From 56e523c6154deafe0d4382234c26b852926681bb Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 8 Jan 2025 14:35:20 -0500 Subject: [PATCH 01/19] chore(main): release 2.47.1-SNAPSHOT (#2867) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- gapic-google-cloud-storage-v2/pom.xml | 4 ++-- google-cloud-storage-bom/pom.xml | 16 ++++++++-------- google-cloud-storage-control/pom.xml | 4 ++-- google-cloud-storage/pom.xml | 4 ++-- grpc-google-cloud-storage-control-v2/pom.xml | 4 ++-- grpc-google-cloud-storage-v2/pom.xml | 4 ++-- pom.xml | 16 ++++++++-------- proto-google-cloud-storage-control-v2/pom.xml | 4 ++-- proto-google-cloud-storage-v2/pom.xml | 4 ++-- samples/snapshot/pom.xml | 6 +++--- storage-shared-benchmarking/pom.xml | 4 ++-- versions.txt | 14 +++++++------- 12 files changed, 42 insertions(+), 42 deletions(-) diff --git a/gapic-google-cloud-storage-v2/pom.xml b/gapic-google-cloud-storage-v2/pom.xml index b400d84187..e2bfd66809 100644 --- a/gapic-google-cloud-storage-v2/pom.xml +++ b/gapic-google-cloud-storage-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc gapic-google-cloud-storage-v2 - 2.47.0 + 2.47.1-SNAPSHOT gapic-google-cloud-storage-v2 GRPC library for gapic-google-cloud-storage-v2 com.google.cloud google-cloud-storage-parent - 2.47.0 + 2.47.1-SNAPSHOT diff --git a/google-cloud-storage-bom/pom.xml b/google-cloud-storage-bom/pom.xml index 588a6b4ab2..7d9cf8a8d0 100644 --- a/google-cloud-storage-bom/pom.xml +++ b/google-cloud-storage-bom/pom.xml @@ -19,7 +19,7 @@ 4.0.0 com.google.cloud google-cloud-storage-bom - 2.47.0 + 2.47.1-SNAPSHOT pom com.google.cloud @@ -69,37 +69,37 @@ com.google.cloud google-cloud-storage - 2.47.0 + 2.47.1-SNAPSHOT com.google.api.grpc gapic-google-cloud-storage-v2 - 2.47.0 + 2.47.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-storage-v2 - 2.47.0 + 2.47.1-SNAPSHOT com.google.api.grpc proto-google-cloud-storage-v2 - 2.47.0 + 2.47.1-SNAPSHOT com.google.cloud google-cloud-storage-control - 2.47.0 + 2.47.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-storage-control-v2 - 2.47.0 + 2.47.1-SNAPSHOT com.google.api.grpc proto-google-cloud-storage-control-v2 - 2.47.0 + 2.47.1-SNAPSHOT diff --git a/google-cloud-storage-control/pom.xml b/google-cloud-storage-control/pom.xml index 8661b49b41..33894ef37b 100644 --- a/google-cloud-storage-control/pom.xml +++ b/google-cloud-storage-control/pom.xml @@ -5,13 +5,13 @@ 4.0.0 com.google.cloud google-cloud-storage-control - 2.47.0 + 2.47.1-SNAPSHOT google-cloud-storage-control GRPC library for google-cloud-storage-control com.google.cloud google-cloud-storage-parent - 2.47.0 + 2.47.1-SNAPSHOT diff --git a/google-cloud-storage/pom.xml b/google-cloud-storage/pom.xml index 4870af6f1a..7a58a7f30b 100644 --- a/google-cloud-storage/pom.xml +++ b/google-cloud-storage/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-storage - 2.47.0 + 2.47.1-SNAPSHOT jar Google Cloud Storage https://github.com/googleapis/java-storage @@ -12,7 +12,7 @@ com.google.cloud google-cloud-storage-parent - 2.47.0 + 2.47.1-SNAPSHOT google-cloud-storage diff --git a/grpc-google-cloud-storage-control-v2/pom.xml b/grpc-google-cloud-storage-control-v2/pom.xml index 85dce53918..c62b10235c 100644 --- a/grpc-google-cloud-storage-control-v2/pom.xml +++ b/grpc-google-cloud-storage-control-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-storage-control-v2 - 2.47.0 + 2.47.1-SNAPSHOT grpc-google-cloud-storage-control-v2 GRPC library for google-cloud-storage com.google.cloud google-cloud-storage-parent - 2.47.0 + 2.47.1-SNAPSHOT diff --git a/grpc-google-cloud-storage-v2/pom.xml b/grpc-google-cloud-storage-v2/pom.xml index 8dd6ffd197..dbea495da0 100644 --- a/grpc-google-cloud-storage-v2/pom.xml +++ b/grpc-google-cloud-storage-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-storage-v2 - 2.47.0 + 2.47.1-SNAPSHOT grpc-google-cloud-storage-v2 GRPC library for grpc-google-cloud-storage-v2 com.google.cloud google-cloud-storage-parent - 2.47.0 + 2.47.1-SNAPSHOT diff --git a/pom.xml b/pom.xml index fa043dcea5..3e71183a23 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-storage-parent pom - 2.47.0 + 2.47.1-SNAPSHOT Storage Parent https://github.com/googleapis/java-storage @@ -123,7 +123,7 @@ com.google.cloud google-cloud-storage - 2.47.0 + 2.47.1-SNAPSHOT com.google.apis @@ -145,32 +145,32 @@ com.google.api.grpc proto-google-cloud-storage-v2 - 2.47.0 + 2.47.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-storage-v2 - 2.47.0 + 2.47.1-SNAPSHOT com.google.api.grpc gapic-google-cloud-storage-v2 - 2.47.0 + 2.47.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-storage-control-v2 - 2.47.0 + 2.47.1-SNAPSHOT com.google.api.grpc proto-google-cloud-storage-control-v2 - 2.47.0 + 2.47.1-SNAPSHOT com.google.cloud google-cloud-storage-control - 2.47.0 + 2.47.1-SNAPSHOT com.google.cloud diff --git a/proto-google-cloud-storage-control-v2/pom.xml b/proto-google-cloud-storage-control-v2/pom.xml index 31a4c5f31b..8a6ef64c65 100644 --- a/proto-google-cloud-storage-control-v2/pom.xml +++ b/proto-google-cloud-storage-control-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-storage-control-v2 - 2.47.0 + 2.47.1-SNAPSHOT proto-google-cloud-storage-control-v2 Proto library for proto-google-cloud-storage-control-v2 com.google.cloud google-cloud-storage-parent - 2.47.0 + 2.47.1-SNAPSHOT diff --git a/proto-google-cloud-storage-v2/pom.xml b/proto-google-cloud-storage-v2/pom.xml index 1eefb465fc..36e9c57f85 100644 --- a/proto-google-cloud-storage-v2/pom.xml +++ b/proto-google-cloud-storage-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-storage-v2 - 2.47.0 + 2.47.1-SNAPSHOT proto-google-cloud-storage-v2 PROTO library for proto-google-cloud-storage-v2 com.google.cloud google-cloud-storage-parent - 2.47.0 + 2.47.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e1784a43a5..848585e941 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,12 +28,12 @@ com.google.cloud google-cloud-storage - 2.47.0 + 2.47.1-SNAPSHOT com.google.cloud google-cloud-storage-control - 2.47.0 + 2.47.1-SNAPSHOT compile @@ -64,7 +64,7 @@ com.google.cloud google-cloud-storage - 2.47.0 + 2.47.1-SNAPSHOT tests test diff --git a/storage-shared-benchmarking/pom.xml b/storage-shared-benchmarking/pom.xml index 1e19157376..1fba56d862 100644 --- a/storage-shared-benchmarking/pom.xml +++ b/storage-shared-benchmarking/pom.xml @@ -10,7 +10,7 @@ com.google.cloud google-cloud-storage-parent - 2.47.0 + 2.47.1-SNAPSHOT @@ -31,7 +31,7 @@ com.google.cloud google-cloud-storage - 2.47.0 + 2.47.1-SNAPSHOT tests diff --git a/versions.txt b/versions.txt index 301dfce75a..b4efcb6869 100644 --- a/versions.txt +++ b/versions.txt @@ -1,10 +1,10 @@ # Format: # module:released-version:current-version -google-cloud-storage:2.47.0:2.47.0 -gapic-google-cloud-storage-v2:2.47.0:2.47.0 -grpc-google-cloud-storage-v2:2.47.0:2.47.0 -proto-google-cloud-storage-v2:2.47.0:2.47.0 -google-cloud-storage-control:2.47.0:2.47.0 -proto-google-cloud-storage-control-v2:2.47.0:2.47.0 -grpc-google-cloud-storage-control-v2:2.47.0:2.47.0 +google-cloud-storage:2.47.0:2.47.1-SNAPSHOT +gapic-google-cloud-storage-v2:2.47.0:2.47.1-SNAPSHOT +grpc-google-cloud-storage-v2:2.47.0:2.47.1-SNAPSHOT +proto-google-cloud-storage-v2:2.47.0:2.47.1-SNAPSHOT +google-cloud-storage-control:2.47.0:2.47.1-SNAPSHOT +proto-google-cloud-storage-control-v2:2.47.0:2.47.1-SNAPSHOT +grpc-google-cloud-storage-control-v2:2.47.0:2.47.1-SNAPSHOT From d9c4bf6c5268d041123cd93500359643893ae968 Mon Sep 17 00:00:00 2001 From: cloud-java-bot <122572305+cloud-java-bot@users.noreply.github.com> Date: Wed, 8 Jan 2025 14:53:16 -0500 Subject: [PATCH 02/19] chore: Update generation configuration at Wed Jan 8 02:23:03 UTC 2025 (#2863) BEGIN_COMMIT_OVERRIDE BEGIN_NESTED_COMMIT chore(storage/v2): Add new preview BidiReadObject API chore(storage/v2): Add new preview appendable Object to BidiWrite API chore(docs): Add IAM information to RPC comments for reference documentation PiperOrigin-RevId: 712942128 Source Link: [googleapis/googleapis@44ad570](https://github.com/googleapis/googleapis/commit/44ad570a9b4055b9b952c3d8fd476be6f95d8b0a) END_NESTED_COMMIT END_COMMIT_OVERRIDE --------- Co-authored-by: BenWhitehead --- .../com/google/storage/v2/StorageClient.java | 388 ++- .../google/storage/v2/StorageSettings.java | 12 + .../storage/v2/stub/GrpcStorageStub.java | 42 + .../google/storage/v2/stub/StorageStub.java | 7 + .../storage/v2/stub/StorageStubSettings.java | 21 + .../com.google.storage.v2/reflect-config.json | 252 ++ .../com/google/storage/v2/gapic_metadata.json | 3 + .../google/storage/v2/MockStorageImpl.java | 37 + .../google/storage/v2/StorageClientTest.java | 64 +- generation_config.yaml | 2 +- .../clirr-ignored-differences.xml | 5 + .../com/google/storage/v2/StorageGrpc.java | 424 ++- .../google/storage/v2/AppendObjectSpec.java | 1700 +++++++++++ .../storage/v2/AppendObjectSpecOrBuilder.java | 225 ++ .../com/google/storage/v2/BidiReadHandle.java | 539 ++++ .../storage/v2/BidiReadHandleOrBuilder.java | 39 + .../storage/v2/BidiReadObjectError.java | 941 ++++++ .../v2/BidiReadObjectErrorOrBuilder.java | 78 + .../v2/BidiReadObjectRedirectedError.java | 953 ++++++ ...idiReadObjectRedirectedErrorOrBuilder.java | 101 + .../storage/v2/BidiReadObjectRequest.java | 1341 +++++++++ .../v2/BidiReadObjectRequestOrBuilder.java | 140 + .../storage/v2/BidiReadObjectResponse.java | 1665 +++++++++++ .../v2/BidiReadObjectResponseOrBuilder.java | 190 ++ .../google/storage/v2/BidiReadObjectSpec.java | 2648 +++++++++++++++++ .../v2/BidiReadObjectSpecOrBuilder.java | 387 +++ .../google/storage/v2/BidiWriteHandle.java | 540 ++++ .../storage/v2/BidiWriteHandleOrBuilder.java | 39 + .../v2/BidiWriteObjectRedirectedError.java | 1090 +++++++ ...diWriteObjectRedirectedErrorOrBuilder.java | 129 + .../storage/v2/BidiWriteObjectRequest.java | 364 ++- .../v2/BidiWriteObjectRequestOrBuilder.java | 35 + .../storage/v2/BidiWriteObjectResponse.java | 306 +- .../v2/BidiWriteObjectResponseOrBuilder.java | 41 + .../google/storage/v2/ObjectRangeData.java | 1125 +++++++ .../storage/v2/ObjectRangeDataOrBuilder.java | 121 + .../java/com/google/storage/v2/ReadRange.java | 787 +++++ .../com/google/storage/v2/ReadRangeError.java | 797 +++++ .../storage/v2/ReadRangeErrorOrBuilder.java | 74 + .../google/storage/v2/ReadRangeOrBuilder.java | 83 + .../v2/StartResumableWriteRequest.java | 168 +- .../StartResumableWriteRequestOrBuilder.java | 42 +- .../v2/StartResumableWriteResponse.java | 49 +- .../StartResumableWriteResponseOrBuilder.java | 14 +- .../com/google/storage/v2/StorageProto.java | 1304 ++++---- .../google/storage/v2/WriteObjectSpec.java | 135 + .../storage/v2/WriteObjectSpecOrBuilder.java | 27 + .../proto/google/storage/v2/storage.proto | 387 ++- 48 files changed, 18981 insertions(+), 880 deletions(-) create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/AppendObjectSpec.java create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/AppendObjectSpecOrBuilder.java create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadHandle.java create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadHandleOrBuilder.java create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectError.java create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectErrorOrBuilder.java create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectRedirectedError.java create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectRedirectedErrorOrBuilder.java create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectRequest.java create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectRequestOrBuilder.java create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectResponse.java create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectResponseOrBuilder.java create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectSpec.java create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectSpecOrBuilder.java create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteHandle.java create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteHandleOrBuilder.java create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectRedirectedError.java create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectRedirectedErrorOrBuilder.java create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectRangeData.java create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectRangeDataOrBuilder.java create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadRange.java create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadRangeError.java create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadRangeErrorOrBuilder.java create mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadRangeOrBuilder.java diff --git a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageClient.java b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageClient.java index ff55df4259..c03a4e70ec 100644 --- a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageClient.java +++ b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageClient.java @@ -273,8 +273,10 @@ * * *

DeleteObject - *

Deletes an object and its metadata. - *

Deletions are normally permanent when versioning is disabled or whenever the generation parameter is used. However, if soft delete is enabled for the bucket, deleted objects can be restored using RestoreObject until the soft delete retention period has passed. + *

Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used, or if [soft delete](https://cloud.google.com/storage/docs/soft-delete) is not enabled for the bucket. When this API is used to delete an object from a bucket that has soft delete policy enabled, the object becomes soft deleted, and the `softDeleteTime` and `hardDeleteTime` properties are set on the object. This API cannot be used to permanently delete soft-deleted objects. Soft-deleted objects are permanently deleted according to their `hardDeleteTime`. + *

You can use the [`RestoreObject`][google.storage.v2.Storage.RestoreObject] API to restore soft-deleted objects until the soft delete retention period has passed. + *

**IAM Permissions**: + *

Requires `storage.objects.delete` [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on the bucket. * *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    @@ -334,7 +336,9 @@ * * *

    GetObject - *

    Retrieves an object's metadata. + *

    Retrieves object metadata. + *

    **IAM Permissions**: + *

    Requires `storage.objects.get` [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on the bucket. To return object ACLs, the authenticated user must also have the `storage.objects.getIamPolicy` permission. * *

    Request object method variants only take one parameter, a request object, which must be constructed before the call.

    *
      @@ -355,7 +359,9 @@ * * *

      ReadObject - *

      Reads an object's data. + *

      Retrieves object data. + *

      **IAM Permissions**: + *

      Requires `storage.objects.get` [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on the bucket. * *

      Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

      *
        @@ -364,6 +370,21 @@ * * * + *

        BidiReadObject + *

        Reads an object's data. + *

        This is a bi-directional API with the added support for reading multiple ranges within one stream both within and across multiple messages. If the server encountered an error for any of the inputs, the stream will be closed with the relevant error code. Because the API allows for multiple outstanding requests, when the stream is closed the error response will contain a BidiReadObjectRangesError proto in the error extension describing the error for each outstanding read_id. + *

        **IAM Permissions**: + *

        Requires `storage.objects.get` + *

        [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on the bucket. + *

        This API is currently in preview and is not yet available for general use. + * + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • bidiReadObjectCallable() + *

        + * + * + * *

        UpdateObject *

        Updates an object's metadata. Equivalent to JSON API's storage.objects.patch. * @@ -387,8 +408,10 @@ *

        An object can be written either in a single message stream or in a resumable sequence of message streams. To write using a single stream, the client should include in the first message of the stream an `WriteObjectSpec` describing the destination bucket, object, and any preconditions. Additionally, the final message must set 'finish_write' to true, or else it is an error. *

        For a resumable write, the client should instead call `StartResumableWrite()`, populating a `WriteObjectSpec` into that request. They should then attach the returned `upload_id` to the first message of each following call to `WriteObject`. If the stream is closed before finishing the upload (either explicitly by the client or due to a network error or an error response from the server), the client should do as follows: - Check the result Status of the stream, to determine if writing can be resumed on this stream or must be restarted from scratch (by calling `StartResumableWrite()`). The resumable errors are DEADLINE_EXCEEDED, INTERNAL, and UNAVAILABLE. For each case, the client should use binary exponential backoff before retrying. Additionally, writes can be resumed after RESOURCE_EXHAUSTED errors, but only after taking appropriate measures, which may include reducing aggregate send rate across clients and/or requesting a quota increase for your project. - If the call to `WriteObject` returns `ABORTED`, that indicates concurrent attempts to update the resumable write, caused either by multiple racing clients or by a single client where the previous request was timed out on the client side but nonetheless reached the server. In this case the client should take steps to prevent further concurrent writes (e.g., increase the timeouts, stop using more than one process to perform the upload, etc.), and then should follow the steps below for resuming the upload. - For resumable errors, the client should call `QueryWriteStatus()` and then continue writing from the returned `persisted_size`. This may be less than the amount of data the client previously sent. Note also that it is acceptable to send data starting at an offset earlier than the returned `persisted_size`; in this case, the service will skip data at offsets that were already persisted (without checking that it matches the previously written data), and write only the data starting from the persisted offset. Even though the data isn't written, it may still incur a performance cost over resuming at the correct write offset. This behavior can make client-side handling simpler in some cases. - Clients must only send data that is a multiple of 256 KiB per message, unless the object is being finished with `finish_write` set to `true`. *

        The service will not view the object as complete until the client has sent a `WriteObjectRequest` with `finish_write` set to `true`. Sending any requests on a stream after sending a request with `finish_write` set to `true` will cause an error. The client **should** check the response it receives to determine how much data the service was able to commit and whether the service views the object as complete. - *

        Attempting to resume an already finalized object will result in an OK status, with a WriteObjectResponse containing the finalized object's metadata. - *

        Alternatively, the BidiWriteObject operation may be used to write an object with controls over flushing and the ability to fetch the ability to determine the current persisted size. + *

        Attempting to resume an already finalized object will result in an OK status, with a `WriteObjectResponse` containing the finalized object's metadata. + *

        Alternatively, the BidiWriteObject operation may be used to write an object with controls over flushing and the ability to fetch the ability to determine the current persisted size. + *

        **IAM Permissions**: + *

        Requires `storage.objects.create` [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on the bucket. * *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        *
          @@ -410,7 +433,9 @@ * * *

          ListObjects - *

          Retrieves a list of objects matching the criteria. + *

          Retrieves a list of objects matching the criteria. + *

          **IAM Permissions**: + *

          The authenticated user requires `storage.objects.list` [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) to use this method. To return object ACLs, the authenticated user must also have the `storage.objects.getIamPolicy` permission. * *

          Request object method variants only take one parameter, a request object, which must be constructed before the call.

          *
            @@ -444,7 +469,9 @@ * * *

            StartResumableWrite - *

            Starts a resumable write. How long the write operation remains valid, and what happens when the write operation becomes invalid, are service-dependent. + *

            Starts a resumable write operation. This method is part of the [Resumable upload](https://cloud.google.com/storage/docs/resumable-uploads) feature. This allows you to upload large objects in multiple chunks, which is more resilient to network interruptions than a single upload. The validity duration of the write operation, and the consequences of it becoming invalid, are service-dependent. + *

            **IAM Permissions**: + *

            Requires `storage.objects.create` [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on the bucket. * *

            Request object method variants only take one parameter, a request object, which must be constructed before the call.

            *
              @@ -458,9 +485,9 @@ * * *

              QueryWriteStatus - *

              Determines the `persisted_size` for an object that is being written, which can then be used as the `write_offset` for the next `Write()` call. - *

              If the object does not exist (i.e., the object has been deleted, or the first `Write()` has not yet reached the service), this method returns the error `NOT_FOUND`. - *

              The client **may** call `QueryWriteStatus()` at any time to determine how much data has been processed for this object. This is useful if the client is buffering data and needs to know which data can be safely evicted. For any sequence of `QueryWriteStatus()` calls for a given object name, the sequence of returned `persisted_size` values will be non-decreasing. + *

              Determines the `persisted_size` of an object that is being written. This method is part of the [resumable upload](https://cloud.google.com/storage/docs/resumable-uploads) feature. The returned value is the size of the object that has been persisted so far. The value can be used as the `write_offset` for the next `Write()` call. + *

              If the object does not exist, meaning if it was deleted, or the first `Write()` has not yet reached the service, this method returns the error `NOT_FOUND`. + *

              This method is useful for clients that buffer data and need to know which data can be safely evicted. The client can call `QueryWriteStatus()` at any time to determine how much data has been logged for this object. For any sequence of `QueryWriteStatus()` calls for a given object name, the sequence of returned `persisted_size` values are non-decreasing. * *

              Request object method variants only take one parameter, a request object, which must be constructed before the call.

              *
                @@ -1824,11 +1851,21 @@ public final UnaryCallable composeObjectCallable() // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes an object and its metadata. + * Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for + * the bucket, or if the generation parameter is used, or if [soft + * delete](https://cloud.google.com/storage/docs/soft-delete) is not enabled for the bucket. When + * this API is used to delete an object from a bucket that has soft delete policy enabled, the + * object becomes soft deleted, and the `softDeleteTime` and `hardDeleteTime` properties are set + * on the object. This API cannot be used to permanently delete soft-deleted objects. Soft-deleted + * objects are permanently deleted according to their `hardDeleteTime`. + * + *

                You can use the [`RestoreObject`][google.storage.v2.Storage.RestoreObject] API to restore + * soft-deleted objects until the soft delete retention period has passed. * - *

                Deletions are normally permanent when versioning is disabled or whenever the generation - * parameter is used. However, if soft delete is enabled for the bucket, deleted objects can be - * restored using RestoreObject until the soft delete retention period has passed. + *

                **IAM Permissions**: + * + *

                Requires `storage.objects.delete` [IAM + * permission](https://cloud.google.com/iam/docs/overview#permissions) on the bucket. * *

                Sample code: * @@ -1861,11 +1898,21 @@ public final void deleteObject(BucketName bucket, String object) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes an object and its metadata. + * Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for + * the bucket, or if the generation parameter is used, or if [soft + * delete](https://cloud.google.com/storage/docs/soft-delete) is not enabled for the bucket. When + * this API is used to delete an object from a bucket that has soft delete policy enabled, the + * object becomes soft deleted, and the `softDeleteTime` and `hardDeleteTime` properties are set + * on the object. This API cannot be used to permanently delete soft-deleted objects. Soft-deleted + * objects are permanently deleted according to their `hardDeleteTime`. + * + *

                You can use the [`RestoreObject`][google.storage.v2.Storage.RestoreObject] API to restore + * soft-deleted objects until the soft delete retention period has passed. * - *

                Deletions are normally permanent when versioning is disabled or whenever the generation - * parameter is used. However, if soft delete is enabled for the bucket, deleted objects can be - * restored using RestoreObject until the soft delete retention period has passed. + *

                **IAM Permissions**: + * + *

                Requires `storage.objects.delete` [IAM + * permission](https://cloud.google.com/iam/docs/overview#permissions) on the bucket. * *

                Sample code: * @@ -1895,11 +1942,21 @@ public final void deleteObject(String bucket, String object) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes an object and its metadata. + * Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for + * the bucket, or if the generation parameter is used, or if [soft + * delete](https://cloud.google.com/storage/docs/soft-delete) is not enabled for the bucket. When + * this API is used to delete an object from a bucket that has soft delete policy enabled, the + * object becomes soft deleted, and the `softDeleteTime` and `hardDeleteTime` properties are set + * on the object. This API cannot be used to permanently delete soft-deleted objects. Soft-deleted + * objects are permanently deleted according to their `hardDeleteTime`. + * + *

                You can use the [`RestoreObject`][google.storage.v2.Storage.RestoreObject] API to restore + * soft-deleted objects until the soft delete retention period has passed. + * + *

                **IAM Permissions**: * - *

                Deletions are normally permanent when versioning is disabled or whenever the generation - * parameter is used. However, if soft delete is enabled for the bucket, deleted objects can be - * restored using RestoreObject until the soft delete retention period has passed. + *

                Requires `storage.objects.delete` [IAM + * permission](https://cloud.google.com/iam/docs/overview#permissions) on the bucket. * *

                Sample code: * @@ -1936,11 +1993,21 @@ public final void deleteObject(BucketName bucket, String object, long generation // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes an object and its metadata. + * Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for + * the bucket, or if the generation parameter is used, or if [soft + * delete](https://cloud.google.com/storage/docs/soft-delete) is not enabled for the bucket. When + * this API is used to delete an object from a bucket that has soft delete policy enabled, the + * object becomes soft deleted, and the `softDeleteTime` and `hardDeleteTime` properties are set + * on the object. This API cannot be used to permanently delete soft-deleted objects. Soft-deleted + * objects are permanently deleted according to their `hardDeleteTime`. + * + *

                You can use the [`RestoreObject`][google.storage.v2.Storage.RestoreObject] API to restore + * soft-deleted objects until the soft delete retention period has passed. + * + *

                **IAM Permissions**: * - *

                Deletions are normally permanent when versioning is disabled or whenever the generation - * parameter is used. However, if soft delete is enabled for the bucket, deleted objects can be - * restored using RestoreObject until the soft delete retention period has passed. + *

                Requires `storage.objects.delete` [IAM + * permission](https://cloud.google.com/iam/docs/overview#permissions) on the bucket. * *

                Sample code: * @@ -1977,11 +2044,21 @@ public final void deleteObject(String bucket, String object, long generation) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes an object and its metadata. + * Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for + * the bucket, or if the generation parameter is used, or if [soft + * delete](https://cloud.google.com/storage/docs/soft-delete) is not enabled for the bucket. When + * this API is used to delete an object from a bucket that has soft delete policy enabled, the + * object becomes soft deleted, and the `softDeleteTime` and `hardDeleteTime` properties are set + * on the object. This API cannot be used to permanently delete soft-deleted objects. Soft-deleted + * objects are permanently deleted according to their `hardDeleteTime`. * - *

                Deletions are normally permanent when versioning is disabled or whenever the generation - * parameter is used. However, if soft delete is enabled for the bucket, deleted objects can be - * restored using RestoreObject until the soft delete retention period has passed. + *

                You can use the [`RestoreObject`][google.storage.v2.Storage.RestoreObject] API to restore + * soft-deleted objects until the soft delete retention period has passed. + * + *

                **IAM Permissions**: + * + *

                Requires `storage.objects.delete` [IAM + * permission](https://cloud.google.com/iam/docs/overview#permissions) on the bucket. * *

                Sample code: * @@ -2016,11 +2093,21 @@ public final void deleteObject(DeleteObjectRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes an object and its metadata. + * Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for + * the bucket, or if the generation parameter is used, or if [soft + * delete](https://cloud.google.com/storage/docs/soft-delete) is not enabled for the bucket. When + * this API is used to delete an object from a bucket that has soft delete policy enabled, the + * object becomes soft deleted, and the `softDeleteTime` and `hardDeleteTime` properties are set + * on the object. This API cannot be used to permanently delete soft-deleted objects. Soft-deleted + * objects are permanently deleted according to their `hardDeleteTime`. + * + *

                You can use the [`RestoreObject`][google.storage.v2.Storage.RestoreObject] API to restore + * soft-deleted objects until the soft delete retention period has passed. * - *

                Deletions are normally permanent when versioning is disabled or whenever the generation - * parameter is used. However, if soft delete is enabled for the bucket, deleted objects can be - * restored using RestoreObject until the soft delete retention period has passed. + *

                **IAM Permissions**: + * + *

                Requires `storage.objects.delete` [IAM + * permission](https://cloud.google.com/iam/docs/overview#permissions) on the bucket. * *

                Sample code: * @@ -2294,7 +2381,14 @@ public final CancelResumableWriteResponse cancelResumableWrite( // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Retrieves an object's metadata. + * Retrieves object metadata. + * + *

                **IAM Permissions**: + * + *

                Requires `storage.objects.get` [IAM + * permission](https://cloud.google.com/iam/docs/overview#permissions) on the bucket. To return + * object ACLs, the authenticated user must also have the `storage.objects.getIamPolicy` + * permission. * *

                Sample code: * @@ -2326,7 +2420,14 @@ public final Object getObject(BucketName bucket, String object) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Retrieves an object's metadata. + * Retrieves object metadata. + * + *

                **IAM Permissions**: + * + *

                Requires `storage.objects.get` [IAM + * permission](https://cloud.google.com/iam/docs/overview#permissions) on the bucket. To return + * object ACLs, the authenticated user must also have the `storage.objects.getIamPolicy` + * permission. * *

                Sample code: * @@ -2355,7 +2456,14 @@ public final Object getObject(String bucket, String object) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Retrieves an object's metadata. + * Retrieves object metadata. + * + *

                **IAM Permissions**: + * + *

                Requires `storage.objects.get` [IAM + * permission](https://cloud.google.com/iam/docs/overview#permissions) on the bucket. To return + * object ACLs, the authenticated user must also have the `storage.objects.getIamPolicy` + * permission. * *

                Sample code: * @@ -2391,7 +2499,14 @@ public final Object getObject(BucketName bucket, String object, long generation) // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Retrieves an object's metadata. + * Retrieves object metadata. + * + *

                **IAM Permissions**: + * + *

                Requires `storage.objects.get` [IAM + * permission](https://cloud.google.com/iam/docs/overview#permissions) on the bucket. To return + * object ACLs, the authenticated user must also have the `storage.objects.getIamPolicy` + * permission. * *

                Sample code: * @@ -2427,7 +2542,14 @@ public final Object getObject(String bucket, String object, long generation) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Retrieves an object's metadata. + * Retrieves object metadata. + * + *

                **IAM Permissions**: + * + *

                Requires `storage.objects.get` [IAM + * permission](https://cloud.google.com/iam/docs/overview#permissions) on the bucket. To return + * object ACLs, the authenticated user must also have the `storage.objects.getIamPolicy` + * permission. * *

                Sample code: * @@ -2465,7 +2587,14 @@ public final Object getObject(GetObjectRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Retrieves an object's metadata. + * Retrieves object metadata. + * + *

                **IAM Permissions**: + * + *

                Requires `storage.objects.get` [IAM + * permission](https://cloud.google.com/iam/docs/overview#permissions) on the bucket. To return + * object ACLs, the authenticated user must also have the `storage.objects.getIamPolicy` + * permission. * *

                Sample code: * @@ -2502,7 +2631,12 @@ public final UnaryCallable getObjectCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Reads an object's data. + * Retrieves object data. + * + *

                **IAM Permissions**: + * + *

                Requires `storage.objects.get` [IAM + * permission](https://cloud.google.com/iam/docs/overview#permissions) on the bucket. * *

                Sample code: * @@ -2538,6 +2672,53 @@ public final ServerStreamingCallable read return stub.readObjectCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reads an object's data. + * + *

                This is a bi-directional API with the added support for reading multiple ranges within one + * stream both within and across multiple messages. If the server encountered an error for any of + * the inputs, the stream will be closed with the relevant error code. Because the API allows for + * multiple outstanding requests, when the stream is closed the error response will contain a + * BidiReadObjectRangesError proto in the error extension describing the error for each + * outstanding read_id. + * + *

                **IAM Permissions**: + * + *

                Requires `storage.objects.get` + * + *

                [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on the bucket. + * + *

                This API is currently in preview and is not yet available for general use. + * + *

                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 (StorageClient storageClient = StorageClient.create()) {
                +   *   BidiStream bidiStream =
                +   *       storageClient.bidiReadObjectCallable().call();
                +   *   BidiReadObjectRequest request =
                +   *       BidiReadObjectRequest.newBuilder()
                +   *           .setReadObjectSpec(BidiReadObjectSpec.newBuilder().build())
                +   *           .addAllReadRanges(new ArrayList())
                +   *           .build();
                +   *   bidiStream.send(request);
                +   *   for (BidiReadObjectResponse response : bidiStream) {
                +   *     // Do something when a response is received.
                +   *   }
                +   * }
                +   * }
                + */ + public final BidiStreamingCallable + bidiReadObjectCallable() { + return stub.bidiReadObjectCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates an object's metadata. Equivalent to JSON API's storage.objects.patch. @@ -2688,11 +2869,16 @@ public final UnaryCallable updateObjectCallable() { * service was able to commit and whether the service views the object as complete. * *

                Attempting to resume an already finalized object will result in an OK status, with a - * WriteObjectResponse containing the finalized object's metadata. + * `WriteObjectResponse` containing the finalized object's metadata. * *

                Alternatively, the BidiWriteObject operation may be used to write an object with controls * over flushing and the ability to fetch the ability to determine the current persisted size. * + *

                **IAM Permissions**: + * + *

                Requires `storage.objects.create` [IAM + * permission](https://cloud.google.com/iam/docs/overview#permissions) on the bucket. + * *

                Sample code: * *

                {@code
                @@ -2790,6 +2976,13 @@ public final UnaryCallable updateObjectCallable() {
                   /**
                    * Retrieves a list of objects matching the criteria.
                    *
                +   * 

                **IAM Permissions**: + * + *

                The authenticated user requires `storage.objects.list` [IAM + * permission](https://cloud.google.com/iam/docs/overview#permissions) to use this method. To + * return object ACLs, the authenticated user must also have the `storage.objects.getIamPolicy` + * permission. + * *

                Sample code: * *

                {@code
                @@ -2821,6 +3014,13 @@ public final ListObjectsPagedResponse listObjects(BucketName parent) {
                   /**
                    * Retrieves a list of objects matching the criteria.
                    *
                +   * 

                **IAM Permissions**: + * + *

                The authenticated user requires `storage.objects.list` [IAM + * permission](https://cloud.google.com/iam/docs/overview#permissions) to use this method. To + * return object ACLs, the authenticated user must also have the `storage.objects.getIamPolicy` + * permission. + * *

                Sample code: * *

                {@code
                @@ -2849,6 +3049,13 @@ public final ListObjectsPagedResponse listObjects(String parent) {
                   /**
                    * Retrieves a list of objects matching the criteria.
                    *
                +   * 

                **IAM Permissions**: + * + *

                The authenticated user requires `storage.objects.list` [IAM + * permission](https://cloud.google.com/iam/docs/overview#permissions) to use this method. To + * return object ACLs, the authenticated user must also have the `storage.objects.getIamPolicy` + * permission. + * *

                Sample code: * *

                {@code
                @@ -2891,6 +3098,13 @@ public final ListObjectsPagedResponse listObjects(ListObjectsRequest request) {
                   /**
                    * Retrieves a list of objects matching the criteria.
                    *
                +   * 

                **IAM Permissions**: + * + *

                The authenticated user requires `storage.objects.list` [IAM + * permission](https://cloud.google.com/iam/docs/overview#permissions) to use this method. To + * return object ACLs, the authenticated user must also have the `storage.objects.getIamPolicy` + * permission. + * *

                Sample code: * *

                {@code
                @@ -2933,6 +3147,13 @@ public final ListObjectsPagedResponse listObjects(ListObjectsRequest request) {
                   /**
                    * Retrieves a list of objects matching the criteria.
                    *
                +   * 

                **IAM Permissions**: + * + *

                The authenticated user requires `storage.objects.list` [IAM + * permission](https://cloud.google.com/iam/docs/overview#permissions) to use this method. To + * return object ACLs, the authenticated user must also have the `storage.objects.getIamPolicy` + * permission. + * *

                Sample code: * *

                {@code
                @@ -3082,8 +3303,16 @@ public final UnaryCallable rewriteObjectC
                 
                   // AUTO-GENERATED DOCUMENTATION AND METHOD.
                   /**
                -   * Starts a resumable write. How long the write operation remains valid, and what happens when the
                -   * write operation becomes invalid, are service-dependent.
                +   * Starts a resumable write operation. This method is part of the [Resumable
                +   * upload](https://cloud.google.com/storage/docs/resumable-uploads) feature. This allows you to
                +   * upload large objects in multiple chunks, which is more resilient to network interruptions than
                +   * a single upload. The validity duration of the write operation, and the consequences of it
                +   * becoming invalid, are service-dependent.
                +   *
                +   * 

                **IAM Permissions**: + * + *

                Requires `storage.objects.create` [IAM + * permission](https://cloud.google.com/iam/docs/overview#permissions) on the bucket. * *

                Sample code: * @@ -3113,8 +3342,16 @@ public final StartResumableWriteResponse startResumableWrite(StartResumableWrite // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Starts a resumable write. How long the write operation remains valid, and what happens when the - * write operation becomes invalid, are service-dependent. + * Starts a resumable write operation. This method is part of the [Resumable + * upload](https://cloud.google.com/storage/docs/resumable-uploads) feature. This allows you to + * upload large objects in multiple chunks, which is more resilient to network interruptions than + * a single upload. The validity duration of the write operation, and the consequences of it + * becoming invalid, are service-dependent. + * + *

                **IAM Permissions**: + * + *

                Requires `storage.objects.create` [IAM + * permission](https://cloud.google.com/iam/docs/overview#permissions) on the bucket. * *

                Sample code: * @@ -3145,17 +3382,18 @@ public final StartResumableWriteResponse startResumableWrite(StartResumableWrite // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Determines the `persisted_size` for an object that is being written, which can then be used as - * the `write_offset` for the next `Write()` call. + * Determines the `persisted_size` of an object that is being written. This method is part of the + * [resumable upload](https://cloud.google.com/storage/docs/resumable-uploads) feature. The + * returned value is the size of the object that has been persisted so far. The value can be used + * as the `write_offset` for the next `Write()` call. * - *

                If the object does not exist (i.e., the object has been deleted, or the first `Write()` has - * not yet reached the service), this method returns the error `NOT_FOUND`. + *

                If the object does not exist, meaning if it was deleted, or the first `Write()` has not yet + * reached the service, this method returns the error `NOT_FOUND`. * - *

                The client **may** call `QueryWriteStatus()` at any time to determine how - * much data has been processed for this object. This is useful if the client is buffering data - * and needs to know which data can be safely evicted. For any sequence of `QueryWriteStatus()` - * calls for a given object name, the sequence of returned `persisted_size` values will be - * non-decreasing. + *

                This method is useful for clients that buffer data and need to know which data can be safely + * evicted. The client can call `QueryWriteStatus()` at any time to determine how much data has + * been logged for this object. For any sequence of `QueryWriteStatus()` calls for a given object + * name, the sequence of returned `persisted_size` values are non-decreasing. * *

                Sample code: * @@ -3183,17 +3421,18 @@ public final QueryWriteStatusResponse queryWriteStatus(String uploadId) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Determines the `persisted_size` for an object that is being written, which can then be used as - * the `write_offset` for the next `Write()` call. + * Determines the `persisted_size` of an object that is being written. This method is part of the + * [resumable upload](https://cloud.google.com/storage/docs/resumable-uploads) feature. The + * returned value is the size of the object that has been persisted so far. The value can be used + * as the `write_offset` for the next `Write()` call. * - *

                If the object does not exist (i.e., the object has been deleted, or the first `Write()` has - * not yet reached the service), this method returns the error `NOT_FOUND`. + *

                If the object does not exist, meaning if it was deleted, or the first `Write()` has not yet + * reached the service, this method returns the error `NOT_FOUND`. * - *

                The client **may** call `QueryWriteStatus()` at any time to determine how - * much data has been processed for this object. This is useful if the client is buffering data - * and needs to know which data can be safely evicted. For any sequence of `QueryWriteStatus()` - * calls for a given object name, the sequence of returned `persisted_size` values will be - * non-decreasing. + *

                This method is useful for clients that buffer data and need to know which data can be safely + * evicted. The client can call `QueryWriteStatus()` at any time to determine how much data has + * been logged for this object. For any sequence of `QueryWriteStatus()` calls for a given object + * name, the sequence of returned `persisted_size` values are non-decreasing. * *

                Sample code: * @@ -3222,17 +3461,18 @@ public final QueryWriteStatusResponse queryWriteStatus(QueryWriteStatusRequest r // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Determines the `persisted_size` for an object that is being written, which can then be used as - * the `write_offset` for the next `Write()` call. + * Determines the `persisted_size` of an object that is being written. This method is part of the + * [resumable upload](https://cloud.google.com/storage/docs/resumable-uploads) feature. The + * returned value is the size of the object that has been persisted so far. The value can be used + * as the `write_offset` for the next `Write()` call. * - *

                If the object does not exist (i.e., the object has been deleted, or the first `Write()` has - * not yet reached the service), this method returns the error `NOT_FOUND`. + *

                If the object does not exist, meaning if it was deleted, or the first `Write()` has not yet + * reached the service, this method returns the error `NOT_FOUND`. * - *

                The client **may** call `QueryWriteStatus()` at any time to determine how - * much data has been processed for this object. This is useful if the client is buffering data - * and needs to know which data can be safely evicted. For any sequence of `QueryWriteStatus()` - * calls for a given object name, the sequence of returned `persisted_size` values will be - * non-decreasing. + *

                This method is useful for clients that buffer data and need to know which data can be safely + * evicted. The client can call `QueryWriteStatus()` at any time to determine how much data has + * been logged for this object. For any sequence of `QueryWriteStatus()` calls for a given object + * name, the sequence of returned `persisted_size` values are non-decreasing. * *

                Sample code: * diff --git a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageSettings.java b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageSettings.java index c8607e700c..30131d23e4 100644 --- a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageSettings.java +++ b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageSettings.java @@ -173,6 +173,12 @@ public ServerStreamingCallSettings readOb return ((StorageStubSettings) getStubSettings()).readObjectSettings(); } + /** Returns the object with the settings used for calls to bidiReadObject. */ + public StreamingCallSettings + bidiReadObjectSettings() { + return ((StorageStubSettings) getStubSettings()).bidiReadObjectSettings(); + } + /** Returns the object with the settings used for calls to updateObject. */ public UnaryCallSettings updateObjectSettings() { return ((StorageStubSettings) getStubSettings()).updateObjectSettings(); @@ -393,6 +399,12 @@ public UnaryCallSettings.Builder getObjectSettings() { return getStubSettingsBuilder().readObjectSettings(); } + /** Returns the builder for the settings used for calls to bidiReadObject. */ + public StreamingCallSettings.Builder + bidiReadObjectSettings() { + return getStubSettingsBuilder().bidiReadObjectSettings(); + } + /** Returns the builder for the settings used for calls to updateObject. */ public UnaryCallSettings.Builder updateObjectSettings() { return getStubSettingsBuilder().updateObjectSettings(); diff --git a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageStub.java b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageStub.java index 03c120c532..3b9340a440 100644 --- a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageStub.java +++ b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageStub.java @@ -37,6 +37,8 @@ import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; +import com.google.storage.v2.BidiReadObjectRequest; +import com.google.storage.v2.BidiReadObjectResponse; import com.google.storage.v2.BidiWriteObjectRequest; import com.google.storage.v2.BidiWriteObjectResponse; import com.google.storage.v2.Bucket; @@ -217,6 +219,17 @@ public class GrpcStorageStub extends StorageStub { .setResponseMarshaller(ProtoUtils.marshaller(ReadObjectResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor + bidiReadObjectMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName("google.storage.v2.Storage/BidiReadObject") + .setRequestMarshaller( + ProtoUtils.marshaller(BidiReadObjectRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(BidiReadObjectResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor updateObjectMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -316,6 +329,8 @@ public class GrpcStorageStub extends StorageStub { cancelResumableWriteCallable; private final UnaryCallable getObjectCallable; private final ServerStreamingCallable readObjectCallable; + private final BidiStreamingCallable + bidiReadObjectCallable; private final UnaryCallable updateObjectCallable; private final ClientStreamingCallable writeObjectCallable; @@ -369,6 +384,8 @@ public class GrpcStorageStub extends StorageStub { private static final PathTemplate GET_OBJECT_0_PATH_TEMPLATE = PathTemplate.create("{bucket=**}"); private static final PathTemplate READ_OBJECT_0_PATH_TEMPLATE = PathTemplate.create("{bucket=**}"); + private static final PathTemplate BIDI_READ_OBJECT_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=**}"); private static final PathTemplate UPDATE_OBJECT_0_PATH_TEMPLATE = PathTemplate.create("{bucket=**}"); private static final PathTemplate LIST_OBJECTS_0_PATH_TEMPLATE = @@ -593,6 +610,22 @@ protected GrpcStorageStub( return builder.build(); }) .build(); + GrpcCallSettings + bidiReadObjectTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(bidiReadObjectMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + if (request.getReadObjectSpec() != null) { + builder.add( + request.getReadObjectSpec().getBucket(), + "bucket", + BIDI_READ_OBJECT_0_PATH_TEMPLATE); + } + return builder.build(); + }) + .build(); GrpcCallSettings updateObjectTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateObjectMethodDescriptor) @@ -732,6 +765,9 @@ protected GrpcStorageStub( this.readObjectCallable = callableFactory.createServerStreamingCallable( readObjectTransportSettings, settings.readObjectSettings(), clientContext); + this.bidiReadObjectCallable = + callableFactory.createBidiStreamingCallable( + bidiReadObjectTransportSettings, settings.bidiReadObjectSettings(), clientContext); this.updateObjectCallable = callableFactory.createUnaryCallable( updateObjectTransportSettings, settings.updateObjectSettings(), clientContext); @@ -853,6 +889,12 @@ public ServerStreamingCallable readObject return readObjectCallable; } + @Override + public BidiStreamingCallable + bidiReadObjectCallable() { + return bidiReadObjectCallable; + } + @Override public UnaryCallable updateObjectCallable() { return updateObjectCallable; diff --git a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStub.java b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStub.java index fd1f4911c7..4b0aa6d73f 100644 --- a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStub.java +++ b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStub.java @@ -30,6 +30,8 @@ import com.google.iam.v1.TestIamPermissionsRequest; import com.google.iam.v1.TestIamPermissionsResponse; import com.google.protobuf.Empty; +import com.google.storage.v2.BidiReadObjectRequest; +import com.google.storage.v2.BidiReadObjectResponse; import com.google.storage.v2.BidiWriteObjectRequest; import com.google.storage.v2.BidiWriteObjectResponse; import com.google.storage.v2.Bucket; @@ -139,6 +141,11 @@ public ServerStreamingCallable readObject throw new UnsupportedOperationException("Not implemented: readObjectCallable()"); } + public BidiStreamingCallable + bidiReadObjectCallable() { + throw new UnsupportedOperationException("Not implemented: bidiReadObjectCallable()"); + } + public UnaryCallable updateObjectCallable() { throw new UnsupportedOperationException("Not implemented: updateObjectCallable()"); } 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 aae7378e5e..5401277c77 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 @@ -53,6 +53,8 @@ import com.google.iam.v1.TestIamPermissionsRequest; import com.google.iam.v1.TestIamPermissionsResponse; import com.google.protobuf.Empty; +import com.google.storage.v2.BidiReadObjectRequest; +import com.google.storage.v2.BidiReadObjectResponse; import com.google.storage.v2.BidiWriteObjectRequest; import com.google.storage.v2.BidiWriteObjectResponse; import com.google.storage.v2.Bucket; @@ -170,6 +172,8 @@ public class StorageStubSettings extends StubSettings { private final UnaryCallSettings getObjectSettings; private final ServerStreamingCallSettings readObjectSettings; + private final StreamingCallSettings + bidiReadObjectSettings; private final UnaryCallSettings updateObjectSettings; private final StreamingCallSettings writeObjectSettings; private final StreamingCallSettings @@ -364,6 +368,12 @@ public ServerStreamingCallSettings readOb return readObjectSettings; } + /** Returns the object with the settings used for calls to bidiReadObject. */ + public StreamingCallSettings + bidiReadObjectSettings() { + return bidiReadObjectSettings; + } + /** Returns the object with the settings used for calls to updateObject. */ public UnaryCallSettings updateObjectSettings() { return updateObjectSettings; @@ -503,6 +513,7 @@ protected StorageStubSettings(Builder settingsBuilder) throws IOException { cancelResumableWriteSettings = settingsBuilder.cancelResumableWriteSettings().build(); getObjectSettings = settingsBuilder.getObjectSettings().build(); readObjectSettings = settingsBuilder.readObjectSettings().build(); + bidiReadObjectSettings = settingsBuilder.bidiReadObjectSettings().build(); updateObjectSettings = settingsBuilder.updateObjectSettings().build(); writeObjectSettings = settingsBuilder.writeObjectSettings().build(); bidiWriteObjectSettings = settingsBuilder.bidiWriteObjectSettings().build(); @@ -538,6 +549,8 @@ public static class Builder extends StubSettings.Builder getObjectSettings; private final ServerStreamingCallSettings.Builder readObjectSettings; + private final StreamingCallSettings.Builder + bidiReadObjectSettings; private final UnaryCallSettings.Builder updateObjectSettings; private final StreamingCallSettings.Builder writeObjectSettings; @@ -608,6 +621,7 @@ protected Builder(ClientContext clientContext) { cancelResumableWriteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); getObjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); readObjectSettings = ServerStreamingCallSettings.newBuilder(); + bidiReadObjectSettings = StreamingCallSettings.newBuilder(); updateObjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); writeObjectSettings = StreamingCallSettings.newBuilder(); bidiWriteObjectSettings = StreamingCallSettings.newBuilder(); @@ -660,6 +674,7 @@ protected Builder(StorageStubSettings settings) { cancelResumableWriteSettings = settings.cancelResumableWriteSettings.toBuilder(); getObjectSettings = settings.getObjectSettings.toBuilder(); readObjectSettings = settings.readObjectSettings.toBuilder(); + bidiReadObjectSettings = settings.bidiReadObjectSettings.toBuilder(); updateObjectSettings = settings.updateObjectSettings.toBuilder(); writeObjectSettings = settings.writeObjectSettings.toBuilder(); bidiWriteObjectSettings = settings.bidiWriteObjectSettings.toBuilder(); @@ -910,6 +925,12 @@ public UnaryCallSettings.Builder getObjectSettings() { return readObjectSettings; } + /** Returns the builder for the settings used for calls to bidiReadObject. */ + public StreamingCallSettings.Builder + bidiReadObjectSettings() { + return bidiReadObjectSettings; + } + /** Returns the builder for the settings used for calls to updateObject. */ public UnaryCallSettings.Builder updateObjectSettings() { return updateObjectSettings; diff --git a/gapic-google-cloud-storage-v2/src/main/resources/META-INF/native-image/com.google.storage.v2/reflect-config.json b/gapic-google-cloud-storage-v2/src/main/resources/META-INF/native-image/com.google.storage.v2/reflect-config.json index dcba41fdaa..7d2ebcda10 100644 --- a/gapic-google-cloud-storage-v2/src/main/resources/META-INF/native-image/com.google.storage.v2/reflect-config.json +++ b/gapic-google-cloud-storage-v2/src/main/resources/META-INF/native-image/com.google.storage.v2/reflect-config.json @@ -692,6 +692,24 @@ "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, @@ -1493,6 +1511,186 @@ "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.v2.AppendObjectSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.AppendObjectSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.BidiReadHandle", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.BidiReadHandle$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.BidiReadObjectError", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.BidiReadObjectError$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.BidiReadObjectRedirectedError", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.BidiReadObjectRedirectedError$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.BidiReadObjectRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.BidiReadObjectRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.BidiReadObjectResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.BidiReadObjectResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.BidiReadObjectSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.BidiReadObjectSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.BidiWriteHandle", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.BidiWriteHandle$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.BidiWriteObjectRedirectedError", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.BidiWriteObjectRedirectedError$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.storage.v2.BidiWriteObjectRequest", "queryAllDeclaredConstructors": true, @@ -2285,6 +2483,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.storage.v2.ObjectRangeData", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ObjectRangeData$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.storage.v2.Owner", "queryAllDeclaredConstructors": true, @@ -2393,6 +2609,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.storage.v2.ReadRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ReadRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ReadRangeError", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ReadRangeError$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.storage.v2.RestoreObjectRequest", "queryAllDeclaredConstructors": true, diff --git a/gapic-google-cloud-storage-v2/src/main/resources/com/google/storage/v2/gapic_metadata.json b/gapic-google-cloud-storage-v2/src/main/resources/com/google/storage/v2/gapic_metadata.json index 8756be5ca4..78b2d9c7eb 100644 --- a/gapic-google-cloud-storage-v2/src/main/resources/com/google/storage/v2/gapic_metadata.json +++ b/gapic-google-cloud-storage-v2/src/main/resources/com/google/storage/v2/gapic_metadata.json @@ -10,6 +10,9 @@ "grpc": { "libraryClient": "StorageClient", "rpcs": { + "BidiReadObject": { + "methods": ["bidiReadObjectCallable"] + }, "BidiWriteObject": { "methods": ["bidiWriteObjectCallable"] }, diff --git a/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorageImpl.java b/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorageImpl.java index f3a5493396..4d861cd8ea 100644 --- a/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorageImpl.java +++ b/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorageImpl.java @@ -371,6 +371,43 @@ public void readObject( } } + @Override + public StreamObserver bidiReadObject( + final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(BidiReadObjectRequest value) { + requests.add(value); + final java.lang.Object response = responses.remove(); + if (response instanceof BidiReadObjectResponse) { + responseObserver.onNext(((BidiReadObjectResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method BidiReadObject, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + BidiReadObjectResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } + @Override public void updateObject(UpdateObjectRequest request, StreamObserver responseObserver) { java.lang.Object response = responses.poll(); diff --git a/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/StorageClientTest.java b/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/StorageClientTest.java index 6a712f8446..af5dbfcb7f 100644 --- a/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/StorageClientTest.java +++ b/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/StorageClientTest.java @@ -1812,6 +1812,65 @@ public void readObjectExceptionTest() throws Exception { } } + @Test + public void bidiReadObjectTest() throws Exception { + BidiReadObjectResponse expectedResponse = + BidiReadObjectResponse.newBuilder() + .addAllObjectDataRanges(new ArrayList()) + .setMetadata(Object.newBuilder().build()) + .setReadHandle(BidiReadHandle.newBuilder().build()) + .build(); + mockStorage.addResponse(expectedResponse); + BidiReadObjectRequest request = + BidiReadObjectRequest.newBuilder() + .setReadObjectSpec(BidiReadObjectSpec.newBuilder().build()) + .addAllReadRanges(new ArrayList()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.bidiReadObjectCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + requestObserver.onCompleted(); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void bidiReadObjectExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorage.addException(exception); + BidiReadObjectRequest request = + BidiReadObjectRequest.newBuilder() + .setReadObjectSpec(BidiReadObjectSpec.newBuilder().build()) + .addAllReadRanges(new ArrayList()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.bidiReadObjectCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test public void updateObjectTest() throws Exception { Object expectedResponse = @@ -1945,7 +2004,10 @@ public void writeObjectExceptionTest() throws Exception { @Test public void bidiWriteObjectTest() throws Exception { - BidiWriteObjectResponse expectedResponse = BidiWriteObjectResponse.newBuilder().build(); + BidiWriteObjectResponse expectedResponse = + BidiWriteObjectResponse.newBuilder() + .setWriteHandle(BidiWriteHandle.newBuilder().build()) + .build(); mockStorage.addResponse(expectedResponse); BidiWriteObjectRequest request = BidiWriteObjectRequest.newBuilder() diff --git a/generation_config.yaml b/generation_config.yaml index c69974c84e..b34efeafbe 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,5 +1,5 @@ gapic_generator_version: 2.51.0 -googleapis_commitish: 3cef095370b3176f67542e527ffde81e019df091 +googleapis_commitish: 130b113520c1b3fffd90f67198681b5fe84de464 libraries_bom_version: 26.52.0 libraries: - api_shortname: storage diff --git a/grpc-google-cloud-storage-v2/clirr-ignored-differences.xml b/grpc-google-cloud-storage-v2/clirr-ignored-differences.xml index 79cdb9fa49..06a66a8c0a 100644 --- a/grpc-google-cloud-storage-v2/clirr-ignored-differences.xml +++ b/grpc-google-cloud-storage-v2/clirr-ignored-differences.xml @@ -35,5 +35,10 @@ com/google/storage/v2/* * moveObject(*) + + 7012 + com/google/storage/v2/* + * bidiReadObject(*) + diff --git a/grpc-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageGrpc.java b/grpc-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageGrpc.java index cc7dda5302..5f3c98dc7e 100644 --- a/grpc-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageGrpc.java +++ b/grpc-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageGrpc.java @@ -663,6 +663,48 @@ private StorageGrpc() {} return getReadObjectMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.storage.v2.BidiReadObjectRequest, com.google.storage.v2.BidiReadObjectResponse> + getBidiReadObjectMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "BidiReadObject", + requestType = com.google.storage.v2.BidiReadObjectRequest.class, + responseType = com.google.storage.v2.BidiReadObjectResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.storage.v2.BidiReadObjectRequest, com.google.storage.v2.BidiReadObjectResponse> + getBidiReadObjectMethod() { + io.grpc.MethodDescriptor< + com.google.storage.v2.BidiReadObjectRequest, + com.google.storage.v2.BidiReadObjectResponse> + getBidiReadObjectMethod; + if ((getBidiReadObjectMethod = StorageGrpc.getBidiReadObjectMethod) == null) { + synchronized (StorageGrpc.class) { + if ((getBidiReadObjectMethod = StorageGrpc.getBidiReadObjectMethod) == null) { + StorageGrpc.getBidiReadObjectMethod = + getBidiReadObjectMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "BidiReadObject")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.storage.v2.BidiReadObjectRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.storage.v2.BidiReadObjectResponse.getDefaultInstance())) + .setSchemaDescriptor(new StorageMethodDescriptorSupplier("BidiReadObject")) + .build(); + } + } + } + return getBidiReadObjectMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.storage.v2.UpdateObjectRequest, com.google.storage.v2.Object> getUpdateObjectMethod; @@ -1222,11 +1264,23 @@ default void composeObject( * * *
                -     * Deletes an object and its metadata.
                -     * Deletions are normally permanent when versioning is disabled or whenever
                -     * the generation parameter is used. However, if soft delete is enabled for
                -     * the bucket, deleted objects can be restored using RestoreObject until the
                -     * soft delete retention period has passed.
                +     * Deletes an object and its metadata. Deletions are permanent if versioning
                +     * is not enabled for the bucket, or if the generation parameter is used, or
                +     * if [soft delete](https://cloud.google.com/storage/docs/soft-delete) is not
                +     * enabled for the bucket.
                +     * When this API is used to delete an object from a bucket that has soft
                +     * delete policy enabled, the object becomes soft deleted, and the
                +     * `softDeleteTime` and `hardDeleteTime` properties are set on the object.
                +     * This API cannot be used to permanently delete soft-deleted objects.
                +     * Soft-deleted objects are permanently deleted according to their
                +     * `hardDeleteTime`.
                +     * You can use the [`RestoreObject`][google.storage.v2.Storage.RestoreObject]
                +     * API to restore soft-deleted objects until the soft delete retention period
                +     * has passed.
                +     * **IAM Permissions**:
                +     * Requires `storage.objects.delete`
                +     * [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on
                +     * the bucket.
                      * 
                */ default void deleteObject( @@ -1274,7 +1328,12 @@ default void cancelResumableWrite( * * *
                -     * Retrieves an object's metadata.
                +     * Retrieves object metadata.
                +     * **IAM Permissions**:
                +     * Requires `storage.objects.get`
                +     * [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on
                +     * the bucket. To return object ACLs, the authenticated user must also have
                +     * the `storage.objects.getIamPolicy` permission.
                      * 
                */ default void getObject( @@ -1287,7 +1346,11 @@ default void getObject( * * *
                -     * Reads an object's data.
                +     * Retrieves object data.
                +     * **IAM Permissions**:
                +     * Requires `storage.objects.get`
                +     * [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on
                +     * the bucket.
                      * 
                */ default void readObject( @@ -1296,6 +1359,33 @@ default void readObject( io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getReadObjectMethod(), responseObserver); } + /** + * + * + *
                +     * Reads an object's data.
                +     * This is a bi-directional API with the added support for reading multiple
                +     * ranges within one stream both within and across multiple messages.
                +     * If the server encountered an error for any of the inputs, the stream will
                +     * be closed with the relevant error code.
                +     * Because the API allows for multiple outstanding requests, when the stream
                +     * is closed the error response will contain a BidiReadObjectRangesError proto
                +     * in the error extension describing the error for each outstanding read_id.
                +     * **IAM Permissions**:
                +     * Requires `storage.objects.get`
                +     * [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on
                +     * the bucket.
                +     * This API is currently in preview and is not yet available for general
                +     * use.
                +     * 
                + */ + default io.grpc.stub.StreamObserver bidiReadObject( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getBidiReadObjectMethod(), responseObserver); + } + /** * * @@ -1364,11 +1454,15 @@ default void updateObject( * receives to determine how much data the service was able to commit and * whether the service views the object as complete. * Attempting to resume an already finalized object will result in an OK - * status, with a WriteObjectResponse containing the finalized object's + * status, with a `WriteObjectResponse` containing the finalized object's * metadata. * Alternatively, the BidiWriteObject operation may be used to write an * object with controls over flushing and the ability to fetch the ability to * determine the current persisted size. + * **IAM Permissions**: + * Requires `storage.objects.create` + * [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on + * the bucket. * */ default io.grpc.stub.StreamObserver writeObject( @@ -1409,6 +1503,11 @@ default io.grpc.stub.StreamObserver wr * *
                      * Retrieves a list of objects matching the criteria.
                +     * **IAM Permissions**:
                +     * The authenticated user requires `storage.objects.list`
                +     * [IAM permission](https://cloud.google.com/iam/docs/overview#permissions)
                +     * to use this method. To return object ACLs, the authenticated user must also
                +     * have the `storage.objects.getIamPolicy` permission.
                      * 
                */ default void listObjects( @@ -1437,9 +1536,17 @@ default void rewriteObject( * * *
                -     * Starts a resumable write. How long the write operation remains valid, and
                -     * what happens when the write operation becomes invalid, are
                -     * service-dependent.
                +     * Starts a resumable write operation. This
                +     * method is part of the [Resumable
                +     * upload](https://cloud.google.com/storage/docs/resumable-uploads) feature.
                +     * This allows you to upload large objects in multiple chunks, which is more
                +     * resilient to network interruptions than a single upload. The validity
                +     * duration of the write operation, and the consequences of it becoming
                +     * invalid, are service-dependent.
                +     * **IAM Permissions**:
                +     * Requires `storage.objects.create`
                +     * [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on
                +     * the bucket.
                      * 
                */ default void startResumableWrite( @@ -1454,16 +1561,20 @@ default void startResumableWrite( * * *
                -     * Determines the `persisted_size` for an object that is being written, which
                -     * can then be used as the `write_offset` for the next `Write()` call.
                -     * If the object does not exist (i.e., the object has been deleted, or the
                -     * first `Write()` has not yet reached the service), this method returns the
                +     * Determines the `persisted_size` of an object that is being written. This
                +     * method is part of the [resumable
                +     * upload](https://cloud.google.com/storage/docs/resumable-uploads) feature.
                +     * The returned value is the size of the object that has been persisted so
                +     * far. The value can be used as the `write_offset` for the next `Write()`
                +     * call.
                +     * If the object does not exist, meaning if it was deleted, or the
                +     * first `Write()` has not yet reached the service, this method returns the
                      * error `NOT_FOUND`.
                -     * The client **may** call `QueryWriteStatus()` at any time to determine how
                -     * much data has been processed for this object. This is useful if the
                -     * client is buffering data and needs to know which data can be safely
                -     * evicted. For any sequence of `QueryWriteStatus()` calls for a given
                -     * object name, the sequence of returned `persisted_size` values will be
                +     * This method is useful for clients that buffer data and need to know which
                +     * data can be safely evicted. The client can call `QueryWriteStatus()` at any
                +     * time to determine how much data has been logged for this object.
                +     * For any sequence of `QueryWriteStatus()` calls for a given
                +     * object name, the sequence of returned `persisted_size` values are
                      * non-decreasing.
                      * 
                */ @@ -1729,11 +1840,23 @@ public void composeObject( * * *
                -     * Deletes an object and its metadata.
                -     * Deletions are normally permanent when versioning is disabled or whenever
                -     * the generation parameter is used. However, if soft delete is enabled for
                -     * the bucket, deleted objects can be restored using RestoreObject until the
                -     * soft delete retention period has passed.
                +     * Deletes an object and its metadata. Deletions are permanent if versioning
                +     * is not enabled for the bucket, or if the generation parameter is used, or
                +     * if [soft delete](https://cloud.google.com/storage/docs/soft-delete) is not
                +     * enabled for the bucket.
                +     * When this API is used to delete an object from a bucket that has soft
                +     * delete policy enabled, the object becomes soft deleted, and the
                +     * `softDeleteTime` and `hardDeleteTime` properties are set on the object.
                +     * This API cannot be used to permanently delete soft-deleted objects.
                +     * Soft-deleted objects are permanently deleted according to their
                +     * `hardDeleteTime`.
                +     * You can use the [`RestoreObject`][google.storage.v2.Storage.RestoreObject]
                +     * API to restore soft-deleted objects until the soft delete retention period
                +     * has passed.
                +     * **IAM Permissions**:
                +     * Requires `storage.objects.delete`
                +     * [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on
                +     * the bucket.
                      * 
                */ public void deleteObject( @@ -1787,7 +1910,12 @@ public void cancelResumableWrite( * * *
                -     * Retrieves an object's metadata.
                +     * Retrieves object metadata.
                +     * **IAM Permissions**:
                +     * Requires `storage.objects.get`
                +     * [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on
                +     * the bucket. To return object ACLs, the authenticated user must also have
                +     * the `storage.objects.getIamPolicy` permission.
                      * 
                */ public void getObject( @@ -1801,7 +1929,11 @@ public void getObject( * * *
                -     * Reads an object's data.
                +     * Retrieves object data.
                +     * **IAM Permissions**:
                +     * Requires `storage.objects.get`
                +     * [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on
                +     * the bucket.
                      * 
                */ public void readObject( @@ -1811,6 +1943,33 @@ public void readObject( getChannel().newCall(getReadObjectMethod(), getCallOptions()), request, responseObserver); } + /** + * + * + *
                +     * Reads an object's data.
                +     * This is a bi-directional API with the added support for reading multiple
                +     * ranges within one stream both within and across multiple messages.
                +     * If the server encountered an error for any of the inputs, the stream will
                +     * be closed with the relevant error code.
                +     * Because the API allows for multiple outstanding requests, when the stream
                +     * is closed the error response will contain a BidiReadObjectRangesError proto
                +     * in the error extension describing the error for each outstanding read_id.
                +     * **IAM Permissions**:
                +     * Requires `storage.objects.get`
                +     * [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on
                +     * the bucket.
                +     * This API is currently in preview and is not yet available for general
                +     * use.
                +     * 
                + */ + public io.grpc.stub.StreamObserver bidiReadObject( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getBidiReadObjectMethod(), getCallOptions()), responseObserver); + } + /** * * @@ -1881,11 +2040,15 @@ public void updateObject( * receives to determine how much data the service was able to commit and * whether the service views the object as complete. * Attempting to resume an already finalized object will result in an OK - * status, with a WriteObjectResponse containing the finalized object's + * status, with a `WriteObjectResponse` containing the finalized object's * metadata. * Alternatively, the BidiWriteObject operation may be used to write an * object with controls over flushing and the ability to fetch the ability to * determine the current persisted size. + * **IAM Permissions**: + * Requires `storage.objects.create` + * [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on + * the bucket. * */ public io.grpc.stub.StreamObserver writeObject( @@ -1926,6 +2089,11 @@ public io.grpc.stub.StreamObserver wri * *
                      * Retrieves a list of objects matching the criteria.
                +     * **IAM Permissions**:
                +     * The authenticated user requires `storage.objects.list`
                +     * [IAM permission](https://cloud.google.com/iam/docs/overview#permissions)
                +     * to use this method. To return object ACLs, the authenticated user must also
                +     * have the `storage.objects.getIamPolicy` permission.
                      * 
                */ public void listObjects( @@ -1958,9 +2126,17 @@ public void rewriteObject( * * *
                -     * Starts a resumable write. How long the write operation remains valid, and
                -     * what happens when the write operation becomes invalid, are
                -     * service-dependent.
                +     * Starts a resumable write operation. This
                +     * method is part of the [Resumable
                +     * upload](https://cloud.google.com/storage/docs/resumable-uploads) feature.
                +     * This allows you to upload large objects in multiple chunks, which is more
                +     * resilient to network interruptions than a single upload. The validity
                +     * duration of the write operation, and the consequences of it becoming
                +     * invalid, are service-dependent.
                +     * **IAM Permissions**:
                +     * Requires `storage.objects.create`
                +     * [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on
                +     * the bucket.
                      * 
                */ public void startResumableWrite( @@ -1977,16 +2153,20 @@ public void startResumableWrite( * * *
                -     * Determines the `persisted_size` for an object that is being written, which
                -     * can then be used as the `write_offset` for the next `Write()` call.
                -     * If the object does not exist (i.e., the object has been deleted, or the
                -     * first `Write()` has not yet reached the service), this method returns the
                +     * Determines the `persisted_size` of an object that is being written. This
                +     * method is part of the [resumable
                +     * upload](https://cloud.google.com/storage/docs/resumable-uploads) feature.
                +     * The returned value is the size of the object that has been persisted so
                +     * far. The value can be used as the `write_offset` for the next `Write()`
                +     * call.
                +     * If the object does not exist, meaning if it was deleted, or the
                +     * first `Write()` has not yet reached the service, this method returns the
                      * error `NOT_FOUND`.
                -     * The client **may** call `QueryWriteStatus()` at any time to determine how
                -     * much data has been processed for this object. This is useful if the
                -     * client is buffering data and needs to know which data can be safely
                -     * evicted. For any sequence of `QueryWriteStatus()` calls for a given
                -     * object name, the sequence of returned `persisted_size` values will be
                +     * This method is useful for clients that buffer data and need to know which
                +     * data can be safely evicted. The client can call `QueryWriteStatus()` at any
                +     * time to determine how much data has been logged for this object.
                +     * For any sequence of `QueryWriteStatus()` calls for a given
                +     * object name, the sequence of returned `persisted_size` values are
                      * non-decreasing.
                      * 
                */ @@ -2192,11 +2372,23 @@ public com.google.storage.v2.Object composeObject( * * *
                -     * Deletes an object and its metadata.
                -     * Deletions are normally permanent when versioning is disabled or whenever
                -     * the generation parameter is used. However, if soft delete is enabled for
                -     * the bucket, deleted objects can be restored using RestoreObject until the
                -     * soft delete retention period has passed.
                +     * Deletes an object and its metadata. Deletions are permanent if versioning
                +     * is not enabled for the bucket, or if the generation parameter is used, or
                +     * if [soft delete](https://cloud.google.com/storage/docs/soft-delete) is not
                +     * enabled for the bucket.
                +     * When this API is used to delete an object from a bucket that has soft
                +     * delete policy enabled, the object becomes soft deleted, and the
                +     * `softDeleteTime` and `hardDeleteTime` properties are set on the object.
                +     * This API cannot be used to permanently delete soft-deleted objects.
                +     * Soft-deleted objects are permanently deleted according to their
                +     * `hardDeleteTime`.
                +     * You can use the [`RestoreObject`][google.storage.v2.Storage.RestoreObject]
                +     * API to restore soft-deleted objects until the soft delete retention period
                +     * has passed.
                +     * **IAM Permissions**:
                +     * Requires `storage.objects.delete`
                +     * [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on
                +     * the bucket.
                      * 
                */ public com.google.protobuf.Empty deleteObject( @@ -2240,7 +2432,12 @@ public com.google.storage.v2.CancelResumableWriteResponse cancelResumableWrite( * * *
                -     * Retrieves an object's metadata.
                +     * Retrieves object metadata.
                +     * **IAM Permissions**:
                +     * Requires `storage.objects.get`
                +     * [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on
                +     * the bucket. To return object ACLs, the authenticated user must also have
                +     * the `storage.objects.getIamPolicy` permission.
                      * 
                */ public com.google.storage.v2.Object getObject(com.google.storage.v2.GetObjectRequest request) { @@ -2252,7 +2449,11 @@ public com.google.storage.v2.Object getObject(com.google.storage.v2.GetObjectReq * * *
                -     * Reads an object's data.
                +     * Retrieves object data.
                +     * **IAM Permissions**:
                +     * Requires `storage.objects.get`
                +     * [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on
                +     * the bucket.
                      * 
                */ public java.util.Iterator readObject( @@ -2280,6 +2481,11 @@ public com.google.storage.v2.Object updateObject( * *
                      * Retrieves a list of objects matching the criteria.
                +     * **IAM Permissions**:
                +     * The authenticated user requires `storage.objects.list`
                +     * [IAM permission](https://cloud.google.com/iam/docs/overview#permissions)
                +     * to use this method. To return object ACLs, the authenticated user must also
                +     * have the `storage.objects.getIamPolicy` permission.
                      * 
                */ public com.google.storage.v2.ListObjectsResponse listObjects( @@ -2306,9 +2512,17 @@ public com.google.storage.v2.RewriteResponse rewriteObject( * * *
                -     * Starts a resumable write. How long the write operation remains valid, and
                -     * what happens when the write operation becomes invalid, are
                -     * service-dependent.
                +     * Starts a resumable write operation. This
                +     * method is part of the [Resumable
                +     * upload](https://cloud.google.com/storage/docs/resumable-uploads) feature.
                +     * This allows you to upload large objects in multiple chunks, which is more
                +     * resilient to network interruptions than a single upload. The validity
                +     * duration of the write operation, and the consequences of it becoming
                +     * invalid, are service-dependent.
                +     * **IAM Permissions**:
                +     * Requires `storage.objects.create`
                +     * [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on
                +     * the bucket.
                      * 
                */ public com.google.storage.v2.StartResumableWriteResponse startResumableWrite( @@ -2321,16 +2535,20 @@ public com.google.storage.v2.StartResumableWriteResponse startResumableWrite( * * *
                -     * Determines the `persisted_size` for an object that is being written, which
                -     * can then be used as the `write_offset` for the next `Write()` call.
                -     * If the object does not exist (i.e., the object has been deleted, or the
                -     * first `Write()` has not yet reached the service), this method returns the
                +     * Determines the `persisted_size` of an object that is being written. This
                +     * method is part of the [resumable
                +     * upload](https://cloud.google.com/storage/docs/resumable-uploads) feature.
                +     * The returned value is the size of the object that has been persisted so
                +     * far. The value can be used as the `write_offset` for the next `Write()`
                +     * call.
                +     * If the object does not exist, meaning if it was deleted, or the
                +     * first `Write()` has not yet reached the service, this method returns the
                      * error `NOT_FOUND`.
                -     * The client **may** call `QueryWriteStatus()` at any time to determine how
                -     * much data has been processed for this object. This is useful if the
                -     * client is buffering data and needs to know which data can be safely
                -     * evicted. For any sequence of `QueryWriteStatus()` calls for a given
                -     * object name, the sequence of returned `persisted_size` values will be
                +     * This method is useful for clients that buffer data and need to know which
                +     * data can be safely evicted. The client can call `QueryWriteStatus()` at any
                +     * time to determine how much data has been logged for this object.
                +     * For any sequence of `QueryWriteStatus()` calls for a given
                +     * object name, the sequence of returned `persisted_size` values are
                      * non-decreasing.
                      * 
                */ @@ -2536,11 +2754,23 @@ protected StorageFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c * * *
                -     * Deletes an object and its metadata.
                -     * Deletions are normally permanent when versioning is disabled or whenever
                -     * the generation parameter is used. However, if soft delete is enabled for
                -     * the bucket, deleted objects can be restored using RestoreObject until the
                -     * soft delete retention period has passed.
                +     * Deletes an object and its metadata. Deletions are permanent if versioning
                +     * is not enabled for the bucket, or if the generation parameter is used, or
                +     * if [soft delete](https://cloud.google.com/storage/docs/soft-delete) is not
                +     * enabled for the bucket.
                +     * When this API is used to delete an object from a bucket that has soft
                +     * delete policy enabled, the object becomes soft deleted, and the
                +     * `softDeleteTime` and `hardDeleteTime` properties are set on the object.
                +     * This API cannot be used to permanently delete soft-deleted objects.
                +     * Soft-deleted objects are permanently deleted according to their
                +     * `hardDeleteTime`.
                +     * You can use the [`RestoreObject`][google.storage.v2.Storage.RestoreObject]
                +     * API to restore soft-deleted objects until the soft delete retention period
                +     * has passed.
                +     * **IAM Permissions**:
                +     * Requires `storage.objects.delete`
                +     * [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on
                +     * the bucket.
                      * 
                */ public com.google.common.util.concurrent.ListenableFuture @@ -2585,7 +2815,12 @@ protected StorageFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c * * *
                -     * Retrieves an object's metadata.
                +     * Retrieves object metadata.
                +     * **IAM Permissions**:
                +     * Requires `storage.objects.get`
                +     * [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on
                +     * the bucket. To return object ACLs, the authenticated user must also have
                +     * the `storage.objects.getIamPolicy` permission.
                      * 
                */ public com.google.common.util.concurrent.ListenableFuture @@ -2613,6 +2848,11 @@ protected StorageFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c * *
                      * Retrieves a list of objects matching the criteria.
                +     * **IAM Permissions**:
                +     * The authenticated user requires `storage.objects.list`
                +     * [IAM permission](https://cloud.google.com/iam/docs/overview#permissions)
                +     * to use this method. To return object ACLs, the authenticated user must also
                +     * have the `storage.objects.getIamPolicy` permission.
                      * 
                */ public com.google.common.util.concurrent.ListenableFuture< @@ -2640,9 +2880,17 @@ protected StorageFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c * * *
                -     * Starts a resumable write. How long the write operation remains valid, and
                -     * what happens when the write operation becomes invalid, are
                -     * service-dependent.
                +     * Starts a resumable write operation. This
                +     * method is part of the [Resumable
                +     * upload](https://cloud.google.com/storage/docs/resumable-uploads) feature.
                +     * This allows you to upload large objects in multiple chunks, which is more
                +     * resilient to network interruptions than a single upload. The validity
                +     * duration of the write operation, and the consequences of it becoming
                +     * invalid, are service-dependent.
                +     * **IAM Permissions**:
                +     * Requires `storage.objects.create`
                +     * [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on
                +     * the bucket.
                      * 
                */ public com.google.common.util.concurrent.ListenableFuture< @@ -2656,16 +2904,20 @@ protected StorageFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c * * *
                -     * Determines the `persisted_size` for an object that is being written, which
                -     * can then be used as the `write_offset` for the next `Write()` call.
                -     * If the object does not exist (i.e., the object has been deleted, or the
                -     * first `Write()` has not yet reached the service), this method returns the
                +     * Determines the `persisted_size` of an object that is being written. This
                +     * method is part of the [resumable
                +     * upload](https://cloud.google.com/storage/docs/resumable-uploads) feature.
                +     * The returned value is the size of the object that has been persisted so
                +     * far. The value can be used as the `write_offset` for the next `Write()`
                +     * call.
                +     * If the object does not exist, meaning if it was deleted, or the
                +     * first `Write()` has not yet reached the service, this method returns the
                      * error `NOT_FOUND`.
                -     * The client **may** call `QueryWriteStatus()` at any time to determine how
                -     * much data has been processed for this object. This is useful if the
                -     * client is buffering data and needs to know which data can be safely
                -     * evicted. For any sequence of `QueryWriteStatus()` calls for a given
                -     * object name, the sequence of returned `persisted_size` values will be
                +     * This method is useful for clients that buffer data and need to know which
                +     * data can be safely evicted. The client can call `QueryWriteStatus()` at any
                +     * time to determine how much data has been logged for this object.
                +     * For any sequence of `QueryWriteStatus()` calls for a given
                +     * object name, the sequence of returned `persisted_size` values are
                      * non-decreasing.
                      * 
                */ @@ -2711,8 +2963,9 @@ protected StorageFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c private static final int METHODID_START_RESUMABLE_WRITE = 18; private static final int METHODID_QUERY_WRITE_STATUS = 19; private static final int METHODID_MOVE_OBJECT = 20; - private static final int METHODID_WRITE_OBJECT = 21; - private static final int METHODID_BIDI_WRITE_OBJECT = 22; + private static final int METHODID_BIDI_READ_OBJECT = 21; + private static final int METHODID_WRITE_OBJECT = 22; + private static final int METHODID_BIDI_WRITE_OBJECT = 23; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -2854,6 +3107,11 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv public io.grpc.stub.StreamObserver invoke( io.grpc.stub.StreamObserver responseObserver) { switch (methodId) { + case METHODID_BIDI_READ_OBJECT: + return (io.grpc.stub.StreamObserver) + serviceImpl.bidiReadObject( + (io.grpc.stub.StreamObserver) + responseObserver); case METHODID_WRITE_OBJECT: return (io.grpc.stub.StreamObserver) serviceImpl.writeObject( @@ -2962,6 +3220,13 @@ public static final io.grpc.ServerServiceDefinition bindService(AsyncService ser new MethodHandlers< com.google.storage.v2.ReadObjectRequest, com.google.storage.v2.ReadObjectResponse>(service, METHODID_READ_OBJECT))) + .addMethod( + getBidiReadObjectMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.storage.v2.BidiReadObjectRequest, + com.google.storage.v2.BidiReadObjectResponse>( + service, METHODID_BIDI_READ_OBJECT))) .addMethod( getUpdateObjectMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -3077,6 +3342,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getCancelResumableWriteMethod()) .addMethod(getGetObjectMethod()) .addMethod(getReadObjectMethod()) + .addMethod(getBidiReadObjectMethod()) .addMethod(getUpdateObjectMethod()) .addMethod(getWriteObjectMethod()) .addMethod(getBidiWriteObjectMethod()) diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/AppendObjectSpec.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/AppendObjectSpec.java new file mode 100644 index 0000000000..4cf93fbba2 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/AppendObjectSpec.java @@ -0,0 +1,1700 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +/** + * + * + *
                + * Describes an attempt to append to an object, possibly over multiple requests.
                + * 
                + * + * Protobuf type {@code google.storage.v2.AppendObjectSpec} + */ +public final class AppendObjectSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.AppendObjectSpec) + AppendObjectSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use AppendObjectSpec.newBuilder() to construct. + private AppendObjectSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AppendObjectSpec() { + bucket_ = ""; + object_ = ""; + routingToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AppendObjectSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_AppendObjectSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_AppendObjectSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.AppendObjectSpec.class, + com.google.storage.v2.AppendObjectSpec.Builder.class); + } + + private int bitField0_; + public static final int BUCKET_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object bucket_ = ""; + /** + * + * + *
                +   * Required. The name of the bucket containing the object to write.
                +   * 
                + * + * + * string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bucket. + */ + @java.lang.Override + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucket_ = s; + return s; + } + } + /** + * + * + *
                +   * Required. The name of the bucket containing the object to write.
                +   * 
                + * + * + * string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for bucket. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OBJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object object_ = ""; + /** + * + * + *
                +   * Required. The name of the object to open for writing.
                +   * 
                + * + * string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The object. + */ + @java.lang.Override + public java.lang.String getObject() { + java.lang.Object ref = object_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + object_ = s; + return s; + } + } + /** + * + * + *
                +   * Required. The name of the object to open for writing.
                +   * 
                + * + * string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for object. + */ + @java.lang.Override + public com.google.protobuf.ByteString getObjectBytes() { + java.lang.Object ref = object_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + object_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GENERATION_FIELD_NUMBER = 3; + private long generation_ = 0L; + /** + * + * + *
                +   * Required. The generation number of the object to open for writing.
                +   * 
                + * + * int64 generation = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The generation. + */ + @java.lang.Override + public long getGeneration() { + return generation_; + } + + public static final int IF_METAGENERATION_MATCH_FIELD_NUMBER = 4; + private long ifMetagenerationMatch_ = 0L; + /** + * + * + *
                +   * Makes the operation conditional on whether the object'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 conditional on whether the object'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 conditional on whether the object'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 conditional on whether the object'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 ROUTING_TOKEN_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object routingToken_ = ""; + /** + * + * + *
                +   * An optional routing token that influences request routing for the stream.
                +   * Must be provided if a BidiWriteObjectRedirectedError is returned.
                +   * 
                + * + * optional string routing_token = 6; + * + * @return Whether the routingToken field is set. + */ + @java.lang.Override + public boolean hasRoutingToken() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
                +   * An optional routing token that influences request routing for the stream.
                +   * Must be provided if a BidiWriteObjectRedirectedError is returned.
                +   * 
                + * + * optional string routing_token = 6; + * + * @return The routingToken. + */ + @java.lang.Override + public java.lang.String getRoutingToken() { + java.lang.Object ref = routingToken_; + 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(); + routingToken_ = s; + return s; + } + } + /** + * + * + *
                +   * An optional routing token that influences request routing for the stream.
                +   * Must be provided if a BidiWriteObjectRedirectedError is returned.
                +   * 
                + * + * optional string routing_token = 6; + * + * @return The bytes for routingToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRoutingTokenBytes() { + java.lang.Object ref = routingToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + routingToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WRITE_HANDLE_FIELD_NUMBER = 7; + private com.google.storage.v2.BidiWriteHandle writeHandle_; + /** + * + * + *
                +   * An optional write handle returned from a previous BidiWriteObjectResponse
                +   * message or a BidiWriteObjectRedirectedError error.
                +   * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 7; + * + * @return Whether the writeHandle field is set. + */ + @java.lang.Override + public boolean hasWriteHandle() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
                +   * An optional write handle returned from a previous BidiWriteObjectResponse
                +   * message or a BidiWriteObjectRedirectedError error.
                +   * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 7; + * + * @return The writeHandle. + */ + @java.lang.Override + public com.google.storage.v2.BidiWriteHandle getWriteHandle() { + return writeHandle_ == null + ? com.google.storage.v2.BidiWriteHandle.getDefaultInstance() + : writeHandle_; + } + /** + * + * + *
                +   * An optional write handle returned from a previous BidiWriteObjectResponse
                +   * message or a BidiWriteObjectRedirectedError error.
                +   * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 7; + */ + @java.lang.Override + public com.google.storage.v2.BidiWriteHandleOrBuilder getWriteHandleOrBuilder() { + return writeHandle_ == null + ? com.google.storage.v2.BidiWriteHandle.getDefaultInstance() + : writeHandle_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucket_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, bucket_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(object_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, object_); + } + if (generation_ != 0L) { + output.writeInt64(3, generation_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt64(4, ifMetagenerationMatch_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt64(5, ifMetagenerationNotMatch_); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, routingToken_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(7, getWriteHandle()); + } + 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(bucket_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, bucket_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(object_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, object_); + } + if (generation_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, generation_); + } + 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 (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, routingToken_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getWriteHandle()); + } + 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.v2.AppendObjectSpec)) { + return super.equals(obj); + } + com.google.storage.v2.AppendObjectSpec other = (com.google.storage.v2.AppendObjectSpec) obj; + + if (!getBucket().equals(other.getBucket())) return false; + if (!getObject().equals(other.getObject())) return false; + if (getGeneration() != other.getGeneration()) 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 (hasRoutingToken() != other.hasRoutingToken()) return false; + if (hasRoutingToken()) { + if (!getRoutingToken().equals(other.getRoutingToken())) return false; + } + if (hasWriteHandle() != other.hasWriteHandle()) return false; + if (hasWriteHandle()) { + if (!getWriteHandle().equals(other.getWriteHandle())) 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) + BUCKET_FIELD_NUMBER; + hash = (53 * hash) + getBucket().hashCode(); + hash = (37 * hash) + OBJECT_FIELD_NUMBER; + hash = (53 * hash) + getObject().hashCode(); + hash = (37 * hash) + GENERATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getGeneration()); + if (hasIfMetagenerationMatch()) { + hash = (37 * hash) + IF_METAGENERATION_MATCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationMatch()); + } + if (hasIfMetagenerationNotMatch()) { + hash = (37 * hash) + IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationNotMatch()); + } + if (hasRoutingToken()) { + hash = (37 * hash) + ROUTING_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getRoutingToken().hashCode(); + } + if (hasWriteHandle()) { + hash = (37 * hash) + WRITE_HANDLE_FIELD_NUMBER; + hash = (53 * hash) + getWriteHandle().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.AppendObjectSpec parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.AppendObjectSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.AppendObjectSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.AppendObjectSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.AppendObjectSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.AppendObjectSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.AppendObjectSpec parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.AppendObjectSpec parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.AppendObjectSpec parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.AppendObjectSpec parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.AppendObjectSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.AppendObjectSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.storage.v2.AppendObjectSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
                +   * Describes an attempt to append to an object, possibly over multiple requests.
                +   * 
                + * + * Protobuf type {@code google.storage.v2.AppendObjectSpec} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.AppendObjectSpec) + com.google.storage.v2.AppendObjectSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_AppendObjectSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_AppendObjectSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.AppendObjectSpec.class, + com.google.storage.v2.AppendObjectSpec.Builder.class); + } + + // Construct using com.google.storage.v2.AppendObjectSpec.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getWriteHandleFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + bucket_ = ""; + object_ = ""; + generation_ = 0L; + ifMetagenerationMatch_ = 0L; + ifMetagenerationNotMatch_ = 0L; + routingToken_ = ""; + writeHandle_ = null; + if (writeHandleBuilder_ != null) { + writeHandleBuilder_.dispose(); + writeHandleBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_AppendObjectSpec_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.AppendObjectSpec getDefaultInstanceForType() { + return com.google.storage.v2.AppendObjectSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.AppendObjectSpec build() { + com.google.storage.v2.AppendObjectSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.AppendObjectSpec buildPartial() { + com.google.storage.v2.AppendObjectSpec result = + new com.google.storage.v2.AppendObjectSpec(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.storage.v2.AppendObjectSpec result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.bucket_ = bucket_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.object_ = object_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.generation_ = generation_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.ifMetagenerationMatch_ = ifMetagenerationMatch_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.ifMetagenerationNotMatch_ = ifMetagenerationNotMatch_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.routingToken_ = routingToken_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.writeHandle_ = + writeHandleBuilder_ == null ? writeHandle_ : writeHandleBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + 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.v2.AppendObjectSpec) { + return mergeFrom((com.google.storage.v2.AppendObjectSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.AppendObjectSpec other) { + if (other == com.google.storage.v2.AppendObjectSpec.getDefaultInstance()) return this; + if (!other.getBucket().isEmpty()) { + bucket_ = other.bucket_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getObject().isEmpty()) { + object_ = other.object_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getGeneration() != 0L) { + setGeneration(other.getGeneration()); + } + if (other.hasIfMetagenerationMatch()) { + setIfMetagenerationMatch(other.getIfMetagenerationMatch()); + } + if (other.hasIfMetagenerationNotMatch()) { + setIfMetagenerationNotMatch(other.getIfMetagenerationNotMatch()); + } + if (other.hasRoutingToken()) { + routingToken_ = other.routingToken_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.hasWriteHandle()) { + mergeWriteHandle(other.getWriteHandle()); + } + 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: + { + bucket_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + object_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + generation_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + ifMetagenerationMatch_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + ifMetagenerationNotMatch_ = input.readInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: + { + routingToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage(getWriteHandleFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + 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 bucket_ = ""; + /** + * + * + *
                +     * Required. The name of the bucket containing the object to write.
                +     * 
                + * + * + * string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bucket. + */ + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucket_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
                +     * Required. The name of the bucket containing the object to write.
                +     * 
                + * + * + * string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for bucket. + */ + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
                +     * Required. The name of the bucket containing the object to write.
                +     * 
                + * + * + * string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bucket to set. + * @return This builder for chaining. + */ + public Builder setBucket(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bucket_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
                +     * Required. The name of the bucket containing the object to write.
                +     * 
                + * + * + * string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearBucket() { + bucket_ = getDefaultInstance().getBucket(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
                +     * Required. The name of the bucket containing the object to write.
                +     * 
                + * + * + * string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for bucket to set. + * @return This builder for chaining. + */ + public Builder setBucketBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bucket_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object object_ = ""; + /** + * + * + *
                +     * Required. The name of the object to open for writing.
                +     * 
                + * + * string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The object. + */ + public java.lang.String getObject() { + java.lang.Object ref = object_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + object_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
                +     * Required. The name of the object to open for writing.
                +     * 
                + * + * string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for object. + */ + public com.google.protobuf.ByteString getObjectBytes() { + java.lang.Object ref = object_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + object_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
                +     * Required. The name of the object to open for writing.
                +     * 
                + * + * string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The object to set. + * @return This builder for chaining. + */ + public Builder setObject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + object_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
                +     * Required. The name of the object to open for writing.
                +     * 
                + * + * string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearObject() { + object_ = getDefaultInstance().getObject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
                +     * Required. The name of the object to open for writing.
                +     * 
                + * + * string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for object to set. + * @return This builder for chaining. + */ + public Builder setObjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + object_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long generation_; + /** + * + * + *
                +     * Required. The generation number of the object to open for writing.
                +     * 
                + * + * int64 generation = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The generation. + */ + @java.lang.Override + public long getGeneration() { + return generation_; + } + /** + * + * + *
                +     * Required. The generation number of the object to open for writing.
                +     * 
                + * + * int64 generation = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The generation to set. + * @return This builder for chaining. + */ + public Builder setGeneration(long value) { + + generation_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
                +     * Required. The generation number of the object to open for writing.
                +     * 
                + * + * int64 generation = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearGeneration() { + bitField0_ = (bitField0_ & ~0x00000004); + generation_ = 0L; + onChanged(); + return this; + } + + private long ifMetagenerationMatch_; + /** + * + * + *
                +     * Makes the operation conditional on whether the object'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_ & 0x00000008) != 0); + } + /** + * + * + *
                +     * Makes the operation conditional on whether the object'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 conditional on whether the object'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_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
                +     * Makes the operation conditional on whether the object's current
                +     * metageneration matches the given value.
                +     * 
                + * + * optional int64 if_metageneration_match = 4; + * + * @return This builder for chaining. + */ + public Builder clearIfMetagenerationMatch() { + bitField0_ = (bitField0_ & ~0x00000008); + ifMetagenerationMatch_ = 0L; + onChanged(); + return this; + } + + private long ifMetagenerationNotMatch_; + /** + * + * + *
                +     * Makes the operation conditional on whether the object's current
                +     * metageneration does not match the given value.
                +     * 
                + * + * optional int64 if_metageneration_not_match = 5; + * + * @return Whether the ifMetagenerationNotMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationNotMatch() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
                +     * Makes the operation conditional on whether the object'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 conditional on whether the object'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_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
                +     * Makes the operation conditional on whether the object'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_ & ~0x00000010); + ifMetagenerationNotMatch_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object routingToken_ = ""; + /** + * + * + *
                +     * An optional routing token that influences request routing for the stream.
                +     * Must be provided if a BidiWriteObjectRedirectedError is returned.
                +     * 
                + * + * optional string routing_token = 6; + * + * @return Whether the routingToken field is set. + */ + public boolean hasRoutingToken() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
                +     * An optional routing token that influences request routing for the stream.
                +     * Must be provided if a BidiWriteObjectRedirectedError is returned.
                +     * 
                + * + * optional string routing_token = 6; + * + * @return The routingToken. + */ + public java.lang.String getRoutingToken() { + java.lang.Object ref = routingToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + routingToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
                +     * An optional routing token that influences request routing for the stream.
                +     * Must be provided if a BidiWriteObjectRedirectedError is returned.
                +     * 
                + * + * optional string routing_token = 6; + * + * @return The bytes for routingToken. + */ + public com.google.protobuf.ByteString getRoutingTokenBytes() { + java.lang.Object ref = routingToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + routingToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
                +     * An optional routing token that influences request routing for the stream.
                +     * Must be provided if a BidiWriteObjectRedirectedError is returned.
                +     * 
                + * + * optional string routing_token = 6; + * + * @param value The routingToken to set. + * @return This builder for chaining. + */ + public Builder setRoutingToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + routingToken_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
                +     * An optional routing token that influences request routing for the stream.
                +     * Must be provided if a BidiWriteObjectRedirectedError is returned.
                +     * 
                + * + * optional string routing_token = 6; + * + * @return This builder for chaining. + */ + public Builder clearRoutingToken() { + routingToken_ = getDefaultInstance().getRoutingToken(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
                +     * An optional routing token that influences request routing for the stream.
                +     * Must be provided if a BidiWriteObjectRedirectedError is returned.
                +     * 
                + * + * optional string routing_token = 6; + * + * @param value The bytes for routingToken to set. + * @return This builder for chaining. + */ + public Builder setRoutingTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + routingToken_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private com.google.storage.v2.BidiWriteHandle writeHandle_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.BidiWriteHandle, + com.google.storage.v2.BidiWriteHandle.Builder, + com.google.storage.v2.BidiWriteHandleOrBuilder> + writeHandleBuilder_; + /** + * + * + *
                +     * An optional write handle returned from a previous BidiWriteObjectResponse
                +     * message or a BidiWriteObjectRedirectedError error.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 7; + * + * @return Whether the writeHandle field is set. + */ + public boolean hasWriteHandle() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
                +     * An optional write handle returned from a previous BidiWriteObjectResponse
                +     * message or a BidiWriteObjectRedirectedError error.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 7; + * + * @return The writeHandle. + */ + public com.google.storage.v2.BidiWriteHandle getWriteHandle() { + if (writeHandleBuilder_ == null) { + return writeHandle_ == null + ? com.google.storage.v2.BidiWriteHandle.getDefaultInstance() + : writeHandle_; + } else { + return writeHandleBuilder_.getMessage(); + } + } + /** + * + * + *
                +     * An optional write handle returned from a previous BidiWriteObjectResponse
                +     * message or a BidiWriteObjectRedirectedError error.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 7; + */ + public Builder setWriteHandle(com.google.storage.v2.BidiWriteHandle value) { + if (writeHandleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + writeHandle_ = value; + } else { + writeHandleBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
                +     * An optional write handle returned from a previous BidiWriteObjectResponse
                +     * message or a BidiWriteObjectRedirectedError error.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 7; + */ + public Builder setWriteHandle(com.google.storage.v2.BidiWriteHandle.Builder builderForValue) { + if (writeHandleBuilder_ == null) { + writeHandle_ = builderForValue.build(); + } else { + writeHandleBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
                +     * An optional write handle returned from a previous BidiWriteObjectResponse
                +     * message or a BidiWriteObjectRedirectedError error.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 7; + */ + public Builder mergeWriteHandle(com.google.storage.v2.BidiWriteHandle value) { + if (writeHandleBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && writeHandle_ != null + && writeHandle_ != com.google.storage.v2.BidiWriteHandle.getDefaultInstance()) { + getWriteHandleBuilder().mergeFrom(value); + } else { + writeHandle_ = value; + } + } else { + writeHandleBuilder_.mergeFrom(value); + } + if (writeHandle_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + * + * + *
                +     * An optional write handle returned from a previous BidiWriteObjectResponse
                +     * message or a BidiWriteObjectRedirectedError error.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 7; + */ + public Builder clearWriteHandle() { + bitField0_ = (bitField0_ & ~0x00000040); + writeHandle_ = null; + if (writeHandleBuilder_ != null) { + writeHandleBuilder_.dispose(); + writeHandleBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
                +     * An optional write handle returned from a previous BidiWriteObjectResponse
                +     * message or a BidiWriteObjectRedirectedError error.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 7; + */ + public com.google.storage.v2.BidiWriteHandle.Builder getWriteHandleBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getWriteHandleFieldBuilder().getBuilder(); + } + /** + * + * + *
                +     * An optional write handle returned from a previous BidiWriteObjectResponse
                +     * message or a BidiWriteObjectRedirectedError error.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 7; + */ + public com.google.storage.v2.BidiWriteHandleOrBuilder getWriteHandleOrBuilder() { + if (writeHandleBuilder_ != null) { + return writeHandleBuilder_.getMessageOrBuilder(); + } else { + return writeHandle_ == null + ? com.google.storage.v2.BidiWriteHandle.getDefaultInstance() + : writeHandle_; + } + } + /** + * + * + *
                +     * An optional write handle returned from a previous BidiWriteObjectResponse
                +     * message or a BidiWriteObjectRedirectedError error.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.BidiWriteHandle, + com.google.storage.v2.BidiWriteHandle.Builder, + com.google.storage.v2.BidiWriteHandleOrBuilder> + getWriteHandleFieldBuilder() { + if (writeHandleBuilder_ == null) { + writeHandleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.BidiWriteHandle, + com.google.storage.v2.BidiWriteHandle.Builder, + com.google.storage.v2.BidiWriteHandleOrBuilder>( + getWriteHandle(), getParentForChildren(), isClean()); + writeHandle_ = null; + } + return writeHandleBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.storage.v2.AppendObjectSpec) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.AppendObjectSpec) + private static final com.google.storage.v2.AppendObjectSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.AppendObjectSpec(); + } + + public static com.google.storage.v2.AppendObjectSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AppendObjectSpec 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.v2.AppendObjectSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/AppendObjectSpecOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/AppendObjectSpecOrBuilder.java new file mode 100644 index 0000000000..9076416768 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/AppendObjectSpecOrBuilder.java @@ -0,0 +1,225 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +public interface AppendObjectSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.AppendObjectSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
                +   * Required. The name of the bucket containing the object to write.
                +   * 
                + * + * + * string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bucket. + */ + java.lang.String getBucket(); + /** + * + * + *
                +   * Required. The name of the bucket containing the object to write.
                +   * 
                + * + * + * string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for bucket. + */ + com.google.protobuf.ByteString getBucketBytes(); + + /** + * + * + *
                +   * Required. The name of the object to open for writing.
                +   * 
                + * + * string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The object. + */ + java.lang.String getObject(); + /** + * + * + *
                +   * Required. The name of the object to open for writing.
                +   * 
                + * + * string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for object. + */ + com.google.protobuf.ByteString getObjectBytes(); + + /** + * + * + *
                +   * Required. The generation number of the object to open for writing.
                +   * 
                + * + * int64 generation = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The generation. + */ + long getGeneration(); + + /** + * + * + *
                +   * Makes the operation conditional on whether the object'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 conditional on whether the object's current
                +   * metageneration matches the given value.
                +   * 
                + * + * optional int64 if_metageneration_match = 4; + * + * @return The ifMetagenerationMatch. + */ + long getIfMetagenerationMatch(); + + /** + * + * + *
                +   * Makes the operation conditional on whether the object'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 conditional on whether the object's current
                +   * metageneration does not match the given value.
                +   * 
                + * + * optional int64 if_metageneration_not_match = 5; + * + * @return The ifMetagenerationNotMatch. + */ + long getIfMetagenerationNotMatch(); + + /** + * + * + *
                +   * An optional routing token that influences request routing for the stream.
                +   * Must be provided if a BidiWriteObjectRedirectedError is returned.
                +   * 
                + * + * optional string routing_token = 6; + * + * @return Whether the routingToken field is set. + */ + boolean hasRoutingToken(); + /** + * + * + *
                +   * An optional routing token that influences request routing for the stream.
                +   * Must be provided if a BidiWriteObjectRedirectedError is returned.
                +   * 
                + * + * optional string routing_token = 6; + * + * @return The routingToken. + */ + java.lang.String getRoutingToken(); + /** + * + * + *
                +   * An optional routing token that influences request routing for the stream.
                +   * Must be provided if a BidiWriteObjectRedirectedError is returned.
                +   * 
                + * + * optional string routing_token = 6; + * + * @return The bytes for routingToken. + */ + com.google.protobuf.ByteString getRoutingTokenBytes(); + + /** + * + * + *
                +   * An optional write handle returned from a previous BidiWriteObjectResponse
                +   * message or a BidiWriteObjectRedirectedError error.
                +   * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 7; + * + * @return Whether the writeHandle field is set. + */ + boolean hasWriteHandle(); + /** + * + * + *
                +   * An optional write handle returned from a previous BidiWriteObjectResponse
                +   * message or a BidiWriteObjectRedirectedError error.
                +   * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 7; + * + * @return The writeHandle. + */ + com.google.storage.v2.BidiWriteHandle getWriteHandle(); + /** + * + * + *
                +   * An optional write handle returned from a previous BidiWriteObjectResponse
                +   * message or a BidiWriteObjectRedirectedError error.
                +   * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 7; + */ + com.google.storage.v2.BidiWriteHandleOrBuilder getWriteHandleOrBuilder(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadHandle.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadHandle.java new file mode 100644 index 0000000000..d9e4aafb95 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadHandle.java @@ -0,0 +1,539 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +/** + * + * + *
                + * BidiReadHandle contains a handle from a previous BiDiReadObject
                + * invocation. The client can use this instead of BidiReadObjectSpec as an
                + * optimized way of opening subsequent bidirectional streams to the same object.
                + * 
                + * + * Protobuf type {@code google.storage.v2.BidiReadHandle} + */ +public final class BidiReadHandle extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.BidiReadHandle) + BidiReadHandleOrBuilder { + private static final long serialVersionUID = 0L; + // Use BidiReadHandle.newBuilder() to construct. + private BidiReadHandle(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BidiReadHandle() { + handle_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BidiReadHandle(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadHandle_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadHandle_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.BidiReadHandle.class, + com.google.storage.v2.BidiReadHandle.Builder.class); + } + + public static final int HANDLE_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString handle_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
                +   * Required. Opaque value describing a previous read.
                +   * 
                + * + * bytes handle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The handle. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHandle() { + return handle_; + } + + 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 (!handle_.isEmpty()) { + output.writeBytes(1, handle_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!handle_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, handle_); + } + 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.v2.BidiReadHandle)) { + return super.equals(obj); + } + com.google.storage.v2.BidiReadHandle other = (com.google.storage.v2.BidiReadHandle) obj; + + if (!getHandle().equals(other.getHandle())) 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) + HANDLE_FIELD_NUMBER; + hash = (53 * hash) + getHandle().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.BidiReadHandle parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiReadHandle parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadHandle parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiReadHandle parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadHandle parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiReadHandle parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadHandle parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiReadHandle parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadHandle parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiReadHandle parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadHandle parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiReadHandle parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.storage.v2.BidiReadHandle 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; + } + /** + * + * + *
                +   * BidiReadHandle contains a handle from a previous BiDiReadObject
                +   * invocation. The client can use this instead of BidiReadObjectSpec as an
                +   * optimized way of opening subsequent bidirectional streams to the same object.
                +   * 
                + * + * Protobuf type {@code google.storage.v2.BidiReadHandle} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.BidiReadHandle) + com.google.storage.v2.BidiReadHandleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadHandle_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadHandle_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.BidiReadHandle.class, + com.google.storage.v2.BidiReadHandle.Builder.class); + } + + // Construct using com.google.storage.v2.BidiReadHandle.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + handle_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadHandle_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.BidiReadHandle getDefaultInstanceForType() { + return com.google.storage.v2.BidiReadHandle.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.BidiReadHandle build() { + com.google.storage.v2.BidiReadHandle result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.BidiReadHandle buildPartial() { + com.google.storage.v2.BidiReadHandle result = new com.google.storage.v2.BidiReadHandle(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.storage.v2.BidiReadHandle result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.handle_ = handle_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.BidiReadHandle) { + return mergeFrom((com.google.storage.v2.BidiReadHandle) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.BidiReadHandle other) { + if (other == com.google.storage.v2.BidiReadHandle.getDefaultInstance()) return this; + if (other.getHandle() != com.google.protobuf.ByteString.EMPTY) { + setHandle(other.getHandle()); + } + 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: + { + handle_ = input.readBytes(); + 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 com.google.protobuf.ByteString handle_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
                +     * Required. Opaque value describing a previous read.
                +     * 
                + * + * bytes handle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The handle. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHandle() { + return handle_; + } + /** + * + * + *
                +     * Required. Opaque value describing a previous read.
                +     * 
                + * + * bytes handle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The handle to set. + * @return This builder for chaining. + */ + public Builder setHandle(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + handle_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
                +     * Required. Opaque value describing a previous read.
                +     * 
                + * + * bytes handle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearHandle() { + bitField0_ = (bitField0_ & ~0x00000001); + handle_ = getDefaultInstance().getHandle(); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.storage.v2.BidiReadHandle) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.BidiReadHandle) + private static final com.google.storage.v2.BidiReadHandle DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.BidiReadHandle(); + } + + public static com.google.storage.v2.BidiReadHandle getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BidiReadHandle 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.v2.BidiReadHandle getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadHandleOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadHandleOrBuilder.java new file mode 100644 index 0000000000..0ef938634d --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadHandleOrBuilder.java @@ -0,0 +1,39 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +public interface BidiReadHandleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.BidiReadHandle) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
                +   * Required. Opaque value describing a previous read.
                +   * 
                + * + * bytes handle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The handle. + */ + com.google.protobuf.ByteString getHandle(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectError.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectError.java new file mode 100644 index 0000000000..f20da2344a --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectError.java @@ -0,0 +1,941 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +/** + * + * + *
                + * Error extension proto containing details for all outstanding reads on the
                + * failed stream
                + * 
                + * + * Protobuf type {@code google.storage.v2.BidiReadObjectError} + */ +public final class BidiReadObjectError extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.BidiReadObjectError) + BidiReadObjectErrorOrBuilder { + private static final long serialVersionUID = 0L; + // Use BidiReadObjectError.newBuilder() to construct. + private BidiReadObjectError(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BidiReadObjectError() { + readRangeErrors_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BidiReadObjectError(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.BidiReadObjectError.class, + com.google.storage.v2.BidiReadObjectError.Builder.class); + } + + public static final int READ_RANGE_ERRORS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List readRangeErrors_; + /** + * + * + *
                +   * The error code for each outstanding read_range
                +   * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + @java.lang.Override + public java.util.List getReadRangeErrorsList() { + return readRangeErrors_; + } + /** + * + * + *
                +   * The error code for each outstanding read_range
                +   * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + @java.lang.Override + public java.util.List + getReadRangeErrorsOrBuilderList() { + return readRangeErrors_; + } + /** + * + * + *
                +   * The error code for each outstanding read_range
                +   * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + @java.lang.Override + public int getReadRangeErrorsCount() { + return readRangeErrors_.size(); + } + /** + * + * + *
                +   * The error code for each outstanding read_range
                +   * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + @java.lang.Override + public com.google.storage.v2.ReadRangeError getReadRangeErrors(int index) { + return readRangeErrors_.get(index); + } + /** + * + * + *
                +   * The error code for each outstanding read_range
                +   * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + @java.lang.Override + public com.google.storage.v2.ReadRangeErrorOrBuilder getReadRangeErrorsOrBuilder(int index) { + return readRangeErrors_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < readRangeErrors_.size(); i++) { + output.writeMessage(1, readRangeErrors_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < readRangeErrors_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, readRangeErrors_.get(i)); + } + 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.v2.BidiReadObjectError)) { + return super.equals(obj); + } + com.google.storage.v2.BidiReadObjectError other = + (com.google.storage.v2.BidiReadObjectError) obj; + + if (!getReadRangeErrorsList().equals(other.getReadRangeErrorsList())) 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 (getReadRangeErrorsCount() > 0) { + hash = (37 * hash) + READ_RANGE_ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getReadRangeErrorsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.BidiReadObjectError parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiReadObjectError parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectError parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiReadObjectError parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiReadObjectError parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectError parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiReadObjectError parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectError parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiReadObjectError parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectError parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiReadObjectError parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.storage.v2.BidiReadObjectError 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; + } + /** + * + * + *
                +   * Error extension proto containing details for all outstanding reads on the
                +   * failed stream
                +   * 
                + * + * Protobuf type {@code google.storage.v2.BidiReadObjectError} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.BidiReadObjectError) + com.google.storage.v2.BidiReadObjectErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.BidiReadObjectError.class, + com.google.storage.v2.BidiReadObjectError.Builder.class); + } + + // Construct using com.google.storage.v2.BidiReadObjectError.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (readRangeErrorsBuilder_ == null) { + readRangeErrors_ = java.util.Collections.emptyList(); + } else { + readRangeErrors_ = null; + readRangeErrorsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectError_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.BidiReadObjectError getDefaultInstanceForType() { + return com.google.storage.v2.BidiReadObjectError.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.BidiReadObjectError build() { + com.google.storage.v2.BidiReadObjectError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.BidiReadObjectError buildPartial() { + com.google.storage.v2.BidiReadObjectError result = + new com.google.storage.v2.BidiReadObjectError(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.storage.v2.BidiReadObjectError result) { + if (readRangeErrorsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + readRangeErrors_ = java.util.Collections.unmodifiableList(readRangeErrors_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.readRangeErrors_ = readRangeErrors_; + } else { + result.readRangeErrors_ = readRangeErrorsBuilder_.build(); + } + } + + private void buildPartial0(com.google.storage.v2.BidiReadObjectError result) { + int from_bitField0_ = 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.v2.BidiReadObjectError) { + return mergeFrom((com.google.storage.v2.BidiReadObjectError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.BidiReadObjectError other) { + if (other == com.google.storage.v2.BidiReadObjectError.getDefaultInstance()) return this; + if (readRangeErrorsBuilder_ == null) { + if (!other.readRangeErrors_.isEmpty()) { + if (readRangeErrors_.isEmpty()) { + readRangeErrors_ = other.readRangeErrors_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureReadRangeErrorsIsMutable(); + readRangeErrors_.addAll(other.readRangeErrors_); + } + onChanged(); + } + } else { + if (!other.readRangeErrors_.isEmpty()) { + if (readRangeErrorsBuilder_.isEmpty()) { + readRangeErrorsBuilder_.dispose(); + readRangeErrorsBuilder_ = null; + readRangeErrors_ = other.readRangeErrors_; + bitField0_ = (bitField0_ & ~0x00000001); + readRangeErrorsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getReadRangeErrorsFieldBuilder() + : null; + } else { + readRangeErrorsBuilder_.addAllMessages(other.readRangeErrors_); + } + } + } + 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.v2.ReadRangeError m = + input.readMessage( + com.google.storage.v2.ReadRangeError.parser(), extensionRegistry); + if (readRangeErrorsBuilder_ == null) { + ensureReadRangeErrorsIsMutable(); + readRangeErrors_.add(m); + } else { + readRangeErrorsBuilder_.addMessage(m); + } + 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.util.List readRangeErrors_ = + java.util.Collections.emptyList(); + + private void ensureReadRangeErrorsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + readRangeErrors_ = + new java.util.ArrayList(readRangeErrors_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.ReadRangeError, + com.google.storage.v2.ReadRangeError.Builder, + com.google.storage.v2.ReadRangeErrorOrBuilder> + readRangeErrorsBuilder_; + + /** + * + * + *
                +     * The error code for each outstanding read_range
                +     * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + public java.util.List getReadRangeErrorsList() { + if (readRangeErrorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(readRangeErrors_); + } else { + return readRangeErrorsBuilder_.getMessageList(); + } + } + /** + * + * + *
                +     * The error code for each outstanding read_range
                +     * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + public int getReadRangeErrorsCount() { + if (readRangeErrorsBuilder_ == null) { + return readRangeErrors_.size(); + } else { + return readRangeErrorsBuilder_.getCount(); + } + } + /** + * + * + *
                +     * The error code for each outstanding read_range
                +     * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + public com.google.storage.v2.ReadRangeError getReadRangeErrors(int index) { + if (readRangeErrorsBuilder_ == null) { + return readRangeErrors_.get(index); + } else { + return readRangeErrorsBuilder_.getMessage(index); + } + } + /** + * + * + *
                +     * The error code for each outstanding read_range
                +     * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + public Builder setReadRangeErrors(int index, com.google.storage.v2.ReadRangeError value) { + if (readRangeErrorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReadRangeErrorsIsMutable(); + readRangeErrors_.set(index, value); + onChanged(); + } else { + readRangeErrorsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
                +     * The error code for each outstanding read_range
                +     * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + public Builder setReadRangeErrors( + int index, com.google.storage.v2.ReadRangeError.Builder builderForValue) { + if (readRangeErrorsBuilder_ == null) { + ensureReadRangeErrorsIsMutable(); + readRangeErrors_.set(index, builderForValue.build()); + onChanged(); + } else { + readRangeErrorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
                +     * The error code for each outstanding read_range
                +     * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + public Builder addReadRangeErrors(com.google.storage.v2.ReadRangeError value) { + if (readRangeErrorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReadRangeErrorsIsMutable(); + readRangeErrors_.add(value); + onChanged(); + } else { + readRangeErrorsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
                +     * The error code for each outstanding read_range
                +     * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + public Builder addReadRangeErrors(int index, com.google.storage.v2.ReadRangeError value) { + if (readRangeErrorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReadRangeErrorsIsMutable(); + readRangeErrors_.add(index, value); + onChanged(); + } else { + readRangeErrorsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
                +     * The error code for each outstanding read_range
                +     * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + public Builder addReadRangeErrors( + com.google.storage.v2.ReadRangeError.Builder builderForValue) { + if (readRangeErrorsBuilder_ == null) { + ensureReadRangeErrorsIsMutable(); + readRangeErrors_.add(builderForValue.build()); + onChanged(); + } else { + readRangeErrorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
                +     * The error code for each outstanding read_range
                +     * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + public Builder addReadRangeErrors( + int index, com.google.storage.v2.ReadRangeError.Builder builderForValue) { + if (readRangeErrorsBuilder_ == null) { + ensureReadRangeErrorsIsMutable(); + readRangeErrors_.add(index, builderForValue.build()); + onChanged(); + } else { + readRangeErrorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
                +     * The error code for each outstanding read_range
                +     * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + public Builder addAllReadRangeErrors( + java.lang.Iterable values) { + if (readRangeErrorsBuilder_ == null) { + ensureReadRangeErrorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, readRangeErrors_); + onChanged(); + } else { + readRangeErrorsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
                +     * The error code for each outstanding read_range
                +     * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + public Builder clearReadRangeErrors() { + if (readRangeErrorsBuilder_ == null) { + readRangeErrors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + readRangeErrorsBuilder_.clear(); + } + return this; + } + /** + * + * + *
                +     * The error code for each outstanding read_range
                +     * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + public Builder removeReadRangeErrors(int index) { + if (readRangeErrorsBuilder_ == null) { + ensureReadRangeErrorsIsMutable(); + readRangeErrors_.remove(index); + onChanged(); + } else { + readRangeErrorsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
                +     * The error code for each outstanding read_range
                +     * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + public com.google.storage.v2.ReadRangeError.Builder getReadRangeErrorsBuilder(int index) { + return getReadRangeErrorsFieldBuilder().getBuilder(index); + } + /** + * + * + *
                +     * The error code for each outstanding read_range
                +     * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + public com.google.storage.v2.ReadRangeErrorOrBuilder getReadRangeErrorsOrBuilder(int index) { + if (readRangeErrorsBuilder_ == null) { + return readRangeErrors_.get(index); + } else { + return readRangeErrorsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
                +     * The error code for each outstanding read_range
                +     * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + public java.util.List + getReadRangeErrorsOrBuilderList() { + if (readRangeErrorsBuilder_ != null) { + return readRangeErrorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(readRangeErrors_); + } + } + /** + * + * + *
                +     * The error code for each outstanding read_range
                +     * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + public com.google.storage.v2.ReadRangeError.Builder addReadRangeErrorsBuilder() { + return getReadRangeErrorsFieldBuilder() + .addBuilder(com.google.storage.v2.ReadRangeError.getDefaultInstance()); + } + /** + * + * + *
                +     * The error code for each outstanding read_range
                +     * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + public com.google.storage.v2.ReadRangeError.Builder addReadRangeErrorsBuilder(int index) { + return getReadRangeErrorsFieldBuilder() + .addBuilder(index, com.google.storage.v2.ReadRangeError.getDefaultInstance()); + } + /** + * + * + *
                +     * The error code for each outstanding read_range
                +     * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + public java.util.List + getReadRangeErrorsBuilderList() { + return getReadRangeErrorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.ReadRangeError, + com.google.storage.v2.ReadRangeError.Builder, + com.google.storage.v2.ReadRangeErrorOrBuilder> + getReadRangeErrorsFieldBuilder() { + if (readRangeErrorsBuilder_ == null) { + readRangeErrorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.ReadRangeError, + com.google.storage.v2.ReadRangeError.Builder, + com.google.storage.v2.ReadRangeErrorOrBuilder>( + readRangeErrors_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + readRangeErrors_ = null; + } + return readRangeErrorsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.storage.v2.BidiReadObjectError) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.BidiReadObjectError) + private static final com.google.storage.v2.BidiReadObjectError DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.BidiReadObjectError(); + } + + public static com.google.storage.v2.BidiReadObjectError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BidiReadObjectError 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.v2.BidiReadObjectError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectErrorOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectErrorOrBuilder.java new file mode 100644 index 0000000000..c7ff0c5057 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectErrorOrBuilder.java @@ -0,0 +1,78 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +public interface BidiReadObjectErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.BidiReadObjectError) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
                +   * The error code for each outstanding read_range
                +   * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + java.util.List getReadRangeErrorsList(); + /** + * + * + *
                +   * The error code for each outstanding read_range
                +   * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + com.google.storage.v2.ReadRangeError getReadRangeErrors(int index); + /** + * + * + *
                +   * The error code for each outstanding read_range
                +   * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + int getReadRangeErrorsCount(); + /** + * + * + *
                +   * The error code for each outstanding read_range
                +   * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + java.util.List + getReadRangeErrorsOrBuilderList(); + /** + * + * + *
                +   * The error code for each outstanding read_range
                +   * 
                + * + * repeated .google.storage.v2.ReadRangeError read_range_errors = 1; + */ + com.google.storage.v2.ReadRangeErrorOrBuilder getReadRangeErrorsOrBuilder(int index); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectRedirectedError.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectRedirectedError.java new file mode 100644 index 0000000000..dcb0ff54eb --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectRedirectedError.java @@ -0,0 +1,953 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +/** + * + * + *
                + * Error proto containing details for a redirected read. This error is only
                + * returned on initial open in case of a redirect.
                + * 
                + * + * Protobuf type {@code google.storage.v2.BidiReadObjectRedirectedError} + */ +public final class BidiReadObjectRedirectedError extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.BidiReadObjectRedirectedError) + BidiReadObjectRedirectedErrorOrBuilder { + private static final long serialVersionUID = 0L; + // Use BidiReadObjectRedirectedError.newBuilder() to construct. + private BidiReadObjectRedirectedError(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BidiReadObjectRedirectedError() { + routingToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BidiReadObjectRedirectedError(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectRedirectedError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectRedirectedError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.BidiReadObjectRedirectedError.class, + com.google.storage.v2.BidiReadObjectRedirectedError.Builder.class); + } + + private int bitField0_; + public static final int READ_HANDLE_FIELD_NUMBER = 1; + private com.google.storage.v2.BidiReadHandle readHandle_; + /** + * + * + *
                +   * The read handle for the redirected read. The client can use this for the
                +   * subsequent open.
                +   * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 1; + * + * @return Whether the readHandle field is set. + */ + @java.lang.Override + public boolean hasReadHandle() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
                +   * The read handle for the redirected read. The client can use this for the
                +   * subsequent open.
                +   * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 1; + * + * @return The readHandle. + */ + @java.lang.Override + public com.google.storage.v2.BidiReadHandle getReadHandle() { + return readHandle_ == null + ? com.google.storage.v2.BidiReadHandle.getDefaultInstance() + : readHandle_; + } + /** + * + * + *
                +   * The read handle for the redirected read. The client can use this for the
                +   * subsequent open.
                +   * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 1; + */ + @java.lang.Override + public com.google.storage.v2.BidiReadHandleOrBuilder getReadHandleOrBuilder() { + return readHandle_ == null + ? com.google.storage.v2.BidiReadHandle.getDefaultInstance() + : readHandle_; + } + + public static final int ROUTING_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object routingToken_ = ""; + /** + * + * + *
                +   * The routing token that should be used when reopening the read stream.
                +   * 
                + * + * optional string routing_token = 2; + * + * @return Whether the routingToken field is set. + */ + @java.lang.Override + public boolean hasRoutingToken() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
                +   * The routing token that should be used when reopening the read stream.
                +   * 
                + * + * optional string routing_token = 2; + * + * @return The routingToken. + */ + @java.lang.Override + public java.lang.String getRoutingToken() { + java.lang.Object ref = routingToken_; + 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(); + routingToken_ = s; + return s; + } + } + /** + * + * + *
                +   * The routing token that should be used when reopening the read stream.
                +   * 
                + * + * optional string routing_token = 2; + * + * @return The bytes for routingToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRoutingTokenBytes() { + java.lang.Object ref = routingToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + routingToken_ = 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.writeMessage(1, getReadHandle()); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, routingToken_); + } + 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.computeMessageSize(1, getReadHandle()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, routingToken_); + } + 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.v2.BidiReadObjectRedirectedError)) { + return super.equals(obj); + } + com.google.storage.v2.BidiReadObjectRedirectedError other = + (com.google.storage.v2.BidiReadObjectRedirectedError) obj; + + if (hasReadHandle() != other.hasReadHandle()) return false; + if (hasReadHandle()) { + if (!getReadHandle().equals(other.getReadHandle())) return false; + } + if (hasRoutingToken() != other.hasRoutingToken()) return false; + if (hasRoutingToken()) { + if (!getRoutingToken().equals(other.getRoutingToken())) 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 (hasReadHandle()) { + hash = (37 * hash) + READ_HANDLE_FIELD_NUMBER; + hash = (53 * hash) + getReadHandle().hashCode(); + } + if (hasRoutingToken()) { + hash = (37 * hash) + ROUTING_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getRoutingToken().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.BidiReadObjectRedirectedError parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiReadObjectRedirectedError parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectRedirectedError parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiReadObjectRedirectedError parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectRedirectedError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiReadObjectRedirectedError parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectRedirectedError parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiReadObjectRedirectedError parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectRedirectedError parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiReadObjectRedirectedError parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectRedirectedError parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiReadObjectRedirectedError parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.storage.v2.BidiReadObjectRedirectedError 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; + } + /** + * + * + *
                +   * Error proto containing details for a redirected read. This error is only
                +   * returned on initial open in case of a redirect.
                +   * 
                + * + * Protobuf type {@code google.storage.v2.BidiReadObjectRedirectedError} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.BidiReadObjectRedirectedError) + com.google.storage.v2.BidiReadObjectRedirectedErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectRedirectedError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectRedirectedError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.BidiReadObjectRedirectedError.class, + com.google.storage.v2.BidiReadObjectRedirectedError.Builder.class); + } + + // Construct using com.google.storage.v2.BidiReadObjectRedirectedError.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getReadHandleFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + readHandle_ = null; + if (readHandleBuilder_ != null) { + readHandleBuilder_.dispose(); + readHandleBuilder_ = null; + } + routingToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectRedirectedError_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.BidiReadObjectRedirectedError getDefaultInstanceForType() { + return com.google.storage.v2.BidiReadObjectRedirectedError.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.BidiReadObjectRedirectedError build() { + com.google.storage.v2.BidiReadObjectRedirectedError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.BidiReadObjectRedirectedError buildPartial() { + com.google.storage.v2.BidiReadObjectRedirectedError result = + new com.google.storage.v2.BidiReadObjectRedirectedError(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.storage.v2.BidiReadObjectRedirectedError result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.readHandle_ = readHandleBuilder_ == null ? readHandle_ : readHandleBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.routingToken_ = routingToken_; + to_bitField0_ |= 0x00000002; + } + 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.v2.BidiReadObjectRedirectedError) { + return mergeFrom((com.google.storage.v2.BidiReadObjectRedirectedError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.BidiReadObjectRedirectedError other) { + if (other == com.google.storage.v2.BidiReadObjectRedirectedError.getDefaultInstance()) + return this; + if (other.hasReadHandle()) { + mergeReadHandle(other.getReadHandle()); + } + if (other.hasRoutingToken()) { + routingToken_ = other.routingToken_; + 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: + { + input.readMessage(getReadHandleFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + routingToken_ = 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 com.google.storage.v2.BidiReadHandle readHandle_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.BidiReadHandle, + com.google.storage.v2.BidiReadHandle.Builder, + com.google.storage.v2.BidiReadHandleOrBuilder> + readHandleBuilder_; + /** + * + * + *
                +     * The read handle for the redirected read. The client can use this for the
                +     * subsequent open.
                +     * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 1; + * + * @return Whether the readHandle field is set. + */ + public boolean hasReadHandle() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
                +     * The read handle for the redirected read. The client can use this for the
                +     * subsequent open.
                +     * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 1; + * + * @return The readHandle. + */ + public com.google.storage.v2.BidiReadHandle getReadHandle() { + if (readHandleBuilder_ == null) { + return readHandle_ == null + ? com.google.storage.v2.BidiReadHandle.getDefaultInstance() + : readHandle_; + } else { + return readHandleBuilder_.getMessage(); + } + } + /** + * + * + *
                +     * The read handle for the redirected read. The client can use this for the
                +     * subsequent open.
                +     * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 1; + */ + public Builder setReadHandle(com.google.storage.v2.BidiReadHandle value) { + if (readHandleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readHandle_ = value; + } else { + readHandleBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
                +     * The read handle for the redirected read. The client can use this for the
                +     * subsequent open.
                +     * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 1; + */ + public Builder setReadHandle(com.google.storage.v2.BidiReadHandle.Builder builderForValue) { + if (readHandleBuilder_ == null) { + readHandle_ = builderForValue.build(); + } else { + readHandleBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
                +     * The read handle for the redirected read. The client can use this for the
                +     * subsequent open.
                +     * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 1; + */ + public Builder mergeReadHandle(com.google.storage.v2.BidiReadHandle value) { + if (readHandleBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && readHandle_ != null + && readHandle_ != com.google.storage.v2.BidiReadHandle.getDefaultInstance()) { + getReadHandleBuilder().mergeFrom(value); + } else { + readHandle_ = value; + } + } else { + readHandleBuilder_.mergeFrom(value); + } + if (readHandle_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
                +     * The read handle for the redirected read. The client can use this for the
                +     * subsequent open.
                +     * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 1; + */ + public Builder clearReadHandle() { + bitField0_ = (bitField0_ & ~0x00000001); + readHandle_ = null; + if (readHandleBuilder_ != null) { + readHandleBuilder_.dispose(); + readHandleBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
                +     * The read handle for the redirected read. The client can use this for the
                +     * subsequent open.
                +     * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 1; + */ + public com.google.storage.v2.BidiReadHandle.Builder getReadHandleBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getReadHandleFieldBuilder().getBuilder(); + } + /** + * + * + *
                +     * The read handle for the redirected read. The client can use this for the
                +     * subsequent open.
                +     * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 1; + */ + public com.google.storage.v2.BidiReadHandleOrBuilder getReadHandleOrBuilder() { + if (readHandleBuilder_ != null) { + return readHandleBuilder_.getMessageOrBuilder(); + } else { + return readHandle_ == null + ? com.google.storage.v2.BidiReadHandle.getDefaultInstance() + : readHandle_; + } + } + /** + * + * + *
                +     * The read handle for the redirected read. The client can use this for the
                +     * subsequent open.
                +     * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.BidiReadHandle, + com.google.storage.v2.BidiReadHandle.Builder, + com.google.storage.v2.BidiReadHandleOrBuilder> + getReadHandleFieldBuilder() { + if (readHandleBuilder_ == null) { + readHandleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.BidiReadHandle, + com.google.storage.v2.BidiReadHandle.Builder, + com.google.storage.v2.BidiReadHandleOrBuilder>( + getReadHandle(), getParentForChildren(), isClean()); + readHandle_ = null; + } + return readHandleBuilder_; + } + + private java.lang.Object routingToken_ = ""; + /** + * + * + *
                +     * The routing token that should be used when reopening the read stream.
                +     * 
                + * + * optional string routing_token = 2; + * + * @return Whether the routingToken field is set. + */ + public boolean hasRoutingToken() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
                +     * The routing token that should be used when reopening the read stream.
                +     * 
                + * + * optional string routing_token = 2; + * + * @return The routingToken. + */ + public java.lang.String getRoutingToken() { + java.lang.Object ref = routingToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + routingToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
                +     * The routing token that should be used when reopening the read stream.
                +     * 
                + * + * optional string routing_token = 2; + * + * @return The bytes for routingToken. + */ + public com.google.protobuf.ByteString getRoutingTokenBytes() { + java.lang.Object ref = routingToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + routingToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
                +     * The routing token that should be used when reopening the read stream.
                +     * 
                + * + * optional string routing_token = 2; + * + * @param value The routingToken to set. + * @return This builder for chaining. + */ + public Builder setRoutingToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + routingToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
                +     * The routing token that should be used when reopening the read stream.
                +     * 
                + * + * optional string routing_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearRoutingToken() { + routingToken_ = getDefaultInstance().getRoutingToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
                +     * The routing token that should be used when reopening the read stream.
                +     * 
                + * + * optional string routing_token = 2; + * + * @param value The bytes for routingToken to set. + * @return This builder for chaining. + */ + public Builder setRoutingTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + routingToken_ = 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.v2.BidiReadObjectRedirectedError) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.BidiReadObjectRedirectedError) + private static final com.google.storage.v2.BidiReadObjectRedirectedError DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.BidiReadObjectRedirectedError(); + } + + public static com.google.storage.v2.BidiReadObjectRedirectedError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BidiReadObjectRedirectedError 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.v2.BidiReadObjectRedirectedError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectRedirectedErrorOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectRedirectedErrorOrBuilder.java new file mode 100644 index 0000000000..f739bbac5e --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectRedirectedErrorOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +public interface BidiReadObjectRedirectedErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.BidiReadObjectRedirectedError) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
                +   * The read handle for the redirected read. The client can use this for the
                +   * subsequent open.
                +   * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 1; + * + * @return Whether the readHandle field is set. + */ + boolean hasReadHandle(); + /** + * + * + *
                +   * The read handle for the redirected read. The client can use this for the
                +   * subsequent open.
                +   * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 1; + * + * @return The readHandle. + */ + com.google.storage.v2.BidiReadHandle getReadHandle(); + /** + * + * + *
                +   * The read handle for the redirected read. The client can use this for the
                +   * subsequent open.
                +   * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 1; + */ + com.google.storage.v2.BidiReadHandleOrBuilder getReadHandleOrBuilder(); + + /** + * + * + *
                +   * The routing token that should be used when reopening the read stream.
                +   * 
                + * + * optional string routing_token = 2; + * + * @return Whether the routingToken field is set. + */ + boolean hasRoutingToken(); + /** + * + * + *
                +   * The routing token that should be used when reopening the read stream.
                +   * 
                + * + * optional string routing_token = 2; + * + * @return The routingToken. + */ + java.lang.String getRoutingToken(); + /** + * + * + *
                +   * The routing token that should be used when reopening the read stream.
                +   * 
                + * + * optional string routing_token = 2; + * + * @return The bytes for routingToken. + */ + com.google.protobuf.ByteString getRoutingTokenBytes(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectRequest.java new file mode 100644 index 0000000000..3ec83ea9f1 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectRequest.java @@ -0,0 +1,1341 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +/** + * + * + *
                + * Request message for BidiReadObject.
                + * 
                + * + * Protobuf type {@code google.storage.v2.BidiReadObjectRequest} + */ +public final class BidiReadObjectRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.BidiReadObjectRequest) + BidiReadObjectRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use BidiReadObjectRequest.newBuilder() to construct. + private BidiReadObjectRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BidiReadObjectRequest() { + readRanges_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BidiReadObjectRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.BidiReadObjectRequest.class, + com.google.storage.v2.BidiReadObjectRequest.Builder.class); + } + + private int bitField0_; + public static final int READ_OBJECT_SPEC_FIELD_NUMBER = 1; + private com.google.storage.v2.BidiReadObjectSpec readObjectSpec_; + /** + * + * + *
                +   * The first message of each stream should set this field. If this is not
                +   * the first message, an error will be returned. Describes the object to read.
                +   * 
                + * + * .google.storage.v2.BidiReadObjectSpec read_object_spec = 1; + * + * @return Whether the readObjectSpec field is set. + */ + @java.lang.Override + public boolean hasReadObjectSpec() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
                +   * The first message of each stream should set this field. If this is not
                +   * the first message, an error will be returned. Describes the object to read.
                +   * 
                + * + * .google.storage.v2.BidiReadObjectSpec read_object_spec = 1; + * + * @return The readObjectSpec. + */ + @java.lang.Override + public com.google.storage.v2.BidiReadObjectSpec getReadObjectSpec() { + return readObjectSpec_ == null + ? com.google.storage.v2.BidiReadObjectSpec.getDefaultInstance() + : readObjectSpec_; + } + /** + * + * + *
                +   * The first message of each stream should set this field. If this is not
                +   * the first message, an error will be returned. Describes the object to read.
                +   * 
                + * + * .google.storage.v2.BidiReadObjectSpec read_object_spec = 1; + */ + @java.lang.Override + public com.google.storage.v2.BidiReadObjectSpecOrBuilder getReadObjectSpecOrBuilder() { + return readObjectSpec_ == null + ? com.google.storage.v2.BidiReadObjectSpec.getDefaultInstance() + : readObjectSpec_; + } + + public static final int READ_RANGES_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private java.util.List readRanges_; + /** + * + * + *
                +   * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +   * is large enough to require multiple responses, they are guaranteed to be
                +   * delivered in increasing offset order. There are no ordering guarantees
                +   * across ranges. When no ranges are provided, the response message will not
                +   * include ObjectRangeData. For full object downloads, the offset and size can
                +   * be set to 0.
                +   * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + @java.lang.Override + public java.util.List getReadRangesList() { + return readRanges_; + } + /** + * + * + *
                +   * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +   * is large enough to require multiple responses, they are guaranteed to be
                +   * delivered in increasing offset order. There are no ordering guarantees
                +   * across ranges. When no ranges are provided, the response message will not
                +   * include ObjectRangeData. For full object downloads, the offset and size can
                +   * be set to 0.
                +   * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + @java.lang.Override + public java.util.List + getReadRangesOrBuilderList() { + return readRanges_; + } + /** + * + * + *
                +   * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +   * is large enough to require multiple responses, they are guaranteed to be
                +   * delivered in increasing offset order. There are no ordering guarantees
                +   * across ranges. When no ranges are provided, the response message will not
                +   * include ObjectRangeData. For full object downloads, the offset and size can
                +   * be set to 0.
                +   * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + @java.lang.Override + public int getReadRangesCount() { + return readRanges_.size(); + } + /** + * + * + *
                +   * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +   * is large enough to require multiple responses, they are guaranteed to be
                +   * delivered in increasing offset order. There are no ordering guarantees
                +   * across ranges. When no ranges are provided, the response message will not
                +   * include ObjectRangeData. For full object downloads, the offset and size can
                +   * be set to 0.
                +   * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + @java.lang.Override + public com.google.storage.v2.ReadRange getReadRanges(int index) { + return readRanges_.get(index); + } + /** + * + * + *
                +   * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +   * is large enough to require multiple responses, they are guaranteed to be
                +   * delivered in increasing offset order. There are no ordering guarantees
                +   * across ranges. When no ranges are provided, the response message will not
                +   * include ObjectRangeData. For full object downloads, the offset and size can
                +   * be set to 0.
                +   * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + @java.lang.Override + public com.google.storage.v2.ReadRangeOrBuilder getReadRangesOrBuilder(int index) { + return readRanges_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getReadObjectSpec()); + } + for (int i = 0; i < readRanges_.size(); i++) { + output.writeMessage(8, readRanges_.get(i)); + } + 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.computeMessageSize(1, getReadObjectSpec()); + } + for (int i = 0; i < readRanges_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, readRanges_.get(i)); + } + 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.v2.BidiReadObjectRequest)) { + return super.equals(obj); + } + com.google.storage.v2.BidiReadObjectRequest other = + (com.google.storage.v2.BidiReadObjectRequest) obj; + + if (hasReadObjectSpec() != other.hasReadObjectSpec()) return false; + if (hasReadObjectSpec()) { + if (!getReadObjectSpec().equals(other.getReadObjectSpec())) return false; + } + if (!getReadRangesList().equals(other.getReadRangesList())) 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 (hasReadObjectSpec()) { + hash = (37 * hash) + READ_OBJECT_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getReadObjectSpec().hashCode(); + } + if (getReadRangesCount() > 0) { + hash = (37 * hash) + READ_RANGES_FIELD_NUMBER; + hash = (53 * hash) + getReadRangesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.BidiReadObjectRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiReadObjectRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiReadObjectRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiReadObjectRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiReadObjectRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiReadObjectRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiReadObjectRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.storage.v2.BidiReadObjectRequest 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 BidiReadObject.
                +   * 
                + * + * Protobuf type {@code google.storage.v2.BidiReadObjectRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.BidiReadObjectRequest) + com.google.storage.v2.BidiReadObjectRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.BidiReadObjectRequest.class, + com.google.storage.v2.BidiReadObjectRequest.Builder.class); + } + + // Construct using com.google.storage.v2.BidiReadObjectRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getReadObjectSpecFieldBuilder(); + getReadRangesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + readObjectSpec_ = null; + if (readObjectSpecBuilder_ != null) { + readObjectSpecBuilder_.dispose(); + readObjectSpecBuilder_ = null; + } + if (readRangesBuilder_ == null) { + readRanges_ = java.util.Collections.emptyList(); + } else { + readRanges_ = null; + readRangesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectRequest_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.BidiReadObjectRequest getDefaultInstanceForType() { + return com.google.storage.v2.BidiReadObjectRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.BidiReadObjectRequest build() { + com.google.storage.v2.BidiReadObjectRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.BidiReadObjectRequest buildPartial() { + com.google.storage.v2.BidiReadObjectRequest result = + new com.google.storage.v2.BidiReadObjectRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.storage.v2.BidiReadObjectRequest result) { + if (readRangesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + readRanges_ = java.util.Collections.unmodifiableList(readRanges_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.readRanges_ = readRanges_; + } else { + result.readRanges_ = readRangesBuilder_.build(); + } + } + + private void buildPartial0(com.google.storage.v2.BidiReadObjectRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.readObjectSpec_ = + readObjectSpecBuilder_ == null ? readObjectSpec_ : readObjectSpecBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + 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.v2.BidiReadObjectRequest) { + return mergeFrom((com.google.storage.v2.BidiReadObjectRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.BidiReadObjectRequest other) { + if (other == com.google.storage.v2.BidiReadObjectRequest.getDefaultInstance()) return this; + if (other.hasReadObjectSpec()) { + mergeReadObjectSpec(other.getReadObjectSpec()); + } + if (readRangesBuilder_ == null) { + if (!other.readRanges_.isEmpty()) { + if (readRanges_.isEmpty()) { + readRanges_ = other.readRanges_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureReadRangesIsMutable(); + readRanges_.addAll(other.readRanges_); + } + onChanged(); + } + } else { + if (!other.readRanges_.isEmpty()) { + if (readRangesBuilder_.isEmpty()) { + readRangesBuilder_.dispose(); + readRangesBuilder_ = null; + readRanges_ = other.readRanges_; + bitField0_ = (bitField0_ & ~0x00000002); + readRangesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getReadRangesFieldBuilder() + : null; + } else { + readRangesBuilder_.addAllMessages(other.readRanges_); + } + } + } + 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(getReadObjectSpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 66: + { + com.google.storage.v2.ReadRange m = + input.readMessage(com.google.storage.v2.ReadRange.parser(), extensionRegistry); + if (readRangesBuilder_ == null) { + ensureReadRangesIsMutable(); + readRanges_.add(m); + } else { + readRangesBuilder_.addMessage(m); + } + 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 com.google.storage.v2.BidiReadObjectSpec readObjectSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.BidiReadObjectSpec, + com.google.storage.v2.BidiReadObjectSpec.Builder, + com.google.storage.v2.BidiReadObjectSpecOrBuilder> + readObjectSpecBuilder_; + /** + * + * + *
                +     * The first message of each stream should set this field. If this is not
                +     * the first message, an error will be returned. Describes the object to read.
                +     * 
                + * + * .google.storage.v2.BidiReadObjectSpec read_object_spec = 1; + * + * @return Whether the readObjectSpec field is set. + */ + public boolean hasReadObjectSpec() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
                +     * The first message of each stream should set this field. If this is not
                +     * the first message, an error will be returned. Describes the object to read.
                +     * 
                + * + * .google.storage.v2.BidiReadObjectSpec read_object_spec = 1; + * + * @return The readObjectSpec. + */ + public com.google.storage.v2.BidiReadObjectSpec getReadObjectSpec() { + if (readObjectSpecBuilder_ == null) { + return readObjectSpec_ == null + ? com.google.storage.v2.BidiReadObjectSpec.getDefaultInstance() + : readObjectSpec_; + } else { + return readObjectSpecBuilder_.getMessage(); + } + } + /** + * + * + *
                +     * The first message of each stream should set this field. If this is not
                +     * the first message, an error will be returned. Describes the object to read.
                +     * 
                + * + * .google.storage.v2.BidiReadObjectSpec read_object_spec = 1; + */ + public Builder setReadObjectSpec(com.google.storage.v2.BidiReadObjectSpec value) { + if (readObjectSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readObjectSpec_ = value; + } else { + readObjectSpecBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
                +     * The first message of each stream should set this field. If this is not
                +     * the first message, an error will be returned. Describes the object to read.
                +     * 
                + * + * .google.storage.v2.BidiReadObjectSpec read_object_spec = 1; + */ + public Builder setReadObjectSpec( + com.google.storage.v2.BidiReadObjectSpec.Builder builderForValue) { + if (readObjectSpecBuilder_ == null) { + readObjectSpec_ = builderForValue.build(); + } else { + readObjectSpecBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
                +     * The first message of each stream should set this field. If this is not
                +     * the first message, an error will be returned. Describes the object to read.
                +     * 
                + * + * .google.storage.v2.BidiReadObjectSpec read_object_spec = 1; + */ + public Builder mergeReadObjectSpec(com.google.storage.v2.BidiReadObjectSpec value) { + if (readObjectSpecBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && readObjectSpec_ != null + && readObjectSpec_ != com.google.storage.v2.BidiReadObjectSpec.getDefaultInstance()) { + getReadObjectSpecBuilder().mergeFrom(value); + } else { + readObjectSpec_ = value; + } + } else { + readObjectSpecBuilder_.mergeFrom(value); + } + if (readObjectSpec_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
                +     * The first message of each stream should set this field. If this is not
                +     * the first message, an error will be returned. Describes the object to read.
                +     * 
                + * + * .google.storage.v2.BidiReadObjectSpec read_object_spec = 1; + */ + public Builder clearReadObjectSpec() { + bitField0_ = (bitField0_ & ~0x00000001); + readObjectSpec_ = null; + if (readObjectSpecBuilder_ != null) { + readObjectSpecBuilder_.dispose(); + readObjectSpecBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
                +     * The first message of each stream should set this field. If this is not
                +     * the first message, an error will be returned. Describes the object to read.
                +     * 
                + * + * .google.storage.v2.BidiReadObjectSpec read_object_spec = 1; + */ + public com.google.storage.v2.BidiReadObjectSpec.Builder getReadObjectSpecBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getReadObjectSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
                +     * The first message of each stream should set this field. If this is not
                +     * the first message, an error will be returned. Describes the object to read.
                +     * 
                + * + * .google.storage.v2.BidiReadObjectSpec read_object_spec = 1; + */ + public com.google.storage.v2.BidiReadObjectSpecOrBuilder getReadObjectSpecOrBuilder() { + if (readObjectSpecBuilder_ != null) { + return readObjectSpecBuilder_.getMessageOrBuilder(); + } else { + return readObjectSpec_ == null + ? com.google.storage.v2.BidiReadObjectSpec.getDefaultInstance() + : readObjectSpec_; + } + } + /** + * + * + *
                +     * The first message of each stream should set this field. If this is not
                +     * the first message, an error will be returned. Describes the object to read.
                +     * 
                + * + * .google.storage.v2.BidiReadObjectSpec read_object_spec = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.BidiReadObjectSpec, + com.google.storage.v2.BidiReadObjectSpec.Builder, + com.google.storage.v2.BidiReadObjectSpecOrBuilder> + getReadObjectSpecFieldBuilder() { + if (readObjectSpecBuilder_ == null) { + readObjectSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.BidiReadObjectSpec, + com.google.storage.v2.BidiReadObjectSpec.Builder, + com.google.storage.v2.BidiReadObjectSpecOrBuilder>( + getReadObjectSpec(), getParentForChildren(), isClean()); + readObjectSpec_ = null; + } + return readObjectSpecBuilder_; + } + + private java.util.List readRanges_ = + java.util.Collections.emptyList(); + + private void ensureReadRangesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + readRanges_ = new java.util.ArrayList(readRanges_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.ReadRange, + com.google.storage.v2.ReadRange.Builder, + com.google.storage.v2.ReadRangeOrBuilder> + readRangesBuilder_; + + /** + * + * + *
                +     * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +     * is large enough to require multiple responses, they are guaranteed to be
                +     * delivered in increasing offset order. There are no ordering guarantees
                +     * across ranges. When no ranges are provided, the response message will not
                +     * include ObjectRangeData. For full object downloads, the offset and size can
                +     * be set to 0.
                +     * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + public java.util.List getReadRangesList() { + if (readRangesBuilder_ == null) { + return java.util.Collections.unmodifiableList(readRanges_); + } else { + return readRangesBuilder_.getMessageList(); + } + } + /** + * + * + *
                +     * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +     * is large enough to require multiple responses, they are guaranteed to be
                +     * delivered in increasing offset order. There are no ordering guarantees
                +     * across ranges. When no ranges are provided, the response message will not
                +     * include ObjectRangeData. For full object downloads, the offset and size can
                +     * be set to 0.
                +     * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + public int getReadRangesCount() { + if (readRangesBuilder_ == null) { + return readRanges_.size(); + } else { + return readRangesBuilder_.getCount(); + } + } + /** + * + * + *
                +     * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +     * is large enough to require multiple responses, they are guaranteed to be
                +     * delivered in increasing offset order. There are no ordering guarantees
                +     * across ranges. When no ranges are provided, the response message will not
                +     * include ObjectRangeData. For full object downloads, the offset and size can
                +     * be set to 0.
                +     * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + public com.google.storage.v2.ReadRange getReadRanges(int index) { + if (readRangesBuilder_ == null) { + return readRanges_.get(index); + } else { + return readRangesBuilder_.getMessage(index); + } + } + /** + * + * + *
                +     * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +     * is large enough to require multiple responses, they are guaranteed to be
                +     * delivered in increasing offset order. There are no ordering guarantees
                +     * across ranges. When no ranges are provided, the response message will not
                +     * include ObjectRangeData. For full object downloads, the offset and size can
                +     * be set to 0.
                +     * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + public Builder setReadRanges(int index, com.google.storage.v2.ReadRange value) { + if (readRangesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReadRangesIsMutable(); + readRanges_.set(index, value); + onChanged(); + } else { + readRangesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
                +     * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +     * is large enough to require multiple responses, they are guaranteed to be
                +     * delivered in increasing offset order. There are no ordering guarantees
                +     * across ranges. When no ranges are provided, the response message will not
                +     * include ObjectRangeData. For full object downloads, the offset and size can
                +     * be set to 0.
                +     * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + public Builder setReadRanges( + int index, com.google.storage.v2.ReadRange.Builder builderForValue) { + if (readRangesBuilder_ == null) { + ensureReadRangesIsMutable(); + readRanges_.set(index, builderForValue.build()); + onChanged(); + } else { + readRangesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
                +     * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +     * is large enough to require multiple responses, they are guaranteed to be
                +     * delivered in increasing offset order. There are no ordering guarantees
                +     * across ranges. When no ranges are provided, the response message will not
                +     * include ObjectRangeData. For full object downloads, the offset and size can
                +     * be set to 0.
                +     * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + public Builder addReadRanges(com.google.storage.v2.ReadRange value) { + if (readRangesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReadRangesIsMutable(); + readRanges_.add(value); + onChanged(); + } else { + readRangesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
                +     * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +     * is large enough to require multiple responses, they are guaranteed to be
                +     * delivered in increasing offset order. There are no ordering guarantees
                +     * across ranges. When no ranges are provided, the response message will not
                +     * include ObjectRangeData. For full object downloads, the offset and size can
                +     * be set to 0.
                +     * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + public Builder addReadRanges(int index, com.google.storage.v2.ReadRange value) { + if (readRangesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReadRangesIsMutable(); + readRanges_.add(index, value); + onChanged(); + } else { + readRangesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
                +     * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +     * is large enough to require multiple responses, they are guaranteed to be
                +     * delivered in increasing offset order. There are no ordering guarantees
                +     * across ranges. When no ranges are provided, the response message will not
                +     * include ObjectRangeData. For full object downloads, the offset and size can
                +     * be set to 0.
                +     * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + public Builder addReadRanges(com.google.storage.v2.ReadRange.Builder builderForValue) { + if (readRangesBuilder_ == null) { + ensureReadRangesIsMutable(); + readRanges_.add(builderForValue.build()); + onChanged(); + } else { + readRangesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
                +     * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +     * is large enough to require multiple responses, they are guaranteed to be
                +     * delivered in increasing offset order. There are no ordering guarantees
                +     * across ranges. When no ranges are provided, the response message will not
                +     * include ObjectRangeData. For full object downloads, the offset and size can
                +     * be set to 0.
                +     * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + public Builder addReadRanges( + int index, com.google.storage.v2.ReadRange.Builder builderForValue) { + if (readRangesBuilder_ == null) { + ensureReadRangesIsMutable(); + readRanges_.add(index, builderForValue.build()); + onChanged(); + } else { + readRangesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
                +     * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +     * is large enough to require multiple responses, they are guaranteed to be
                +     * delivered in increasing offset order. There are no ordering guarantees
                +     * across ranges. When no ranges are provided, the response message will not
                +     * include ObjectRangeData. For full object downloads, the offset and size can
                +     * be set to 0.
                +     * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + public Builder addAllReadRanges( + java.lang.Iterable values) { + if (readRangesBuilder_ == null) { + ensureReadRangesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, readRanges_); + onChanged(); + } else { + readRangesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
                +     * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +     * is large enough to require multiple responses, they are guaranteed to be
                +     * delivered in increasing offset order. There are no ordering guarantees
                +     * across ranges. When no ranges are provided, the response message will not
                +     * include ObjectRangeData. For full object downloads, the offset and size can
                +     * be set to 0.
                +     * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + public Builder clearReadRanges() { + if (readRangesBuilder_ == null) { + readRanges_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + readRangesBuilder_.clear(); + } + return this; + } + /** + * + * + *
                +     * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +     * is large enough to require multiple responses, they are guaranteed to be
                +     * delivered in increasing offset order. There are no ordering guarantees
                +     * across ranges. When no ranges are provided, the response message will not
                +     * include ObjectRangeData. For full object downloads, the offset and size can
                +     * be set to 0.
                +     * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + public Builder removeReadRanges(int index) { + if (readRangesBuilder_ == null) { + ensureReadRangesIsMutable(); + readRanges_.remove(index); + onChanged(); + } else { + readRangesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
                +     * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +     * is large enough to require multiple responses, they are guaranteed to be
                +     * delivered in increasing offset order. There are no ordering guarantees
                +     * across ranges. When no ranges are provided, the response message will not
                +     * include ObjectRangeData. For full object downloads, the offset and size can
                +     * be set to 0.
                +     * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + public com.google.storage.v2.ReadRange.Builder getReadRangesBuilder(int index) { + return getReadRangesFieldBuilder().getBuilder(index); + } + /** + * + * + *
                +     * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +     * is large enough to require multiple responses, they are guaranteed to be
                +     * delivered in increasing offset order. There are no ordering guarantees
                +     * across ranges. When no ranges are provided, the response message will not
                +     * include ObjectRangeData. For full object downloads, the offset and size can
                +     * be set to 0.
                +     * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + public com.google.storage.v2.ReadRangeOrBuilder getReadRangesOrBuilder(int index) { + if (readRangesBuilder_ == null) { + return readRanges_.get(index); + } else { + return readRangesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
                +     * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +     * is large enough to require multiple responses, they are guaranteed to be
                +     * delivered in increasing offset order. There are no ordering guarantees
                +     * across ranges. When no ranges are provided, the response message will not
                +     * include ObjectRangeData. For full object downloads, the offset and size can
                +     * be set to 0.
                +     * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + public java.util.List + getReadRangesOrBuilderList() { + if (readRangesBuilder_ != null) { + return readRangesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(readRanges_); + } + } + /** + * + * + *
                +     * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +     * is large enough to require multiple responses, they are guaranteed to be
                +     * delivered in increasing offset order. There are no ordering guarantees
                +     * across ranges. When no ranges are provided, the response message will not
                +     * include ObjectRangeData. For full object downloads, the offset and size can
                +     * be set to 0.
                +     * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + public com.google.storage.v2.ReadRange.Builder addReadRangesBuilder() { + return getReadRangesFieldBuilder() + .addBuilder(com.google.storage.v2.ReadRange.getDefaultInstance()); + } + /** + * + * + *
                +     * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +     * is large enough to require multiple responses, they are guaranteed to be
                +     * delivered in increasing offset order. There are no ordering guarantees
                +     * across ranges. When no ranges are provided, the response message will not
                +     * include ObjectRangeData. For full object downloads, the offset and size can
                +     * be set to 0.
                +     * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + public com.google.storage.v2.ReadRange.Builder addReadRangesBuilder(int index) { + return getReadRangesFieldBuilder() + .addBuilder(index, com.google.storage.v2.ReadRange.getDefaultInstance()); + } + /** + * + * + *
                +     * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +     * is large enough to require multiple responses, they are guaranteed to be
                +     * delivered in increasing offset order. There are no ordering guarantees
                +     * across ranges. When no ranges are provided, the response message will not
                +     * include ObjectRangeData. For full object downloads, the offset and size can
                +     * be set to 0.
                +     * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + public java.util.List getReadRangesBuilderList() { + return getReadRangesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.ReadRange, + com.google.storage.v2.ReadRange.Builder, + com.google.storage.v2.ReadRangeOrBuilder> + getReadRangesFieldBuilder() { + if (readRangesBuilder_ == null) { + readRangesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.ReadRange, + com.google.storage.v2.ReadRange.Builder, + com.google.storage.v2.ReadRangeOrBuilder>( + readRanges_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + readRanges_ = null; + } + return readRangesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.storage.v2.BidiReadObjectRequest) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.BidiReadObjectRequest) + private static final com.google.storage.v2.BidiReadObjectRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.BidiReadObjectRequest(); + } + + public static com.google.storage.v2.BidiReadObjectRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BidiReadObjectRequest 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.v2.BidiReadObjectRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectRequestOrBuilder.java new file mode 100644 index 0000000000..c3924a04f2 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectRequestOrBuilder.java @@ -0,0 +1,140 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +public interface BidiReadObjectRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.BidiReadObjectRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
                +   * The first message of each stream should set this field. If this is not
                +   * the first message, an error will be returned. Describes the object to read.
                +   * 
                + * + * .google.storage.v2.BidiReadObjectSpec read_object_spec = 1; + * + * @return Whether the readObjectSpec field is set. + */ + boolean hasReadObjectSpec(); + /** + * + * + *
                +   * The first message of each stream should set this field. If this is not
                +   * the first message, an error will be returned. Describes the object to read.
                +   * 
                + * + * .google.storage.v2.BidiReadObjectSpec read_object_spec = 1; + * + * @return The readObjectSpec. + */ + com.google.storage.v2.BidiReadObjectSpec getReadObjectSpec(); + /** + * + * + *
                +   * The first message of each stream should set this field. If this is not
                +   * the first message, an error will be returned. Describes the object to read.
                +   * 
                + * + * .google.storage.v2.BidiReadObjectSpec read_object_spec = 1; + */ + com.google.storage.v2.BidiReadObjectSpecOrBuilder getReadObjectSpecOrBuilder(); + + /** + * + * + *
                +   * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +   * is large enough to require multiple responses, they are guaranteed to be
                +   * delivered in increasing offset order. There are no ordering guarantees
                +   * across ranges. When no ranges are provided, the response message will not
                +   * include ObjectRangeData. For full object downloads, the offset and size can
                +   * be set to 0.
                +   * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + java.util.List getReadRangesList(); + /** + * + * + *
                +   * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +   * is large enough to require multiple responses, they are guaranteed to be
                +   * delivered in increasing offset order. There are no ordering guarantees
                +   * across ranges. When no ranges are provided, the response message will not
                +   * include ObjectRangeData. For full object downloads, the offset and size can
                +   * be set to 0.
                +   * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + com.google.storage.v2.ReadRange getReadRanges(int index); + /** + * + * + *
                +   * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +   * is large enough to require multiple responses, they are guaranteed to be
                +   * delivered in increasing offset order. There are no ordering guarantees
                +   * across ranges. When no ranges are provided, the response message will not
                +   * include ObjectRangeData. For full object downloads, the offset and size can
                +   * be set to 0.
                +   * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + int getReadRangesCount(); + /** + * + * + *
                +   * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +   * is large enough to require multiple responses, they are guaranteed to be
                +   * delivered in increasing offset order. There are no ordering guarantees
                +   * across ranges. When no ranges are provided, the response message will not
                +   * include ObjectRangeData. For full object downloads, the offset and size can
                +   * be set to 0.
                +   * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + java.util.List getReadRangesOrBuilderList(); + /** + * + * + *
                +   * Provides a list of 0 or more (up to 100) ranges to read. If a single range
                +   * is large enough to require multiple responses, they are guaranteed to be
                +   * delivered in increasing offset order. There are no ordering guarantees
                +   * across ranges. When no ranges are provided, the response message will not
                +   * include ObjectRangeData. For full object downloads, the offset and size can
                +   * be set to 0.
                +   * 
                + * + * repeated .google.storage.v2.ReadRange read_ranges = 8; + */ + com.google.storage.v2.ReadRangeOrBuilder getReadRangesOrBuilder(int index); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectResponse.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectResponse.java new file mode 100644 index 0000000000..6924cdeeae --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectResponse.java @@ -0,0 +1,1665 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +/** + * + * + *
                + * Response message for BidiReadObject.
                + * 
                + * + * Protobuf type {@code google.storage.v2.BidiReadObjectResponse} + */ +public final class BidiReadObjectResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.BidiReadObjectResponse) + BidiReadObjectResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use BidiReadObjectResponse.newBuilder() to construct. + private BidiReadObjectResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BidiReadObjectResponse() { + objectDataRanges_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BidiReadObjectResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.BidiReadObjectResponse.class, + com.google.storage.v2.BidiReadObjectResponse.Builder.class); + } + + private int bitField0_; + public static final int OBJECT_DATA_RANGES_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private java.util.List objectDataRanges_; + /** + * + * + *
                +   * A portion of the object's data. The service **may** leave data
                +   * empty for any given ReadResponse. This enables the service to inform the
                +   * client that the request is still live while it is running an operation to
                +   * generate more data.
                +   * The service **may** pipeline multiple responses belonging to different read
                +   * requests. Each ObjectRangeData entry will have a read_id
                +   * set to the same value as the corresponding source read request.
                +   * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + @java.lang.Override + public java.util.List getObjectDataRangesList() { + return objectDataRanges_; + } + /** + * + * + *
                +   * A portion of the object's data. The service **may** leave data
                +   * empty for any given ReadResponse. This enables the service to inform the
                +   * client that the request is still live while it is running an operation to
                +   * generate more data.
                +   * The service **may** pipeline multiple responses belonging to different read
                +   * requests. Each ObjectRangeData entry will have a read_id
                +   * set to the same value as the corresponding source read request.
                +   * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + @java.lang.Override + public java.util.List + getObjectDataRangesOrBuilderList() { + return objectDataRanges_; + } + /** + * + * + *
                +   * A portion of the object's data. The service **may** leave data
                +   * empty for any given ReadResponse. This enables the service to inform the
                +   * client that the request is still live while it is running an operation to
                +   * generate more data.
                +   * The service **may** pipeline multiple responses belonging to different read
                +   * requests. Each ObjectRangeData entry will have a read_id
                +   * set to the same value as the corresponding source read request.
                +   * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + @java.lang.Override + public int getObjectDataRangesCount() { + return objectDataRanges_.size(); + } + /** + * + * + *
                +   * A portion of the object's data. The service **may** leave data
                +   * empty for any given ReadResponse. This enables the service to inform the
                +   * client that the request is still live while it is running an operation to
                +   * generate more data.
                +   * The service **may** pipeline multiple responses belonging to different read
                +   * requests. Each ObjectRangeData entry will have a read_id
                +   * set to the same value as the corresponding source read request.
                +   * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + @java.lang.Override + public com.google.storage.v2.ObjectRangeData getObjectDataRanges(int index) { + return objectDataRanges_.get(index); + } + /** + * + * + *
                +   * A portion of the object's data. The service **may** leave data
                +   * empty for any given ReadResponse. This enables the service to inform the
                +   * client that the request is still live while it is running an operation to
                +   * generate more data.
                +   * The service **may** pipeline multiple responses belonging to different read
                +   * requests. Each ObjectRangeData entry will have a read_id
                +   * set to the same value as the corresponding source read request.
                +   * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + @java.lang.Override + public com.google.storage.v2.ObjectRangeDataOrBuilder getObjectDataRangesOrBuilder(int index) { + return objectDataRanges_.get(index); + } + + public static final int METADATA_FIELD_NUMBER = 4; + private com.google.storage.v2.Object metadata_; + /** + * + * + *
                +   * Metadata of the object whose media is being returned.
                +   * Only populated in the first response in the stream and not populated when
                +   * the stream is opened with a read handle.
                +   * 
                + * + * .google.storage.v2.Object metadata = 4; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
                +   * Metadata of the object whose media is being returned.
                +   * Only populated in the first response in the stream and not populated when
                +   * the stream is opened with a read handle.
                +   * 
                + * + * .google.storage.v2.Object metadata = 4; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.storage.v2.Object getMetadata() { + return metadata_ == null ? com.google.storage.v2.Object.getDefaultInstance() : metadata_; + } + /** + * + * + *
                +   * Metadata of the object whose media is being returned.
                +   * Only populated in the first response in the stream and not populated when
                +   * the stream is opened with a read handle.
                +   * 
                + * + * .google.storage.v2.Object metadata = 4; + */ + @java.lang.Override + public com.google.storage.v2.ObjectOrBuilder getMetadataOrBuilder() { + return metadata_ == null ? com.google.storage.v2.Object.getDefaultInstance() : metadata_; + } + + public static final int READ_HANDLE_FIELD_NUMBER = 7; + private com.google.storage.v2.BidiReadHandle readHandle_; + /** + * + * + *
                +   * This field will be periodically refreshed, however it may not be set in
                +   * every response. It allows the client to more efficiently open subsequent
                +   * bidirectional streams to the same object.
                +   * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 7; + * + * @return Whether the readHandle field is set. + */ + @java.lang.Override + public boolean hasReadHandle() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
                +   * This field will be periodically refreshed, however it may not be set in
                +   * every response. It allows the client to more efficiently open subsequent
                +   * bidirectional streams to the same object.
                +   * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 7; + * + * @return The readHandle. + */ + @java.lang.Override + public com.google.storage.v2.BidiReadHandle getReadHandle() { + return readHandle_ == null + ? com.google.storage.v2.BidiReadHandle.getDefaultInstance() + : readHandle_; + } + /** + * + * + *
                +   * This field will be periodically refreshed, however it may not be set in
                +   * every response. It allows the client to more efficiently open subsequent
                +   * bidirectional streams to the same object.
                +   * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 7; + */ + @java.lang.Override + public com.google.storage.v2.BidiReadHandleOrBuilder getReadHandleOrBuilder() { + return readHandle_ == null + ? com.google.storage.v2.BidiReadHandle.getDefaultInstance() + : readHandle_; + } + + 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.writeMessage(4, getMetadata()); + } + for (int i = 0; i < objectDataRanges_.size(); i++) { + output.writeMessage(6, objectDataRanges_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(7, getReadHandle()); + } + 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.computeMessageSize(4, getMetadata()); + } + for (int i = 0; i < objectDataRanges_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, objectDataRanges_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getReadHandle()); + } + 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.v2.BidiReadObjectResponse)) { + return super.equals(obj); + } + com.google.storage.v2.BidiReadObjectResponse other = + (com.google.storage.v2.BidiReadObjectResponse) obj; + + if (!getObjectDataRangesList().equals(other.getObjectDataRangesList())) return false; + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) return false; + } + if (hasReadHandle() != other.hasReadHandle()) return false; + if (hasReadHandle()) { + if (!getReadHandle().equals(other.getReadHandle())) 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 (getObjectDataRangesCount() > 0) { + hash = (37 * hash) + OBJECT_DATA_RANGES_FIELD_NUMBER; + hash = (53 * hash) + getObjectDataRangesList().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + if (hasReadHandle()) { + hash = (37 * hash) + READ_HANDLE_FIELD_NUMBER; + hash = (53 * hash) + getReadHandle().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.BidiReadObjectResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiReadObjectResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiReadObjectResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiReadObjectResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiReadObjectResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiReadObjectResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiReadObjectResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.storage.v2.BidiReadObjectResponse 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 BidiReadObject.
                +   * 
                + * + * Protobuf type {@code google.storage.v2.BidiReadObjectResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.BidiReadObjectResponse) + com.google.storage.v2.BidiReadObjectResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.BidiReadObjectResponse.class, + com.google.storage.v2.BidiReadObjectResponse.Builder.class); + } + + // Construct using com.google.storage.v2.BidiReadObjectResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getObjectDataRangesFieldBuilder(); + getMetadataFieldBuilder(); + getReadHandleFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (objectDataRangesBuilder_ == null) { + objectDataRanges_ = java.util.Collections.emptyList(); + } else { + objectDataRanges_ = null; + objectDataRangesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + readHandle_ = null; + if (readHandleBuilder_ != null) { + readHandleBuilder_.dispose(); + readHandleBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectResponse_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.BidiReadObjectResponse getDefaultInstanceForType() { + return com.google.storage.v2.BidiReadObjectResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.BidiReadObjectResponse build() { + com.google.storage.v2.BidiReadObjectResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.BidiReadObjectResponse buildPartial() { + com.google.storage.v2.BidiReadObjectResponse result = + new com.google.storage.v2.BidiReadObjectResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.storage.v2.BidiReadObjectResponse result) { + if (objectDataRangesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + objectDataRanges_ = java.util.Collections.unmodifiableList(objectDataRanges_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.objectDataRanges_ = objectDataRanges_; + } else { + result.objectDataRanges_ = objectDataRangesBuilder_.build(); + } + } + + private void buildPartial0(com.google.storage.v2.BidiReadObjectResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.metadata_ = metadataBuilder_ == null ? metadata_ : metadataBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.readHandle_ = readHandleBuilder_ == null ? readHandle_ : readHandleBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + 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.v2.BidiReadObjectResponse) { + return mergeFrom((com.google.storage.v2.BidiReadObjectResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.BidiReadObjectResponse other) { + if (other == com.google.storage.v2.BidiReadObjectResponse.getDefaultInstance()) return this; + if (objectDataRangesBuilder_ == null) { + if (!other.objectDataRanges_.isEmpty()) { + if (objectDataRanges_.isEmpty()) { + objectDataRanges_ = other.objectDataRanges_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureObjectDataRangesIsMutable(); + objectDataRanges_.addAll(other.objectDataRanges_); + } + onChanged(); + } + } else { + if (!other.objectDataRanges_.isEmpty()) { + if (objectDataRangesBuilder_.isEmpty()) { + objectDataRangesBuilder_.dispose(); + objectDataRangesBuilder_ = null; + objectDataRanges_ = other.objectDataRanges_; + bitField0_ = (bitField0_ & ~0x00000001); + objectDataRangesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getObjectDataRangesFieldBuilder() + : null; + } else { + objectDataRangesBuilder_.addAllMessages(other.objectDataRanges_); + } + } + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (other.hasReadHandle()) { + mergeReadHandle(other.getReadHandle()); + } + 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 34: + { + input.readMessage(getMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 34 + case 50: + { + com.google.storage.v2.ObjectRangeData m = + input.readMessage( + com.google.storage.v2.ObjectRangeData.parser(), extensionRegistry); + if (objectDataRangesBuilder_ == null) { + ensureObjectDataRangesIsMutable(); + objectDataRanges_.add(m); + } else { + objectDataRangesBuilder_.addMessage(m); + } + break; + } // case 50 + case 58: + { + input.readMessage(getReadHandleFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + 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.util.List objectDataRanges_ = + java.util.Collections.emptyList(); + + private void ensureObjectDataRangesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + objectDataRanges_ = + new java.util.ArrayList(objectDataRanges_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.ObjectRangeData, + com.google.storage.v2.ObjectRangeData.Builder, + com.google.storage.v2.ObjectRangeDataOrBuilder> + objectDataRangesBuilder_; + + /** + * + * + *
                +     * A portion of the object's data. The service **may** leave data
                +     * empty for any given ReadResponse. This enables the service to inform the
                +     * client that the request is still live while it is running an operation to
                +     * generate more data.
                +     * The service **may** pipeline multiple responses belonging to different read
                +     * requests. Each ObjectRangeData entry will have a read_id
                +     * set to the same value as the corresponding source read request.
                +     * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + public java.util.List getObjectDataRangesList() { + if (objectDataRangesBuilder_ == null) { + return java.util.Collections.unmodifiableList(objectDataRanges_); + } else { + return objectDataRangesBuilder_.getMessageList(); + } + } + /** + * + * + *
                +     * A portion of the object's data. The service **may** leave data
                +     * empty for any given ReadResponse. This enables the service to inform the
                +     * client that the request is still live while it is running an operation to
                +     * generate more data.
                +     * The service **may** pipeline multiple responses belonging to different read
                +     * requests. Each ObjectRangeData entry will have a read_id
                +     * set to the same value as the corresponding source read request.
                +     * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + public int getObjectDataRangesCount() { + if (objectDataRangesBuilder_ == null) { + return objectDataRanges_.size(); + } else { + return objectDataRangesBuilder_.getCount(); + } + } + /** + * + * + *
                +     * A portion of the object's data. The service **may** leave data
                +     * empty for any given ReadResponse. This enables the service to inform the
                +     * client that the request is still live while it is running an operation to
                +     * generate more data.
                +     * The service **may** pipeline multiple responses belonging to different read
                +     * requests. Each ObjectRangeData entry will have a read_id
                +     * set to the same value as the corresponding source read request.
                +     * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + public com.google.storage.v2.ObjectRangeData getObjectDataRanges(int index) { + if (objectDataRangesBuilder_ == null) { + return objectDataRanges_.get(index); + } else { + return objectDataRangesBuilder_.getMessage(index); + } + } + /** + * + * + *
                +     * A portion of the object's data. The service **may** leave data
                +     * empty for any given ReadResponse. This enables the service to inform the
                +     * client that the request is still live while it is running an operation to
                +     * generate more data.
                +     * The service **may** pipeline multiple responses belonging to different read
                +     * requests. Each ObjectRangeData entry will have a read_id
                +     * set to the same value as the corresponding source read request.
                +     * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + public Builder setObjectDataRanges(int index, com.google.storage.v2.ObjectRangeData value) { + if (objectDataRangesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureObjectDataRangesIsMutable(); + objectDataRanges_.set(index, value); + onChanged(); + } else { + objectDataRangesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
                +     * A portion of the object's data. The service **may** leave data
                +     * empty for any given ReadResponse. This enables the service to inform the
                +     * client that the request is still live while it is running an operation to
                +     * generate more data.
                +     * The service **may** pipeline multiple responses belonging to different read
                +     * requests. Each ObjectRangeData entry will have a read_id
                +     * set to the same value as the corresponding source read request.
                +     * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + public Builder setObjectDataRanges( + int index, com.google.storage.v2.ObjectRangeData.Builder builderForValue) { + if (objectDataRangesBuilder_ == null) { + ensureObjectDataRangesIsMutable(); + objectDataRanges_.set(index, builderForValue.build()); + onChanged(); + } else { + objectDataRangesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
                +     * A portion of the object's data. The service **may** leave data
                +     * empty for any given ReadResponse. This enables the service to inform the
                +     * client that the request is still live while it is running an operation to
                +     * generate more data.
                +     * The service **may** pipeline multiple responses belonging to different read
                +     * requests. Each ObjectRangeData entry will have a read_id
                +     * set to the same value as the corresponding source read request.
                +     * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + public Builder addObjectDataRanges(com.google.storage.v2.ObjectRangeData value) { + if (objectDataRangesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureObjectDataRangesIsMutable(); + objectDataRanges_.add(value); + onChanged(); + } else { + objectDataRangesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
                +     * A portion of the object's data. The service **may** leave data
                +     * empty for any given ReadResponse. This enables the service to inform the
                +     * client that the request is still live while it is running an operation to
                +     * generate more data.
                +     * The service **may** pipeline multiple responses belonging to different read
                +     * requests. Each ObjectRangeData entry will have a read_id
                +     * set to the same value as the corresponding source read request.
                +     * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + public Builder addObjectDataRanges(int index, com.google.storage.v2.ObjectRangeData value) { + if (objectDataRangesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureObjectDataRangesIsMutable(); + objectDataRanges_.add(index, value); + onChanged(); + } else { + objectDataRangesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
                +     * A portion of the object's data. The service **may** leave data
                +     * empty for any given ReadResponse. This enables the service to inform the
                +     * client that the request is still live while it is running an operation to
                +     * generate more data.
                +     * The service **may** pipeline multiple responses belonging to different read
                +     * requests. Each ObjectRangeData entry will have a read_id
                +     * set to the same value as the corresponding source read request.
                +     * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + public Builder addObjectDataRanges( + com.google.storage.v2.ObjectRangeData.Builder builderForValue) { + if (objectDataRangesBuilder_ == null) { + ensureObjectDataRangesIsMutable(); + objectDataRanges_.add(builderForValue.build()); + onChanged(); + } else { + objectDataRangesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
                +     * A portion of the object's data. The service **may** leave data
                +     * empty for any given ReadResponse. This enables the service to inform the
                +     * client that the request is still live while it is running an operation to
                +     * generate more data.
                +     * The service **may** pipeline multiple responses belonging to different read
                +     * requests. Each ObjectRangeData entry will have a read_id
                +     * set to the same value as the corresponding source read request.
                +     * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + public Builder addObjectDataRanges( + int index, com.google.storage.v2.ObjectRangeData.Builder builderForValue) { + if (objectDataRangesBuilder_ == null) { + ensureObjectDataRangesIsMutable(); + objectDataRanges_.add(index, builderForValue.build()); + onChanged(); + } else { + objectDataRangesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
                +     * A portion of the object's data. The service **may** leave data
                +     * empty for any given ReadResponse. This enables the service to inform the
                +     * client that the request is still live while it is running an operation to
                +     * generate more data.
                +     * The service **may** pipeline multiple responses belonging to different read
                +     * requests. Each ObjectRangeData entry will have a read_id
                +     * set to the same value as the corresponding source read request.
                +     * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + public Builder addAllObjectDataRanges( + java.lang.Iterable values) { + if (objectDataRangesBuilder_ == null) { + ensureObjectDataRangesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, objectDataRanges_); + onChanged(); + } else { + objectDataRangesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
                +     * A portion of the object's data. The service **may** leave data
                +     * empty for any given ReadResponse. This enables the service to inform the
                +     * client that the request is still live while it is running an operation to
                +     * generate more data.
                +     * The service **may** pipeline multiple responses belonging to different read
                +     * requests. Each ObjectRangeData entry will have a read_id
                +     * set to the same value as the corresponding source read request.
                +     * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + public Builder clearObjectDataRanges() { + if (objectDataRangesBuilder_ == null) { + objectDataRanges_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + objectDataRangesBuilder_.clear(); + } + return this; + } + /** + * + * + *
                +     * A portion of the object's data. The service **may** leave data
                +     * empty for any given ReadResponse. This enables the service to inform the
                +     * client that the request is still live while it is running an operation to
                +     * generate more data.
                +     * The service **may** pipeline multiple responses belonging to different read
                +     * requests. Each ObjectRangeData entry will have a read_id
                +     * set to the same value as the corresponding source read request.
                +     * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + public Builder removeObjectDataRanges(int index) { + if (objectDataRangesBuilder_ == null) { + ensureObjectDataRangesIsMutable(); + objectDataRanges_.remove(index); + onChanged(); + } else { + objectDataRangesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
                +     * A portion of the object's data. The service **may** leave data
                +     * empty for any given ReadResponse. This enables the service to inform the
                +     * client that the request is still live while it is running an operation to
                +     * generate more data.
                +     * The service **may** pipeline multiple responses belonging to different read
                +     * requests. Each ObjectRangeData entry will have a read_id
                +     * set to the same value as the corresponding source read request.
                +     * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + public com.google.storage.v2.ObjectRangeData.Builder getObjectDataRangesBuilder(int index) { + return getObjectDataRangesFieldBuilder().getBuilder(index); + } + /** + * + * + *
                +     * A portion of the object's data. The service **may** leave data
                +     * empty for any given ReadResponse. This enables the service to inform the
                +     * client that the request is still live while it is running an operation to
                +     * generate more data.
                +     * The service **may** pipeline multiple responses belonging to different read
                +     * requests. Each ObjectRangeData entry will have a read_id
                +     * set to the same value as the corresponding source read request.
                +     * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + public com.google.storage.v2.ObjectRangeDataOrBuilder getObjectDataRangesOrBuilder(int index) { + if (objectDataRangesBuilder_ == null) { + return objectDataRanges_.get(index); + } else { + return objectDataRangesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
                +     * A portion of the object's data. The service **may** leave data
                +     * empty for any given ReadResponse. This enables the service to inform the
                +     * client that the request is still live while it is running an operation to
                +     * generate more data.
                +     * The service **may** pipeline multiple responses belonging to different read
                +     * requests. Each ObjectRangeData entry will have a read_id
                +     * set to the same value as the corresponding source read request.
                +     * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + public java.util.List + getObjectDataRangesOrBuilderList() { + if (objectDataRangesBuilder_ != null) { + return objectDataRangesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(objectDataRanges_); + } + } + /** + * + * + *
                +     * A portion of the object's data. The service **may** leave data
                +     * empty for any given ReadResponse. This enables the service to inform the
                +     * client that the request is still live while it is running an operation to
                +     * generate more data.
                +     * The service **may** pipeline multiple responses belonging to different read
                +     * requests. Each ObjectRangeData entry will have a read_id
                +     * set to the same value as the corresponding source read request.
                +     * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + public com.google.storage.v2.ObjectRangeData.Builder addObjectDataRangesBuilder() { + return getObjectDataRangesFieldBuilder() + .addBuilder(com.google.storage.v2.ObjectRangeData.getDefaultInstance()); + } + /** + * + * + *
                +     * A portion of the object's data. The service **may** leave data
                +     * empty for any given ReadResponse. This enables the service to inform the
                +     * client that the request is still live while it is running an operation to
                +     * generate more data.
                +     * The service **may** pipeline multiple responses belonging to different read
                +     * requests. Each ObjectRangeData entry will have a read_id
                +     * set to the same value as the corresponding source read request.
                +     * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + public com.google.storage.v2.ObjectRangeData.Builder addObjectDataRangesBuilder(int index) { + return getObjectDataRangesFieldBuilder() + .addBuilder(index, com.google.storage.v2.ObjectRangeData.getDefaultInstance()); + } + /** + * + * + *
                +     * A portion of the object's data. The service **may** leave data
                +     * empty for any given ReadResponse. This enables the service to inform the
                +     * client that the request is still live while it is running an operation to
                +     * generate more data.
                +     * The service **may** pipeline multiple responses belonging to different read
                +     * requests. Each ObjectRangeData entry will have a read_id
                +     * set to the same value as the corresponding source read request.
                +     * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + public java.util.List + getObjectDataRangesBuilderList() { + return getObjectDataRangesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.ObjectRangeData, + com.google.storage.v2.ObjectRangeData.Builder, + com.google.storage.v2.ObjectRangeDataOrBuilder> + getObjectDataRangesFieldBuilder() { + if (objectDataRangesBuilder_ == null) { + objectDataRangesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.ObjectRangeData, + com.google.storage.v2.ObjectRangeData.Builder, + com.google.storage.v2.ObjectRangeDataOrBuilder>( + objectDataRanges_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + objectDataRanges_ = null; + } + return objectDataRangesBuilder_; + } + + private com.google.storage.v2.Object metadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Object, + com.google.storage.v2.Object.Builder, + com.google.storage.v2.ObjectOrBuilder> + metadataBuilder_; + /** + * + * + *
                +     * Metadata of the object whose media is being returned.
                +     * Only populated in the first response in the stream and not populated when
                +     * the stream is opened with a read handle.
                +     * 
                + * + * .google.storage.v2.Object metadata = 4; + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
                +     * Metadata of the object whose media is being returned.
                +     * Only populated in the first response in the stream and not populated when
                +     * the stream is opened with a read handle.
                +     * 
                + * + * .google.storage.v2.Object metadata = 4; + * + * @return The metadata. + */ + public com.google.storage.v2.Object getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null ? com.google.storage.v2.Object.getDefaultInstance() : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
                +     * Metadata of the object whose media is being returned.
                +     * Only populated in the first response in the stream and not populated when
                +     * the stream is opened with a read handle.
                +     * 
                + * + * .google.storage.v2.Object metadata = 4; + */ + public Builder setMetadata(com.google.storage.v2.Object value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
                +     * Metadata of the object whose media is being returned.
                +     * Only populated in the first response in the stream and not populated when
                +     * the stream is opened with a read handle.
                +     * 
                + * + * .google.storage.v2.Object metadata = 4; + */ + public Builder setMetadata(com.google.storage.v2.Object.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
                +     * Metadata of the object whose media is being returned.
                +     * Only populated in the first response in the stream and not populated when
                +     * the stream is opened with a read handle.
                +     * 
                + * + * .google.storage.v2.Object metadata = 4; + */ + public Builder mergeMetadata(com.google.storage.v2.Object value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && metadata_ != null + && metadata_ != com.google.storage.v2.Object.getDefaultInstance()) { + getMetadataBuilder().mergeFrom(value); + } else { + metadata_ = value; + } + } else { + metadataBuilder_.mergeFrom(value); + } + if (metadata_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
                +     * Metadata of the object whose media is being returned.
                +     * Only populated in the first response in the stream and not populated when
                +     * the stream is opened with a read handle.
                +     * 
                + * + * .google.storage.v2.Object metadata = 4; + */ + public Builder clearMetadata() { + bitField0_ = (bitField0_ & ~0x00000002); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
                +     * Metadata of the object whose media is being returned.
                +     * Only populated in the first response in the stream and not populated when
                +     * the stream is opened with a read handle.
                +     * 
                + * + * .google.storage.v2.Object metadata = 4; + */ + public com.google.storage.v2.Object.Builder getMetadataBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
                +     * Metadata of the object whose media is being returned.
                +     * Only populated in the first response in the stream and not populated when
                +     * the stream is opened with a read handle.
                +     * 
                + * + * .google.storage.v2.Object metadata = 4; + */ + public com.google.storage.v2.ObjectOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null ? com.google.storage.v2.Object.getDefaultInstance() : metadata_; + } + } + /** + * + * + *
                +     * Metadata of the object whose media is being returned.
                +     * Only populated in the first response in the stream and not populated when
                +     * the stream is opened with a read handle.
                +     * 
                + * + * .google.storage.v2.Object metadata = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Object, + com.google.storage.v2.Object.Builder, + com.google.storage.v2.ObjectOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Object, + com.google.storage.v2.Object.Builder, + com.google.storage.v2.ObjectOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private com.google.storage.v2.BidiReadHandle readHandle_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.BidiReadHandle, + com.google.storage.v2.BidiReadHandle.Builder, + com.google.storage.v2.BidiReadHandleOrBuilder> + readHandleBuilder_; + /** + * + * + *
                +     * This field will be periodically refreshed, however it may not be set in
                +     * every response. It allows the client to more efficiently open subsequent
                +     * bidirectional streams to the same object.
                +     * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 7; + * + * @return Whether the readHandle field is set. + */ + public boolean hasReadHandle() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
                +     * This field will be periodically refreshed, however it may not be set in
                +     * every response. It allows the client to more efficiently open subsequent
                +     * bidirectional streams to the same object.
                +     * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 7; + * + * @return The readHandle. + */ + public com.google.storage.v2.BidiReadHandle getReadHandle() { + if (readHandleBuilder_ == null) { + return readHandle_ == null + ? com.google.storage.v2.BidiReadHandle.getDefaultInstance() + : readHandle_; + } else { + return readHandleBuilder_.getMessage(); + } + } + /** + * + * + *
                +     * This field will be periodically refreshed, however it may not be set in
                +     * every response. It allows the client to more efficiently open subsequent
                +     * bidirectional streams to the same object.
                +     * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 7; + */ + public Builder setReadHandle(com.google.storage.v2.BidiReadHandle value) { + if (readHandleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readHandle_ = value; + } else { + readHandleBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
                +     * This field will be periodically refreshed, however it may not be set in
                +     * every response. It allows the client to more efficiently open subsequent
                +     * bidirectional streams to the same object.
                +     * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 7; + */ + public Builder setReadHandle(com.google.storage.v2.BidiReadHandle.Builder builderForValue) { + if (readHandleBuilder_ == null) { + readHandle_ = builderForValue.build(); + } else { + readHandleBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
                +     * This field will be periodically refreshed, however it may not be set in
                +     * every response. It allows the client to more efficiently open subsequent
                +     * bidirectional streams to the same object.
                +     * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 7; + */ + public Builder mergeReadHandle(com.google.storage.v2.BidiReadHandle value) { + if (readHandleBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && readHandle_ != null + && readHandle_ != com.google.storage.v2.BidiReadHandle.getDefaultInstance()) { + getReadHandleBuilder().mergeFrom(value); + } else { + readHandle_ = value; + } + } else { + readHandleBuilder_.mergeFrom(value); + } + if (readHandle_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
                +     * This field will be periodically refreshed, however it may not be set in
                +     * every response. It allows the client to more efficiently open subsequent
                +     * bidirectional streams to the same object.
                +     * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 7; + */ + public Builder clearReadHandle() { + bitField0_ = (bitField0_ & ~0x00000004); + readHandle_ = null; + if (readHandleBuilder_ != null) { + readHandleBuilder_.dispose(); + readHandleBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
                +     * This field will be periodically refreshed, however it may not be set in
                +     * every response. It allows the client to more efficiently open subsequent
                +     * bidirectional streams to the same object.
                +     * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 7; + */ + public com.google.storage.v2.BidiReadHandle.Builder getReadHandleBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getReadHandleFieldBuilder().getBuilder(); + } + /** + * + * + *
                +     * This field will be periodically refreshed, however it may not be set in
                +     * every response. It allows the client to more efficiently open subsequent
                +     * bidirectional streams to the same object.
                +     * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 7; + */ + public com.google.storage.v2.BidiReadHandleOrBuilder getReadHandleOrBuilder() { + if (readHandleBuilder_ != null) { + return readHandleBuilder_.getMessageOrBuilder(); + } else { + return readHandle_ == null + ? com.google.storage.v2.BidiReadHandle.getDefaultInstance() + : readHandle_; + } + } + /** + * + * + *
                +     * This field will be periodically refreshed, however it may not be set in
                +     * every response. It allows the client to more efficiently open subsequent
                +     * bidirectional streams to the same object.
                +     * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.BidiReadHandle, + com.google.storage.v2.BidiReadHandle.Builder, + com.google.storage.v2.BidiReadHandleOrBuilder> + getReadHandleFieldBuilder() { + if (readHandleBuilder_ == null) { + readHandleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.BidiReadHandle, + com.google.storage.v2.BidiReadHandle.Builder, + com.google.storage.v2.BidiReadHandleOrBuilder>( + getReadHandle(), getParentForChildren(), isClean()); + readHandle_ = null; + } + return readHandleBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.storage.v2.BidiReadObjectResponse) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.BidiReadObjectResponse) + private static final com.google.storage.v2.BidiReadObjectResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.BidiReadObjectResponse(); + } + + public static com.google.storage.v2.BidiReadObjectResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BidiReadObjectResponse 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.v2.BidiReadObjectResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectResponseOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectResponseOrBuilder.java new file mode 100644 index 0000000000..6f9a98068b --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectResponseOrBuilder.java @@ -0,0 +1,190 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +public interface BidiReadObjectResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.BidiReadObjectResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
                +   * A portion of the object's data. The service **may** leave data
                +   * empty for any given ReadResponse. This enables the service to inform the
                +   * client that the request is still live while it is running an operation to
                +   * generate more data.
                +   * The service **may** pipeline multiple responses belonging to different read
                +   * requests. Each ObjectRangeData entry will have a read_id
                +   * set to the same value as the corresponding source read request.
                +   * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + java.util.List getObjectDataRangesList(); + /** + * + * + *
                +   * A portion of the object's data. The service **may** leave data
                +   * empty for any given ReadResponse. This enables the service to inform the
                +   * client that the request is still live while it is running an operation to
                +   * generate more data.
                +   * The service **may** pipeline multiple responses belonging to different read
                +   * requests. Each ObjectRangeData entry will have a read_id
                +   * set to the same value as the corresponding source read request.
                +   * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + com.google.storage.v2.ObjectRangeData getObjectDataRanges(int index); + /** + * + * + *
                +   * A portion of the object's data. The service **may** leave data
                +   * empty for any given ReadResponse. This enables the service to inform the
                +   * client that the request is still live while it is running an operation to
                +   * generate more data.
                +   * The service **may** pipeline multiple responses belonging to different read
                +   * requests. Each ObjectRangeData entry will have a read_id
                +   * set to the same value as the corresponding source read request.
                +   * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + int getObjectDataRangesCount(); + /** + * + * + *
                +   * A portion of the object's data. The service **may** leave data
                +   * empty for any given ReadResponse. This enables the service to inform the
                +   * client that the request is still live while it is running an operation to
                +   * generate more data.
                +   * The service **may** pipeline multiple responses belonging to different read
                +   * requests. Each ObjectRangeData entry will have a read_id
                +   * set to the same value as the corresponding source read request.
                +   * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + java.util.List + getObjectDataRangesOrBuilderList(); + /** + * + * + *
                +   * A portion of the object's data. The service **may** leave data
                +   * empty for any given ReadResponse. This enables the service to inform the
                +   * client that the request is still live while it is running an operation to
                +   * generate more data.
                +   * The service **may** pipeline multiple responses belonging to different read
                +   * requests. Each ObjectRangeData entry will have a read_id
                +   * set to the same value as the corresponding source read request.
                +   * 
                + * + * repeated .google.storage.v2.ObjectRangeData object_data_ranges = 6; + */ + com.google.storage.v2.ObjectRangeDataOrBuilder getObjectDataRangesOrBuilder(int index); + + /** + * + * + *
                +   * Metadata of the object whose media is being returned.
                +   * Only populated in the first response in the stream and not populated when
                +   * the stream is opened with a read handle.
                +   * 
                + * + * .google.storage.v2.Object metadata = 4; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + * + * + *
                +   * Metadata of the object whose media is being returned.
                +   * Only populated in the first response in the stream and not populated when
                +   * the stream is opened with a read handle.
                +   * 
                + * + * .google.storage.v2.Object metadata = 4; + * + * @return The metadata. + */ + com.google.storage.v2.Object getMetadata(); + /** + * + * + *
                +   * Metadata of the object whose media is being returned.
                +   * Only populated in the first response in the stream and not populated when
                +   * the stream is opened with a read handle.
                +   * 
                + * + * .google.storage.v2.Object metadata = 4; + */ + com.google.storage.v2.ObjectOrBuilder getMetadataOrBuilder(); + + /** + * + * + *
                +   * This field will be periodically refreshed, however it may not be set in
                +   * every response. It allows the client to more efficiently open subsequent
                +   * bidirectional streams to the same object.
                +   * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 7; + * + * @return Whether the readHandle field is set. + */ + boolean hasReadHandle(); + /** + * + * + *
                +   * This field will be periodically refreshed, however it may not be set in
                +   * every response. It allows the client to more efficiently open subsequent
                +   * bidirectional streams to the same object.
                +   * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 7; + * + * @return The readHandle. + */ + com.google.storage.v2.BidiReadHandle getReadHandle(); + /** + * + * + *
                +   * This field will be periodically refreshed, however it may not be set in
                +   * every response. It allows the client to more efficiently open subsequent
                +   * bidirectional streams to the same object.
                +   * 
                + * + * .google.storage.v2.BidiReadHandle read_handle = 7; + */ + com.google.storage.v2.BidiReadHandleOrBuilder getReadHandleOrBuilder(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectSpec.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectSpec.java new file mode 100644 index 0000000000..113c64e14e --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectSpec.java @@ -0,0 +1,2648 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +/** + * + * + *
                + * Describes the object to read in a BidiReadObject request.
                + * 
                + * + * Protobuf type {@code google.storage.v2.BidiReadObjectSpec} + */ +public final class BidiReadObjectSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.BidiReadObjectSpec) + BidiReadObjectSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use BidiReadObjectSpec.newBuilder() to construct. + private BidiReadObjectSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BidiReadObjectSpec() { + bucket_ = ""; + object_ = ""; + routingToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BidiReadObjectSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.BidiReadObjectSpec.class, + com.google.storage.v2.BidiReadObjectSpec.Builder.class); + } + + private int bitField0_; + public static final int BUCKET_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object bucket_ = ""; + /** + * + * + *
                +   * Required. The name of the bucket containing the object to read.
                +   * 
                + * + * + * string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bucket. + */ + @java.lang.Override + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucket_ = s; + return s; + } + } + /** + * + * + *
                +   * Required. The name of the bucket containing the object to read.
                +   * 
                + * + * + * string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for bucket. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OBJECT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object object_ = ""; + /** + * + * + *
                +   * Required. The name of the object to read.
                +   * 
                + * + * string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The object. + */ + @java.lang.Override + public java.lang.String getObject() { + java.lang.Object ref = object_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + object_ = s; + return s; + } + } + /** + * + * + *
                +   * Required. The name of the object to read.
                +   * 
                + * + * string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for object. + */ + @java.lang.Override + public com.google.protobuf.ByteString getObjectBytes() { + java.lang.Object ref = object_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + object_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GENERATION_FIELD_NUMBER = 3; + private long generation_ = 0L; + /** + * + * + *
                +   * If present, selects a specific revision of this object (as opposed
                +   * to the latest version, the default).
                +   * 
                + * + * int64 generation = 3; + * + * @return The generation. + */ + @java.lang.Override + public long getGeneration() { + return generation_; + } + + public static final int IF_GENERATION_MATCH_FIELD_NUMBER = 4; + private long ifGenerationMatch_ = 0L; + /** + * + * + *
                +   * Makes the operation conditional on whether the object's current generation
                +   * matches the given value. Setting to 0 makes the operation succeed only if
                +   * there are no live versions of the object.
                +   * 
                + * + * optional int64 if_generation_match = 4; + * + * @return Whether the ifGenerationMatch field is set. + */ + @java.lang.Override + public boolean hasIfGenerationMatch() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
                +   * Makes the operation conditional on whether the object's current generation
                +   * matches the given value. Setting to 0 makes the operation succeed only if
                +   * there are no live versions of the object.
                +   * 
                + * + * optional int64 if_generation_match = 4; + * + * @return The ifGenerationMatch. + */ + @java.lang.Override + public long getIfGenerationMatch() { + return ifGenerationMatch_; + } + + public static final int IF_GENERATION_NOT_MATCH_FIELD_NUMBER = 5; + private long ifGenerationNotMatch_ = 0L; + /** + * + * + *
                +   * Makes the operation conditional on whether the object's live generation
                +   * does not match the given value. If no live object exists, the precondition
                +   * fails. Setting to 0 makes the operation succeed only if there is a live
                +   * version of the object.
                +   * 
                + * + * optional int64 if_generation_not_match = 5; + * + * @return Whether the ifGenerationNotMatch field is set. + */ + @java.lang.Override + public boolean hasIfGenerationNotMatch() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
                +   * Makes the operation conditional on whether the object's live generation
                +   * does not match the given value. If no live object exists, the precondition
                +   * fails. Setting to 0 makes the operation succeed only if there is a live
                +   * version of the object.
                +   * 
                + * + * optional int64 if_generation_not_match = 5; + * + * @return The ifGenerationNotMatch. + */ + @java.lang.Override + public long getIfGenerationNotMatch() { + return ifGenerationNotMatch_; + } + + public static final int IF_METAGENERATION_MATCH_FIELD_NUMBER = 6; + private long ifMetagenerationMatch_ = 0L; + /** + * + * + *
                +   * Makes the operation conditional on whether the object's current
                +   * metageneration matches the given value.
                +   * 
                + * + * optional int64 if_metageneration_match = 6; + * + * @return Whether the ifMetagenerationMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationMatch() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
                +   * Makes the operation conditional on whether the object's current
                +   * metageneration matches the given value.
                +   * 
                + * + * optional int64 if_metageneration_match = 6; + * + * @return The ifMetagenerationMatch. + */ + @java.lang.Override + public long getIfMetagenerationMatch() { + return ifMetagenerationMatch_; + } + + public static final int IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER = 7; + private long ifMetagenerationNotMatch_ = 0L; + /** + * + * + *
                +   * Makes the operation conditional on whether the object's current
                +   * metageneration does not match the given value.
                +   * 
                + * + * optional int64 if_metageneration_not_match = 7; + * + * @return Whether the ifMetagenerationNotMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationNotMatch() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
                +   * Makes the operation conditional on whether the object's current
                +   * metageneration does not match the given value.
                +   * 
                + * + * optional int64 if_metageneration_not_match = 7; + * + * @return The ifMetagenerationNotMatch. + */ + @java.lang.Override + public long getIfMetagenerationNotMatch() { + return ifMetagenerationNotMatch_; + } + + public static final int COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER = 8; + private com.google.storage.v2.CommonObjectRequestParams commonObjectRequestParams_; + /** + * + * + *
                +   * A set of parameters common to Storage API requests concerning an object.
                +   * 
                + * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + * + * @return Whether the commonObjectRequestParams field is set. + */ + @java.lang.Override + public boolean hasCommonObjectRequestParams() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
                +   * A set of parameters common to Storage API requests concerning an object.
                +   * 
                + * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + * + * @return The commonObjectRequestParams. + */ + @java.lang.Override + public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { + return commonObjectRequestParams_ == null + ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() + : commonObjectRequestParams_; + } + /** + * + * + *
                +   * A set of parameters common to Storage API requests concerning an object.
                +   * 
                + * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + */ + @java.lang.Override + public com.google.storage.v2.CommonObjectRequestParamsOrBuilder + getCommonObjectRequestParamsOrBuilder() { + return commonObjectRequestParams_ == null + ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() + : commonObjectRequestParams_; + } + + public static final int READ_MASK_FIELD_NUMBER = 12; + private com.google.protobuf.FieldMask readMask_; + /** + * + * + *
                +   * Mask specifying which fields to read.
                +   * The checksummed_data field and its children will always be present.
                +   * If no mask is specified, will default to all fields except metadata.owner
                +   * and metadata.acl.
                +   * * may be used to mean "all fields".
                +   * As per https://google.aip.dev/161, this field is deprecated.
                +   * As an alternative, grpc metadata can be used:
                +   * https://cloud.google.com/apis/docs/system-parameters#definitions
                +   * 
                + * + * optional .google.protobuf.FieldMask read_mask = 12 [deprecated = true]; + * + * @deprecated google.storage.v2.BidiReadObjectSpec.read_mask is deprecated. See + * google/storage/v2/storage.proto;l=987 + * @return Whether the readMask field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasReadMask() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
                +   * Mask specifying which fields to read.
                +   * The checksummed_data field and its children will always be present.
                +   * If no mask is specified, will default to all fields except metadata.owner
                +   * and metadata.acl.
                +   * * may be used to mean "all fields".
                +   * As per https://google.aip.dev/161, this field is deprecated.
                +   * As an alternative, grpc metadata can be used:
                +   * https://cloud.google.com/apis/docs/system-parameters#definitions
                +   * 
                + * + * optional .google.protobuf.FieldMask read_mask = 12 [deprecated = true]; + * + * @deprecated google.storage.v2.BidiReadObjectSpec.read_mask is deprecated. See + * google/storage/v2/storage.proto;l=987 + * @return The readMask. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.FieldMask getReadMask() { + return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; + } + /** + * + * + *
                +   * Mask specifying which fields to read.
                +   * The checksummed_data field and its children will always be present.
                +   * If no mask is specified, will default to all fields except metadata.owner
                +   * and metadata.acl.
                +   * * may be used to mean "all fields".
                +   * As per https://google.aip.dev/161, this field is deprecated.
                +   * As an alternative, grpc metadata can be used:
                +   * https://cloud.google.com/apis/docs/system-parameters#definitions
                +   * 
                + * + * optional .google.protobuf.FieldMask read_mask = 12 [deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder() { + return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; + } + + public static final int READ_HANDLE_FIELD_NUMBER = 13; + private com.google.storage.v2.BidiReadHandle readHandle_; + /** + * + * + *
                +   * The client can optionally set this field. The read handle is an optimized
                +   * way of creating new streams. Read handles are generated and periodically
                +   * refreshed from prior reads.
                +   * 
                + * + * optional .google.storage.v2.BidiReadHandle read_handle = 13; + * + * @return Whether the readHandle field is set. + */ + @java.lang.Override + public boolean hasReadHandle() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
                +   * The client can optionally set this field. The read handle is an optimized
                +   * way of creating new streams. Read handles are generated and periodically
                +   * refreshed from prior reads.
                +   * 
                + * + * optional .google.storage.v2.BidiReadHandle read_handle = 13; + * + * @return The readHandle. + */ + @java.lang.Override + public com.google.storage.v2.BidiReadHandle getReadHandle() { + return readHandle_ == null + ? com.google.storage.v2.BidiReadHandle.getDefaultInstance() + : readHandle_; + } + /** + * + * + *
                +   * The client can optionally set this field. The read handle is an optimized
                +   * way of creating new streams. Read handles are generated and periodically
                +   * refreshed from prior reads.
                +   * 
                + * + * optional .google.storage.v2.BidiReadHandle read_handle = 13; + */ + @java.lang.Override + public com.google.storage.v2.BidiReadHandleOrBuilder getReadHandleOrBuilder() { + return readHandle_ == null + ? com.google.storage.v2.BidiReadHandle.getDefaultInstance() + : readHandle_; + } + + public static final int ROUTING_TOKEN_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private volatile java.lang.Object routingToken_ = ""; + /** + * + * + *
                +   * The routing token that influences request routing for the stream. Must be
                +   * provided if a BidiReadObjectRedirectedError is returned.
                +   * 
                + * + * optional string routing_token = 14; + * + * @return Whether the routingToken field is set. + */ + @java.lang.Override + public boolean hasRoutingToken() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
                +   * The routing token that influences request routing for the stream. Must be
                +   * provided if a BidiReadObjectRedirectedError is returned.
                +   * 
                + * + * optional string routing_token = 14; + * + * @return The routingToken. + */ + @java.lang.Override + public java.lang.String getRoutingToken() { + java.lang.Object ref = routingToken_; + 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(); + routingToken_ = s; + return s; + } + } + /** + * + * + *
                +   * The routing token that influences request routing for the stream. Must be
                +   * provided if a BidiReadObjectRedirectedError is returned.
                +   * 
                + * + * optional string routing_token = 14; + * + * @return The bytes for routingToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRoutingTokenBytes() { + java.lang.Object ref = routingToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + routingToken_ = 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(bucket_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, bucket_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(object_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, object_); + } + if (generation_ != 0L) { + output.writeInt64(3, generation_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt64(4, ifGenerationMatch_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt64(5, ifGenerationNotMatch_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt64(6, ifMetagenerationMatch_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeInt64(7, ifMetagenerationNotMatch_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(8, getCommonObjectRequestParams()); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(12, getReadMask()); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(13, getReadHandle()); + } + if (((bitField0_ & 0x00000080) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, routingToken_); + } + 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(bucket_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, bucket_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(object_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, object_); + } + if (generation_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, generation_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, ifGenerationMatch_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, ifGenerationNotMatch_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(6, ifMetagenerationMatch_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(7, ifMetagenerationNotMatch_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, getCommonObjectRequestParams()); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getReadMask()); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getReadHandle()); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, routingToken_); + } + 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.v2.BidiReadObjectSpec)) { + return super.equals(obj); + } + com.google.storage.v2.BidiReadObjectSpec other = (com.google.storage.v2.BidiReadObjectSpec) obj; + + if (!getBucket().equals(other.getBucket())) return false; + if (!getObject().equals(other.getObject())) return false; + if (getGeneration() != other.getGeneration()) return false; + if (hasIfGenerationMatch() != other.hasIfGenerationMatch()) return false; + if (hasIfGenerationMatch()) { + if (getIfGenerationMatch() != other.getIfGenerationMatch()) return false; + } + if (hasIfGenerationNotMatch() != other.hasIfGenerationNotMatch()) return false; + if (hasIfGenerationNotMatch()) { + if (getIfGenerationNotMatch() != other.getIfGenerationNotMatch()) return false; + } + if (hasIfMetagenerationMatch() != other.hasIfMetagenerationMatch()) return false; + if (hasIfMetagenerationMatch()) { + if (getIfMetagenerationMatch() != other.getIfMetagenerationMatch()) return false; + } + if (hasIfMetagenerationNotMatch() != other.hasIfMetagenerationNotMatch()) return false; + if (hasIfMetagenerationNotMatch()) { + if (getIfMetagenerationNotMatch() != other.getIfMetagenerationNotMatch()) return false; + } + if (hasCommonObjectRequestParams() != other.hasCommonObjectRequestParams()) return false; + if (hasCommonObjectRequestParams()) { + if (!getCommonObjectRequestParams().equals(other.getCommonObjectRequestParams())) + return false; + } + if (hasReadMask() != other.hasReadMask()) return false; + if (hasReadMask()) { + if (!getReadMask().equals(other.getReadMask())) return false; + } + if (hasReadHandle() != other.hasReadHandle()) return false; + if (hasReadHandle()) { + if (!getReadHandle().equals(other.getReadHandle())) return false; + } + if (hasRoutingToken() != other.hasRoutingToken()) return false; + if (hasRoutingToken()) { + if (!getRoutingToken().equals(other.getRoutingToken())) 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) + BUCKET_FIELD_NUMBER; + hash = (53 * hash) + getBucket().hashCode(); + hash = (37 * hash) + OBJECT_FIELD_NUMBER; + hash = (53 * hash) + getObject().hashCode(); + hash = (37 * hash) + GENERATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getGeneration()); + if (hasIfGenerationMatch()) { + hash = (37 * hash) + IF_GENERATION_MATCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfGenerationMatch()); + } + if (hasIfGenerationNotMatch()) { + hash = (37 * hash) + IF_GENERATION_NOT_MATCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfGenerationNotMatch()); + } + if (hasIfMetagenerationMatch()) { + hash = (37 * hash) + IF_METAGENERATION_MATCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationMatch()); + } + if (hasIfMetagenerationNotMatch()) { + hash = (37 * hash) + IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationNotMatch()); + } + if (hasCommonObjectRequestParams()) { + hash = (37 * hash) + COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER; + hash = (53 * hash) + getCommonObjectRequestParams().hashCode(); + } + if (hasReadMask()) { + hash = (37 * hash) + READ_MASK_FIELD_NUMBER; + hash = (53 * hash) + getReadMask().hashCode(); + } + if (hasReadHandle()) { + hash = (37 * hash) + READ_HANDLE_FIELD_NUMBER; + hash = (53 * hash) + getReadHandle().hashCode(); + } + if (hasRoutingToken()) { + hash = (37 * hash) + ROUTING_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getRoutingToken().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.BidiReadObjectSpec parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiReadObjectSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiReadObjectSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiReadObjectSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectSpec parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiReadObjectSpec parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiReadObjectSpec parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.BidiReadObjectSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiReadObjectSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.storage.v2.BidiReadObjectSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
                +   * Describes the object to read in a BidiReadObject request.
                +   * 
                + * + * Protobuf type {@code google.storage.v2.BidiReadObjectSpec} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.BidiReadObjectSpec) + com.google.storage.v2.BidiReadObjectSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.BidiReadObjectSpec.class, + com.google.storage.v2.BidiReadObjectSpec.Builder.class); + } + + // Construct using com.google.storage.v2.BidiReadObjectSpec.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCommonObjectRequestParamsFieldBuilder(); + getReadMaskFieldBuilder(); + getReadHandleFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + bucket_ = ""; + object_ = ""; + generation_ = 0L; + ifGenerationMatch_ = 0L; + ifGenerationNotMatch_ = 0L; + ifMetagenerationMatch_ = 0L; + ifMetagenerationNotMatch_ = 0L; + commonObjectRequestParams_ = null; + if (commonObjectRequestParamsBuilder_ != null) { + commonObjectRequestParamsBuilder_.dispose(); + commonObjectRequestParamsBuilder_ = null; + } + readMask_ = null; + if (readMaskBuilder_ != null) { + readMaskBuilder_.dispose(); + readMaskBuilder_ = null; + } + readHandle_ = null; + if (readHandleBuilder_ != null) { + readHandleBuilder_.dispose(); + readHandleBuilder_ = null; + } + routingToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiReadObjectSpec_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.BidiReadObjectSpec getDefaultInstanceForType() { + return com.google.storage.v2.BidiReadObjectSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.BidiReadObjectSpec build() { + com.google.storage.v2.BidiReadObjectSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.BidiReadObjectSpec buildPartial() { + com.google.storage.v2.BidiReadObjectSpec result = + new com.google.storage.v2.BidiReadObjectSpec(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.storage.v2.BidiReadObjectSpec result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.bucket_ = bucket_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.object_ = object_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.generation_ = generation_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.ifGenerationMatch_ = ifGenerationMatch_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.ifGenerationNotMatch_ = ifGenerationNotMatch_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.ifMetagenerationMatch_ = ifMetagenerationMatch_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.ifMetagenerationNotMatch_ = ifMetagenerationNotMatch_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.commonObjectRequestParams_ = + commonObjectRequestParamsBuilder_ == null + ? commonObjectRequestParams_ + : commonObjectRequestParamsBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.readMask_ = readMaskBuilder_ == null ? readMask_ : readMaskBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.readHandle_ = readHandleBuilder_ == null ? readHandle_ : readHandleBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.routingToken_ = routingToken_; + to_bitField0_ |= 0x00000080; + } + 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.v2.BidiReadObjectSpec) { + return mergeFrom((com.google.storage.v2.BidiReadObjectSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.BidiReadObjectSpec other) { + if (other == com.google.storage.v2.BidiReadObjectSpec.getDefaultInstance()) return this; + if (!other.getBucket().isEmpty()) { + bucket_ = other.bucket_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getObject().isEmpty()) { + object_ = other.object_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getGeneration() != 0L) { + setGeneration(other.getGeneration()); + } + if (other.hasIfGenerationMatch()) { + setIfGenerationMatch(other.getIfGenerationMatch()); + } + if (other.hasIfGenerationNotMatch()) { + setIfGenerationNotMatch(other.getIfGenerationNotMatch()); + } + if (other.hasIfMetagenerationMatch()) { + setIfMetagenerationMatch(other.getIfMetagenerationMatch()); + } + if (other.hasIfMetagenerationNotMatch()) { + setIfMetagenerationNotMatch(other.getIfMetagenerationNotMatch()); + } + if (other.hasCommonObjectRequestParams()) { + mergeCommonObjectRequestParams(other.getCommonObjectRequestParams()); + } + if (other.hasReadMask()) { + mergeReadMask(other.getReadMask()); + } + if (other.hasReadHandle()) { + mergeReadHandle(other.getReadHandle()); + } + if (other.hasRoutingToken()) { + routingToken_ = other.routingToken_; + bitField0_ |= 0x00000400; + 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: + { + bucket_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + object_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + generation_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + ifGenerationMatch_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + ifGenerationNotMatch_ = input.readInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: + { + ifMetagenerationMatch_ = input.readInt64(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: + { + ifMetagenerationNotMatch_ = input.readInt64(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 66: + { + input.readMessage( + getCommonObjectRequestParamsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 98: + { + input.readMessage(getReadMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 98 + case 106: + { + input.readMessage(getReadHandleFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 106 + case 114: + { + routingToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 114 + 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 bucket_ = ""; + /** + * + * + *
                +     * Required. The name of the bucket containing the object to read.
                +     * 
                + * + * + * string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bucket. + */ + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucket_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
                +     * Required. The name of the bucket containing the object to read.
                +     * 
                + * + * + * string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for bucket. + */ + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
                +     * Required. The name of the bucket containing the object to read.
                +     * 
                + * + * + * string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bucket to set. + * @return This builder for chaining. + */ + public Builder setBucket(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bucket_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
                +     * Required. The name of the bucket containing the object to read.
                +     * 
                + * + * + * string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearBucket() { + bucket_ = getDefaultInstance().getBucket(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
                +     * Required. The name of the bucket containing the object to read.
                +     * 
                + * + * + * string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for bucket to set. + * @return This builder for chaining. + */ + public Builder setBucketBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bucket_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object object_ = ""; + /** + * + * + *
                +     * Required. The name of the object to read.
                +     * 
                + * + * string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The object. + */ + public java.lang.String getObject() { + java.lang.Object ref = object_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + object_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
                +     * Required. The name of the object to read.
                +     * 
                + * + * string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for object. + */ + public com.google.protobuf.ByteString getObjectBytes() { + java.lang.Object ref = object_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + object_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
                +     * Required. The name of the object to read.
                +     * 
                + * + * string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The object to set. + * @return This builder for chaining. + */ + public Builder setObject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + object_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
                +     * Required. The name of the object to read.
                +     * 
                + * + * string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearObject() { + object_ = getDefaultInstance().getObject(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
                +     * Required. The name of the object to read.
                +     * 
                + * + * string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for object to set. + * @return This builder for chaining. + */ + public Builder setObjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + object_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long generation_; + /** + * + * + *
                +     * If present, selects a specific revision of this object (as opposed
                +     * to the latest version, the default).
                +     * 
                + * + * int64 generation = 3; + * + * @return The generation. + */ + @java.lang.Override + public long getGeneration() { + return generation_; + } + /** + * + * + *
                +     * If present, selects a specific revision of this object (as opposed
                +     * to the latest version, the default).
                +     * 
                + * + * int64 generation = 3; + * + * @param value The generation to set. + * @return This builder for chaining. + */ + public Builder setGeneration(long value) { + + generation_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
                +     * If present, selects a specific revision of this object (as opposed
                +     * to the latest version, the default).
                +     * 
                + * + * int64 generation = 3; + * + * @return This builder for chaining. + */ + public Builder clearGeneration() { + bitField0_ = (bitField0_ & ~0x00000004); + generation_ = 0L; + onChanged(); + return this; + } + + private long ifGenerationMatch_; + /** + * + * + *
                +     * Makes the operation conditional on whether the object's current generation
                +     * matches the given value. Setting to 0 makes the operation succeed only if
                +     * there are no live versions of the object.
                +     * 
                + * + * optional int64 if_generation_match = 4; + * + * @return Whether the ifGenerationMatch field is set. + */ + @java.lang.Override + public boolean hasIfGenerationMatch() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
                +     * Makes the operation conditional on whether the object's current generation
                +     * matches the given value. Setting to 0 makes the operation succeed only if
                +     * there are no live versions of the object.
                +     * 
                + * + * optional int64 if_generation_match = 4; + * + * @return The ifGenerationMatch. + */ + @java.lang.Override + public long getIfGenerationMatch() { + return ifGenerationMatch_; + } + /** + * + * + *
                +     * Makes the operation conditional on whether the object's current generation
                +     * matches the given value. Setting to 0 makes the operation succeed only if
                +     * there are no live versions of the object.
                +     * 
                + * + * optional int64 if_generation_match = 4; + * + * @param value The ifGenerationMatch to set. + * @return This builder for chaining. + */ + public Builder setIfGenerationMatch(long value) { + + ifGenerationMatch_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
                +     * Makes the operation conditional on whether the object's current generation
                +     * matches the given value. Setting to 0 makes the operation succeed only if
                +     * there are no live versions of the object.
                +     * 
                + * + * optional int64 if_generation_match = 4; + * + * @return This builder for chaining. + */ + public Builder clearIfGenerationMatch() { + bitField0_ = (bitField0_ & ~0x00000008); + ifGenerationMatch_ = 0L; + onChanged(); + return this; + } + + private long ifGenerationNotMatch_; + /** + * + * + *
                +     * Makes the operation conditional on whether the object's live generation
                +     * does not match the given value. If no live object exists, the precondition
                +     * fails. Setting to 0 makes the operation succeed only if there is a live
                +     * version of the object.
                +     * 
                + * + * optional int64 if_generation_not_match = 5; + * + * @return Whether the ifGenerationNotMatch field is set. + */ + @java.lang.Override + public boolean hasIfGenerationNotMatch() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
                +     * Makes the operation conditional on whether the object's live generation
                +     * does not match the given value. If no live object exists, the precondition
                +     * fails. Setting to 0 makes the operation succeed only if there is a live
                +     * version of the object.
                +     * 
                + * + * optional int64 if_generation_not_match = 5; + * + * @return The ifGenerationNotMatch. + */ + @java.lang.Override + public long getIfGenerationNotMatch() { + return ifGenerationNotMatch_; + } + /** + * + * + *
                +     * Makes the operation conditional on whether the object's live generation
                +     * does not match the given value. If no live object exists, the precondition
                +     * fails. Setting to 0 makes the operation succeed only if there is a live
                +     * version of the object.
                +     * 
                + * + * optional int64 if_generation_not_match = 5; + * + * @param value The ifGenerationNotMatch to set. + * @return This builder for chaining. + */ + public Builder setIfGenerationNotMatch(long value) { + + ifGenerationNotMatch_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
                +     * Makes the operation conditional on whether the object's live generation
                +     * does not match the given value. If no live object exists, the precondition
                +     * fails. Setting to 0 makes the operation succeed only if there is a live
                +     * version of the object.
                +     * 
                + * + * optional int64 if_generation_not_match = 5; + * + * @return This builder for chaining. + */ + public Builder clearIfGenerationNotMatch() { + bitField0_ = (bitField0_ & ~0x00000010); + ifGenerationNotMatch_ = 0L; + onChanged(); + return this; + } + + private long ifMetagenerationMatch_; + /** + * + * + *
                +     * Makes the operation conditional on whether the object's current
                +     * metageneration matches the given value.
                +     * 
                + * + * optional int64 if_metageneration_match = 6; + * + * @return Whether the ifMetagenerationMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationMatch() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
                +     * Makes the operation conditional on whether the object's current
                +     * metageneration matches the given value.
                +     * 
                + * + * optional int64 if_metageneration_match = 6; + * + * @return The ifMetagenerationMatch. + */ + @java.lang.Override + public long getIfMetagenerationMatch() { + return ifMetagenerationMatch_; + } + /** + * + * + *
                +     * Makes the operation conditional on whether the object's current
                +     * metageneration matches the given value.
                +     * 
                + * + * optional int64 if_metageneration_match = 6; + * + * @param value The ifMetagenerationMatch to set. + * @return This builder for chaining. + */ + public Builder setIfMetagenerationMatch(long value) { + + ifMetagenerationMatch_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
                +     * Makes the operation conditional on whether the object's current
                +     * metageneration matches the given value.
                +     * 
                + * + * optional int64 if_metageneration_match = 6; + * + * @return This builder for chaining. + */ + public Builder clearIfMetagenerationMatch() { + bitField0_ = (bitField0_ & ~0x00000020); + ifMetagenerationMatch_ = 0L; + onChanged(); + return this; + } + + private long ifMetagenerationNotMatch_; + /** + * + * + *
                +     * Makes the operation conditional on whether the object's current
                +     * metageneration does not match the given value.
                +     * 
                + * + * optional int64 if_metageneration_not_match = 7; + * + * @return Whether the ifMetagenerationNotMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationNotMatch() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
                +     * Makes the operation conditional on whether the object's current
                +     * metageneration does not match the given value.
                +     * 
                + * + * optional int64 if_metageneration_not_match = 7; + * + * @return The ifMetagenerationNotMatch. + */ + @java.lang.Override + public long getIfMetagenerationNotMatch() { + return ifMetagenerationNotMatch_; + } + /** + * + * + *
                +     * Makes the operation conditional on whether the object's current
                +     * metageneration does not match the given value.
                +     * 
                + * + * optional int64 if_metageneration_not_match = 7; + * + * @param value The ifMetagenerationNotMatch to set. + * @return This builder for chaining. + */ + public Builder setIfMetagenerationNotMatch(long value) { + + ifMetagenerationNotMatch_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
                +     * Makes the operation conditional on whether the object's current
                +     * metageneration does not match the given value.
                +     * 
                + * + * optional int64 if_metageneration_not_match = 7; + * + * @return This builder for chaining. + */ + public Builder clearIfMetagenerationNotMatch() { + bitField0_ = (bitField0_ & ~0x00000040); + ifMetagenerationNotMatch_ = 0L; + onChanged(); + return this; + } + + private com.google.storage.v2.CommonObjectRequestParams commonObjectRequestParams_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonObjectRequestParams, + com.google.storage.v2.CommonObjectRequestParams.Builder, + com.google.storage.v2.CommonObjectRequestParamsOrBuilder> + commonObjectRequestParamsBuilder_; + /** + * + * + *
                +     * A set of parameters common to Storage API requests concerning an object.
                +     * 
                + * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + * + * @return Whether the commonObjectRequestParams field is set. + */ + public boolean hasCommonObjectRequestParams() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
                +     * A set of parameters common to Storage API requests concerning an object.
                +     * 
                + * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + * + * @return The commonObjectRequestParams. + */ + public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { + if (commonObjectRequestParamsBuilder_ == null) { + return commonObjectRequestParams_ == null + ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() + : commonObjectRequestParams_; + } else { + return commonObjectRequestParamsBuilder_.getMessage(); + } + } + /** + * + * + *
                +     * A set of parameters common to Storage API requests concerning an object.
                +     * 
                + * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + */ + public Builder setCommonObjectRequestParams( + com.google.storage.v2.CommonObjectRequestParams value) { + if (commonObjectRequestParamsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonObjectRequestParams_ = value; + } else { + commonObjectRequestParamsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
                +     * A set of parameters common to Storage API requests concerning an object.
                +     * 
                + * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + */ + public Builder setCommonObjectRequestParams( + com.google.storage.v2.CommonObjectRequestParams.Builder builderForValue) { + if (commonObjectRequestParamsBuilder_ == null) { + commonObjectRequestParams_ = builderForValue.build(); + } else { + commonObjectRequestParamsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
                +     * A set of parameters common to Storage API requests concerning an object.
                +     * 
                + * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + */ + public Builder mergeCommonObjectRequestParams( + com.google.storage.v2.CommonObjectRequestParams value) { + if (commonObjectRequestParamsBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && commonObjectRequestParams_ != null + && commonObjectRequestParams_ + != com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance()) { + getCommonObjectRequestParamsBuilder().mergeFrom(value); + } else { + commonObjectRequestParams_ = value; + } + } else { + commonObjectRequestParamsBuilder_.mergeFrom(value); + } + if (commonObjectRequestParams_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + /** + * + * + *
                +     * A set of parameters common to Storage API requests concerning an object.
                +     * 
                + * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + */ + public Builder clearCommonObjectRequestParams() { + bitField0_ = (bitField0_ & ~0x00000080); + commonObjectRequestParams_ = null; + if (commonObjectRequestParamsBuilder_ != null) { + commonObjectRequestParamsBuilder_.dispose(); + commonObjectRequestParamsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
                +     * A set of parameters common to Storage API requests concerning an object.
                +     * 
                + * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + */ + public com.google.storage.v2.CommonObjectRequestParams.Builder + getCommonObjectRequestParamsBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getCommonObjectRequestParamsFieldBuilder().getBuilder(); + } + /** + * + * + *
                +     * A set of parameters common to Storage API requests concerning an object.
                +     * 
                + * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + */ + public com.google.storage.v2.CommonObjectRequestParamsOrBuilder + getCommonObjectRequestParamsOrBuilder() { + if (commonObjectRequestParamsBuilder_ != null) { + return commonObjectRequestParamsBuilder_.getMessageOrBuilder(); + } else { + return commonObjectRequestParams_ == null + ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() + : commonObjectRequestParams_; + } + } + /** + * + * + *
                +     * A set of parameters common to Storage API requests concerning an object.
                +     * 
                + * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonObjectRequestParams, + com.google.storage.v2.CommonObjectRequestParams.Builder, + com.google.storage.v2.CommonObjectRequestParamsOrBuilder> + getCommonObjectRequestParamsFieldBuilder() { + if (commonObjectRequestParamsBuilder_ == null) { + commonObjectRequestParamsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonObjectRequestParams, + com.google.storage.v2.CommonObjectRequestParams.Builder, + com.google.storage.v2.CommonObjectRequestParamsOrBuilder>( + getCommonObjectRequestParams(), getParentForChildren(), isClean()); + commonObjectRequestParams_ = null; + } + return commonObjectRequestParamsBuilder_; + } + + private com.google.protobuf.FieldMask readMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + readMaskBuilder_; + /** + * + * + *
                +     * Mask specifying which fields to read.
                +     * The checksummed_data field and its children will always be present.
                +     * If no mask is specified, will default to all fields except metadata.owner
                +     * and metadata.acl.
                +     * * may be used to mean "all fields".
                +     * As per https://google.aip.dev/161, this field is deprecated.
                +     * As an alternative, grpc metadata can be used:
                +     * https://cloud.google.com/apis/docs/system-parameters#definitions
                +     * 
                + * + * optional .google.protobuf.FieldMask read_mask = 12 [deprecated = true]; + * + * @deprecated google.storage.v2.BidiReadObjectSpec.read_mask is deprecated. See + * google/storage/v2/storage.proto;l=987 + * @return Whether the readMask field is set. + */ + @java.lang.Deprecated + public boolean hasReadMask() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
                +     * Mask specifying which fields to read.
                +     * The checksummed_data field and its children will always be present.
                +     * If no mask is specified, will default to all fields except metadata.owner
                +     * and metadata.acl.
                +     * * may be used to mean "all fields".
                +     * As per https://google.aip.dev/161, this field is deprecated.
                +     * As an alternative, grpc metadata can be used:
                +     * https://cloud.google.com/apis/docs/system-parameters#definitions
                +     * 
                + * + * optional .google.protobuf.FieldMask read_mask = 12 [deprecated = true]; + * + * @deprecated google.storage.v2.BidiReadObjectSpec.read_mask is deprecated. See + * google/storage/v2/storage.proto;l=987 + * @return The readMask. + */ + @java.lang.Deprecated + public com.google.protobuf.FieldMask getReadMask() { + if (readMaskBuilder_ == null) { + return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; + } else { + return readMaskBuilder_.getMessage(); + } + } + /** + * + * + *
                +     * Mask specifying which fields to read.
                +     * The checksummed_data field and its children will always be present.
                +     * If no mask is specified, will default to all fields except metadata.owner
                +     * and metadata.acl.
                +     * * may be used to mean "all fields".
                +     * As per https://google.aip.dev/161, this field is deprecated.
                +     * As an alternative, grpc metadata can be used:
                +     * https://cloud.google.com/apis/docs/system-parameters#definitions
                +     * 
                + * + * optional .google.protobuf.FieldMask read_mask = 12 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setReadMask(com.google.protobuf.FieldMask value) { + if (readMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readMask_ = value; + } else { + readMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
                +     * Mask specifying which fields to read.
                +     * The checksummed_data field and its children will always be present.
                +     * If no mask is specified, will default to all fields except metadata.owner
                +     * and metadata.acl.
                +     * * may be used to mean "all fields".
                +     * As per https://google.aip.dev/161, this field is deprecated.
                +     * As an alternative, grpc metadata can be used:
                +     * https://cloud.google.com/apis/docs/system-parameters#definitions
                +     * 
                + * + * optional .google.protobuf.FieldMask read_mask = 12 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setReadMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (readMaskBuilder_ == null) { + readMask_ = builderForValue.build(); + } else { + readMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
                +     * Mask specifying which fields to read.
                +     * The checksummed_data field and its children will always be present.
                +     * If no mask is specified, will default to all fields except metadata.owner
                +     * and metadata.acl.
                +     * * may be used to mean "all fields".
                +     * As per https://google.aip.dev/161, this field is deprecated.
                +     * As an alternative, grpc metadata can be used:
                +     * https://cloud.google.com/apis/docs/system-parameters#definitions
                +     * 
                + * + * optional .google.protobuf.FieldMask read_mask = 12 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder mergeReadMask(com.google.protobuf.FieldMask value) { + if (readMaskBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && readMask_ != null + && readMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getReadMaskBuilder().mergeFrom(value); + } else { + readMask_ = value; + } + } else { + readMaskBuilder_.mergeFrom(value); + } + if (readMask_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + /** + * + * + *
                +     * Mask specifying which fields to read.
                +     * The checksummed_data field and its children will always be present.
                +     * If no mask is specified, will default to all fields except metadata.owner
                +     * and metadata.acl.
                +     * * may be used to mean "all fields".
                +     * As per https://google.aip.dev/161, this field is deprecated.
                +     * As an alternative, grpc metadata can be used:
                +     * https://cloud.google.com/apis/docs/system-parameters#definitions
                +     * 
                + * + * optional .google.protobuf.FieldMask read_mask = 12 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder clearReadMask() { + bitField0_ = (bitField0_ & ~0x00000100); + readMask_ = null; + if (readMaskBuilder_ != null) { + readMaskBuilder_.dispose(); + readMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
                +     * Mask specifying which fields to read.
                +     * The checksummed_data field and its children will always be present.
                +     * If no mask is specified, will default to all fields except metadata.owner
                +     * and metadata.acl.
                +     * * may be used to mean "all fields".
                +     * As per https://google.aip.dev/161, this field is deprecated.
                +     * As an alternative, grpc metadata can be used:
                +     * https://cloud.google.com/apis/docs/system-parameters#definitions
                +     * 
                + * + * optional .google.protobuf.FieldMask read_mask = 12 [deprecated = true]; + */ + @java.lang.Deprecated + public com.google.protobuf.FieldMask.Builder getReadMaskBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getReadMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
                +     * Mask specifying which fields to read.
                +     * The checksummed_data field and its children will always be present.
                +     * If no mask is specified, will default to all fields except metadata.owner
                +     * and metadata.acl.
                +     * * may be used to mean "all fields".
                +     * As per https://google.aip.dev/161, this field is deprecated.
                +     * As an alternative, grpc metadata can be used:
                +     * https://cloud.google.com/apis/docs/system-parameters#definitions
                +     * 
                + * + * optional .google.protobuf.FieldMask read_mask = 12 [deprecated = true]; + */ + @java.lang.Deprecated + public com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder() { + if (readMaskBuilder_ != null) { + return readMaskBuilder_.getMessageOrBuilder(); + } else { + return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; + } + } + /** + * + * + *
                +     * Mask specifying which fields to read.
                +     * The checksummed_data field and its children will always be present.
                +     * If no mask is specified, will default to all fields except metadata.owner
                +     * and metadata.acl.
                +     * * may be used to mean "all fields".
                +     * As per https://google.aip.dev/161, this field is deprecated.
                +     * As an alternative, grpc metadata can be used:
                +     * https://cloud.google.com/apis/docs/system-parameters#definitions
                +     * 
                + * + * optional .google.protobuf.FieldMask read_mask = 12 [deprecated = true]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getReadMaskFieldBuilder() { + if (readMaskBuilder_ == null) { + readMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getReadMask(), getParentForChildren(), isClean()); + readMask_ = null; + } + return readMaskBuilder_; + } + + private com.google.storage.v2.BidiReadHandle readHandle_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.BidiReadHandle, + com.google.storage.v2.BidiReadHandle.Builder, + com.google.storage.v2.BidiReadHandleOrBuilder> + readHandleBuilder_; + /** + * + * + *
                +     * The client can optionally set this field. The read handle is an optimized
                +     * way of creating new streams. Read handles are generated and periodically
                +     * refreshed from prior reads.
                +     * 
                + * + * optional .google.storage.v2.BidiReadHandle read_handle = 13; + * + * @return Whether the readHandle field is set. + */ + public boolean hasReadHandle() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * + * + *
                +     * The client can optionally set this field. The read handle is an optimized
                +     * way of creating new streams. Read handles are generated and periodically
                +     * refreshed from prior reads.
                +     * 
                + * + * optional .google.storage.v2.BidiReadHandle read_handle = 13; + * + * @return The readHandle. + */ + public com.google.storage.v2.BidiReadHandle getReadHandle() { + if (readHandleBuilder_ == null) { + return readHandle_ == null + ? com.google.storage.v2.BidiReadHandle.getDefaultInstance() + : readHandle_; + } else { + return readHandleBuilder_.getMessage(); + } + } + /** + * + * + *
                +     * The client can optionally set this field. The read handle is an optimized
                +     * way of creating new streams. Read handles are generated and periodically
                +     * refreshed from prior reads.
                +     * 
                + * + * optional .google.storage.v2.BidiReadHandle read_handle = 13; + */ + public Builder setReadHandle(com.google.storage.v2.BidiReadHandle value) { + if (readHandleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readHandle_ = value; + } else { + readHandleBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
                +     * The client can optionally set this field. The read handle is an optimized
                +     * way of creating new streams. Read handles are generated and periodically
                +     * refreshed from prior reads.
                +     * 
                + * + * optional .google.storage.v2.BidiReadHandle read_handle = 13; + */ + public Builder setReadHandle(com.google.storage.v2.BidiReadHandle.Builder builderForValue) { + if (readHandleBuilder_ == null) { + readHandle_ = builderForValue.build(); + } else { + readHandleBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
                +     * The client can optionally set this field. The read handle is an optimized
                +     * way of creating new streams. Read handles are generated and periodically
                +     * refreshed from prior reads.
                +     * 
                + * + * optional .google.storage.v2.BidiReadHandle read_handle = 13; + */ + public Builder mergeReadHandle(com.google.storage.v2.BidiReadHandle value) { + if (readHandleBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && readHandle_ != null + && readHandle_ != com.google.storage.v2.BidiReadHandle.getDefaultInstance()) { + getReadHandleBuilder().mergeFrom(value); + } else { + readHandle_ = value; + } + } else { + readHandleBuilder_.mergeFrom(value); + } + if (readHandle_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + /** + * + * + *
                +     * The client can optionally set this field. The read handle is an optimized
                +     * way of creating new streams. Read handles are generated and periodically
                +     * refreshed from prior reads.
                +     * 
                + * + * optional .google.storage.v2.BidiReadHandle read_handle = 13; + */ + public Builder clearReadHandle() { + bitField0_ = (bitField0_ & ~0x00000200); + readHandle_ = null; + if (readHandleBuilder_ != null) { + readHandleBuilder_.dispose(); + readHandleBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
                +     * The client can optionally set this field. The read handle is an optimized
                +     * way of creating new streams. Read handles are generated and periodically
                +     * refreshed from prior reads.
                +     * 
                + * + * optional .google.storage.v2.BidiReadHandle read_handle = 13; + */ + public com.google.storage.v2.BidiReadHandle.Builder getReadHandleBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getReadHandleFieldBuilder().getBuilder(); + } + /** + * + * + *
                +     * The client can optionally set this field. The read handle is an optimized
                +     * way of creating new streams. Read handles are generated and periodically
                +     * refreshed from prior reads.
                +     * 
                + * + * optional .google.storage.v2.BidiReadHandle read_handle = 13; + */ + public com.google.storage.v2.BidiReadHandleOrBuilder getReadHandleOrBuilder() { + if (readHandleBuilder_ != null) { + return readHandleBuilder_.getMessageOrBuilder(); + } else { + return readHandle_ == null + ? com.google.storage.v2.BidiReadHandle.getDefaultInstance() + : readHandle_; + } + } + /** + * + * + *
                +     * The client can optionally set this field. The read handle is an optimized
                +     * way of creating new streams. Read handles are generated and periodically
                +     * refreshed from prior reads.
                +     * 
                + * + * optional .google.storage.v2.BidiReadHandle read_handle = 13; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.BidiReadHandle, + com.google.storage.v2.BidiReadHandle.Builder, + com.google.storage.v2.BidiReadHandleOrBuilder> + getReadHandleFieldBuilder() { + if (readHandleBuilder_ == null) { + readHandleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.BidiReadHandle, + com.google.storage.v2.BidiReadHandle.Builder, + com.google.storage.v2.BidiReadHandleOrBuilder>( + getReadHandle(), getParentForChildren(), isClean()); + readHandle_ = null; + } + return readHandleBuilder_; + } + + private java.lang.Object routingToken_ = ""; + /** + * + * + *
                +     * The routing token that influences request routing for the stream. Must be
                +     * provided if a BidiReadObjectRedirectedError is returned.
                +     * 
                + * + * optional string routing_token = 14; + * + * @return Whether the routingToken field is set. + */ + public boolean hasRoutingToken() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * + * + *
                +     * The routing token that influences request routing for the stream. Must be
                +     * provided if a BidiReadObjectRedirectedError is returned.
                +     * 
                + * + * optional string routing_token = 14; + * + * @return The routingToken. + */ + public java.lang.String getRoutingToken() { + java.lang.Object ref = routingToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + routingToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
                +     * The routing token that influences request routing for the stream. Must be
                +     * provided if a BidiReadObjectRedirectedError is returned.
                +     * 
                + * + * optional string routing_token = 14; + * + * @return The bytes for routingToken. + */ + public com.google.protobuf.ByteString getRoutingTokenBytes() { + java.lang.Object ref = routingToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + routingToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
                +     * The routing token that influences request routing for the stream. Must be
                +     * provided if a BidiReadObjectRedirectedError is returned.
                +     * 
                + * + * optional string routing_token = 14; + * + * @param value The routingToken to set. + * @return This builder for chaining. + */ + public Builder setRoutingToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + routingToken_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
                +     * The routing token that influences request routing for the stream. Must be
                +     * provided if a BidiReadObjectRedirectedError is returned.
                +     * 
                + * + * optional string routing_token = 14; + * + * @return This builder for chaining. + */ + public Builder clearRoutingToken() { + routingToken_ = getDefaultInstance().getRoutingToken(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + * + * + *
                +     * The routing token that influences request routing for the stream. Must be
                +     * provided if a BidiReadObjectRedirectedError is returned.
                +     * 
                + * + * optional string routing_token = 14; + * + * @param value The bytes for routingToken to set. + * @return This builder for chaining. + */ + public Builder setRoutingTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + routingToken_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.storage.v2.BidiReadObjectSpec) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.BidiReadObjectSpec) + private static final com.google.storage.v2.BidiReadObjectSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.BidiReadObjectSpec(); + } + + public static com.google.storage.v2.BidiReadObjectSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BidiReadObjectSpec 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.v2.BidiReadObjectSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectSpecOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectSpecOrBuilder.java new file mode 100644 index 0000000000..6a0ce440d8 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiReadObjectSpecOrBuilder.java @@ -0,0 +1,387 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +public interface BidiReadObjectSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.BidiReadObjectSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
                +   * Required. The name of the bucket containing the object to read.
                +   * 
                + * + * + * string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bucket. + */ + java.lang.String getBucket(); + /** + * + * + *
                +   * Required. The name of the bucket containing the object to read.
                +   * 
                + * + * + * string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for bucket. + */ + com.google.protobuf.ByteString getBucketBytes(); + + /** + * + * + *
                +   * Required. The name of the object to read.
                +   * 
                + * + * string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The object. + */ + java.lang.String getObject(); + /** + * + * + *
                +   * Required. The name of the object to read.
                +   * 
                + * + * string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for object. + */ + com.google.protobuf.ByteString getObjectBytes(); + + /** + * + * + *
                +   * If present, selects a specific revision of this object (as opposed
                +   * to the latest version, the default).
                +   * 
                + * + * int64 generation = 3; + * + * @return The generation. + */ + long getGeneration(); + + /** + * + * + *
                +   * Makes the operation conditional on whether the object's current generation
                +   * matches the given value. Setting to 0 makes the operation succeed only if
                +   * there are no live versions of the object.
                +   * 
                + * + * optional int64 if_generation_match = 4; + * + * @return Whether the ifGenerationMatch field is set. + */ + boolean hasIfGenerationMatch(); + /** + * + * + *
                +   * Makes the operation conditional on whether the object's current generation
                +   * matches the given value. Setting to 0 makes the operation succeed only if
                +   * there are no live versions of the object.
                +   * 
                + * + * optional int64 if_generation_match = 4; + * + * @return The ifGenerationMatch. + */ + long getIfGenerationMatch(); + + /** + * + * + *
                +   * Makes the operation conditional on whether the object's live generation
                +   * does not match the given value. If no live object exists, the precondition
                +   * fails. Setting to 0 makes the operation succeed only if there is a live
                +   * version of the object.
                +   * 
                + * + * optional int64 if_generation_not_match = 5; + * + * @return Whether the ifGenerationNotMatch field is set. + */ + boolean hasIfGenerationNotMatch(); + /** + * + * + *
                +   * Makes the operation conditional on whether the object's live generation
                +   * does not match the given value. If no live object exists, the precondition
                +   * fails. Setting to 0 makes the operation succeed only if there is a live
                +   * version of the object.
                +   * 
                + * + * optional int64 if_generation_not_match = 5; + * + * @return The ifGenerationNotMatch. + */ + long getIfGenerationNotMatch(); + + /** + * + * + *
                +   * Makes the operation conditional on whether the object's current
                +   * metageneration matches the given value.
                +   * 
                + * + * optional int64 if_metageneration_match = 6; + * + * @return Whether the ifMetagenerationMatch field is set. + */ + boolean hasIfMetagenerationMatch(); + /** + * + * + *
                +   * Makes the operation conditional on whether the object's current
                +   * metageneration matches the given value.
                +   * 
                + * + * optional int64 if_metageneration_match = 6; + * + * @return The ifMetagenerationMatch. + */ + long getIfMetagenerationMatch(); + + /** + * + * + *
                +   * Makes the operation conditional on whether the object's current
                +   * metageneration does not match the given value.
                +   * 
                + * + * optional int64 if_metageneration_not_match = 7; + * + * @return Whether the ifMetagenerationNotMatch field is set. + */ + boolean hasIfMetagenerationNotMatch(); + /** + * + * + *
                +   * Makes the operation conditional on whether the object's current
                +   * metageneration does not match the given value.
                +   * 
                + * + * optional int64 if_metageneration_not_match = 7; + * + * @return The ifMetagenerationNotMatch. + */ + long getIfMetagenerationNotMatch(); + + /** + * + * + *
                +   * A set of parameters common to Storage API requests concerning an object.
                +   * 
                + * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + * + * @return Whether the commonObjectRequestParams field is set. + */ + boolean hasCommonObjectRequestParams(); + /** + * + * + *
                +   * A set of parameters common to Storage API requests concerning an object.
                +   * 
                + * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + * + * @return The commonObjectRequestParams. + */ + com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams(); + /** + * + * + *
                +   * A set of parameters common to Storage API requests concerning an object.
                +   * 
                + * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + */ + com.google.storage.v2.CommonObjectRequestParamsOrBuilder getCommonObjectRequestParamsOrBuilder(); + + /** + * + * + *
                +   * Mask specifying which fields to read.
                +   * The checksummed_data field and its children will always be present.
                +   * If no mask is specified, will default to all fields except metadata.owner
                +   * and metadata.acl.
                +   * * may be used to mean "all fields".
                +   * As per https://google.aip.dev/161, this field is deprecated.
                +   * As an alternative, grpc metadata can be used:
                +   * https://cloud.google.com/apis/docs/system-parameters#definitions
                +   * 
                + * + * optional .google.protobuf.FieldMask read_mask = 12 [deprecated = true]; + * + * @deprecated google.storage.v2.BidiReadObjectSpec.read_mask is deprecated. See + * google/storage/v2/storage.proto;l=987 + * @return Whether the readMask field is set. + */ + @java.lang.Deprecated + boolean hasReadMask(); + /** + * + * + *
                +   * Mask specifying which fields to read.
                +   * The checksummed_data field and its children will always be present.
                +   * If no mask is specified, will default to all fields except metadata.owner
                +   * and metadata.acl.
                +   * * may be used to mean "all fields".
                +   * As per https://google.aip.dev/161, this field is deprecated.
                +   * As an alternative, grpc metadata can be used:
                +   * https://cloud.google.com/apis/docs/system-parameters#definitions
                +   * 
                + * + * optional .google.protobuf.FieldMask read_mask = 12 [deprecated = true]; + * + * @deprecated google.storage.v2.BidiReadObjectSpec.read_mask is deprecated. See + * google/storage/v2/storage.proto;l=987 + * @return The readMask. + */ + @java.lang.Deprecated + com.google.protobuf.FieldMask getReadMask(); + /** + * + * + *
                +   * Mask specifying which fields to read.
                +   * The checksummed_data field and its children will always be present.
                +   * If no mask is specified, will default to all fields except metadata.owner
                +   * and metadata.acl.
                +   * * may be used to mean "all fields".
                +   * As per https://google.aip.dev/161, this field is deprecated.
                +   * As an alternative, grpc metadata can be used:
                +   * https://cloud.google.com/apis/docs/system-parameters#definitions
                +   * 
                + * + * optional .google.protobuf.FieldMask read_mask = 12 [deprecated = true]; + */ + @java.lang.Deprecated + com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder(); + + /** + * + * + *
                +   * The client can optionally set this field. The read handle is an optimized
                +   * way of creating new streams. Read handles are generated and periodically
                +   * refreshed from prior reads.
                +   * 
                + * + * optional .google.storage.v2.BidiReadHandle read_handle = 13; + * + * @return Whether the readHandle field is set. + */ + boolean hasReadHandle(); + /** + * + * + *
                +   * The client can optionally set this field. The read handle is an optimized
                +   * way of creating new streams. Read handles are generated and periodically
                +   * refreshed from prior reads.
                +   * 
                + * + * optional .google.storage.v2.BidiReadHandle read_handle = 13; + * + * @return The readHandle. + */ + com.google.storage.v2.BidiReadHandle getReadHandle(); + /** + * + * + *
                +   * The client can optionally set this field. The read handle is an optimized
                +   * way of creating new streams. Read handles are generated and periodically
                +   * refreshed from prior reads.
                +   * 
                + * + * optional .google.storage.v2.BidiReadHandle read_handle = 13; + */ + com.google.storage.v2.BidiReadHandleOrBuilder getReadHandleOrBuilder(); + + /** + * + * + *
                +   * The routing token that influences request routing for the stream. Must be
                +   * provided if a BidiReadObjectRedirectedError is returned.
                +   * 
                + * + * optional string routing_token = 14; + * + * @return Whether the routingToken field is set. + */ + boolean hasRoutingToken(); + /** + * + * + *
                +   * The routing token that influences request routing for the stream. Must be
                +   * provided if a BidiReadObjectRedirectedError is returned.
                +   * 
                + * + * optional string routing_token = 14; + * + * @return The routingToken. + */ + java.lang.String getRoutingToken(); + /** + * + * + *
                +   * The routing token that influences request routing for the stream. Must be
                +   * provided if a BidiReadObjectRedirectedError is returned.
                +   * 
                + * + * optional string routing_token = 14; + * + * @return The bytes for routingToken. + */ + com.google.protobuf.ByteString getRoutingTokenBytes(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteHandle.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteHandle.java new file mode 100644 index 0000000000..e684b777d8 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteHandle.java @@ -0,0 +1,540 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +/** + * + * + *
                + * BidiWriteHandle contains a handle from a previous BidiWriteObject
                + * invocation. The client can use this as an optimized way of opening subsequent
                + * bidirectional streams to the same object.
                + * 
                + * + * Protobuf type {@code google.storage.v2.BidiWriteHandle} + */ +public final class BidiWriteHandle extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.BidiWriteHandle) + BidiWriteHandleOrBuilder { + private static final long serialVersionUID = 0L; + // Use BidiWriteHandle.newBuilder() to construct. + private BidiWriteHandle(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BidiWriteHandle() { + handle_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BidiWriteHandle(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiWriteHandle_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiWriteHandle_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.BidiWriteHandle.class, + com.google.storage.v2.BidiWriteHandle.Builder.class); + } + + public static final int HANDLE_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString handle_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
                +   * Required. Opaque value describing a previous write.
                +   * 
                + * + * bytes handle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The handle. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHandle() { + return handle_; + } + + 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 (!handle_.isEmpty()) { + output.writeBytes(1, handle_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!handle_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, handle_); + } + 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.v2.BidiWriteHandle)) { + return super.equals(obj); + } + com.google.storage.v2.BidiWriteHandle other = (com.google.storage.v2.BidiWriteHandle) obj; + + if (!getHandle().equals(other.getHandle())) 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) + HANDLE_FIELD_NUMBER; + hash = (53 * hash) + getHandle().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.BidiWriteHandle parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiWriteHandle parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiWriteHandle parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiWriteHandle parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiWriteHandle parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiWriteHandle parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiWriteHandle parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiWriteHandle parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.BidiWriteHandle parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiWriteHandle parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.BidiWriteHandle parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiWriteHandle parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.storage.v2.BidiWriteHandle 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; + } + /** + * + * + *
                +   * BidiWriteHandle contains a handle from a previous BidiWriteObject
                +   * invocation. The client can use this as an optimized way of opening subsequent
                +   * bidirectional streams to the same object.
                +   * 
                + * + * Protobuf type {@code google.storage.v2.BidiWriteHandle} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.BidiWriteHandle) + com.google.storage.v2.BidiWriteHandleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiWriteHandle_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiWriteHandle_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.BidiWriteHandle.class, + com.google.storage.v2.BidiWriteHandle.Builder.class); + } + + // Construct using com.google.storage.v2.BidiWriteHandle.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + handle_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiWriteHandle_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.BidiWriteHandle getDefaultInstanceForType() { + return com.google.storage.v2.BidiWriteHandle.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.BidiWriteHandle build() { + com.google.storage.v2.BidiWriteHandle result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.BidiWriteHandle buildPartial() { + com.google.storage.v2.BidiWriteHandle result = + new com.google.storage.v2.BidiWriteHandle(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.storage.v2.BidiWriteHandle result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.handle_ = handle_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.BidiWriteHandle) { + return mergeFrom((com.google.storage.v2.BidiWriteHandle) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.BidiWriteHandle other) { + if (other == com.google.storage.v2.BidiWriteHandle.getDefaultInstance()) return this; + if (other.getHandle() != com.google.protobuf.ByteString.EMPTY) { + setHandle(other.getHandle()); + } + 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: + { + handle_ = input.readBytes(); + 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 com.google.protobuf.ByteString handle_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
                +     * Required. Opaque value describing a previous write.
                +     * 
                + * + * bytes handle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The handle. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHandle() { + return handle_; + } + /** + * + * + *
                +     * Required. Opaque value describing a previous write.
                +     * 
                + * + * bytes handle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The handle to set. + * @return This builder for chaining. + */ + public Builder setHandle(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + handle_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
                +     * Required. Opaque value describing a previous write.
                +     * 
                + * + * bytes handle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearHandle() { + bitField0_ = (bitField0_ & ~0x00000001); + handle_ = getDefaultInstance().getHandle(); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.storage.v2.BidiWriteHandle) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.BidiWriteHandle) + private static final com.google.storage.v2.BidiWriteHandle DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.BidiWriteHandle(); + } + + public static com.google.storage.v2.BidiWriteHandle getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BidiWriteHandle 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.v2.BidiWriteHandle getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteHandleOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteHandleOrBuilder.java new file mode 100644 index 0000000000..9b92ea60fb --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteHandleOrBuilder.java @@ -0,0 +1,39 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +public interface BidiWriteHandleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.BidiWriteHandle) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
                +   * Required. Opaque value describing a previous write.
                +   * 
                + * + * bytes handle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The handle. + */ + com.google.protobuf.ByteString getHandle(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectRedirectedError.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectRedirectedError.java new file mode 100644 index 0000000000..917b35a317 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectRedirectedError.java @@ -0,0 +1,1090 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +/** + * + * + *
                + * Error proto containing details for a redirected write. This error is only
                + * returned on initial open in case of a redirect.
                + * 
                + * + * Protobuf type {@code google.storage.v2.BidiWriteObjectRedirectedError} + */ +public final class BidiWriteObjectRedirectedError extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.BidiWriteObjectRedirectedError) + BidiWriteObjectRedirectedErrorOrBuilder { + private static final long serialVersionUID = 0L; + // Use BidiWriteObjectRedirectedError.newBuilder() to construct. + private BidiWriteObjectRedirectedError( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BidiWriteObjectRedirectedError() { + routingToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BidiWriteObjectRedirectedError(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiWriteObjectRedirectedError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiWriteObjectRedirectedError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.BidiWriteObjectRedirectedError.class, + com.google.storage.v2.BidiWriteObjectRedirectedError.Builder.class); + } + + private int bitField0_; + public static final int ROUTING_TOKEN_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object routingToken_ = ""; + /** + * + * + *
                +   * The routing token that should be used when reopening the write stream.
                +   * 
                + * + * optional string routing_token = 1; + * + * @return Whether the routingToken field is set. + */ + @java.lang.Override + public boolean hasRoutingToken() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
                +   * The routing token that should be used when reopening the write stream.
                +   * 
                + * + * optional string routing_token = 1; + * + * @return The routingToken. + */ + @java.lang.Override + public java.lang.String getRoutingToken() { + java.lang.Object ref = routingToken_; + 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(); + routingToken_ = s; + return s; + } + } + /** + * + * + *
                +   * The routing token that should be used when reopening the write stream.
                +   * 
                + * + * optional string routing_token = 1; + * + * @return The bytes for routingToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRoutingTokenBytes() { + java.lang.Object ref = routingToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + routingToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WRITE_HANDLE_FIELD_NUMBER = 2; + private com.google.storage.v2.BidiWriteHandle writeHandle_; + /** + * + * + *
                +   * Opaque value describing a previous write.
                +   * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 2; + * + * @return Whether the writeHandle field is set. + */ + @java.lang.Override + public boolean hasWriteHandle() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
                +   * Opaque value describing a previous write.
                +   * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 2; + * + * @return The writeHandle. + */ + @java.lang.Override + public com.google.storage.v2.BidiWriteHandle getWriteHandle() { + return writeHandle_ == null + ? com.google.storage.v2.BidiWriteHandle.getDefaultInstance() + : writeHandle_; + } + /** + * + * + *
                +   * Opaque value describing a previous write.
                +   * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 2; + */ + @java.lang.Override + public com.google.storage.v2.BidiWriteHandleOrBuilder getWriteHandleOrBuilder() { + return writeHandle_ == null + ? com.google.storage.v2.BidiWriteHandle.getDefaultInstance() + : writeHandle_; + } + + public static final int GENERATION_FIELD_NUMBER = 3; + private long generation_ = 0L; + /** + * + * + *
                +   * The generation of the object that triggered the redirect.
                +   * Note that if this error was returned as part of an appendable object
                +   * create, this object generation is now successfully created and
                +   * append_object_spec should be used when reconnecting.
                +   * 
                + * + * optional int64 generation = 3; + * + * @return Whether the generation field is set. + */ + @java.lang.Override + public boolean hasGeneration() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
                +   * The generation of the object that triggered the redirect.
                +   * Note that if this error was returned as part of an appendable object
                +   * create, this object generation is now successfully created and
                +   * append_object_spec should be used when reconnecting.
                +   * 
                + * + * optional int64 generation = 3; + * + * @return The generation. + */ + @java.lang.Override + public long getGeneration() { + return generation_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, routingToken_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getWriteHandle()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt64(3, generation_); + } + 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.GeneratedMessageV3.computeStringSize(1, routingToken_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getWriteHandle()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, generation_); + } + 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.v2.BidiWriteObjectRedirectedError)) { + return super.equals(obj); + } + com.google.storage.v2.BidiWriteObjectRedirectedError other = + (com.google.storage.v2.BidiWriteObjectRedirectedError) obj; + + if (hasRoutingToken() != other.hasRoutingToken()) return false; + if (hasRoutingToken()) { + if (!getRoutingToken().equals(other.getRoutingToken())) return false; + } + if (hasWriteHandle() != other.hasWriteHandle()) return false; + if (hasWriteHandle()) { + if (!getWriteHandle().equals(other.getWriteHandle())) return false; + } + if (hasGeneration() != other.hasGeneration()) return false; + if (hasGeneration()) { + if (getGeneration() != other.getGeneration()) 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 (hasRoutingToken()) { + hash = (37 * hash) + ROUTING_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getRoutingToken().hashCode(); + } + if (hasWriteHandle()) { + hash = (37 * hash) + WRITE_HANDLE_FIELD_NUMBER; + hash = (53 * hash) + getWriteHandle().hashCode(); + } + if (hasGeneration()) { + hash = (37 * hash) + GENERATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getGeneration()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.BidiWriteObjectRedirectedError parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiWriteObjectRedirectedError parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiWriteObjectRedirectedError parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiWriteObjectRedirectedError parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiWriteObjectRedirectedError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BidiWriteObjectRedirectedError parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BidiWriteObjectRedirectedError parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiWriteObjectRedirectedError parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.BidiWriteObjectRedirectedError parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiWriteObjectRedirectedError parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.BidiWriteObjectRedirectedError parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BidiWriteObjectRedirectedError parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.storage.v2.BidiWriteObjectRedirectedError 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; + } + /** + * + * + *
                +   * Error proto containing details for a redirected write. This error is only
                +   * returned on initial open in case of a redirect.
                +   * 
                + * + * Protobuf type {@code google.storage.v2.BidiWriteObjectRedirectedError} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.BidiWriteObjectRedirectedError) + com.google.storage.v2.BidiWriteObjectRedirectedErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiWriteObjectRedirectedError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiWriteObjectRedirectedError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.BidiWriteObjectRedirectedError.class, + com.google.storage.v2.BidiWriteObjectRedirectedError.Builder.class); + } + + // Construct using com.google.storage.v2.BidiWriteObjectRedirectedError.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getWriteHandleFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + routingToken_ = ""; + writeHandle_ = null; + if (writeHandleBuilder_ != null) { + writeHandleBuilder_.dispose(); + writeHandleBuilder_ = null; + } + generation_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BidiWriteObjectRedirectedError_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.BidiWriteObjectRedirectedError getDefaultInstanceForType() { + return com.google.storage.v2.BidiWriteObjectRedirectedError.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.BidiWriteObjectRedirectedError build() { + com.google.storage.v2.BidiWriteObjectRedirectedError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.BidiWriteObjectRedirectedError buildPartial() { + com.google.storage.v2.BidiWriteObjectRedirectedError result = + new com.google.storage.v2.BidiWriteObjectRedirectedError(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.storage.v2.BidiWriteObjectRedirectedError result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.routingToken_ = routingToken_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.writeHandle_ = + writeHandleBuilder_ == null ? writeHandle_ : writeHandleBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.generation_ = generation_; + to_bitField0_ |= 0x00000004; + } + 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.v2.BidiWriteObjectRedirectedError) { + return mergeFrom((com.google.storage.v2.BidiWriteObjectRedirectedError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.BidiWriteObjectRedirectedError other) { + if (other == com.google.storage.v2.BidiWriteObjectRedirectedError.getDefaultInstance()) + return this; + if (other.hasRoutingToken()) { + routingToken_ = other.routingToken_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasWriteHandle()) { + mergeWriteHandle(other.getWriteHandle()); + } + if (other.hasGeneration()) { + setGeneration(other.getGeneration()); + } + 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: + { + routingToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getWriteHandleFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + generation_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + 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 routingToken_ = ""; + /** + * + * + *
                +     * The routing token that should be used when reopening the write stream.
                +     * 
                + * + * optional string routing_token = 1; + * + * @return Whether the routingToken field is set. + */ + public boolean hasRoutingToken() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
                +     * The routing token that should be used when reopening the write stream.
                +     * 
                + * + * optional string routing_token = 1; + * + * @return The routingToken. + */ + public java.lang.String getRoutingToken() { + java.lang.Object ref = routingToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + routingToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
                +     * The routing token that should be used when reopening the write stream.
                +     * 
                + * + * optional string routing_token = 1; + * + * @return The bytes for routingToken. + */ + public com.google.protobuf.ByteString getRoutingTokenBytes() { + java.lang.Object ref = routingToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + routingToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
                +     * The routing token that should be used when reopening the write stream.
                +     * 
                + * + * optional string routing_token = 1; + * + * @param value The routingToken to set. + * @return This builder for chaining. + */ + public Builder setRoutingToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + routingToken_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
                +     * The routing token that should be used when reopening the write stream.
                +     * 
                + * + * optional string routing_token = 1; + * + * @return This builder for chaining. + */ + public Builder clearRoutingToken() { + routingToken_ = getDefaultInstance().getRoutingToken(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
                +     * The routing token that should be used when reopening the write stream.
                +     * 
                + * + * optional string routing_token = 1; + * + * @param value The bytes for routingToken to set. + * @return This builder for chaining. + */ + public Builder setRoutingTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + routingToken_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.storage.v2.BidiWriteHandle writeHandle_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.BidiWriteHandle, + com.google.storage.v2.BidiWriteHandle.Builder, + com.google.storage.v2.BidiWriteHandleOrBuilder> + writeHandleBuilder_; + /** + * + * + *
                +     * Opaque value describing a previous write.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 2; + * + * @return Whether the writeHandle field is set. + */ + public boolean hasWriteHandle() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
                +     * Opaque value describing a previous write.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 2; + * + * @return The writeHandle. + */ + public com.google.storage.v2.BidiWriteHandle getWriteHandle() { + if (writeHandleBuilder_ == null) { + return writeHandle_ == null + ? com.google.storage.v2.BidiWriteHandle.getDefaultInstance() + : writeHandle_; + } else { + return writeHandleBuilder_.getMessage(); + } + } + /** + * + * + *
                +     * Opaque value describing a previous write.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 2; + */ + public Builder setWriteHandle(com.google.storage.v2.BidiWriteHandle value) { + if (writeHandleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + writeHandle_ = value; + } else { + writeHandleBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
                +     * Opaque value describing a previous write.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 2; + */ + public Builder setWriteHandle(com.google.storage.v2.BidiWriteHandle.Builder builderForValue) { + if (writeHandleBuilder_ == null) { + writeHandle_ = builderForValue.build(); + } else { + writeHandleBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
                +     * Opaque value describing a previous write.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 2; + */ + public Builder mergeWriteHandle(com.google.storage.v2.BidiWriteHandle value) { + if (writeHandleBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && writeHandle_ != null + && writeHandle_ != com.google.storage.v2.BidiWriteHandle.getDefaultInstance()) { + getWriteHandleBuilder().mergeFrom(value); + } else { + writeHandle_ = value; + } + } else { + writeHandleBuilder_.mergeFrom(value); + } + if (writeHandle_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
                +     * Opaque value describing a previous write.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 2; + */ + public Builder clearWriteHandle() { + bitField0_ = (bitField0_ & ~0x00000002); + writeHandle_ = null; + if (writeHandleBuilder_ != null) { + writeHandleBuilder_.dispose(); + writeHandleBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
                +     * Opaque value describing a previous write.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 2; + */ + public com.google.storage.v2.BidiWriteHandle.Builder getWriteHandleBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getWriteHandleFieldBuilder().getBuilder(); + } + /** + * + * + *
                +     * Opaque value describing a previous write.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 2; + */ + public com.google.storage.v2.BidiWriteHandleOrBuilder getWriteHandleOrBuilder() { + if (writeHandleBuilder_ != null) { + return writeHandleBuilder_.getMessageOrBuilder(); + } else { + return writeHandle_ == null + ? com.google.storage.v2.BidiWriteHandle.getDefaultInstance() + : writeHandle_; + } + } + /** + * + * + *
                +     * Opaque value describing a previous write.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.BidiWriteHandle, + com.google.storage.v2.BidiWriteHandle.Builder, + com.google.storage.v2.BidiWriteHandleOrBuilder> + getWriteHandleFieldBuilder() { + if (writeHandleBuilder_ == null) { + writeHandleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.BidiWriteHandle, + com.google.storage.v2.BidiWriteHandle.Builder, + com.google.storage.v2.BidiWriteHandleOrBuilder>( + getWriteHandle(), getParentForChildren(), isClean()); + writeHandle_ = null; + } + return writeHandleBuilder_; + } + + private long generation_; + /** + * + * + *
                +     * The generation of the object that triggered the redirect.
                +     * Note that if this error was returned as part of an appendable object
                +     * create, this object generation is now successfully created and
                +     * append_object_spec should be used when reconnecting.
                +     * 
                + * + * optional int64 generation = 3; + * + * @return Whether the generation field is set. + */ + @java.lang.Override + public boolean hasGeneration() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
                +     * The generation of the object that triggered the redirect.
                +     * Note that if this error was returned as part of an appendable object
                +     * create, this object generation is now successfully created and
                +     * append_object_spec should be used when reconnecting.
                +     * 
                + * + * optional int64 generation = 3; + * + * @return The generation. + */ + @java.lang.Override + public long getGeneration() { + return generation_; + } + /** + * + * + *
                +     * The generation of the object that triggered the redirect.
                +     * Note that if this error was returned as part of an appendable object
                +     * create, this object generation is now successfully created and
                +     * append_object_spec should be used when reconnecting.
                +     * 
                + * + * optional int64 generation = 3; + * + * @param value The generation to set. + * @return This builder for chaining. + */ + public Builder setGeneration(long value) { + + generation_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
                +     * The generation of the object that triggered the redirect.
                +     * Note that if this error was returned as part of an appendable object
                +     * create, this object generation is now successfully created and
                +     * append_object_spec should be used when reconnecting.
                +     * 
                + * + * optional int64 generation = 3; + * + * @return This builder for chaining. + */ + public Builder clearGeneration() { + bitField0_ = (bitField0_ & ~0x00000004); + generation_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.storage.v2.BidiWriteObjectRedirectedError) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.BidiWriteObjectRedirectedError) + private static final com.google.storage.v2.BidiWriteObjectRedirectedError DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.BidiWriteObjectRedirectedError(); + } + + public static com.google.storage.v2.BidiWriteObjectRedirectedError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BidiWriteObjectRedirectedError 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.v2.BidiWriteObjectRedirectedError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectRedirectedErrorOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectRedirectedErrorOrBuilder.java new file mode 100644 index 0000000000..eed3844d6c --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectRedirectedErrorOrBuilder.java @@ -0,0 +1,129 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +public interface BidiWriteObjectRedirectedErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.BidiWriteObjectRedirectedError) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
                +   * The routing token that should be used when reopening the write stream.
                +   * 
                + * + * optional string routing_token = 1; + * + * @return Whether the routingToken field is set. + */ + boolean hasRoutingToken(); + /** + * + * + *
                +   * The routing token that should be used when reopening the write stream.
                +   * 
                + * + * optional string routing_token = 1; + * + * @return The routingToken. + */ + java.lang.String getRoutingToken(); + /** + * + * + *
                +   * The routing token that should be used when reopening the write stream.
                +   * 
                + * + * optional string routing_token = 1; + * + * @return The bytes for routingToken. + */ + com.google.protobuf.ByteString getRoutingTokenBytes(); + + /** + * + * + *
                +   * Opaque value describing a previous write.
                +   * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 2; + * + * @return Whether the writeHandle field is set. + */ + boolean hasWriteHandle(); + /** + * + * + *
                +   * Opaque value describing a previous write.
                +   * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 2; + * + * @return The writeHandle. + */ + com.google.storage.v2.BidiWriteHandle getWriteHandle(); + /** + * + * + *
                +   * Opaque value describing a previous write.
                +   * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 2; + */ + com.google.storage.v2.BidiWriteHandleOrBuilder getWriteHandleOrBuilder(); + + /** + * + * + *
                +   * The generation of the object that triggered the redirect.
                +   * Note that if this error was returned as part of an appendable object
                +   * create, this object generation is now successfully created and
                +   * append_object_spec should be used when reconnecting.
                +   * 
                + * + * optional int64 generation = 3; + * + * @return Whether the generation field is set. + */ + boolean hasGeneration(); + /** + * + * + *
                +   * The generation of the object that triggered the redirect.
                +   * Note that if this error was returned as part of an appendable object
                +   * create, this object generation is now successfully created and
                +   * append_object_spec should be used when reconnecting.
                +   * 
                + * + * optional int64 generation = 3; + * + * @return The generation. + */ + long getGeneration(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectRequest.java index 446166b92c..e80ab3a974 100644 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectRequest.java +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectRequest.java @@ -73,6 +73,7 @@ public enum FirstMessageCase com.google.protobuf.AbstractMessage.InternalOneOfEnum { UPLOAD_ID(1), WRITE_OBJECT_SPEC(2), + APPEND_OBJECT_SPEC(11), FIRSTMESSAGE_NOT_SET(0); private final int value; @@ -95,6 +96,8 @@ public static FirstMessageCase forNumber(int value) { return UPLOAD_ID; case 2: return WRITE_OBJECT_SPEC; + case 11: + return APPEND_OBJECT_SPEC; case 0: return FIRSTMESSAGE_NOT_SET; default: @@ -284,6 +287,57 @@ public com.google.storage.v2.WriteObjectSpecOrBuilder getWriteObjectSpecOrBuilde return com.google.storage.v2.WriteObjectSpec.getDefaultInstance(); } + public static final int APPEND_OBJECT_SPEC_FIELD_NUMBER = 11; + /** + * + * + *
                +   * For appendable uploads. Describes the object to append to.
                +   * 
                + * + * .google.storage.v2.AppendObjectSpec append_object_spec = 11; + * + * @return Whether the appendObjectSpec field is set. + */ + @java.lang.Override + public boolean hasAppendObjectSpec() { + return firstMessageCase_ == 11; + } + /** + * + * + *
                +   * For appendable uploads. Describes the object to append to.
                +   * 
                + * + * .google.storage.v2.AppendObjectSpec append_object_spec = 11; + * + * @return The appendObjectSpec. + */ + @java.lang.Override + public com.google.storage.v2.AppendObjectSpec getAppendObjectSpec() { + if (firstMessageCase_ == 11) { + return (com.google.storage.v2.AppendObjectSpec) firstMessage_; + } + return com.google.storage.v2.AppendObjectSpec.getDefaultInstance(); + } + /** + * + * + *
                +   * For appendable uploads. Describes the object to append to.
                +   * 
                + * + * .google.storage.v2.AppendObjectSpec append_object_spec = 11; + */ + @java.lang.Override + public com.google.storage.v2.AppendObjectSpecOrBuilder getAppendObjectSpecOrBuilder() { + if (firstMessageCase_ == 11) { + return (com.google.storage.v2.AppendObjectSpec) firstMessage_; + } + return com.google.storage.v2.AppendObjectSpec.getDefaultInstance(); + } + public static final int WRITE_OFFSET_FIELD_NUMBER = 3; private long writeOffset_ = 0L; /** @@ -590,6 +644,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(10, getCommonObjectRequestParams()); } + if (firstMessageCase_ == 11) { + output.writeMessage(11, (com.google.storage.v2.AppendObjectSpec) firstMessage_); + } getUnknownFields().writeTo(output); } @@ -632,6 +689,11 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 10, getCommonObjectRequestParams()); } + if (firstMessageCase_ == 11) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 11, (com.google.storage.v2.AppendObjectSpec) firstMessage_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -669,6 +731,9 @@ public boolean equals(final java.lang.Object obj) { case 2: if (!getWriteObjectSpec().equals(other.getWriteObjectSpec())) return false; break; + case 11: + if (!getAppendObjectSpec().equals(other.getAppendObjectSpec())) return false; + break; case 0: default: } @@ -716,6 +781,10 @@ public int hashCode() { hash = (37 * hash) + WRITE_OBJECT_SPEC_FIELD_NUMBER; hash = (53 * hash) + getWriteObjectSpec().hashCode(); break; + case 11: + hash = (37 * hash) + APPEND_OBJECT_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getAppendObjectSpec().hashCode(); + break; case 0: default: } @@ -879,6 +948,9 @@ public Builder clear() { if (writeObjectSpecBuilder_ != null) { writeObjectSpecBuilder_.clear(); } + if (appendObjectSpecBuilder_ != null) { + appendObjectSpecBuilder_.clear(); + } writeOffset_ = 0L; if (checksummedDataBuilder_ != null) { checksummedDataBuilder_.clear(); @@ -937,25 +1009,25 @@ public com.google.storage.v2.BidiWriteObjectRequest buildPartial() { private void buildPartial0(com.google.storage.v2.BidiWriteObjectRequest result) { int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000004) != 0)) { + if (((from_bitField0_ & 0x00000008) != 0)) { result.writeOffset_ = writeOffset_; } int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000010) != 0)) { + if (((from_bitField0_ & 0x00000020) != 0)) { result.objectChecksums_ = objectChecksumsBuilder_ == null ? objectChecksums_ : objectChecksumsBuilder_.build(); to_bitField0_ |= 0x00000001; } - if (((from_bitField0_ & 0x00000020) != 0)) { + if (((from_bitField0_ & 0x00000040) != 0)) { result.stateLookup_ = stateLookup_; } - if (((from_bitField0_ & 0x00000040) != 0)) { + if (((from_bitField0_ & 0x00000080) != 0)) { result.flush_ = flush_; } - if (((from_bitField0_ & 0x00000080) != 0)) { + if (((from_bitField0_ & 0x00000100) != 0)) { result.finishWrite_ = finishWrite_; } - if (((from_bitField0_ & 0x00000100) != 0)) { + if (((from_bitField0_ & 0x00000200) != 0)) { result.commonObjectRequestParams_ = commonObjectRequestParamsBuilder_ == null ? commonObjectRequestParams_ @@ -971,6 +1043,9 @@ private void buildPartialOneofs(com.google.storage.v2.BidiWriteObjectRequest res if (firstMessageCase_ == 2 && writeObjectSpecBuilder_ != null) { result.firstMessage_ = writeObjectSpecBuilder_.build(); } + if (firstMessageCase_ == 11 && appendObjectSpecBuilder_ != null) { + result.firstMessage_ = appendObjectSpecBuilder_.build(); + } result.dataCase_ = dataCase_; result.data_ = this.data_; if (dataCase_ == 4 && checksummedDataBuilder_ != null) { @@ -1054,6 +1129,11 @@ public Builder mergeFrom(com.google.storage.v2.BidiWriteObjectRequest other) { mergeWriteObjectSpec(other.getWriteObjectSpec()); break; } + case APPEND_OBJECT_SPEC: + { + mergeAppendObjectSpec(other.getAppendObjectSpec()); + break; + } case FIRSTMESSAGE_NOT_SET: { break; @@ -1112,7 +1192,7 @@ public Builder mergeFrom( case 24: { writeOffset_ = input.readInt64(); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; break; } // case 24 case 34: @@ -1124,34 +1204,41 @@ public Builder mergeFrom( case 50: { input.readMessage(getObjectChecksumsFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; break; } // case 50 case 56: { stateLookup_ = input.readBool(); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; break; } // case 56 case 64: { flush_ = input.readBool(); - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; break; } // case 64 case 72: { finishWrite_ = input.readBool(); - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; break; } // case 72 case 82: { input.readMessage( getCommonObjectRequestParamsFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; break; } // case 82 + case 90: + { + input.readMessage( + getAppendObjectSpecFieldBuilder().getBuilder(), extensionRegistry); + firstMessageCase_ = 11; + break; + } // case 90 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1557,6 +1644,215 @@ public com.google.storage.v2.WriteObjectSpecOrBuilder getWriteObjectSpecOrBuilde return writeObjectSpecBuilder_; } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.AppendObjectSpec, + com.google.storage.v2.AppendObjectSpec.Builder, + com.google.storage.v2.AppendObjectSpecOrBuilder> + appendObjectSpecBuilder_; + /** + * + * + *
                +     * For appendable uploads. Describes the object to append to.
                +     * 
                + * + * .google.storage.v2.AppendObjectSpec append_object_spec = 11; + * + * @return Whether the appendObjectSpec field is set. + */ + @java.lang.Override + public boolean hasAppendObjectSpec() { + return firstMessageCase_ == 11; + } + /** + * + * + *
                +     * For appendable uploads. Describes the object to append to.
                +     * 
                + * + * .google.storage.v2.AppendObjectSpec append_object_spec = 11; + * + * @return The appendObjectSpec. + */ + @java.lang.Override + public com.google.storage.v2.AppendObjectSpec getAppendObjectSpec() { + if (appendObjectSpecBuilder_ == null) { + if (firstMessageCase_ == 11) { + return (com.google.storage.v2.AppendObjectSpec) firstMessage_; + } + return com.google.storage.v2.AppendObjectSpec.getDefaultInstance(); + } else { + if (firstMessageCase_ == 11) { + return appendObjectSpecBuilder_.getMessage(); + } + return com.google.storage.v2.AppendObjectSpec.getDefaultInstance(); + } + } + /** + * + * + *
                +     * For appendable uploads. Describes the object to append to.
                +     * 
                + * + * .google.storage.v2.AppendObjectSpec append_object_spec = 11; + */ + public Builder setAppendObjectSpec(com.google.storage.v2.AppendObjectSpec value) { + if (appendObjectSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + firstMessage_ = value; + onChanged(); + } else { + appendObjectSpecBuilder_.setMessage(value); + } + firstMessageCase_ = 11; + return this; + } + /** + * + * + *
                +     * For appendable uploads. Describes the object to append to.
                +     * 
                + * + * .google.storage.v2.AppendObjectSpec append_object_spec = 11; + */ + public Builder setAppendObjectSpec( + com.google.storage.v2.AppendObjectSpec.Builder builderForValue) { + if (appendObjectSpecBuilder_ == null) { + firstMessage_ = builderForValue.build(); + onChanged(); + } else { + appendObjectSpecBuilder_.setMessage(builderForValue.build()); + } + firstMessageCase_ = 11; + return this; + } + /** + * + * + *
                +     * For appendable uploads. Describes the object to append to.
                +     * 
                + * + * .google.storage.v2.AppendObjectSpec append_object_spec = 11; + */ + public Builder mergeAppendObjectSpec(com.google.storage.v2.AppendObjectSpec value) { + if (appendObjectSpecBuilder_ == null) { + if (firstMessageCase_ == 11 + && firstMessage_ != com.google.storage.v2.AppendObjectSpec.getDefaultInstance()) { + firstMessage_ = + com.google.storage.v2.AppendObjectSpec.newBuilder( + (com.google.storage.v2.AppendObjectSpec) firstMessage_) + .mergeFrom(value) + .buildPartial(); + } else { + firstMessage_ = value; + } + onChanged(); + } else { + if (firstMessageCase_ == 11) { + appendObjectSpecBuilder_.mergeFrom(value); + } else { + appendObjectSpecBuilder_.setMessage(value); + } + } + firstMessageCase_ = 11; + return this; + } + /** + * + * + *
                +     * For appendable uploads. Describes the object to append to.
                +     * 
                + * + * .google.storage.v2.AppendObjectSpec append_object_spec = 11; + */ + public Builder clearAppendObjectSpec() { + if (appendObjectSpecBuilder_ == null) { + if (firstMessageCase_ == 11) { + firstMessageCase_ = 0; + firstMessage_ = null; + onChanged(); + } + } else { + if (firstMessageCase_ == 11) { + firstMessageCase_ = 0; + firstMessage_ = null; + } + appendObjectSpecBuilder_.clear(); + } + return this; + } + /** + * + * + *
                +     * For appendable uploads. Describes the object to append to.
                +     * 
                + * + * .google.storage.v2.AppendObjectSpec append_object_spec = 11; + */ + public com.google.storage.v2.AppendObjectSpec.Builder getAppendObjectSpecBuilder() { + return getAppendObjectSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
                +     * For appendable uploads. Describes the object to append to.
                +     * 
                + * + * .google.storage.v2.AppendObjectSpec append_object_spec = 11; + */ + @java.lang.Override + public com.google.storage.v2.AppendObjectSpecOrBuilder getAppendObjectSpecOrBuilder() { + if ((firstMessageCase_ == 11) && (appendObjectSpecBuilder_ != null)) { + return appendObjectSpecBuilder_.getMessageOrBuilder(); + } else { + if (firstMessageCase_ == 11) { + return (com.google.storage.v2.AppendObjectSpec) firstMessage_; + } + return com.google.storage.v2.AppendObjectSpec.getDefaultInstance(); + } + } + /** + * + * + *
                +     * For appendable uploads. Describes the object to append to.
                +     * 
                + * + * .google.storage.v2.AppendObjectSpec append_object_spec = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.AppendObjectSpec, + com.google.storage.v2.AppendObjectSpec.Builder, + com.google.storage.v2.AppendObjectSpecOrBuilder> + getAppendObjectSpecFieldBuilder() { + if (appendObjectSpecBuilder_ == null) { + if (!(firstMessageCase_ == 11)) { + firstMessage_ = com.google.storage.v2.AppendObjectSpec.getDefaultInstance(); + } + appendObjectSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.AppendObjectSpec, + com.google.storage.v2.AppendObjectSpec.Builder, + com.google.storage.v2.AppendObjectSpecOrBuilder>( + (com.google.storage.v2.AppendObjectSpec) firstMessage_, + getParentForChildren(), + isClean()); + firstMessage_ = null; + } + firstMessageCase_ = 11; + onChanged(); + return appendObjectSpecBuilder_; + } + private long writeOffset_; /** * @@ -1612,7 +1908,7 @@ public long getWriteOffset() { public Builder setWriteOffset(long value) { writeOffset_ = value; - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1640,7 +1936,7 @@ public Builder setWriteOffset(long value) { * @return This builder for chaining. */ public Builder clearWriteOffset() { - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000008); writeOffset_ = 0L; onChanged(); return this; @@ -1882,7 +2178,7 @@ public com.google.storage.v2.ChecksummedDataOrBuilder getChecksummedDataOrBuilde * @return Whether the objectChecksums field is set. */ public boolean hasObjectChecksums() { - return ((bitField0_ & 0x00000010) != 0); + return ((bitField0_ & 0x00000020) != 0); } /** * @@ -1928,7 +2224,7 @@ public Builder setObjectChecksums(com.google.storage.v2.ObjectChecksums value) { } else { objectChecksumsBuilder_.setMessage(value); } - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; onChanged(); return this; } @@ -1951,7 +2247,7 @@ public Builder setObjectChecksums( } else { objectChecksumsBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; onChanged(); return this; } @@ -1969,7 +2265,7 @@ public Builder setObjectChecksums( */ public Builder mergeObjectChecksums(com.google.storage.v2.ObjectChecksums value) { if (objectChecksumsBuilder_ == null) { - if (((bitField0_ & 0x00000010) != 0) + if (((bitField0_ & 0x00000020) != 0) && objectChecksums_ != null && objectChecksums_ != com.google.storage.v2.ObjectChecksums.getDefaultInstance()) { getObjectChecksumsBuilder().mergeFrom(value); @@ -1980,7 +2276,7 @@ public Builder mergeObjectChecksums(com.google.storage.v2.ObjectChecksums value) objectChecksumsBuilder_.mergeFrom(value); } if (objectChecksums_ != null) { - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; onChanged(); } return this; @@ -1998,7 +2294,7 @@ public Builder mergeObjectChecksums(com.google.storage.v2.ObjectChecksums value) * .google.storage.v2.ObjectChecksums object_checksums = 6; */ public Builder clearObjectChecksums() { - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000020); objectChecksums_ = null; if (objectChecksumsBuilder_ != null) { objectChecksumsBuilder_.dispose(); @@ -2020,7 +2316,7 @@ public Builder clearObjectChecksums() { * .google.storage.v2.ObjectChecksums object_checksums = 6; */ public com.google.storage.v2.ObjectChecksums.Builder getObjectChecksumsBuilder() { - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; onChanged(); return getObjectChecksumsFieldBuilder().getBuilder(); } @@ -2119,7 +2415,7 @@ public boolean getStateLookup() { public Builder setStateLookup(boolean value) { stateLookup_ = value; - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; onChanged(); return this; } @@ -2142,7 +2438,7 @@ public Builder setStateLookup(boolean value) { * @return This builder for chaining. */ public Builder clearStateLookup() { - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000040); stateLookup_ = false; onChanged(); return this; @@ -2189,7 +2485,7 @@ public boolean getFlush() { public Builder setFlush(boolean value) { flush_ = value; - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); return this; } @@ -2210,7 +2506,7 @@ public Builder setFlush(boolean value) { * @return This builder for chaining. */ public Builder clearFlush() { - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000080); flush_ = false; onChanged(); return this; @@ -2257,7 +2553,7 @@ public boolean getFinishWrite() { public Builder setFinishWrite(boolean value) { finishWrite_ = value; - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; onChanged(); return this; } @@ -2278,7 +2574,7 @@ public Builder setFinishWrite(boolean value) { * @return This builder for chaining. */ public Builder clearFinishWrite() { - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000100); finishWrite_ = false; onChanged(); return this; @@ -2302,7 +2598,7 @@ public Builder clearFinishWrite() { * @return Whether the commonObjectRequestParams field is set. */ public boolean hasCommonObjectRequestParams() { - return ((bitField0_ & 0x00000100) != 0); + return ((bitField0_ & 0x00000200) != 0); } /** * @@ -2343,7 +2639,7 @@ public Builder setCommonObjectRequestParams( } else { commonObjectRequestParamsBuilder_.setMessage(value); } - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; onChanged(); return this; } @@ -2363,7 +2659,7 @@ public Builder setCommonObjectRequestParams( } else { commonObjectRequestParamsBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; onChanged(); return this; } @@ -2379,7 +2675,7 @@ public Builder setCommonObjectRequestParams( public Builder mergeCommonObjectRequestParams( com.google.storage.v2.CommonObjectRequestParams value) { if (commonObjectRequestParamsBuilder_ == null) { - if (((bitField0_ & 0x00000100) != 0) + if (((bitField0_ & 0x00000200) != 0) && commonObjectRequestParams_ != null && commonObjectRequestParams_ != com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance()) { @@ -2391,7 +2687,7 @@ public Builder mergeCommonObjectRequestParams( commonObjectRequestParamsBuilder_.mergeFrom(value); } if (commonObjectRequestParams_ != null) { - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; onChanged(); } return this; @@ -2406,7 +2702,7 @@ public Builder mergeCommonObjectRequestParams( * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; */ public Builder clearCommonObjectRequestParams() { - bitField0_ = (bitField0_ & ~0x00000100); + bitField0_ = (bitField0_ & ~0x00000200); commonObjectRequestParams_ = null; if (commonObjectRequestParamsBuilder_ != null) { commonObjectRequestParamsBuilder_.dispose(); @@ -2426,7 +2722,7 @@ public Builder clearCommonObjectRequestParams() { */ public com.google.storage.v2.CommonObjectRequestParams.Builder getCommonObjectRequestParamsBuilder() { - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; onChanged(); return getCommonObjectRequestParamsFieldBuilder().getBuilder(); } diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectRequestOrBuilder.java index a6b7717b04..b8a59dca62 100644 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectRequestOrBuilder.java +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectRequestOrBuilder.java @@ -102,6 +102,41 @@ public interface BidiWriteObjectRequestOrBuilder */ com.google.storage.v2.WriteObjectSpecOrBuilder getWriteObjectSpecOrBuilder(); + /** + * + * + *
                +   * For appendable uploads. Describes the object to append to.
                +   * 
                + * + * .google.storage.v2.AppendObjectSpec append_object_spec = 11; + * + * @return Whether the appendObjectSpec field is set. + */ + boolean hasAppendObjectSpec(); + /** + * + * + *
                +   * For appendable uploads. Describes the object to append to.
                +   * 
                + * + * .google.storage.v2.AppendObjectSpec append_object_spec = 11; + * + * @return The appendObjectSpec. + */ + com.google.storage.v2.AppendObjectSpec getAppendObjectSpec(); + /** + * + * + *
                +   * For appendable uploads. Describes the object to append to.
                +   * 
                + * + * .google.storage.v2.AppendObjectSpec append_object_spec = 11; + */ + com.google.storage.v2.AppendObjectSpecOrBuilder getAppendObjectSpecOrBuilder(); + /** * * diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectResponse.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectResponse.java index 81f05d58eb..ba2aa2e8df 100644 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectResponse.java +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectResponse.java @@ -61,6 +61,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.storage.v2.BidiWriteObjectResponse.Builder.class); } + private int bitField0_; private int writeStatusCase_ = 0; @SuppressWarnings("serial") @@ -201,6 +202,62 @@ public com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder() { return com.google.storage.v2.Object.getDefaultInstance(); } + public static final int WRITE_HANDLE_FIELD_NUMBER = 3; + private com.google.storage.v2.BidiWriteHandle writeHandle_; + /** + * + * + *
                +   * An optional write handle that will periodically be present in response
                +   * messages. Clients should save it for later use in establishing a new stream
                +   * if a connection is interrupted.
                +   * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 3; + * + * @return Whether the writeHandle field is set. + */ + @java.lang.Override + public boolean hasWriteHandle() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
                +   * An optional write handle that will periodically be present in response
                +   * messages. Clients should save it for later use in establishing a new stream
                +   * if a connection is interrupted.
                +   * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 3; + * + * @return The writeHandle. + */ + @java.lang.Override + public com.google.storage.v2.BidiWriteHandle getWriteHandle() { + return writeHandle_ == null + ? com.google.storage.v2.BidiWriteHandle.getDefaultInstance() + : writeHandle_; + } + /** + * + * + *
                +   * An optional write handle that will periodically be present in response
                +   * messages. Clients should save it for later use in establishing a new stream
                +   * if a connection is interrupted.
                +   * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 3; + */ + @java.lang.Override + public com.google.storage.v2.BidiWriteHandleOrBuilder getWriteHandleOrBuilder() { + return writeHandle_ == null + ? com.google.storage.v2.BidiWriteHandle.getDefaultInstance() + : writeHandle_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -221,6 +278,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (writeStatusCase_ == 2) { output.writeMessage(2, (com.google.storage.v2.Object) writeStatus_); } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getWriteHandle()); + } getUnknownFields().writeTo(output); } @@ -240,6 +300,9 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 2, (com.google.storage.v2.Object) writeStatus_); } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getWriteHandle()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -256,6 +319,10 @@ public boolean equals(final java.lang.Object obj) { com.google.storage.v2.BidiWriteObjectResponse other = (com.google.storage.v2.BidiWriteObjectResponse) obj; + if (hasWriteHandle() != other.hasWriteHandle()) return false; + if (hasWriteHandle()) { + if (!getWriteHandle().equals(other.getWriteHandle())) return false; + } if (!getWriteStatusCase().equals(other.getWriteStatusCase())) return false; switch (writeStatusCase_) { case 1: @@ -278,6 +345,10 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); + if (hasWriteHandle()) { + hash = (37 * hash) + WRITE_HANDLE_FIELD_NUMBER; + hash = (53 * hash) + getWriteHandle().hashCode(); + } switch (writeStatusCase_) { case 1: hash = (37 * hash) + PERSISTED_SIZE_FIELD_NUMBER; @@ -419,10 +490,19 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.storage.v2.BidiWriteObjectResponse.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getWriteHandleFieldBuilder(); + } } @java.lang.Override @@ -432,6 +512,11 @@ public Builder clear() { if (resourceBuilder_ != null) { resourceBuilder_.clear(); } + writeHandle_ = null; + if (writeHandleBuilder_ != null) { + writeHandleBuilder_.dispose(); + writeHandleBuilder_ = null; + } writeStatusCase_ = 0; writeStatus_ = null; return this; @@ -471,6 +556,13 @@ public com.google.storage.v2.BidiWriteObjectResponse buildPartial() { private void buildPartial0(com.google.storage.v2.BidiWriteObjectResponse result) { int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.writeHandle_ = + writeHandleBuilder_ == null ? writeHandle_ : writeHandleBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } private void buildPartialOneofs(com.google.storage.v2.BidiWriteObjectResponse result) { @@ -526,6 +618,9 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.storage.v2.BidiWriteObjectResponse other) { if (other == com.google.storage.v2.BidiWriteObjectResponse.getDefaultInstance()) return this; + if (other.hasWriteHandle()) { + mergeWriteHandle(other.getWriteHandle()); + } switch (other.getWriteStatusCase()) { case PERSISTED_SIZE: { @@ -580,6 +675,12 @@ public Builder mergeFrom( writeStatusCase_ = 2; break; } // case 18 + case 26: + { + input.readMessage(getWriteHandleFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -901,6 +1002,209 @@ public com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder() { return resourceBuilder_; } + private com.google.storage.v2.BidiWriteHandle writeHandle_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.BidiWriteHandle, + com.google.storage.v2.BidiWriteHandle.Builder, + com.google.storage.v2.BidiWriteHandleOrBuilder> + writeHandleBuilder_; + /** + * + * + *
                +     * An optional write handle that will periodically be present in response
                +     * messages. Clients should save it for later use in establishing a new stream
                +     * if a connection is interrupted.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 3; + * + * @return Whether the writeHandle field is set. + */ + public boolean hasWriteHandle() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
                +     * An optional write handle that will periodically be present in response
                +     * messages. Clients should save it for later use in establishing a new stream
                +     * if a connection is interrupted.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 3; + * + * @return The writeHandle. + */ + public com.google.storage.v2.BidiWriteHandle getWriteHandle() { + if (writeHandleBuilder_ == null) { + return writeHandle_ == null + ? com.google.storage.v2.BidiWriteHandle.getDefaultInstance() + : writeHandle_; + } else { + return writeHandleBuilder_.getMessage(); + } + } + /** + * + * + *
                +     * An optional write handle that will periodically be present in response
                +     * messages. Clients should save it for later use in establishing a new stream
                +     * if a connection is interrupted.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 3; + */ + public Builder setWriteHandle(com.google.storage.v2.BidiWriteHandle value) { + if (writeHandleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + writeHandle_ = value; + } else { + writeHandleBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
                +     * An optional write handle that will periodically be present in response
                +     * messages. Clients should save it for later use in establishing a new stream
                +     * if a connection is interrupted.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 3; + */ + public Builder setWriteHandle(com.google.storage.v2.BidiWriteHandle.Builder builderForValue) { + if (writeHandleBuilder_ == null) { + writeHandle_ = builderForValue.build(); + } else { + writeHandleBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
                +     * An optional write handle that will periodically be present in response
                +     * messages. Clients should save it for later use in establishing a new stream
                +     * if a connection is interrupted.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 3; + */ + public Builder mergeWriteHandle(com.google.storage.v2.BidiWriteHandle value) { + if (writeHandleBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && writeHandle_ != null + && writeHandle_ != com.google.storage.v2.BidiWriteHandle.getDefaultInstance()) { + getWriteHandleBuilder().mergeFrom(value); + } else { + writeHandle_ = value; + } + } else { + writeHandleBuilder_.mergeFrom(value); + } + if (writeHandle_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
                +     * An optional write handle that will periodically be present in response
                +     * messages. Clients should save it for later use in establishing a new stream
                +     * if a connection is interrupted.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 3; + */ + public Builder clearWriteHandle() { + bitField0_ = (bitField0_ & ~0x00000004); + writeHandle_ = null; + if (writeHandleBuilder_ != null) { + writeHandleBuilder_.dispose(); + writeHandleBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
                +     * An optional write handle that will periodically be present in response
                +     * messages. Clients should save it for later use in establishing a new stream
                +     * if a connection is interrupted.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 3; + */ + public com.google.storage.v2.BidiWriteHandle.Builder getWriteHandleBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getWriteHandleFieldBuilder().getBuilder(); + } + /** + * + * + *
                +     * An optional write handle that will periodically be present in response
                +     * messages. Clients should save it for later use in establishing a new stream
                +     * if a connection is interrupted.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 3; + */ + public com.google.storage.v2.BidiWriteHandleOrBuilder getWriteHandleOrBuilder() { + if (writeHandleBuilder_ != null) { + return writeHandleBuilder_.getMessageOrBuilder(); + } else { + return writeHandle_ == null + ? com.google.storage.v2.BidiWriteHandle.getDefaultInstance() + : writeHandle_; + } + } + /** + * + * + *
                +     * An optional write handle that will periodically be present in response
                +     * messages. Clients should save it for later use in establishing a new stream
                +     * if a connection is interrupted.
                +     * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.BidiWriteHandle, + com.google.storage.v2.BidiWriteHandle.Builder, + com.google.storage.v2.BidiWriteHandleOrBuilder> + getWriteHandleFieldBuilder() { + if (writeHandleBuilder_ == null) { + writeHandleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.BidiWriteHandle, + com.google.storage.v2.BidiWriteHandle.Builder, + com.google.storage.v2.BidiWriteHandleOrBuilder>( + getWriteHandle(), getParentForChildren(), isClean()); + writeHandle_ = null; + } + return writeHandleBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectResponseOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectResponseOrBuilder.java index a0f4c7a225..4f946d0a14 100644 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectResponseOrBuilder.java +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BidiWriteObjectResponseOrBuilder.java @@ -89,5 +89,46 @@ public interface BidiWriteObjectResponseOrBuilder */ com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder(); + /** + * + * + *
                +   * An optional write handle that will periodically be present in response
                +   * messages. Clients should save it for later use in establishing a new stream
                +   * if a connection is interrupted.
                +   * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 3; + * + * @return Whether the writeHandle field is set. + */ + boolean hasWriteHandle(); + /** + * + * + *
                +   * An optional write handle that will periodically be present in response
                +   * messages. Clients should save it for later use in establishing a new stream
                +   * if a connection is interrupted.
                +   * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 3; + * + * @return The writeHandle. + */ + com.google.storage.v2.BidiWriteHandle getWriteHandle(); + /** + * + * + *
                +   * An optional write handle that will periodically be present in response
                +   * messages. Clients should save it for later use in establishing a new stream
                +   * if a connection is interrupted.
                +   * 
                + * + * optional .google.storage.v2.BidiWriteHandle write_handle = 3; + */ + com.google.storage.v2.BidiWriteHandleOrBuilder getWriteHandleOrBuilder(); + com.google.storage.v2.BidiWriteObjectResponse.WriteStatusCase getWriteStatusCase(); } diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectRangeData.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectRangeData.java new file mode 100644 index 0000000000..f51c36f379 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectRangeData.java @@ -0,0 +1,1125 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +/** + * + * + *
                + * Contains data and metadata for a range of an object.
                + * 
                + * + * Protobuf type {@code google.storage.v2.ObjectRangeData} + */ +public final class ObjectRangeData extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.ObjectRangeData) + ObjectRangeDataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ObjectRangeData.newBuilder() to construct. + private ObjectRangeData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ObjectRangeData() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ObjectRangeData(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ObjectRangeData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ObjectRangeData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.ObjectRangeData.class, + com.google.storage.v2.ObjectRangeData.Builder.class); + } + + private int bitField0_; + public static final int CHECKSUMMED_DATA_FIELD_NUMBER = 1; + private com.google.storage.v2.ChecksummedData checksummedData_; + /** + * + * + *
                +   * A portion of the data for the object.
                +   * 
                + * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + * + * @return Whether the checksummedData field is set. + */ + @java.lang.Override + public boolean hasChecksummedData() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
                +   * A portion of the data for the object.
                +   * 
                + * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + * + * @return The checksummedData. + */ + @java.lang.Override + public com.google.storage.v2.ChecksummedData getChecksummedData() { + return checksummedData_ == null + ? com.google.storage.v2.ChecksummedData.getDefaultInstance() + : checksummedData_; + } + /** + * + * + *
                +   * A portion of the data for the object.
                +   * 
                + * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + */ + @java.lang.Override + public com.google.storage.v2.ChecksummedDataOrBuilder getChecksummedDataOrBuilder() { + return checksummedData_ == null + ? com.google.storage.v2.ChecksummedData.getDefaultInstance() + : checksummedData_; + } + + public static final int READ_RANGE_FIELD_NUMBER = 2; + private com.google.storage.v2.ReadRange readRange_; + /** + * + * + *
                +   * The ReadRange describes the content being returned with read_id set to the
                +   * corresponding ReadObjectRequest in the stream. Multiple ObjectRangeData
                +   * messages may have the same read_id but increasing offsets.
                +   * ReadObjectResponse messages with the same read_id are guaranteed to be
                +   * delivered in increasing offset order.
                +   * 
                + * + * .google.storage.v2.ReadRange read_range = 2; + * + * @return Whether the readRange field is set. + */ + @java.lang.Override + public boolean hasReadRange() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
                +   * The ReadRange describes the content being returned with read_id set to the
                +   * corresponding ReadObjectRequest in the stream. Multiple ObjectRangeData
                +   * messages may have the same read_id but increasing offsets.
                +   * ReadObjectResponse messages with the same read_id are guaranteed to be
                +   * delivered in increasing offset order.
                +   * 
                + * + * .google.storage.v2.ReadRange read_range = 2; + * + * @return The readRange. + */ + @java.lang.Override + public com.google.storage.v2.ReadRange getReadRange() { + return readRange_ == null ? com.google.storage.v2.ReadRange.getDefaultInstance() : readRange_; + } + /** + * + * + *
                +   * The ReadRange describes the content being returned with read_id set to the
                +   * corresponding ReadObjectRequest in the stream. Multiple ObjectRangeData
                +   * messages may have the same read_id but increasing offsets.
                +   * ReadObjectResponse messages with the same read_id are guaranteed to be
                +   * delivered in increasing offset order.
                +   * 
                + * + * .google.storage.v2.ReadRange read_range = 2; + */ + @java.lang.Override + public com.google.storage.v2.ReadRangeOrBuilder getReadRangeOrBuilder() { + return readRange_ == null ? com.google.storage.v2.ReadRange.getDefaultInstance() : readRange_; + } + + public static final int RANGE_END_FIELD_NUMBER = 3; + private boolean rangeEnd_ = false; + /** + * + * + *
                +   * If set, indicates there are no more bytes to read for the given ReadRange.
                +   * 
                + * + * bool range_end = 3; + * + * @return The rangeEnd. + */ + @java.lang.Override + public boolean getRangeEnd() { + return rangeEnd_; + } + + 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.writeMessage(1, getChecksummedData()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getReadRange()); + } + if (rangeEnd_ != false) { + output.writeBool(3, rangeEnd_); + } + 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.computeMessageSize(1, getChecksummedData()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getReadRange()); + } + if (rangeEnd_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, rangeEnd_); + } + 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.v2.ObjectRangeData)) { + return super.equals(obj); + } + com.google.storage.v2.ObjectRangeData other = (com.google.storage.v2.ObjectRangeData) obj; + + if (hasChecksummedData() != other.hasChecksummedData()) return false; + if (hasChecksummedData()) { + if (!getChecksummedData().equals(other.getChecksummedData())) return false; + } + if (hasReadRange() != other.hasReadRange()) return false; + if (hasReadRange()) { + if (!getReadRange().equals(other.getReadRange())) return false; + } + if (getRangeEnd() != other.getRangeEnd()) 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 (hasChecksummedData()) { + hash = (37 * hash) + CHECKSUMMED_DATA_FIELD_NUMBER; + hash = (53 * hash) + getChecksummedData().hashCode(); + } + if (hasReadRange()) { + hash = (37 * hash) + READ_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getReadRange().hashCode(); + } + hash = (37 * hash) + RANGE_END_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRangeEnd()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.ObjectRangeData parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ObjectRangeData parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.ObjectRangeData parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ObjectRangeData parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.ObjectRangeData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ObjectRangeData parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.ObjectRangeData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ObjectRangeData parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.ObjectRangeData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ObjectRangeData parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.ObjectRangeData parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ObjectRangeData parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.storage.v2.ObjectRangeData 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 data and metadata for a range of an object.
                +   * 
                + * + * Protobuf type {@code google.storage.v2.ObjectRangeData} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.ObjectRangeData) + com.google.storage.v2.ObjectRangeDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ObjectRangeData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ObjectRangeData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.ObjectRangeData.class, + com.google.storage.v2.ObjectRangeData.Builder.class); + } + + // Construct using com.google.storage.v2.ObjectRangeData.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getChecksummedDataFieldBuilder(); + getReadRangeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + checksummedData_ = null; + if (checksummedDataBuilder_ != null) { + checksummedDataBuilder_.dispose(); + checksummedDataBuilder_ = null; + } + readRange_ = null; + if (readRangeBuilder_ != null) { + readRangeBuilder_.dispose(); + readRangeBuilder_ = null; + } + rangeEnd_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ObjectRangeData_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.ObjectRangeData getDefaultInstanceForType() { + return com.google.storage.v2.ObjectRangeData.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.ObjectRangeData build() { + com.google.storage.v2.ObjectRangeData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.ObjectRangeData buildPartial() { + com.google.storage.v2.ObjectRangeData result = + new com.google.storage.v2.ObjectRangeData(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.storage.v2.ObjectRangeData result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.checksummedData_ = + checksummedDataBuilder_ == null ? checksummedData_ : checksummedDataBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.readRange_ = readRangeBuilder_ == null ? readRange_ : readRangeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.rangeEnd_ = rangeEnd_; + } + 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.v2.ObjectRangeData) { + return mergeFrom((com.google.storage.v2.ObjectRangeData) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.ObjectRangeData other) { + if (other == com.google.storage.v2.ObjectRangeData.getDefaultInstance()) return this; + if (other.hasChecksummedData()) { + mergeChecksummedData(other.getChecksummedData()); + } + if (other.hasReadRange()) { + mergeReadRange(other.getReadRange()); + } + if (other.getRangeEnd() != false) { + setRangeEnd(other.getRangeEnd()); + } + 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(getChecksummedDataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getReadRangeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + rangeEnd_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + 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.v2.ChecksummedData checksummedData_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ChecksummedData, + com.google.storage.v2.ChecksummedData.Builder, + com.google.storage.v2.ChecksummedDataOrBuilder> + checksummedDataBuilder_; + /** + * + * + *
                +     * A portion of the data for the object.
                +     * 
                + * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + * + * @return Whether the checksummedData field is set. + */ + public boolean hasChecksummedData() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
                +     * A portion of the data for the object.
                +     * 
                + * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + * + * @return The checksummedData. + */ + public com.google.storage.v2.ChecksummedData getChecksummedData() { + if (checksummedDataBuilder_ == null) { + return checksummedData_ == null + ? com.google.storage.v2.ChecksummedData.getDefaultInstance() + : checksummedData_; + } else { + return checksummedDataBuilder_.getMessage(); + } + } + /** + * + * + *
                +     * A portion of the data for the object.
                +     * 
                + * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + */ + public Builder setChecksummedData(com.google.storage.v2.ChecksummedData value) { + if (checksummedDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + checksummedData_ = value; + } else { + checksummedDataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
                +     * A portion of the data for the object.
                +     * 
                + * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + */ + public Builder setChecksummedData( + com.google.storage.v2.ChecksummedData.Builder builderForValue) { + if (checksummedDataBuilder_ == null) { + checksummedData_ = builderForValue.build(); + } else { + checksummedDataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
                +     * A portion of the data for the object.
                +     * 
                + * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + */ + public Builder mergeChecksummedData(com.google.storage.v2.ChecksummedData value) { + if (checksummedDataBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && checksummedData_ != null + && checksummedData_ != com.google.storage.v2.ChecksummedData.getDefaultInstance()) { + getChecksummedDataBuilder().mergeFrom(value); + } else { + checksummedData_ = value; + } + } else { + checksummedDataBuilder_.mergeFrom(value); + } + if (checksummedData_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
                +     * A portion of the data for the object.
                +     * 
                + * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + */ + public Builder clearChecksummedData() { + bitField0_ = (bitField0_ & ~0x00000001); + checksummedData_ = null; + if (checksummedDataBuilder_ != null) { + checksummedDataBuilder_.dispose(); + checksummedDataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
                +     * A portion of the data for the object.
                +     * 
                + * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + */ + public com.google.storage.v2.ChecksummedData.Builder getChecksummedDataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getChecksummedDataFieldBuilder().getBuilder(); + } + /** + * + * + *
                +     * A portion of the data for the object.
                +     * 
                + * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + */ + public com.google.storage.v2.ChecksummedDataOrBuilder getChecksummedDataOrBuilder() { + if (checksummedDataBuilder_ != null) { + return checksummedDataBuilder_.getMessageOrBuilder(); + } else { + return checksummedData_ == null + ? com.google.storage.v2.ChecksummedData.getDefaultInstance() + : checksummedData_; + } + } + /** + * + * + *
                +     * A portion of the data for the object.
                +     * 
                + * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ChecksummedData, + com.google.storage.v2.ChecksummedData.Builder, + com.google.storage.v2.ChecksummedDataOrBuilder> + getChecksummedDataFieldBuilder() { + if (checksummedDataBuilder_ == null) { + checksummedDataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ChecksummedData, + com.google.storage.v2.ChecksummedData.Builder, + com.google.storage.v2.ChecksummedDataOrBuilder>( + getChecksummedData(), getParentForChildren(), isClean()); + checksummedData_ = null; + } + return checksummedDataBuilder_; + } + + private com.google.storage.v2.ReadRange readRange_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ReadRange, + com.google.storage.v2.ReadRange.Builder, + com.google.storage.v2.ReadRangeOrBuilder> + readRangeBuilder_; + /** + * + * + *
                +     * The ReadRange describes the content being returned with read_id set to the
                +     * corresponding ReadObjectRequest in the stream. Multiple ObjectRangeData
                +     * messages may have the same read_id but increasing offsets.
                +     * ReadObjectResponse messages with the same read_id are guaranteed to be
                +     * delivered in increasing offset order.
                +     * 
                + * + * .google.storage.v2.ReadRange read_range = 2; + * + * @return Whether the readRange field is set. + */ + public boolean hasReadRange() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
                +     * The ReadRange describes the content being returned with read_id set to the
                +     * corresponding ReadObjectRequest in the stream. Multiple ObjectRangeData
                +     * messages may have the same read_id but increasing offsets.
                +     * ReadObjectResponse messages with the same read_id are guaranteed to be
                +     * delivered in increasing offset order.
                +     * 
                + * + * .google.storage.v2.ReadRange read_range = 2; + * + * @return The readRange. + */ + public com.google.storage.v2.ReadRange getReadRange() { + if (readRangeBuilder_ == null) { + return readRange_ == null + ? com.google.storage.v2.ReadRange.getDefaultInstance() + : readRange_; + } else { + return readRangeBuilder_.getMessage(); + } + } + /** + * + * + *
                +     * The ReadRange describes the content being returned with read_id set to the
                +     * corresponding ReadObjectRequest in the stream. Multiple ObjectRangeData
                +     * messages may have the same read_id but increasing offsets.
                +     * ReadObjectResponse messages with the same read_id are guaranteed to be
                +     * delivered in increasing offset order.
                +     * 
                + * + * .google.storage.v2.ReadRange read_range = 2; + */ + public Builder setReadRange(com.google.storage.v2.ReadRange value) { + if (readRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readRange_ = value; + } else { + readRangeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
                +     * The ReadRange describes the content being returned with read_id set to the
                +     * corresponding ReadObjectRequest in the stream. Multiple ObjectRangeData
                +     * messages may have the same read_id but increasing offsets.
                +     * ReadObjectResponse messages with the same read_id are guaranteed to be
                +     * delivered in increasing offset order.
                +     * 
                + * + * .google.storage.v2.ReadRange read_range = 2; + */ + public Builder setReadRange(com.google.storage.v2.ReadRange.Builder builderForValue) { + if (readRangeBuilder_ == null) { + readRange_ = builderForValue.build(); + } else { + readRangeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
                +     * The ReadRange describes the content being returned with read_id set to the
                +     * corresponding ReadObjectRequest in the stream. Multiple ObjectRangeData
                +     * messages may have the same read_id but increasing offsets.
                +     * ReadObjectResponse messages with the same read_id are guaranteed to be
                +     * delivered in increasing offset order.
                +     * 
                + * + * .google.storage.v2.ReadRange read_range = 2; + */ + public Builder mergeReadRange(com.google.storage.v2.ReadRange value) { + if (readRangeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && readRange_ != null + && readRange_ != com.google.storage.v2.ReadRange.getDefaultInstance()) { + getReadRangeBuilder().mergeFrom(value); + } else { + readRange_ = value; + } + } else { + readRangeBuilder_.mergeFrom(value); + } + if (readRange_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
                +     * The ReadRange describes the content being returned with read_id set to the
                +     * corresponding ReadObjectRequest in the stream. Multiple ObjectRangeData
                +     * messages may have the same read_id but increasing offsets.
                +     * ReadObjectResponse messages with the same read_id are guaranteed to be
                +     * delivered in increasing offset order.
                +     * 
                + * + * .google.storage.v2.ReadRange read_range = 2; + */ + public Builder clearReadRange() { + bitField0_ = (bitField0_ & ~0x00000002); + readRange_ = null; + if (readRangeBuilder_ != null) { + readRangeBuilder_.dispose(); + readRangeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
                +     * The ReadRange describes the content being returned with read_id set to the
                +     * corresponding ReadObjectRequest in the stream. Multiple ObjectRangeData
                +     * messages may have the same read_id but increasing offsets.
                +     * ReadObjectResponse messages with the same read_id are guaranteed to be
                +     * delivered in increasing offset order.
                +     * 
                + * + * .google.storage.v2.ReadRange read_range = 2; + */ + public com.google.storage.v2.ReadRange.Builder getReadRangeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getReadRangeFieldBuilder().getBuilder(); + } + /** + * + * + *
                +     * The ReadRange describes the content being returned with read_id set to the
                +     * corresponding ReadObjectRequest in the stream. Multiple ObjectRangeData
                +     * messages may have the same read_id but increasing offsets.
                +     * ReadObjectResponse messages with the same read_id are guaranteed to be
                +     * delivered in increasing offset order.
                +     * 
                + * + * .google.storage.v2.ReadRange read_range = 2; + */ + public com.google.storage.v2.ReadRangeOrBuilder getReadRangeOrBuilder() { + if (readRangeBuilder_ != null) { + return readRangeBuilder_.getMessageOrBuilder(); + } else { + return readRange_ == null + ? com.google.storage.v2.ReadRange.getDefaultInstance() + : readRange_; + } + } + /** + * + * + *
                +     * The ReadRange describes the content being returned with read_id set to the
                +     * corresponding ReadObjectRequest in the stream. Multiple ObjectRangeData
                +     * messages may have the same read_id but increasing offsets.
                +     * ReadObjectResponse messages with the same read_id are guaranteed to be
                +     * delivered in increasing offset order.
                +     * 
                + * + * .google.storage.v2.ReadRange read_range = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ReadRange, + com.google.storage.v2.ReadRange.Builder, + com.google.storage.v2.ReadRangeOrBuilder> + getReadRangeFieldBuilder() { + if (readRangeBuilder_ == null) { + readRangeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ReadRange, + com.google.storage.v2.ReadRange.Builder, + com.google.storage.v2.ReadRangeOrBuilder>( + getReadRange(), getParentForChildren(), isClean()); + readRange_ = null; + } + return readRangeBuilder_; + } + + private boolean rangeEnd_; + /** + * + * + *
                +     * If set, indicates there are no more bytes to read for the given ReadRange.
                +     * 
                + * + * bool range_end = 3; + * + * @return The rangeEnd. + */ + @java.lang.Override + public boolean getRangeEnd() { + return rangeEnd_; + } + /** + * + * + *
                +     * If set, indicates there are no more bytes to read for the given ReadRange.
                +     * 
                + * + * bool range_end = 3; + * + * @param value The rangeEnd to set. + * @return This builder for chaining. + */ + public Builder setRangeEnd(boolean value) { + + rangeEnd_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
                +     * If set, indicates there are no more bytes to read for the given ReadRange.
                +     * 
                + * + * bool range_end = 3; + * + * @return This builder for chaining. + */ + public Builder clearRangeEnd() { + bitField0_ = (bitField0_ & ~0x00000004); + rangeEnd_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.storage.v2.ObjectRangeData) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.ObjectRangeData) + private static final com.google.storage.v2.ObjectRangeData DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.ObjectRangeData(); + } + + public static com.google.storage.v2.ObjectRangeData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ObjectRangeData 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.v2.ObjectRangeData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectRangeDataOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectRangeDataOrBuilder.java new file mode 100644 index 0000000000..6e9d9958b4 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectRangeDataOrBuilder.java @@ -0,0 +1,121 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +public interface ObjectRangeDataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.ObjectRangeData) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
                +   * A portion of the data for the object.
                +   * 
                + * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + * + * @return Whether the checksummedData field is set. + */ + boolean hasChecksummedData(); + /** + * + * + *
                +   * A portion of the data for the object.
                +   * 
                + * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + * + * @return The checksummedData. + */ + com.google.storage.v2.ChecksummedData getChecksummedData(); + /** + * + * + *
                +   * A portion of the data for the object.
                +   * 
                + * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + */ + com.google.storage.v2.ChecksummedDataOrBuilder getChecksummedDataOrBuilder(); + + /** + * + * + *
                +   * The ReadRange describes the content being returned with read_id set to the
                +   * corresponding ReadObjectRequest in the stream. Multiple ObjectRangeData
                +   * messages may have the same read_id but increasing offsets.
                +   * ReadObjectResponse messages with the same read_id are guaranteed to be
                +   * delivered in increasing offset order.
                +   * 
                + * + * .google.storage.v2.ReadRange read_range = 2; + * + * @return Whether the readRange field is set. + */ + boolean hasReadRange(); + /** + * + * + *
                +   * The ReadRange describes the content being returned with read_id set to the
                +   * corresponding ReadObjectRequest in the stream. Multiple ObjectRangeData
                +   * messages may have the same read_id but increasing offsets.
                +   * ReadObjectResponse messages with the same read_id are guaranteed to be
                +   * delivered in increasing offset order.
                +   * 
                + * + * .google.storage.v2.ReadRange read_range = 2; + * + * @return The readRange. + */ + com.google.storage.v2.ReadRange getReadRange(); + /** + * + * + *
                +   * The ReadRange describes the content being returned with read_id set to the
                +   * corresponding ReadObjectRequest in the stream. Multiple ObjectRangeData
                +   * messages may have the same read_id but increasing offsets.
                +   * ReadObjectResponse messages with the same read_id are guaranteed to be
                +   * delivered in increasing offset order.
                +   * 
                + * + * .google.storage.v2.ReadRange read_range = 2; + */ + com.google.storage.v2.ReadRangeOrBuilder getReadRangeOrBuilder(); + + /** + * + * + *
                +   * If set, indicates there are no more bytes to read for the given ReadRange.
                +   * 
                + * + * bool range_end = 3; + * + * @return The rangeEnd. + */ + boolean getRangeEnd(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadRange.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadRange.java new file mode 100644 index 0000000000..e8f808c116 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadRange.java @@ -0,0 +1,787 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +/** + * + * + *
                + * Describes a range of bytes to read in a BidiReadObjectRanges request.
                + * 
                + * + * Protobuf type {@code google.storage.v2.ReadRange} + */ +public final class ReadRange extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.ReadRange) + ReadRangeOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReadRange.newBuilder() to construct. + private ReadRange(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReadRange() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReadRange(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ReadRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ReadRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.ReadRange.class, com.google.storage.v2.ReadRange.Builder.class); + } + + public static final int READ_OFFSET_FIELD_NUMBER = 1; + private long readOffset_ = 0L; + /** + * + * + *
                +   * Required. The offset for the first byte to return in the read, relative to
                +   * the start of the object.
                +   *
                +   * A negative read_offset value will be interpreted as the number of bytes
                +   * back from the end of the object to be returned. For example, if an object's
                +   * length is 15 bytes, a ReadObjectRequest with read_offset = -5 and
                +   * read_length = 3 would return bytes 10 through 12 of the object. Requesting
                +   * a negative offset with magnitude larger than the size of the object will
                +   * return the entire object. A read_offset larger than the size of the object
                +   * will result in an OutOfRange error.
                +   * 
                + * + * int64 read_offset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The readOffset. + */ + @java.lang.Override + public long getReadOffset() { + return readOffset_; + } + + public static final int READ_LENGTH_FIELD_NUMBER = 2; + private long readLength_ = 0L; + /** + * + * + *
                +   * Optional. The maximum number of data bytes the server is allowed to return
                +   * across all response messages with the same read_id. A read_length of zero
                +   * indicates to read until the resource end, and a negative read_length will
                +   * cause an error. If the stream returns fewer bytes than allowed by the
                +   * read_length and no error occurred, the stream includes all data from the
                +   * read_offset to the resource end.
                +   * 
                + * + * int64 read_length = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The readLength. + */ + @java.lang.Override + public long getReadLength() { + return readLength_; + } + + public static final int READ_ID_FIELD_NUMBER = 3; + private long readId_ = 0L; + /** + * + * + *
                +   * Required. Read identifier provided by the client. When the client issues
                +   * more than one outstanding ReadRange on the same stream, responses can be
                +   * mapped back to their corresponding requests using this value. Clients must
                +   * ensure that all outstanding requests have different read_id values. The
                +   * server may close the stream with an error if this condition is not met.
                +   * 
                + * + * int64 read_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The readId. + */ + @java.lang.Override + public long getReadId() { + return readId_; + } + + 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 (readOffset_ != 0L) { + output.writeInt64(1, readOffset_); + } + if (readLength_ != 0L) { + output.writeInt64(2, readLength_); + } + if (readId_ != 0L) { + output.writeInt64(3, readId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (readOffset_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, readOffset_); + } + if (readLength_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, readLength_); + } + if (readId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, readId_); + } + 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.v2.ReadRange)) { + return super.equals(obj); + } + com.google.storage.v2.ReadRange other = (com.google.storage.v2.ReadRange) obj; + + if (getReadOffset() != other.getReadOffset()) return false; + if (getReadLength() != other.getReadLength()) return false; + if (getReadId() != other.getReadId()) 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) + READ_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getReadOffset()); + hash = (37 * hash) + READ_LENGTH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getReadLength()); + hash = (37 * hash) + READ_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getReadId()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.ReadRange parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ReadRange parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.ReadRange parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ReadRange parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.ReadRange parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ReadRange parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.ReadRange parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ReadRange parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.ReadRange parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ReadRange parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.ReadRange parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ReadRange parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.storage.v2.ReadRange prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
                +   * Describes a range of bytes to read in a BidiReadObjectRanges request.
                +   * 
                + * + * Protobuf type {@code google.storage.v2.ReadRange} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.ReadRange) + com.google.storage.v2.ReadRangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ReadRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ReadRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.ReadRange.class, com.google.storage.v2.ReadRange.Builder.class); + } + + // Construct using com.google.storage.v2.ReadRange.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + readOffset_ = 0L; + readLength_ = 0L; + readId_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ReadRange_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.ReadRange getDefaultInstanceForType() { + return com.google.storage.v2.ReadRange.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.ReadRange build() { + com.google.storage.v2.ReadRange result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.ReadRange buildPartial() { + com.google.storage.v2.ReadRange result = new com.google.storage.v2.ReadRange(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.storage.v2.ReadRange result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.readOffset_ = readOffset_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.readLength_ = readLength_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.readId_ = readId_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.ReadRange) { + return mergeFrom((com.google.storage.v2.ReadRange) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.ReadRange other) { + if (other == com.google.storage.v2.ReadRange.getDefaultInstance()) return this; + if (other.getReadOffset() != 0L) { + setReadOffset(other.getReadOffset()); + } + if (other.getReadLength() != 0L) { + setReadLength(other.getReadLength()); + } + if (other.getReadId() != 0L) { + setReadId(other.getReadId()); + } + 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: + { + readOffset_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + readLength_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + readId_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + 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 long readOffset_; + /** + * + * + *
                +     * Required. The offset for the first byte to return in the read, relative to
                +     * the start of the object.
                +     *
                +     * A negative read_offset value will be interpreted as the number of bytes
                +     * back from the end of the object to be returned. For example, if an object's
                +     * length is 15 bytes, a ReadObjectRequest with read_offset = -5 and
                +     * read_length = 3 would return bytes 10 through 12 of the object. Requesting
                +     * a negative offset with magnitude larger than the size of the object will
                +     * return the entire object. A read_offset larger than the size of the object
                +     * will result in an OutOfRange error.
                +     * 
                + * + * int64 read_offset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The readOffset. + */ + @java.lang.Override + public long getReadOffset() { + return readOffset_; + } + /** + * + * + *
                +     * Required. The offset for the first byte to return in the read, relative to
                +     * the start of the object.
                +     *
                +     * A negative read_offset value will be interpreted as the number of bytes
                +     * back from the end of the object to be returned. For example, if an object's
                +     * length is 15 bytes, a ReadObjectRequest with read_offset = -5 and
                +     * read_length = 3 would return bytes 10 through 12 of the object. Requesting
                +     * a negative offset with magnitude larger than the size of the object will
                +     * return the entire object. A read_offset larger than the size of the object
                +     * will result in an OutOfRange error.
                +     * 
                + * + * int64 read_offset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The readOffset to set. + * @return This builder for chaining. + */ + public Builder setReadOffset(long value) { + + readOffset_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
                +     * Required. The offset for the first byte to return in the read, relative to
                +     * the start of the object.
                +     *
                +     * A negative read_offset value will be interpreted as the number of bytes
                +     * back from the end of the object to be returned. For example, if an object's
                +     * length is 15 bytes, a ReadObjectRequest with read_offset = -5 and
                +     * read_length = 3 would return bytes 10 through 12 of the object. Requesting
                +     * a negative offset with magnitude larger than the size of the object will
                +     * return the entire object. A read_offset larger than the size of the object
                +     * will result in an OutOfRange error.
                +     * 
                + * + * int64 read_offset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearReadOffset() { + bitField0_ = (bitField0_ & ~0x00000001); + readOffset_ = 0L; + onChanged(); + return this; + } + + private long readLength_; + /** + * + * + *
                +     * Optional. The maximum number of data bytes the server is allowed to return
                +     * across all response messages with the same read_id. A read_length of zero
                +     * indicates to read until the resource end, and a negative read_length will
                +     * cause an error. If the stream returns fewer bytes than allowed by the
                +     * read_length and no error occurred, the stream includes all data from the
                +     * read_offset to the resource end.
                +     * 
                + * + * int64 read_length = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The readLength. + */ + @java.lang.Override + public long getReadLength() { + return readLength_; + } + /** + * + * + *
                +     * Optional. The maximum number of data bytes the server is allowed to return
                +     * across all response messages with the same read_id. A read_length of zero
                +     * indicates to read until the resource end, and a negative read_length will
                +     * cause an error. If the stream returns fewer bytes than allowed by the
                +     * read_length and no error occurred, the stream includes all data from the
                +     * read_offset to the resource end.
                +     * 
                + * + * int64 read_length = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The readLength to set. + * @return This builder for chaining. + */ + public Builder setReadLength(long value) { + + readLength_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
                +     * Optional. The maximum number of data bytes the server is allowed to return
                +     * across all response messages with the same read_id. A read_length of zero
                +     * indicates to read until the resource end, and a negative read_length will
                +     * cause an error. If the stream returns fewer bytes than allowed by the
                +     * read_length and no error occurred, the stream includes all data from the
                +     * read_offset to the resource end.
                +     * 
                + * + * int64 read_length = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearReadLength() { + bitField0_ = (bitField0_ & ~0x00000002); + readLength_ = 0L; + onChanged(); + return this; + } + + private long readId_; + /** + * + * + *
                +     * Required. Read identifier provided by the client. When the client issues
                +     * more than one outstanding ReadRange on the same stream, responses can be
                +     * mapped back to their corresponding requests using this value. Clients must
                +     * ensure that all outstanding requests have different read_id values. The
                +     * server may close the stream with an error if this condition is not met.
                +     * 
                + * + * int64 read_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The readId. + */ + @java.lang.Override + public long getReadId() { + return readId_; + } + /** + * + * + *
                +     * Required. Read identifier provided by the client. When the client issues
                +     * more than one outstanding ReadRange on the same stream, responses can be
                +     * mapped back to their corresponding requests using this value. Clients must
                +     * ensure that all outstanding requests have different read_id values. The
                +     * server may close the stream with an error if this condition is not met.
                +     * 
                + * + * int64 read_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The readId to set. + * @return This builder for chaining. + */ + public Builder setReadId(long value) { + + readId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
                +     * Required. Read identifier provided by the client. When the client issues
                +     * more than one outstanding ReadRange on the same stream, responses can be
                +     * mapped back to their corresponding requests using this value. Clients must
                +     * ensure that all outstanding requests have different read_id values. The
                +     * server may close the stream with an error if this condition is not met.
                +     * 
                + * + * int64 read_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearReadId() { + bitField0_ = (bitField0_ & ~0x00000004); + readId_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.storage.v2.ReadRange) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.ReadRange) + private static final com.google.storage.v2.ReadRange DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.ReadRange(); + } + + public static com.google.storage.v2.ReadRange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadRange 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.v2.ReadRange getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadRangeError.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadRangeError.java new file mode 100644 index 0000000000..58355733e4 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadRangeError.java @@ -0,0 +1,797 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +/** + * + * + *
                + * Error extension proto containing details for a single range read
                + * 
                + * + * Protobuf type {@code google.storage.v2.ReadRangeError} + */ +public final class ReadRangeError extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.ReadRangeError) + ReadRangeErrorOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReadRangeError.newBuilder() to construct. + private ReadRangeError(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReadRangeError() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReadRangeError(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ReadRangeError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ReadRangeError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.ReadRangeError.class, + com.google.storage.v2.ReadRangeError.Builder.class); + } + + private int bitField0_; + public static final int READ_ID_FIELD_NUMBER = 1; + private long readId_ = 0L; + /** + * + * + *
                +   * The id of the corresponding read_range
                +   * 
                + * + * int64 read_id = 1; + * + * @return The readId. + */ + @java.lang.Override + public long getReadId() { + return readId_; + } + + public static final int STATUS_FIELD_NUMBER = 2; + private com.google.rpc.Status status_; + /** + * + * + *
                +   * The status which should be an enum value of [google.rpc.Code].
                +   * 
                + * + * .google.rpc.Status status = 2; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
                +   * The status which should be an enum value of [google.rpc.Code].
                +   * 
                + * + * .google.rpc.Status status = 2; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + /** + * + * + *
                +   * The status which should be an enum value of [google.rpc.Code].
                +   * 
                + * + * .google.rpc.Status status = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + 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 (readId_ != 0L) { + output.writeInt64(1, readId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getStatus()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (readId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, readId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStatus()); + } + 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.v2.ReadRangeError)) { + return super.equals(obj); + } + com.google.storage.v2.ReadRangeError other = (com.google.storage.v2.ReadRangeError) obj; + + if (getReadId() != other.getReadId()) return false; + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) 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) + READ_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getReadId()); + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.ReadRangeError parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ReadRangeError parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.ReadRangeError parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ReadRangeError parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.ReadRangeError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ReadRangeError parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.ReadRangeError parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ReadRangeError parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.ReadRangeError parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ReadRangeError parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.storage.v2.ReadRangeError parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ReadRangeError parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.storage.v2.ReadRangeError 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; + } + /** + * + * + *
                +   * Error extension proto containing details for a single range read
                +   * 
                + * + * Protobuf type {@code google.storage.v2.ReadRangeError} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.ReadRangeError) + com.google.storage.v2.ReadRangeErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ReadRangeError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ReadRangeError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.ReadRangeError.class, + com.google.storage.v2.ReadRangeError.Builder.class); + } + + // Construct using com.google.storage.v2.ReadRangeError.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStatusFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + readId_ = 0L; + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ReadRangeError_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.ReadRangeError getDefaultInstanceForType() { + return com.google.storage.v2.ReadRangeError.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.ReadRangeError build() { + com.google.storage.v2.ReadRangeError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.ReadRangeError buildPartial() { + com.google.storage.v2.ReadRangeError result = new com.google.storage.v2.ReadRangeError(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.storage.v2.ReadRangeError result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.readId_ = readId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + 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.v2.ReadRangeError) { + return mergeFrom((com.google.storage.v2.ReadRangeError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.ReadRangeError other) { + if (other == com.google.storage.v2.ReadRangeError.getDefaultInstance()) return this; + if (other.getReadId() != 0L) { + setReadId(other.getReadId()); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + 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: + { + readId_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage(getStatusFieldBuilder().getBuilder(), extensionRegistry); + 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 long readId_; + /** + * + * + *
                +     * The id of the corresponding read_range
                +     * 
                + * + * int64 read_id = 1; + * + * @return The readId. + */ + @java.lang.Override + public long getReadId() { + return readId_; + } + /** + * + * + *
                +     * The id of the corresponding read_range
                +     * 
                + * + * int64 read_id = 1; + * + * @param value The readId to set. + * @return This builder for chaining. + */ + public Builder setReadId(long value) { + + readId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
                +     * The id of the corresponding read_range
                +     * 
                + * + * int64 read_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearReadId() { + bitField0_ = (bitField0_ & ~0x00000001); + readId_ = 0L; + onChanged(); + return this; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + /** + * + * + *
                +     * The status which should be an enum value of [google.rpc.Code].
                +     * 
                + * + * .google.rpc.Status status = 2; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
                +     * The status which should be an enum value of [google.rpc.Code].
                +     * 
                + * + * .google.rpc.Status status = 2; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + /** + * + * + *
                +     * The status which should be an enum value of [google.rpc.Code].
                +     * 
                + * + * .google.rpc.Status status = 2; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
                +     * The status which should be an enum value of [google.rpc.Code].
                +     * 
                + * + * .google.rpc.Status status = 2; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
                +     * The status which should be an enum value of [google.rpc.Code].
                +     * 
                + * + * .google.rpc.Status status = 2; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && status_ != null + && status_ != com.google.rpc.Status.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + if (status_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
                +     * The status which should be an enum value of [google.rpc.Code].
                +     * 
                + * + * .google.rpc.Status status = 2; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000002); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
                +     * The status which should be an enum value of [google.rpc.Code].
                +     * 
                + * + * .google.rpc.Status status = 2; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + /** + * + * + *
                +     * The status which should be an enum value of [google.rpc.Code].
                +     * 
                + * + * .google.rpc.Status status = 2; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + /** + * + * + *
                +     * The status which should be an enum value of [google.rpc.Code].
                +     * 
                + * + * .google.rpc.Status status = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.storage.v2.ReadRangeError) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.ReadRangeError) + private static final com.google.storage.v2.ReadRangeError DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.ReadRangeError(); + } + + public static com.google.storage.v2.ReadRangeError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadRangeError 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.v2.ReadRangeError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadRangeErrorOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadRangeErrorOrBuilder.java new file mode 100644 index 0000000000..0e70cccff4 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadRangeErrorOrBuilder.java @@ -0,0 +1,74 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +public interface ReadRangeErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.ReadRangeError) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
                +   * The id of the corresponding read_range
                +   * 
                + * + * int64 read_id = 1; + * + * @return The readId. + */ + long getReadId(); + + /** + * + * + *
                +   * The status which should be an enum value of [google.rpc.Code].
                +   * 
                + * + * .google.rpc.Status status = 2; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + /** + * + * + *
                +   * The status which should be an enum value of [google.rpc.Code].
                +   * 
                + * + * .google.rpc.Status status = 2; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + /** + * + * + *
                +   * The status which should be an enum value of [google.rpc.Code].
                +   * 
                + * + * .google.rpc.Status status = 2; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadRangeOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadRangeOrBuilder.java new file mode 100644 index 0000000000..3b783ba9b9 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadRangeOrBuilder.java @@ -0,0 +1,83 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +// Protobuf Java Version: 3.25.5 +package com.google.storage.v2; + +public interface ReadRangeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.ReadRange) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
                +   * Required. The offset for the first byte to return in the read, relative to
                +   * the start of the object.
                +   *
                +   * A negative read_offset value will be interpreted as the number of bytes
                +   * back from the end of the object to be returned. For example, if an object's
                +   * length is 15 bytes, a ReadObjectRequest with read_offset = -5 and
                +   * read_length = 3 would return bytes 10 through 12 of the object. Requesting
                +   * a negative offset with magnitude larger than the size of the object will
                +   * return the entire object. A read_offset larger than the size of the object
                +   * will result in an OutOfRange error.
                +   * 
                + * + * int64 read_offset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The readOffset. + */ + long getReadOffset(); + + /** + * + * + *
                +   * Optional. The maximum number of data bytes the server is allowed to return
                +   * across all response messages with the same read_id. A read_length of zero
                +   * indicates to read until the resource end, and a negative read_length will
                +   * cause an error. If the stream returns fewer bytes than allowed by the
                +   * read_length and no error occurred, the stream includes all data from the
                +   * read_offset to the resource end.
                +   * 
                + * + * int64 read_length = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The readLength. + */ + long getReadLength(); + + /** + * + * + *
                +   * Required. Read identifier provided by the client. When the client issues
                +   * more than one outstanding ReadRange on the same stream, responses can be
                +   * mapped back to their corresponding requests using this value. Clients must
                +   * ensure that all outstanding requests have different read_id values. The
                +   * server may close the stream with an error if this condition is not met.
                +   * 
                + * + * int64 read_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The readId. + */ + long getReadId(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequest.java index 1368af0f58..c948d44c9a 100644 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequest.java +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequest.java @@ -68,8 +68,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
                -   * Required. The destination bucket, object, and metadata, as well as any
                -   * preconditions.
                +   * Required. Contains the information necessary to start a resumable write.
                    * 
                * * @@ -86,8 +85,7 @@ public boolean hasWriteObjectSpec() { * * *
                -   * Required. The destination bucket, object, and metadata, as well as any
                -   * preconditions.
                +   * Required. Contains the information necessary to start a resumable write.
                    * 
                * * @@ -106,8 +104,7 @@ public com.google.storage.v2.WriteObjectSpec getWriteObjectSpec() { * * *
                -   * Required. The destination bucket, object, and metadata, as well as any
                -   * preconditions.
                +   * Required. Contains the information necessary to start a resumable write.
                    * 
                * * @@ -127,7 +124,7 @@ public com.google.storage.v2.WriteObjectSpecOrBuilder getWriteObjectSpecOrBuilde * * *
                -   * A set of parameters common to Storage API requests concerning an object.
                +   * A set of parameters common to Storage API requests related to an object.
                    * 
                * * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; @@ -142,7 +139,7 @@ public boolean hasCommonObjectRequestParams() { * * *
                -   * A set of parameters common to Storage API requests concerning an object.
                +   * A set of parameters common to Storage API requests related to an object.
                    * 
                * * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; @@ -159,7 +156,7 @@ public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestPar * * *
                -   * A set of parameters common to Storage API requests concerning an object.
                +   * A set of parameters common to Storage API requests related to an object.
                    * 
                * * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; @@ -178,10 +175,11 @@ public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestPar * * *
                -   * The checksums of the complete object. This will be used to validate the
                -   * uploaded object. For each upload, object_checksums can be provided with
                -   * either StartResumableWriteRequest or the WriteObjectRequest with
                -   * finish_write set to `true`.
                +   * The checksums of the complete object. This is used to validate the
                +   * uploaded object. For each upload, `object_checksums` can be provided when
                +   * initiating a resumable upload with`StartResumableWriteRequest` or when
                +   * completing a write with `WriteObjectRequest` with
                +   * `finish_write` set to `true`.
                    * 
                * * .google.storage.v2.ObjectChecksums object_checksums = 5; @@ -196,10 +194,11 @@ public boolean hasObjectChecksums() { * * *
                -   * The checksums of the complete object. This will be used to validate the
                -   * uploaded object. For each upload, object_checksums can be provided with
                -   * either StartResumableWriteRequest or the WriteObjectRequest with
                -   * finish_write set to `true`.
                +   * The checksums of the complete object. This is used to validate the
                +   * uploaded object. For each upload, `object_checksums` can be provided when
                +   * initiating a resumable upload with`StartResumableWriteRequest` or when
                +   * completing a write with `WriteObjectRequest` with
                +   * `finish_write` set to `true`.
                    * 
                * * .google.storage.v2.ObjectChecksums object_checksums = 5; @@ -216,10 +215,11 @@ public com.google.storage.v2.ObjectChecksums getObjectChecksums() { * * *
                -   * The checksums of the complete object. This will be used to validate the
                -   * uploaded object. For each upload, object_checksums can be provided with
                -   * either StartResumableWriteRequest or the WriteObjectRequest with
                -   * finish_write set to `true`.
                +   * The checksums of the complete object. This is used to validate the
                +   * uploaded object. For each upload, `object_checksums` can be provided when
                +   * initiating a resumable upload with`StartResumableWriteRequest` or when
                +   * completing a write with `WriteObjectRequest` with
                +   * `finish_write` set to `true`.
                    * 
                * * .google.storage.v2.ObjectChecksums object_checksums = 5; @@ -677,8 +677,7 @@ public Builder mergeFrom( * * *
                -     * Required. The destination bucket, object, and metadata, as well as any
                -     * preconditions.
                +     * Required. Contains the information necessary to start a resumable write.
                      * 
                * * @@ -694,8 +693,7 @@ public boolean hasWriteObjectSpec() { * * *
                -     * Required. The destination bucket, object, and metadata, as well as any
                -     * preconditions.
                +     * Required. Contains the information necessary to start a resumable write.
                      * 
                * * @@ -717,8 +715,7 @@ public com.google.storage.v2.WriteObjectSpec getWriteObjectSpec() { * * *
                -     * Required. The destination bucket, object, and metadata, as well as any
                -     * preconditions.
                +     * Required. Contains the information necessary to start a resumable write.
                      * 
                * * @@ -742,8 +739,7 @@ public Builder setWriteObjectSpec(com.google.storage.v2.WriteObjectSpec value) { * * *
                -     * Required. The destination bucket, object, and metadata, as well as any
                -     * preconditions.
                +     * Required. Contains the information necessary to start a resumable write.
                      * 
                * * @@ -765,8 +761,7 @@ public Builder setWriteObjectSpec( * * *
                -     * Required. The destination bucket, object, and metadata, as well as any
                -     * preconditions.
                +     * Required. Contains the information necessary to start a resumable write.
                      * 
                * * @@ -795,8 +790,7 @@ public Builder mergeWriteObjectSpec(com.google.storage.v2.WriteObjectSpec value) * * *
                -     * Required. The destination bucket, object, and metadata, as well as any
                -     * preconditions.
                +     * Required. Contains the information necessary to start a resumable write.
                      * 
                * * @@ -817,8 +811,7 @@ public Builder clearWriteObjectSpec() { * * *
                -     * Required. The destination bucket, object, and metadata, as well as any
                -     * preconditions.
                +     * Required. Contains the information necessary to start a resumable write.
                      * 
                * * @@ -834,8 +827,7 @@ public com.google.storage.v2.WriteObjectSpec.Builder getWriteObjectSpecBuilder() * * *
                -     * Required. The destination bucket, object, and metadata, as well as any
                -     * preconditions.
                +     * Required. Contains the information necessary to start a resumable write.
                      * 
                * * @@ -855,8 +847,7 @@ public com.google.storage.v2.WriteObjectSpecOrBuilder getWriteObjectSpecOrBuilde * * *
                -     * Required. The destination bucket, object, and metadata, as well as any
                -     * preconditions.
                +     * Required. Contains the information necessary to start a resumable write.
                      * 
                * * @@ -890,7 +881,7 @@ public com.google.storage.v2.WriteObjectSpecOrBuilder getWriteObjectSpecOrBuilde * * *
                -     * A set of parameters common to Storage API requests concerning an object.
                +     * A set of parameters common to Storage API requests related to an object.
                      * 
                * * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; @@ -904,7 +895,7 @@ public boolean hasCommonObjectRequestParams() { * * *
                -     * A set of parameters common to Storage API requests concerning an object.
                +     * A set of parameters common to Storage API requests related to an object.
                      * 
                * * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; @@ -924,7 +915,7 @@ public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestPar * * *
                -     * A set of parameters common to Storage API requests concerning an object.
                +     * A set of parameters common to Storage API requests related to an object.
                      * 
                * * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; @@ -947,7 +938,7 @@ public Builder setCommonObjectRequestParams( * * *
                -     * A set of parameters common to Storage API requests concerning an object.
                +     * A set of parameters common to Storage API requests related to an object.
                      * 
                * * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; @@ -967,7 +958,7 @@ public Builder setCommonObjectRequestParams( * * *
                -     * A set of parameters common to Storage API requests concerning an object.
                +     * A set of parameters common to Storage API requests related to an object.
                      * 
                * * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; @@ -996,7 +987,7 @@ public Builder mergeCommonObjectRequestParams( * * *
                -     * A set of parameters common to Storage API requests concerning an object.
                +     * A set of parameters common to Storage API requests related to an object.
                      * 
                * * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; @@ -1015,7 +1006,7 @@ public Builder clearCommonObjectRequestParams() { * * *
                -     * A set of parameters common to Storage API requests concerning an object.
                +     * A set of parameters common to Storage API requests related to an object.
                      * 
                * * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; @@ -1030,7 +1021,7 @@ public Builder clearCommonObjectRequestParams() { * * *
                -     * A set of parameters common to Storage API requests concerning an object.
                +     * A set of parameters common to Storage API requests related to an object.
                      * 
                * * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; @@ -1049,7 +1040,7 @@ public Builder clearCommonObjectRequestParams() { * * *
                -     * A set of parameters common to Storage API requests concerning an object.
                +     * A set of parameters common to Storage API requests related to an object.
                      * 
                * * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; @@ -1081,10 +1072,11 @@ public Builder clearCommonObjectRequestParams() { * * *
                -     * The checksums of the complete object. This will be used to validate the
                -     * uploaded object. For each upload, object_checksums can be provided with
                -     * either StartResumableWriteRequest or the WriteObjectRequest with
                -     * finish_write set to `true`.
                +     * The checksums of the complete object. This is used to validate the
                +     * uploaded object. For each upload, `object_checksums` can be provided when
                +     * initiating a resumable upload with`StartResumableWriteRequest` or when
                +     * completing a write with `WriteObjectRequest` with
                +     * `finish_write` set to `true`.
                      * 
                * * .google.storage.v2.ObjectChecksums object_checksums = 5; @@ -1098,10 +1090,11 @@ public boolean hasObjectChecksums() { * * *
                -     * The checksums of the complete object. This will be used to validate the
                -     * uploaded object. For each upload, object_checksums can be provided with
                -     * either StartResumableWriteRequest or the WriteObjectRequest with
                -     * finish_write set to `true`.
                +     * The checksums of the complete object. This is used to validate the
                +     * uploaded object. For each upload, `object_checksums` can be provided when
                +     * initiating a resumable upload with`StartResumableWriteRequest` or when
                +     * completing a write with `WriteObjectRequest` with
                +     * `finish_write` set to `true`.
                      * 
                * * .google.storage.v2.ObjectChecksums object_checksums = 5; @@ -1121,10 +1114,11 @@ public com.google.storage.v2.ObjectChecksums getObjectChecksums() { * * *
                -     * The checksums of the complete object. This will be used to validate the
                -     * uploaded object. For each upload, object_checksums can be provided with
                -     * either StartResumableWriteRequest or the WriteObjectRequest with
                -     * finish_write set to `true`.
                +     * The checksums of the complete object. This is used to validate the
                +     * uploaded object. For each upload, `object_checksums` can be provided when
                +     * initiating a resumable upload with`StartResumableWriteRequest` or when
                +     * completing a write with `WriteObjectRequest` with
                +     * `finish_write` set to `true`.
                      * 
                * * .google.storage.v2.ObjectChecksums object_checksums = 5; @@ -1146,10 +1140,11 @@ public Builder setObjectChecksums(com.google.storage.v2.ObjectChecksums value) { * * *
                -     * The checksums of the complete object. This will be used to validate the
                -     * uploaded object. For each upload, object_checksums can be provided with
                -     * either StartResumableWriteRequest or the WriteObjectRequest with
                -     * finish_write set to `true`.
                +     * The checksums of the complete object. This is used to validate the
                +     * uploaded object. For each upload, `object_checksums` can be provided when
                +     * initiating a resumable upload with`StartResumableWriteRequest` or when
                +     * completing a write with `WriteObjectRequest` with
                +     * `finish_write` set to `true`.
                      * 
                * * .google.storage.v2.ObjectChecksums object_checksums = 5; @@ -1169,10 +1164,11 @@ public Builder setObjectChecksums( * * *
                -     * The checksums of the complete object. This will be used to validate the
                -     * uploaded object. For each upload, object_checksums can be provided with
                -     * either StartResumableWriteRequest or the WriteObjectRequest with
                -     * finish_write set to `true`.
                +     * The checksums of the complete object. This is used to validate the
                +     * uploaded object. For each upload, `object_checksums` can be provided when
                +     * initiating a resumable upload with`StartResumableWriteRequest` or when
                +     * completing a write with `WriteObjectRequest` with
                +     * `finish_write` set to `true`.
                      * 
                * * .google.storage.v2.ObjectChecksums object_checksums = 5; @@ -1199,10 +1195,11 @@ public Builder mergeObjectChecksums(com.google.storage.v2.ObjectChecksums value) * * *
                -     * The checksums of the complete object. This will be used to validate the
                -     * uploaded object. For each upload, object_checksums can be provided with
                -     * either StartResumableWriteRequest or the WriteObjectRequest with
                -     * finish_write set to `true`.
                +     * The checksums of the complete object. This is used to validate the
                +     * uploaded object. For each upload, `object_checksums` can be provided when
                +     * initiating a resumable upload with`StartResumableWriteRequest` or when
                +     * completing a write with `WriteObjectRequest` with
                +     * `finish_write` set to `true`.
                      * 
                * * .google.storage.v2.ObjectChecksums object_checksums = 5; @@ -1221,10 +1218,11 @@ public Builder clearObjectChecksums() { * * *
                -     * The checksums of the complete object. This will be used to validate the
                -     * uploaded object. For each upload, object_checksums can be provided with
                -     * either StartResumableWriteRequest or the WriteObjectRequest with
                -     * finish_write set to `true`.
                +     * The checksums of the complete object. This is used to validate the
                +     * uploaded object. For each upload, `object_checksums` can be provided when
                +     * initiating a resumable upload with`StartResumableWriteRequest` or when
                +     * completing a write with `WriteObjectRequest` with
                +     * `finish_write` set to `true`.
                      * 
                * * .google.storage.v2.ObjectChecksums object_checksums = 5; @@ -1238,10 +1236,11 @@ public com.google.storage.v2.ObjectChecksums.Builder getObjectChecksumsBuilder() * * *
                -     * The checksums of the complete object. This will be used to validate the
                -     * uploaded object. For each upload, object_checksums can be provided with
                -     * either StartResumableWriteRequest or the WriteObjectRequest with
                -     * finish_write set to `true`.
                +     * The checksums of the complete object. This is used to validate the
                +     * uploaded object. For each upload, `object_checksums` can be provided when
                +     * initiating a resumable upload with`StartResumableWriteRequest` or when
                +     * completing a write with `WriteObjectRequest` with
                +     * `finish_write` set to `true`.
                      * 
                * * .google.storage.v2.ObjectChecksums object_checksums = 5; @@ -1259,10 +1258,11 @@ public com.google.storage.v2.ObjectChecksumsOrBuilder getObjectChecksumsOrBuilde * * *
                -     * The checksums of the complete object. This will be used to validate the
                -     * uploaded object. For each upload, object_checksums can be provided with
                -     * either StartResumableWriteRequest or the WriteObjectRequest with
                -     * finish_write set to `true`.
                +     * The checksums of the complete object. This is used to validate the
                +     * uploaded object. For each upload, `object_checksums` can be provided when
                +     * initiating a resumable upload with`StartResumableWriteRequest` or when
                +     * completing a write with `WriteObjectRequest` with
                +     * `finish_write` set to `true`.
                      * 
                * * .google.storage.v2.ObjectChecksums object_checksums = 5; diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequestOrBuilder.java index 1c2c87b0f3..85e108249f 100644 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequestOrBuilder.java +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequestOrBuilder.java @@ -28,8 +28,7 @@ public interface StartResumableWriteRequestOrBuilder * * *
                -   * Required. The destination bucket, object, and metadata, as well as any
                -   * preconditions.
                +   * Required. Contains the information necessary to start a resumable write.
                    * 
                * * @@ -43,8 +42,7 @@ public interface StartResumableWriteRequestOrBuilder * * *
                -   * Required. The destination bucket, object, and metadata, as well as any
                -   * preconditions.
                +   * Required. Contains the information necessary to start a resumable write.
                    * 
                * * @@ -58,8 +56,7 @@ public interface StartResumableWriteRequestOrBuilder * * *
                -   * Required. The destination bucket, object, and metadata, as well as any
                -   * preconditions.
                +   * Required. Contains the information necessary to start a resumable write.
                    * 
                * * @@ -72,7 +69,7 @@ public interface StartResumableWriteRequestOrBuilder * * *
                -   * A set of parameters common to Storage API requests concerning an object.
                +   * A set of parameters common to Storage API requests related to an object.
                    * 
                * * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; @@ -84,7 +81,7 @@ public interface StartResumableWriteRequestOrBuilder * * *
                -   * A set of parameters common to Storage API requests concerning an object.
                +   * A set of parameters common to Storage API requests related to an object.
                    * 
                * * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; @@ -96,7 +93,7 @@ public interface StartResumableWriteRequestOrBuilder * * *
                -   * A set of parameters common to Storage API requests concerning an object.
                +   * A set of parameters common to Storage API requests related to an object.
                    * 
                * * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; @@ -107,10 +104,11 @@ public interface StartResumableWriteRequestOrBuilder * * *
                -   * The checksums of the complete object. This will be used to validate the
                -   * uploaded object. For each upload, object_checksums can be provided with
                -   * either StartResumableWriteRequest or the WriteObjectRequest with
                -   * finish_write set to `true`.
                +   * The checksums of the complete object. This is used to validate the
                +   * uploaded object. For each upload, `object_checksums` can be provided when
                +   * initiating a resumable upload with`StartResumableWriteRequest` or when
                +   * completing a write with `WriteObjectRequest` with
                +   * `finish_write` set to `true`.
                    * 
                * * .google.storage.v2.ObjectChecksums object_checksums = 5; @@ -122,10 +120,11 @@ public interface StartResumableWriteRequestOrBuilder * * *
                -   * The checksums of the complete object. This will be used to validate the
                -   * uploaded object. For each upload, object_checksums can be provided with
                -   * either StartResumableWriteRequest or the WriteObjectRequest with
                -   * finish_write set to `true`.
                +   * The checksums of the complete object. This is used to validate the
                +   * uploaded object. For each upload, `object_checksums` can be provided when
                +   * initiating a resumable upload with`StartResumableWriteRequest` or when
                +   * completing a write with `WriteObjectRequest` with
                +   * `finish_write` set to `true`.
                    * 
                * * .google.storage.v2.ObjectChecksums object_checksums = 5; @@ -137,10 +136,11 @@ public interface StartResumableWriteRequestOrBuilder * * *
                -   * The checksums of the complete object. This will be used to validate the
                -   * uploaded object. For each upload, object_checksums can be provided with
                -   * either StartResumableWriteRequest or the WriteObjectRequest with
                -   * finish_write set to `true`.
                +   * The checksums of the complete object. This is used to validate the
                +   * uploaded object. For each upload, `object_checksums` can be provided when
                +   * initiating a resumable upload with`StartResumableWriteRequest` or when
                +   * completing a write with `WriteObjectRequest` with
                +   * `finish_write` set to `true`.
                    * 
                * * .google.storage.v2.ObjectChecksums object_checksums = 5; diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponse.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponse.java index 1458f6946e..639ea509df 100644 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponse.java +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponse.java @@ -71,8 +71,11 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
                -   * The upload_id of the newly started resumable write operation. This
                -   * value should be copied into the `WriteObjectRequest.upload_id` field.
                +   * A unique identifier for the initiated resumable write operation.
                +   * As the ID grants write access, you should keep it confidential during
                +   * the upload to prevent unauthorized access and data tampering during your
                +   * upload. This ID should be included in subsequent `WriteObject` requests to
                +   * upload the object data.
                    * 
                * * string upload_id = 1; @@ -95,8 +98,11 @@ public java.lang.String getUploadId() { * * *
                -   * The upload_id of the newly started resumable write operation. This
                -   * value should be copied into the `WriteObjectRequest.upload_id` field.
                +   * A unique identifier for the initiated resumable write operation.
                +   * As the ID grants write access, you should keep it confidential during
                +   * the upload to prevent unauthorized access and data tampering during your
                +   * upload. This ID should be included in subsequent `WriteObject` requests to
                +   * upload the object data.
                    * 
                * * string upload_id = 1; @@ -463,8 +469,11 @@ public Builder mergeFrom( * * *
                -     * The upload_id of the newly started resumable write operation. This
                -     * value should be copied into the `WriteObjectRequest.upload_id` field.
                +     * A unique identifier for the initiated resumable write operation.
                +     * As the ID grants write access, you should keep it confidential during
                +     * the upload to prevent unauthorized access and data tampering during your
                +     * upload. This ID should be included in subsequent `WriteObject` requests to
                +     * upload the object data.
                      * 
                * * string upload_id = 1; @@ -486,8 +495,11 @@ public java.lang.String getUploadId() { * * *
                -     * The upload_id of the newly started resumable write operation. This
                -     * value should be copied into the `WriteObjectRequest.upload_id` field.
                +     * A unique identifier for the initiated resumable write operation.
                +     * As the ID grants write access, you should keep it confidential during
                +     * the upload to prevent unauthorized access and data tampering during your
                +     * upload. This ID should be included in subsequent `WriteObject` requests to
                +     * upload the object data.
                      * 
                * * string upload_id = 1; @@ -509,8 +521,11 @@ public com.google.protobuf.ByteString getUploadIdBytes() { * * *
                -     * The upload_id of the newly started resumable write operation. This
                -     * value should be copied into the `WriteObjectRequest.upload_id` field.
                +     * A unique identifier for the initiated resumable write operation.
                +     * As the ID grants write access, you should keep it confidential during
                +     * the upload to prevent unauthorized access and data tampering during your
                +     * upload. This ID should be included in subsequent `WriteObject` requests to
                +     * upload the object data.
                      * 
                * * string upload_id = 1; @@ -531,8 +546,11 @@ public Builder setUploadId(java.lang.String value) { * * *
                -     * The upload_id of the newly started resumable write operation. This
                -     * value should be copied into the `WriteObjectRequest.upload_id` field.
                +     * A unique identifier for the initiated resumable write operation.
                +     * As the ID grants write access, you should keep it confidential during
                +     * the upload to prevent unauthorized access and data tampering during your
                +     * upload. This ID should be included in subsequent `WriteObject` requests to
                +     * upload the object data.
                      * 
                * * string upload_id = 1; @@ -549,8 +567,11 @@ public Builder clearUploadId() { * * *
                -     * The upload_id of the newly started resumable write operation. This
                -     * value should be copied into the `WriteObjectRequest.upload_id` field.
                +     * A unique identifier for the initiated resumable write operation.
                +     * As the ID grants write access, you should keep it confidential during
                +     * the upload to prevent unauthorized access and data tampering during your
                +     * upload. This ID should be included in subsequent `WriteObject` requests to
                +     * upload the object data.
                      * 
                * * string upload_id = 1; diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponseOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponseOrBuilder.java index 26ca3752f2..7aa0beb166 100644 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponseOrBuilder.java +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponseOrBuilder.java @@ -28,8 +28,11 @@ public interface StartResumableWriteResponseOrBuilder * * *
                -   * The upload_id of the newly started resumable write operation. This
                -   * value should be copied into the `WriteObjectRequest.upload_id` field.
                +   * A unique identifier for the initiated resumable write operation.
                +   * As the ID grants write access, you should keep it confidential during
                +   * the upload to prevent unauthorized access and data tampering during your
                +   * upload. This ID should be included in subsequent `WriteObject` requests to
                +   * upload the object data.
                    * 
                * * string upload_id = 1; @@ -41,8 +44,11 @@ public interface StartResumableWriteResponseOrBuilder * * *
                -   * The upload_id of the newly started resumable write operation. This
                -   * value should be copied into the `WriteObjectRequest.upload_id` field.
                +   * A unique identifier for the initiated resumable write operation.
                +   * As the ID grants write access, you should keep it confidential during
                +   * the upload to prevent unauthorized access and data tampering during your
                +   * upload. This ID should be included in subsequent `WriteObject` requests to
                +   * upload the object data.
                    * 
                * * string upload_id = 1; diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageProto.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageProto.java index 4b728da794..82ab3bb471 100644 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageProto.java +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageProto.java @@ -96,6 +96,50 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_storage_v2_ReadObjectResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_storage_v2_ReadObjectResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_BidiReadObjectSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_BidiReadObjectSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_BidiReadObjectRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_BidiReadObjectRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_BidiReadObjectResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_BidiReadObjectResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_BidiReadObjectRedirectedError_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_BidiReadObjectRedirectedError_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_BidiWriteObjectRedirectedError_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_BidiWriteObjectRedirectedError_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_BidiReadObjectError_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_BidiReadObjectError_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_ReadRangeError_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_ReadRangeError_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_ReadRange_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_ReadRange_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_ObjectRangeData_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_ObjectRangeData_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_BidiReadHandle_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_BidiReadHandle_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_BidiWriteHandle_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_BidiWriteHandle_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_storage_v2_WriteObjectSpec_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -108,6 +152,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_storage_v2_WriteObjectResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_storage_v2_WriteObjectResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_AppendObjectSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_AppendObjectSpec_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_storage_v2_BidiWriteObjectRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -297,526 +345,590 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "gle/iam/v1/policy.proto\032\036google/protobuf" + "/duration.proto\032\033google/protobuf/empty.p" + "roto\032 google/protobuf/field_mask.proto\032\037" - + "google/protobuf/timestamp.proto\032\026google/" - + "type/date.proto\"\326\001\n\023DeleteBucketRequest\022" - + "3\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035storage.googleapi" - + "s.com/Bucket\022$\n\027if_metageneration_match\030" - + "\002 \001(\003H\000\210\001\001\022(\n\033if_metageneration_not_matc" - + "h\030\003 \001(\003H\001\210\001\001B\032\n\030_if_metageneration_match" - + "B\036\n\034_if_metageneration_not_match\"\225\002\n\020Get" - + "BucketRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035sto" - + "rage.googleapis.com/Bucket\022$\n\027if_metagen" - + "eration_match\030\002 \001(\003H\000\210\001\001\022(\n\033if_metagener" - + "ation_not_match\030\003 \001(\003H\001\210\001\001\0222\n\tread_mask\030" - + "\005 \001(\0132\032.google.protobuf.FieldMaskH\002\210\001\001B\032" - + "\n\030_if_metageneration_matchB\036\n\034_if_metage" - + "neration_not_matchB\014\n\n_read_mask\"\316\001\n\023Cre" - + "ateBucketRequest\0225\n\006parent\030\001 \001(\tB%\340A\002\372A\037" - + "\022\035storage.googleapis.com/Bucket\022)\n\006bucke" - + "t\030\002 \001(\0132\031.google.storage.v2.Bucket\022\026\n\tbu" - + "cket_id\030\003 \001(\tB\003\340A\002\022\026\n\016predefined_acl\030\006 \001" - + "(\t\022%\n\035predefined_default_object_acl\030\007 \001(" - + "\t\"\304\001\n\022ListBucketsRequest\0225\n\006parent\030\001 \001(\t" - + "B%\340A\002\372A\037\022\035storage.googleapis.com/Bucket\022" - + "\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016" - + "\n\006prefix\030\004 \001(\t\0222\n\tread_mask\030\005 \001(\0132\032.goog" - + "le.protobuf.FieldMaskH\000\210\001\001B\014\n\n_read_mask" - + "\"Z\n\023ListBucketsResponse\022*\n\007buckets\030\001 \003(\013" - + "2\031.google.storage.v2.Bucket\022\027\n\017next_page" - + "_token\030\002 \001(\t\"\177\n LockBucketRetentionPolic" - + "yRequest\0225\n\006bucket\030\001 \001(\tB%\340A\002\372A\037\n\035storag" - + "e.googleapis.com/Bucket\022$\n\027if_metagenera" - + "tion_match\030\002 \001(\003B\003\340A\002\"\306\002\n\023UpdateBucketRe" - + "quest\022.\n\006bucket\030\001 \001(\0132\031.google.storage.v" - + "2.BucketB\003\340A\002\022$\n\027if_metageneration_match" - + "\030\002 \001(\003H\000\210\001\001\022(\n\033if_metageneration_not_mat" - + "ch\030\003 \001(\003H\001\210\001\001\022\026\n\016predefined_acl\030\010 \001(\t\022%\n" - + "\035predefined_default_object_acl\030\t \001(\t\0224\n\013" - + "update_mask\030\006 \001(\0132\032.google.protobuf.Fiel" - + "dMaskB\003\340A\002B\032\n\030_if_metageneration_matchB\036" - + "\n\034_if_metageneration_not_match\"\365\005\n\024Compo" - + "seObjectRequest\0223\n\013destination\030\001 \001(\0132\031.g" - + "oogle.storage.v2.ObjectB\003\340A\002\022L\n\016source_o" - + "bjects\030\002 \003(\01324.google.storage.v2.Compose" - + "ObjectRequest.SourceObject\022\"\n\032destinatio" - + "n_predefined_acl\030\t \001(\t\022 \n\023if_generation_" - + "match\030\004 \001(\003H\000\210\001\001\022$\n\027if_metageneration_ma" - + "tch\030\005 \001(\003H\001\210\001\001\0227\n\007kms_key\030\006 \001(\tB&\372A#\n!cl" - + "oudkms.googleapis.com/CryptoKey\022R\n\034commo" - + "n_object_request_params\030\007 \001(\0132,.google.s" - + "torage.v2.CommonObjectRequestParams\022<\n\020o" - + "bject_checksums\030\n \001(\0132\".google.storage.v" - + "2.ObjectChecksums\032\356\001\n\014SourceObject\022\021\n\004na" - + "me\030\001 \001(\tB\003\340A\002\022\022\n\ngeneration\030\002 \001(\003\022f\n\024obj" - + "ect_preconditions\030\003 \001(\0132H.google.storage" - + ".v2.ComposeObjectRequest.SourceObject.Ob" - + "jectPreconditions\032O\n\023ObjectPreconditions" - + "\022 \n\023if_generation_match\030\001 \001(\003H\000\210\001\001B\026\n\024_i" - + "f_generation_matchB\026\n\024_if_generation_mat" - + "chB\032\n\030_if_metageneration_match\"\321\003\n\023Delet" - + "eObjectRequest\0225\n\006bucket\030\001 \001(\tB%\340A\002\372A\037\n\035" - + "storage.googleapis.com/Bucket\022\023\n\006object\030" - + "\002 \001(\tB\003\340A\002\022\022\n\ngeneration\030\004 \001(\003\022 \n\023if_gen" - + "eration_match\030\005 \001(\003H\000\210\001\001\022$\n\027if_generatio" - + "n_not_match\030\006 \001(\003H\001\210\001\001\022$\n\027if_metagenerat" - + "ion_match\030\007 \001(\003H\002\210\001\001\022(\n\033if_metageneratio" - + "n_not_match\030\010 \001(\003H\003\210\001\001\022R\n\034common_object_" - + "request_params\030\n \001(\0132,.google.storage.v2" - + ".CommonObjectRequestParamsB\026\n\024_if_genera" - + "tion_matchB\032\n\030_if_generation_not_matchB\032" - + "\n\030_if_metageneration_matchB\036\n\034_if_metage" - + "neration_not_match\"\245\004\n\024RestoreObjectRequ" - + "est\0225\n\006bucket\030\001 \001(\tB%\340A\002\372A\037\n\035storage.goo" - + "gleapis.com/Bucket\022\023\n\006object\030\002 \001(\tB\003\340A\002\022" - + "\027\n\ngeneration\030\003 \001(\003B\003\340A\002\022\032\n\rrestore_toke" - + "n\030\013 \001(\tB\003\340A\001\022 \n\023if_generation_match\030\004 \001(" - + "\003H\000\210\001\001\022$\n\027if_generation_not_match\030\005 \001(\003H" - + "\001\210\001\001\022$\n\027if_metageneration_match\030\006 \001(\003H\002\210" - + "\001\001\022(\n\033if_metageneration_not_match\030\007 \001(\003H" - + "\003\210\001\001\022\034\n\017copy_source_acl\030\t \001(\010H\004\210\001\001\022R\n\034co" - + "mmon_object_request_params\030\010 \001(\0132,.googl" - + "e.storage.v2.CommonObjectRequestParamsB\026" - + "\n\024_if_generation_matchB\032\n\030_if_generation" - + "_not_matchB\032\n\030_if_metageneration_matchB\036" - + "\n\034_if_metageneration_not_matchB\022\n\020_copy_" - + "source_acl\"5\n\033CancelResumableWriteReques" - + "t\022\026\n\tupload_id\030\001 \001(\tB\003\340A\002\"\036\n\034CancelResum" - + "ableWriteResponse\"\272\004\n\021ReadObjectRequest\022" + + "google/protobuf/timestamp.proto\032\027google/" + + "rpc/status.proto\032\026google/type/date.proto" + + "\"\326\001\n\023DeleteBucketRequest\0223\n\004name\030\001 \001(\tB%" + + "\340A\002\372A\037\n\035storage.googleapis.com/Bucket\022$\n" + + "\027if_metageneration_match\030\002 \001(\003H\000\210\001\001\022(\n\033i" + + "f_metageneration_not_match\030\003 \001(\003H\001\210\001\001B\032\n" + + "\030_if_metageneration_matchB\036\n\034_if_metagen" + + "eration_not_match\"\225\002\n\020GetBucketRequest\0223" + + "\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035storage.googleapis" + + ".com/Bucket\022$\n\027if_metageneration_match\030\002" + + " \001(\003H\000\210\001\001\022(\n\033if_metageneration_not_match" + + "\030\003 \001(\003H\001\210\001\001\0222\n\tread_mask\030\005 \001(\0132\032.google." + + "protobuf.FieldMaskH\002\210\001\001B\032\n\030_if_metagener" + + "ation_matchB\036\n\034_if_metageneration_not_ma" + + "tchB\014\n\n_read_mask\"\316\001\n\023CreateBucketReques" + + "t\0225\n\006parent\030\001 \001(\tB%\340A\002\372A\037\022\035storage.googl" + + "eapis.com/Bucket\022)\n\006bucket\030\002 \001(\0132\031.googl" + + "e.storage.v2.Bucket\022\026\n\tbucket_id\030\003 \001(\tB\003" + + "\340A\002\022\026\n\016predefined_acl\030\006 \001(\t\022%\n\035predefine" + + "d_default_object_acl\030\007 \001(\t\"\304\001\n\022ListBucke" + + "tsRequest\0225\n\006parent\030\001 \001(\tB%\340A\002\372A\037\022\035stora" + + "ge.googleapis.com/Bucket\022\021\n\tpage_size\030\002 " + + "\001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n\006prefix\030\004 \001(\t\022" + + "2\n\tread_mask\030\005 \001(\0132\032.google.protobuf.Fie" + + "ldMaskH\000\210\001\001B\014\n\n_read_mask\"Z\n\023ListBuckets" + + "Response\022*\n\007buckets\030\001 \003(\0132\031.google.stora" + + "ge.v2.Bucket\022\027\n\017next_page_token\030\002 \001(\t\"\177\n" + + " LockBucketRetentionPolicyRequest\0225\n\006buc" + + "ket\030\001 \001(\tB%\340A\002\372A\037\n\035storage.googleapis.co" + + "m/Bucket\022$\n\027if_metageneration_match\030\002 \001(" + + "\003B\003\340A\002\"\306\002\n\023UpdateBucketRequest\022.\n\006bucket" + + "\030\001 \001(\0132\031.google.storage.v2.BucketB\003\340A\002\022$" + + "\n\027if_metageneration_match\030\002 \001(\003H\000\210\001\001\022(\n\033" + + "if_metageneration_not_match\030\003 \001(\003H\001\210\001\001\022\026" + + "\n\016predefined_acl\030\010 \001(\t\022%\n\035predefined_def" + + "ault_object_acl\030\t \001(\t\0224\n\013update_mask\030\006 \001" + + "(\0132\032.google.protobuf.FieldMaskB\003\340A\002B\032\n\030_" + + "if_metageneration_matchB\036\n\034_if_metagener" + + "ation_not_match\"\365\005\n\024ComposeObjectRequest" + + "\0223\n\013destination\030\001 \001(\0132\031.google.storage.v" + + "2.ObjectB\003\340A\002\022L\n\016source_objects\030\002 \003(\01324." + + "google.storage.v2.ComposeObjectRequest.S" + + "ourceObject\022\"\n\032destination_predefined_ac" + + "l\030\t \001(\t\022 \n\023if_generation_match\030\004 \001(\003H\000\210\001" + + "\001\022$\n\027if_metageneration_match\030\005 \001(\003H\001\210\001\001\022" + + "7\n\007kms_key\030\006 \001(\tB&\372A#\n!cloudkms.googleap" + + "is.com/CryptoKey\022R\n\034common_object_reques" + + "t_params\030\007 \001(\0132,.google.storage.v2.Commo" + + "nObjectRequestParams\022<\n\020object_checksums" + + "\030\n \001(\0132\".google.storage.v2.ObjectChecksu" + + "ms\032\356\001\n\014SourceObject\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\022" + + "\n\ngeneration\030\002 \001(\003\022f\n\024object_preconditio" + + "ns\030\003 \001(\0132H.google.storage.v2.ComposeObje" + + "ctRequest.SourceObject.ObjectPreconditio" + + "ns\032O\n\023ObjectPreconditions\022 \n\023if_generati" + + "on_match\030\001 \001(\003H\000\210\001\001B\026\n\024_if_generation_ma" + + "tchB\026\n\024_if_generation_matchB\032\n\030_if_metag" + + "eneration_match\"\321\003\n\023DeleteObjectRequest\022" + "5\n\006bucket\030\001 \001(\tB%\340A\002\372A\037\n\035storage.googlea" + "pis.com/Bucket\022\023\n\006object\030\002 \001(\tB\003\340A\002\022\022\n\ng" - + "eneration\030\003 \001(\003\022\023\n\013read_offset\030\004 \001(\003\022\022\n\n" - + "read_limit\030\005 \001(\003\022 \n\023if_generation_match\030" - + "\006 \001(\003H\000\210\001\001\022$\n\027if_generation_not_match\030\007 " - + "\001(\003H\001\210\001\001\022$\n\027if_metageneration_match\030\010 \001(" - + "\003H\002\210\001\001\022(\n\033if_metageneration_not_match\030\t " - + "\001(\003H\003\210\001\001\022R\n\034common_object_request_params" - + "\030\n \001(\0132,.google.storage.v2.CommonObjectR" - + "equestParams\0222\n\tread_mask\030\014 \001(\0132\032.google" - + ".protobuf.FieldMaskH\004\210\001\001B\026\n\024_if_generati" - + "on_matchB\032\n\030_if_generation_not_matchB\032\n\030" - + "_if_metageneration_matchB\036\n\034_if_metagene" - + "ration_not_matchB\014\n\n_read_mask\"\330\004\n\020GetOb" - + "jectRequest\0225\n\006bucket\030\001 \001(\tB%\340A\002\372A\037\n\035sto" - + "rage.googleapis.com/Bucket\022\023\n\006object\030\002 \001" - + "(\tB\003\340A\002\022\022\n\ngeneration\030\003 \001(\003\022\031\n\014soft_dele" - + "ted\030\013 \001(\010H\000\210\001\001\022 \n\023if_generation_match\030\004 " - + "\001(\003H\001\210\001\001\022$\n\027if_generation_not_match\030\005 \001(" - + "\003H\002\210\001\001\022$\n\027if_metageneration_match\030\006 \001(\003H" - + "\003\210\001\001\022(\n\033if_metageneration_not_match\030\007 \001(" - + "\003H\004\210\001\001\022R\n\034common_object_request_params\030\010" - + " \001(\0132,.google.storage.v2.CommonObjectReq" - + "uestParams\0222\n\tread_mask\030\n \001(\0132\032.google.p" - + "rotobuf.FieldMaskH\005\210\001\001\022\032\n\rrestore_token\030" - + "\014 \001(\tB\003\340A\001B\017\n\r_soft_deletedB\026\n\024_if_gener" - + "ation_matchB\032\n\030_if_generation_not_matchB" - + "\032\n\030_if_metageneration_matchB\036\n\034_if_metag" - + "eneration_not_matchB\014\n\n_read_mask\"\365\001\n\022Re" - + "adObjectResponse\022<\n\020checksummed_data\030\001 \001" - + "(\0132\".google.storage.v2.ChecksummedData\022<" - + "\n\020object_checksums\030\002 \001(\0132\".google.storag" - + "e.v2.ObjectChecksums\0226\n\rcontent_range\030\003 " - + "\001(\0132\037.google.storage.v2.ContentRange\022+\n\010" - + "metadata\030\004 \001(\0132\031.google.storage.v2.Objec" - + "t\"\215\003\n\017WriteObjectSpec\0220\n\010resource\030\001 \001(\0132" - + "\031.google.storage.v2.ObjectB\003\340A\002\022\026\n\016prede" - + "fined_acl\030\007 \001(\t\022 \n\023if_generation_match\030\003" - + " \001(\003H\000\210\001\001\022$\n\027if_generation_not_match\030\004 \001" - + "(\003H\001\210\001\001\022$\n\027if_metageneration_match\030\005 \001(\003" - + "H\002\210\001\001\022(\n\033if_metageneration_not_match\030\006 \001" - + "(\003H\003\210\001\001\022\030\n\013object_size\030\010 \001(\003H\004\210\001\001B\026\n\024_if" - + "_generation_matchB\032\n\030_if_generation_not_" - + "matchB\032\n\030_if_metageneration_matchB\036\n\034_if" - + "_metageneration_not_matchB\016\n\014_object_siz" - + "e\"\206\003\n\022WriteObjectRequest\022\023\n\tupload_id\030\001 " - + "\001(\tH\000\022?\n\021write_object_spec\030\002 \001(\0132\".googl" - + "e.storage.v2.WriteObjectSpecH\000\022\031\n\014write_" - + "offset\030\003 \001(\003B\003\340A\002\022>\n\020checksummed_data\030\004 " - + "\001(\0132\".google.storage.v2.ChecksummedDataH" - + "\001\022<\n\020object_checksums\030\006 \001(\0132\".google.sto" - + "rage.v2.ObjectChecksums\022\024\n\014finish_write\030" - + "\007 \001(\010\022R\n\034common_object_request_params\030\010 " - + "\001(\0132,.google.storage.v2.CommonObjectRequ" - + "estParamsB\017\n\rfirst_messageB\006\n\004data\"n\n\023Wr" - + "iteObjectResponse\022\030\n\016persisted_size\030\001 \001(" - + "\003H\000\022-\n\010resource\030\002 \001(\0132\031.google.storage.v" - + "2.ObjectH\000B\016\n\014write_status\"\257\003\n\026BidiWrite" + + "eneration\030\004 \001(\003\022 \n\023if_generation_match\030\005" + + " \001(\003H\000\210\001\001\022$\n\027if_generation_not_match\030\006 \001" + + "(\003H\001\210\001\001\022$\n\027if_metageneration_match\030\007 \001(\003" + + "H\002\210\001\001\022(\n\033if_metageneration_not_match\030\010 \001" + + "(\003H\003\210\001\001\022R\n\034common_object_request_params\030" + + "\n \001(\0132,.google.storage.v2.CommonObjectRe" + + "questParamsB\026\n\024_if_generation_matchB\032\n\030_" + + "if_generation_not_matchB\032\n\030_if_metagener" + + "ation_matchB\036\n\034_if_metageneration_not_ma" + + "tch\"\245\004\n\024RestoreObjectRequest\0225\n\006bucket\030\001" + + " \001(\tB%\340A\002\372A\037\n\035storage.googleapis.com/Buc" + + "ket\022\023\n\006object\030\002 \001(\tB\003\340A\002\022\027\n\ngeneration\030\003" + + " \001(\003B\003\340A\002\022\032\n\rrestore_token\030\013 \001(\tB\003\340A\001\022 \n" + + "\023if_generation_match\030\004 \001(\003H\000\210\001\001\022$\n\027if_ge" + + "neration_not_match\030\005 \001(\003H\001\210\001\001\022$\n\027if_meta" + + "generation_match\030\006 \001(\003H\002\210\001\001\022(\n\033if_metage" + + "neration_not_match\030\007 \001(\003H\003\210\001\001\022\034\n\017copy_so" + + "urce_acl\030\t \001(\010H\004\210\001\001\022R\n\034common_object_req" + + "uest_params\030\010 \001(\0132,.google.storage.v2.Co" + + "mmonObjectRequestParamsB\026\n\024_if_generatio" + + "n_matchB\032\n\030_if_generation_not_matchB\032\n\030_" + + "if_metageneration_matchB\036\n\034_if_metagener" + + "ation_not_matchB\022\n\020_copy_source_acl\"5\n\033C" + + "ancelResumableWriteRequest\022\026\n\tupload_id\030" + + "\001 \001(\tB\003\340A\002\"\036\n\034CancelResumableWriteRespon" + + "se\"\272\004\n\021ReadObjectRequest\0225\n\006bucket\030\001 \001(\t" + + "B%\340A\002\372A\037\n\035storage.googleapis.com/Bucket\022" + + "\023\n\006object\030\002 \001(\tB\003\340A\002\022\022\n\ngeneration\030\003 \001(\003" + + "\022\023\n\013read_offset\030\004 \001(\003\022\022\n\nread_limit\030\005 \001(" + + "\003\022 \n\023if_generation_match\030\006 \001(\003H\000\210\001\001\022$\n\027i" + + "f_generation_not_match\030\007 \001(\003H\001\210\001\001\022$\n\027if_" + + "metageneration_match\030\010 \001(\003H\002\210\001\001\022(\n\033if_me" + + "tageneration_not_match\030\t \001(\003H\003\210\001\001\022R\n\034com" + + "mon_object_request_params\030\n \001(\0132,.google" + + ".storage.v2.CommonObjectRequestParams\0222\n" + + "\tread_mask\030\014 \001(\0132\032.google.protobuf.Field" + + "MaskH\004\210\001\001B\026\n\024_if_generation_matchB\032\n\030_if" + + "_generation_not_matchB\032\n\030_if_metagenerat" + + "ion_matchB\036\n\034_if_metageneration_not_matc" + + "hB\014\n\n_read_mask\"\330\004\n\020GetObjectRequest\0225\n\006" + + "bucket\030\001 \001(\tB%\340A\002\372A\037\n\035storage.googleapis" + + ".com/Bucket\022\023\n\006object\030\002 \001(\tB\003\340A\002\022\022\n\ngene" + + "ration\030\003 \001(\003\022\031\n\014soft_deleted\030\013 \001(\010H\000\210\001\001\022" + + " \n\023if_generation_match\030\004 \001(\003H\001\210\001\001\022$\n\027if_" + + "generation_not_match\030\005 \001(\003H\002\210\001\001\022$\n\027if_me" + + "tageneration_match\030\006 \001(\003H\003\210\001\001\022(\n\033if_meta" + + "generation_not_match\030\007 \001(\003H\004\210\001\001\022R\n\034commo" + + "n_object_request_params\030\010 \001(\0132,.google.s" + + "torage.v2.CommonObjectRequestParams\0222\n\tr" + + "ead_mask\030\n \001(\0132\032.google.protobuf.FieldMa" + + "skH\005\210\001\001\022\032\n\rrestore_token\030\014 \001(\tB\003\340A\001B\017\n\r_" + + "soft_deletedB\026\n\024_if_generation_matchB\032\n\030" + + "_if_generation_not_matchB\032\n\030_if_metagene" + + "ration_matchB\036\n\034_if_metageneration_not_m" + + "atchB\014\n\n_read_mask\"\365\001\n\022ReadObjectRespons" + + "e\022<\n\020checksummed_data\030\001 \001(\0132\".google.sto" + + "rage.v2.ChecksummedData\022<\n\020object_checks" + + "ums\030\002 \001(\0132\".google.storage.v2.ObjectChec" + + "ksums\0226\n\rcontent_range\030\003 \001(\0132\037.google.st" + + "orage.v2.ContentRange\022+\n\010metadata\030\004 \001(\0132" + + "\031.google.storage.v2.Object\"\221\005\n\022BidiReadO" + + "bjectSpec\0225\n\006bucket\030\001 \001(\tB%\340A\002\372A\037\n\035stora" + + "ge.googleapis.com/Bucket\022\023\n\006object\030\002 \001(\t" + + "B\003\340A\002\022\022\n\ngeneration\030\003 \001(\003\022 \n\023if_generati" + + "on_match\030\004 \001(\003H\000\210\001\001\022$\n\027if_generation_not" + + "_match\030\005 \001(\003H\001\210\001\001\022$\n\027if_metageneration_m" + + "atch\030\006 \001(\003H\002\210\001\001\022(\n\033if_metageneration_not" + + "_match\030\007 \001(\003H\003\210\001\001\022R\n\034common_object_reque" + + "st_params\030\010 \001(\0132,.google.storage.v2.Comm" + + "onObjectRequestParams\0226\n\tread_mask\030\014 \001(\013" + + "2\032.google.protobuf.FieldMaskB\002\030\001H\004\210\001\001\022;\n" + + "\013read_handle\030\r \001(\0132!.google.storage.v2.B" + + "idiReadHandleH\005\210\001\001\022\032\n\rrouting_token\030\016 \001(" + + "\tH\006\210\001\001B\026\n\024_if_generation_matchB\032\n\030_if_ge" + + "neration_not_matchB\032\n\030_if_metageneration" + + "_matchB\036\n\034_if_metageneration_not_matchB\014" + + "\n\n_read_maskB\016\n\014_read_handleB\020\n\016_routing" + + "_token\"\213\001\n\025BidiReadObjectRequest\022?\n\020read" + + "_object_spec\030\001 \001(\0132%.google.storage.v2.B" + + "idiReadObjectSpec\0221\n\013read_ranges\030\010 \003(\0132\034" + + ".google.storage.v2.ReadRange\"\275\001\n\026BidiRea" + + "dObjectResponse\022>\n\022object_data_ranges\030\006 " + + "\003(\0132\".google.storage.v2.ObjectRangeData\022" + + "+\n\010metadata\030\004 \001(\0132\031.google.storage.v2.Ob" + + "ject\0226\n\013read_handle\030\007 \001(\0132!.google.stora" + + "ge.v2.BidiReadHandle\"\205\001\n\035BidiReadObjectR" + + "edirectedError\0226\n\013read_handle\030\001 \001(\0132!.go" + + "ogle.storage.v2.BidiReadHandle\022\032\n\rroutin" + + "g_token\030\002 \001(\tH\000\210\001\001B\020\n\016_routing_token\"\306\001\n" + + "\036BidiWriteObjectRedirectedError\022\032\n\rrouti" + + "ng_token\030\001 \001(\tH\000\210\001\001\022=\n\014write_handle\030\002 \001(" + + "\0132\".google.storage.v2.BidiWriteHandleH\001\210" + + "\001\001\022\027\n\ngeneration\030\003 \001(\003H\002\210\001\001B\020\n\016_routing_" + + "tokenB\017\n\r_write_handleB\r\n\013_generation\"S\n" + + "\023BidiReadObjectError\022<\n\021read_range_error" + + "s\030\001 \003(\0132!.google.storage.v2.ReadRangeErr" + + "or\"E\n\016ReadRangeError\022\017\n\007read_id\030\001 \001(\003\022\"\n" + + "\006status\030\002 \001(\0132\022.google.rpc.Status\"U\n\tRea" + + "dRange\022\030\n\013read_offset\030\001 \001(\003B\003\340A\002\022\030\n\013read" + + "_length\030\002 \001(\003B\003\340A\001\022\024\n\007read_id\030\003 \001(\003B\003\340A\002" + + "\"\224\001\n\017ObjectRangeData\022<\n\020checksummed_data" + + "\030\001 \001(\0132\".google.storage.v2.ChecksummedDa" + + "ta\0220\n\nread_range\030\002 \001(\0132\034.google.storage." + + "v2.ReadRange\022\021\n\trange_end\030\003 \001(\010\"%\n\016BidiR" + + "eadHandle\022\023\n\006handle\030\001 \001(\014B\003\340A\002\"&\n\017BidiWr" + + "iteHandle\022\023\n\006handle\030\001 \001(\014B\003\340A\002\"\265\003\n\017Write" + + "ObjectSpec\0220\n\010resource\030\001 \001(\0132\031.google.st" + + "orage.v2.ObjectB\003\340A\002\022\026\n\016predefined_acl\030\007" + + " \001(\t\022 \n\023if_generation_match\030\003 \001(\003H\000\210\001\001\022$" + + "\n\027if_generation_not_match\030\004 \001(\003H\001\210\001\001\022$\n\027" + + "if_metageneration_match\030\005 \001(\003H\002\210\001\001\022(\n\033if" + + "_metageneration_not_match\030\006 \001(\003H\003\210\001\001\022\030\n\013" + + "object_size\030\010 \001(\003H\004\210\001\001\022\027\n\nappendable\030\t \001" + + "(\010H\005\210\001\001B\026\n\024_if_generation_matchB\032\n\030_if_g" + + "eneration_not_matchB\032\n\030_if_metageneratio" + + "n_matchB\036\n\034_if_metageneration_not_matchB" + + "\016\n\014_object_sizeB\r\n\013_appendable\"\206\003\n\022Write" + "ObjectRequest\022\023\n\tupload_id\030\001 \001(\tH\000\022?\n\021wr" + "ite_object_spec\030\002 \001(\0132\".google.storage.v" + "2.WriteObjectSpecH\000\022\031\n\014write_offset\030\003 \001(" + "\003B\003\340A\002\022>\n\020checksummed_data\030\004 \001(\0132\".googl" + "e.storage.v2.ChecksummedDataH\001\022<\n\020object" + "_checksums\030\006 \001(\0132\".google.storage.v2.Obj" - + "ectChecksums\022\024\n\014state_lookup\030\007 \001(\010\022\r\n\005fl" - + "ush\030\010 \001(\010\022\024\n\014finish_write\030\t \001(\010\022R\n\034commo" - + "n_object_request_params\030\n \001(\0132,.google.s" - + "torage.v2.CommonObjectRequestParamsB\017\n\rf" - + "irst_messageB\006\n\004data\"r\n\027BidiWriteObjectR" - + "esponse\022\030\n\016persisted_size\030\001 \001(\003H\000\022-\n\010res" - + "ource\030\002 \001(\0132\031.google.storage.v2.ObjectH\000" - + "B\016\n\014write_status\"\255\003\n\022ListObjectsRequest\022" - + "5\n\006parent\030\001 \001(\tB%\340A\002\372A\037\n\035storage.googlea" - + "pis.com/Bucket\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npag" - + "e_token\030\003 \001(\t\022\021\n\tdelimiter\030\004 \001(\t\022\"\n\032incl" - + "ude_trailing_delimiter\030\005 \001(\010\022\016\n\006prefix\030\006" - + " \001(\t\022\020\n\010versions\030\007 \001(\010\0222\n\tread_mask\030\010 \001(" - + "\0132\032.google.protobuf.FieldMaskH\000\210\001\001\022 \n\023le" - + "xicographic_start\030\n \001(\tB\003\340A\001\022\036\n\021lexicogr" - + "aphic_end\030\013 \001(\tB\003\340A\001\022\031\n\014soft_deleted\030\014 \001" - + "(\010B\003\340A\001\022(\n\033include_folders_as_prefixes\030\r" - + " \001(\010B\003\340A\001\022\027\n\nmatch_glob\030\016 \001(\tB\003\340A\001B\014\n\n_r" - + "ead_mask\"\205\001\n\027QueryWriteStatusRequest\022\026\n\t" - + "upload_id\030\001 \001(\tB\003\340A\002\022R\n\034common_object_re" - + "quest_params\030\002 \001(\0132,.google.storage.v2.C" - + "ommonObjectRequestParams\"s\n\030QueryWriteSt" - + "atusResponse\022\030\n\016persisted_size\030\001 \001(\003H\000\022-" + + "ectChecksums\022\024\n\014finish_write\030\007 \001(\010\022R\n\034co" + + "mmon_object_request_params\030\010 \001(\0132,.googl" + + "e.storage.v2.CommonObjectRequestParamsB\017" + + "\n\rfirst_messageB\006\n\004data\"n\n\023WriteObjectRe" + + "sponse\022\030\n\016persisted_size\030\001 \001(\003H\000\022-\n\010reso" + + "urce\030\002 \001(\0132\031.google.storage.v2.ObjectH\000B" + + "\016\n\014write_status\"\201\003\n\020AppendObjectSpec\0225\n\006" + + "bucket\030\001 \001(\tB%\340A\002\372A\037\n\035storage.googleapis" + + ".com/Bucket\022\023\n\006object\030\002 \001(\tB\003\340A\002\022\027\n\ngene" + + "ration\030\003 \001(\003B\003\340A\002\022$\n\027if_metageneration_m" + + "atch\030\004 \001(\003H\000\210\001\001\022(\n\033if_metageneration_not" + + "_match\030\005 \001(\003H\001\210\001\001\022\032\n\rrouting_token\030\006 \001(\t" + + "H\002\210\001\001\022=\n\014write_handle\030\007 \001(\0132\".google.sto" + + "rage.v2.BidiWriteHandleH\003\210\001\001B\032\n\030_if_meta" + + "generation_matchB\036\n\034_if_metageneration_n" + + "ot_matchB\020\n\016_routing_tokenB\017\n\r_write_han" + + "dle\"\362\003\n\026BidiWriteObjectRequest\022\023\n\tupload" + + "_id\030\001 \001(\tH\000\022?\n\021write_object_spec\030\002 \001(\0132\"" + + ".google.storage.v2.WriteObjectSpecH\000\022A\n\022" + + "append_object_spec\030\013 \001(\0132#.google.storag" + + "e.v2.AppendObjectSpecH\000\022\031\n\014write_offset\030" + + "\003 \001(\003B\003\340A\002\022>\n\020checksummed_data\030\004 \001(\0132\".g" + + "oogle.storage.v2.ChecksummedDataH\001\022<\n\020ob" + + "ject_checksums\030\006 \001(\0132\".google.storage.v2" + + ".ObjectChecksums\022\024\n\014state_lookup\030\007 \001(\010\022\r" + + "\n\005flush\030\010 \001(\010\022\024\n\014finish_write\030\t \001(\010\022R\n\034c" + + "ommon_object_request_params\030\n \001(\0132,.goog" + + "le.storage.v2.CommonObjectRequestParamsB" + + "\017\n\rfirst_messageB\006\n\004data\"\302\001\n\027BidiWriteOb" + + "jectResponse\022\030\n\016persisted_size\030\001 \001(\003H\000\022-" + "\n\010resource\030\002 \001(\0132\031.google.storage.v2.Obj" - + "ectH\000B\016\n\014write_status\"\250\n\n\024RewriteObjectR" - + "equest\022 \n\020destination_name\030\030 \001(\tB\006\340A\002\340A\005" - + "\022D\n\022destination_bucket\030\031 \001(\tB(\340A\002\340A\005\372A\037\n" - + "\035storage.googleapis.com/Bucket\022C\n\023destin" - + "ation_kms_key\030\033 \001(\tB&\372A#\n!cloudkms.googl" - + "eapis.com/CryptoKey\022.\n\013destination\030\001 \001(\013" - + "2\031.google.storage.v2.Object\022<\n\rsource_bu" - + "cket\030\002 \001(\tB%\340A\002\372A\037\n\035storage.googleapis.c" - + "om/Bucket\022\032\n\rsource_object\030\003 \001(\tB\003\340A\002\022\031\n" - + "\021source_generation\030\004 \001(\003\022\025\n\rrewrite_toke" - + "n\030\005 \001(\t\022\"\n\032destination_predefined_acl\030\034 " - + "\001(\t\022 \n\023if_generation_match\030\007 \001(\003H\000\210\001\001\022$\n" - + "\027if_generation_not_match\030\010 \001(\003H\001\210\001\001\022$\n\027i" - + "f_metageneration_match\030\t \001(\003H\002\210\001\001\022(\n\033if_" - + "metageneration_not_match\030\n \001(\003H\003\210\001\001\022\'\n\032i" - + "f_source_generation_match\030\013 \001(\003H\004\210\001\001\022+\n\036" - + "if_source_generation_not_match\030\014 \001(\003H\005\210\001" - + "\001\022+\n\036if_source_metageneration_match\030\r \001(" - + "\003H\006\210\001\001\022/\n\"if_source_metageneration_not_m" - + "atch\030\016 \001(\003H\007\210\001\001\022$\n\034max_bytes_rewritten_p" - + "er_call\030\017 \001(\003\022(\n copy_source_encryption_" - + "algorithm\030\020 \001(\t\022(\n copy_source_encryptio" - + "n_key_bytes\030\025 \001(\014\022/\n\'copy_source_encrypt" - + "ion_key_sha256_bytes\030\026 \001(\014\022R\n\034common_obj" - + "ect_request_params\030\023 \001(\0132,.google.storag" - + "e.v2.CommonObjectRequestParams\022<\n\020object" - + "_checksums\030\035 \001(\0132\".google.storage.v2.Obj" - + "ectChecksumsB\026\n\024_if_generation_matchB\032\n\030" - + "_if_generation_not_matchB\032\n\030_if_metagene" - + "ration_matchB\036\n\034_if_metageneration_not_m" - + "atchB\035\n\033_if_source_generation_matchB!\n\037_" - + "if_source_generation_not_matchB!\n\037_if_so" - + "urce_metageneration_matchB%\n#_if_source_" - + "metageneration_not_match\"\227\001\n\017RewriteResp" - + "onse\022\035\n\025total_bytes_rewritten\030\001 \001(\003\022\023\n\013o" - + "bject_size\030\002 \001(\003\022\014\n\004done\030\003 \001(\010\022\025\n\rrewrit" - + "e_token\030\004 \001(\t\022+\n\010resource\030\005 \001(\0132\031.google" - + ".storage.v2.Object\"\367\005\n\021MoveObjectRequest" - + "\0225\n\006bucket\030\001 \001(\tB%\340A\002\372A\037\n\035storage.google" - + "apis.com/Bucket\022\032\n\rsource_object\030\002 \001(\tB\003" - + "\340A\002\022\037\n\022destination_object\030\003 \001(\tB\003\340A\002\022,\n\032" - + "if_source_generation_match\030\004 \001(\003B\003\340A\001H\000\210" - + "\001\001\0220\n\036if_source_generation_not_match\030\005 \001" - + "(\003B\003\340A\001H\001\210\001\001\0220\n\036if_source_metageneration" - + "_match\030\006 \001(\003B\003\340A\001H\002\210\001\001\0224\n\"if_source_meta" - + "generation_not_match\030\007 \001(\003B\003\340A\001H\003\210\001\001\022%\n\023" - + "if_generation_match\030\010 \001(\003B\003\340A\001H\004\210\001\001\022)\n\027i" - + "f_generation_not_match\030\t \001(\003B\003\340A\001H\005\210\001\001\022)" - + "\n\027if_metageneration_match\030\n \001(\003B\003\340A\001H\006\210\001" - + "\001\022-\n\033if_metageneration_not_match\030\013 \001(\003B\003" - + "\340A\001H\007\210\001\001B\035\n\033_if_source_generation_matchB" - + "!\n\037_if_source_generation_not_matchB!\n\037_i" - + "f_source_metageneration_matchB%\n#_if_sou" - + "rce_metageneration_not_matchB\026\n\024_if_gene" - + "ration_matchB\032\n\030_if_generation_not_match" - + "B\032\n\030_if_metageneration_matchB\036\n\034_if_meta" - + "generation_not_match\"\362\001\n\032StartResumableW" - + "riteRequest\022B\n\021write_object_spec\030\001 \001(\0132\"" - + ".google.storage.v2.WriteObjectSpecB\003\340A\002\022" - + "R\n\034common_object_request_params\030\003 \001(\0132,." - + "google.storage.v2.CommonObjectRequestPar" - + "ams\022<\n\020object_checksums\030\005 \001(\0132\".google.s" - + "torage.v2.ObjectChecksums\"0\n\033StartResuma" - + "bleWriteResponse\022\021\n\tupload_id\030\001 \001(\t\"\357\003\n\023" - + "UpdateObjectRequest\022.\n\006object\030\001 \001(\0132\031.go" - + "ogle.storage.v2.ObjectB\003\340A\002\022 \n\023if_genera" - + "tion_match\030\002 \001(\003H\000\210\001\001\022$\n\027if_generation_n" - + "ot_match\030\003 \001(\003H\001\210\001\001\022$\n\027if_metageneration" - + "_match\030\004 \001(\003H\002\210\001\001\022(\n\033if_metageneration_n" - + "ot_match\030\005 \001(\003H\003\210\001\001\022\026\n\016predefined_acl\030\n " - + "\001(\t\0224\n\013update_mask\030\007 \001(\0132\032.google.protob" - + "uf.FieldMaskB\003\340A\002\022R\n\034common_object_reque" - + "st_params\030\010 \001(\0132,.google.storage.v2.Comm" - + "onObjectRequestParamsB\026\n\024_if_generation_" - + "matchB\032\n\030_if_generation_not_matchB\032\n\030_if" - + "_metageneration_matchB\036\n\034_if_metagenerat" - + "ion_not_match\"|\n\031CommonObjectRequestPara" - + "ms\022\034\n\024encryption_algorithm\030\001 \001(\t\022\034\n\024encr" - + "yption_key_bytes\030\004 \001(\014\022#\n\033encryption_key" - + "_sha256_bytes\030\005 \001(\014\"\312\005\n\020ServiceConstants" - + "\"\265\005\n\006Values\022\026\n\022VALUES_UNSPECIFIED\020\000\022\033\n\024M" - + "AX_READ_CHUNK_BYTES\020\200\200\200\001\022\034\n\025MAX_WRITE_CH" - + "UNK_BYTES\020\200\200\200\001\022\031\n\022MAX_OBJECT_SIZE_MB\020\200\200\300" - + "\002\022)\n$MAX_CUSTOM_METADATA_FIELD_NAME_BYTE" - + "S\020\200\010\022*\n%MAX_CUSTOM_METADATA_FIELD_VALUE_" - + "BYTES\020\200 \022)\n$MAX_CUSTOM_METADATA_TOTAL_SI" - + "ZE_BYTES\020\200@\022*\n$MAX_BUCKET_METADATA_TOTAL" - + "_SIZE_BYTES\020\200\240\001\022\'\n#MAX_NOTIFICATION_CONF" - + "IGS_PER_BUCKET\020d\022\"\n\036MAX_LIFECYCLE_RULES_" - + "PER_BUCKET\020d\022&\n\"MAX_NOTIFICATION_CUSTOM_" - + "ATTRIBUTES\020\005\0221\n,MAX_NOTIFICATION_CUSTOM_" - + "ATTRIBUTE_KEY_LENGTH\020\200\002\0223\n.MAX_NOTIFICAT" - + "ION_CUSTOM_ATTRIBUTE_VALUE_LENGTH\020\200\010\022\034\n\030" - + "MAX_LABELS_ENTRIES_COUNT\020@\022\037\n\033MAX_LABELS" - + "_KEY_VALUE_LENGTH\020?\022\037\n\032MAX_LABELS_KEY_VA" - + "LUE_BYTES\020\200\001\022.\n)MAX_OBJECT_IDS_PER_DELET" - + "E_OBJECTS_REQUEST\020\350\007\022\036\n\032SPLIT_TOKEN_MAX_" - + "VALID_DAYS\020\016\032\002\020\001\"\243\034\n\006Bucket\022\021\n\004name\030\001 \001(" - + "\tB\003\340A\005\022\026\n\tbucket_id\030\002 \001(\tB\003\340A\003\022\014\n\004etag\030\035" - + " \001(\t\022D\n\007project\030\003 \001(\tB3\340A\005\372A-\n+cloudreso" - + "urcemanager.googleapis.com/Project\022\033\n\016me" - + "tageneration\030\004 \001(\003B\003\340A\003\022\025\n\010location\030\005 \001(" - + "\tB\003\340A\005\022\032\n\rlocation_type\030\006 \001(\tB\003\340A\003\022\025\n\rst" - + "orage_class\030\007 \001(\t\022\013\n\003rpo\030\033 \001(\t\0223\n\003acl\030\010 " - + "\003(\0132&.google.storage.v2.BucketAccessCont" - + "rol\022B\n\022default_object_acl\030\t \003(\0132&.google" - + ".storage.v2.ObjectAccessControl\0226\n\tlifec" - + "ycle\030\n \001(\0132#.google.storage.v2.Bucket.Li" - + "fecycle\0224\n\013create_time\030\013 \001(\0132\032.google.pr" - + "otobuf.TimestampB\003\340A\003\022,\n\004cors\030\014 \003(\0132\036.go" - + "ogle.storage.v2.Bucket.Cors\0224\n\013update_ti" - + "me\030\r \001(\0132\032.google.protobuf.TimestampB\003\340A" - + "\003\022 \n\030default_event_based_hold\030\016 \001(\010\0225\n\006l" - + "abels\030\017 \003(\0132%.google.storage.v2.Bucket.L" - + "abelsEntry\0222\n\007website\030\020 \001(\0132!.google.sto" - + "rage.v2.Bucket.Website\0228\n\nversioning\030\021 \001" - + "(\0132$.google.storage.v2.Bucket.Versioning" - + "\0222\n\007logging\030\022 \001(\0132!.google.storage.v2.Bu" - + "cket.Logging\022,\n\005owner\030\023 \001(\0132\030.google.sto" - + "rage.v2.OwnerB\003\340A\003\0228\n\nencryption\030\024 \001(\0132$" - + ".google.storage.v2.Bucket.Encryption\0222\n\007" - + "billing\030\025 \001(\0132!.google.storage.v2.Bucket" - + ".Billing\022C\n\020retention_policy\030\026 \001(\0132).goo" - + "gle.storage.v2.Bucket.RetentionPolicy\0227\n" - + "\niam_config\030\027 \001(\0132#.google.storage.v2.Bu" - + "cket.IamConfig\022\025\n\rsatisfies_pzs\030\031 \001(\010\022P\n" - + "\027custom_placement_config\030\032 \001(\0132/.google." - + "storage.v2.Bucket.CustomPlacementConfig\022" - + "6\n\tautoclass\030\034 \001(\0132#.google.storage.v2.B" - + "ucket.Autoclass\022T\n\026hierarchical_namespac" - + "e\030 \001(\0132/.google.storage.v2.Bucket.Hiera" - + "rchicalNamespaceB\003\340A\001\022K\n\022soft_delete_pol" - + "icy\030\037 \001(\0132*.google.storage.v2.Bucket.Sof" - + "tDeletePolicyB\003\340A\001\032!\n\007Billing\022\026\n\016request" - + "er_pays\030\001 \001(\010\032X\n\004Cors\022\016\n\006origin\030\001 \003(\t\022\016\n" - + "\006method\030\002 \003(\t\022\027\n\017response_header\030\003 \003(\t\022\027" - + "\n\017max_age_seconds\030\004 \001(\005\032M\n\nEncryption\022?\n" - + "\017default_kms_key\030\001 \001(\tB&\372A#\n!cloudkms.go" - + "ogleapis.com/CryptoKey\032\354\001\n\tIamConfig\022a\n\033" - + "uniform_bucket_level_access\030\001 \001(\0132<.goog" - + "le.storage.v2.Bucket.IamConfig.UniformBu" - + "cketLevelAccess\022 \n\030public_access_prevent" - + "ion\030\003 \001(\t\032Z\n\030UniformBucketLevelAccess\022\017\n" - + "\007enabled\030\001 \001(\010\022-\n\tlock_time\030\002 \001(\0132\032.goog" - + "le.protobuf.Timestamp\032\363\005\n\tLifecycle\0226\n\004r" - + "ule\030\001 \003(\0132(.google.storage.v2.Bucket.Lif" - + "ecycle.Rule\032\255\005\n\004Rule\022?\n\006action\030\001 \001(\0132/.g" - + "oogle.storage.v2.Bucket.Lifecycle.Rule.A" - + "ction\022E\n\tcondition\030\002 \001(\01322.google.storag" - + "e.v2.Bucket.Lifecycle.Rule.Condition\032-\n\006" - + "Action\022\014\n\004type\030\001 \001(\t\022\025\n\rstorage_class\030\002 " - + "\001(\t\032\355\003\n\tCondition\022\025\n\010age_days\030\001 \001(\005H\000\210\001\001" - + "\022)\n\016created_before\030\002 \001(\0132\021.google.type.D" - + "ate\022\024\n\007is_live\030\003 \001(\010H\001\210\001\001\022\037\n\022num_newer_v" - + "ersions\030\004 \001(\005H\002\210\001\001\022\035\n\025matches_storage_cl" - + "ass\030\005 \003(\t\022#\n\026days_since_custom_time\030\007 \001(" - + "\005H\003\210\001\001\022-\n\022custom_time_before\030\010 \001(\0132\021.goo" - + "gle.type.Date\022\'\n\032days_since_noncurrent_t" - + "ime\030\t \001(\005H\004\210\001\001\0221\n\026noncurrent_time_before" - + "\030\n \001(\0132\021.google.type.Date\022\026\n\016matches_pre" - + "fix\030\013 \003(\t\022\026\n\016matches_suffix\030\014 \003(\tB\013\n\t_ag" - + "e_daysB\n\n\010_is_liveB\025\n\023_num_newer_version" - + "sB\031\n\027_days_since_custom_timeB\035\n\033_days_si" - + "nce_noncurrent_time\0328\n\007Logging\022\022\n\nlog_bu" - + "cket\030\001 \001(\t\022\031\n\021log_object_prefix\030\002 \001(\t\032\217\001" - + "\n\017RetentionPolicy\0222\n\016effective_time\030\001 \001(" - + "\0132\032.google.protobuf.Timestamp\022\021\n\tis_lock" - + "ed\030\002 \001(\010\0225\n\022retention_duration\030\004 \001(\0132\031.g" - + "oogle.protobuf.Duration\032\261\001\n\020SoftDeletePo" - + "licy\022:\n\022retention_duration\030\001 \001(\0132\031.googl" - + "e.protobuf.DurationH\000\210\001\001\0227\n\016effective_ti" - + "me\030\002 \001(\0132\032.google.protobuf.TimestampH\001\210\001" - + "\001B\025\n\023_retention_durationB\021\n\017_effective_t" - + "ime\032\035\n\nVersioning\022\017\n\007enabled\030\001 \001(\010\032;\n\007We" - + "bsite\022\030\n\020main_page_suffix\030\001 \001(\t\022\026\n\016not_f" - + "ound_page\030\002 \001(\t\032/\n\025CustomPlacementConfig" - + "\022\026\n\016data_locations\030\001 \003(\t\032\213\002\n\tAutoclass\022\017" - + "\n\007enabled\030\001 \001(\010\0224\n\013toggle_time\030\002 \001(\0132\032.g" - + "oogle.protobuf.TimestampB\003\340A\003\022#\n\026termina" - + "l_storage_class\030\003 \001(\tH\000\210\001\001\022P\n\"terminal_s" - + "torage_class_update_time\030\004 \001(\0132\032.google." - + "protobuf.TimestampB\003\340A\003H\001\210\001\001B\031\n\027_termina" - + "l_storage_classB%\n#_terminal_storage_cla" - + "ss_update_time\032-\n\025HierarchicalNamespace\022" - + "\024\n\007enabled\030\001 \001(\010B\003\340A\001\032-\n\013LabelsEntry\022\013\n\003" - + "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:X\352AU\n\035stora" - + "ge.googleapis.com/Bucket\022#projects/{proj" - + "ect}/buckets/{bucket}*\007buckets2\006bucket\"\316" - + "\001\n\023BucketAccessControl\022\014\n\004role\030\001 \001(\t\022\n\n\002" - + "id\030\002 \001(\t\022\016\n\006entity\030\003 \001(\t\022\027\n\nentity_alt\030\t" - + " \001(\tB\003\340A\003\022\021\n\tentity_id\030\004 \001(\t\022\014\n\004etag\030\010 \001" - + "(\t\022\r\n\005email\030\005 \001(\t\022\016\n\006domain\030\006 \001(\t\0224\n\014pro" - + "ject_team\030\007 \001(\0132\036.google.storage.v2.Proj" - + "ectTeam\"I\n\017ChecksummedData\022\026\n\007content\030\001 " - + "\001(\014B\005\010\001\340A\001\022\023\n\006crc32c\030\002 \001(\007H\000\210\001\001B\t\n\007_crc3" - + "2c\"C\n\017ObjectChecksums\022\023\n\006crc32c\030\001 \001(\007H\000\210" - + "\001\001\022\020\n\010md5_hash\030\002 \001(\014B\t\n\007_crc32c\"L\n\022Custo" - + "merEncryption\022\034\n\024encryption_algorithm\030\001 " - + "\001(\t\022\030\n\020key_sha256_bytes\030\003 \001(\014\"\227\013\n\006Object" - + "\022\021\n\004name\030\001 \001(\tB\003\340A\005\0225\n\006bucket\030\002 \001(\tB%\340A\005" - + "\372A\037\n\035storage.googleapis.com/Bucket\022\014\n\004et" - + "ag\030\033 \001(\t\022\027\n\ngeneration\030\003 \001(\003B\003\340A\005\022\037\n\rres" - + "tore_token\030# \001(\tB\003\340A\003H\000\210\001\001\022\033\n\016metagenera" - + "tion\030\004 \001(\003B\003\340A\003\022\025\n\rstorage_class\030\005 \001(\t\022\021" - + "\n\004size\030\006 \001(\003B\003\340A\003\022\030\n\020content_encoding\030\007 " - + "\001(\t\022\033\n\023content_disposition\030\010 \001(\t\022\025\n\rcach" - + "e_control\030\t \001(\t\0223\n\003acl\030\n \003(\0132&.google.st" - + "orage.v2.ObjectAccessControl\022\030\n\020content_" - + "language\030\013 \001(\t\0224\n\013delete_time\030\014 \001(\0132\032.go" - + "ogle.protobuf.TimestampB\003\340A\003\0226\n\rfinalize" - + "_time\030$ \001(\0132\032.google.protobuf.TimestampB" - + "\003\340A\003\022\024\n\014content_type\030\r \001(\t\0224\n\013create_tim" - + "e\030\016 \001(\0132\032.google.protobuf.TimestampB\003\340A\003" - + "\022\034\n\017component_count\030\017 \001(\005B\003\340A\003\022:\n\tchecks" - + "ums\030\020 \001(\0132\".google.storage.v2.ObjectChec" - + "ksumsB\003\340A\003\0224\n\013update_time\030\021 \001(\0132\032.google" - + ".protobuf.TimestampB\003\340A\003\0227\n\007kms_key\030\022 \001(" - + "\tB&\372A#\n!cloudkms.googleapis.com/CryptoKe" - + "y\022B\n\031update_storage_class_time\030\023 \001(\0132\032.g", - "oogle.protobuf.TimestampB\003\340A\003\022\026\n\016tempora" - + "ry_hold\030\024 \001(\010\0229\n\025retention_expire_time\030\025" - + " \001(\0132\032.google.protobuf.Timestamp\0229\n\010meta" - + "data\030\026 \003(\0132\'.google.storage.v2.Object.Me" - + "tadataEntry\022\035\n\020event_based_hold\030\027 \001(\010H\001\210" - + "\001\001\022,\n\005owner\030\030 \001(\0132\030.google.storage.v2.Ow" - + "nerB\003\340A\003\022B\n\023customer_encryption\030\031 \001(\0132%." - + "google.storage.v2.CustomerEncryption\022/\n\013" - + "custom_time\030\032 \001(\0132\032.google.protobuf.Time" - + "stamp\022>\n\020soft_delete_time\030\034 \001(\0132\032.google" - + ".protobuf.TimestampB\003\340A\003H\002\210\001\001\022>\n\020hard_de" - + "lete_time\030\035 \001(\0132\032.google.protobuf.Timest" - + "ampB\003\340A\003H\003\210\001\001\032/\n\rMetadataEntry\022\013\n\003key\030\001 " - + "\001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\020\n\016_restore_token" - + "B\023\n\021_event_based_holdB\023\n\021_soft_delete_ti" - + "meB\023\n\021_hard_delete_time\"\316\001\n\023ObjectAccess" - + "Control\022\014\n\004role\030\001 \001(\t\022\n\n\002id\030\002 \001(\t\022\016\n\006ent" - + "ity\030\003 \001(\t\022\027\n\nentity_alt\030\t \001(\tB\003\340A\003\022\021\n\ten" - + "tity_id\030\004 \001(\t\022\014\n\004etag\030\010 \001(\t\022\r\n\005email\030\005 \001" - + "(\t\022\016\n\006domain\030\006 \001(\t\0224\n\014project_team\030\007 \001(\013" - + "2\036.google.storage.v2.ProjectTeam\"l\n\023List" - + "ObjectsResponse\022*\n\007objects\030\001 \003(\0132\031.googl" - + "e.storage.v2.Object\022\020\n\010prefixes\030\002 \003(\t\022\027\n" - + "\017next_page_token\030\003 \001(\t\"3\n\013ProjectTeam\022\026\n" - + "\016project_number\030\001 \001(\t\022\014\n\004team\030\002 \001(\t\"*\n\005O" - + "wner\022\016\n\006entity\030\001 \001(\t\022\021\n\tentity_id\030\002 \001(\t\"" - + "C\n\014ContentRange\022\r\n\005start\030\001 \001(\003\022\013\n\003end\030\002 " - + "\001(\003\022\027\n\017complete_length\030\003 \001(\0032\245\035\n\007Storage" - + "\022r\n\014DeleteBucket\022&.google.storage.v2.Del" - + "eteBucketRequest\032\026.google.protobuf.Empty" - + "\"\"\332A\004name\212\323\344\223\002\025\022\023\n\004name\022\013{bucket=**}\022o\n\t" - + "GetBucket\022#.google.storage.v2.GetBucketR" - + "equest\032\031.google.storage.v2.Bucket\"\"\332A\004na" - + "me\212\323\344\223\002\025\022\023\n\004name\022\013{bucket=**}\022\253\001\n\014Create" - + "Bucket\022&.google.storage.v2.CreateBucketR" - + "equest\032\031.google.storage.v2.Bucket\"X\332A\027pa" - + "rent,bucket,bucket_id\212\323\344\223\0028\022\026\n\006parent\022\014{" - + "project=**}\022\036\n\016bucket.project\022\014{project=" - + "**}\022\205\001\n\013ListBuckets\022%.google.storage.v2." - + "ListBucketsRequest\032&.google.storage.v2.L" - + "istBucketsResponse\"\'\332A\006parent\212\323\344\223\002\030\022\026\n\006p" - + "arent\022\014{project=**}\022\223\001\n\031LockBucketRetent" - + "ionPolicy\0223.google.storage.v2.LockBucket" - + "RetentionPolicyRequest\032\031.google.storage." - + "v2.Bucket\"&\332A\006bucket\212\323\344\223\002\027\022\025\n\006bucket\022\013{b" - + "ucket=**}\022u\n\014GetIamPolicy\022\".google.iam.v" - + "1.GetIamPolicyRequest\032\025.google.iam.v1.Po" - + "licy\"*\332A\010resource\212\323\344\223\002\031\022\027\n\010resource\022\013{bu" - + "cket=**}\022|\n\014SetIamPolicy\022\".google.iam.v1" - + ".SetIamPolicyRequest\032\025.google.iam.v1.Pol" - + "icy\"1\332A\017resource,policy\212\323\344\223\002\031\022\027\n\010resourc" - + "e\022\013{bucket=**}\022\226\002\n\022TestIamPermissions\022(." - + "google.iam.v1.TestIamPermissionsRequest\032" - + ").google.iam.v1.TestIamPermissionsRespon" - + "se\"\252\001\332A\024resource,permissions\212\323\344\223\002\214\001\022\027\n\010r" - + "esource\022\013{bucket=**}\0224\n\010resource\022({bucke" - + "t=projects/*/buckets/*}/objects/**\022;\n\010re" - + "source\022/{bucket=projects/*/buckets/*}/ma" - + "nagedFolders/**\022\212\001\n\014UpdateBucket\022&.googl" - + "e.storage.v2.UpdateBucketRequest\032\031.googl" - + "e.storage.v2.Bucket\"7\332A\022bucket,update_ma" - + "sk\212\323\344\223\002\034\022\032\n\013bucket.name\022\013{bucket=**}\022~\n\r" - + "ComposeObject\022\'.google.storage.v2.Compos" - + "eObjectRequest\032\031.google.storage.v2.Objec" - + "t\")\212\323\344\223\002#\022!\n\022destination.bucket\022\013{bucket" - + "=**}\022\230\001\n\014DeleteObject\022&.google.storage.v" - + "2.DeleteObjectRequest\032\026.google.protobuf." - + "Empty\"H\332A\rbucket,object\332A\030bucket,object," - + "generation\212\323\344\223\002\027\022\025\n\006bucket\022\013{bucket=**}\022" - + "\215\001\n\rRestoreObject\022\'.google.storage.v2.Re" - + "storeObjectRequest\032\031.google.storage.v2.O" - + "bject\"8\332A\030bucket,object,generation\212\323\344\223\002\027" - + "\022\025\n\006bucket\022\013{bucket=**}\022\272\001\n\024CancelResuma" - + "bleWrite\022..google.storage.v2.CancelResum" - + "ableWriteRequest\032/.google.storage.v2.Can" - + "celResumableWriteResponse\"A\332A\tupload_id\212" - + "\323\344\223\002/\022-\n\tupload_id\022 {bucket=projects/*/b" - + "uckets/*}/**\022\225\001\n\tGetObject\022#.google.stor" - + "age.v2.GetObjectRequest\032\031.google.storage" - + ".v2.Object\"H\332A\rbucket,object\332A\030bucket,ob" + + "ectH\000\022=\n\014write_handle\030\003 \001(\0132\".google.sto" + + "rage.v2.BidiWriteHandleH\001\210\001\001B\016\n\014write_st" + + "atusB\017\n\r_write_handle\"\255\003\n\022ListObjectsReq" + + "uest\0225\n\006parent\030\001 \001(\tB%\340A\002\372A\037\n\035storage.go" + + "ogleapis.com/Bucket\022\021\n\tpage_size\030\002 \001(\005\022\022" + + "\n\npage_token\030\003 \001(\t\022\021\n\tdelimiter\030\004 \001(\t\022\"\n" + + "\032include_trailing_delimiter\030\005 \001(\010\022\016\n\006pre" + + "fix\030\006 \001(\t\022\020\n\010versions\030\007 \001(\010\0222\n\tread_mask" + + "\030\010 \001(\0132\032.google.protobuf.FieldMaskH\000\210\001\001\022" + + " \n\023lexicographic_start\030\n \001(\tB\003\340A\001\022\036\n\021lex" + + "icographic_end\030\013 \001(\tB\003\340A\001\022\031\n\014soft_delete" + + "d\030\014 \001(\010B\003\340A\001\022(\n\033include_folders_as_prefi" + + "xes\030\r \001(\010B\003\340A\001\022\027\n\nmatch_glob\030\016 \001(\tB\003\340A\001B" + + "\014\n\n_read_mask\"\205\001\n\027QueryWriteStatusReques" + + "t\022\026\n\tupload_id\030\001 \001(\tB\003\340A\002\022R\n\034common_obje" + + "ct_request_params\030\002 \001(\0132,.google.storage" + + ".v2.CommonObjectRequestParams\"s\n\030QueryWr" + + "iteStatusResponse\022\030\n\016persisted_size\030\001 \001(" + + "\003H\000\022-\n\010resource\030\002 \001(\0132\031.google.storage.v" + + "2.ObjectH\000B\016\n\014write_status\"\250\n\n\024RewriteOb" + + "jectRequest\022 \n\020destination_name\030\030 \001(\tB\006\340" + + "A\002\340A\005\022D\n\022destination_bucket\030\031 \001(\tB(\340A\002\340A" + + "\005\372A\037\n\035storage.googleapis.com/Bucket\022C\n\023d" + + "estination_kms_key\030\033 \001(\tB&\372A#\n!cloudkms." + + "googleapis.com/CryptoKey\022.\n\013destination\030" + + "\001 \001(\0132\031.google.storage.v2.Object\022<\n\rsour" + + "ce_bucket\030\002 \001(\tB%\340A\002\372A\037\n\035storage.googlea" + + "pis.com/Bucket\022\032\n\rsource_object\030\003 \001(\tB\003\340" + + "A\002\022\031\n\021source_generation\030\004 \001(\003\022\025\n\rrewrite" + + "_token\030\005 \001(\t\022\"\n\032destination_predefined_a" + + "cl\030\034 \001(\t\022 \n\023if_generation_match\030\007 \001(\003H\000\210" + + "\001\001\022$\n\027if_generation_not_match\030\010 \001(\003H\001\210\001\001" + + "\022$\n\027if_metageneration_match\030\t \001(\003H\002\210\001\001\022(" + + "\n\033if_metageneration_not_match\030\n \001(\003H\003\210\001\001" + + "\022\'\n\032if_source_generation_match\030\013 \001(\003H\004\210\001" + + "\001\022+\n\036if_source_generation_not_match\030\014 \001(" + + "\003H\005\210\001\001\022+\n\036if_source_metageneration_match" + + "\030\r \001(\003H\006\210\001\001\022/\n\"if_source_metageneration_" + + "not_match\030\016 \001(\003H\007\210\001\001\022$\n\034max_bytes_rewrit" + + "ten_per_call\030\017 \001(\003\022(\n copy_source_encryp" + + "tion_algorithm\030\020 \001(\t\022(\n copy_source_encr" + + "yption_key_bytes\030\025 \001(\014\022/\n\'copy_source_en" + + "cryption_key_sha256_bytes\030\026 \001(\014\022R\n\034commo" + + "n_object_request_params\030\023 \001(\0132,.google.s" + + "torage.v2.CommonObjectRequestParams\022<\n\020o" + + "bject_checksums\030\035 \001(\0132\".google.storage.v" + + "2.ObjectChecksumsB\026\n\024_if_generation_matc" + + "hB\032\n\030_if_generation_not_matchB\032\n\030_if_met" + + "ageneration_matchB\036\n\034_if_metageneration_" + + "not_matchB\035\n\033_if_source_generation_match" + + "B!\n\037_if_source_generation_not_matchB!\n\037_" + + "if_source_metageneration_matchB%\n#_if_so" + + "urce_metageneration_not_match\"\227\001\n\017Rewrit" + + "eResponse\022\035\n\025total_bytes_rewritten\030\001 \001(\003" + + "\022\023\n\013object_size\030\002 \001(\003\022\014\n\004done\030\003 \001(\010\022\025\n\rr" + + "ewrite_token\030\004 \001(\t\022+\n\010resource\030\005 \001(\0132\031.g" + + "oogle.storage.v2.Object\"\367\005\n\021MoveObjectRe" + + "quest\0225\n\006bucket\030\001 \001(\tB%\340A\002\372A\037\n\035storage.g" + + "oogleapis.com/Bucket\022\032\n\rsource_object\030\002 " + + "\001(\tB\003\340A\002\022\037\n\022destination_object\030\003 \001(\tB\003\340A" + + "\002\022,\n\032if_source_generation_match\030\004 \001(\003B\003\340" + + "A\001H\000\210\001\001\0220\n\036if_source_generation_not_matc" + + "h\030\005 \001(\003B\003\340A\001H\001\210\001\001\0220\n\036if_source_metagener" + + "ation_match\030\006 \001(\003B\003\340A\001H\002\210\001\001\0224\n\"if_source" + + "_metageneration_not_match\030\007 \001(\003B\003\340A\001H\003\210\001" + + "\001\022%\n\023if_generation_match\030\010 \001(\003B\003\340A\001H\004\210\001\001" + + "\022)\n\027if_generation_not_match\030\t \001(\003B\003\340A\001H\005" + + "\210\001\001\022)\n\027if_metageneration_match\030\n \001(\003B\003\340A" + + "\001H\006\210\001\001\022-\n\033if_metageneration_not_match\030\013 " + + "\001(\003B\003\340A\001H\007\210\001\001B\035\n\033_if_source_generation_m" + + "atchB!\n\037_if_source_generation_not_matchB" + + "!\n\037_if_source_metageneration_matchB%\n#_i" + + "f_source_metageneration_not_matchB\026\n\024_if" + + "_generation_matchB\032\n\030_if_generation_not_" + + "matchB\032\n\030_if_metageneration_matchB\036\n\034_if" + + "_metageneration_not_match\"\362\001\n\032StartResum" + + "ableWriteRequest\022B\n\021write_object_spec\030\001 " + + "\001(\0132\".google.storage.v2.WriteObjectSpecB" + + "\003\340A\002\022R\n\034common_object_request_params\030\003 \001" + + "(\0132,.google.storage.v2.CommonObjectReque" + + "stParams\022<\n\020object_checksums\030\005 \001(\0132\".goo" + + "gle.storage.v2.ObjectChecksums\"0\n\033StartR" + + "esumableWriteResponse\022\021\n\tupload_id\030\001 \001(\t" + + "\"\357\003\n\023UpdateObjectRequest\022.\n\006object\030\001 \001(\013" + + "2\031.google.storage.v2.ObjectB\003\340A\002\022 \n\023if_g" + + "eneration_match\030\002 \001(\003H\000\210\001\001\022$\n\027if_generat" + + "ion_not_match\030\003 \001(\003H\001\210\001\001\022$\n\027if_metagener" + + "ation_match\030\004 \001(\003H\002\210\001\001\022(\n\033if_metagenerat" + + "ion_not_match\030\005 \001(\003H\003\210\001\001\022\026\n\016predefined_a" + + "cl\030\n \001(\t\0224\n\013update_mask\030\007 \001(\0132\032.google.p" + + "rotobuf.FieldMaskB\003\340A\002\022R\n\034common_object_" + + "request_params\030\010 \001(\0132,.google.storage.v2" + + ".CommonObjectRequestParamsB\026\n\024_if_genera" + + "tion_matchB\032\n\030_if_generation_not_matchB\032" + + "\n\030_if_metageneration_matchB\036\n\034_if_metage" + + "neration_not_match\"|\n\031CommonObjectReques" + + "tParams\022\034\n\024encryption_algorithm\030\001 \001(\t\022\034\n" + + "\024encryption_key_bytes\030\004 \001(\014\022#\n\033encryptio" + + "n_key_sha256_bytes\030\005 \001(\014\"\312\005\n\020ServiceCons" + + "tants\"\265\005\n\006Values\022\026\n\022VALUES_UNSPECIFIED\020\000" + + "\022\033\n\024MAX_READ_CHUNK_BYTES\020\200\200\200\001\022\034\n\025MAX_WRI" + + "TE_CHUNK_BYTES\020\200\200\200\001\022\031\n\022MAX_OBJECT_SIZE_M" + + "B\020\200\200\300\002\022)\n$MAX_CUSTOM_METADATA_FIELD_NAME" + + "_BYTES\020\200\010\022*\n%MAX_CUSTOM_METADATA_FIELD_V" + + "ALUE_BYTES\020\200 \022)\n$MAX_CUSTOM_METADATA_TOT" + + "AL_SIZE_BYTES\020\200@\022*\n$MAX_BUCKET_METADATA_" + + "TOTAL_SIZE_BYTES\020\200\240\001\022\'\n#MAX_NOTIFICATION" + + "_CONFIGS_PER_BUCKET\020d\022\"\n\036MAX_LIFECYCLE_R" + + "ULES_PER_BUCKET\020d\022&\n\"MAX_NOTIFICATION_CU" + + "STOM_ATTRIBUTES\020\005\0221\n,MAX_NOTIFICATION_CU" + + "STOM_ATTRIBUTE_KEY_LENGTH\020\200\002\0223\n.MAX_NOTI" + + "FICATION_CUSTOM_ATTRIBUTE_VALUE_LENGTH\020\200" + + "\010\022\034\n\030MAX_LABELS_ENTRIES_COUNT\020@\022\037\n\033MAX_L" + + "ABELS_KEY_VALUE_LENGTH\020?\022\037\n\032MAX_LABELS_K" + + "EY_VALUE_BYTES\020\200\001\022.\n)MAX_OBJECT_IDS_PER_" + + "DELETE_OBJECTS_REQUEST\020\350\007\022\036\n\032SPLIT_TOKEN" + + "_MAX_VALID_DAYS\020\016\032\002\020\001\"\243\034\n\006Bucket\022\021\n\004name" + + "\030\001 \001(\tB\003\340A\005\022\026\n\tbucket_id\030\002 \001(\tB\003\340A\003\022\014\n\004e" + + "tag\030\035 \001(\t\022D\n\007project\030\003 \001(\tB3\340A\005\372A-\n+clou" + + "dresourcemanager.googleapis.com/Project\022" + + "\033\n\016metageneration\030\004 \001(\003B\003\340A\003\022\025\n\010location" + + "\030\005 \001(\tB\003\340A\005\022\032\n\rlocation_type\030\006 \001(\tB\003\340A\003\022" + + "\025\n\rstorage_class\030\007 \001(\t\022\013\n\003rpo\030\033 \001(\t\0223\n\003a" + + "cl\030\010 \003(\0132&.google.storage.v2.BucketAcces" + + "sControl\022B\n\022default_object_acl\030\t \003(\0132&.g" + + "oogle.storage.v2.ObjectAccessControl\0226\n\t" + + "lifecycle\030\n \001(\0132#.google.storage.v2.Buck" + + "et.Lifecycle\0224\n\013create_time\030\013 \001(\0132\032.goog" + + "le.protobuf.TimestampB\003\340A\003\022,\n\004cors\030\014 \003(\013" + + "2\036.google.storage.v2.Bucket.Cors\0224\n\013upda" + + "te_time\030\r \001(\0132\032.google.protobuf.Timestam" + + "pB\003\340A\003\022 \n\030default_event_based_hold\030\016 \001(\010" + + "\0225\n\006labels\030\017 \003(\0132%.google.storage.v2.Buc" + + "ket.LabelsEntry\0222\n\007website\030\020 \001(\0132!.googl" + + "e.storage.v2.Bucket.Website\0228\n\nversionin" + + "g\030\021 \001(\0132$.google.storage.v2.Bucket.Versi" + + "oning\0222\n\007logging\030\022 \001(\0132!.google.storage." + + "v2.Bucket.Logging\022,\n\005owner\030\023 \001(\0132\030.googl" + + "e.storage.v2.OwnerB\003\340A\003\0228\n\nencryption\030\024 " + + "\001(\0132$.google.storage.v2.Bucket.Encryptio" + + "n\0222\n\007billing\030\025 \001(\0132!.google.storage.v2.B" + + "ucket.Billing\022C\n\020retention_policy\030\026 \001(\0132" + + ").google.storage.v2.Bucket.RetentionPoli" + + "cy\0227\n\niam_config\030\027 \001(\0132#.google.storage." + + "v2.Bucket.IamConfig\022\025\n\rsatisfies_pzs\030\031 \001" + + "(\010\022P\n\027custom_placement_config\030\032 \001(\0132/.go" + + "ogle.storage.v2.Bucket.CustomPlacementCo" + + "nfig\0226\n\tautoclass\030\034 \001(\0132#.google.storage" + + ".v2.Bucket.Autoclass\022T\n\026hierarchical_nam" + + "espace\030 \001(\0132/.google.storage.v2.Bucket." + + "HierarchicalNamespaceB\003\340A\001\022K\n\022soft_delet" + + "e_policy\030\037 \001(\0132*.google.storage.v2.Bucke" + + "t.SoftDeletePolicyB\003\340A\001\032!\n\007Billing\022\026\n\016re" + + "quester_pays\030\001 \001(\010\032X\n\004Cors\022\016\n\006origin\030\001 \003" + + "(\t\022\016\n\006method\030\002 \003(\t\022\027\n\017response_header\030\003 " + + "\003(\t\022\027\n\017max_age_seconds\030\004 \001(\005\032M\n\nEncrypti" + + "on\022?\n\017default_kms_key\030\001 \001(\tB&\372A#\n!cloudk" + + "ms.googleapis.com/CryptoKey\032\354\001\n\tIamConfi" + + "g\022a\n\033uniform_bucket_level_access\030\001 \001(\0132<" + + ".google.storage.v2.Bucket.IamConfig.Unif" + + "ormBucketLevelAccess\022 \n\030public_access_pr" + + "evention\030\003 \001(\t\032Z\n\030UniformBucketLevelAcce" + + "ss\022\017\n\007enabled\030\001 \001(\010\022-\n\tlock_time\030\002 \001(\0132\032" + + ".google.protobuf.Timestamp\032\363\005\n\tLifecycle" + + "\0226\n\004rule\030\001 \003(\0132(.google.storage.v2.Bucke" + + "t.Lifecycle.Rule\032\255\005\n\004Rule\022?\n\006action\030\001 \001(" + + "\0132/.google.storage.v2.Bucket.Lifecycle.R" + + "ule.Action\022E\n\tcondition\030\002 \001(\01322.google.s" + + "torage.v2.Bucket.Lifecycle.Rule.Conditio" + + "n\032-\n\006Action\022\014\n\004type\030\001 \001(\t\022\025\n\rstorage_cla" + + "ss\030\002 \001(\t\032\355\003\n\tCondition\022\025\n\010age_days\030\001 \001(\005" + + "H\000\210\001\001\022)\n\016created_before\030\002 \001(\0132\021.google.t" + + "ype.Date\022\024\n\007is_live\030\003 \001(\010H\001\210\001\001\022\037\n\022num_ne" + + "wer_versions\030\004 \001(\005H\002\210\001\001\022\035\n\025matches_stora" + + "ge_class\030\005 \003(\t\022#\n\026days_since_custom_time" + + "\030\007 \001(\005H\003\210\001\001\022-\n\022custom_time_before\030\010 \001(\0132" + + "\021.google.type.Date\022\'\n\032days_since_noncurr" + + "ent_time\030\t \001(\005H\004\210\001\001\0221\n\026noncurrent_time_b", + "efore\030\n \001(\0132\021.google.type.Date\022\026\n\016matche" + + "s_prefix\030\013 \003(\t\022\026\n\016matches_suffix\030\014 \003(\tB\013" + + "\n\t_age_daysB\n\n\010_is_liveB\025\n\023_num_newer_ve" + + "rsionsB\031\n\027_days_since_custom_timeB\035\n\033_da" + + "ys_since_noncurrent_time\0328\n\007Logging\022\022\n\nl" + + "og_bucket\030\001 \001(\t\022\031\n\021log_object_prefix\030\002 \001" + + "(\t\032\217\001\n\017RetentionPolicy\0222\n\016effective_time" + + "\030\001 \001(\0132\032.google.protobuf.Timestamp\022\021\n\tis" + + "_locked\030\002 \001(\010\0225\n\022retention_duration\030\004 \001(" + + "\0132\031.google.protobuf.Duration\032\261\001\n\020SoftDel" + + "etePolicy\022:\n\022retention_duration\030\001 \001(\0132\031." + + "google.protobuf.DurationH\000\210\001\001\0227\n\016effecti" + + "ve_time\030\002 \001(\0132\032.google.protobuf.Timestam" + + "pH\001\210\001\001B\025\n\023_retention_durationB\021\n\017_effect" + + "ive_time\032\035\n\nVersioning\022\017\n\007enabled\030\001 \001(\010\032" + + ";\n\007Website\022\030\n\020main_page_suffix\030\001 \001(\t\022\026\n\016" + + "not_found_page\030\002 \001(\t\032/\n\025CustomPlacementC" + + "onfig\022\026\n\016data_locations\030\001 \003(\t\032\213\002\n\tAutocl" + + "ass\022\017\n\007enabled\030\001 \001(\010\0224\n\013toggle_time\030\002 \001(" + + "\0132\032.google.protobuf.TimestampB\003\340A\003\022#\n\026te" + + "rminal_storage_class\030\003 \001(\tH\000\210\001\001\022P\n\"termi" + + "nal_storage_class_update_time\030\004 \001(\0132\032.go" + + "ogle.protobuf.TimestampB\003\340A\003H\001\210\001\001B\031\n\027_te" + + "rminal_storage_classB%\n#_terminal_storag" + + "e_class_update_time\032-\n\025HierarchicalNames" + + "pace\022\024\n\007enabled\030\001 \001(\010B\003\340A\001\032-\n\013LabelsEntr" + + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:X\352AU\n\035" + + "storage.googleapis.com/Bucket\022#projects/" + + "{project}/buckets/{bucket}*\007buckets2\006buc" + + "ket\"\316\001\n\023BucketAccessControl\022\014\n\004role\030\001 \001(" + + "\t\022\n\n\002id\030\002 \001(\t\022\016\n\006entity\030\003 \001(\t\022\027\n\nentity_" + + "alt\030\t \001(\tB\003\340A\003\022\021\n\tentity_id\030\004 \001(\t\022\014\n\004eta" + + "g\030\010 \001(\t\022\r\n\005email\030\005 \001(\t\022\016\n\006domain\030\006 \001(\t\0224" + + "\n\014project_team\030\007 \001(\0132\036.google.storage.v2" + + ".ProjectTeam\"I\n\017ChecksummedData\022\026\n\007conte" + + "nt\030\001 \001(\014B\005\010\001\340A\001\022\023\n\006crc32c\030\002 \001(\007H\000\210\001\001B\t\n\007" + + "_crc32c\"C\n\017ObjectChecksums\022\023\n\006crc32c\030\001 \001" + + "(\007H\000\210\001\001\022\020\n\010md5_hash\030\002 \001(\014B\t\n\007_crc32c\"L\n\022" + + "CustomerEncryption\022\034\n\024encryption_algorit" + + "hm\030\001 \001(\t\022\030\n\020key_sha256_bytes\030\003 \001(\014\"\227\013\n\006O" + + "bject\022\021\n\004name\030\001 \001(\tB\003\340A\005\0225\n\006bucket\030\002 \001(\t" + + "B%\340A\005\372A\037\n\035storage.googleapis.com/Bucket\022" + + "\014\n\004etag\030\033 \001(\t\022\027\n\ngeneration\030\003 \001(\003B\003\340A\005\022\037" + + "\n\rrestore_token\030# \001(\tB\003\340A\003H\000\210\001\001\022\033\n\016metag" + + "eneration\030\004 \001(\003B\003\340A\003\022\025\n\rstorage_class\030\005 " + + "\001(\t\022\021\n\004size\030\006 \001(\003B\003\340A\003\022\030\n\020content_encodi" + + "ng\030\007 \001(\t\022\033\n\023content_disposition\030\010 \001(\t\022\025\n" + + "\rcache_control\030\t \001(\t\0223\n\003acl\030\n \003(\0132&.goog" + + "le.storage.v2.ObjectAccessControl\022\030\n\020con" + + "tent_language\030\013 \001(\t\0224\n\013delete_time\030\014 \001(\013" + + "2\032.google.protobuf.TimestampB\003\340A\003\0226\n\rfin" + + "alize_time\030$ \001(\0132\032.google.protobuf.Times" + + "tampB\003\340A\003\022\024\n\014content_type\030\r \001(\t\0224\n\013creat" + + "e_time\030\016 \001(\0132\032.google.protobuf.Timestamp" + + "B\003\340A\003\022\034\n\017component_count\030\017 \001(\005B\003\340A\003\022:\n\tc" + + "hecksums\030\020 \001(\0132\".google.storage.v2.Objec" + + "tChecksumsB\003\340A\003\0224\n\013update_time\030\021 \001(\0132\032.g" + + "oogle.protobuf.TimestampB\003\340A\003\0227\n\007kms_key" + + "\030\022 \001(\tB&\372A#\n!cloudkms.googleapis.com/Cry" + + "ptoKey\022B\n\031update_storage_class_time\030\023 \001(" + + "\0132\032.google.protobuf.TimestampB\003\340A\003\022\026\n\016te" + + "mporary_hold\030\024 \001(\010\0229\n\025retention_expire_t" + + "ime\030\025 \001(\0132\032.google.protobuf.Timestamp\0229\n" + + "\010metadata\030\026 \003(\0132\'.google.storage.v2.Obje" + + "ct.MetadataEntry\022\035\n\020event_based_hold\030\027 \001" + + "(\010H\001\210\001\001\022,\n\005owner\030\030 \001(\0132\030.google.storage." + + "v2.OwnerB\003\340A\003\022B\n\023customer_encryption\030\031 \001" + + "(\0132%.google.storage.v2.CustomerEncryptio" + + "n\022/\n\013custom_time\030\032 \001(\0132\032.google.protobuf" + + ".Timestamp\022>\n\020soft_delete_time\030\034 \001(\0132\032.g" + + "oogle.protobuf.TimestampB\003\340A\003H\002\210\001\001\022>\n\020ha" + + "rd_delete_time\030\035 \001(\0132\032.google.protobuf.T" + + "imestampB\003\340A\003H\003\210\001\001\032/\n\rMetadataEntry\022\013\n\003k" + + "ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\020\n\016_restore_" + + "tokenB\023\n\021_event_based_holdB\023\n\021_soft_dele" + + "te_timeB\023\n\021_hard_delete_time\"\316\001\n\023ObjectA" + + "ccessControl\022\014\n\004role\030\001 \001(\t\022\n\n\002id\030\002 \001(\t\022\016" + + "\n\006entity\030\003 \001(\t\022\027\n\nentity_alt\030\t \001(\tB\003\340A\003\022" + + "\021\n\tentity_id\030\004 \001(\t\022\014\n\004etag\030\010 \001(\t\022\r\n\005emai" + + "l\030\005 \001(\t\022\016\n\006domain\030\006 \001(\t\0224\n\014project_team\030" + + "\007 \001(\0132\036.google.storage.v2.ProjectTeam\"l\n" + + "\023ListObjectsResponse\022*\n\007objects\030\001 \003(\0132\031." + + "google.storage.v2.Object\022\020\n\010prefixes\030\002 \003" + + "(\t\022\027\n\017next_page_token\030\003 \001(\t\"3\n\013ProjectTe" + + "am\022\026\n\016project_number\030\001 \001(\t\022\014\n\004team\030\002 \001(\t" + + "\"*\n\005Owner\022\016\n\006entity\030\001 \001(\t\022\021\n\tentity_id\030\002" + + " \001(\t\"C\n\014ContentRange\022\r\n\005start\030\001 \001(\003\022\013\n\003e" + + "nd\030\002 \001(\003\022\027\n\017complete_length\030\003 \001(\0032\301\036\n\007St" + + "orage\022r\n\014DeleteBucket\022&.google.storage.v" + + "2.DeleteBucketRequest\032\026.google.protobuf." + + "Empty\"\"\332A\004name\212\323\344\223\002\025\022\023\n\004name\022\013{bucket=**" + + "}\022o\n\tGetBucket\022#.google.storage.v2.GetBu" + + "cketRequest\032\031.google.storage.v2.Bucket\"\"" + + "\332A\004name\212\323\344\223\002\025\022\023\n\004name\022\013{bucket=**}\022\253\001\n\014C" + + "reateBucket\022&.google.storage.v2.CreateBu" + + "cketRequest\032\031.google.storage.v2.Bucket\"X" + + "\332A\027parent,bucket,bucket_id\212\323\344\223\0028\022\026\n\006pare" + + "nt\022\014{project=**}\022\036\n\016bucket.project\022\014{pro" + + "ject=**}\022\205\001\n\013ListBuckets\022%.google.storag" + + "e.v2.ListBucketsRequest\032&.google.storage" + + ".v2.ListBucketsResponse\"\'\332A\006parent\212\323\344\223\002\030" + + "\022\026\n\006parent\022\014{project=**}\022\223\001\n\031LockBucketR" + + "etentionPolicy\0223.google.storage.v2.LockB" + + "ucketRetentionPolicyRequest\032\031.google.sto" + + "rage.v2.Bucket\"&\332A\006bucket\212\323\344\223\002\027\022\025\n\006bucke" + + "t\022\013{bucket=**}\022u\n\014GetIamPolicy\022\".google." + + "iam.v1.GetIamPolicyRequest\032\025.google.iam." + + "v1.Policy\"*\332A\010resource\212\323\344\223\002\031\022\027\n\010resource" + + "\022\013{bucket=**}\022|\n\014SetIamPolicy\022\".google.i" + + "am.v1.SetIamPolicyRequest\032\025.google.iam.v" + + "1.Policy\"1\332A\017resource,policy\212\323\344\223\002\031\022\027\n\010re" + + "source\022\013{bucket=**}\022\226\002\n\022TestIamPermissio" + + "ns\022(.google.iam.v1.TestIamPermissionsReq" + + "uest\032).google.iam.v1.TestIamPermissionsR" + + "esponse\"\252\001\332A\024resource,permissions\212\323\344\223\002\214\001" + + "\022\027\n\010resource\022\013{bucket=**}\0224\n\010resource\022({" + + "bucket=projects/*/buckets/*}/objects/**\022" + + ";\n\010resource\022/{bucket=projects/*/buckets/" + + "*}/managedFolders/**\022\212\001\n\014UpdateBucket\022&." + + "google.storage.v2.UpdateBucketRequest\032\031." + + "google.storage.v2.Bucket\"7\332A\022bucket,upda" + + "te_mask\212\323\344\223\002\034\022\032\n\013bucket.name\022\013{bucket=**" + + "}\022~\n\rComposeObject\022\'.google.storage.v2.C" + + "omposeObjectRequest\032\031.google.storage.v2." + + "Object\")\212\323\344\223\002#\022!\n\022destination.bucket\022\013{b" + + "ucket=**}\022\230\001\n\014DeleteObject\022&.google.stor" + + "age.v2.DeleteObjectRequest\032\026.google.prot" + + "obuf.Empty\"H\332A\rbucket,object\332A\030bucket,ob" + "ject,generation\212\323\344\223\002\027\022\025\n\006bucket\022\013{bucket" - + "=**}\022\245\001\n\nReadObject\022$.google.storage.v2." - + "ReadObjectRequest\032%.google.storage.v2.Re" - + "adObjectResponse\"H\332A\rbucket,object\332A\030buc" - + "ket,object,generation\212\323\344\223\002\027\022\025\n\006bucket\022\013{" - + "bucket=**}0\001\022\214\001\n\014UpdateObject\022&.google.s" - + "torage.v2.UpdateObjectRequest\032\031.google.s" - + "torage.v2.Object\"9\332A\022object,update_mask\212" - + "\323\344\223\002\036\022\034\n\robject.bucket\022\013{bucket=**}\022`\n\013W" - + "riteObject\022%.google.storage.v2.WriteObje" - + "ctRequest\032&.google.storage.v2.WriteObjec" - + "tResponse\"\000(\001\022n\n\017BidiWriteObject\022).googl" - + "e.storage.v2.BidiWriteObjectRequest\032*.go" - + "ogle.storage.v2.BidiWriteObjectResponse\"" - + "\000(\0010\001\022\204\001\n\013ListObjects\022%.google.storage.v" - + "2.ListObjectsRequest\032&.google.storage.v2" - + ".ListObjectsResponse\"&\332A\006parent\212\323\344\223\002\027\022\025\n" - + "\006parent\022\013{bucket=**}\022\230\001\n\rRewriteObject\022\'" - + ".google.storage.v2.RewriteObjectRequest\032" - + "\".google.storage.v2.RewriteResponse\":\212\323\344" - + "\223\0024\022\017\n\rsource_bucket\022!\n\022destination_buck" - + "et\022\013{bucket=**}\022\256\001\n\023StartResumableWrite\022" - + "-.google.storage.v2.StartResumableWriteR" - + "equest\032..google.storage.v2.StartResumabl" - + "eWriteResponse\"8\212\323\344\223\0022\0220\n!write_object_s" - + "pec.resource.bucket\022\013{bucket=**}\022\256\001\n\020Que" - + "ryWriteStatus\022*.google.storage.v2.QueryW" - + "riteStatusRequest\032+.google.storage.v2.Qu" - + "eryWriteStatusResponse\"A\332A\tupload_id\212\323\344\223" - + "\002/\022-\n\tupload_id\022 {bucket=projects/*/buck" - + "ets/*}/**\022\226\001\n\nMoveObject\022$.google.storag" - + "e.v2.MoveObjectRequest\032\031.google.storage." - + "v2.Object\"G\332A\'bucket,source_object,desti" - + "nation_object\212\323\344\223\002\027\022\025\n\006bucket\022\013{bucket=*" - + "*}\032\247\002\312A\026storage.googleapis.com\322A\212\002https:" - + "//www.googleapis.com/auth/cloud-platform" - + ",https://www.googleapis.com/auth/cloud-p" - + "latform.read-only,https://www.googleapis" - + ".com/auth/devstorage.full_control,https:" - + "//www.googleapis.com/auth/devstorage.rea" - + "d_only,https://www.googleapis.com/auth/d" - + "evstorage.read_writeB\342\001\n\025com.google.stor" - + "age.v2B\014StorageProtoP\001Z>cloud.google.com" - + "/go/storage/internal/apiv2/storagepb;sto" - + "ragepb\352Ax\n!cloudkms.googleapis.com/Crypt" - + "oKey\022Sprojects/{project}/locations/{loca" - + "tion}/keyRings/{key_ring}/cryptoKeys/{cr" - + "ypto_key}b\006proto3" + + "=**}\022\215\001\n\rRestoreObject\022\'.google.storage." + + "v2.RestoreObjectRequest\032\031.google.storage" + + ".v2.Object\"8\332A\030bucket,object,generation\212" + + "\323\344\223\002\027\022\025\n\006bucket\022\013{bucket=**}\022\272\001\n\024CancelR" + + "esumableWrite\022..google.storage.v2.Cancel" + + "ResumableWriteRequest\032/.google.storage.v" + + "2.CancelResumableWriteResponse\"A\332A\tuploa" + + "d_id\212\323\344\223\002/\022-\n\tupload_id\022 {bucket=project" + + "s/*/buckets/*}/**\022\225\001\n\tGetObject\022#.google" + + ".storage.v2.GetObjectRequest\032\031.google.st" + + "orage.v2.Object\"H\332A\rbucket,object\332A\030buck" + + "et,object,generation\212\323\344\223\002\027\022\025\n\006bucket\022\013{b" + + "ucket=**}\022\245\001\n\nReadObject\022$.google.storag" + + "e.v2.ReadObjectRequest\032%.google.storage." + + "v2.ReadObjectResponse\"H\332A\rbucket,object\332" + + "A\030bucket,object,generation\212\323\344\223\002\027\022\025\n\006buck" + + "et\022\013{bucket=**}0\001\022\231\001\n\016BidiReadObject\022(.g" + + "oogle.storage.v2.BidiReadObjectRequest\032)" + + ".google.storage.v2.BidiReadObjectRespons" + + "e\".\212\323\344\223\002(\022&\n\027read_object_spec.bucket\022\013{b" + + "ucket=**}(\0010\001\022\214\001\n\014UpdateObject\022&.google." + + "storage.v2.UpdateObjectRequest\032\031.google." + + "storage.v2.Object\"9\332A\022object,update_mask" + + "\212\323\344\223\002\036\022\034\n\robject.bucket\022\013{bucket=**}\022`\n\013" + + "WriteObject\022%.google.storage.v2.WriteObj" + + "ectRequest\032&.google.storage.v2.WriteObje" + + "ctResponse\"\000(\001\022n\n\017BidiWriteObject\022).goog" + + "le.storage.v2.BidiWriteObjectRequest\032*.g" + + "oogle.storage.v2.BidiWriteObjectResponse" + + "\"\000(\0010\001\022\204\001\n\013ListObjects\022%.google.storage." + + "v2.ListObjectsRequest\032&.google.storage.v" + + "2.ListObjectsResponse\"&\332A\006parent\212\323\344\223\002\027\022\025" + + "\n\006parent\022\013{bucket=**}\022\230\001\n\rRewriteObject\022" + + "\'.google.storage.v2.RewriteObjectRequest" + + "\032\".google.storage.v2.RewriteResponse\":\212\323" + + "\344\223\0024\022\017\n\rsource_bucket\022!\n\022destination_buc" + + "ket\022\013{bucket=**}\022\256\001\n\023StartResumableWrite" + + "\022-.google.storage.v2.StartResumableWrite" + + "Request\032..google.storage.v2.StartResumab" + + "leWriteResponse\"8\212\323\344\223\0022\0220\n!write_object_" + + "spec.resource.bucket\022\013{bucket=**}\022\256\001\n\020Qu" + + "eryWriteStatus\022*.google.storage.v2.Query" + + "WriteStatusRequest\032+.google.storage.v2.Q" + + "ueryWriteStatusResponse\"A\332A\tupload_id\212\323\344" + + "\223\002/\022-\n\tupload_id\022 {bucket=projects/*/buc" + + "kets/*}/**\022\226\001\n\nMoveObject\022$.google.stora" + + "ge.v2.MoveObjectRequest\032\031.google.storage" + + ".v2.Object\"G\332A\'bucket,source_object,dest" + + "ination_object\212\323\344\223\002\027\022\025\n\006bucket\022\013{bucket=" + + "**}\032\247\002\312A\026storage.googleapis.com\322A\212\002https" + + "://www.googleapis.com/auth/cloud-platfor" + + "m,https://www.googleapis.com/auth/cloud-" + + "platform.read-only,https://www.googleapi" + + "s.com/auth/devstorage.full_control,https" + + "://www.googleapis.com/auth/devstorage.re" + + "ad_only,https://www.googleapis.com/auth/" + + "devstorage.read_writeB\342\001\n\025com.google.sto" + + "rage.v2B\014StorageProtoP\001Z>cloud.google.co" + + "m/go/storage/internal/apiv2/storagepb;st" + + "oragepb\352Ax\n!cloudkms.googleapis.com/Cryp" + + "toKey\022Sprojects/{project}/locations/{loc" + + "ation}/keyRings/{key_ring}/cryptoKeys/{c" + + "rypto_key}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -832,6 +944,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.EmptyProto.getDescriptor(), com.google.protobuf.FieldMaskProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), com.google.type.DateProto.getDescriptor(), }); internal_static_google_storage_v2_DeleteBucketRequest_descriptor = @@ -1018,8 +1131,106 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "ChecksummedData", "ObjectChecksums", "ContentRange", "Metadata", }); - internal_static_google_storage_v2_WriteObjectSpec_descriptor = + internal_static_google_storage_v2_BidiReadObjectSpec_descriptor = getDescriptor().getMessageTypes().get(15); + internal_static_google_storage_v2_BidiReadObjectSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_BidiReadObjectSpec_descriptor, + new java.lang.String[] { + "Bucket", + "Object", + "Generation", + "IfGenerationMatch", + "IfGenerationNotMatch", + "IfMetagenerationMatch", + "IfMetagenerationNotMatch", + "CommonObjectRequestParams", + "ReadMask", + "ReadHandle", + "RoutingToken", + }); + internal_static_google_storage_v2_BidiReadObjectRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_storage_v2_BidiReadObjectRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_BidiReadObjectRequest_descriptor, + new java.lang.String[] { + "ReadObjectSpec", "ReadRanges", + }); + internal_static_google_storage_v2_BidiReadObjectResponse_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_storage_v2_BidiReadObjectResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_BidiReadObjectResponse_descriptor, + new java.lang.String[] { + "ObjectDataRanges", "Metadata", "ReadHandle", + }); + internal_static_google_storage_v2_BidiReadObjectRedirectedError_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_storage_v2_BidiReadObjectRedirectedError_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_BidiReadObjectRedirectedError_descriptor, + new java.lang.String[] { + "ReadHandle", "RoutingToken", + }); + internal_static_google_storage_v2_BidiWriteObjectRedirectedError_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_storage_v2_BidiWriteObjectRedirectedError_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_BidiWriteObjectRedirectedError_descriptor, + new java.lang.String[] { + "RoutingToken", "WriteHandle", "Generation", + }); + internal_static_google_storage_v2_BidiReadObjectError_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_storage_v2_BidiReadObjectError_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_BidiReadObjectError_descriptor, + new java.lang.String[] { + "ReadRangeErrors", + }); + internal_static_google_storage_v2_ReadRangeError_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_storage_v2_ReadRangeError_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_ReadRangeError_descriptor, + new java.lang.String[] { + "ReadId", "Status", + }); + internal_static_google_storage_v2_ReadRange_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_storage_v2_ReadRange_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_ReadRange_descriptor, + new java.lang.String[] { + "ReadOffset", "ReadLength", "ReadId", + }); + internal_static_google_storage_v2_ObjectRangeData_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_storage_v2_ObjectRangeData_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_ObjectRangeData_descriptor, + new java.lang.String[] { + "ChecksummedData", "ReadRange", "RangeEnd", + }); + internal_static_google_storage_v2_BidiReadHandle_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_storage_v2_BidiReadHandle_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_BidiReadHandle_descriptor, + new java.lang.String[] { + "Handle", + }); + internal_static_google_storage_v2_BidiWriteHandle_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_google_storage_v2_BidiWriteHandle_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_BidiWriteHandle_descriptor, + new java.lang.String[] { + "Handle", + }); + internal_static_google_storage_v2_WriteObjectSpec_descriptor = + getDescriptor().getMessageTypes().get(26); internal_static_google_storage_v2_WriteObjectSpec_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_WriteObjectSpec_descriptor, @@ -1031,9 +1242,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "IfMetagenerationMatch", "IfMetagenerationNotMatch", "ObjectSize", + "Appendable", }); internal_static_google_storage_v2_WriteObjectRequest_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(27); internal_static_google_storage_v2_WriteObjectRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_WriteObjectRequest_descriptor, @@ -1049,21 +1261,36 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Data", }); internal_static_google_storage_v2_WriteObjectResponse_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(28); internal_static_google_storage_v2_WriteObjectResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_WriteObjectResponse_descriptor, new java.lang.String[] { "PersistedSize", "Resource", "WriteStatus", }); + internal_static_google_storage_v2_AppendObjectSpec_descriptor = + getDescriptor().getMessageTypes().get(29); + internal_static_google_storage_v2_AppendObjectSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_AppendObjectSpec_descriptor, + new java.lang.String[] { + "Bucket", + "Object", + "Generation", + "IfMetagenerationMatch", + "IfMetagenerationNotMatch", + "RoutingToken", + "WriteHandle", + }); internal_static_google_storage_v2_BidiWriteObjectRequest_descriptor = - getDescriptor().getMessageTypes().get(18); + getDescriptor().getMessageTypes().get(30); internal_static_google_storage_v2_BidiWriteObjectRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_BidiWriteObjectRequest_descriptor, new java.lang.String[] { "UploadId", "WriteObjectSpec", + "AppendObjectSpec", "WriteOffset", "ChecksummedData", "ObjectChecksums", @@ -1075,15 +1302,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Data", }); internal_static_google_storage_v2_BidiWriteObjectResponse_descriptor = - getDescriptor().getMessageTypes().get(19); + getDescriptor().getMessageTypes().get(31); internal_static_google_storage_v2_BidiWriteObjectResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_BidiWriteObjectResponse_descriptor, new java.lang.String[] { - "PersistedSize", "Resource", "WriteStatus", + "PersistedSize", "Resource", "WriteHandle", "WriteStatus", }); internal_static_google_storage_v2_ListObjectsRequest_descriptor = - getDescriptor().getMessageTypes().get(20); + getDescriptor().getMessageTypes().get(32); internal_static_google_storage_v2_ListObjectsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_ListObjectsRequest_descriptor, @@ -1103,7 +1330,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "MatchGlob", }); internal_static_google_storage_v2_QueryWriteStatusRequest_descriptor = - getDescriptor().getMessageTypes().get(21); + getDescriptor().getMessageTypes().get(33); internal_static_google_storage_v2_QueryWriteStatusRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_QueryWriteStatusRequest_descriptor, @@ -1111,7 +1338,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "UploadId", "CommonObjectRequestParams", }); internal_static_google_storage_v2_QueryWriteStatusResponse_descriptor = - getDescriptor().getMessageTypes().get(22); + getDescriptor().getMessageTypes().get(34); internal_static_google_storage_v2_QueryWriteStatusResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_QueryWriteStatusResponse_descriptor, @@ -1119,7 +1346,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "PersistedSize", "Resource", "WriteStatus", }); internal_static_google_storage_v2_RewriteObjectRequest_descriptor = - getDescriptor().getMessageTypes().get(23); + getDescriptor().getMessageTypes().get(35); internal_static_google_storage_v2_RewriteObjectRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_RewriteObjectRequest_descriptor, @@ -1149,7 +1376,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ObjectChecksums", }); internal_static_google_storage_v2_RewriteResponse_descriptor = - getDescriptor().getMessageTypes().get(24); + getDescriptor().getMessageTypes().get(36); internal_static_google_storage_v2_RewriteResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_RewriteResponse_descriptor, @@ -1157,7 +1384,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "TotalBytesRewritten", "ObjectSize", "Done", "RewriteToken", "Resource", }); internal_static_google_storage_v2_MoveObjectRequest_descriptor = - getDescriptor().getMessageTypes().get(25); + getDescriptor().getMessageTypes().get(37); internal_static_google_storage_v2_MoveObjectRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_MoveObjectRequest_descriptor, @@ -1175,7 +1402,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "IfMetagenerationNotMatch", }); internal_static_google_storage_v2_StartResumableWriteRequest_descriptor = - getDescriptor().getMessageTypes().get(26); + getDescriptor().getMessageTypes().get(38); internal_static_google_storage_v2_StartResumableWriteRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_StartResumableWriteRequest_descriptor, @@ -1183,7 +1410,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "WriteObjectSpec", "CommonObjectRequestParams", "ObjectChecksums", }); internal_static_google_storage_v2_StartResumableWriteResponse_descriptor = - getDescriptor().getMessageTypes().get(27); + getDescriptor().getMessageTypes().get(39); internal_static_google_storage_v2_StartResumableWriteResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_StartResumableWriteResponse_descriptor, @@ -1191,7 +1418,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "UploadId", }); internal_static_google_storage_v2_UpdateObjectRequest_descriptor = - getDescriptor().getMessageTypes().get(28); + getDescriptor().getMessageTypes().get(40); internal_static_google_storage_v2_UpdateObjectRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_UpdateObjectRequest_descriptor, @@ -1206,7 +1433,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "CommonObjectRequestParams", }); internal_static_google_storage_v2_CommonObjectRequestParams_descriptor = - getDescriptor().getMessageTypes().get(29); + getDescriptor().getMessageTypes().get(41); internal_static_google_storage_v2_CommonObjectRequestParams_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_CommonObjectRequestParams_descriptor, @@ -1214,12 +1441,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "EncryptionAlgorithm", "EncryptionKeyBytes", "EncryptionKeySha256Bytes", }); internal_static_google_storage_v2_ServiceConstants_descriptor = - getDescriptor().getMessageTypes().get(30); + getDescriptor().getMessageTypes().get(42); internal_static_google_storage_v2_ServiceConstants_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_ServiceConstants_descriptor, new java.lang.String[] {}); - internal_static_google_storage_v2_Bucket_descriptor = getDescriptor().getMessageTypes().get(31); + internal_static_google_storage_v2_Bucket_descriptor = getDescriptor().getMessageTypes().get(43); internal_static_google_storage_v2_Bucket_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_Bucket_descriptor, @@ -1410,7 +1637,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_storage_v2_BucketAccessControl_descriptor = - getDescriptor().getMessageTypes().get(32); + getDescriptor().getMessageTypes().get(44); internal_static_google_storage_v2_BucketAccessControl_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_BucketAccessControl_descriptor, @@ -1426,7 +1653,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ProjectTeam", }); internal_static_google_storage_v2_ChecksummedData_descriptor = - getDescriptor().getMessageTypes().get(33); + getDescriptor().getMessageTypes().get(45); internal_static_google_storage_v2_ChecksummedData_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_ChecksummedData_descriptor, @@ -1434,7 +1661,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Content", "Crc32C", }); internal_static_google_storage_v2_ObjectChecksums_descriptor = - getDescriptor().getMessageTypes().get(34); + getDescriptor().getMessageTypes().get(46); internal_static_google_storage_v2_ObjectChecksums_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_ObjectChecksums_descriptor, @@ -1442,14 +1669,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Crc32C", "Md5Hash", }); internal_static_google_storage_v2_CustomerEncryption_descriptor = - getDescriptor().getMessageTypes().get(35); + getDescriptor().getMessageTypes().get(47); internal_static_google_storage_v2_CustomerEncryption_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_CustomerEncryption_descriptor, new java.lang.String[] { "EncryptionAlgorithm", "KeySha256Bytes", }); - internal_static_google_storage_v2_Object_descriptor = getDescriptor().getMessageTypes().get(36); + internal_static_google_storage_v2_Object_descriptor = getDescriptor().getMessageTypes().get(48); internal_static_google_storage_v2_Object_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_Object_descriptor, @@ -1495,7 +1722,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_storage_v2_ObjectAccessControl_descriptor = - getDescriptor().getMessageTypes().get(37); + getDescriptor().getMessageTypes().get(49); internal_static_google_storage_v2_ObjectAccessControl_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_ObjectAccessControl_descriptor, @@ -1511,7 +1738,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ProjectTeam", }); internal_static_google_storage_v2_ListObjectsResponse_descriptor = - getDescriptor().getMessageTypes().get(38); + getDescriptor().getMessageTypes().get(50); internal_static_google_storage_v2_ListObjectsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_ListObjectsResponse_descriptor, @@ -1519,14 +1746,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Objects", "Prefixes", "NextPageToken", }); internal_static_google_storage_v2_ProjectTeam_descriptor = - getDescriptor().getMessageTypes().get(39); + getDescriptor().getMessageTypes().get(51); internal_static_google_storage_v2_ProjectTeam_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_ProjectTeam_descriptor, new java.lang.String[] { "ProjectNumber", "Team", }); - internal_static_google_storage_v2_Owner_descriptor = getDescriptor().getMessageTypes().get(40); + internal_static_google_storage_v2_Owner_descriptor = getDescriptor().getMessageTypes().get(52); internal_static_google_storage_v2_Owner_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_Owner_descriptor, @@ -1534,7 +1761,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Entity", "EntityId", }); internal_static_google_storage_v2_ContentRange_descriptor = - getDescriptor().getMessageTypes().get(41); + getDescriptor().getMessageTypes().get(53); internal_static_google_storage_v2_ContentRange_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_storage_v2_ContentRange_descriptor, @@ -1563,6 +1790,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.EmptyProto.getDescriptor(); com.google.protobuf.FieldMaskProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); com.google.type.DateProto.getDescriptor(); } diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpec.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpec.java index 70cef9ec7b..bfd5f99efe 100644 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpec.java +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpec.java @@ -356,6 +356,41 @@ public long getObjectSize() { return objectSize_; } + public static final int APPENDABLE_FIELD_NUMBER = 9; + private boolean appendable_ = false; + /** + * + * + *
                +   * If true, the object will be created in appendable mode.
                +   * This field may only be set when using BidiWriteObject.
                +   * 
                + * + * optional bool appendable = 9; + * + * @return Whether the appendable field is set. + */ + @java.lang.Override + public boolean hasAppendable() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
                +   * If true, the object will be created in appendable mode.
                +   * This field may only be set when using BidiWriteObject.
                +   * 
                + * + * optional bool appendable = 9; + * + * @return The appendable. + */ + @java.lang.Override + public boolean getAppendable() { + return appendable_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -391,6 +426,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (((bitField0_ & 0x00000020) != 0)) { output.writeInt64(8, objectSize_); } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeBool(9, appendable_); + } getUnknownFields().writeTo(output); } @@ -421,6 +459,9 @@ public int getSerializedSize() { if (((bitField0_ & 0x00000020) != 0)) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(8, objectSize_); } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, appendable_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -461,6 +502,10 @@ public boolean equals(final java.lang.Object obj) { if (hasObjectSize()) { if (getObjectSize() != other.getObjectSize()) return false; } + if (hasAppendable() != other.hasAppendable()) return false; + if (hasAppendable()) { + if (getAppendable() != other.getAppendable()) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -498,6 +543,10 @@ public int hashCode() { hash = (37 * hash) + OBJECT_SIZE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getObjectSize()); } + if (hasAppendable()) { + hash = (37 * hash) + APPENDABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAppendable()); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -656,6 +705,7 @@ public Builder clear() { ifMetagenerationMatch_ = 0L; ifMetagenerationNotMatch_ = 0L; objectSize_ = 0L; + appendable_ = false; return this; } @@ -720,6 +770,10 @@ private void buildPartial0(com.google.storage.v2.WriteObjectSpec result) { result.objectSize_ = objectSize_; to_bitField0_ |= 0x00000020; } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.appendable_ = appendable_; + to_bitField0_ |= 0x00000040; + } result.bitField0_ |= to_bitField0_; } @@ -791,6 +845,9 @@ public Builder mergeFrom(com.google.storage.v2.WriteObjectSpec other) { if (other.hasObjectSize()) { setObjectSize(other.getObjectSize()); } + if (other.hasAppendable()) { + setAppendable(other.getAppendable()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -859,6 +916,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000040; break; } // case 64 + case 72: + { + appendable_ = input.readBool(); + bitField0_ |= 0x00000080; + break; + } // case 72 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1576,6 +1639,78 @@ public Builder clearObjectSize() { return this; } + private boolean appendable_; + /** + * + * + *
                +     * If true, the object will be created in appendable mode.
                +     * This field may only be set when using BidiWriteObject.
                +     * 
                + * + * optional bool appendable = 9; + * + * @return Whether the appendable field is set. + */ + @java.lang.Override + public boolean hasAppendable() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
                +     * If true, the object will be created in appendable mode.
                +     * This field may only be set when using BidiWriteObject.
                +     * 
                + * + * optional bool appendable = 9; + * + * @return The appendable. + */ + @java.lang.Override + public boolean getAppendable() { + return appendable_; + } + /** + * + * + *
                +     * If true, the object will be created in appendable mode.
                +     * This field may only be set when using BidiWriteObject.
                +     * 
                + * + * optional bool appendable = 9; + * + * @param value The appendable to set. + * @return This builder for chaining. + */ + public Builder setAppendable(boolean value) { + + appendable_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
                +     * If true, the object will be created in appendable mode.
                +     * This field may only be set when using BidiWriteObject.
                +     * 
                + * + * optional bool appendable = 9; + * + * @return This builder for chaining. + */ + public Builder clearAppendable() { + bitField0_ = (bitField0_ & ~0x00000080); + appendable_ = false; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpecOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpecOrBuilder.java index 43de710bca..8c75296afe 100644 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpecOrBuilder.java +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpecOrBuilder.java @@ -238,4 +238,31 @@ public interface WriteObjectSpecOrBuilder * @return The objectSize. */ long getObjectSize(); + + /** + * + * + *
                +   * If true, the object will be created in appendable mode.
                +   * This field may only be set when using BidiWriteObject.
                +   * 
                + * + * optional bool appendable = 9; + * + * @return Whether the appendable field is set. + */ + boolean hasAppendable(); + /** + * + * + *
                +   * If true, the object will be created in appendable mode.
                +   * This field may only be set when using BidiWriteObject.
                +   * 
                + * + * optional bool appendable = 9; + * + * @return The appendable. + */ + boolean getAppendable(); } diff --git a/proto-google-cloud-storage-v2/src/main/proto/google/storage/v2/storage.proto b/proto-google-cloud-storage-v2/src/main/proto/google/storage/v2/storage.proto index 2671acbc4a..ef5bc011ff 100644 --- a/proto-google-cloud-storage-v2/src/main/proto/google/storage/v2/storage.proto +++ b/proto-google-cloud-storage-v2/src/main/proto/google/storage/v2/storage.proto @@ -26,6 +26,7 @@ import "google/protobuf/duration.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; import "google/type/date.proto"; option go_package = "cloud.google.com/go/storage/internal/apiv2/storagepb;storagepb"; @@ -176,12 +177,26 @@ service Storage { }; } - // Deletes an object and its metadata. + // Deletes an object and its metadata. Deletions are permanent if versioning + // is not enabled for the bucket, or if the generation parameter is used, or + // if [soft delete](https://cloud.google.com/storage/docs/soft-delete) is not + // enabled for the bucket. + // When this API is used to delete an object from a bucket that has soft + // delete policy enabled, the object becomes soft deleted, and the + // `softDeleteTime` and `hardDeleteTime` properties are set on the object. + // This API cannot be used to permanently delete soft-deleted objects. + // Soft-deleted objects are permanently deleted according to their + // `hardDeleteTime`. // - // Deletions are normally permanent when versioning is disabled or whenever - // the generation parameter is used. However, if soft delete is enabled for - // the bucket, deleted objects can be restored using RestoreObject until the - // soft delete retention period has passed. + // You can use the [`RestoreObject`][google.storage.v2.Storage.RestoreObject] + // API to restore soft-deleted objects until the soft delete retention period + // has passed. + // + // **IAM Permissions**: + // + // Requires `storage.objects.delete` + // [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on + // the bucket. rpc DeleteObject(DeleteObjectRequest) returns (google.protobuf.Empty) { option (google.api.routing) = { routing_parameters { field: "bucket" path_template: "{bucket=**}" } @@ -217,7 +232,14 @@ service Storage { option (google.api.method_signature) = "upload_id"; } - // Retrieves an object's metadata. + // Retrieves object metadata. + // + // **IAM Permissions**: + // + // Requires `storage.objects.get` + // [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on + // the bucket. To return object ACLs, the authenticated user must also have + // the `storage.objects.getIamPolicy` permission. rpc GetObject(GetObjectRequest) returns (Object) { option (google.api.routing) = { routing_parameters { field: "bucket" path_template: "{bucket=**}" } @@ -226,7 +248,13 @@ service Storage { option (google.api.method_signature) = "bucket,object,generation"; } - // Reads an object's data. + // Retrieves object data. + // + // **IAM Permissions**: + // + // Requires `storage.objects.get` + // [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on + // the bucket. rpc ReadObject(ReadObjectRequest) returns (stream ReadObjectResponse) { option (google.api.routing) = { routing_parameters { field: "bucket" path_template: "{bucket=**}" } @@ -235,6 +263,35 @@ service Storage { option (google.api.method_signature) = "bucket,object,generation"; } + // Reads an object's data. + // + // This is a bi-directional API with the added support for reading multiple + // ranges within one stream both within and across multiple messages. + // If the server encountered an error for any of the inputs, the stream will + // be closed with the relevant error code. + // Because the API allows for multiple outstanding requests, when the stream + // is closed the error response will contain a BidiReadObjectRangesError proto + // in the error extension describing the error for each outstanding read_id. + // + // **IAM Permissions**: + // + // Requires `storage.objects.get` + // + // [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on + // the bucket. + // + // This API is currently in preview and is not yet available for general + // use. + rpc BidiReadObject(stream BidiReadObjectRequest) + returns (stream BidiReadObjectResponse) { + option (google.api.routing) = { + routing_parameters { + field: "read_object_spec.bucket" + path_template: "{bucket=**}" + } + }; + } + // Updates an object's metadata. // Equivalent to JSON API's storage.objects.patch. rpc UpdateObject(UpdateObjectRequest) returns (Object) { @@ -297,12 +354,18 @@ service Storage { // whether the service views the object as complete. // // Attempting to resume an already finalized object will result in an OK - // status, with a WriteObjectResponse containing the finalized object's + // status, with a `WriteObjectResponse` containing the finalized object's // metadata. // // Alternatively, the BidiWriteObject operation may be used to write an // object with controls over flushing and the ability to fetch the ability to // determine the current persisted size. + // + // **IAM Permissions**: + // + // Requires `storage.objects.create` + // [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on + // the bucket. rpc WriteObject(stream WriteObjectRequest) returns (WriteObjectResponse) {} // Stores a new object and metadata. @@ -324,6 +387,13 @@ service Storage { returns (stream BidiWriteObjectResponse) {} // Retrieves a list of objects matching the criteria. + // + // **IAM Permissions**: + // + // The authenticated user requires `storage.objects.list` + // [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) + // to use this method. To return object ACLs, the authenticated user must also + // have the `storage.objects.getIamPolicy` permission. rpc ListObjects(ListObjectsRequest) returns (ListObjectsResponse) { option (google.api.routing) = { routing_parameters { field: "parent" path_template: "{bucket=**}" } @@ -343,9 +413,19 @@ service Storage { }; } - // Starts a resumable write. How long the write operation remains valid, and - // what happens when the write operation becomes invalid, are - // service-dependent. + // Starts a resumable write operation. This + // method is part of the [Resumable + // upload](https://cloud.google.com/storage/docs/resumable-uploads) feature. + // This allows you to upload large objects in multiple chunks, which is more + // resilient to network interruptions than a single upload. The validity + // duration of the write operation, and the consequences of it becoming + // invalid, are service-dependent. + // + // **IAM Permissions**: + // + // Requires `storage.objects.create` + // [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on + // the bucket. rpc StartResumableWrite(StartResumableWriteRequest) returns (StartResumableWriteResponse) { option (google.api.routing) = { @@ -356,18 +436,22 @@ service Storage { }; } - // Determines the `persisted_size` for an object that is being written, which - // can then be used as the `write_offset` for the next `Write()` call. + // Determines the `persisted_size` of an object that is being written. This + // method is part of the [resumable + // upload](https://cloud.google.com/storage/docs/resumable-uploads) feature. + // The returned value is the size of the object that has been persisted so + // far. The value can be used as the `write_offset` for the next `Write()` + // call. // - // If the object does not exist (i.e., the object has been deleted, or the - // first `Write()` has not yet reached the service), this method returns the + // If the object does not exist, meaning if it was deleted, or the + // first `Write()` has not yet reached the service, this method returns the // error `NOT_FOUND`. // - // The client **may** call `QueryWriteStatus()` at any time to determine how - // much data has been processed for this object. This is useful if the - // client is buffering data and needs to know which data can be safely - // evicted. For any sequence of `QueryWriteStatus()` calls for a given - // object name, the sequence of returned `persisted_size` values will be + // This method is useful for clients that buffer data and need to know which + // data can be safely evicted. The client can call `QueryWriteStatus()` at any + // time to determine how much data has been logged for this object. + // For any sequence of `QueryWriteStatus()` calls for a given + // object name, the sequence of returned `persisted_size` values are // non-decreasing. rpc QueryWriteStatus(QueryWriteStatusRequest) returns (QueryWriteStatusResponse) { @@ -856,6 +940,205 @@ message ReadObjectResponse { Object metadata = 4; } +// Describes the object to read in a BidiReadObject request. +message BidiReadObjectSpec { + // Required. The name of the bucket containing the object to read. + string bucket = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" } + ]; + + // Required. The name of the object to read. + string object = 2 [(google.api.field_behavior) = REQUIRED]; + + // If present, selects a specific revision of this object (as opposed + // to the latest version, the default). + int64 generation = 3; + + // Makes the operation conditional on whether the object's current generation + // matches the given value. Setting to 0 makes the operation succeed only if + // there are no live versions of the object. + optional int64 if_generation_match = 4; + + // Makes the operation conditional on whether the object's live generation + // does not match the given value. If no live object exists, the precondition + // fails. Setting to 0 makes the operation succeed only if there is a live + // version of the object. + optional int64 if_generation_not_match = 5; + + // Makes the operation conditional on whether the object's current + // metageneration matches the given value. + optional int64 if_metageneration_match = 6; + + // Makes the operation conditional on whether the object's current + // metageneration does not match the given value. + optional int64 if_metageneration_not_match = 7; + + // A set of parameters common to Storage API requests concerning an object. + CommonObjectRequestParams common_object_request_params = 8; + + // Mask specifying which fields to read. + // The checksummed_data field and its children will always be present. + // If no mask is specified, will default to all fields except metadata.owner + // and metadata.acl. + // * may be used to mean "all fields". + // As per https://google.aip.dev/161, this field is deprecated. + // As an alternative, grpc metadata can be used: + // https://cloud.google.com/apis/docs/system-parameters#definitions + optional google.protobuf.FieldMask read_mask = 12 [deprecated = true]; + + // The client can optionally set this field. The read handle is an optimized + // way of creating new streams. Read handles are generated and periodically + // refreshed from prior reads. + optional BidiReadHandle read_handle = 13; + + // The routing token that influences request routing for the stream. Must be + // provided if a BidiReadObjectRedirectedError is returned. + optional string routing_token = 14; +} + +// Request message for BidiReadObject. +message BidiReadObjectRequest { + // The first message of each stream should set this field. If this is not + // the first message, an error will be returned. Describes the object to read. + BidiReadObjectSpec read_object_spec = 1; + + // Provides a list of 0 or more (up to 100) ranges to read. If a single range + // is large enough to require multiple responses, they are guaranteed to be + // delivered in increasing offset order. There are no ordering guarantees + // across ranges. When no ranges are provided, the response message will not + // include ObjectRangeData. For full object downloads, the offset and size can + // be set to 0. + repeated ReadRange read_ranges = 8; +} + +// Response message for BidiReadObject. +message BidiReadObjectResponse { + // A portion of the object's data. The service **may** leave data + // empty for any given ReadResponse. This enables the service to inform the + // client that the request is still live while it is running an operation to + // generate more data. + // The service **may** pipeline multiple responses belonging to different read + // requests. Each ObjectRangeData entry will have a read_id + // set to the same value as the corresponding source read request. + repeated ObjectRangeData object_data_ranges = 6; + + // Metadata of the object whose media is being returned. + // Only populated in the first response in the stream and not populated when + // the stream is opened with a read handle. + Object metadata = 4; + + // This field will be periodically refreshed, however it may not be set in + // every response. It allows the client to more efficiently open subsequent + // bidirectional streams to the same object. + BidiReadHandle read_handle = 7; +} + +// Error proto containing details for a redirected read. This error is only +// returned on initial open in case of a redirect. +message BidiReadObjectRedirectedError { + // The read handle for the redirected read. The client can use this for the + // subsequent open. + BidiReadHandle read_handle = 1; + + // The routing token that should be used when reopening the read stream. + optional string routing_token = 2; +} + +// Error proto containing details for a redirected write. This error is only +// returned on initial open in case of a redirect. +message BidiWriteObjectRedirectedError { + // The routing token that should be used when reopening the write stream. + optional string routing_token = 1; + + // Opaque value describing a previous write. + optional BidiWriteHandle write_handle = 2; + + // The generation of the object that triggered the redirect. + // Note that if this error was returned as part of an appendable object + // create, this object generation is now successfully created and + // append_object_spec should be used when reconnecting. + optional int64 generation = 3; +} + +// Error extension proto containing details for all outstanding reads on the +// failed stream +message BidiReadObjectError { + // The error code for each outstanding read_range + repeated ReadRangeError read_range_errors = 1; +} + +// Error extension proto containing details for a single range read +message ReadRangeError { + // The id of the corresponding read_range + int64 read_id = 1; + + // The status which should be an enum value of [google.rpc.Code]. + google.rpc.Status status = 2; +} + +// Describes a range of bytes to read in a BidiReadObjectRanges request. +message ReadRange { + // Required. The offset for the first byte to return in the read, relative to + // the start of the object. + // + // A negative read_offset value will be interpreted as the number of bytes + // back from the end of the object to be returned. For example, if an object's + // length is 15 bytes, a ReadObjectRequest with read_offset = -5 and + // read_length = 3 would return bytes 10 through 12 of the object. Requesting + // a negative offset with magnitude larger than the size of the object will + // return the entire object. A read_offset larger than the size of the object + // will result in an OutOfRange error. + int64 read_offset = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The maximum number of data bytes the server is allowed to return + // across all response messages with the same read_id. A read_length of zero + // indicates to read until the resource end, and a negative read_length will + // cause an error. If the stream returns fewer bytes than allowed by the + // read_length and no error occurred, the stream includes all data from the + // read_offset to the resource end. + int64 read_length = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Read identifier provided by the client. When the client issues + // more than one outstanding ReadRange on the same stream, responses can be + // mapped back to their corresponding requests using this value. Clients must + // ensure that all outstanding requests have different read_id values. The + // server may close the stream with an error if this condition is not met. + int64 read_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Contains data and metadata for a range of an object. +message ObjectRangeData { + // A portion of the data for the object. + ChecksummedData checksummed_data = 1; + + // The ReadRange describes the content being returned with read_id set to the + // corresponding ReadObjectRequest in the stream. Multiple ObjectRangeData + // messages may have the same read_id but increasing offsets. + // ReadObjectResponse messages with the same read_id are guaranteed to be + // delivered in increasing offset order. + ReadRange read_range = 2; + + // If set, indicates there are no more bytes to read for the given ReadRange. + bool range_end = 3; +} + +// BidiReadHandle contains a handle from a previous BiDiReadObject +// invocation. The client can use this instead of BidiReadObjectSpec as an +// optimized way of opening subsequent bidirectional streams to the same object. +message BidiReadHandle { + // Required. Opaque value describing a previous read. + bytes handle = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// BidiWriteHandle contains a handle from a previous BidiWriteObject +// invocation. The client can use this as an optimized way of opening subsequent +// bidirectional streams to the same object. +message BidiWriteHandle { + // Required. Opaque value describing a previous write. + bytes handle = 1 [(google.api.field_behavior) = REQUIRED]; +} + // Describes an attempt to insert an object, possibly over multiple requests. message WriteObjectSpec { // Required. Destination object, including its name and its metadata. @@ -893,6 +1176,10 @@ message WriteObjectSpec { // you must start the upload over from scratch, this time sending the correct // number of bytes. optional int64 object_size = 8; + + // If true, the object will be created in appendable mode. + // This field may only be set when using BidiWriteObject. + optional bool appendable = 9; } // Request message for WriteObject. @@ -962,6 +1249,37 @@ message WriteObjectResponse { } } +// Describes an attempt to append to an object, possibly over multiple requests. +message AppendObjectSpec { + // Required. The name of the bucket containing the object to write. + string bucket = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" } + ]; + + // Required. The name of the object to open for writing. + string object = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The generation number of the object to open for writing. + int64 generation = 3 [(google.api.field_behavior) = REQUIRED]; + + // Makes the operation conditional on whether the object's current + // metageneration matches the given value. + optional int64 if_metageneration_match = 4; + + // Makes the operation conditional on whether the object's current + // metageneration does not match the given value. + optional int64 if_metageneration_not_match = 5; + + // An optional routing token that influences request routing for the stream. + // Must be provided if a BidiWriteObjectRedirectedError is returned. + optional string routing_token = 6; + + // An optional write handle returned from a previous BidiWriteObjectResponse + // message or a BidiWriteObjectRedirectedError error. + optional BidiWriteHandle write_handle = 7; +} + // Request message for BidiWriteObject. message BidiWriteObjectRequest { // The first message of each stream should set one of the following. @@ -973,6 +1291,9 @@ message BidiWriteObjectRequest { // For non-resumable uploads. Describes the overall upload, including the // destination bucket and object name, preconditions, etc. WriteObjectSpec write_object_spec = 2; + + // For appendable uploads. Describes the object to append to. + AppendObjectSpec append_object_spec = 11; } // Required. The offset from the beginning of the object at which the data @@ -1045,6 +1366,11 @@ message BidiWriteObjectResponse { // the upload has finalized. Object resource = 2; } + + // An optional write handle that will periodically be present in response + // messages. Clients should save it for later use in establishing a new stream + // if a connection is interrupted. + optional BidiWriteHandle write_handle = 3; } // Request message for ListObjects. @@ -1390,25 +1716,28 @@ message MoveObjectRequest { // Request message StartResumableWrite. message StartResumableWriteRequest { - // Required. The destination bucket, object, and metadata, as well as any - // preconditions. + // Required. Contains the information necessary to start a resumable write. WriteObjectSpec write_object_spec = 1 [(google.api.field_behavior) = REQUIRED]; - // A set of parameters common to Storage API requests concerning an object. + // A set of parameters common to Storage API requests related to an object. CommonObjectRequestParams common_object_request_params = 3; - // The checksums of the complete object. This will be used to validate the - // uploaded object. For each upload, object_checksums can be provided with - // either StartResumableWriteRequest or the WriteObjectRequest with - // finish_write set to `true`. + // The checksums of the complete object. This is used to validate the + // uploaded object. For each upload, `object_checksums` can be provided when + // initiating a resumable upload with`StartResumableWriteRequest` or when + // completing a write with `WriteObjectRequest` with + // `finish_write` set to `true`. ObjectChecksums object_checksums = 5; } // Response object for `StartResumableWrite`. message StartResumableWriteResponse { - // The upload_id of the newly started resumable write operation. This - // value should be copied into the `WriteObjectRequest.upload_id` field. + // A unique identifier for the initiated resumable write operation. + // As the ID grants write access, you should keep it confidential during + // the upload to prevent unauthorized access and data tampering during your + // upload. This ID should be included in subsequent `WriteObject` requests to + // upload the object data. string upload_id = 1; } From 5dd44503d7b5225959f14b13ac216e34ec351046 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 9 Jan 2025 00:44:11 +0100 Subject: [PATCH 03/19] chore(deps): update storage release dependencies to v2.47.0 (#2868) --- samples/install-without-bom/pom.xml | 6 +++--- samples/snippets/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ad78220d0a..a25af6ea07 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -30,12 +30,12 @@ com.google.cloud google-cloud-storage - 2.46.0 + 2.47.0 com.google.cloud google-cloud-storage-control - 2.46.0 + 2.47.0 @@ -72,7 +72,7 @@ com.google.cloud google-cloud-storage - 2.46.0 + 2.47.0 tests test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 1639090fa8..894cba5fff 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -83,7 +83,7 @@ com.google.cloud google-cloud-storage - 2.46.0 + 2.47.0 tests test From 09ed02995f4688db69c0e0db1c3d72cadce0c395 Mon Sep 17 00:00:00 2001 From: cloud-java-bot <122572305+cloud-java-bot@users.noreply.github.com> Date: Thu, 9 Jan 2025 12:44:58 -0500 Subject: [PATCH 04/19] chore: Update generation configuration at Thu Jan 9 02:34:00 UTC 2025 (#2869) * chore: Update generation configuration at Thu Jan 9 02:34:00 UTC 2025 * chore: generate libraries at Thu Jan 9 02:34:43 UTC 2025 --- README.md | 4 ++-- generation_config.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 58be7d52ed..a5dbb98dbb 100644 --- a/README.md +++ b/README.md @@ -46,12 +46,12 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-storage - 2.46.0 + 2.47.0 com.google.cloud google-cloud-storage-control - 2.46.0 + 2.47.0 ``` diff --git a/generation_config.yaml b/generation_config.yaml index b34efeafbe..50bfa407b2 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,5 +1,5 @@ -gapic_generator_version: 2.51.0 -googleapis_commitish: 130b113520c1b3fffd90f67198681b5fe84de464 +gapic_generator_version: 2.51.1 +googleapis_commitish: 00196e2a68b16a864c57db2e870822875a7f1198 libraries_bom_version: 26.52.0 libraries: - api_shortname: storage From 958c21f9b490e6e8a237fdf1be51781d38917979 Mon Sep 17 00:00:00 2001 From: BenWhitehead Date: Thu, 9 Jan 2025 18:31:01 -0500 Subject: [PATCH 05/19] test: integrate otel into our StorageITRunner (#2862) --- google-cloud-storage/pom.xml | 6 + .../cloud/storage/OtelStorageDecorator.java | 13 +- .../PackagePrivateMethodWorkarounds.java | 19 ++- .../it/runner/registry/BackendResources.java | 8 +- .../it/runner/registry/ObjectsFixture.java | 14 +- .../it/runner/registry/OtelSdkShim.java | 102 ++++++++++++++ .../storage/it/runner/registry/Registry.java | 132 +++++++++++++++--- .../registry/TestRunScopedInstance.java | 61 +++++++- 8 files changed, 311 insertions(+), 44 deletions(-) create mode 100644 google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/OtelSdkShim.java diff --git a/google-cloud-storage/pom.xml b/google-cloud-storage/pom.xml index 7a58a7f30b..53825591a4 100644 --- a/google-cloud-storage/pom.xml +++ b/google-cloud-storage/pom.xml @@ -164,6 +164,12 @@ com.google.cloud.opentelemetry exporter-metrics + + com.google.cloud.opentelemetry + exporter-trace + 0.32.0 + test + io.opentelemetry.contrib diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/OtelStorageDecorator.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/OtelStorageDecorator.java index a281e8257d..2b13fbfb71 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/OtelStorageDecorator.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/OtelStorageDecorator.java @@ -31,6 +31,7 @@ import com.google.cloud.storage.PostPolicyV4.PostConditionsV4; import com.google.cloud.storage.PostPolicyV4.PostFieldsV4; import com.google.cloud.storage.TransportCompatibility.Transport; +import com.google.common.annotations.VisibleForTesting; import io.opentelemetry.api.OpenTelemetry; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.trace.Span; @@ -58,7 +59,7 @@ final class OtelStorageDecorator implements Storage { /** Becomes the {@code otel.scope.name} attribute in a span */ private static final String OTEL_SCOPE_NAME = "cloud.google.com/java/storage"; - private final Storage delegate; + @VisibleForTesting final Storage delegate; private final OpenTelemetry otel; private final Attributes baseAttributes; private final Tracer tracer; @@ -1501,9 +1502,10 @@ public SpanBuilder spanBuilder(String spanName) { } } - private static final class OtelDecoratedReadChannel implements ReadChannel { + @VisibleForTesting + static final class OtelDecoratedReadChannel implements ReadChannel { - private final ReadChannel reader; + @VisibleForTesting final ReadChannel reader; private final Span span; private OtelDecoratedReadChannel(ReadChannel reader, Span span) { @@ -1624,8 +1626,9 @@ public void close() throws IOException { } } - private static final class OtelDecoratedWriteChannel implements WriteChannel { - private final WriteChannel delegate; + @VisibleForTesting + static final class OtelDecoratedWriteChannel implements WriteChannel { + @VisibleForTesting final WriteChannel delegate; private final Span openSpan; private OtelDecoratedWriteChannel(WriteChannel delegate, Span openSpan) { diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/PackagePrivateMethodWorkarounds.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/PackagePrivateMethodWorkarounds.java index 66df95a896..2aba240722 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/PackagePrivateMethodWorkarounds.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/PackagePrivateMethodWorkarounds.java @@ -20,6 +20,8 @@ import com.google.api.core.ApiFutures; import com.google.cloud.ReadChannel; import com.google.cloud.WriteChannel; +import com.google.cloud.storage.OtelStorageDecorator.OtelDecoratedReadChannel; +import com.google.cloud.storage.OtelStorageDecorator.OtelDecoratedWriteChannel; import com.google.common.collect.ImmutableList; import com.google.storage.v2.StorageClient; import java.util.Optional; @@ -49,6 +51,10 @@ public static Blob blobCopyWithStorage(Blob b, Storage s) { public static Function> maybeGetBlobInfoFunction() { return (w) -> { + if (w instanceof OtelDecoratedWriteChannel) { + OtelDecoratedWriteChannel odwc = (OtelDecoratedWriteChannel) w; + w = odwc.delegate; + } if (w instanceof BlobWriteChannelV2) { BlobWriteChannelV2 blobWriteChannel = (BlobWriteChannelV2) w; return Optional.ofNullable(blobWriteChannel.getResolvedObject()) @@ -71,13 +77,16 @@ public static Function> maybeGetBlobInfoFunctio } public static ApiFuture getBlobInfoFromReadChannelFunction(ReadChannel c) { + if (c instanceof OtelDecoratedReadChannel) { + OtelDecoratedReadChannel odrc = (OtelDecoratedReadChannel) c; + c = odrc.reader; + } if (c instanceof StorageReadChannel) { StorageReadChannel src = (StorageReadChannel) c; return src.getObject(); - } else { - return ApiFutures.immediateFailedFuture( - new IllegalStateException("Unsupported ReadChannel Type " + c.getClass().getName())); } + return ApiFutures.immediateFailedFuture( + new IllegalStateException("Unsupported ReadChannel Type " + c.getClass().getName())); } @Nullable @@ -87,6 +96,10 @@ public static StorageClient maybeGetStorageClient(Storage s) { } // handle instances of AbstractStorageProxy Storage service = s.getOptions().getService(); + if (service instanceof OtelStorageDecorator) { + OtelStorageDecorator osd = (OtelStorageDecorator) service; + service = osd.delegate; + } if (service instanceof GrpcStorageImpl) { return ((GrpcStorageImpl) service).storageClient; } diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/BackendResources.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/BackendResources.java index a00d4e616e..012a404a34 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/BackendResources.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/BackendResources.java @@ -83,7 +83,7 @@ public String toString() { } @SuppressWarnings("SwitchStatementWithTooFewBranches") - static BackendResources of(Backend backend) { + static BackendResources of(Backend backend, TestRunScopedInstance otelSdk) { ProtectedBucketNames protectedBucketNames = new ProtectedBucketNames(); TestRunScopedInstance storageJson = TestRunScopedInstance.of( @@ -99,7 +99,8 @@ static BackendResources of(Backend backend) { .setProjectId("test-project-id"); break; default: // PROD, java8 doesn't have exhaustive checking for enum switch - optionsBuilder = StorageOptions.http(); + // Register the exporters with OpenTelemetry + optionsBuilder = StorageOptions.http().setOpenTelemetry(otelSdk.get().get()); break; } HttpStorageOptions built = optionsBuilder.build(); @@ -121,7 +122,8 @@ static BackendResources of(Backend backend) { .setProjectId("test-project-id"); break; default: // PROD, java8 doesn't have exhaustive checking for enum switch - optionsBuilder = StorageOptions.grpc(); + // Register the exporters with OpenTelemetry + optionsBuilder = StorageOptions.grpc().setOpenTelemetry(otelSdk.get().get()); break; } GrpcStorageOptions built = diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/ObjectsFixture.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/ObjectsFixture.java index ed9e4428b7..ef8bbddd10 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/ObjectsFixture.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/ObjectsFixture.java @@ -102,7 +102,8 @@ public void start() { BlobInfo info2 = BlobInfo.newBuilder(blobId2).setMetadata(ImmutableMap.of("pow", "2")).build(); BlobInfo info3 = BlobInfo.newBuilder(blobId3).setMetadata(ImmutableMap.of("pow", "3")).build(); BlobInfo info4 = BlobInfo.newBuilder(blobId4).setMetadata(ImmutableMap.of("pow", "4")).build(); - s.create(info1, "A".getBytes(StandardCharsets.UTF_8), blobTargetOptions); + this.info1 = + s.create(info1, "A".getBytes(StandardCharsets.UTF_8), blobTargetOptions).asBlobInfo(); ComposeRequest c2 = ComposeRequest.newBuilder() @@ -122,14 +123,9 @@ public void start() { .setTarget(info4) .setTargetOptions(blobTargetOptions) .build(); - s.compose(c2); - s.compose(c3); - s.compose(c4); - - this.info1 = s.get(blobId1, blobGetOptions).asBlobInfo(); - this.info2 = s.get(blobId2, blobGetOptions).asBlobInfo(); - this.info3 = s.get(blobId3, blobGetOptions).asBlobInfo(); - this.info4 = s.get(blobId4, blobGetOptions).asBlobInfo(); + this.info2 = s.compose(c2).asBlobInfo(); + this.info3 = s.compose(c3).asBlobInfo(); + this.info4 = s.compose(c4).asBlobInfo(); byte[] bytes = DataGenerator.base64Characters().genBytes(512 * 1024); Blob obj512KiB = diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/OtelSdkShim.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/OtelSdkShim.java new file mode 100644 index 0000000000..f2ea10bce5 --- /dev/null +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/OtelSdkShim.java @@ -0,0 +1,102 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.google.cloud.storage.it.runner.registry; + +import com.google.cloud.opentelemetry.metric.GoogleCloudMetricExporter; +import com.google.cloud.opentelemetry.metric.MetricConfiguration; +import com.google.cloud.opentelemetry.trace.TraceConfiguration; +import com.google.cloud.opentelemetry.trace.TraceExporter; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.metrics.SdkMeterProvider; +import io.opentelemetry.sdk.metrics.export.MetricExporter; +import io.opentelemetry.sdk.metrics.export.PeriodicMetricReader; +import io.opentelemetry.sdk.trace.SdkTracerProvider; +import io.opentelemetry.sdk.trace.export.BatchSpanProcessor; +import io.opentelemetry.sdk.trace.export.SpanExporter; +import io.opentelemetry.sdk.trace.samplers.Sampler; +import java.time.Duration; +import java.util.Arrays; + +public final class OtelSdkShim implements ManagedLifecycle { + private static final boolean STORAGE_IT_OTEL_ENABLE = + Arrays.asList( + System.getProperty("STORAGE_IT_OTEL_ENABLE"), System.getenv("STORAGE_IT_OTEL_ENABLE")) + .contains("true"); + private final String projectId; + + private OpenTelemetrySdk otelSdk; + + OtelSdkShim(String projectId) { + this.projectId = projectId; + } + + @Override + public OpenTelemetry get() { + if (otelSdk == null) { + return OpenTelemetry.noop(); + } + return otelSdk; + } + + @Override + public void start() { + if (!STORAGE_IT_OTEL_ENABLE) { + otelSdk = null; + return; + } + MetricConfiguration metricConfiguration = + MetricConfiguration.builder() + .setProjectId(projectId) + .setDeadline(Duration.ofSeconds(30)) + .build(); + TraceConfiguration traceConfiguration = + TraceConfiguration.builder() + .setProjectId(projectId) + .setDeadline(Duration.ofSeconds(30)) + .build(); + MetricExporter metricExporter = + GoogleCloudMetricExporter.createWithConfiguration(metricConfiguration); + SpanExporter spanExporter = TraceExporter.createWithConfiguration(traceConfiguration); + + SdkMeterProvider meterProvider = + SdkMeterProvider.builder() + .registerMetricReader( + PeriodicMetricReader.builder(metricExporter) + .setInterval(Duration.ofSeconds(60)) + .build()) + .build(); + SdkTracerProvider tracerProvider = + SdkTracerProvider.builder() + .setSampler(Sampler.traceIdRatioBased(1.0)) + .addSpanProcessor( + BatchSpanProcessor.builder(spanExporter).setMeterProvider(meterProvider).build()) + .build(); + otelSdk = + OpenTelemetrySdk.builder() + .setTracerProvider(tracerProvider) + .setMeterProvider(meterProvider) + .build(); + } + + @Override + public void stop() { + if (otelSdk != null) { + otelSdk.close(); + } + } +} diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/Registry.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/Registry.java index e8c43b20f0..cf0a3cb899 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/Registry.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/Registry.java @@ -16,11 +16,13 @@ package com.google.cloud.storage.it.runner.registry; +import com.google.cloud.storage.StorageOptions; import com.google.cloud.storage.TransportCompatibility.Transport; import com.google.cloud.storage.it.runner.CrossRunIntersection; import com.google.cloud.storage.it.runner.TestInitializer; import com.google.cloud.storage.it.runner.annotations.Backend; import com.google.cloud.storage.it.runner.annotations.Inject; +import com.google.cloud.storage.it.runner.annotations.SingleBackend; import com.google.cloud.storage.it.runner.annotations.StorageFixture; import com.google.common.base.Joiner; import com.google.common.collect.ImmutableList; @@ -28,6 +30,12 @@ import com.google.common.util.concurrent.ListeningScheduledExecutorService; import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.ThreadFactoryBuilder; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.trace.Span; +import io.opentelemetry.api.trace.StatusCode; +import io.opentelemetry.api.trace.Tracer; +import io.opentelemetry.context.Scope; +import java.util.Arrays; import java.util.List; import java.util.Optional; import java.util.concurrent.Executors; @@ -70,16 +78,26 @@ public final class Registry extends RunListener { private final TestRunScopedInstance generator = TestRunScopedInstance.of("GENERATOR", Generator::new); - private final BackendResources prodBackendResources = BackendResources.of(Backend.PROD); - private final BackendResources testBenchBackendResource = BackendResources.of(Backend.TEST_BENCH); + final TestRunScopedInstance otelSdk = + TestRunScopedInstance.of( + "OTEL_SDK", + () -> { + String projectId = StorageOptions.getDefaultInstance().getProjectId(); + return new OtelSdkShim(projectId); + }); + + private final BackendResources prodBackendResources = BackendResources.of(Backend.PROD, otelSdk); + private final BackendResources testBenchBackendResource = + BackendResources.of(Backend.TEST_BENCH, otelSdk); private final ImmutableList> entries = new ImmutableList.Builder>() .add( - RegistryEntry.of(0, TestBench.class, testBench), - RegistryEntry.of(1, Generator.class, generator), - registryEntry(2, Backend.class, CrossRunIntersection::getBackend), - registryEntry(3, Transport.class, CrossRunIntersection::getTransport)) + RegistryEntry.of(0, OpenTelemetry.class, otelSdk), + RegistryEntry.of(1, TestBench.class, testBench), + RegistryEntry.of(2, Generator.class, generator), + registryEntry(3, Backend.class, CrossRunIntersection::getBackend), + registryEntry(4, Transport.class, CrossRunIntersection::getTransport)) .addAll(prodBackendResources.getRegistryEntries()) .addAll(testBenchBackendResource.getRegistryEntries()) .build(); @@ -87,7 +105,23 @@ public final class Registry extends RunListener { private final ImmutableSet> injectableTypes = entries.stream().map(RegistryEntry::getType).collect(ImmutableSet.toImmutableSet()); private final String injectableTypesString = Joiner.on("|").join(injectableTypes); - private final ThreadLocal currentTest = new ThreadLocal<>(); + private final ThreadLocal currentTest = new ThreadLocal<>(); + + private static final class CurrentTest { + private final Description desc; + private final Span span; + private final Scope scope; + + private CurrentTest(Description desc, Span span, Scope scope) { + this.desc = desc; + this.span = span; + this.scope = scope; + } + + public static CurrentTest of(Description desc, Span span, Scope scope) { + return new CurrentTest(desc, span, scope); + } + } private Registry() {} @@ -117,17 +151,38 @@ TestBench testBench() { @Nullable public Description getCurrentTest() { - return currentTest.get(); + return currentTest.get().desc; } @Override public void testStarted(Description description) { - currentTest.set(description); + OpenTelemetry sdk; + if (description.getDisplayName().contains("[TEST_BENCH]") + || isClassAnnotatedSingleBackendTestBench(description) + || Arrays.stream(description.getTestClass().getDeclaredFields()) + .anyMatch(field -> field.getType() == TestBench.class)) { + sdk = OpenTelemetry.noop(); + } else { + sdk = otelSdk.get().get(); + } + + Tracer tracer = sdk.getTracer("test"); + Span span = + tracer + .spanBuilder( + String.format("%s/%s", description.getClassName(), description.getMethodName())) + .setAttribute("service.name", "test") + .startSpan(); + Scope scope = span.makeCurrent(); + currentTest.set(CurrentTest.of(description, span, scope)); } @Override public void testFinished(Description description) { - currentTest.remove(); + CurrentTest currentTest = this.currentTest.get(); + currentTest.scope.close(); + currentTest.span.end(); + this.currentTest.remove(); } public RunnerScheduler parallelScheduler() { @@ -182,16 +237,40 @@ public Object resolve(FrameworkField ff, CrossRunIntersection crossRunIntersecti // private volatile ListenableFuture shutdownF; private void shutdown() { - entries.stream() - .sorted() - .forEach( - re -> { - try { - re.getInstance().shutdown(); - } catch (Exception e) { - throw new RuntimeException(e); - } - }); + Span span = + otelSdk + .get() + .get() + .getTracer("registry") + .spanBuilder("registry/shutdown") + .setAttribute("service.name", "registry") + .startSpan(); + try (Scope ignore = span.makeCurrent()) { + entries.stream() + .sorted() + .filter(e -> e.getShutdownPriority() > 0) + .forEach( + re -> { + try { + re.getInstance().shutdown(); + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } catch (Throwable t) { + span.recordException(t); + span.setStatus(StatusCode.ERROR, t.getClass().getSimpleName()); + throw t; + } finally { + span.end(); + try { + // manually shutdown otelSdk so that the previous span can be recorded as ending + otelSdk.shutdown(); + } catch (Exception e) { + //noinspection ThrowFromFinallyBlock + throw new RuntimeException(e); + } + } } @FunctionalInterface @@ -226,4 +305,17 @@ private static RegistryEntry registryEntry( private static StatelessManagedLifecycle lift(Function f) { return (ff, cell) -> f.apply(cell); } + + private static boolean isClassAnnotatedSingleBackendTestBench(Description description) { + return Arrays.stream(description.getTestClass().getAnnotations()) + .anyMatch( + a -> { + if (a instanceof SingleBackend) { + SingleBackend sb = (SingleBackend) a; + return sb.value() == Backend.TEST_BENCH; + } else { + return false; + } + }); + } } diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/TestRunScopedInstance.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/TestRunScopedInstance.java index d2a6e34ca3..a503b0674b 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/TestRunScopedInstance.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/TestRunScopedInstance.java @@ -17,6 +17,9 @@ package com.google.cloud.storage.it.runner.registry; import com.google.common.base.MoreObjects; +import io.opentelemetry.api.trace.Span; +import io.opentelemetry.api.trace.StatusCode; +import io.opentelemetry.context.Scope; import java.util.function.Supplier; import org.junit.runner.notification.RunListener.ThreadSafe; @@ -40,13 +43,42 @@ static TestRunScopedInstance of(String name, Sup return new TestRunScopedInstance<>(name, ctor); } + public String getName() { + return name; + } + public T get() { if (instance == null) { synchronized (this) { if (instance == null) { - T tmp = ctor.get(); - tmp.start(); - instance = tmp; + // if we don't short-circuit for OTEL_SDK we will cause a stack overflow, because we would + // be trying to get our instance to record that we're starting our instance. + if (name.equals("OTEL_SDK")) { + T tmp = ctor.get(); + tmp.start(); + instance = tmp; + } else { + Span span = + Registry.getInstance() + .otelSdk + .get() + .get() + .getTracer("test") + .spanBuilder("registry/" + name + "/start") + .setAttribute("service.name", "registry") + .startSpan(); + try (Scope ignore = span.makeCurrent()) { + T tmp = ctor.get(); + tmp.start(); + instance = tmp; + } catch (Throwable t) { + span.recordException(t); + span.setStatus(StatusCode.ERROR, t.getClass().getSimpleName()); + throw t; + } finally { + span.end(); + } + } } } } @@ -59,7 +91,28 @@ public void shutdown() throws Exception { synchronized (this) { instance = null; } - tmp.stop(); + if (name.equals("OTEL_SDK")) { + tmp.stop(); + } else { + Span span = + Registry.getInstance() + .otelSdk + .get() + .get() + .getTracer("test") + .spanBuilder("registry/" + name + "/stop") + .setAttribute("service.name", "registry") + .startSpan(); + try (Scope ignore = span.makeCurrent()) { + tmp.stop(); + } catch (Throwable t) { + span.recordException(t); + span.setStatus(StatusCode.ERROR, t.getClass().getSimpleName()); + throw t; + } finally { + span.end(); + } + } } } From 4f34f7d26ce4c21d0128e22e288a1f534f520246 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 10 Jan 2025 17:19:28 +0100 Subject: [PATCH 06/19] test(deps): update cross product test dependencies (#2875) --- google-cloud-storage/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-storage/pom.xml b/google-cloud-storage/pom.xml index 53825591a4..bf64ee6056 100644 --- a/google-cloud-storage/pom.xml +++ b/google-cloud-storage/pom.xml @@ -239,14 +239,14 @@ com.google.api.grpc proto-google-cloud-kms-v1 - 0.149.0 + 0.150.0 test com.google.cloud google-cloud-kms - 2.58.0 + 2.59.0 test From 39509d53ee283694526efbec58daa24c3d8ca080 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 10 Jan 2025 17:46:20 +0100 Subject: [PATCH 07/19] deps: update dependency com.google.cloud.opentelemetry:exporter-trace to v0.33.0 (#2873) --- google-cloud-storage/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-cloud-storage/pom.xml b/google-cloud-storage/pom.xml index bf64ee6056..0c9b0f0d26 100644 --- a/google-cloud-storage/pom.xml +++ b/google-cloud-storage/pom.xml @@ -167,7 +167,7 @@ com.google.cloud.opentelemetry exporter-trace - 0.32.0 + 0.33.0 test From 1b74ecf68eb9ea1b1bb00d1c236f2fdb5e507995 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 13 Jan 2025 16:57:07 +0100 Subject: [PATCH 08/19] test(deps): update cross product test dependencies (#2877) --- google-cloud-storage/pom.xml | 2 +- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-storage/pom.xml b/google-cloud-storage/pom.xml index 0c9b0f0d26..397556a367 100644 --- a/google-cloud-storage/pom.xml +++ b/google-cloud-storage/pom.xml @@ -16,7 +16,7 @@ google-cloud-storage - 1.117.0 + 1.118.0 diff --git a/pom.xml b/pom.xml index 3e71183a23..41e60719fe 100644 --- a/pom.xml +++ b/pom.xml @@ -133,7 +133,7 @@ com.google.cloud google-cloud-pubsub - 1.135.0 + 1.136.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index a25af6ea07..97ed84332d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -66,7 +66,7 @@ com.google.cloud google-cloud-pubsub - 1.135.0 + 1.136.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 848585e941..8d6c764a05 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -58,7 +58,7 @@ com.google.cloud google-cloud-pubsub - 1.135.0 + 1.136.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 894cba5fff..47401724fb 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -76,7 +76,7 @@ com.google.cloud google-cloud-pubsub - 1.135.0 + 1.136.0 test From 7ae7e3998930c1bec72ff7c06ebc2b66343852ca Mon Sep 17 00:00:00 2001 From: BenWhitehead Date: Tue, 14 Jan 2025 11:40:30 -0500 Subject: [PATCH 09/19] fix: update Signed URL default scheme to resolve from storage options host (#2880) Fixes #2870 --- .../com/google/cloud/storage/StorageImpl.java | 19 ++++++++------- .../cloud/storage/it/ITSignedUrlTest.java | 24 +++++++++++++++++++ 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageImpl.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageImpl.java index ee538bcde8..efb627459b 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageImpl.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageImpl.java @@ -72,6 +72,7 @@ import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import java.net.URLEncoder; import java.nio.ByteBuffer; @@ -104,15 +105,9 @@ final class StorageImpl extends BaseService implements Storage, private static final String EMPTY_BYTE_ARRAY_MD5 = "1B2M2Y8AsgTpgAmY7PhCfg=="; private static final String EMPTY_BYTE_ARRAY_CRC32C = "AAAAAA=="; private static final String PATH_DELIMITER = "/"; - /** Signed URLs are only supported through the GCS XML API endpoint. */ - private static final String STORAGE_XML_URI_SCHEME = "https"; - // TODO: in the future, this can be replaced by getOptions().getHost() - private final String STORAGE_XML_URI_HOST_NAME = - getOptions() - .getResolvedApiaryHost("storage") - .replaceFirst("http(s)?://", "") - .replace("/", ""); + private final String STORAGE_XML_URI_SCHEME; + private final String STORAGE_XML_URI_HOST_NAME; private static final int DEFAULT_BUFFER_SIZE = 15 * 1024 * 1024; private static final int MIN_BUFFER_SIZE = 256 * 1024; @@ -128,6 +123,14 @@ final class StorageImpl extends BaseService implements Storage, this.retryAlgorithmManager = options.getRetryAlgorithmManager(); this.storageRpc = options.getStorageRpcV1(); this.writerFactory = writerFactory; + try { + String resolvedApiaryHost = options.getResolvedApiaryHost("storage"); + URI uri = new URI(resolvedApiaryHost); + STORAGE_XML_URI_HOST_NAME = uri.getHost(); + STORAGE_XML_URI_SCHEME = firstNonNull(uri.getScheme(), "https"); + } catch (URISyntaxException e) { + throw StorageException.coalesce(e); + } } @Override diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITSignedUrlTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITSignedUrlTest.java index 89dcbb1bf2..abef72a5b9 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITSignedUrlTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITSignedUrlTest.java @@ -16,6 +16,8 @@ package com.google.cloud.storage.it; +import static com.google.cloud.storage.TestUtils.assertAll; +import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -33,6 +35,7 @@ import com.google.cloud.storage.PostPolicyV4; import com.google.cloud.storage.PostPolicyV4.PostFieldsV4; import com.google.cloud.storage.Storage; +import com.google.cloud.storage.Storage.SignUrlOption; import com.google.cloud.storage.StorageOptions; import com.google.cloud.storage.TransportCompatibility.Transport; import com.google.cloud.storage.it.runner.StorageITRunner; @@ -45,6 +48,7 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import java.net.URI; import java.net.URL; import java.net.URLConnection; import java.nio.ByteBuffer; @@ -261,4 +265,24 @@ public void testUploadUsingSignedURL() throws Exception { assertTrue(storage.delete(bucketName, blobName)); } } + + @Test + public void generatingSignedURLForHttpProducesTheCorrectScheme() throws Exception { + StorageOptions options = + storage.getOptions().toBuilder().setHost("http://[::1]").setProjectId("no-project").build(); + try (Storage s = options.getService()) { + BlobInfo info = BlobInfo.newBuilder("no-bucket", "no-object").build(); + URL urlV2 = s.signUrl(info, 5, TimeUnit.MINUTES, SignUrlOption.withV2Signature()); + URL urlV4 = s.signUrl(info, 5, TimeUnit.MINUTES, SignUrlOption.withV4Signature()); + URI uriV2 = urlV2.toURI(); + URI uriV4 = urlV4.toURI(); + assertAll( + () -> assertThat(uriV2.getScheme()).isEqualTo("http"), + () -> assertThat(uriV2.getHost()).isEqualTo("[::1]"), + () -> assertThat(uriV2.getPath()).contains("no-bucket/no-object"), + () -> assertThat(uriV4.getScheme()).isEqualTo("http"), + () -> assertThat(uriV4.getHost()).isEqualTo("[::1]"), + () -> assertThat(uriV4.getPath()).contains("no-bucket/no-object")); + } + } } From a64a3d58410dd2e9db20a36cd7169037f71eaeeb Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 15 Jan 2025 23:11:35 +0100 Subject: [PATCH 10/19] deps: update gcr.io/cloud-devrel-public-resources/storage-testbench docker tag to v0.52.0 (#2883) --- .../com/google/cloud/storage/it/runner/registry/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-cloud-storage/src/test/resources/com/google/cloud/storage/it/runner/registry/Dockerfile b/google-cloud-storage/src/test/resources/com/google/cloud/storage/it/runner/registry/Dockerfile index 0c005975bb..dfde7c9655 100644 --- a/google-cloud-storage/src/test/resources/com/google/cloud/storage/it/runner/registry/Dockerfile +++ b/google-cloud-storage/src/test/resources/com/google/cloud/storage/it/runner/registry/Dockerfile @@ -1 +1 @@ -FROM gcr.io/cloud-devrel-public-resources/storage-testbench:v0.51.0 +FROM gcr.io/cloud-devrel-public-resources/storage-testbench:v0.52.0 From e80d2e00df3b310a6ea03c321473fbbd9711686a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 16 Jan 2025 19:07:14 +0100 Subject: [PATCH 11/19] chore(deps): update dependency com.google.cloud:libraries-bom to v26.53.0 (#2886) --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 47401724fb..3351625753 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -31,7 +31,7 @@ com.google.cloud libraries-bom - 26.52.0 + 26.53.0 pom import From c6a9fe3d16b36bf59107fe9a4ec44211190d8f02 Mon Sep 17 00:00:00 2001 From: cloud-java-bot <122572305+cloud-java-bot@users.noreply.github.com> Date: Tue, 21 Jan 2025 19:18:18 -0500 Subject: [PATCH 12/19] chore: Update generation configuration at Tue Jan 21 02:20:38 UTC 2025 (#2888) --- README.md | 4 ++-- generation_config.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a5dbb98dbb..017d2d7435 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.52.0 + 26.53.0 pom import @@ -59,7 +59,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.52.0') +implementation platform('com.google.cloud:libraries-bom:26.53.0') implementation 'com.google.cloud:google-cloud-storage' ``` diff --git a/generation_config.yaml b/generation_config.yaml index 50bfa407b2..efa72100e4 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,6 +1,6 @@ gapic_generator_version: 2.51.1 -googleapis_commitish: 00196e2a68b16a864c57db2e870822875a7f1198 -libraries_bom_version: 26.52.0 +googleapis_commitish: 318818b22ec2bd44ebe43fe662418b7dff032abf +libraries_bom_version: 26.53.0 libraries: - api_shortname: storage name_pretty: Cloud Storage From 8933d603cf1d51b4ff0d0d2a8aa7a31225fdb99d Mon Sep 17 00:00:00 2001 From: BenWhitehead Date: Tue, 21 Jan 2025 19:18:50 -0500 Subject: [PATCH 13/19] test: make registry fixture names more "name~spacy" to appear better in otel traces (#2879) --- .../storage/it/ITUniverseDomainTest.java | 5 ++++ .../it/runner/registry/BackendResources.java | 23 ++++++++++--------- .../storage/it/runner/registry/Registry.java | 6 ++--- .../registry/TestRunScopedInstance.java | 2 +- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITUniverseDomainTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITUniverseDomainTest.java index ede5d1a088..a0fc1a1fab 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITUniverseDomainTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITUniverseDomainTest.java @@ -18,6 +18,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; +import static org.junit.Assume.assumeNotNull; import com.google.auth.oauth2.GoogleCredentials; import com.google.auth.oauth2.ServiceAccountCredentials; @@ -43,6 +44,10 @@ public class ITUniverseDomainTest { @BeforeClass public static void setUp() throws Exception { + assumeNotNull(TEST_UNIVERSE_DOMAIN); + assumeNotNull(TEST_PROJECT_ID); + assumeNotNull(TEST_UNIVERSE_LOCATION); + assumeNotNull(CREDENTIAL_PATH); GoogleCredentials creds = ServiceAccountCredentials.fromStream(Files.newInputStream(Paths.get(CREDENTIAL_PATH))) .toBuilder() diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/BackendResources.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/BackendResources.java index 012a404a34..c2193bf589 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/BackendResources.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/BackendResources.java @@ -87,7 +87,7 @@ static BackendResources of(Backend backend, TestRunScopedInstance o ProtectedBucketNames protectedBucketNames = new ProtectedBucketNames(); TestRunScopedInstance storageJson = TestRunScopedInstance.of( - "STORAGE_JSON_" + backend.name(), + "fixture/STORAGE/[JSON][" + backend.name() + "]", () -> { HttpStorageOptions.Builder optionsBuilder; switch (backend) { @@ -108,7 +108,7 @@ static BackendResources of(Backend backend, TestRunScopedInstance o }); TestRunScopedInstance storageGrpc = TestRunScopedInstance.of( - "STORAGE_GRPC_" + backend.name(), + "fixture/STORAGE/[GRPC][" + backend.name() + "]", () -> { GrpcStorageOptions.Builder optionsBuilder; switch (backend) { @@ -137,7 +137,7 @@ static BackendResources of(Backend backend, TestRunScopedInstance o }); TestRunScopedInstance ctrl = TestRunScopedInstance.of( - "STORAGE_CONTROL_" + backend.name(), + "fixture/STORAGE_CONTROL/[" + backend.name() + "]", () -> { StorageControlSettings.Builder builder; switch (backend) { @@ -176,7 +176,7 @@ static BackendResources of(Backend backend, TestRunScopedInstance o }); TestRunScopedInstance bucket = TestRunScopedInstance.of( - "BUCKET_" + backend.name(), + "fixture/BUCKET/[" + backend.name() + "]", () -> { String bucketName = String.format("java-storage-grpc-%s", UUID.randomUUID()); protectedBucketNames.add(bucketName); @@ -185,7 +185,7 @@ static BackendResources of(Backend backend, TestRunScopedInstance o }); TestRunScopedInstance bucketRp = TestRunScopedInstance.of( - "BUCKET_REQUESTER_PAYS_" + backend.name(), + "fixture/BUCKET/[" + backend.name() + "]/REQUESTER_PAYS", () -> { String bucketName = String.format("java-storage-grpc-rp-%s", UUID.randomUUID()); protectedBucketNames.add(bucketName); @@ -196,7 +196,7 @@ static BackendResources of(Backend backend, TestRunScopedInstance o }); TestRunScopedInstance bucketVersioned = TestRunScopedInstance.of( - "BUCKET_VERSIONED_" + backend.name(), + "fixture/BUCKET/[" + backend.name() + "]/VERSIONED", () -> { String bucketName = String.format("java-storage-grpc-v-%s", UUID.randomUUID()); protectedBucketNames.add(bucketName); @@ -207,7 +207,7 @@ static BackendResources of(Backend backend, TestRunScopedInstance o }); TestRunScopedInstance bucketHns = TestRunScopedInstance.of( - "BUCKET_HNS_" + backend.name(), + "fixture/BUCKET/[" + backend.name() + "]/HNS", () -> { String bucketName = String.format("java-storage-grpc-hns-%s", UUID.randomUUID()); protectedBucketNames.add(bucketName); @@ -225,22 +225,23 @@ static BackendResources of(Backend backend, TestRunScopedInstance o }); TestRunScopedInstance objectsFixture = TestRunScopedInstance.of( - "OBJECTS_FIXTURE_" + backend.name(), + "fixture/OBJECTS/[" + backend.name() + "]", () -> new ObjectsFixture(storageJson.get().getStorage(), bucket.get().getBucketInfo())); TestRunScopedInstance objectsFixtureRp = TestRunScopedInstance.of( - "OBJECTS_FIXTURE_REQUESTER_PAYS_" + backend.name(), + "fixture/OBJECTS/[" + backend.name() + "]/REQUESTER_PAYS", () -> new ObjectsFixture(storageJson.get().getStorage(), bucketRp.get().getBucketInfo())); TestRunScopedInstance objectsFixtureHns = TestRunScopedInstance.of( - "OBJECTS_FIXTURE_HNS_" + backend.name(), + "fixture/OBJECTS/[" + backend.name() + "]/HNS", () -> new ObjectsFixture( storageJson.get().getStorage(), bucketHns.get().getBucketInfo())); TestRunScopedInstance kmsFixture = TestRunScopedInstance.of( - "KMS_FIXTURE_" + backend.name(), () -> KmsFixture.of(storageJson.get().getStorage())); + "fixture/KMS/[" + backend.name() + "]", + () -> KmsFixture.of(storageJson.get().getStorage())); return new BackendResources( backend, diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/Registry.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/Registry.java index cf0a3cb899..23b15f0cd1 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/Registry.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/Registry.java @@ -73,14 +73,14 @@ public final class Registry extends RunListener { new ThreadFactoryBuilder().setDaemon(true).setNameFormat("test-run-%d").build())); private final TestRunScopedInstance testBench = - TestRunScopedInstance.of("TEST_BENCH", () -> TestBench.newBuilder().build()); + TestRunScopedInstance.of("fixture/TEST_BENCH", () -> TestBench.newBuilder().build()); private final TestRunScopedInstance generator = - TestRunScopedInstance.of("GENERATOR", Generator::new); + TestRunScopedInstance.of("fixture/GENERATOR", Generator::new); final TestRunScopedInstance otelSdk = TestRunScopedInstance.of( - "OTEL_SDK", + "fixture/OTEL_SDK", () -> { String projectId = StorageOptions.getDefaultInstance().getProjectId(); return new OtelSdkShim(projectId); diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/TestRunScopedInstance.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/TestRunScopedInstance.java index a503b0674b..5112a38257 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/TestRunScopedInstance.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/TestRunScopedInstance.java @@ -53,7 +53,7 @@ public T get() { if (instance == null) { // if we don't short-circuit for OTEL_SDK we will cause a stack overflow, because we would // be trying to get our instance to record that we're starting our instance. - if (name.equals("OTEL_SDK")) { + if (name.equals("fixture/OTEL_SDK")) { T tmp = ctor.get(); tmp.start(); instance = tmp; From ce00122de381c9d513a16c19876acefd28d5fd3e Mon Sep 17 00:00:00 2001 From: BenWhitehead Date: Tue, 21 Jan 2025 19:20:45 -0500 Subject: [PATCH 14/19] test: fix HttpRpcContextTest to not attempt environment credentials resolution (#2876) --- .../com/google/cloud/storage/spi/v1/HttpRpcContextTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/spi/v1/HttpRpcContextTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/spi/v1/HttpRpcContextTest.java index 3e8b295bda..bb049137bf 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/spi/v1/HttpRpcContextTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/spi/v1/HttpRpcContextTest.java @@ -21,6 +21,7 @@ import static org.junit.Assert.assertTrue; import com.google.api.client.testing.http.MockLowLevelHttpResponse; +import com.google.cloud.NoCredentials; import com.google.cloud.TransportOptions; import com.google.cloud.Tuple; import com.google.cloud.WriteChannel; @@ -66,6 +67,8 @@ public void testInvocationIdIsPassedThrough() { Storage service = StorageOptions.getDefaultInstance() .toBuilder() + .setProjectId("test-project") + .setCredentials(NoCredentials.getInstance()) .setTransportOptions(transportOptions) .build() .getService(); From 34e5903df9b7221ba9ebabc07046d7b819f9f209 Mon Sep 17 00:00:00 2001 From: ldetmer <1771267+ldetmer@users.noreply.github.com> Date: Wed, 22 Jan 2025 18:26:51 +0000 Subject: [PATCH 15/19] feat: next release from main branch is 2.48.0 (#2885) --- .github/release-please.yml | 7 +++++++ .github/sync-repo-settings.yaml | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/.github/release-please.yml b/.github/release-please.yml index 1b56aa4310..7341462432 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -52,3 +52,10 @@ branches: - README.md - .readme-partials.yaml branch: 2.38.x + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-backport + extraFiles: + - README.md + - .readme-partials.yaml + branch: 2.47.x diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 3336e9eeeb..b41763405f 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -163,6 +163,23 @@ branchProtectionRules: - 'Kokoro - Test: Java GraalVM Native Image' - 'Kokoro - Test: Java 17 GraalVM Native Image' - javadoc + - pattern: 2.47.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (17) + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - 'Kokoro - Test: Java GraalVM Native Image' + - 'Kokoro - Test: Java 17 GraalVM Native Image' + - javadoc + - unmanaged_dependency_check permissionRules: - team: yoshi-admins permission: admin From c49fd08582c7235919270c1dd4eb2ece6933d302 Mon Sep 17 00:00:00 2001 From: BenWhitehead Date: Wed, 22 Jan 2025 14:49:17 -0500 Subject: [PATCH 16/19] feat: add new Storage#moveBlob method to atomically rename an object (#2882) --- .../clirr-ignored-differences.xml | 11 ++ .../storage/GrpcRetryAlgorithmManager.java | 7 + .../google/cloud/storage/GrpcStorageImpl.java | 26 +++ .../storage/HttpRetryAlgorithmManager.java | 9 + .../cloud/storage/OtelStorageDecorator.java | 19 +++ .../com/google/cloud/storage/Storage.java | 158 ++++++++++++++++++ .../com/google/cloud/storage/StorageImpl.java | 21 +++ .../com/google/cloud/storage/UnifiedOpts.java | 85 ++++++++++ .../cloud/storage/spi/v1/HttpStorageRpc.java | 37 ++++ .../cloud/storage/spi/v1/StorageRpc.java | 7 + .../storage/testing/StorageRpcTestBase.java | 10 ++ .../cloud/storage/it/ITFoldersTest.java | 43 ++++- .../runner/registry/AbstractStorageProxy.java | 5 + 13 files changed, 436 insertions(+), 2 deletions(-) diff --git a/google-cloud-storage/clirr-ignored-differences.xml b/google-cloud-storage/clirr-ignored-differences.xml index 0b19230fdd..060db7c33f 100644 --- a/google-cloud-storage/clirr-ignored-differences.xml +++ b/google-cloud-storage/clirr-ignored-differences.xml @@ -108,5 +108,16 @@ io.opentelemetry.api.OpenTelemetry getOpenTelemetry() + + + 7012 + com/google/cloud/storage/Storage + * moveBlob(*) + + + 7012 + com/google/cloud/storage/spi/v1/StorageRpc + * moveObject(*) + diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcRetryAlgorithmManager.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcRetryAlgorithmManager.java index d8a126c956..ef125fa4e2 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcRetryAlgorithmManager.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcRetryAlgorithmManager.java @@ -32,6 +32,7 @@ import com.google.storage.v2.ListBucketsRequest; import com.google.storage.v2.ListObjectsRequest; import com.google.storage.v2.LockBucketRetentionPolicyRequest; +import com.google.storage.v2.MoveObjectRequest; import com.google.storage.v2.QueryWriteStatusRequest; import com.google.storage.v2.ReadObjectRequest; import com.google.storage.v2.RestoreObjectRequest; @@ -124,6 +125,12 @@ public ResultRetryAlgorithm getFor(RewriteObjectRequest req) { : retryStrategy.getNonidempotentHandler(); } + public ResultRetryAlgorithm getFor(MoveObjectRequest req) { + return req.hasIfGenerationMatch() + ? retryStrategy.getIdempotentHandler() + : retryStrategy.getNonidempotentHandler(); + } + public ResultRetryAlgorithm getFor(SetIamPolicyRequest req) { if (req.getPolicy().getEtag().equals(ByteString.empty())) { return retryStrategy.getNonidempotentHandler(); diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageImpl.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageImpl.java index 428f85bc73..69781270b0 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageImpl.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageImpl.java @@ -90,6 +90,7 @@ import com.google.storage.v2.ListObjectsRequest; import com.google.storage.v2.ListObjectsResponse; import com.google.storage.v2.LockBucketRetentionPolicyRequest; +import com.google.storage.v2.MoveObjectRequest; import com.google.storage.v2.Object; import com.google.storage.v2.ObjectAccessControl; import com.google.storage.v2.ReadObjectRequest; @@ -1418,6 +1419,31 @@ public BlobWriteSession blobWriteSession(BlobInfo info, BlobWriteOption... optio return BlobWriteSessions.of(writableByteChannelSession); } + @Override + public Blob moveBlob(MoveBlobRequest request) { + Object srcObj = codecs.blobId().encode(request.getSource()); + Object dstObj = codecs.blobId().encode(request.getTarget()); + Opts srcOpts = + Opts.unwrap(request.getSourceOptions()).resolveFrom(request.getSource()).projectAsSource(); + Opts dstOpts = + Opts.unwrap(request.getTargetOptions()).resolveFrom(request.getTarget()); + MoveObjectRequest.Builder b = + MoveObjectRequest.newBuilder() + .setBucket(srcObj.getBucket()) + .setSourceObject(srcObj.getName()) + .setDestinationObject(dstObj.getName()); + + srcOpts.moveObjectsRequest().apply(b); + dstOpts.moveObjectsRequest().apply(b); + + MoveObjectRequest req = b.build(); + return Retrying.run( + getOptions(), + retryAlgorithmManager.getFor(req), + () -> storageClient.moveObjectCallable().call(req), + syntaxDecoders.blob); + } + @Override public GrpcStorageOptions getOptions() { return (GrpcStorageOptions) super.getOptions(); diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/HttpRetryAlgorithmManager.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/HttpRetryAlgorithmManager.java index b2315cd825..a2564860c2 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/HttpRetryAlgorithmManager.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/HttpRetryAlgorithmManager.java @@ -27,6 +27,7 @@ import com.google.cloud.storage.spi.v1.StorageRpc; import com.google.cloud.storage.spi.v1.StorageRpc.RewriteRequest; import com.google.common.base.MoreObjects; +import com.google.common.collect.ImmutableMap; import java.io.Serializable; import java.util.List; import java.util.Map; @@ -236,6 +237,14 @@ public ResultRetryAlgorithm getForObjectsRewrite(RewriteRequest pb) { : retryStrategy.getNonidempotentHandler(); } + public ResultRetryAlgorithm getForObjectsMove( + ImmutableMap sourceOptions, + ImmutableMap targetOptions) { + return targetOptions.containsKey(StorageRpc.Option.IF_GENERATION_MATCH) + ? retryStrategy.getIdempotentHandler() + : retryStrategy.getNonidempotentHandler(); + } + public ResultRetryAlgorithm getForObjectsCompose( List sources, StorageObject target, Map optionsMap) { return optionsMap.containsKey(StorageRpc.Option.IF_GENERATION_MATCH) diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/OtelStorageDecorator.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/OtelStorageDecorator.java index 2b13fbfb71..dc92c3420f 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/OtelStorageDecorator.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/OtelStorageDecorator.java @@ -1434,6 +1434,25 @@ public BlobWriteSession blobWriteSession(BlobInfo blobInfo, BlobWriteOption... o } } + @Override + public Blob moveBlob(MoveBlobRequest request) { + Span span = + tracer + .spanBuilder("moveBlob") + .setAttribute("gsutil.uri.source", request.getSource().toGsUtilUriWithGeneration()) + .setAttribute("gsutil.uri.target", request.getTarget().toGsUtilUriWithGeneration()) + .startSpan(); + try (Scope ignore = span.makeCurrent()) { + return delegate.moveBlob(request); + } catch (Throwable t) { + span.recordException(t); + span.setStatus(StatusCode.ERROR, t.getClass().getSimpleName()); + throw t; + } finally { + span.end(); + } + } + @Override public StorageOptions getOptions() { return delegate.getOptions(); diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/Storage.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/Storage.java index 8b719396a6..2fa0960281 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/Storage.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/Storage.java @@ -50,6 +50,7 @@ import com.google.cloud.storage.UnifiedOpts.ObjectSourceOpt; import com.google.cloud.storage.UnifiedOpts.ObjectTargetOpt; import com.google.cloud.storage.UnifiedOpts.Opts; +import com.google.common.base.MoreObjects; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -73,6 +74,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.stream.Stream; @@ -2778,6 +2780,150 @@ public static Builder newBuilder() { } } + /** + * A class to contain all information needed for a Google Cloud Storage Object Move. + * + * @since 2.48.0 + * @see Storage#moveBlob(MoveBlobRequest) + */ + @TransportCompatibility({Transport.HTTP, Transport.GRPC}) + final class MoveBlobRequest { + private final BlobId source; + private final BlobId target; + private final ImmutableList sourceOptions; + private final ImmutableList targetOptions; + + MoveBlobRequest( + BlobId source, + BlobId target, + ImmutableList sourceOptions, + ImmutableList targetOptions) { + this.source = source; + this.target = target; + this.sourceOptions = sourceOptions; + this.targetOptions = targetOptions; + } + + public BlobId getSource() { + return source; + } + + public BlobId getTarget() { + return target; + } + + public List getSourceOptions() { + return sourceOptions; + } + + public List getTargetOptions() { + return targetOptions; + } + + public Builder toBuilder() { + return new Builder(source, target, sourceOptions, targetOptions); + } + + public static Builder newBuilder() { + return new Builder(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof MoveBlobRequest)) { + return false; + } + MoveBlobRequest that = (MoveBlobRequest) o; + return Objects.equals(source, that.source) + && Objects.equals(target, that.target) + && Objects.equals(sourceOptions, that.sourceOptions) + && Objects.equals(targetOptions, that.targetOptions); + } + + @Override + public int hashCode() { + return Objects.hash(source, target, sourceOptions, targetOptions); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("source", source) + .add("target", target) + .add("sourceOptions", sourceOptions) + .add("targetOptions", targetOptions) + .toString(); + } + + public static final class Builder { + + private BlobId source; + private BlobId target; + private ImmutableList sourceOptions; + private ImmutableList targetOptions; + + private Builder() { + this(null, null, ImmutableList.of(), ImmutableList.of()); + } + + private Builder( + BlobId source, + BlobId target, + ImmutableList sourceOptions, + ImmutableList targetOptions) { + this.source = source; + this.target = target; + this.sourceOptions = sourceOptions; + this.targetOptions = targetOptions; + } + + public Builder setSource(BlobId source) { + this.source = requireNonNull(source, "source must be non null"); + return this; + } + + public Builder setTarget(BlobId target) { + this.target = requireNonNull(target, "target must be non null"); + return this; + } + + public Builder setSourceOptions(Iterable sourceOptions) { + this.sourceOptions = + ImmutableList.copyOf(requireNonNull(sourceOptions, "sourceOptions must be non null")); + return this; + } + + public Builder setTargetOptions(Iterable targetOptions) { + this.targetOptions = + ImmutableList.copyOf(requireNonNull(targetOptions, "targetOptions must be non null")); + return this; + } + + public Builder setSourceOptions(BlobSourceOption... sourceOptions) { + this.sourceOptions = + ImmutableList.copyOf(requireNonNull(sourceOptions, "sourceOptions must be non null")); + return this; + } + + public Builder setTargetOptions(BlobTargetOption... targetOptions) { + this.targetOptions = + ImmutableList.copyOf(requireNonNull(targetOptions, "targetOptions must be non null")); + return this; + } + + public MoveBlobRequest build() { + return new MoveBlobRequest( + requireNonNull(source, "source must be non null"), + requireNonNull(target, "target must be non null"), + sourceOptions, + targetOptions); + } + } + } + /** * Creates a new bucket. * @@ -4882,4 +5028,16 @@ default void close() throws Exception {} default BlobWriteSession blobWriteSession(BlobInfo blobInfo, BlobWriteOption... options) { return throwGrpcOnly(fmtMethodName("blobWriteSession", BlobInfo.class, BlobWriteOption.class)); } + + /** + * Atomically move an object from one name to another. + * + *

                This new method is an atomic equivalent of the existing {@link Storage#copy(CopyRequest)} + + * {@link Storage#delete(BlobId)}, however without the ability to change metadata fields for the + * target object. + * + * @since 2.48.0 + */ + @TransportCompatibility({Transport.HTTP, Transport.GRPC}) + Blob moveBlob(MoveBlobRequest request); } diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageImpl.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageImpl.java index efb627459b..e5b023a3a0 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageImpl.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageImpl.java @@ -1696,6 +1696,27 @@ public BlobWriteSession blobWriteSession(BlobInfo blobInfo, BlobWriteOption... o return BlobWriteSessions.of(writableByteChannelSession); } + @Override + public Blob moveBlob(MoveBlobRequest request) { + Opts srcOpts = + Opts.unwrap(request.getSourceOptions()).resolveFrom(request.getSource()).projectAsSource(); + Opts dstOpts = + Opts.unwrap(request.getTargetOptions()).resolveFrom(request.getTarget()); + ImmutableMap sourceOptions = srcOpts.getRpcOptions(); + ImmutableMap targetOptions = dstOpts.getRpcOptions(); + + return run( + retryAlgorithmManager.getForObjectsMove(sourceOptions, targetOptions), + () -> + storageRpc.moveObject( + request.getSource().getBucket(), + request.getSource().getName(), + request.getTarget().getName(), + sourceOptions, + targetOptions), + o -> codecs.blobInfo().decode(o).asBlob(this)); + } + @Override public BlobInfo internalCreateFrom(Path path, BlobInfo info, Opts opts) throws IOException { diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/UnifiedOpts.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/UnifiedOpts.java index 1f51429d02..6c9828c1b1 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/UnifiedOpts.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/UnifiedOpts.java @@ -48,6 +48,7 @@ import com.google.storage.v2.ListBucketsRequest; import com.google.storage.v2.ListObjectsRequest; import com.google.storage.v2.LockBucketRetentionPolicyRequest; +import com.google.storage.v2.MoveObjectRequest; import com.google.storage.v2.ReadObjectRequest; import com.google.storage.v2.RestoreObjectRequest; import com.google.storage.v2.RewriteObjectRequest; @@ -155,6 +156,10 @@ default Mapper rewriteObject() { return Mapper.identity(); } + default Mapper moveObject() { + return Mapper.identity(); + } + default Mapper restoreObject() { return Mapper.identity(); } @@ -193,6 +198,10 @@ default Mapper rewriteObject() { return Mapper.identity(); } + default Mapper moveObject() { + return Mapper.identity(); + } + default Mapper startResumableWrite() { return Mapper.identity(); } @@ -295,6 +304,11 @@ default Mapper getObject() { default Mapper rewriteObject() { return Mapper.identity(); } + + @Override + default Mapper moveObject() { + return Mapper.identity(); + } } /** @@ -877,6 +891,11 @@ public Mapper rewriteObject() { return Mapper.identity(); } + @Override + public Mapper moveObject() { + return Mapper.identity(); + } + /** * Define a decoder which can clear out any fields which may have not been selected. * @@ -1090,6 +1109,11 @@ public Mapper rewriteObject() { return b -> b.setIfGenerationMatch(val); } + @Override + public Mapper moveObject() { + return b -> b.setIfGenerationMatch(val); + } + @Override public SourceGenerationMatch asSource() { return new SourceGenerationMatch(val); @@ -1154,6 +1178,11 @@ public Mapper rewriteObject() { return b -> b.setIfGenerationNotMatch(val); } + @Override + public Mapper moveObject() { + return b -> b.setIfGenerationNotMatch(val); + } + @Override public SourceGenerationNotMatch asSource() { return new SourceGenerationNotMatch(val); @@ -1329,6 +1358,11 @@ public Mapper rewriteObject() { return b -> b.setIfMetagenerationMatch(val); } + @Override + public Mapper moveObject() { + return b -> b.setIfMetagenerationMatch(val); + } + @Override public Mapper updateBucket() { return b -> b.setIfMetagenerationMatch(val); @@ -1417,6 +1451,11 @@ public Mapper rewriteObject() { return b -> b.setIfMetagenerationNotMatch(val); } + @Override + public Mapper moveObject() { + return b -> b.setIfMetagenerationNotMatch(val); + } + @Override public Mapper updateBucket() { return b -> b.setIfMetagenerationNotMatch(val); @@ -1620,6 +1659,11 @@ private SourceGenerationMatch(@NonNull Long val) { public Mapper rewriteObject() { return b -> b.setIfSourceGenerationMatch(val); } + + @Override + public Mapper moveObject() { + return b -> b.setIfSourceGenerationMatch(val); + } } /** @@ -1638,6 +1682,11 @@ private SourceGenerationNotMatch(@NonNull Long val) { public Mapper rewriteObject() { return b -> b.setIfSourceGenerationNotMatch(val); } + + @Override + public Mapper moveObject() { + return b -> b.setIfSourceGenerationNotMatch(val); + } } /** @@ -1656,6 +1705,11 @@ private SourceMetagenerationMatch(@NonNull Long val) { public Mapper rewriteObject() { return b -> b.setIfSourceMetagenerationMatch(val); } + + @Override + public Mapper moveObject() { + return b -> b.setIfSourceMetagenerationMatch(val); + } } /** @@ -1674,6 +1728,11 @@ private SourceMetagenerationNotMatch(@NonNull Long val) { public Mapper rewriteObject() { return b -> b.setIfSourceMetagenerationNotMatch(val); } + + @Override + public Mapper moveObject() { + return b -> b.setIfSourceMetagenerationNotMatch(val); + } } static final class RequestedPolicyVersion extends RpcOptVal<@NonNull Long> @@ -1854,6 +1913,11 @@ public Mapper getGrpcMetadataMapper() { public Mapper rewriteObject() { return Mapper.identity(); } + + @Override + public Mapper moveObject() { + return Mapper.identity(); + } } static final class VersionsFilter extends RpcOptVal<@NonNull Boolean> implements ObjectListOpt { @@ -2448,6 +2512,27 @@ Mapper rewriteObjectsRequest() { .reduce(Mapper.identity(), Mapper::andThen); } + Mapper moveObjectsRequest() { + return opts.stream() + .filter(isInstanceOf(ObjectTargetOpt.class).or(isInstanceOf(ObjectSourceOpt.class))) + .map( + o -> { + // TODO: Do we need to formalize this type of dual relationship with it's own + // interface? + if (o instanceof ObjectTargetOpt) { + ObjectTargetOpt oto = (ObjectTargetOpt) o; + return oto.moveObject(); + } else if (o instanceof ObjectSourceOpt) { + ObjectSourceOpt oso = (ObjectSourceOpt) o; + return oso.moveObject(); + } else { + // in practice this shouldn't happen because of the filter guard upstream + throw new IllegalStateException("Unexpected type: %s" + o.getClass()); + } + }) + .reduce(Mapper.identity(), Mapper::andThen); + } + Mapper getIamPolicyRequest() { return fuseMappers(BucketSourceOpt.class, BucketSourceOpt::getIamPolicy); } diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/HttpStorageRpc.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/HttpStorageRpc.java index 5341051a25..c276c511af 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/HttpStorageRpc.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/HttpStorageRpc.java @@ -46,6 +46,7 @@ import com.google.api.services.storage.Storage.Objects.Compose; import com.google.api.services.storage.Storage.Objects.Get; import com.google.api.services.storage.Storage.Objects.Insert; +import com.google.api.services.storage.Storage.Objects.Move; import com.google.api.services.storage.model.Bucket; import com.google.api.services.storage.model.Bucket.RetentionPolicy; import com.google.api.services.storage.model.BucketAccessControl; @@ -1143,6 +1144,42 @@ public String open(String signedURL) { } } + @Override + public StorageObject moveObject( + String bucket, + String sourceObject, + String destinationObject, + Map sourceOptions, + Map targetOptions) { + + String userProject = Option.USER_PROJECT.getString(sourceOptions); + if (userProject == null) { + userProject = Option.USER_PROJECT.getString(targetOptions); + } + try { + Move move = + storage + .objects() + .move(bucket, sourceObject, destinationObject) + .setIfSourceMetagenerationMatch( + Option.IF_SOURCE_METAGENERATION_MATCH.getLong(sourceOptions)) + .setIfSourceMetagenerationNotMatch( + Option.IF_SOURCE_METAGENERATION_NOT_MATCH.getLong(sourceOptions)) + .setIfSourceGenerationMatch(Option.IF_SOURCE_GENERATION_MATCH.getLong(sourceOptions)) + .setIfSourceGenerationNotMatch( + Option.IF_SOURCE_GENERATION_NOT_MATCH.getLong(sourceOptions)) + .setIfMetagenerationMatch(Option.IF_METAGENERATION_MATCH.getLong(targetOptions)) + .setIfMetagenerationNotMatch( + Option.IF_METAGENERATION_NOT_MATCH.getLong(targetOptions)) + .setIfGenerationMatch(Option.IF_GENERATION_MATCH.getLong(targetOptions)) + .setIfGenerationNotMatch(Option.IF_GENERATION_NOT_MATCH.getLong(targetOptions)) + .setUserProject(userProject); + return move.execute(); + } catch (IOException e) { + throw translate(e); + } + } + @Override public RewriteResponse openRewrite(RewriteRequest rewriteRequest) { Span span = startSpan(HttpStorageRpcSpans.SPAN_NAME_OPEN_REWRITE); diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/StorageRpc.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/StorageRpc.java index 78747d42d6..ffd1766b53 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/StorageRpc.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/StorageRpc.java @@ -393,6 +393,13 @@ StorageObject writeWithResponse( int length, boolean last); + StorageObject moveObject( + String bucket, + String sourceObject, + String destinationObject, + Map sourceOptions, + Map targetOptions); + /** * Sends a rewrite request to open a rewrite channel. * diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/testing/StorageRpcTestBase.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/testing/StorageRpcTestBase.java index 6686cb925e..8f835f5bf3 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/testing/StorageRpcTestBase.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/testing/StorageRpcTestBase.java @@ -322,6 +322,16 @@ public ServiceAccount getServiceAccount(String projectId) { throw new UnsupportedOperationException("Not implemented yet"); } + @Override + public StorageObject moveObject( + String bucket, + String sourceObject, + String destinationObject, + Map sourceOptions, + Map targetOptions) { + throw new UnsupportedOperationException("Not implemented yet"); + } + @Override public Storage getStorage() { throw new UnsupportedOperationException("Not implemented yet"); diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITFoldersTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITFoldersTest.java index a595336671..1eceea6ce0 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITFoldersTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITFoldersTest.java @@ -19,14 +19,24 @@ import static com.google.cloud.storage.TestUtils.assertAll; import static com.google.common.truth.Truth.assertThat; +import com.google.cloud.storage.Blob; +import com.google.cloud.storage.BlobId; +import com.google.cloud.storage.BlobInfo; import com.google.cloud.storage.BucketInfo; +import com.google.cloud.storage.DataGenerator; +import com.google.cloud.storage.Storage; +import com.google.cloud.storage.Storage.BlobSourceOption; +import com.google.cloud.storage.Storage.BlobTargetOption; +import com.google.cloud.storage.Storage.MoveBlobRequest; +import com.google.cloud.storage.TransportCompatibility.Transport; import com.google.cloud.storage.it.runner.StorageITRunner; import com.google.cloud.storage.it.runner.annotations.Backend; import com.google.cloud.storage.it.runner.annotations.BucketFixture; import com.google.cloud.storage.it.runner.annotations.BucketType; +import com.google.cloud.storage.it.runner.annotations.CrossRun; import com.google.cloud.storage.it.runner.annotations.Inject; -import com.google.cloud.storage.it.runner.annotations.SingleBackend; import com.google.cloud.storage.it.runner.registry.Generator; +import com.google.common.collect.ImmutableMap; import com.google.storage.control.v2.BucketName; import com.google.storage.control.v2.CreateFolderRequest; import com.google.storage.control.v2.Folder; @@ -36,10 +46,13 @@ import org.junit.runner.RunWith; @RunWith(StorageITRunner.class) -@SingleBackend(Backend.PROD) +@CrossRun( + backends = Backend.PROD, + transports = {Transport.HTTP, Transport.GRPC}) public class ITFoldersTest { @Inject public StorageControlClient ctrl; + @Inject public Storage storage; @Inject @BucketFixture(BucketType.HNS) @@ -61,4 +74,30 @@ public void createFolder() throws Exception { () -> assertThat(folder.getName()).isEqualTo(FolderName.format("_", bucketName, folderId)), () -> assertThat(folder.getMetageneration()).isGreaterThan(0)); } + + @Test + public void moveObject() throws Exception { + ChecksummedTestContent testContent = + ChecksummedTestContent.of(DataGenerator.base64Characters().genBytes(5286)); + + BlobId id1 = BlobId.of(bucket.getName(), generator.randomObjectName()); + BlobId id2 = BlobId.of(bucket.getName(), generator.randomObjectName()); + + ImmutableMap metadata = ImmutableMap.of("a", "b", "c", "d"); + BlobInfo info1 = BlobInfo.newBuilder(id1).setMetadata(metadata).build(); + Blob blob1 = storage.create(info1, testContent.getBytes(), BlobTargetOption.doesNotExist()); + + Blob blob2 = + storage.moveBlob( + MoveBlobRequest.newBuilder() + .setSource(blob1.getBlobId()) + .setTarget(id2) + .setSourceOptions(BlobSourceOption.generationMatch()) + .setTargetOptions(BlobTargetOption.doesNotExist()) + .build()); + + assertAll( + () -> assertThat(blob2.getCrc32c()).isEqualTo(testContent.getCrc32cBase64()), + () -> assertThat(blob2.getMetadata()).isEqualTo(metadata)); + } } diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/AbstractStorageProxy.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/AbstractStorageProxy.java index 9e5e9691e9..f0dc3f3499 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/AbstractStorageProxy.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/AbstractStorageProxy.java @@ -494,6 +494,11 @@ public void close() throws Exception { delegate.close(); } + @Override + public Blob moveBlob(MoveBlobRequest request) { + return delegate.moveBlob(request); + } + @Override public StorageOptions getOptions() { return delegate.getOptions(); From 8ad501012fab0dfd8d0f0dce49d7c681540022a9 Mon Sep 17 00:00:00 2001 From: BenWhitehead Date: Thu, 23 Jan 2025 15:35:08 -0500 Subject: [PATCH 17/19] fix: update StorageException translation of an ApiException to include error details (#2872) Update StorageException logic for coalescing ApiExceptions to add a formatted string including fields from error details as a suppressed exception on the api exception. This keeps the diagnostic information at the "gapic layer" in the printed stacktrace similar to the json document being on the "apiary layer" of the cause. --- .../cloud/storage/StorageException.java | 42 ++++++++- ...StorageExceptionGrpcCompatibilityTest.java | 93 +++++++++++++++++++ 2 files changed, 132 insertions(+), 3 deletions(-) diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageException.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageException.java index 63708115fd..456da54828 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageException.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageException.java @@ -22,15 +22,19 @@ import com.google.api.gax.grpc.GrpcStatusCode; import com.google.api.gax.rpc.ApiException; import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.ErrorDetails; import com.google.api.gax.rpc.StatusCode; import com.google.cloud.BaseServiceException; import com.google.cloud.RetryHelper.RetryHelperException; import com.google.cloud.http.BaseHttpServiceException; import com.google.common.collect.ImmutableSet; +import com.google.protobuf.TextFormat; import io.grpc.StatusException; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.Objects; import java.util.Set; +import java.util.stream.Stream; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -127,9 +131,6 @@ static BaseServiceException coalesce(Throwable t) { static StorageException asStorageException(ApiException apiEx) { // https://cloud.google.com/storage/docs/json_api/v1/status-codes // https://cloud.google.com/apis/design/errors#http_mapping - // https://cloud.google.com/apis/design/errors#error_payloads - // TODO: flush this out more to wire through "error" and "details" when we're able to get real - // errors from GCS int httpStatusCode = 0; StatusCode statusCode = apiEx.getStatusCode(); if (statusCode instanceof GrpcStatusCode) { @@ -155,12 +156,41 @@ static StorageException asStorageException(ApiException apiEx) { message = "Error: " + statusCodeName; } + // https://cloud.google.com/apis/design/errors#error_payloads + attachErrorDetails(apiEx); + // It'd be better to use ExceptionData and BaseServiceException#(ExceptionData) but, // BaseHttpServiceException does not pass that through so we're stuck using this for now. // TODO: When we can break the coupling to BaseHttpServiceException replace this return new StorageException(httpStatusCode, message, apiEx.getReason(), apiEx); } + private static void attachErrorDetails(ApiException ae) { + if (ae != null && ae.getErrorDetails() != null) { + final StringBuilder sb = new StringBuilder(); + ErrorDetails ed = ae.getErrorDetails(); + sb.append("ErrorDetails {\n"); + Stream.of( + ed.getErrorInfo(), + ed.getDebugInfo(), + ed.getQuotaFailure(), + ed.getPreconditionFailure(), + ed.getBadRequest(), + ed.getHelp()) + .filter(Objects::nonNull) + .forEach( + msg -> + sb.append("\t\t") + .append(msg.getClass().getSimpleName()) + .append(": { ") + .append(TextFormat.printer().shortDebugString(msg)) + .append(" }\n")); + sb.append("\t}"); + + ae.addSuppressed(new ApiExceptionErrorDetailsComment(sb.toString())); + } + } + /** * Translate IOException to a StorageException representing the cause of the error. This method * defaults to idempotent always being {@code true}. Additionally, this method translates @@ -222,4 +252,10 @@ interface IOExceptionCallable { interface IOExceptionRunnable { void run() throws IOException; } + + private static final class ApiExceptionErrorDetailsComment extends Throwable { + private ApiExceptionErrorDetailsComment(String message) { + super(message, null, true, false); + } + } } diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageExceptionGrpcCompatibilityTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageExceptionGrpcCompatibilityTest.java index a877890c9c..2e2246ae5c 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageExceptionGrpcCompatibilityTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageExceptionGrpcCompatibilityTest.java @@ -16,6 +16,7 @@ package com.google.cloud.storage; +import static com.google.cloud.storage.TestUtils.assertAll; import static com.google.common.truth.Truth.assertThat; import com.google.api.gax.grpc.GrpcStatusCode; @@ -25,11 +26,21 @@ import com.google.cloud.BaseServiceException; import com.google.common.collect.ImmutableList; import com.google.protobuf.Any; +import com.google.protobuf.TextFormat; +import com.google.protobuf.TextFormat.Printer; +import com.google.rpc.BadRequest; +import com.google.rpc.BadRequest.FieldViolation; import com.google.rpc.DebugInfo; import com.google.rpc.ErrorInfo; +import com.google.rpc.Help; +import com.google.rpc.Help.Link; +import com.google.rpc.LocalizedMessage; +import com.google.rpc.PreconditionFailure; +import com.google.rpc.QuotaFailure; import io.grpc.Status; import io.grpc.Status.Code; import io.grpc.StatusRuntimeException; +import java.util.List; import org.junit.Test; public final class StorageExceptionGrpcCompatibilityTest { @@ -114,6 +125,88 @@ public void testCoalesce_UNAUTHENTICATED() { doTestCoalesce(401, Code.UNAUTHENTICATED); } + @Test + public void apiExceptionErrorDetails() throws Exception { + ErrorInfo errorInfo = + ErrorInfo.newBuilder() + .setReason("STACKOUT") + .setDomain("spanner.googlepais.com") + .putMetadata("availableRegions", "us-central1,us-east2") + .build(); + DebugInfo debugInfo = + DebugInfo.newBuilder() + .addStackEntries("HEAD") + .addStackEntries("HEAD~1") + .addStackEntries("HEAD~2") + .addStackEntries("HEAD~3") + .setDetail("some detail") + .build(); + QuotaFailure quotaFailure = + QuotaFailure.newBuilder() + .addViolations( + QuotaFailure.Violation.newBuilder() + .setSubject("clientip:127.0.3.3") + .setDescription("Daily limit") + .build()) + .build(); + PreconditionFailure preconditionFailure = + PreconditionFailure.newBuilder() + .addViolations( + PreconditionFailure.Violation.newBuilder() + .setType("TOS") + .setSubject("google.com/cloud") + .setDescription("Terms of service not accepted") + .build()) + .build(); + BadRequest badRequest = + BadRequest.newBuilder() + .addFieldViolations( + FieldViolation.newBuilder() + .setField("email_addresses[3].type[2]") + .setDescription("duplicate value 'WORK'") + .setReason("INVALID_EMAIL_ADDRESS_TYPE") + .setLocalizedMessage( + LocalizedMessage.newBuilder() + .setLocale("en-US") + .setMessage("Invalid email type: duplicate value") + .build()) + .build()) + .build(); + Help help = + Help.newBuilder() + .addLinks( + Link.newBuilder().setDescription("link1").setUrl("https://google.com").build()) + .build(); + List errors = + ImmutableList.of( + Any.pack(errorInfo), + Any.pack(debugInfo), + Any.pack(quotaFailure), + Any.pack(preconditionFailure), + Any.pack(badRequest), + Any.pack(help)); + ErrorDetails errorDetails = ErrorDetails.builder().setRawErrorMessages(errors).build(); + ApiException ae = + ApiExceptionFactory.createException( + Code.OUT_OF_RANGE.toStatus().asRuntimeException(), + GrpcStatusCode.of(Code.OUT_OF_RANGE), + false, + errorDetails); + + BaseServiceException se = StorageException.coalesce(ae); + String message = se.getCause().getSuppressed()[0].getMessage(); + Printer printer = TextFormat.printer(); + assertAll( + () -> assertThat(message).contains("ErrorDetails {"), + () -> assertThat(message).contains(printer.shortDebugString(errorInfo)), + () -> assertThat(message).contains(printer.shortDebugString(debugInfo)), + () -> assertThat(message).contains(printer.shortDebugString(quotaFailure)), + () -> assertThat(message).contains(printer.shortDebugString(preconditionFailure)), + () -> assertThat(message).contains(printer.shortDebugString(badRequest)), + () -> assertThat(message).contains(printer.shortDebugString(help)), + () -> assertThat(message).contains("\t}")); + } + private void doTestCoalesce(int expectedCode, Code code) { Status status = code.toStatus(); GrpcStatusCode statusCode = GrpcStatusCode.of(code); From 5fc07c1261d43c3ab04084b508608458a91623f2 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 27 Jan 2025 17:43:09 +0100 Subject: [PATCH 18/19] build(deps): update googleapis/sdk-platform-java action to v2.52.0 (#2892) --- .github/workflows/hermetic_library_generation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hermetic_library_generation.yaml b/.github/workflows/hermetic_library_generation.yaml index 8f4feed050..70e76714fa 100644 --- a/.github/workflows/hermetic_library_generation.yaml +++ b/.github/workflows/hermetic_library_generation.yaml @@ -43,7 +43,7 @@ jobs: with: fetch-depth: 0 token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} - - uses: googleapis/sdk-platform-java/.github/scripts@v2.51.1 + - uses: googleapis/sdk-platform-java/.github/scripts@v2.52.0 if: env.SHOULD_RUN == 'true' with: base_ref: ${{ github.base_ref }} From 78b9010e3dd23352c8553356308e3d24f1d706d3 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 16:06:35 -0500 Subject: [PATCH 19/19] chore(main): release 2.48.0 (#2871) --- CHANGELOG.md | 21 +++++++++++++++++++ README.md | 6 +++--- gapic-google-cloud-storage-v2/pom.xml | 4 ++-- google-cloud-storage-bom/pom.xml | 16 +++++++------- google-cloud-storage-control/pom.xml | 4 ++-- google-cloud-storage/pom.xml | 4 ++-- grpc-google-cloud-storage-control-v2/pom.xml | 4 ++-- grpc-google-cloud-storage-v2/pom.xml | 4 ++-- pom.xml | 16 +++++++------- proto-google-cloud-storage-control-v2/pom.xml | 4 ++-- proto-google-cloud-storage-v2/pom.xml | 4 ++-- samples/snapshot/pom.xml | 6 +++--- storage-shared-benchmarking/pom.xml | 4 ++-- versions.txt | 14 ++++++------- 14 files changed, 66 insertions(+), 45 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c943f580f..bcfd1ce9f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog +## [2.48.0](https://github.com/googleapis/java-storage/compare/v2.47.0...v2.48.0) (2025-01-27) + + +### Features + +* Add new Storage#moveBlob method to atomically rename an object ([#2882](https://github.com/googleapis/java-storage/issues/2882)) ([c49fd08](https://github.com/googleapis/java-storage/commit/c49fd08582c7235919270c1dd4eb2ece6933d302)) +* Next release from main branch is 2.48.0 ([#2885](https://github.com/googleapis/java-storage/issues/2885)) ([34e5903](https://github.com/googleapis/java-storage/commit/34e5903df9b7221ba9ebabc07046d7b819f9f209)) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.51.1 ([09ed029](https://github.com/googleapis/java-storage/commit/09ed02995f4688db69c0e0db1c3d72cadce0c395)) +* Update Signed URL default scheme to resolve from storage options host ([#2880](https://github.com/googleapis/java-storage/issues/2880)) ([7ae7e39](https://github.com/googleapis/java-storage/commit/7ae7e3998930c1bec72ff7c06ebc2b66343852ca)), closes [#2870](https://github.com/googleapis/java-storage/issues/2870) +* Update StorageException translation of an ApiException to include error details ([#2872](https://github.com/googleapis/java-storage/issues/2872)) ([8ad5010](https://github.com/googleapis/java-storage/commit/8ad501012fab0dfd8d0f0dce49d7c681540022a9)) + + +### Dependencies + +* Update dependency com.google.cloud.opentelemetry:exporter-trace to v0.33.0 ([#2873](https://github.com/googleapis/java-storage/issues/2873)) ([39509d5](https://github.com/googleapis/java-storage/commit/39509d53ee283694526efbec58daa24c3d8ca080)) +* Update gcr.io/cloud-devrel-public-resources/storage-testbench docker tag to v0.52.0 ([#2883](https://github.com/googleapis/java-storage/issues/2883)) ([a64a3d5](https://github.com/googleapis/java-storage/commit/a64a3d58410dd2e9db20a36cd7169037f71eaeeb)) + ## [2.47.0](https://github.com/googleapis/java-storage/compare/v2.46.0...v2.47.0) (2025-01-08) diff --git a/README.md b/README.md index 017d2d7435..881a3d22ec 100644 --- a/README.md +++ b/README.md @@ -66,13 +66,13 @@ implementation 'com.google.cloud:google-cloud-storage' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-storage:2.47.0' +implementation 'com.google.cloud:google-cloud-storage:2.48.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-storage" % "2.47.0" +libraryDependencies += "com.google.cloud" % "google-cloud-storage" % "2.48.0" ``` ## Authentication @@ -514,7 +514,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-storage/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-storage.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-storage/2.47.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-storage/2.48.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/gapic-google-cloud-storage-v2/pom.xml b/gapic-google-cloud-storage-v2/pom.xml index e2bfd66809..bae0cefbd8 100644 --- a/gapic-google-cloud-storage-v2/pom.xml +++ b/gapic-google-cloud-storage-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc gapic-google-cloud-storage-v2 - 2.47.1-SNAPSHOT + 2.48.0 gapic-google-cloud-storage-v2 GRPC library for gapic-google-cloud-storage-v2 com.google.cloud google-cloud-storage-parent - 2.47.1-SNAPSHOT + 2.48.0 diff --git a/google-cloud-storage-bom/pom.xml b/google-cloud-storage-bom/pom.xml index 7d9cf8a8d0..c32c3acb3a 100644 --- a/google-cloud-storage-bom/pom.xml +++ b/google-cloud-storage-bom/pom.xml @@ -19,7 +19,7 @@ 4.0.0 com.google.cloud google-cloud-storage-bom - 2.47.1-SNAPSHOT + 2.48.0 pom com.google.cloud @@ -69,37 +69,37 @@ com.google.cloud google-cloud-storage - 2.47.1-SNAPSHOT + 2.48.0 com.google.api.grpc gapic-google-cloud-storage-v2 - 2.47.1-SNAPSHOT + 2.48.0 com.google.api.grpc grpc-google-cloud-storage-v2 - 2.47.1-SNAPSHOT + 2.48.0 com.google.api.grpc proto-google-cloud-storage-v2 - 2.47.1-SNAPSHOT + 2.48.0 com.google.cloud google-cloud-storage-control - 2.47.1-SNAPSHOT + 2.48.0 com.google.api.grpc grpc-google-cloud-storage-control-v2 - 2.47.1-SNAPSHOT + 2.48.0 com.google.api.grpc proto-google-cloud-storage-control-v2 - 2.47.1-SNAPSHOT + 2.48.0 diff --git a/google-cloud-storage-control/pom.xml b/google-cloud-storage-control/pom.xml index 33894ef37b..2f85675348 100644 --- a/google-cloud-storage-control/pom.xml +++ b/google-cloud-storage-control/pom.xml @@ -5,13 +5,13 @@ 4.0.0 com.google.cloud google-cloud-storage-control - 2.47.1-SNAPSHOT + 2.48.0 google-cloud-storage-control GRPC library for google-cloud-storage-control com.google.cloud google-cloud-storage-parent - 2.47.1-SNAPSHOT + 2.48.0 diff --git a/google-cloud-storage/pom.xml b/google-cloud-storage/pom.xml index 397556a367..9a9f7efd22 100644 --- a/google-cloud-storage/pom.xml +++ b/google-cloud-storage/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-storage - 2.47.1-SNAPSHOT + 2.48.0 jar Google Cloud Storage https://github.com/googleapis/java-storage @@ -12,7 +12,7 @@ com.google.cloud google-cloud-storage-parent - 2.47.1-SNAPSHOT + 2.48.0 google-cloud-storage diff --git a/grpc-google-cloud-storage-control-v2/pom.xml b/grpc-google-cloud-storage-control-v2/pom.xml index c62b10235c..009de4d7b5 100644 --- a/grpc-google-cloud-storage-control-v2/pom.xml +++ b/grpc-google-cloud-storage-control-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-storage-control-v2 - 2.47.1-SNAPSHOT + 2.48.0 grpc-google-cloud-storage-control-v2 GRPC library for google-cloud-storage com.google.cloud google-cloud-storage-parent - 2.47.1-SNAPSHOT + 2.48.0 diff --git a/grpc-google-cloud-storage-v2/pom.xml b/grpc-google-cloud-storage-v2/pom.xml index dbea495da0..5571eebbf9 100644 --- a/grpc-google-cloud-storage-v2/pom.xml +++ b/grpc-google-cloud-storage-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-storage-v2 - 2.47.1-SNAPSHOT + 2.48.0 grpc-google-cloud-storage-v2 GRPC library for grpc-google-cloud-storage-v2 com.google.cloud google-cloud-storage-parent - 2.47.1-SNAPSHOT + 2.48.0 diff --git a/pom.xml b/pom.xml index 41e60719fe..fb9bc7ccfb 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-storage-parent pom - 2.47.1-SNAPSHOT + 2.48.0 Storage Parent https://github.com/googleapis/java-storage @@ -123,7 +123,7 @@ com.google.cloud google-cloud-storage - 2.47.1-SNAPSHOT + 2.48.0 com.google.apis @@ -145,32 +145,32 @@ com.google.api.grpc proto-google-cloud-storage-v2 - 2.47.1-SNAPSHOT + 2.48.0 com.google.api.grpc grpc-google-cloud-storage-v2 - 2.47.1-SNAPSHOT + 2.48.0 com.google.api.grpc gapic-google-cloud-storage-v2 - 2.47.1-SNAPSHOT + 2.48.0 com.google.api.grpc grpc-google-cloud-storage-control-v2 - 2.47.1-SNAPSHOT + 2.48.0 com.google.api.grpc proto-google-cloud-storage-control-v2 - 2.47.1-SNAPSHOT + 2.48.0 com.google.cloud google-cloud-storage-control - 2.47.1-SNAPSHOT + 2.48.0 com.google.cloud diff --git a/proto-google-cloud-storage-control-v2/pom.xml b/proto-google-cloud-storage-control-v2/pom.xml index 8a6ef64c65..7d7859f484 100644 --- a/proto-google-cloud-storage-control-v2/pom.xml +++ b/proto-google-cloud-storage-control-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-storage-control-v2 - 2.47.1-SNAPSHOT + 2.48.0 proto-google-cloud-storage-control-v2 Proto library for proto-google-cloud-storage-control-v2 com.google.cloud google-cloud-storage-parent - 2.47.1-SNAPSHOT + 2.48.0 diff --git a/proto-google-cloud-storage-v2/pom.xml b/proto-google-cloud-storage-v2/pom.xml index 36e9c57f85..7fa134f3ce 100644 --- a/proto-google-cloud-storage-v2/pom.xml +++ b/proto-google-cloud-storage-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-storage-v2 - 2.47.1-SNAPSHOT + 2.48.0 proto-google-cloud-storage-v2 PROTO library for proto-google-cloud-storage-v2 com.google.cloud google-cloud-storage-parent - 2.47.1-SNAPSHOT + 2.48.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 8d6c764a05..98041158e7 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,12 +28,12 @@ com.google.cloud google-cloud-storage - 2.47.1-SNAPSHOT + 2.48.0 com.google.cloud google-cloud-storage-control - 2.47.1-SNAPSHOT + 2.48.0 compile @@ -64,7 +64,7 @@ com.google.cloud google-cloud-storage - 2.47.1-SNAPSHOT + 2.48.0 tests test diff --git a/storage-shared-benchmarking/pom.xml b/storage-shared-benchmarking/pom.xml index 1fba56d862..b7818d69c2 100644 --- a/storage-shared-benchmarking/pom.xml +++ b/storage-shared-benchmarking/pom.xml @@ -10,7 +10,7 @@ com.google.cloud google-cloud-storage-parent - 2.47.1-SNAPSHOT + 2.48.0 @@ -31,7 +31,7 @@ com.google.cloud google-cloud-storage - 2.47.1-SNAPSHOT + 2.48.0 tests diff --git a/versions.txt b/versions.txt index b4efcb6869..760d5284d3 100644 --- a/versions.txt +++ b/versions.txt @@ -1,10 +1,10 @@ # Format: # module:released-version:current-version -google-cloud-storage:2.47.0:2.47.1-SNAPSHOT -gapic-google-cloud-storage-v2:2.47.0:2.47.1-SNAPSHOT -grpc-google-cloud-storage-v2:2.47.0:2.47.1-SNAPSHOT -proto-google-cloud-storage-v2:2.47.0:2.47.1-SNAPSHOT -google-cloud-storage-control:2.47.0:2.47.1-SNAPSHOT -proto-google-cloud-storage-control-v2:2.47.0:2.47.1-SNAPSHOT -grpc-google-cloud-storage-control-v2:2.47.0:2.47.1-SNAPSHOT +google-cloud-storage:2.48.0:2.48.0 +gapic-google-cloud-storage-v2:2.48.0:2.48.0 +grpc-google-cloud-storage-v2:2.48.0:2.48.0 +proto-google-cloud-storage-v2:2.48.0:2.48.0 +google-cloud-storage-control:2.48.0:2.48.0 +proto-google-cloud-storage-control-v2:2.48.0:2.48.0 +grpc-google-cloud-storage-control-v2:2.48.0:2.48.0