From b56cc01a3cda4a8f2752708c679d7bc18988f619 Mon Sep 17 00:00:00 2001 From: Sydney Munro Date: Fri, 18 Mar 2022 14:36:50 -0700 Subject: [PATCH] Revert "Merge branch 'main' into storage-notification-138" This reverts commit 44593cdc8044ea79a2cc1d932bbf7c2ced9722ac, reversing changes made to e5763f19edf3eb4cf2972b700e5be993859f2169. --- .github/.OwlBot.yaml | 31 - .github/CODEOWNERS | 6 +- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/PULL_REQUEST_TEMPLATE.md | 3 - .github/blunderbuss.yml | 2 +- .github/cherry-pick-bot.yml | 1 - .github/generated-files-bot.yml | 5 - .github/readme/synth.metadata/synth.metadata | 18 + .../{.OwlBot.lock.yaml => readme/synth.py} | 13 +- .github/release-please.yml | 24 +- .github/release-trigger.yml | 1 - .github/sync-repo-settings.yaml | 139 +- .github/trusted-contribution.yml | 3 +- .github/workflows/approve-readme.yaml | 17 +- .github/workflows/auto-release.yaml | 31 +- .github/workflows/ci.yaml | 64 +- .github/workflows/formatting.yaml | 25 + .github/workflows/samples.yaml | 20 +- .kokoro/build.bat | 15 - .kokoro/build.sh | 35 +- .kokoro/coerce_logs.sh | 1 + .kokoro/continuous/readme.cfg | 55 + .kokoro/dependencies.sh | 31 +- .kokoro/linkage-monitor.sh | 46 + .kokoro/nightly/java11-integration.cfg | 41 - .kokoro/nightly/samples.cfg | 10 +- .kokoro/presubmit/graalvm-native.cfg | 33 - .kokoro/presubmit/integration.cfg | 9 +- .kokoro/presubmit/samples.cfg | 10 +- .kokoro/release/common.sh | 2 +- .kokoro/release/drop.sh | 2 +- .kokoro/release/promote.sh | 2 +- .kokoro/release/publish_javadoc.cfg | 6 + .kokoro/release/publish_javadoc.sh | 29 +- .kokoro/release/publish_javadoc11.cfg | 30 - .kokoro/release/publish_javadoc11.sh | 63 - .kokoro/release/snapshot.sh | 2 +- .kokoro/release/stage.sh | 4 +- .kokoro/trampoline.sh | 2 +- .readme-partials.yaml | 14 +- .repo-metadata.json | 15 +- CHANGELOG.md | 525 - CONTRIBUTING.md | 62 +- LICENSE | 1 + README.md | 213 +- SECURITY.md | 7 - gapic-google-cloud-storage-v2/pom.xml | 97 - .../com/google/storage/v2/StorageClient.java | 3422 --- .../google/storage/v2/StorageSettings.java | 503 - .../com/google/storage/v2/package-info.java | 50 - .../v2/stub/GrpcStorageCallableFactory.java | 113 - .../storage/v2/stub/GrpcStorageStub.java | 902 - .../google/storage/v2/stub/StorageStub.java | 226 - .../storage/v2/stub/StorageStubSettings.java | 1234 - .../com/google/storage/v2/gapic_metadata.json | 105 - .../com/google/storage/v2/MockStorage.java | 59 - .../google/storage/v2/MockStorageImpl.java | 683 - .../google/storage/v2/StorageClientTest.java | 2580 -- .../retry-conformance-tests-diagram.png | Bin 143852 -> 0 bytes .../retry-conformance-tests-diagram.txt | 59 - .../clirr-ignored-differences.xml | 28 +- google-cloud-storage/conformance-testing.md | 45 - google-cloud-storage/pom.xml | 19 +- .../java/com/google/cloud/storage/Blob.java | 62 +- .../java/com/google/cloud/storage/BlobId.java | 23 - .../google/cloud/storage/BlobReadChannel.java | 27 +- .../cloud/storage/BlobWriteChannel.java | 441 +- .../java/com/google/cloud/storage/Bucket.java | 6 - .../com/google/cloud/storage/BucketInfo.java | 260 +- .../com/google/cloud/storage/CopyWriter.java | 27 +- .../storage/DefaultStorageRetryStrategy.java | 140 - .../google/cloud/storage/PolicyHelper.java | 6 +- .../google/cloud/storage/PostPolicyV4.java | 43 +- .../google/cloud/storage/ResumableMedia.java | 73 - .../cloud/storage/RetryAlgorithmManager.java | 246 - .../com/google/cloud/storage/Retrying.java | 57 - .../java/com/google/cloud/storage/Rpo.java | 70 - .../com/google/cloud/storage/Storage.java | 32 - .../cloud/storage/StorageException.java | 23 +- .../com/google/cloud/storage/StorageImpl.java | 977 +- .../google/cloud/storage/StorageOptions.java | 40 +- .../cloud/storage/StorageRetryStrategy.java | 123 - .../storage/UniformStorageRetryStrategy.java | 43 - .../cloud/storage/spi/v1/HttpStorageRpc.java | 125 +- .../storage/spi/v1/HttpStorageRpcSpans.java | 2 +- .../cloud/storage/spi/v1/StorageRpc.java | 21 +- .../storage/testing/StorageRpcTestBase.java | 5 - .../com/google/cloud/storage/BlobIdTest.java | 8 - .../com/google/cloud/storage/BlobTest.java | 109 +- .../cloud/storage/BlobWriteChannelTest.java | 468 +- .../google/cloud/storage/BucketInfoTest.java | 128 - .../com/google/cloud/storage/BucketTest.java | 90 +- .../google/cloud/storage/DataGeneration.java | 67 - .../DefaultRetryHandlingBehaviorTest.java | 994 - .../PackagePrivateMethodWorkarounds.java | 56 - .../cloud/storage/PolicyHelperTest.java | 10 +- .../cloud/storage/PostPolicyV4Test.java | 34 +- .../cloud/storage/ResumableMediaTest.java | 66 - .../cloud/storage/SerializationTest.java | 5 +- .../cloud/storage/StorageBatchTest.java | 19 +- .../cloud/storage/StorageImplMockitoTest.java | 10 +- .../google/cloud/storage/StorageImplTest.java | 12 + .../cloud/storage/StorageOptionsTest.java | 32 - .../cloud/storage/V4PostPolicyTest.java | 25 +- .../conformance/retry/CleanupStrategy.java | 23 - .../cloud/storage/conformance/retry/Ctx.java | 78 - .../conformance/retry/CtxFunctions.java | 252 - .../storage/conformance/retry/Functions.java | 64 - .../retry/GracefulConformanceEnforcement.java | 106 - .../retry/ITRetryConformanceTest.java | 471 - .../retry/ParallelParameterized.java | 81 - .../conformance/retry/RetryTestFixture.java | 149 - .../storage/conformance/retry/RpcMethod.java | 166 - .../conformance/retry/RpcMethodMapping.java | 207 - .../conformance/retry/RpcMethodMappings.java | 1935 -- .../storage/conformance/retry/State.java | 353 - .../storage/conformance/retry/TestBench.java | 417 - .../retry/TestRetryConformance.java | 218 - .../storage/it/ITBlobWriteChannelTest.java | 196 - .../cloud/storage/it/ITStorageTest.java | 382 +- .../storage/conformance/retry/hello-world.txt | 1 - .../retry/testNamesWhichCanFail.txt | 7 - grpc-google-cloud-storage-v2/pom.xml | 60 - .../com/google/storage/v2/StorageGrpc.java | 3609 --- java.header | 2 +- pom.xml | 145 +- .../clirr-ignored-differences.xml | 58 - proto-google-cloud-storage-v2/pom.xml | 37 - .../java/com/google/storage/v2/Bucket.java | 22391 ---------------- .../storage/v2/BucketAccessControl.java | 1903 -- .../v2/BucketAccessControlOrBuilder.java | 238 - .../com/google/storage/v2/BucketName.java | 191 - .../google/storage/v2/BucketOrBuilder.java | 1009 - .../google/storage/v2/ChecksummedData.java | 685 - .../storage/v2/ChecksummedDataOrBuilder.java | 63 - .../storage/v2/CommonObjectRequestParams.java | 840 - .../CommonObjectRequestParamsOrBuilder.java | 80 - .../storage/v2/CommonRequestParams.java | 648 - .../v2/CommonRequestParamsOrBuilder.java | 54 - .../storage/v2/ComposeObjectRequest.java | 4256 --- .../v2/ComposeObjectRequestOrBuilder.java | 298 - .../com/google/storage/v2/ContentRange.java | 721 - .../storage/v2/ContentRangeOrBuilder.java | 64 - .../storage/v2/CreateBucketRequest.java | 1440 - .../v2/CreateBucketRequestOrBuilder.java | 174 - .../storage/v2/CreateHmacKeyRequest.java | 1105 - .../v2/CreateHmacKeyRequestOrBuilder.java | 114 - .../storage/v2/CreateHmacKeyResponse.java | 830 - .../v2/CreateHmacKeyResponseOrBuilder.java | 74 - .../storage/v2/CreateNotificationRequest.java | 949 - .../CreateNotificationRequestOrBuilder.java | 95 - .../com/google/storage/v2/CryptoKeyName.java | 261 - .../google/storage/v2/CustomerEncryption.java | 733 - .../v2/CustomerEncryptionOrBuilder.java | 64 - .../storage/v2/DeleteBucketRequest.java | 1197 - .../v2/DeleteBucketRequestOrBuilder.java | 141 - .../storage/v2/DeleteHmacKeyRequest.java | 1105 - .../v2/DeleteHmacKeyRequestOrBuilder.java | 114 - .../storage/v2/DeleteNotificationRequest.java | 649 - .../DeleteNotificationRequestOrBuilder.java | 54 - .../storage/v2/DeleteObjectRequest.java | 2232 -- .../v2/DeleteObjectRequestOrBuilder.java | 302 - .../google/storage/v2/GetBucketRequest.java | 1500 -- .../storage/v2/GetBucketRequestOrBuilder.java | 184 - .../google/storage/v2/GetHmacKeyRequest.java | 1104 - .../v2/GetHmacKeyRequestOrBuilder.java | 114 - .../storage/v2/GetNotificationRequest.java | 662 - .../v2/GetNotificationRequestOrBuilder.java | 58 - .../google/storage/v2/GetObjectRequest.java | 2345 -- .../storage/v2/GetObjectRequestOrBuilder.java | 317 - .../storage/v2/GetServiceAccountRequest.java | 926 - .../v2/GetServiceAccountRequestOrBuilder.java | 89 - .../google/storage/v2/HmacKeyMetadata.java | 1892 -- .../storage/v2/HmacKeyMetadataOrBuilder.java | 220 - .../google/storage/v2/ListBucketsRequest.java | 1709 -- .../v2/ListBucketsRequestOrBuilder.java | 201 - .../storage/v2/ListBucketsResponse.java | 1127 - .../v2/ListBucketsResponseOrBuilder.java | 103 - .../storage/v2/ListHmacKeysRequest.java | 1488 - .../v2/ListHmacKeysRequestOrBuilder.java | 171 - .../storage/v2/ListHmacKeysResponse.java | 1132 - .../v2/ListHmacKeysResponseOrBuilder.java | 104 - .../storage/v2/ListNotificationsRequest.java | 946 - .../v2/ListNotificationsRequestOrBuilder.java | 100 - .../storage/v2/ListNotificationsResponse.java | 1138 - .../ListNotificationsResponseOrBuilder.java | 104 - .../google/storage/v2/ListObjectsRequest.java | 2523 -- .../v2/ListObjectsRequestOrBuilder.java | 329 - .../storage/v2/ListObjectsResponse.java | 1416 - .../v2/ListObjectsResponseOrBuilder.java | 158 - .../v2/LockBucketRetentionPolicyRequest.java | 1024 - ...BucketRetentionPolicyRequestOrBuilder.java | 103 - .../com/google/storage/v2/Notification.java | 1863 -- .../google/storage/v2/NotificationName.java | 223 - .../storage/v2/NotificationOrBuilder.java | 260 - .../java/com/google/storage/v2/Object.java | 6573 ----- .../storage/v2/ObjectAccessControl.java | 1903 -- .../v2/ObjectAccessControlOrBuilder.java | 238 - .../google/storage/v2/ObjectChecksums.java | 725 - .../storage/v2/ObjectChecksumsOrBuilder.java | 75 - .../google/storage/v2/ObjectOrBuilder.java | 923 - .../java/com/google/storage/v2/Owner.java | 805 - .../com/google/storage/v2/OwnerOrBuilder.java | 75 - .../storage/v2/PredefinedBucketAcl.java | 252 - .../storage/v2/PredefinedObjectAcl.java | 277 - .../com/google/storage/v2/ProjectName.java | 168 - .../com/google/storage/v2/ProjectTeam.java | 810 - .../storage/v2/ProjectTeamOrBuilder.java | 75 - .../storage/v2/QueryWriteStatusRequest.java | 1205 - .../v2/QueryWriteStatusRequestOrBuilder.java | 122 - .../storage/v2/QueryWriteStatusResponse.java | 994 - .../v2/QueryWriteStatusResponseOrBuilder.java | 96 - .../google/storage/v2/ReadObjectRequest.java | 2586 -- .../v2/ReadObjectRequestOrBuilder.java | 358 - .../google/storage/v2/ReadObjectResponse.java | 1649 -- .../v2/ReadObjectResponseOrBuilder.java | 189 - .../storage/v2/RewriteObjectRequest.java | 4444 --- .../v2/RewriteObjectRequestOrBuilder.java | 668 - .../google/storage/v2/RewriteResponse.java | 1201 - .../storage/v2/RewriteResponseOrBuilder.java | 132 - .../com/google/storage/v2/ServiceAccount.java | 635 - .../storage/v2/ServiceAccountOrBuilder.java | 50 - .../google/storage/v2/ServiceConstants.java | 1002 - .../storage/v2/ServiceConstantsOrBuilder.java | 24 - .../v2/StartResumableWriteRequest.java | 1297 - .../StartResumableWriteRequestOrBuilder.java | 130 - .../v2/StartResumableWriteResponse.java | 643 - .../StartResumableWriteResponseOrBuilder.java | 52 - .../com/google/storage/v2/StorageProto.java | 1715 -- .../storage/v2/UpdateBucketRequest.java | 1953 -- .../v2/UpdateBucketRequestOrBuilder.java | 258 - .../storage/v2/UpdateHmacKeyRequest.java | 1339 - .../v2/UpdateHmacKeyRequestOrBuilder.java | 145 - .../storage/v2/UpdateObjectRequest.java | 2409 -- .../v2/UpdateObjectRequestOrBuilder.java | 337 - .../google/storage/v2/WriteObjectRequest.java | 2592 -- .../v2/WriteObjectRequestOrBuilder.java | 299 - .../storage/v2/WriteObjectResponse.java | 982 - .../v2/WriteObjectResponseOrBuilder.java | 92 - .../google/storage/v2/WriteObjectSpec.java | 1440 - .../storage/v2/WriteObjectSpecOrBuilder.java | 199 - .../proto/google/storage/v2/storage.proto | 2177 -- renovate.json | 5 +- samples/install-without-bom/pom.xml | 22 +- samples/native-image-sample/README.md | 80 - samples/native-image-sample/pom.xml | 173 - .../storage/NativeImageStorageSample.java | 92 - .../storage/NativeImageStorageSampleIT.java | 39 - samples/pom.xml | 5 +- samples/snapshot/pom.xml | 16 +- samples/snippets/pom.xml | 8 +- .../com/example/storage/ConfigureRetries.java | 67 - .../storage/GenerateSignedPostPolicyV4.java | 83 - .../example/storage/GetServiceAccount.java | 35 - .../com/example/storage/QuickstartSample.java | 2 +- .../storage/bucket/AddBucketDefaultOwner.java | 46 - .../AddBucketIamConditionalBinding.java | 81 - .../storage/bucket/AddBucketIamMember.java | 64 - .../storage/bucket/AddBucketLabel.java | 57 - .../storage/bucket/AddBucketOwner.java | 49 - .../bucket/ChangeDefaultStorageClass.java | 48 - .../storage/bucket/ConfigureBucketCors.java | 77 - .../example/storage/bucket/CreateBucket.java | 40 - ...eateBucketWithStorageClassAndLocation.java | 60 - .../CreateBucketWithTurboReplication.java | 56 - .../example/storage/bucket/DeleteBucket.java | 39 - .../bucket/DisableBucketVersioning.java | 39 - .../bucket/DisableDefaultEventBasedHold.java | 41 - .../bucket/DisableLifecycleManagement.java | 39 - .../storage/bucket/DisableRequesterPays.java | 43 - .../DisableUniformBucketLevelAccess.java | 46 - .../bucket/EnableBucketVersioning.java | 39 - .../bucket/EnableDefaultEventBasedHold.java | 41 - .../bucket/EnableLifecycleManagement.java | 56 - .../storage/bucket/EnableRequesterPays.java | 39 - .../EnableUniformBucketLevelAccess.java | 44 - .../storage/bucket/GetBucketMetadata.java | 73 - .../example/storage/bucket/GetBucketRpo.java | 39 - .../bucket/GetDefaultEventBasedHold.java | 48 - .../bucket/GetPublicAccessPrevention.java | 48 - .../bucket/GetRequesterPaysStatus.java | 42 - .../storage/bucket/GetRetentionPolicy.java | 51 - .../bucket/GetUniformBucketLevelAccess.java | 54 - .../storage/bucket/ListBucketIamMembers.java | 54 - .../example/storage/bucket/ListBuckets.java | 38 - .../storage/bucket/LockRetentionPolicy.java | 47 - .../storage/bucket/MakeBucketPublic.java | 46 - .../storage/bucket/PrintBucketAcl.java | 51 - .../bucket/PrintBucketAclFilterByUser.java | 46 - .../storage/bucket/RemoveBucketCors.java | 51 - .../bucket/RemoveBucketDefaultKmsKey.java | 39 - .../bucket/RemoveBucketDefaultOwner.java | 48 - .../RemoveBucketIamConditionalBinding.java | 79 - .../storage/bucket/RemoveBucketIamMember.java | 70 - .../storage/bucket/RemoveBucketLabel.java | 56 - .../storage/bucket/RemoveBucketOwner.java | 52 - .../storage/bucket/RemoveRetentionPolicy.java | 50 - .../storage/bucket/SetAsyncTurboRpo.java | 41 - .../bucket/SetBucketDefaultKmsKey.java | 50 - .../storage/bucket/SetBucketWebsiteInfo.java | 53 - .../storage/bucket/SetClientEndpoint.java | 41 - .../example/storage/bucket/SetDefaultRpo.java | 41 - .../SetPublicAccessPreventionEnforced.java | 49 - .../SetPublicAccessPreventionInherited.java | 49 - .../storage/bucket/SetRetentionPolicy.java | 52 - .../example/storage/hmac/ActivateHmacKey.java | 54 - .../example/storage/hmac/CreateHmacKey.java | 60 - .../storage/hmac/DeactivateHmacKey.java | 54 - .../example/storage/hmac/DeleteHmacKey.java | 46 - .../com/example/storage/hmac/GetHmacKey.java | 51 - .../example/storage/hmac/ListHmacKeys.java | 43 - .../example/storage/object/AddFileOwner.java | 59 - .../storage/object/ChangeObjectCsekToKms.java | 68 - .../object/ChangeObjectStorageClass.java | 65 - .../example/storage/object/ComposeObject.java | 68 - .../example/storage/object/CopyObject.java | 55 - .../object/CopyOldVersionOfObject.java | 65 - .../example/storage/object/DeleteObject.java | 40 - .../object/DeleteOldVersionOfObject.java | 51 - .../object/DownloadEncryptedObject.java | 67 - .../storage/object/DownloadObject.java | 56 - .../object/DownloadObjectIntoMemory.java | 48 - .../storage/object/DownloadPublicObject.java | 54 - .../object/DownloadRequesterPaysObject.java | 52 - .../storage/object/GenerateEncryptionKey.java | 39 - .../object/GenerateV4GetObjectSignedUrl.java | 60 - .../object/GenerateV4PutObjectSignedUrl.java | 76 - .../storage/object/GetObjectMetadata.java | 87 - .../example/storage/object/ListObjects.java | 41 - .../object/ListObjectsWithOldVersions.java | 42 - .../storage/object/ListObjectsWithPrefix.java | 69 - .../storage/object/MakeObjectPublic.java | 38 - .../example/storage/object/MoveObject.java | 67 - .../example/storage/object/PrintFileAcl.java | 56 - .../storage/object/PrintFileAclForUser.java | 52 - .../storage/object/ReleaseEventBasedHold.java | 47 - .../storage/object/ReleaseTemporaryHold.java | 47 - .../storage/object/RemoveFileOwner.java | 61 - .../object/RotateObjectEncryptionKey.java | 64 - .../storage/object/SetEventBasedHold.java | 47 - .../storage/object/SetObjectMetadata.java | 50 - .../storage/object/SetTemporaryHold.java | 47 - .../storage/object/StreamObjectDownload.java | 68 - .../storage/object/StreamObjectUpload.java | 58 - .../storage/object/UploadEncryptedObject.java | 66 - .../object/UploadKmsEncryptedObject.java | 59 - .../example/storage/object/UploadObject.java | 53 - .../object/UploadObjectFromMemory.java | 59 - .../example/storage/ConfigureRetriesTest.java | 66 - .../com/example/storage/ITBucketSnippets.java | 658 - .../com/example/storage/ITHmacSnippets.java | 169 - .../com/example/storage/ITObjectSnippets.java | 455 - .../example/storage/ITStorageSnippets.java | 148 - .../example/storage/QuickstartSampleIT.java | 4 +- .../java/com/example/storage/TestBase.java | 54 - .../bucket/AddBucketDefaultOwnerTest.java | 39 - .../storage/bucket/AddBucketOwnerTest.java | 40 - .../PrintBucketAclFilterByUserTest.java | 44 - .../storage/bucket/PrintBucketAclTest.java | 43 - .../bucket/RemoveBucketDefaultOwnerTest.java | 54 - .../storage/bucket/RemoveBucketOwnerTest.java | 56 - .../storage/object/AddFileOwnerTest.java | 41 - .../object/PrintFileAclForUserTest.java | 56 - .../storage/object/PrintFileAclTest.java | 43 - .../storage/object/RemoveFileOwnerTest.java | 60 - synth.metadata | 91 +- owlbot.py => synth.py | 15 +- versions.txt | 5 +- 368 files changed, 1855 insertions(+), 148661 deletions(-) delete mode 100644 .github/.OwlBot.yaml delete mode 100644 .github/cherry-pick-bot.yml create mode 100644 .github/readme/synth.metadata/synth.metadata rename .github/{.OwlBot.lock.yaml => readme/synth.py} (67%) delete mode 100644 .github/release-trigger.yml create mode 100644 .github/workflows/formatting.yaml create mode 100644 .kokoro/continuous/readme.cfg create mode 100755 .kokoro/linkage-monitor.sh delete mode 100644 .kokoro/nightly/java11-integration.cfg delete mode 100644 .kokoro/presubmit/graalvm-native.cfg delete mode 100644 .kokoro/release/publish_javadoc11.cfg delete mode 100755 .kokoro/release/publish_javadoc11.sh delete mode 100644 SECURITY.md delete mode 100644 gapic-google-cloud-storage-v2/pom.xml delete mode 100644 gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageClient.java delete mode 100644 gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageSettings.java delete mode 100644 gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/package-info.java delete mode 100644 gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageCallableFactory.java delete mode 100644 gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageStub.java delete mode 100644 gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStub.java delete mode 100644 gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStubSettings.java delete mode 100644 gapic-google-cloud-storage-v2/src/main/resources/com/google/storage/v2/gapic_metadata.json delete mode 100644 gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorage.java delete mode 100644 gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorageImpl.java delete mode 100644 gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/StorageClientTest.java delete mode 100644 google-cloud-storage/assets/retry-conformance-tests-diagram.png delete mode 100644 google-cloud-storage/assets/retry-conformance-tests-diagram.txt delete mode 100644 google-cloud-storage/conformance-testing.md delete mode 100644 google-cloud-storage/src/main/java/com/google/cloud/storage/DefaultStorageRetryStrategy.java delete mode 100644 google-cloud-storage/src/main/java/com/google/cloud/storage/ResumableMedia.java delete mode 100644 google-cloud-storage/src/main/java/com/google/cloud/storage/RetryAlgorithmManager.java delete mode 100644 google-cloud-storage/src/main/java/com/google/cloud/storage/Retrying.java delete mode 100644 google-cloud-storage/src/main/java/com/google/cloud/storage/Rpo.java delete mode 100644 google-cloud-storage/src/main/java/com/google/cloud/storage/StorageRetryStrategy.java delete mode 100644 google-cloud-storage/src/main/java/com/google/cloud/storage/UniformStorageRetryStrategy.java delete mode 100644 google-cloud-storage/src/test/java/com/google/cloud/storage/DataGeneration.java delete mode 100644 google-cloud-storage/src/test/java/com/google/cloud/storage/DefaultRetryHandlingBehaviorTest.java delete mode 100644 google-cloud-storage/src/test/java/com/google/cloud/storage/PackagePrivateMethodWorkarounds.java delete mode 100644 google-cloud-storage/src/test/java/com/google/cloud/storage/ResumableMediaTest.java delete mode 100644 google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/CleanupStrategy.java delete mode 100644 google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/Ctx.java delete mode 100644 google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/CtxFunctions.java delete mode 100644 google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/Functions.java delete mode 100644 google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/GracefulConformanceEnforcement.java delete mode 100644 google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ITRetryConformanceTest.java delete mode 100644 google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ParallelParameterized.java delete mode 100644 google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java delete mode 100644 google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethod.java delete mode 100644 google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMapping.java delete mode 100644 google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java delete mode 100644 google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/State.java delete mode 100644 google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/TestBench.java delete mode 100644 google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/TestRetryConformance.java delete mode 100644 google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBlobWriteChannelTest.java delete mode 100644 google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/hello-world.txt delete mode 100644 google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/testNamesWhichCanFail.txt delete mode 100644 grpc-google-cloud-storage-v2/pom.xml delete mode 100644 grpc-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageGrpc.java delete mode 100644 proto-google-cloud-storage-v2/clirr-ignored-differences.xml delete mode 100644 proto-google-cloud-storage-v2/pom.xml delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Bucket.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketAccessControl.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketAccessControlOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketName.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ChecksummedData.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ChecksummedDataOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonObjectRequestParams.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonObjectRequestParamsOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonRequestParams.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonRequestParamsOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ComposeObjectRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ComposeObjectRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ContentRange.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ContentRangeOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateBucketRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateBucketRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateHmacKeyRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateHmacKeyRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateHmacKeyResponse.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateHmacKeyResponseOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateNotificationRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateNotificationRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CryptoKeyName.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CustomerEncryption.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CustomerEncryptionOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteBucketRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteBucketRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteHmacKeyRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteHmacKeyRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteNotificationRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteNotificationRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteObjectRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteObjectRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetBucketRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetBucketRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetHmacKeyRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetHmacKeyRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetNotificationRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetNotificationRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetObjectRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetObjectRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetServiceAccountRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetServiceAccountRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/HmacKeyMetadata.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/HmacKeyMetadataOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListBucketsRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListBucketsRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListBucketsResponse.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListBucketsResponseOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListHmacKeysRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListHmacKeysRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListHmacKeysResponse.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListHmacKeysResponseOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationsRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationsRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationsResponse.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationsResponseOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListObjectsRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListObjectsRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListObjectsResponse.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListObjectsResponseOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/LockBucketRetentionPolicyRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/LockBucketRetentionPolicyRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Notification.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/NotificationName.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/NotificationOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Object.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectAccessControl.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectAccessControlOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectChecksums.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectChecksumsOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Owner.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/OwnerOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/PredefinedBucketAcl.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/PredefinedObjectAcl.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ProjectName.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ProjectTeam.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ProjectTeamOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponse.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponseOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectResponse.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectResponseOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/RewriteObjectRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/RewriteObjectRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/RewriteResponse.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/RewriteResponseOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceAccount.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceAccountOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceConstants.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceConstantsOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponse.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponseOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageProto.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateBucketRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateBucketRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateHmacKeyRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateHmacKeyRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateObjectRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateObjectRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequest.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequestOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponse.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponseOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpec.java delete mode 100644 proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpecOrBuilder.java delete mode 100644 proto-google-cloud-storage-v2/src/main/proto/google/storage/v2/storage.proto delete mode 100644 samples/native-image-sample/README.md delete mode 100644 samples/native-image-sample/pom.xml delete mode 100644 samples/native-image-sample/src/main/java/com/example/storage/NativeImageStorageSample.java delete mode 100644 samples/native-image-sample/src/test/java/com/example/storage/NativeImageStorageSampleIT.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/ConfigureRetries.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/GenerateSignedPostPolicyV4.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/GetServiceAccount.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/AddBucketDefaultOwner.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/AddBucketIamConditionalBinding.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/AddBucketIamMember.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/AddBucketLabel.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/AddBucketOwner.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/ChangeDefaultStorageClass.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/ConfigureBucketCors.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/CreateBucket.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/CreateBucketWithStorageClassAndLocation.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/CreateBucketWithTurboReplication.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/DeleteBucket.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/DisableBucketVersioning.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/DisableDefaultEventBasedHold.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/DisableLifecycleManagement.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/DisableRequesterPays.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/DisableUniformBucketLevelAccess.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/EnableBucketVersioning.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/EnableDefaultEventBasedHold.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/EnableLifecycleManagement.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/EnableRequesterPays.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/EnableUniformBucketLevelAccess.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/GetBucketMetadata.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/GetBucketRpo.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/GetDefaultEventBasedHold.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/GetPublicAccessPrevention.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/GetRequesterPaysStatus.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/GetRetentionPolicy.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/GetUniformBucketLevelAccess.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/ListBucketIamMembers.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/ListBuckets.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/LockRetentionPolicy.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/MakeBucketPublic.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/PrintBucketAcl.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/PrintBucketAclFilterByUser.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketCors.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketDefaultKmsKey.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketDefaultOwner.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketIamConditionalBinding.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketIamMember.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketLabel.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketOwner.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/RemoveRetentionPolicy.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/SetAsyncTurboRpo.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/SetBucketDefaultKmsKey.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/SetBucketWebsiteInfo.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/SetClientEndpoint.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/SetDefaultRpo.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/SetPublicAccessPreventionEnforced.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/SetPublicAccessPreventionInherited.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/bucket/SetRetentionPolicy.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/hmac/ActivateHmacKey.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/hmac/CreateHmacKey.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/hmac/DeactivateHmacKey.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/hmac/DeleteHmacKey.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/hmac/GetHmacKey.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/hmac/ListHmacKeys.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/AddFileOwner.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/ChangeObjectCsekToKms.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/ChangeObjectStorageClass.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/ComposeObject.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/CopyObject.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/CopyOldVersionOfObject.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/DeleteObject.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/DeleteOldVersionOfObject.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/DownloadEncryptedObject.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/DownloadObject.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/DownloadObjectIntoMemory.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/DownloadPublicObject.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/DownloadRequesterPaysObject.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/GenerateEncryptionKey.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/GenerateV4GetObjectSignedUrl.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/GenerateV4PutObjectSignedUrl.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/GetObjectMetadata.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/ListObjects.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/ListObjectsWithOldVersions.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/ListObjectsWithPrefix.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/MakeObjectPublic.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/MoveObject.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/PrintFileAcl.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/PrintFileAclForUser.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/ReleaseEventBasedHold.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/ReleaseTemporaryHold.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/RemoveFileOwner.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/RotateObjectEncryptionKey.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/SetEventBasedHold.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/SetObjectMetadata.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/SetTemporaryHold.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/StreamObjectDownload.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/StreamObjectUpload.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/UploadEncryptedObject.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/UploadKmsEncryptedObject.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/UploadObject.java delete mode 100644 samples/snippets/src/main/java/com/example/storage/object/UploadObjectFromMemory.java delete mode 100644 samples/snippets/src/test/java/com/example/storage/ConfigureRetriesTest.java delete mode 100644 samples/snippets/src/test/java/com/example/storage/ITBucketSnippets.java delete mode 100644 samples/snippets/src/test/java/com/example/storage/ITHmacSnippets.java delete mode 100644 samples/snippets/src/test/java/com/example/storage/ITObjectSnippets.java delete mode 100644 samples/snippets/src/test/java/com/example/storage/ITStorageSnippets.java delete mode 100644 samples/snippets/src/test/java/com/example/storage/TestBase.java delete mode 100644 samples/snippets/src/test/java/com/example/storage/bucket/AddBucketDefaultOwnerTest.java delete mode 100644 samples/snippets/src/test/java/com/example/storage/bucket/AddBucketOwnerTest.java delete mode 100644 samples/snippets/src/test/java/com/example/storage/bucket/PrintBucketAclFilterByUserTest.java delete mode 100644 samples/snippets/src/test/java/com/example/storage/bucket/PrintBucketAclTest.java delete mode 100644 samples/snippets/src/test/java/com/example/storage/bucket/RemoveBucketDefaultOwnerTest.java delete mode 100644 samples/snippets/src/test/java/com/example/storage/bucket/RemoveBucketOwnerTest.java delete mode 100644 samples/snippets/src/test/java/com/example/storage/object/AddFileOwnerTest.java delete mode 100644 samples/snippets/src/test/java/com/example/storage/object/PrintFileAclForUserTest.java delete mode 100644 samples/snippets/src/test/java/com/example/storage/object/PrintFileAclTest.java delete mode 100644 samples/snippets/src/test/java/com/example/storage/object/RemoveFileOwnerTest.java rename owlbot.py => synth.py (61%) diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml deleted file mode 100644 index e1b432019a..0000000000 --- a/.github/.OwlBot.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -docker: - image: "gcr.io/cloud-devrel-public-resources/owlbot-java:latest" - -deep-remove-regex: -- "/grpc-google-.*/src" -- "/proto-google-.*/src" -- "/gapic-google-.*/src" - -deep-copy-regex: -- source: "/google/storage/v2/.*-java/proto-google-.*/src" - dest: "/owl-bot-staging/v2/proto-google-cloud-storage-v2/src" -- source: "/google/storage/v2/.*-java/grpc-google-.*/src" - dest: "/owl-bot-staging/v2/grpc-google-cloud-storage-v2/src" -- source: "/google/storage/v2/.*-java/gapic-google-.*/src" - dest: "/owl-bot-staging/v2/gapic-google-cloud-storage-v2/src" -- source: "/google/storage/v2/google-cloud-storage-v2-java/gapic-google-cloud-storage-v2-java/src/main/java/com/google/storage/v2/gapic_metadata.json" - dest: "/owl-bot-staging/v2/gapic-google-cloud-storage-v2/src/main/resources/com/google/storage/v2/gapic_metadata.json" diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 58577bff43..af60dcee54 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,9 +4,9 @@ # For syntax help see: # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax -# The @googleapis/cloud-storage-dpe is the default owner for changes in this repo -* @googleapis/yoshi-java @googleapis/cloud-storage-dpe -**/*.java @googleapis/cloud-storage-dpe +# The @googleapis/storage-dpe is the default owner for changes in this repo +* @googleapis/yoshi-java @googleapis/storage-dpe +**/*.java @googleapis/storage-dpe # The java-samples-reviewers team is the default owner for samples changes samples/**/*.java @googleapis/java-samples-reviewers diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index cef26db6ee..dcbafdd94e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -21,7 +21,7 @@ If you are still having issues, please include as much information as possible: General, Core, and Other are also allowed as types 2. OS type and version: 3. Java version: -4. version(s): +4. storage version(s): #### Steps to reproduce diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 4bfec61083..330f81ef50 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -5,6 +5,3 @@ Thank you for opening a Pull Request! Before submitting your PR, there are a few - [ ] Appropriate docs were updated (if necessary) Fixes # ☕️ - -If you write sample code, please follow the [samples format]( -https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md). diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml index 2176b05432..1a23ea42b1 100644 --- a/.github/blunderbuss.yml +++ b/.github/blunderbuss.yml @@ -1,5 +1,5 @@ # Configuration for the Blunderbuss GitHub app. For more info see -# https://github.com/googleapis/repo-automation-bots/tree/main/packages/blunderbuss +# https://github.com/googleapis/repo-automation-bots/tree/master/packages/blunderbuss assign_prs_by: - labels: - samples diff --git a/.github/cherry-pick-bot.yml b/.github/cherry-pick-bot.yml deleted file mode 100644 index d4ca94189e..0000000000 --- a/.github/cherry-pick-bot.yml +++ /dev/null @@ -1 +0,0 @@ -enabled: true diff --git a/.github/generated-files-bot.yml b/.github/generated-files-bot.yml index c644a24e11..20f3acc281 100644 --- a/.github/generated-files-bot.yml +++ b/.github/generated-files-bot.yml @@ -5,8 +5,3 @@ externalManifests: - type: json file: '.github/readme/synth.metadata/synth.metadata' jsonpath: '$.generatedFiles[*]' -ignoreAuthors: -- 'renovate-bot' -- 'yoshi-automation' -- 'release-please[bot]' -- 'gcf-owl-bot[bot]' diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata new file mode 100644 index 0000000000..8e259d1a36 --- /dev/null +++ b/.github/readme/synth.metadata/synth.metadata @@ -0,0 +1,18 @@ +{ + "sources": [ + { + "git": { + "name": ".", + "remote": "https://github.com/googleapis/java-storage.git", + "sha": "444a8da44e9a80b806b5880a55d2628e3d5f25ef" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "943bb78606d035001123030067dffcc34f4645f2" + } + } + ] +} \ No newline at end of file diff --git a/.github/.OwlBot.lock.yaml b/.github/readme/synth.py similarity index 67% rename from .github/.OwlBot.lock.yaml rename to .github/readme/synth.py index 3473042c08..7b48cc28d3 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/readme/synth.py @@ -1,16 +1,19 @@ -# Copyright 2022 Google LLC +# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# 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. -docker: - image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:df8d7b2cc0dbc65871e7edd86601901a0612b272fa3f7f0eb590c5c53aa5f92e + +"""This script is used to synthesize generated the README for this library.""" + +from synthtool.languages import java + +java.custom_templates(["java_library/README.md"]) diff --git a/.github/release-please.yml b/.github/release-please.yml index 069b973227..dce2c84509 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1,24 +1,2 @@ -bumpMinorPreMajor: true -handleGHRelease: true releaseType: java-yoshi -branches: - - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-lts - branch: 1.113.14-sp - - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-yoshi - branch: 1.106.1-patch - - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-yoshi - branch: 1.111.3-patch - - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-yoshi - branch: java7 - - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-yoshi - branch: 2.1.x +bumpMinorPreMajor: true \ No newline at end of file diff --git a/.github/release-trigger.yml b/.github/release-trigger.yml deleted file mode 100644 index d4ca94189e..0000000000 --- a/.github/release-trigger.yml +++ /dev/null @@ -1 +0,0 @@ -enabled: true diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 47afe3b4e7..6bddd18eac 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -1,100 +1,49 @@ + +# Whether or not rebase-merging is enabled on this repository. +# Defaults to `true` rebaseMergeAllowed: false + +# Whether or not squash-merging is enabled on this repository. +# Defaults to `true` squashMergeAllowed: true + +# Whether or not PRs are merged with a merge commit on this repository. +# Defaults to `false` mergeCommitAllowed: false + +# Rules for master branch protection branchProtectionRules: - - pattern: main - isAdminEnforced: true - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: false - requiredStatusCheckContexts: - - dependencies (8) - - dependencies (11) - - lint - - clirr - - units (8) - - units (11) - - 'Kokoro - Test: Integration' - - cla/google - - OwlBot Post Processor - - pattern: 1.113.14-sp - isAdminEnforced: true - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: false - requiredStatusCheckContexts: - - dependencies (8) - - dependencies (11) - - lint - - clirr - - units (7) - - units (8) - - units (11) - - 'Kokoro - Test: Integration' - - cla/google - - pattern: 1.106.1-patch - isAdminEnforced: true - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: false - requiredStatusCheckContexts: - - dependencies (8) - - dependencies (11) - - lint - - clirr - - units (7) - - units (8) - - units (11) - - 'Kokoro - Test: Integration' - - cla/google - - pattern: 1.111.3-patch - isAdminEnforced: true - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: false - requiredStatusCheckContexts: - - dependencies (8) - - dependencies (11) - - lint - - clirr - - units (7) - - units (8) - - units (11) - - 'Kokoro - Test: Integration' - - cla/google - - pattern: java7 - isAdminEnforced: true - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: false - requiredStatusCheckContexts: - - dependencies (8) - - dependencies (11) - - lint - - clirr - - units (7) - - units (8) - - units (11) - - 'Kokoro - Test: Integration' - - cla/google - - pattern: 2.1.x - isAdminEnforced: true - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: false - requiredStatusCheckContexts: - - dependencies (8) - - dependencies (11) - - lint - - clirr - - units (8) - - units (11) - - 'Kokoro - Test: Integration' - - cla/google +# Identifies the protection rule pattern. Name of the branch to be protected. +# Defaults to `master` +- pattern: master + # Can admins overwrite branch protection. + # Defaults to `true` + isAdminEnforced: true + # Number of approving reviews required to update matching branches. + # Defaults to `1` + requiredApprovingReviewCount: 1 + # Are reviews from code owners required to update matching branches. + # Defaults to `false` + requiresCodeOwnerReviews: true + # Require up to date branches + requiresStrictStatusChecks: false + # List of required status check contexts that must pass for commits to be accepted to matching branches. + requiredStatusCheckContexts: + - "dependencies (8)" + - "dependencies (11)" + - "linkage-monitor" + - "lint" + - "clirr" + - "units (7)" + - "units (8)" + - "units (11)" + - "Kokoro - Test: Integration" + - "cla/google" +# List of explicit permissions to add (additive only) permissionRules: - - team: yoshi-admins - permission: admin - - team: yoshi-java-admins - permission: admin - - team: yoshi-java - permission: push +- team: yoshi-admins + permission: admin +- team: yoshi-java-admins + permission: admin +- team: yoshi-java + permission: push \ No newline at end of file diff --git a/.github/trusted-contribution.yml b/.github/trusted-contribution.yml index a0ba1f7d90..f247d5c789 100644 --- a/.github/trusted-contribution.yml +++ b/.github/trusted-contribution.yml @@ -1,3 +1,2 @@ trustedContributors: -- renovate-bot -- gcf-owl-bot[bot] +- renovate-bot \ No newline at end of file diff --git a/.github/workflows/approve-readme.yaml b/.github/workflows/approve-readme.yaml index f5fc7d5169..7513acaebc 100644 --- a/.github/workflows/approve-readme.yaml +++ b/.github/workflows/approve-readme.yaml @@ -1,18 +1,3 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Github action job to test core java library features on -# downstream client libraries before they are released. on: pull_request: name: auto-merge-readme @@ -21,7 +6,7 @@ jobs: runs-on: ubuntu-latest if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme' steps: - - uses: actions/github-script@v6 + - uses: actions/github-script@v3 with: github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} script: | diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml index 7a106d007e..2b6cdbc976 100644 --- a/.github/workflows/auto-release.yaml +++ b/.github/workflows/auto-release.yaml @@ -1,27 +1,12 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Github action job to test core java library features on -# downstream client libraries before they are released. on: pull_request: name: auto-release jobs: approve: runs-on: ubuntu-latest - if: contains(github.head_ref, 'release-please') + if: contains(github.head_ref, 'release-v') steps: - - uses: actions/github-script@v6 + - uses: actions/github-script@v3 with: github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} debug: true @@ -31,13 +16,13 @@ jobs: return; } - // only approve PRs like "chore(main): release " - if ( !context.payload.pull_request.title.startsWith("chore(main): release") ) { + // only approve PRs like "chore: release " + if ( !context.payload.pull_request.title.startsWith("chore: release") ) { return; } // only approve PRs with pom.xml and versions.txt changes - const filesPromise = github.rest.pulls.listFiles.endpoint({ + const filesPromise = github.pulls.listFiles.endpoint({ owner: context.repo.owner, repo: context.repo.repo, pull_number: context.payload.pull_request.number, @@ -69,7 +54,7 @@ jobs: return; } - const promise = github.rest.pulls.list.endpoint({ + const promise = github.pulls.list.endpoint({ owner: context.repo.owner, repo: context.repo.repo, state: 'open' @@ -86,7 +71,7 @@ jobs: } // approve release PR - await github.rest.pulls.createReview({ + await github.pulls.createReview({ owner: context.repo.owner, repo: context.repo.repo, body: 'Rubber stamped release!', @@ -95,7 +80,7 @@ jobs: }); // attach kokoro:force-run and automerge labels - await github.rest.issues.addLabels({ + await github.issues.addLabels({ owner: context.repo.owner, repo: context.repo.repo, issue_number: context.payload.pull_request.number, diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 83ef7f9c2c..6830220756 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,48 +1,34 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Github action job to test core java library features on -# downstream client libraries before they are released. on: push: branches: - - main + - master pull_request: name: ci jobs: units: runs-on: ubuntu-latest strategy: - fail-fast: false matrix: - java: [8, 11, 17] + java: [7, 8, 11] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 with: - distribution: zulu java-version: ${{matrix.java}} - run: java -version - run: .kokoro/build.sh env: JOB_TYPE: test + - name: coverage + uses: codecov/codecov-action@v1 + with: + name: actions ${{matrix.java}} windows: runs-on: windows-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 with: - distribution: zulu java-version: 8 - run: java -version - run: .kokoro/build.bat @@ -52,23 +38,30 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [8, 11, 17] + java: [8, 11] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 with: - distribution: zulu java-version: ${{matrix.java}} - run: java -version - run: .kokoro/dependencies.sh + linkage-monitor: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/linkage-monitor.sh lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 with: - distribution: zulu - java-version: 11 + java-version: 8 - run: java -version - run: .kokoro/build.sh env: @@ -76,12 +69,11 @@ jobs: clirr: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 with: - distribution: zulu java-version: 8 - run: java -version - run: .kokoro/build.sh env: - JOB_TYPE: clirr + JOB_TYPE: clirr \ No newline at end of file diff --git a/.github/workflows/formatting.yaml b/.github/workflows/formatting.yaml new file mode 100644 index 0000000000..6844407b4d --- /dev/null +++ b/.github/workflows/formatting.yaml @@ -0,0 +1,25 @@ +on: + pull_request_target: + types: [opened, synchronize] + branches: + - master +name: format +jobs: + format-code: + runs-on: ubuntu-latest + env: + ACCESS_TOKEN: ${{ secrets.YOSHI_CODE_BOT_TOKEN }} + steps: + - uses: actions/checkout@v2 + with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + - uses: actions/setup-java@v1 + with: + java-version: 11 + - run: "mvn com.coveo:fmt-maven-plugin:format" + - uses: googleapis/code-suggester@v1 + with: + command: review + pull_number: ${{ github.event.pull_request.number }} + git_dir: '.' diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml index 912ed8b2b0..c46230a78c 100644 --- a/.github/workflows/samples.yaml +++ b/.github/workflows/samples.yaml @@ -1,18 +1,3 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Github action job to test core java library features on -# downstream client libraries before they are released. on: pull_request: name: samples @@ -20,10 +5,9 @@ jobs: checkstyle: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 with: - distribution: zulu java-version: 8 - name: Run checkstyle run: mvn -P lint --quiet --batch-mode checkstyle:check diff --git a/.kokoro/build.bat b/.kokoro/build.bat index 067cf4a4c4..05826ad93f 100644 --- a/.kokoro/build.bat +++ b/.kokoro/build.bat @@ -1,18 +1,3 @@ -:: Copyright 2022 Google LLC -:: -:: Licensed under the Apache License, Version 2.0 (the "License"); -:: you may not use this file except in compliance with the License. -:: You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, software -:: distributed under the License is distributed on an "AS IS" BASIS, -:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -:: See the License for the specific language governing permissions and -:: limitations under the License. -:: Github action job to test core java library features on -:: downstream client libraries before they are released. :: See documentation in type-shell-output.bat "C:\Program Files\Git\bin\bash.exe" %~dp0build.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 7ac519891b..938f069faa 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -23,13 +23,13 @@ cd ${scriptDir}/.. # include common functions source ${scriptDir}/common.sh -# Print out Maven & Java version -mvn -version +# Print out Java version +java -version echo ${JOB_TYPE} # attempt to install 3 times with exponential backoff (starting with 10 seconds) retry_with_backoff 3 10 \ - mvn install -B -V -ntp \ + mvn install -B -V \ -DskipTests=true \ -Dclirr.skip=true \ -Denforcer.skip=true \ @@ -37,7 +37,7 @@ retry_with_backoff 3 10 \ -Dgcloud.download.skip=true \ -T 1C -# if GOOGLE_APPLICATION_CREDENTIALS is specified as a relative path, prepend Kokoro root directory onto it +# if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS}) fi @@ -47,20 +47,19 @@ set +e case ${JOB_TYPE} in test) - mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true + mvn test -B -Dclirr.skip=true -Denforcer.skip=true RETURN_CODE=$? ;; lint) - mvn com.coveo:fmt-maven-plugin:check -B -ntp + mvn com.coveo:fmt-maven-plugin:check RETURN_CODE=$? ;; javadoc) - mvn javadoc:javadoc javadoc:test-javadoc -B -ntp + mvn javadoc:javadoc javadoc:test-javadoc RETURN_CODE=$? ;; integration) mvn -B ${INTEGRATION_TEST_ARGS} \ - -ntp \ -Penable-integration-tests \ -DtrimStackTrace=false \ -Dclirr.skip=true \ @@ -69,11 +68,6 @@ integration) verify RETURN_CODE=$? ;; -graalvm) - # Run Unit and Integration Tests with Native Image - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test - RETURN_CODE=$? - ;; samples) SAMPLES_DIR=samples # only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise. @@ -84,14 +78,9 @@ samples) if [[ -f ${SAMPLES_DIR}/pom.xml ]] then - for FILE in ${KOKORO_GFILE_DIR}/secret_manager/*-samples-secrets; do - [[ -f "$FILE" ]] || continue - source "$FILE" - done - pushd ${SAMPLES_DIR} mvn -B \ - -ntp \ + -Penable-samples \ -DtrimStackTrace=false \ -Dclirr.skip=true \ -Denforcer.skip=true \ @@ -104,7 +93,7 @@ samples) fi ;; clirr) - mvn -B -ntp -Denforcer.skip=true clirr:check + mvn -B -Denforcer.skip=true clirr:check RETURN_CODE=$? ;; *) @@ -119,10 +108,10 @@ fi # fix output location of logs bash .kokoro/coerce_logs.sh -if [[ "${ENABLE_FLAKYBOT}" == "true" ]] +if [[ "${ENABLE_BUILD_COP}" == "true" ]] then - chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot - ${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-storage + chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/buildcop + ${KOKORO_GFILE_DIR}/linux_amd64/buildcop -repo=googleapis/java-storage fi echo "exiting with ${RETURN_CODE}" diff --git a/.kokoro/coerce_logs.sh b/.kokoro/coerce_logs.sh index 46edbf7f2f..5cf7ba49e6 100755 --- a/.kokoro/coerce_logs.sh +++ b/.kokoro/coerce_logs.sh @@ -28,6 +28,7 @@ job=$(basename ${KOKORO_JOB_NAME}) echo "coercing sponge logs..." for xml in `find . -name *-sponge_log.xml` do + echo "processing ${xml}" class=$(basename ${xml} | cut -d- -f2) dir=$(dirname ${xml})/${job}/${class} text=$(dirname ${xml})/${class}-sponge_log.txt diff --git a/.kokoro/continuous/readme.cfg b/.kokoro/continuous/readme.cfg new file mode 100644 index 0000000000..233f84ab15 --- /dev/null +++ b/.kokoro/continuous/readme.cfg @@ -0,0 +1,55 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# 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. + +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-storage/.kokoro/readme.sh" +} + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.log" + } +} + +# The github token is stored here. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "yoshi-automation-github-key" + # TODO(theacodes): remove this after secrets have globally propagated + backend_type: FASTCONFIGPUSH + } + } +} + +# Common env vars for all repositories and builds. +env_vars: { + key: "GITHUB_USER" + value: "yoshi-automation" +} +env_vars: { + key: "GITHUB_EMAIL" + value: "yoshi-automation@google.com" +} diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh index d7476cfe97..c91e5a5693 100755 --- a/.kokoro/dependencies.sh +++ b/.kokoro/dependencies.sh @@ -14,7 +14,6 @@ # limitations under the License. set -eo pipefail -shopt -s nullglob ## Get the directory of the build script scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) @@ -28,32 +27,12 @@ source ${scriptDir}/common.sh java -version echo $JOB_TYPE -function determineMavenOpts() { - local javaVersion=$( - # filter down to the version line, then pull out the version between quotes, - # then trim the version number down to its minimal number (removing any - # update or suffix number). - java -version 2>&1 | grep "version" \ - | sed -E 's/^.*"(.*?)".*$/\1/g' \ - | sed -E 's/^(1\.[0-9]\.0).*$/\1/g' - ) - - if [[ $javaVersion == 17* ]] - then - # MaxPermSize is no longer supported as of jdk 17 - echo -n "-Xmx1024m" - else - echo -n "-Xmx1024m -XX:MaxPermSize=128m" - fi -} - -export MAVEN_OPTS=$(determineMavenOpts) +export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" # this should run maven enforcer retry_with_backoff 3 10 \ - mvn install -B -V -ntp \ + mvn install -B -V \ -DskipTests=true \ - -Dmaven.javadoc.skip=true \ -Dclirr.skip=true mvn -B dependency:analyze -DfailOnWarning=true @@ -66,7 +45,7 @@ function completenessCheck() { # This is stripped from the output as it is not present in the flattened pom. # Only dependencies with 'compile' or 'runtime' scope are included from original dependency list. msg "Generating dependency list using original pom..." - mvn dependency:list -f pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e 's/ --.*//' >.org-list.txt + mvn dependency:list -f pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e s/\\s--\\smodule.*// >.org-list.txt # Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes) msg "Generating dependency list using flattened pom..." @@ -90,7 +69,7 @@ function completenessCheck() { set +e error_count=0 -for path in **/.flattened-pom.xml +for path in $(find -name ".flattened-pom.xml") do # Check flattened pom in each dir that contains it for completeness dir=$(dirname "$path") @@ -107,4 +86,4 @@ then else msg "Errors found. See log statements above." exit 1 -fi +fi \ No newline at end of file diff --git a/.kokoro/linkage-monitor.sh b/.kokoro/linkage-monitor.sh new file mode 100755 index 0000000000..759ab4e2c2 --- /dev/null +++ b/.kokoro/linkage-monitor.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.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. + +set -eo pipefail +# Display commands being run. +set -x + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Java version +java -version +echo ${JOB_TYPE} + +# attempt to install 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true + +# Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR +JAR=linkage-monitor-latest-all-deps.jar +curl -v -O "https://storage.googleapis.com/cloud-opensource-java-linkage-monitor/${JAR}" + +# Fails if there's new linkage errors compared with baseline +java -jar ${JAR} com.google.cloud:libraries-bom diff --git a/.kokoro/nightly/java11-integration.cfg b/.kokoro/nightly/java11-integration.cfg deleted file mode 100644 index d9f212e255..0000000000 --- a/.kokoro/nightly/java11-integration.cfg +++ /dev/null @@ -1,41 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/java11014" -} -env_vars: { - key: "JOB_TYPE" - value: "integration" -} -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "ENABLE_BUILD_COP" - value: "true" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-it-service-account" -} - -env_vars: { - key: "IT_SERVICE_ACCOUNT_EMAIL" - value: "it-service-account@gcloud-devel.iam.gserviceaccount.com" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-it-service-account" -} diff --git a/.kokoro/nightly/samples.cfg b/.kokoro/nightly/samples.cfg index 2ddc75c91c..f25429314f 100644 --- a/.kokoro/nightly/samples.cfg +++ b/.kokoro/nightly/samples.cfg @@ -33,14 +33,6 @@ env_vars: { } env_vars: { - key: "ENABLE_FLAKYBOT" + key: "ENABLE_BUILD_COP" value: "true" } - -# This service account we want to be any valid account not used for -# GOOGLE_APPLICATION_CREDENTIALS in the tests -env_vars: { - key: "IT_SERVICE_ACCOUNT_EMAIL" - value: "samples@java-docs-samples-testing.iam.gserviceaccount.com" -} - diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg deleted file mode 100644 index 4c7225ec92..0000000000 --- a/.kokoro/presubmit/graalvm-native.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm" -} - -env_vars: { - key: "JOB_TYPE" - value: "graalvm" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-it-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-it-service-account" -} diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg index f5192cfde3..4989fa2695 100644 --- a/.kokoro/presubmit/integration.cfg +++ b/.kokoro/presubmit/integration.cfg @@ -27,13 +27,12 @@ env_vars: { value: "secret_manager/java-it-service-account" } -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-it-service-account" -} - env_vars: { key: "IT_SERVICE_ACCOUNT_EMAIL" value: "it-service-account@gcloud-devel.iam.gserviceaccount.com" } +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/.kokoro/presubmit/samples.cfg b/.kokoro/presubmit/samples.cfg index 9277cc8384..01e0960047 100644 --- a/.kokoro/presubmit/samples.cfg +++ b/.kokoro/presubmit/samples.cfg @@ -30,12 +30,4 @@ env_vars: { env_vars: { key: "SECRET_MANAGER_KEYS" value: "java-docs-samples-service-account" -} - -# This service account we want to be any valid account not used for -# GOOGLE_APPLICATION_CREDENTIALS in the tests -env_vars: { - key: "IT_SERVICE_ACCOUNT_EMAIL" - value: "samples@java-docs-samples-testing.iam.gserviceaccount.com" -} - +} \ No newline at end of file diff --git a/.kokoro/release/common.sh b/.kokoro/release/common.sh index 7f78ee414f..6e3f65999b 100755 --- a/.kokoro/release/common.sh +++ b/.kokoro/release/common.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2018 Google LLC +# Copyright 2018 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.kokoro/release/drop.sh b/.kokoro/release/drop.sh index 742ec1a886..5c4551efa2 100755 --- a/.kokoro/release/drop.sh +++ b/.kokoro/release/drop.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2018 Google LLC +# Copyright 2018 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.kokoro/release/promote.sh b/.kokoro/release/promote.sh index 3cac3d8a97..1fa95fa537 100755 --- a/.kokoro/release/promote.sh +++ b/.kokoro/release/promote.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2018 Google LLC +# Copyright 2018 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg index ab50da64c9..24d1b20a35 100644 --- a/.kokoro/release/publish_javadoc.cfg +++ b/.kokoro/release/publish_javadoc.cfg @@ -7,6 +7,12 @@ env_vars: { value: "docs-staging" } +env_vars: { + key: "STAGING_BUCKET_V2" + value: "docs-staging-v2" + # Production will be at: docs-staging-v2 +} + env_vars: { key: "TRAMPOLINE_BUILD_FILE" value: "github/java-storage/.kokoro/release/publish_javadoc.sh" diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh index bb9c42435c..f372a616a6 100755 --- a/.kokoro/release/publish_javadoc.sh +++ b/.kokoro/release/publish_javadoc.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2019 Google LLC +# Copyright 2019 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -24,6 +24,11 @@ if [[ -z "${STAGING_BUCKET}" ]]; then exit 1 fi +if [[ -z "${STAGING_BUCKET_V2}" ]]; then + echo "Need to set STAGING_BUCKET_V2 environment variable" + exit 1 +fi + # work from the git root directory pushd $(dirname "$0")/../../ @@ -33,8 +38,8 @@ python3 -m pip install gcp-docuploader # compile all packages mvn clean install -B -q -DskipTests=true -export NAME=google-cloud-storage -export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) +NAME=google-cloud-storage +VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) # build the docs mvn site -B -q @@ -51,3 +56,21 @@ python3 -m docuploader create-metadata \ python3 -m docuploader upload . \ --credentials ${CREDENTIALS} \ --staging-bucket ${STAGING_BUCKET} + +popd + +# V2 +mvn clean site -B -q -Ddevsite.template="${KOKORO_GFILE_DIR}/java/" + +pushd target/devsite/reference + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --language java + +# upload docs +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET_V2} diff --git a/.kokoro/release/publish_javadoc11.cfg b/.kokoro/release/publish_javadoc11.cfg deleted file mode 100644 index 6aa8afa690..0000000000 --- a/.kokoro/release/publish_javadoc11.cfg +++ /dev/null @@ -1,30 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# cloud-rad production -env_vars: { - key: "STAGING_BUCKET_V2" - value: "docs-staging-v2" -} - -# Configure the docker image for kokoro-trampoline -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-storage/.kokoro/release/publish_javadoc11.sh" -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "docuploader_service_account" - } - } -} - -# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/ -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx" diff --git a/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh deleted file mode 100755 index 5ed8167dae..0000000000 --- a/.kokoro/release/publish_javadoc11.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -if [[ -z "${CREDENTIALS}" ]]; then - CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account -fi - -if [[ -z "${STAGING_BUCKET_V2}" ]]; then - echo "Need to set STAGING_BUCKET_V2 environment variable" - exit 1 -fi - -# work from the git root directory -pushd $(dirname "$0")/../../ - -# install docuploader package -python3 -m pip install gcp-docuploader - -# compile all packages -mvn clean install -B -q -DskipTests=true - -export NAME=google-cloud-storage -export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) - -# cloud RAD generation -mvn clean javadoc:aggregate -B -q -P docFX -# include CHANGELOG -cp CHANGELOG.md target/docfx-yml/history.md - -pushd target/docfx-yml - -# create metadata -python3 -m docuploader create-metadata \ - --name ${NAME} \ - --version ${VERSION} \ - --xrefs devsite://java/gax \ - --xrefs devsite://java/google-cloud-core \ - --xrefs devsite://java/api-common \ - --xrefs devsite://java/proto-google-common-protos \ - --xrefs devsite://java/google-api-client \ - --xrefs devsite://java/google-http-client \ - --xrefs devsite://java/protobuf \ - --language java - -# upload yml to production bucket -python3 -m docuploader upload . \ - --credentials ${CREDENTIALS} \ - --staging-bucket ${STAGING_BUCKET_V2} \ - --destination-prefix docfx diff --git a/.kokoro/release/snapshot.sh b/.kokoro/release/snapshot.sh index 1f55b77024..098168a737 100755 --- a/.kokoro/release/snapshot.sh +++ b/.kokoro/release/snapshot.sh @@ -25,7 +25,7 @@ grep SNAPSHOT versions.txt setup_environment_secrets create_settings_xml_file "settings.xml" -mvn clean deploy -B \ +mvn clean install deploy -B \ --settings ${MAVEN_SETTINGS_FILE} \ -DperformRelease=true \ -Dgpg.executable=gpg \ diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh index 77dc4e8f0f..16126d2eb5 100755 --- a/.kokoro/release/stage.sh +++ b/.kokoro/release/stage.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2018 Google LLC +# Copyright 2018 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,7 +29,7 @@ create_settings_xml_file "settings.xml" # attempt to stage 3 times with exponential backoff (starting with 10 seconds) retry_with_backoff 3 10 \ - mvn clean deploy -B \ + mvn clean install deploy -B \ --settings ${MAVEN_SETTINGS_FILE} \ -DskipTests=true \ -DperformRelease=true \ diff --git a/.kokoro/trampoline.sh b/.kokoro/trampoline.sh index 8b69b793c9..9da0f83987 100644 --- a/.kokoro/trampoline.sh +++ b/.kokoro/trampoline.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2018 Google LLC +# Copyright 2018 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.readme-partials.yaml b/.readme-partials.yaml index 792c7985a9..3a56b30ca8 100644 --- a/.readme-partials.yaml +++ b/.readme-partials.yaml @@ -51,7 +51,7 @@ custom_content: | ``` A complete example for creating a blob can be found at - [CreateBlob.java](https://github.com/googleapis/google-cloud-java/tree/main/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/CreateBlob.java). + [CreateBlob.java](https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/CreateBlob.java). At this point, you will be able to see your newly created bucket and blob on the Google Developers Console. @@ -66,7 +66,7 @@ custom_content: | ``` A complete example for accessing blobs can be found at - [CreateBlob.java](https://github.com/googleapis/google-cloud-java/tree/main/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/CreateBlob.java). + [CreateBlob.java](https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/CreateBlob.java). #### Updating data Another thing we may want to do is update a blob. The following snippet shows how to update a Storage blob if it exists. @@ -84,7 +84,7 @@ custom_content: | ``` The complete source code can be found at - [UpdateBlob.java](https://github.com/googleapis/google-cloud-java/tree/main/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/UpdateBlob.java). + [UpdateBlob.java](https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/UpdateBlob.java). #### Listing buckets and contents of buckets Suppose that you've added more buckets and blobs, and now you want to see the names of your buckets and the contents @@ -107,7 +107,7 @@ custom_content: | #### Complete source code In - [CreateAndListBucketsAndBlobs.java](https://github.com/googleapis/google-cloud-java/tree/main/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/CreateAndListBucketsAndBlobs.java) + [CreateAndListBucketsAndBlobs.java](https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/CreateAndListBucketsAndBlobs.java) we put together examples creating and listing buckets and blobs into one program. The program assumes that you are running on Compute Engine or from your own desktop. To run the example on App Engine, simply move the code from the main method to your application's servlet class and change the print statements to @@ -115,10 +115,10 @@ custom_content: | ### Example Applications - - [`StorageExample`](https://github.com/googleapis/google-cloud-java/tree/main/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/StorageExample.java) is a simple command line interface that provides some of Cloud Storage's functionality. Read more about using the application on the [`StorageExample` docs page](https://github.com/googleapis/google-cloud-java/blob/main/google-cloud-examples/README.md). - - [`Bookshelf`](https://github.com/GoogleCloudPlatform/getting-started-java/tree/main/bookshelf) - An App Engine application that manages a virtual bookshelf. + - [`StorageExample`](https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/StorageExample.java) is a simple command line interface that provides some of Cloud Storage's functionality. Read more about using the application on the [`StorageExample` docs page](https://github.com/googleapis/google-cloud-java/blob/master/google-cloud-examples/README.md). + - [`Bookshelf`](https://github.com/GoogleCloudPlatform/getting-started-java/tree/master/bookshelf) - An App Engine application that manages a virtual bookshelf. - This app uses `google-cloud` to interface with Cloud Datastore and Cloud Storage. It also uses Cloud SQL, another Google Cloud Platform service. - - [`Flexible Environment/Storage example`](https://github.com/GoogleCloudPlatform/java-docs-samples/tree/main/flexible/cloudstorage) - An app that uploads files to a public Cloud Storage bucket on the App Engine Flexible Environment runtime. + - [`Flexible Environment/Storage example`](https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/flexible/cloudstorage) - An app that uploads files to a public Cloud Storage bucket on the App Engine Flexible Environment runtime. versioning: | This library follows [Semantic Versioning](http://semver.org/), but does update [Storage interface](src/main/java/com.google.cloud.storage/Storage.java) diff --git a/.repo-metadata.json b/.repo-metadata.json index a9b3a810bc..b9a0efaf8c 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -1,19 +1,16 @@ { - "api_shortname": "storage", + "name": "storage", "name_pretty": "Cloud Storage", "product_documentation": "https://cloud.google.com/storage", - "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-storage/latest/history", + "client_documentation": "https://googleapis.dev/java/google-cloud-storage/latest/index.html", "api_description": "is a durable and highly available object storage service. Google Cloud Storage is almost infinitely scalable and guarantees consistency: when a write succeeds, the latest copy of the object will be returned to any GET, globally.", "issue_tracker": "https://issuetracker.google.com/savedsearches/559782", - "release_level": "stable", + "release_level": "ga", "language": "java", "repo": "googleapis/java-storage", "repo_short": "java-storage", "distribution_name": "com.google.cloud:google-cloud-storage", - "codeowner_team": "@googleapis/cloud-storage-dpe", + "codeowner_team": "@googleapis/storage-dpe", "api_id": "storage.googleapis.com", - "requires_billing": true, - "library_type": "GAPIC_COMBO", - "extra_versioned_modules": "gapic-google-cloud-storage-v2", - "excluded_poms": "google-cloud-storage-bom,google-cloud-storage" -} + "requires_billing": true +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 25079b251a..0ccaff6c12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,530 +1,5 @@ # Changelog -### [2.4.5](https://github.com/googleapis/java-storage/compare/v2.4.4...v2.4.5) (2022-03-04) - - -### Documentation - -* Adding Samples for Adding/Removing File Owners ([#1273](https://github.com/googleapis/java-storage/issues/1273)) ([6fad19c](https://github.com/googleapis/java-storage/commit/6fad19c184d108f30c85f62426d254a9f0ff715d)) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.8.0 ([#1284](https://github.com/googleapis/java-storage/issues/1284)) ([0f71ae4](https://github.com/googleapis/java-storage/commit/0f71ae41fbabf6a3f38674a2f68fb55bd9809595)) -* update kms.version to v0.95.1 ([#1287](https://github.com/googleapis/java-storage/issues/1287)) ([8334d3c](https://github.com/googleapis/java-storage/commit/8334d3cb1f527b00ee8f19583dcf112f4f1b08ac)) - -### [2.4.4](https://github.com/googleapis/java-storage/compare/v2.4.3...v2.4.4) (2022-02-28) - - -### Dependencies - -* update actions/setup-java action to v3 ([#1274](https://github.com/googleapis/java-storage/issues/1274)) ([d29d19a](https://github.com/googleapis/java-storage/commit/d29d19a9936164e0ffe4d2f5fa14739a807369f6)) - -### [2.4.3](https://github.com/googleapis/java-storage/compare/v2.4.2...v2.4.3) (2022-02-25) - - -### Dependencies - -* update dependency com.google.apis:google-api-services-storage to v1-rev20220210-1.32.1 ([#1269](https://github.com/googleapis/java-storage/issues/1269)) ([b3933be](https://github.com/googleapis/java-storage/commit/b3933be393bcb8850e39635d28211159a3d0a091)) - - -### Documentation - -* Adding Samples for Add/Remove Bucket Default Owner ([#1260](https://github.com/googleapis/java-storage/issues/1260)) ([7223626](https://github.com/googleapis/java-storage/commit/7223626481930bf4442a04ccf49536f7f9e5fd32)) -* Adding Samples for Add/Remove Bucket Owner ([#1272](https://github.com/googleapis/java-storage/issues/1272)) ([9d25fa9](https://github.com/googleapis/java-storage/commit/9d25fa986ec6116eeb16ac5773b46e7fdbe10647)) -* Adding Samples for Printing Bucket ACLs and Printing Bucket ACL for a specific user. ([#1236](https://github.com/googleapis/java-storage/issues/1236)) ([d82333b](https://github.com/googleapis/java-storage/commit/d82333b01eadd9afd0c9d58455f86bc6457c99e3)) - -### [2.4.2](https://github.com/googleapis/java-storage/compare/v2.4.1...v2.4.2) (2022-02-11) - - -### Dependencies - -* update actions/github-script action to v6 ([#1241](https://github.com/googleapis/java-storage/issues/1241)) ([366d738](https://github.com/googleapis/java-storage/commit/366d7385c4f6ac5c7478ea71cf0f7f1546ad4607)) - -### [2.4.1](https://github.com/googleapis/java-storage/compare/v2.4.0...v2.4.1) (2022-02-08) - - -### Dependencies - -* update kms.version to v0.95.0 ([#1224](https://github.com/googleapis/java-storage/issues/1224)) ([5700c54](https://github.com/googleapis/java-storage/commit/5700c544da904bca75bf42314b150f109771f719)) - -## [2.4.0](https://github.com/googleapis/java-storage/compare/v2.3.0...v2.4.0) (2022-02-03) - - -### Features - -* Change RewriteObjectRequest to specify bucket name, object name and KMS key outside of Object resource ([#1218](https://github.com/googleapis/java-storage/issues/1218)) ([8789e4f](https://github.com/googleapis/java-storage/commit/8789e4f73a3c5b36aa93246d172d07adb24027aa)) -* re-generate gapic client to include full GCS gRPC API ([#1189](https://github.com/googleapis/java-storage/issues/1189)) ([3099a22](https://github.com/googleapis/java-storage/commit/3099a2264d8b135f602d8dd06f3e91ac5b0ecdba)) -* Update definition of RewriteObjectRequest to bring to parity with JSON API support ([#1220](https://github.com/googleapis/java-storage/issues/1220)) ([7845c0e](https://github.com/googleapis/java-storage/commit/7845c0e8be5ba150f5e835172e9341ef2efc6054)) - - -### Bug Fixes - -* Remove post policy v4 client side validation ([#1210](https://github.com/googleapis/java-storage/issues/1210)) ([631741d](https://github.com/googleapis/java-storage/commit/631741df96a6dddd31a38dce099f3d3ff09ca7cf)) - - -### Dependencies - -* **java:** update actions/github-script action to v5 ([#1339](https://github.com/googleapis/java-storage/issues/1339)) ([#1215](https://github.com/googleapis/java-storage/issues/1215)) ([deb110b](https://github.com/googleapis/java-storage/commit/deb110b0b5ec4a7e6963d1c1ab0e63ca58240ae1)) -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.7.0 ([#1219](https://github.com/googleapis/java-storage/issues/1219)) ([623e68b](https://github.com/googleapis/java-storage/commit/623e68b8b678df425730b6472cf34d7b78841757)) - -## [2.3.0](https://github.com/googleapis/java-storage/compare/v2.2.3...v2.3.0) (2022-01-12) - - -### Features - -* Add RPO metadata settings ([#1105](https://github.com/googleapis/java-storage/issues/1105)) ([6f9dfdf](https://github.com/googleapis/java-storage/commit/6f9dfdfdbf9f1466839a17ef97489f207f18bec6)) - - -### Bug Fixes - -* **java:** run Maven in plain console-friendly mode ([#1301](https://github.com/googleapis/java-storage/issues/1301)) ([#1186](https://github.com/googleapis/java-storage/issues/1186)) ([1e55dba](https://github.com/googleapis/java-storage/commit/1e55dba4cd5111472b9bb05db08ba7e47fafe762)) -* Remove all client side validation for OLM, allow nonspecific lif… ([#1160](https://github.com/googleapis/java-storage/issues/1160)) ([5a160ee](https://github.com/googleapis/java-storage/commit/5a160eee2b80e3d392df9d73dfc30ca9cd665764)) - - -### Dependencies - -* update dependency org.easymock:easymock to v4 ([#1198](https://github.com/googleapis/java-storage/issues/1198)) ([558520f](https://github.com/googleapis/java-storage/commit/558520f35ed64f0b36f7f8ada4491023a0fb759e)) -* update kms.version to v0.94.1 ([#1195](https://github.com/googleapis/java-storage/issues/1195)) ([cc999b1](https://github.com/googleapis/java-storage/commit/cc999b1ebaba051524ce6131052c824232ccb79a)) - -### [2.2.3](https://www.github.com/googleapis/java-storage/compare/v2.2.2...v2.2.3) (2022-01-07) - - -### Bug Fixes - -* do not cause a failure when encountering no bindings ([#1177](https://www.github.com/googleapis/java-storage/issues/1177)) ([16c2aef](https://www.github.com/googleapis/java-storage/commit/16c2aef4f09eccee59d1028e3bbf01c65b5982d6)) -* **java:** add -ntp flag to native image testing command ([#1169](https://www.github.com/googleapis/java-storage/issues/1169)) ([b8a6395](https://www.github.com/googleapis/java-storage/commit/b8a6395fcaa34423d42a90bd42f71809f89a6c3b)) -* update retry handling to retry idempotent requests that encounter unexpected EOF while parsing json responses ([#1155](https://www.github.com/googleapis/java-storage/issues/1155)) ([8fbe6ef](https://www.github.com/googleapis/java-storage/commit/8fbe6efab969d699e9ba9e5448db7a6ee10c0572)) - - -### Documentation - -* add new sample storage_configure_retries ([#1152](https://www.github.com/googleapis/java-storage/issues/1152)) ([8634c4b](https://www.github.com/googleapis/java-storage/commit/8634c4b5cb88d2818378558427170ecf6c403df5)) -* update comments ([#1188](https://www.github.com/googleapis/java-storage/issues/1188)) ([d58e67c](https://www.github.com/googleapis/java-storage/commit/d58e67c217f38ca7b1926882ec48bd7b0c351ea7)) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.6.0 ([#1191](https://www.github.com/googleapis/java-storage/issues/1191)) ([3b384cf](https://www.github.com/googleapis/java-storage/commit/3b384cf46876610ce33f2842ee8e9fc13e08443c)) -* update dependency org.apache.httpcomponents:httpcore to v4.4.15 ([#1171](https://www.github.com/googleapis/java-storage/issues/1171)) ([57f7a74](https://www.github.com/googleapis/java-storage/commit/57f7a743ee042c52261cd388fb0aec48c84e5d32)) - -### [2.2.2](https://www.github.com/googleapis/java-storage/compare/v2.2.1...v2.2.2) (2021-12-06) - - -### Bug Fixes - -* update StorageOptions to not overwrite any previously set host ([#1142](https://www.github.com/googleapis/java-storage/issues/1142)) ([05375c0](https://www.github.com/googleapis/java-storage/commit/05375c0b9b6f9fde2e6cefb1af6a695aa3b01732)) - - -### Documentation - -* Add comments to GCS gRPC API proto spec to describe how naming work ([#1139](https://www.github.com/googleapis/java-storage/issues/1139)) ([417c525](https://www.github.com/googleapis/java-storage/commit/417c5250eb7ad1a7b04a055a39d72e6536a63e18)) - - -### Dependencies - -* update dependency com.google.apis:google-api-services-storage to v1-rev20211201-1.32.1 ([#1165](https://www.github.com/googleapis/java-storage/issues/1165)) ([9031836](https://www.github.com/googleapis/java-storage/commit/90318368e69d7677c49e985eb58ff1b61d878ec9)) -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.5.1 ([#1163](https://www.github.com/googleapis/java-storage/issues/1163)) ([feca2c6](https://www.github.com/googleapis/java-storage/commit/feca2c6342786ef3fb699c459067c015bd374a13)) -* update kms.version to v0.94.0 ([#1164](https://www.github.com/googleapis/java-storage/issues/1164)) ([8653783](https://www.github.com/googleapis/java-storage/commit/86537836a3b96f369e1cad59c692d350047414f7)) - -### [2.2.1](https://www.github.com/googleapis/java-storage/compare/v2.2.0...v2.2.1) (2021-11-15) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.5.0 ([#1146](https://www.github.com/googleapis/java-storage/issues/1146)) ([a5d13a9](https://www.github.com/googleapis/java-storage/commit/a5d13a97bae50b4ee8a2fcef180ddc26b77e3d16)) - -## [2.2.0](https://www.github.com/googleapis/java-storage/compare/v2.1.9...v2.2.0) (2021-11-02) - - -### Features - -* next release from mainline is 2.2.0 ([#1124](https://www.github.com/googleapis/java-storage/issues/1124)) ([53a755b](https://www.github.com/googleapis/java-storage/commit/53a755b315c0e739e33929fa5db92eb1daf32e8b)) -* update all automatic retry behavior to be idempotency aware ([#1132](https://www.github.com/googleapis/java-storage/issues/1132)) ([470b8cd](https://www.github.com/googleapis/java-storage/commit/470b8cd8a24c1c2b4be1b956d1691dbae8cf87fd)) - - -### Dependencies - -* update dependency com.google.apis:google-api-services-storage to v1-rev20211018-1.32.1 ([#1123](https://www.github.com/googleapis/java-storage/issues/1123)) ([edc0e00](https://www.github.com/googleapis/java-storage/commit/edc0e00a9f0d3c48ed7abbd5b01429837298ecfb)) -* update kms.version to v0.93.2 ([#1120](https://www.github.com/googleapis/java-storage/issues/1120)) ([a5c007d](https://www.github.com/googleapis/java-storage/commit/a5c007d306c5d7fc00927be39b6879dfc7a01fcb)) - -### [2.1.9](https://www.github.com/googleapis/java-storage/compare/v2.1.8...v2.1.9) (2021-10-19) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.4.0 ([#1115](https://www.github.com/googleapis/java-storage/issues/1115)) ([37d892b](https://www.github.com/googleapis/java-storage/commit/37d892b05ae3c7338b6c804cddfcecca80509ea3)) - -### [2.1.8](https://www.github.com/googleapis/java-storage/compare/v2.1.7...v2.1.8) (2021-10-18) - - -### Bug Fixes - -* regenerate google.cloud.storage.v2 protos ([a7e3b94](https://www.github.com/googleapis/java-storage/commit/a7e3b94e4a3e03599b0dbe51fbe574ed4ea1a0d8)) - - -### Dependencies - -* update kms.version to v0.93.1 ([#1079](https://www.github.com/googleapis/java-storage/issues/1079)) ([1c52b3d](https://www.github.com/googleapis/java-storage/commit/1c52b3db6699c2ad325853e95231e1a908da069f)) - -### [2.1.7](https://www.github.com/googleapis/java-storage/compare/v2.1.6...v2.1.7) (2021-10-04) - - -### Bug Fixes - -* update PAP to use inherited instead of unspecified ([#1051](https://www.github.com/googleapis/java-storage/issues/1051)) ([6d73e46](https://www.github.com/googleapis/java-storage/commit/6d73e4631777542996a0ea815b482f5c19a8927d)) - - -### Dependencies - -* update dependency com.google.apis:google-api-services-storage to v1-rev20210918-1.32.1 ([#1046](https://www.github.com/googleapis/java-storage/issues/1046)) ([2c79005](https://www.github.com/googleapis/java-storage/commit/2c79005d29ee0b279850c7008b1afbb302f9c90d)) -* update kms.version to v0.93.0 ([#1061](https://www.github.com/googleapis/java-storage/issues/1061)) ([97b1a2e](https://www.github.com/googleapis/java-storage/commit/97b1a2ebe411e48e2df095fe5518a867c5136851)) - -### [2.1.6](https://www.github.com/googleapis/java-storage/compare/v2.1.5...v2.1.6) (2021-09-24) - - -### Dependencies - -* update kms.version to v0.92.2 ([#1039](https://www.github.com/googleapis/java-storage/issues/1039)) ([d6a0542](https://www.github.com/googleapis/java-storage/commit/d6a0542f5fd290a0bdc2755f81a49f55724662b2)) - -### [2.1.5](https://www.github.com/googleapis/java-storage/compare/v2.1.4...v2.1.5) (2021-09-22) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.3.0 ([#1035](https://www.github.com/googleapis/java-storage/issues/1035)) ([ae71c24](https://www.github.com/googleapis/java-storage/commit/ae71c2496f64a0601b24574032cc133afb423408)) - -### [2.1.4](https://www.github.com/googleapis/java-storage/compare/v2.1.3...v2.1.4) (2021-09-20) - - -### Dependencies - -* update dependency com.google.apis:google-api-services-storage to v1-rev20210914-1.32.1 ([#1025](https://www.github.com/googleapis/java-storage/issues/1025)) ([ff56d5e](https://www.github.com/googleapis/java-storage/commit/ff56d5e5632d925542ac918d293b68dfcb32b465)) -* update kms.version to v0.92.1 ([#1023](https://www.github.com/googleapis/java-storage/issues/1023)) ([ca1afcf](https://www.github.com/googleapis/java-storage/commit/ca1afcff085bd02b150b93128b102cb9a61e1b4d)) - -### [2.1.3](https://www.github.com/googleapis/java-storage/compare/v2.1.2...v2.1.3) (2021-09-15) - - -### Dependencies - -* update kms.version to v0.92.0 ([#1018](https://www.github.com/googleapis/java-storage/issues/1018)) ([f1c58db](https://www.github.com/googleapis/java-storage/commit/f1c58db517596a5ee65e0f8a6e4b9c561288594e)) - -### [2.1.2](https://www.github.com/googleapis/java-storage/compare/v2.1.1...v2.1.2) (2021-09-14) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.2.1 ([#1011](https://www.github.com/googleapis/java-storage/issues/1011)) ([0bf06a5](https://www.github.com/googleapis/java-storage/commit/0bf06a54e3b90b9d8cf425d490561b48d6b5d882)) - -### [2.1.1](https://www.github.com/googleapis/java-storage/compare/v2.1.0...v2.1.1) (2021-09-03) - - -### Documentation - -* Modify OLM notice to recommend upgrading to latest version. ([#932](https://www.github.com/googleapis/java-storage/issues/932)) ([be72433](https://www.github.com/googleapis/java-storage/commit/be72433ef5446db880e44f103a7d120f444f183f)) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-conformance-tests to v0.2.0 ([#982](https://www.github.com/googleapis/java-storage/issues/982)) ([c7460a3](https://www.github.com/googleapis/java-storage/commit/c7460a3ffef81ef2f651b582a97139c0523d1eab)) -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.2.0 ([#989](https://www.github.com/googleapis/java-storage/issues/989)) ([6745c9e](https://www.github.com/googleapis/java-storage/commit/6745c9e5a9d3a907873b989ca8f8a47edd833523)) -* update kms.version to v0.91.3 ([#991](https://www.github.com/googleapis/java-storage/issues/991)) ([1f15022](https://www.github.com/googleapis/java-storage/commit/1f15022a590bce4f80dcb86d150b8e3dbe43aec9)) - -## [2.1.0](https://www.github.com/googleapis/java-storage/compare/v2.0.2...v2.1.0) (2021-08-24) - - -### Features - -* fix post policy escape bug, update conformance tests ([#924](https://www.github.com/googleapis/java-storage/issues/924)) ([d8329c3](https://www.github.com/googleapis/java-storage/commit/d8329c34fe19fd8c6bba5579aa3c55490c1d4e6f)) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.1.0 ([#976](https://www.github.com/googleapis/java-storage/issues/976)) ([5cac14d](https://www.github.com/googleapis/java-storage/commit/5cac14d7785ef3798c379d17cd44500958d9cc6a)) -* update kms.version to v0.91.2 ([#977](https://www.github.com/googleapis/java-storage/issues/977)) ([1c60e6e](https://www.github.com/googleapis/java-storage/commit/1c60e6e6a34f662478043989b5b0bddea32cc5bf)) - -### [2.0.2](https://www.github.com/googleapis/java-storage/compare/v2.0.1...v2.0.2) (2021-08-19) - - -### Dependencies - -* update kms.version to v0.91.1 ([#956](https://www.github.com/googleapis/java-storage/issues/956)) ([53d24e9](https://www.github.com/googleapis/java-storage/commit/53d24e9d3e27c0319fa3b6837c926484b1bd56a4)) - -## [2.0.1](https://www.github.com/googleapis/java-storage/compare/v2.0.0...v2.0.1) (2021-08-11) - - -### Features - -* generate storage v2 gapic client ([#960](https://www.github.com/googleapis/java-storage/issues/960)) ([fb2f9d4](https://www.github.com/googleapis/java-storage/commit/fb2f9d489e42b57f61642ce9e0c1a65fe91c9c45)) - - -### Bug Fixes - -* incorrectly labeled span list(String,Map) ([#946](https://www.github.com/googleapis/java-storage/issues/946)) ([0c1fdcf](https://www.github.com/googleapis/java-storage/commit/0c1fdcfe89609b10c148f0dc6026084d2f49b1b7)) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.0.1 ([#961](https://www.github.com/googleapis/java-storage/issues/961)) ([69543dc](https://www.github.com/googleapis/java-storage/commit/69543dcba2fce1028e5fac25a59e1defe6465f06)) - -## [2.0.0](https://www.github.com/googleapis/java-storage/compare/v1.118.1...v2.0.0) (2021-08-09) - - -### ⚠ BREAKING CHANGES - -* migrate to java8 (#950) - -### Features - -* migrate to java8 ([#950](https://www.github.com/googleapis/java-storage/issues/950)) ([839bcc1](https://www.github.com/googleapis/java-storage/commit/839bcc174ff1c2f5536130d880a5c6e2559b5793)) - -### [1.118.1](https://www.github.com/googleapis/java-storage/compare/v1.118.0...v1.118.1) (2021-08-06) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2 ([#941](https://www.github.com/googleapis/java-storage/issues/941)) ([effefa6](https://www.github.com/googleapis/java-storage/commit/effefa64336a6112dae1497b3bcde7c7f8b0ad41)) - -## [1.118.0](https://www.github.com/googleapis/java-storage/compare/v1.117.1...v1.118.0) (2021-07-13) - - -### Features - -* fix signed url mismatch in BlobWriteChannel ([#915](https://www.github.com/googleapis/java-storage/issues/915)) ([8b05867](https://www.github.com/googleapis/java-storage/commit/8b0586757523cfc550c62ff264eea3eebbd7f32e)) - - -### Bug Fixes - -* correct lastChunk retry logic in BlobWriteChannel ([#918](https://www.github.com/googleapis/java-storage/issues/918)) ([ab0228c](https://www.github.com/googleapis/java-storage/commit/ab0228c95df831d79f4a9c993908e5700dab5aa7)) - - -### Dependencies - -* update dependency com.google.apis:google-api-services-storage to v1-rev20210127-1.32.1 ([#910](https://www.github.com/googleapis/java-storage/issues/910)) ([2c54acc](https://www.github.com/googleapis/java-storage/commit/2c54acca0653a96773ab3606a8d97299e9fdf045)) -* update kms.version to v0.90.0 ([#911](https://www.github.com/googleapis/java-storage/issues/911)) ([1050725](https://www.github.com/googleapis/java-storage/commit/1050725c91b4375340ba113568ba04538c7f52fc)) - -### [1.117.1](https://www.github.com/googleapis/java-storage/compare/v1.117.0...v1.117.1) (2021-06-30) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.4.0 ([#905](https://www.github.com/googleapis/java-storage/issues/905)) ([dd084d1](https://www.github.com/googleapis/java-storage/commit/dd084d16b5f0bbf54730f2e91ce2c04a61457e0f)) - -## [1.117.0](https://www.github.com/googleapis/java-storage/compare/v1.116.0...v1.117.0) (2021-06-28) - - -### Features - -* Add from and to storage url options for BlobId ([#888](https://www.github.com/googleapis/java-storage/issues/888)) ([1876a58](https://www.github.com/googleapis/java-storage/commit/1876a580f904d095ca6621c1e2f38c3a6e253276)) -* add support of public access prevention ([#636](https://www.github.com/googleapis/java-storage/issues/636)) ([3d1e482](https://www.github.com/googleapis/java-storage/commit/3d1e48208c44c35c8e3761913bcd05c438e81069)) - - -### Bug Fixes - -* Add `shopt -s nullglob` to dependencies script ([#894](https://www.github.com/googleapis/java-storage/issues/894)) ([901fd33](https://www.github.com/googleapis/java-storage/commit/901fd335c8d2f2e49844dee2adfa318a98ed99ba)) -* Update dependencies.sh to not break on mac ([#879](https://www.github.com/googleapis/java-storage/issues/879)) ([bc6d1d9](https://www.github.com/googleapis/java-storage/commit/bc6d1d9e211fbbb1accd1019c8eed4bc55ca421c)) - - -### Documentation - -* add notice about broken OLM experience ([#898](https://www.github.com/googleapis/java-storage/issues/898)) ([73e7cdf](https://www.github.com/googleapis/java-storage/commit/73e7cdf162be76a8438160f4c7f2070fb6fb5ea6)) - - -### Dependencies - -* update dependency com.google.apis:google-api-services-storage to v1-rev20210127-1.31.5 ([#889](https://www.github.com/googleapis/java-storage/issues/889)) ([99138a4](https://www.github.com/googleapis/java-storage/commit/99138a4cd3523cc634e3c5283a775a1c245b6201)) - -## [1.116.0](https://www.github.com/googleapis/java-storage/compare/v1.115.0...v1.116.0) (2021-06-14) - - -### Features - -* Add shouldReturnRawInputStream option to Get requests ([#872](https://www.github.com/googleapis/java-storage/issues/872)) ([474dfae](https://www.github.com/googleapis/java-storage/commit/474dfaec09d591455cecc77b08461efff1010c3a)) - - -### Bug Fixes - -* **ci:** remove linkage-monitor to pass 1.106.1 patch ci ([#862](https://www.github.com/googleapis/java-storage/issues/862)) ([94a9159](https://www.github.com/googleapis/java-storage/commit/94a915958f888cfbf4110d06a7f64be135dc141e)) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.3.0 ([#863](https://www.github.com/googleapis/java-storage/issues/863)) ([37bfd5e](https://www.github.com/googleapis/java-storage/commit/37bfd5e3cf1c62767ff8033366cca66c2e8e6e4c)) -* update kms.version ([#860](https://www.github.com/googleapis/java-storage/issues/860)) ([f1430ff](https://www.github.com/googleapis/java-storage/commit/f1430ffea07696ea808369fcd287187c14afc9a2)) -* update kms.version to v0.89.3 ([#873](https://www.github.com/googleapis/java-storage/issues/873)) ([ee7c236](https://www.github.com/googleapis/java-storage/commit/ee7c2368928c050befb809a2d61bd6ffc92bdc88)) - -## [1.115.0](https://www.github.com/googleapis/java-storage/compare/v1.114.0...v1.115.0) (2021-06-01) - - -### Features - -* add `gcf-owl-bot[bot]` to `ignoreAuthors` ([#837](https://www.github.com/googleapis/java-storage/issues/837)) ([fe8e98a](https://www.github.com/googleapis/java-storage/commit/fe8e98a229f472c1f29d206d937690660bfa1444)) - - -### Bug Fixes - -* improve error detection and reporting for BlobWriteChannel retry state ([#846](https://www.github.com/googleapis/java-storage/issues/846)) ([d0f2184](https://www.github.com/googleapis/java-storage/commit/d0f2184f4dd2d99a4315f260f35421358d14a2df)), closes [#839](https://www.github.com/googleapis/java-storage/issues/839) -* update BucketInfo translation code to properly handle lifecycle rules ([#852](https://www.github.com/googleapis/java-storage/issues/852)) ([3b1df1d](https://www.github.com/googleapis/java-storage/commit/3b1df1d00a459b134103bc8738f0294188502a37)), closes [#850](https://www.github.com/googleapis/java-storage/issues/850) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.2.0 ([#836](https://www.github.com/googleapis/java-storage/issues/836)) ([c1752ce](https://www.github.com/googleapis/java-storage/commit/c1752ce17d5d723d0ea36c41d98ae2bc9201fec2)) -* update kms.version to v0.88.4 ([#830](https://www.github.com/googleapis/java-storage/issues/830)) ([7e3dc28](https://www.github.com/googleapis/java-storage/commit/7e3dc287e4285a9312393179671a78c569e7e869)) -* update kms.version to v0.89.0 ([#855](https://www.github.com/googleapis/java-storage/issues/855)) ([29236e9](https://www.github.com/googleapis/java-storage/commit/29236e9d2eefb0e64b1b9bbfc532f4c3ae3e9ea4)) - -## [1.114.0](https://www.github.com/googleapis/java-storage/compare/v1.113.16...v1.114.0) (2021-05-13) - - -### Features - -* Remove client side vaildation for lifecycle conditions ([#816](https://www.github.com/googleapis/java-storage/issues/816)) ([5ec84cc](https://www.github.com/googleapis/java-storage/commit/5ec84cc2935a4787dd14a207d27501878f5849d5)) - - -### Bug Fixes - -* **test:** update blob paths used in storage.it.ITStorageTest#testDownloadPublicBlobWithoutAuthentication ([#759](https://www.github.com/googleapis/java-storage/issues/759)) ([#817](https://www.github.com/googleapis/java-storage/issues/817)) ([1a576ca](https://www.github.com/googleapis/java-storage/commit/1a576ca3945b51d7a678aa2414be91b3c6b2d55e)) - - -### Dependencies - -* update dependency com.google.api-client:google-api-client to v1.31.5 ([#820](https://www.github.com/googleapis/java-storage/issues/820)) ([9e1bc0b](https://www.github.com/googleapis/java-storage/commit/9e1bc0b42abdaab0b11d761ecdbb92f6116aacd2)) -* update dependency com.google.api.grpc:grpc-google-cloud-kms-v1 to v0.88.3 ([#797](https://www.github.com/googleapis/java-storage/issues/797)) ([747e7e4](https://www.github.com/googleapis/java-storage/commit/747e7e463c028b9cf8a406b7536b1916c1d52c01)) -* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.1.0 ([#815](https://www.github.com/googleapis/java-storage/issues/815)) ([e210de9](https://www.github.com/googleapis/java-storage/commit/e210de93452243242be7d3d719d00da723632335)) - -### [1.113.16](https://www.github.com/googleapis/java-storage/compare/v1.113.15...v1.113.16) (2021-04-23) - - -### Bug Fixes - -* release scripts from issuing overlapping phases ([#784](https://www.github.com/googleapis/java-storage/issues/784)) ([36751f5](https://www.github.com/googleapis/java-storage/commit/36751f5de9708ac9e23550f67256fb05ebf1f69e)) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.21.1 ([#789](https://www.github.com/googleapis/java-storage/issues/789)) ([c005e87](https://www.github.com/googleapis/java-storage/commit/c005e877a7d64c4bbd2ed267526d8025ea29a9ad)) -* update dependency com.google.cloud:google-cloud-shared-dependencies to v1 ([#794](https://www.github.com/googleapis/java-storage/issues/794)) ([195fead](https://www.github.com/googleapis/java-storage/commit/195fead94dea4c50f7e285e0a7a1578fa5b6265d)) - -### [1.113.15](https://www.github.com/googleapis/java-storage/compare/v1.113.14...v1.113.15) (2021-04-13) - - -### Bug Fixes - -* **test:** update blob paths used in storage.it.ITStorageTest#testDownloadPublicBlobWithoutAuthentication ([#759](https://www.github.com/googleapis/java-storage/issues/759)) ([9a6619c](https://www.github.com/googleapis/java-storage/commit/9a6619c39a89e2c2ee8d0000d595d09ac7b7825f)) -* typo ([#779](https://www.github.com/googleapis/java-storage/issues/779)) ([3c3d6b4](https://www.github.com/googleapis/java-storage/commit/3c3d6b487648fde4eb956ce8912cd680a4440f8d)) - - -### Dependencies - -* update dependency com.google.api-client:google-api-client to v1.31.4 ([#774](https://www.github.com/googleapis/java-storage/issues/774)) ([ad9ff7b](https://www.github.com/googleapis/java-storage/commit/ad9ff7b801d0c5fb39f72c7118c319f4e45084a0)) -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.21.0 ([#771](https://www.github.com/googleapis/java-storage/issues/771)) ([5605095](https://www.github.com/googleapis/java-storage/commit/5605095ed796327879a930c12526b3c5b1409b17)) -* update kms.version to v0.88.1 ([#758](https://www.github.com/googleapis/java-storage/issues/758)) ([3e57ea9](https://www.github.com/googleapis/java-storage/commit/3e57ea9a2f5f7013e997469c5ca32be8cef2a4a4)) -* update kms.version to v0.88.2 ([#778](https://www.github.com/googleapis/java-storage/issues/778)) ([6edfc4c](https://www.github.com/googleapis/java-storage/commit/6edfc4ced2bdae9878ecdbc5ef636ac39bdb5881)) -* update truth ([#767](https://www.github.com/googleapis/java-storage/issues/767)) ([4e5ee03](https://www.github.com/googleapis/java-storage/commit/4e5ee0398e700baf4f88224f66309e426f9532d7)) - -### [1.113.14](https://www.github.com/googleapis/java-storage/compare/v1.113.13...v1.113.14) (2021-03-11) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.20.1 ([#749](https://www.github.com/googleapis/java-storage/issues/749)) ([bb42107](https://www.github.com/googleapis/java-storage/commit/bb42107ff10148e14e112ff78534753f2ebc7dd9)) -* update kms.version to v0.88.0 ([#753](https://www.github.com/googleapis/java-storage/issues/753)) ([eaedb64](https://www.github.com/googleapis/java-storage/commit/eaedb6456f2f427a7f2f3f3d6bd13d0d49fd269b)) - -### [1.113.13](https://www.github.com/googleapis/java-storage/compare/v1.113.12...v1.113.13) (2021-03-08) - - -### Bug Fixes - -* npe in createFrom ([#746](https://www.github.com/googleapis/java-storage/issues/746)) ([9ed9d13](https://www.github.com/googleapis/java-storage/commit/9ed9d1389e92766b66e2b8b4fb78b44d96d98803)) - - -### Dependencies - -* update dependency com.google.api-client:google-api-client to v1.31.3 ([#737](https://www.github.com/googleapis/java-storage/issues/737)) ([71b3842](https://www.github.com/googleapis/java-storage/commit/71b384233226531eabc1bd8eebf716ec53708afc)) - -### [1.113.12](https://www.github.com/googleapis/java-storage/compare/v1.113.11...v1.113.12) (2021-02-26) - - -### Bug Fixes - -* retrying get remote offset and recover from last chunk failures. ([#726](https://www.github.com/googleapis/java-storage/issues/726)) ([b41b881](https://www.github.com/googleapis/java-storage/commit/b41b88109e13b5ebbd0393d1f264225c12876be6)) - - -### Dependencies - -* update dependency com.google.api-client:google-api-client to v1.31.2 ([#686](https://www.github.com/googleapis/java-storage/issues/686)) ([6b1f036](https://www.github.com/googleapis/java-storage/commit/6b1f0361376167719ec5456181134136d27d1d3c)) -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.20.0 ([#732](https://www.github.com/googleapis/java-storage/issues/732)) ([c98413d](https://www.github.com/googleapis/java-storage/commit/c98413df9d9514340aed78b5a4d5e596760bb616)) -* update kms.version to v0.87.7 ([#724](https://www.github.com/googleapis/java-storage/issues/724)) ([3229bd8](https://www.github.com/googleapis/java-storage/commit/3229bd860f3a4d700a969aa9e922bbf6b5c1ca10)) -* update kms.version to v0.87.8 ([#733](https://www.github.com/googleapis/java-storage/issues/733)) ([a21b75f](https://www.github.com/googleapis/java-storage/commit/a21b75fa846f373970298dd98f8f3520fc2b3c97)) - -### [1.113.11](https://www.github.com/googleapis/java-storage/compare/v1.113.10...v1.113.11) (2021-02-19) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.19.0 ([#719](https://www.github.com/googleapis/java-storage/issues/719)) ([5831bfa](https://www.github.com/googleapis/java-storage/commit/5831bfae3afeab9b044c8d53ebf6a2ce79bc9950)) - -### [1.113.10](https://www.github.com/googleapis/java-storage/compare/v1.113.9...v1.113.10) (2021-02-17) - - -### Dependencies - -* update dependency com.google.apis:google-api-services-storage to v1-rev20210127-1.31.0 ([#706](https://www.github.com/googleapis/java-storage/issues/706)) ([04db8f7](https://www.github.com/googleapis/java-storage/commit/04db8f7b87644559685d4c05a67a74e4c8bea364)) -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.18.0 ([#683](https://www.github.com/googleapis/java-storage/issues/683)) ([6f172eb](https://www.github.com/googleapis/java-storage/commit/6f172eba6fd6e9c11a1f49569249ea6e714ea91f)) -* update kms.version to v0.87.6 ([#702](https://www.github.com/googleapis/java-storage/issues/702)) ([a50c333](https://www.github.com/googleapis/java-storage/commit/a50c333f6e944fa4c6bdf9613cddca7c4fe79652)) - -### [1.113.9](https://www.github.com/googleapis/java-storage/compare/v1.113.8...v1.113.9) (2021-01-12) - - -### Bug Fixes - -* last chunk is retriable ([#677](https://www.github.com/googleapis/java-storage/issues/677)) ([44f49e0](https://www.github.com/googleapis/java-storage/commit/44f49e0a33c3e541d9f8b22622ffff17cc8b8eaa)) -* unnecessary options in resumable upload URL ([#679](https://www.github.com/googleapis/java-storage/issues/679)) ([d31a39b](https://www.github.com/googleapis/java-storage/commit/d31a39b88b2d8adb04549330f9b8ff1c1a516b69)) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.17.1 ([#678](https://www.github.com/googleapis/java-storage/issues/678)) ([d4a237f](https://www.github.com/googleapis/java-storage/commit/d4a237f4dff9dd870a69d5da9d690c14d4e88610)) -* update kms.version to v0.87.5 ([#662](https://www.github.com/googleapis/java-storage/issues/662)) ([20e7c1f](https://www.github.com/googleapis/java-storage/commit/20e7c1f10a233df6d4660b31d26cd95a6d4002e9)) - -### [1.113.8](https://www.github.com/googleapis/java-storage/compare/v1.113.7...v1.113.8) (2020-12-16) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.17.0 ([#659](https://www.github.com/googleapis/java-storage/issues/659)) ([5fa03fa](https://www.github.com/googleapis/java-storage/commit/5fa03fa14aa9ee29e7b1b27b783ab873052b97c6)) - -### [1.113.7](https://www.github.com/googleapis/java-storage/compare/v1.113.6...v1.113.7) (2020-12-14) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.16.1 ([f1fc884](https://www.github.com/googleapis/java-storage/commit/f1fc884851ee602d737f3e4191acb1f8450c8f2c)) - -### [1.113.6](https://www.github.com/googleapis/java-storage/compare/v1.113.5...v1.113.6) (2020-12-10) - - -### Bug Fixes - -* content-length missing in offset request ([#647](https://www.github.com/googleapis/java-storage/issues/647)) ([3cd3815](https://www.github.com/googleapis/java-storage/commit/3cd3815c62603d05d4c571ba1affeaf91e4d8040)) - - -### Dependencies - -* update kms.version to v0.87.3 ([#646](https://www.github.com/googleapis/java-storage/issues/646)) ([c93896a](https://www.github.com/googleapis/java-storage/commit/c93896a5007b48753809de806ddaf6c8df6e9d56)) - -### [1.113.5](https://www.github.com/googleapis/java-storage/compare/v1.113.4...v1.113.5) (2020-12-07) - - -### Dependencies - -* update dependency com.google.api-client:google-api-client to v1.31.1 ([#611](https://www.github.com/googleapis/java-storage/issues/611)) ([7c4c759](https://www.github.com/googleapis/java-storage/commit/7c4c759d8bca9c20252e06e02eb8ead3bd9f88d6)) -* update dependency com.google.api.grpc:grpc-google-cloud-kms-v1 to v0.87.2 ([#625](https://www.github.com/googleapis/java-storage/issues/625)) ([243a3cb](https://www.github.com/googleapis/java-storage/commit/243a3cb1506b2e2d609210dc4e9608637c06d7f3)) -* update dependency com.google.apis:google-api-services-storage to v1-rev20201112-1.30.10 ([#613](https://www.github.com/googleapis/java-storage/issues/613)) ([b0e24db](https://www.github.com/googleapis/java-storage/commit/b0e24db88c784fd05988a813bd8b29aeff0739f2)) -* update dependency com.google.apis:google-api-services-storage to v1-rev20201112-1.31.0 ([#641](https://www.github.com/googleapis/java-storage/issues/641)) ([11da9c7](https://www.github.com/googleapis/java-storage/commit/11da9c7e9058c508423e7b2f84c897ab3e9ab3f3)) -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.16.0 ([#639](https://www.github.com/googleapis/java-storage/issues/639)) ([68a3af9](https://www.github.com/googleapis/java-storage/commit/68a3af9b12c0e05d2cf59fb58aceab15323e29b1)) -* update dependency org.apache.httpcomponents:httpcore to v4.4.14 ([#637](https://www.github.com/googleapis/java-storage/issues/637)) ([af53902](https://www.github.com/googleapis/java-storage/commit/af5390239ffd1e157f066a1009b7bb18fa6264ec)) - ### [1.113.4](https://www.github.com/googleapis/java-storage/compare/v1.113.3...v1.113.4) (2020-11-13) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b65dd279c9..ccbd5094f4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,17 +48,18 @@ integration tests. ```bash export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +export IT_SERVICE_ACCOUNT_EMAIL=my-service-account@my-project.iam.gserviceaccount.com mvn -Penable-integration-tests clean verify ``` ## Code Samples -All code samples must be in compliance with the [java sample formatting guide][3]. -Code Samples must be bundled in separate Maven modules. +Code Samples must be bundled in separate Maven modules, and guarded by a +Maven profile with the name `enable-samples`. The samples must be separate from the primary project for a few reasons: -1. Primary projects have a minimum Java version of Java 8 whereas samples can have - Java version of Java 11. Due to this we need the ability to +1. Primary projects have a minimum Java version of Java 7 whereas samples have + a minimum Java version of Java 8. Due to this we need the ability to selectively exclude samples from a build run. 2. Many code samples depend on external GCP services and need credentials to access the service. @@ -68,16 +69,39 @@ The samples must be separate from the primary project for a few reasons: ### Building ```bash -mvn clean verify +mvn -Penable-samples clean verify ``` Some samples require access to GCP services and require a service account: ```bash export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json -mvn clean verify +mvn -Penable-samples clean verify ``` +### Profile Config + +1. To add samples in a profile to your Maven project, add the following to your +`pom.xml` + + ```xml + + [...] + + + enable-samples + + sample + + + + [...] + + ``` + +2. [Activate](#profile-activation) the profile. +3. Define your samples in a normal Maven project in the `samples/` directory. + ### Code Formatting Code in this repo is formatted with @@ -87,6 +111,30 @@ To run formatting on your project, you can run: mvn com.coveo:fmt-maven-plugin:format ``` +### Profile Activation + +To include code samples when building and testing the project, enable the +`enable-samples` Maven profile. + +#### Command line + +To activate the Maven profile on the command line add `-Penable-samples` to your +Maven command. + +#### Maven `settings.xml` + +To activate the Maven profile in your `~/.m2/settings.xml` add an entry of +`enable-samples` following the instructions in [Active Profiles][2]. + +This method has the benefit of applying to all projects you build (and is +respected by IntelliJ IDEA) and is recommended if you are going to be +contributing samples to several projects. + +#### IntelliJ IDEA + +To activate the Maven Profile inside IntelliJ IDEA, follow the instructions in +[Activate Maven profiles][3] to activate `enable-samples`. + [1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account [2]: https://maven.apache.org/settings.html#Active_Profiles -[3]: https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md \ No newline at end of file +[3]: https://www.jetbrains.com/help/idea/work-with-maven-profiles.html#activate_maven_profiles diff --git a/LICENSE b/LICENSE index 261eeb9e9f..d645695673 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,4 @@ + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ diff --git a/README.md b/README.md index 79f2876466..5f4a8f99e2 100644 --- a/README.md +++ b/README.md @@ -8,18 +8,16 @@ Java idiomatic client for [Cloud Storage][product-docs]. - [Product Documentation][product-docs] - [Client Library Documentation][javadocs] - ## Quickstart If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file - ```xml com.google.cloud libraries-bom - 25.0.0 + 16.1.0 pom import @@ -36,43 +34,28 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file If you are using Maven without BOM, add this to your dependencies: - ```xml com.google.cloud google-cloud-storage - 2.4.5 + 1.113.4 ``` -If you are using Gradle 5.x or later, add this to your dependencies - -```Groovy -implementation platform('com.google.cloud:libraries-bom:25.0.0') - -implementation 'com.google.cloud:google-cloud-storage' -``` -If you are using Gradle without BOM, add this to your dependencies - +If you are using Gradle, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-storage:2.4.5' +compile 'com.google.cloud:google-cloud-storage:1.113.4' ``` - If you are using SBT, add this to your dependencies - ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-storage" % "2.4.5" +libraryDependencies += "com.google.cloud" % "google-cloud-storage" % "1.113.4" ``` ## Authentication See the [Authentication][authentication] section in the base directory's README. -## Authorization - -The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired Cloud Storage APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Cloud Storage API calls. - ## Getting Started ### Prerequisites @@ -149,7 +132,7 @@ Blob blob = storage.create(blobInfo, "a simple blob".getBytes(UTF_8)); ``` A complete example for creating a blob can be found at -[CreateBlob.java](https://github.com/googleapis/google-cloud-java/tree/main/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/CreateBlob.java). +[CreateBlob.java](https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/CreateBlob.java). At this point, you will be able to see your newly created bucket and blob on the Google Developers Console. @@ -164,7 +147,7 @@ String contentString = new String(content, UTF_8); ``` A complete example for accessing blobs can be found at -[CreateBlob.java](https://github.com/googleapis/google-cloud-java/tree/main/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/CreateBlob.java). +[CreateBlob.java](https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/CreateBlob.java). #### Updating data Another thing we may want to do is update a blob. The following snippet shows how to update a Storage blob if it exists. @@ -182,7 +165,7 @@ if (blob != null) { ``` The complete source code can be found at -[UpdateBlob.java](https://github.com/googleapis/google-cloud-java/tree/main/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/UpdateBlob.java). +[UpdateBlob.java](https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/UpdateBlob.java). #### Listing buckets and contents of buckets Suppose that you've added more buckets and blobs, and now you want to see the names of your buckets and the contents @@ -205,7 +188,7 @@ for (Bucket bucket : storage.list().iterateAll()) { #### Complete source code In -[CreateAndListBucketsAndBlobs.java](https://github.com/googleapis/google-cloud-java/tree/main/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/CreateAndListBucketsAndBlobs.java) +[CreateAndListBucketsAndBlobs.java](https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/CreateAndListBucketsAndBlobs.java) we put together examples creating and listing buckets and blobs into one program. The program assumes that you are running on Compute Engine or from your own desktop. To run the example on App Engine, simply move the code from the main method to your application's servlet class and change the print statements to @@ -213,118 +196,22 @@ display on your webpage. ### Example Applications -- [`StorageExample`](https://github.com/googleapis/google-cloud-java/tree/main/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/StorageExample.java) is a simple command line interface that provides some of Cloud Storage's functionality. Read more about using the application on the [`StorageExample` docs page](https://github.com/googleapis/google-cloud-java/blob/main/google-cloud-examples/README.md). -- [`Bookshelf`](https://github.com/GoogleCloudPlatform/getting-started-java/tree/main/bookshelf) - An App Engine application that manages a virtual bookshelf. +- [`StorageExample`](https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/StorageExample.java) is a simple command line interface that provides some of Cloud Storage's functionality. Read more about using the application on the [`StorageExample` docs page](https://github.com/googleapis/google-cloud-java/blob/master/google-cloud-examples/README.md). +- [`Bookshelf`](https://github.com/GoogleCloudPlatform/getting-started-java/tree/master/bookshelf) - An App Engine application that manages a virtual bookshelf. - This app uses `google-cloud` to interface with Cloud Datastore and Cloud Storage. It also uses Cloud SQL, another Google Cloud Platform service. -- [`Flexible Environment/Storage example`](https://github.com/GoogleCloudPlatform/java-docs-samples/tree/main/flexible/cloudstorage) - An app that uploads files to a public Cloud Storage bucket on the App Engine Flexible Environment runtime. +- [`Flexible Environment/Storage example`](https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/flexible/cloudstorage) - An app that uploads files to a public Cloud Storage bucket on the App Engine Flexible Environment runtime. ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/java-storage/tree/main/samples) directory. +Samples are in the [`samples/`](https://github.com/googleapis/java-storage/tree/master/samples) directory. The samples' `README.md` +has instructions for running the samples. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Native Image Storage Sample | [source code](https://github.com/googleapis/java-storage/blob/main/samples/native-image-sample/src/main/java/com/example/storage/NativeImageStorageSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/native-image-sample/src/main/java/com/example/storage/NativeImageStorageSample.java) | -| Configure Retries | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/ConfigureRetries.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/ConfigureRetries.java) | -| Generate Signed Post Policy V4 | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/GenerateSignedPostPolicyV4.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/GenerateSignedPostPolicyV4.java) | -| Get Service Account | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/GetServiceAccount.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/GetServiceAccount.java) | -| Quickstart Sample | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/QuickstartSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/QuickstartSample.java) | -| Add Bucket Default Owner | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/AddBucketDefaultOwner.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/AddBucketDefaultOwner.java) | -| Add Bucket Iam Conditional Binding | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/AddBucketIamConditionalBinding.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/AddBucketIamConditionalBinding.java) | -| Add Bucket Iam Member | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/AddBucketIamMember.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/AddBucketIamMember.java) | -| Add Bucket Label | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/AddBucketLabel.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/AddBucketLabel.java) | -| Add Bucket Owner | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/AddBucketOwner.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/AddBucketOwner.java) | -| Change Default Storage Class | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/ChangeDefaultStorageClass.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/ChangeDefaultStorageClass.java) | -| Configure Bucket Cors | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/ConfigureBucketCors.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/ConfigureBucketCors.java) | -| Create Bucket | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/CreateBucket.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/CreateBucket.java) | -| Create Bucket With Storage Class And Location | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/CreateBucketWithStorageClassAndLocation.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/CreateBucketWithStorageClassAndLocation.java) | -| Create Bucket With Turbo Replication | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/CreateBucketWithTurboReplication.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/CreateBucketWithTurboReplication.java) | -| Delete Bucket | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/DeleteBucket.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/DeleteBucket.java) | -| Disable Bucket Versioning | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/DisableBucketVersioning.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/DisableBucketVersioning.java) | -| Disable Default Event Based Hold | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/DisableDefaultEventBasedHold.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/DisableDefaultEventBasedHold.java) | -| Disable Lifecycle Management | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/DisableLifecycleManagement.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/DisableLifecycleManagement.java) | -| Disable Requester Pays | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/DisableRequesterPays.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/DisableRequesterPays.java) | -| Disable Uniform Bucket Level Access | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/DisableUniformBucketLevelAccess.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/DisableUniformBucketLevelAccess.java) | -| Enable Bucket Versioning | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/EnableBucketVersioning.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/EnableBucketVersioning.java) | -| Enable Default Event Based Hold | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/EnableDefaultEventBasedHold.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/EnableDefaultEventBasedHold.java) | -| Enable Lifecycle Management | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/EnableLifecycleManagement.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/EnableLifecycleManagement.java) | -| Enable Requester Pays | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/EnableRequesterPays.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/EnableRequesterPays.java) | -| Enable Uniform Bucket Level Access | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/EnableUniformBucketLevelAccess.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/EnableUniformBucketLevelAccess.java) | -| Get Bucket Metadata | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/GetBucketMetadata.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/GetBucketMetadata.java) | -| Get Bucket Rpo | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/GetBucketRpo.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/GetBucketRpo.java) | -| Get Default Event Based Hold | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/GetDefaultEventBasedHold.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/GetDefaultEventBasedHold.java) | -| Get Public Access Prevention | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/GetPublicAccessPrevention.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/GetPublicAccessPrevention.java) | -| Get Requester Pays Status | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/GetRequesterPaysStatus.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/GetRequesterPaysStatus.java) | -| Get Retention Policy | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/GetRetentionPolicy.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/GetRetentionPolicy.java) | -| Get Uniform Bucket Level Access | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/GetUniformBucketLevelAccess.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/GetUniformBucketLevelAccess.java) | -| List Bucket Iam Members | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/ListBucketIamMembers.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/ListBucketIamMembers.java) | -| List Buckets | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/ListBuckets.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/ListBuckets.java) | -| Lock Retention Policy | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/LockRetentionPolicy.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/LockRetentionPolicy.java) | -| Make Bucket Public | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/MakeBucketPublic.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/MakeBucketPublic.java) | -| Print Bucket Acl | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/PrintBucketAcl.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/PrintBucketAcl.java) | -| Print Bucket Acl Filter By User | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/PrintBucketAclFilterByUser.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/PrintBucketAclFilterByUser.java) | -| Remove Bucket Cors | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketCors.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketCors.java) | -| Remove Bucket Default Kms Key | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketDefaultKmsKey.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketDefaultKmsKey.java) | -| Remove Bucket Default Owner | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketDefaultOwner.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketDefaultOwner.java) | -| Remove Bucket Iam Conditional Binding | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketIamConditionalBinding.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketIamConditionalBinding.java) | -| Remove Bucket Iam Member | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketIamMember.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketIamMember.java) | -| Remove Bucket Label | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketLabel.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketLabel.java) | -| Remove Bucket Owner | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketOwner.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketOwner.java) | -| Remove Retention Policy | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/RemoveRetentionPolicy.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/RemoveRetentionPolicy.java) | -| Set Async Turbo Rpo | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/SetAsyncTurboRpo.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/SetAsyncTurboRpo.java) | -| Set Bucket Default Kms Key | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/SetBucketDefaultKmsKey.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/SetBucketDefaultKmsKey.java) | -| Set Bucket Website Info | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/SetBucketWebsiteInfo.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/SetBucketWebsiteInfo.java) | -| Set Client Endpoint | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/SetClientEndpoint.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/SetClientEndpoint.java) | -| Set Default Rpo | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/SetDefaultRpo.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/SetDefaultRpo.java) | -| Set Public Access Prevention Enforced | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/SetPublicAccessPreventionEnforced.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/SetPublicAccessPreventionEnforced.java) | -| Set Public Access Prevention Inherited | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/SetPublicAccessPreventionInherited.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/SetPublicAccessPreventionInherited.java) | -| Set Retention Policy | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/SetRetentionPolicy.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/SetRetentionPolicy.java) | -| Activate Hmac Key | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/hmac/ActivateHmacKey.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/hmac/ActivateHmacKey.java) | -| Create Hmac Key | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/hmac/CreateHmacKey.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/hmac/CreateHmacKey.java) | -| Deactivate Hmac Key | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/hmac/DeactivateHmacKey.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/hmac/DeactivateHmacKey.java) | -| Delete Hmac Key | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/hmac/DeleteHmacKey.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/hmac/DeleteHmacKey.java) | -| Get Hmac Key | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/hmac/GetHmacKey.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/hmac/GetHmacKey.java) | -| List Hmac Keys | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/hmac/ListHmacKeys.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/hmac/ListHmacKeys.java) | -| Add File Owner | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/AddFileOwner.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/AddFileOwner.java) | -| Change Object Csek To Kms | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/ChangeObjectCsekToKms.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/ChangeObjectCsekToKms.java) | -| Change Object Storage Class | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/ChangeObjectStorageClass.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/ChangeObjectStorageClass.java) | -| Compose Object | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/ComposeObject.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/ComposeObject.java) | -| Copy Object | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/CopyObject.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/CopyObject.java) | -| Copy Old Version Of Object | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/CopyOldVersionOfObject.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/CopyOldVersionOfObject.java) | -| Delete Object | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/DeleteObject.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/DeleteObject.java) | -| Delete Old Version Of Object | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/DeleteOldVersionOfObject.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/DeleteOldVersionOfObject.java) | -| Download Encrypted Object | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/DownloadEncryptedObject.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/DownloadEncryptedObject.java) | -| Download Object | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/DownloadObject.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/DownloadObject.java) | -| Download Object Into Memory | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/DownloadObjectIntoMemory.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/DownloadObjectIntoMemory.java) | -| Download Public Object | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/DownloadPublicObject.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/DownloadPublicObject.java) | -| Download Requester Pays Object | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/DownloadRequesterPaysObject.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/DownloadRequesterPaysObject.java) | -| Generate Encryption Key | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/GenerateEncryptionKey.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/GenerateEncryptionKey.java) | -| Generate V4 Get Object Signed Url | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/GenerateV4GetObjectSignedUrl.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/GenerateV4GetObjectSignedUrl.java) | -| Generate V4 Put Object Signed Url | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/GenerateV4PutObjectSignedUrl.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/GenerateV4PutObjectSignedUrl.java) | -| Get Object Metadata | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/GetObjectMetadata.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/GetObjectMetadata.java) | -| List Objects | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/ListObjects.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/ListObjects.java) | -| List Objects With Old Versions | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/ListObjectsWithOldVersions.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/ListObjectsWithOldVersions.java) | -| List Objects With Prefix | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/ListObjectsWithPrefix.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/ListObjectsWithPrefix.java) | -| Make Object Public | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/MakeObjectPublic.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/MakeObjectPublic.java) | -| Move Object | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/MoveObject.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/MoveObject.java) | -| Print File Acl | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/PrintFileAcl.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/PrintFileAcl.java) | -| Print File Acl For User | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/PrintFileAclForUser.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/PrintFileAclForUser.java) | -| Release Event Based Hold | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/ReleaseEventBasedHold.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/ReleaseEventBasedHold.java) | -| Release Temporary Hold | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/ReleaseTemporaryHold.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/ReleaseTemporaryHold.java) | -| Remove File Owner | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/RemoveFileOwner.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/RemoveFileOwner.java) | -| Rotate Object Encryption Key | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/RotateObjectEncryptionKey.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/RotateObjectEncryptionKey.java) | -| Set Event Based Hold | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/SetEventBasedHold.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/SetEventBasedHold.java) | -| Set Object Metadata | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/SetObjectMetadata.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/SetObjectMetadata.java) | -| Set Temporary Hold | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/SetTemporaryHold.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/SetTemporaryHold.java) | -| Stream Object Download | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/StreamObjectDownload.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/StreamObjectDownload.java) | -| Stream Object Upload | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/StreamObjectUpload.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/StreamObjectUpload.java) | -| Upload Encrypted Object | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/UploadEncryptedObject.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/UploadEncryptedObject.java) | -| Upload Kms Encrypted Object | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/UploadKmsEncryptedObject.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/UploadKmsEncryptedObject.java) | -| Upload Object | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/UploadObject.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/UploadObject.java) | -| Upload Object From Memory | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/UploadObjectFromMemory.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/UploadObjectFromMemory.java) | +| Quickstart Sample | [source code](https://github.com/googleapis/java-storage/blob/master/samples/snippets/src/main/java/com/example/storage/QuickstartSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/QuickstartSample.java) | @@ -332,49 +219,9 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-storage/tree/ To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. -## Supported Java Versions - -Java 8 or above is required for using this client. - -Google's Java client libraries, -[Google Cloud Client Libraries][cloudlibs] -and -[Google Cloud API Libraries][apilibs], -follow the -[Oracle Java SE support roadmap][oracle] -(see the Oracle Java SE Product Releases section). +## Java Versions -### For new development - -In general, new feature development occurs with support for the lowest Java -LTS version covered by Oracle's Premier Support (which typically lasts 5 years -from initial General Availability). If the minimum required JVM for a given -library is changed, it is accompanied by a [semver][semver] major release. - -Java 11 and (in September 2021) Java 17 are the best choices for new -development. - -### Keeping production systems current - -Google tests its client libraries with all current LTS versions covered by -Oracle's Extended Support (which typically lasts 8 years from initial -General Availability). - -#### Legacy support - -Google's client libraries support legacy versions of Java runtimes with long -term stable libraries that don't receive feature updates on a best efforts basis -as it may not be possible to backport all patches. - -Google provides updates on a best efforts basis to apps that continue to use -Java 7, though apps might need to upgrade to current versions of the library -that supports their JVM. - -#### Where to find specific information - -The latest versions and the supported Java versions are identified on -the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` -and on [google-cloud-java][g-c-j]. +Java 7 or above is required for using this client. ## Versioning @@ -382,7 +229,6 @@ This library follows [Semantic Versioning](http://semver.org/), but does update to introduce new methods which can break your implementations if you implement this interface for testing purposes. - ## Contributing @@ -394,7 +240,6 @@ Please note that this project is released with a Contributor Code of Conduct. By this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more information. - ## License Apache 2.0 - See [LICENSE][license] for more information. @@ -403,15 +248,14 @@ Apache 2.0 - See [LICENSE][license] for more information. Java Version | Status ------------ | ------ +Java 7 | [![Kokoro CI][kokoro-badge-image-1]][kokoro-badge-link-1] Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] -Java is a registered trademark of Oracle and/or its affiliates. - [product-docs]: https://cloud.google.com/storage -[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-storage/latest/history +[javadocs]: https://googleapis.dev/java/google-cloud-storage/latest/index.html [kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-storage/java7.svg [kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-storage/java7.html [kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-storage/java8.svg @@ -422,27 +266,18 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-storage/java8-win.html [kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-storage/java11.svg [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 +[stability-image]: https://img.shields.io/badge/stability-ga-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-storage.svg [maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-storage&core=gav [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 -[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy [developer-console]: https://console.developers.google.com/ [create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects [cloud-sdk]: https://cloud.google.com/sdk/ -[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting -[contributing]: https://github.com/googleapis/java-storage/blob/main/CONTRIBUTING.md -[code-of-conduct]: https://github.com/googleapis/java-storage/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct -[license]: https://github.com/googleapis/java-storage/blob/main/LICENSE +[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/master/troubleshooting/readme.md#troubleshooting +[contributing]: https://github.com/googleapis/java-storage/blob/master/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-storage/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-storage/blob/master/LICENSE [enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=storage.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png - -[semver]: https://semver.org/ -[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained -[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries -[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html -[g-c-j]: http://github.com/googleapis/google-cloud-java diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 8b58ae9c01..0000000000 --- a/SECURITY.md +++ /dev/null @@ -1,7 +0,0 @@ -# Security Policy - -To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). - -The Google Security Team will respond within 5 working days of your report on g.co/vulnz. - -We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. diff --git a/gapic-google-cloud-storage-v2/pom.xml b/gapic-google-cloud-storage-v2/pom.xml deleted file mode 100644 index 39cc8785e7..0000000000 --- a/gapic-google-cloud-storage-v2/pom.xml +++ /dev/null @@ -1,97 +0,0 @@ - - 4.0.0 - com.google.api.grpc - gapic-google-cloud-storage-v2 - 2.4.6-alpha-SNAPSHOT - gapic-google-cloud-storage-v2 - GRPC library for gapic-google-cloud-storage-v2 - - com.google.cloud - google-cloud-storage-parent - 2.4.6-SNAPSHOT - - - - io.grpc - grpc-api - - - io.grpc - grpc-stub - - - io.grpc - grpc-protobuf - - - com.google.protobuf - protobuf-java - - - com.google.api.grpc - proto-google-cloud-storage-v2 - - - com.google.api.grpc - grpc-google-cloud-storage-v2 - - - com.google.api.grpc - proto-google-common-protos - - - org.threeten - threetenbp - - - com.google.api - api-common - - - com.google.api - gax - - - com.google.api.grpc - proto-google-iam-v1 - - - - com.google.api - gax-grpc - - - com.google.guava - guava - - - junit - junit - - - - com.google.api - gax-grpc - testlib - test - - - - - - - java9 - - [9,) - - - - javax.annotation - javax.annotation-api - - - - - 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 deleted file mode 100644 index 45f49f593c..0000000000 --- a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageClient.java +++ /dev/null @@ -1,3422 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.storage.v2; - -import com.google.api.core.ApiFuture; -import com.google.api.core.ApiFutures; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.paging.AbstractFixedSizeCollection; -import com.google.api.gax.paging.AbstractPage; -import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.resourcenames.ResourceName; -import com.google.common.util.concurrent.MoreExecutors; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import com.google.storage.v2.stub.StorageStub; -import com.google.storage.v2.stub.StorageStubSettings; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Service Description: ## API Overview and Naming Syntax - * - *

The Cloud Storage gRPC API allows applications to read and write data through the abstractions - * of buckets and objects. For a description of these abstractions please see - * https://cloud.google.com/storage/docs. - * - *

Resources are named as follows: - Projects are referred to as they are defined by the Resource - * Manager API, using strings like `projects/123456` or `projects/my-string-id`. - Buckets are named - * using string names of the form: `projects/{project}/buckets/{bucket}` For globally unique - * buckets, `_` may be substituted for the project. - Objects are uniquely identified by their name - * along with the name of the bucket they belong to, as separate strings in this API. For example: - * - *

ReadObjectRequest { bucket: 'projects/_/buckets/my-bucket' object: 'my-object' } Note that - * object names can contain `/` characters, which are treated as any other character (no special - * directory semantics). - * - *

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

{@code
- * try (StorageClient storageClient = StorageClient.create()) {
- *   BucketName name = BucketName.of("[PROJECT]", "[BUCKET]");
- *   storageClient.deleteBucket(name);
- * }
- * }
- * - *

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

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

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

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

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

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

To customize credentials: - * - *

{@code
- * StorageSettings storageSettings =
- *     StorageSettings.newBuilder()
- *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- *         .build();
- * StorageClient storageClient = StorageClient.create(storageSettings);
- * }
- * - *

To customize the endpoint: - * - *

{@code
- * StorageSettings storageSettings = StorageSettings.newBuilder().setEndpoint(myEndpoint).build();
- * StorageClient storageClient = StorageClient.create(storageSettings);
- * }
- * - *

Please refer to the GitHub repository's samples for more quickstart code snippets. - */ -@Generated("by gapic-generator-java") -public class StorageClient implements BackgroundResource { - private final StorageSettings settings; - private final StorageStub stub; - - /** Constructs an instance of StorageClient with default settings. */ - public static final StorageClient create() throws IOException { - return create(StorageSettings.newBuilder().build()); - } - - /** - * Constructs an instance of StorageClient, using the given settings. The channels are created - * based on the settings passed in, or defaults for any settings that are not set. - */ - public static final StorageClient create(StorageSettings settings) throws IOException { - return new StorageClient(settings); - } - - /** - * Constructs an instance of StorageClient, using the given stub for making calls. This is for - * advanced usage - prefer using create(StorageSettings). - */ - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - public static final StorageClient create(StorageStub stub) { - return new StorageClient(stub); - } - - /** - * Constructs an instance of StorageClient, using the given settings. This is protected so that it - * is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ - protected StorageClient(StorageSettings settings) throws IOException { - this.settings = settings; - this.stub = ((StorageStubSettings) settings.getStubSettings()).createStub(); - } - - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - protected StorageClient(StorageStub stub) { - this.settings = null; - this.stub = stub; - } - - public final StorageSettings getSettings() { - return settings; - } - - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - public StorageStub getStub() { - return stub; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Permanently deletes an empty bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   BucketName name = BucketName.of("[PROJECT]", "[BUCKET]");
-   *   storageClient.deleteBucket(name);
-   * }
-   * }
- * - * @param name Required. Name of a bucket to delete. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteBucket(BucketName name) { - DeleteBucketRequest request = - DeleteBucketRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - deleteBucket(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Permanently deletes an empty bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String name = BucketName.of("[PROJECT]", "[BUCKET]").toString();
-   *   storageClient.deleteBucket(name);
-   * }
-   * }
- * - * @param name Required. Name of a bucket to delete. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteBucket(String name) { - DeleteBucketRequest request = DeleteBucketRequest.newBuilder().setName(name).build(); - deleteBucket(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Permanently deletes an empty bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   DeleteBucketRequest request =
-   *       DeleteBucketRequest.newBuilder()
-   *           .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString())
-   *           .setIfMetagenerationMatch(1043427781)
-   *           .setIfMetagenerationNotMatch(1025430873)
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   storageClient.deleteBucket(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteBucket(DeleteBucketRequest request) { - deleteBucketCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Permanently deletes an empty bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   DeleteBucketRequest request =
-   *       DeleteBucketRequest.newBuilder()
-   *           .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString())
-   *           .setIfMetagenerationMatch(1043427781)
-   *           .setIfMetagenerationNotMatch(1025430873)
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = storageClient.deleteBucketCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
-   * }
-   * }
- */ - public final UnaryCallable deleteBucketCallable() { - return stub.deleteBucketCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Returns metadata for the specified bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   BucketName name = BucketName.of("[PROJECT]", "[BUCKET]");
-   *   Bucket response = storageClient.getBucket(name);
-   * }
-   * }
- * - * @param name Required. Name of a bucket. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Bucket getBucket(BucketName name) { - GetBucketRequest request = - GetBucketRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return getBucket(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Returns metadata for the specified bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String name = BucketName.of("[PROJECT]", "[BUCKET]").toString();
-   *   Bucket response = storageClient.getBucket(name);
-   * }
-   * }
- * - * @param name Required. Name of a bucket. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Bucket getBucket(String name) { - GetBucketRequest request = GetBucketRequest.newBuilder().setName(name).build(); - return getBucket(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Returns metadata for the specified bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   GetBucketRequest request =
-   *       GetBucketRequest.newBuilder()
-   *           .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString())
-   *           .setIfMetagenerationMatch(1043427781)
-   *           .setIfMetagenerationNotMatch(1025430873)
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .setReadMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   Bucket response = storageClient.getBucket(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Bucket getBucket(GetBucketRequest request) { - return getBucketCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Returns metadata for the specified bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   GetBucketRequest request =
-   *       GetBucketRequest.newBuilder()
-   *           .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString())
-   *           .setIfMetagenerationMatch(1043427781)
-   *           .setIfMetagenerationNotMatch(1025430873)
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .setReadMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = storageClient.getBucketCallable().futureCall(request);
-   *   // Do something.
-   *   Bucket response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getBucketCallable() { - return stub.getBucketCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a new bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
-   *   Bucket bucket = Bucket.newBuilder().build();
-   *   String bucketId = "bucketId-1603305307";
-   *   Bucket response = storageClient.createBucket(parent, bucket, bucketId);
-   * }
-   * }
- * - * @param parent Required. The project to which this bucket will belong. - * @param bucket Required. Properties of the new bucket being inserted. The project and name of - * the bucket are specified in this request, not in the bucket resource. - * @param bucketId Required. The ID to use for this bucket, which will become the final component - * of the bucket's resource name. For example, the value `foo` might result in a bucket with - * the name `projects/123456/buckets/foo`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Bucket createBucket(ProjectName parent, Bucket bucket, String bucketId) { - CreateBucketRequest request = - CreateBucketRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setBucket(bucket) - .setBucketId(bucketId) - .build(); - return createBucket(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a new bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String parent = ProjectName.of("[PROJECT]").toString();
-   *   Bucket bucket = Bucket.newBuilder().build();
-   *   String bucketId = "bucketId-1603305307";
-   *   Bucket response = storageClient.createBucket(parent, bucket, bucketId);
-   * }
-   * }
- * - * @param parent Required. The project to which this bucket will belong. - * @param bucket Required. Properties of the new bucket being inserted. The project and name of - * the bucket are specified in this request, not in the bucket resource. - * @param bucketId Required. The ID to use for this bucket, which will become the final component - * of the bucket's resource name. For example, the value `foo` might result in a bucket with - * the name `projects/123456/buckets/foo`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Bucket createBucket(String parent, Bucket bucket, String bucketId) { - CreateBucketRequest request = - CreateBucketRequest.newBuilder() - .setParent(parent) - .setBucket(bucket) - .setBucketId(bucketId) - .build(); - return createBucket(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a new bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   CreateBucketRequest request =
-   *       CreateBucketRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setBucket(Bucket.newBuilder().build())
-   *           .setBucketId("bucketId-1603305307")
-   *           .setPredefinedAcl(PredefinedBucketAcl.forNumber(0))
-   *           .setPredefinedDefaultObjectAcl(PredefinedObjectAcl.forNumber(0))
-   *           .build();
-   *   Bucket response = storageClient.createBucket(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Bucket createBucket(CreateBucketRequest request) { - return createBucketCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a new bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   CreateBucketRequest request =
-   *       CreateBucketRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setBucket(Bucket.newBuilder().build())
-   *           .setBucketId("bucketId-1603305307")
-   *           .setPredefinedAcl(PredefinedBucketAcl.forNumber(0))
-   *           .setPredefinedDefaultObjectAcl(PredefinedObjectAcl.forNumber(0))
-   *           .build();
-   *   ApiFuture future = storageClient.createBucketCallable().futureCall(request);
-   *   // Do something.
-   *   Bucket response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable createBucketCallable() { - return stub.createBucketCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves a list of buckets for a given project. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
-   *   for (Bucket element : storageClient.listBuckets(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param parent Required. The project whose buckets we are listing. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListBucketsPagedResponse listBuckets(ProjectName parent) { - ListBucketsRequest request = - ListBucketsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); - return listBuckets(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves a list of buckets for a given project. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String parent = ProjectName.of("[PROJECT]").toString();
-   *   for (Bucket element : storageClient.listBuckets(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param parent Required. The project whose buckets we are listing. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListBucketsPagedResponse listBuckets(String parent) { - ListBucketsRequest request = ListBucketsRequest.newBuilder().setParent(parent).build(); - return listBuckets(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves a list of buckets for a given project. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ListBucketsRequest request =
-   *       ListBucketsRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .setPrefix("prefix-980110702")
-   *           .setReadMask(FieldMask.newBuilder().build())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   for (Bucket element : storageClient.listBuckets(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListBucketsPagedResponse listBuckets(ListBucketsRequest request) { - return listBucketsPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves a list of buckets for a given project. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ListBucketsRequest request =
-   *       ListBucketsRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .setPrefix("prefix-980110702")
-   *           .setReadMask(FieldMask.newBuilder().build())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = storageClient.listBucketsPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (Bucket element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listBucketsPagedCallable() { - return stub.listBucketsPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves a list of buckets for a given project. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ListBucketsRequest request =
-   *       ListBucketsRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .setPrefix("prefix-980110702")
-   *           .setReadMask(FieldMask.newBuilder().build())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   while (true) {
-   *     ListBucketsResponse response = storageClient.listBucketsCallable().call(request);
-   *     for (Bucket element : response.getResponsesList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable listBucketsCallable() { - return stub.listBucketsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Locks retention policy on a bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   BucketName bucket = BucketName.of("[PROJECT]", "[BUCKET]");
-   *   Bucket response = storageClient.lockBucketRetentionPolicy(bucket);
-   * }
-   * }
- * - * @param bucket Required. Name of a bucket. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Bucket lockBucketRetentionPolicy(BucketName bucket) { - LockBucketRetentionPolicyRequest request = - LockBucketRetentionPolicyRequest.newBuilder() - .setBucket(bucket == null ? null : bucket.toString()) - .build(); - return lockBucketRetentionPolicy(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Locks retention policy on a bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String bucket = BucketName.of("[PROJECT]", "[BUCKET]").toString();
-   *   Bucket response = storageClient.lockBucketRetentionPolicy(bucket);
-   * }
-   * }
- * - * @param bucket Required. Name of a bucket. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Bucket lockBucketRetentionPolicy(String bucket) { - LockBucketRetentionPolicyRequest request = - LockBucketRetentionPolicyRequest.newBuilder().setBucket(bucket).build(); - return lockBucketRetentionPolicy(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Locks retention policy on a bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   LockBucketRetentionPolicyRequest request =
-   *       LockBucketRetentionPolicyRequest.newBuilder()
-   *           .setBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString())
-   *           .setIfMetagenerationMatch(1043427781)
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   Bucket response = storageClient.lockBucketRetentionPolicy(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Bucket lockBucketRetentionPolicy(LockBucketRetentionPolicyRequest request) { - return lockBucketRetentionPolicyCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Locks retention policy on a bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   LockBucketRetentionPolicyRequest request =
-   *       LockBucketRetentionPolicyRequest.newBuilder()
-   *           .setBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString())
-   *           .setIfMetagenerationMatch(1043427781)
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   ApiFuture future =
-   *       storageClient.lockBucketRetentionPolicyCallable().futureCall(request);
-   *   // Do something.
-   *   Bucket response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable - lockBucketRetentionPolicyCallable() { - return stub.lockBucketRetentionPolicyCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the IAM policy for a specified bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ResourceName resource =
-   *       CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
-   *   Policy response = storageClient.getIamPolicy(resource);
-   * }
-   * }
- * - * @param resource REQUIRED: The resource for which the policy is being requested. See the - * operation documentation for the appropriate value for this field. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Policy getIamPolicy(ResourceName resource) { - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(resource == null ? null : resource.toString()) - .build(); - return getIamPolicy(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the IAM policy for a specified bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String resource =
-   *       CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString();
-   *   Policy response = storageClient.getIamPolicy(resource);
-   * }
-   * }
- * - * @param resource REQUIRED: The resource for which the policy is being requested. See the - * operation documentation for the appropriate value for this field. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Policy getIamPolicy(String resource) { - GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); - return getIamPolicy(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the IAM policy for a specified bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   GetIamPolicyRequest request =
-   *       GetIamPolicyRequest.newBuilder()
-   *           .setResource(
-   *               CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
-   *                   .toString())
-   *           .setOptions(GetPolicyOptions.newBuilder().build())
-   *           .build();
-   *   Policy response = storageClient.getIamPolicy(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Policy getIamPolicy(GetIamPolicyRequest request) { - return getIamPolicyCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the IAM policy for a specified bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   GetIamPolicyRequest request =
-   *       GetIamPolicyRequest.newBuilder()
-   *           .setResource(
-   *               CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
-   *                   .toString())
-   *           .setOptions(GetPolicyOptions.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = storageClient.getIamPolicyCallable().futureCall(request);
-   *   // Do something.
-   *   Policy response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getIamPolicyCallable() { - return stub.getIamPolicyCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates an IAM policy for the specified bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ResourceName resource =
-   *       CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
-   *   Policy policy = Policy.newBuilder().build();
-   *   Policy response = storageClient.setIamPolicy(resource, policy);
-   * }
-   * }
- * - * @param resource REQUIRED: The resource for which the policy is being specified. See the - * operation documentation for the appropriate value for this field. - * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the - * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud - * Platform services (such as Projects) might reject them. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Policy setIamPolicy(ResourceName resource, Policy policy) { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(resource == null ? null : resource.toString()) - .setPolicy(policy) - .build(); - return setIamPolicy(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates an IAM policy for the specified bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String resource =
-   *       CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString();
-   *   Policy policy = Policy.newBuilder().build();
-   *   Policy response = storageClient.setIamPolicy(resource, policy);
-   * }
-   * }
- * - * @param resource REQUIRED: The resource for which the policy is being specified. See the - * operation documentation for the appropriate value for this field. - * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the - * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud - * Platform services (such as Projects) might reject them. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Policy setIamPolicy(String resource, Policy policy) { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); - return setIamPolicy(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates an IAM policy for the specified bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   SetIamPolicyRequest request =
-   *       SetIamPolicyRequest.newBuilder()
-   *           .setResource(
-   *               CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
-   *                   .toString())
-   *           .setPolicy(Policy.newBuilder().build())
-   *           .build();
-   *   Policy response = storageClient.setIamPolicy(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Policy setIamPolicy(SetIamPolicyRequest request) { - return setIamPolicyCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates an IAM policy for the specified bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   SetIamPolicyRequest request =
-   *       SetIamPolicyRequest.newBuilder()
-   *           .setResource(
-   *               CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
-   *                   .toString())
-   *           .setPolicy(Policy.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = storageClient.setIamPolicyCallable().futureCall(request);
-   *   // Do something.
-   *   Policy response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable setIamPolicyCallable() { - return stub.setIamPolicyCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Tests a set of permissions on the given bucket to see which, if any, are held by the caller. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ResourceName resource =
-   *       CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
-   *   List permissions = new ArrayList<>();
-   *   TestIamPermissionsResponse response = storageClient.testIamPermissions(resource, permissions);
-   * }
-   * }
- * - * @param resource REQUIRED: The resource for which the policy detail is being requested. See the - * operation documentation for the appropriate value for this field. - * @param permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final TestIamPermissionsResponse testIamPermissions( - ResourceName resource, List permissions) { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(resource == null ? null : resource.toString()) - .addAllPermissions(permissions) - .build(); - return testIamPermissions(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Tests a set of permissions on the given bucket to see which, if any, are held by the caller. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String resource =
-   *       CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString();
-   *   List permissions = new ArrayList<>();
-   *   TestIamPermissionsResponse response = storageClient.testIamPermissions(resource, permissions);
-   * }
-   * }
- * - * @param resource REQUIRED: The resource for which the policy detail is being requested. See the - * operation documentation for the appropriate value for this field. - * @param permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final TestIamPermissionsResponse testIamPermissions( - String resource, List permissions) { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(resource) - .addAllPermissions(permissions) - .build(); - return testIamPermissions(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Tests a set of permissions on the given bucket to see which, if any, are held by the caller. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   TestIamPermissionsRequest request =
-   *       TestIamPermissionsRequest.newBuilder()
-   *           .setResource(
-   *               CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
-   *                   .toString())
-   *           .addAllPermissions(new ArrayList())
-   *           .build();
-   *   TestIamPermissionsResponse response = storageClient.testIamPermissions(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { - return testIamPermissionsCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Tests a set of permissions on the given bucket to see which, if any, are held by the caller. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   TestIamPermissionsRequest request =
-   *       TestIamPermissionsRequest.newBuilder()
-   *           .setResource(
-   *               CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
-   *                   .toString())
-   *           .addAllPermissions(new ArrayList())
-   *           .build();
-   *   ApiFuture future =
-   *       storageClient.testIamPermissionsCallable().futureCall(request);
-   *   // Do something.
-   *   TestIamPermissionsResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable - testIamPermissionsCallable() { - return stub.testIamPermissionsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates a bucket. Equivalent to JSON API's storage.buckets.patch method. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   Bucket bucket = Bucket.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   Bucket response = storageClient.updateBucket(bucket, updateMask);
-   * }
-   * }
- * - * @param bucket The bucket to update. The bucket's `name` field will be used to identify the - * bucket. - * @param updateMask List of fields to be updated. - *

To specify ALL fields, equivalent to the JSON API's "update" function, specify a single - * field with the value `*`. Note: not recommended. If a new field is introduced at a - * later time, an older client updating with the `*` may accidentally reset the new - * field's value. - *

Not specifying any fields is an error. Not specifying a field while setting that field - * to a non-default value is an error. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Bucket updateBucket(Bucket bucket, FieldMask updateMask) { - UpdateBucketRequest request = - UpdateBucketRequest.newBuilder().setBucket(bucket).setUpdateMask(updateMask).build(); - return updateBucket(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates a bucket. Equivalent to JSON API's storage.buckets.patch method. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   UpdateBucketRequest request =
-   *       UpdateBucketRequest.newBuilder()
-   *           .setBucket(Bucket.newBuilder().build())
-   *           .setIfMetagenerationMatch(1043427781)
-   *           .setIfMetagenerationNotMatch(1025430873)
-   *           .setPredefinedAcl(PredefinedBucketAcl.forNumber(0))
-   *           .setPredefinedDefaultObjectAcl(PredefinedObjectAcl.forNumber(0))
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   Bucket response = storageClient.updateBucket(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Bucket updateBucket(UpdateBucketRequest request) { - return updateBucketCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates a bucket. Equivalent to JSON API's storage.buckets.patch method. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   UpdateBucketRequest request =
-   *       UpdateBucketRequest.newBuilder()
-   *           .setBucket(Bucket.newBuilder().build())
-   *           .setIfMetagenerationMatch(1043427781)
-   *           .setIfMetagenerationNotMatch(1025430873)
-   *           .setPredefinedAcl(PredefinedBucketAcl.forNumber(0))
-   *           .setPredefinedDefaultObjectAcl(PredefinedObjectAcl.forNumber(0))
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = storageClient.updateBucketCallable().futureCall(request);
-   *   // Do something.
-   *   Bucket response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable updateBucketCallable() { - return stub.updateBucketCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Permanently deletes a notification subscription. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   NotificationName name = NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]");
-   *   storageClient.deleteNotification(name);
-   * }
-   * }
- * - * @param name Required. The parent bucket of the notification. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteNotification(NotificationName name) { - DeleteNotificationRequest request = - DeleteNotificationRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); - deleteNotification(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Permanently deletes a notification subscription. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String name = NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]").toString();
-   *   storageClient.deleteNotification(name);
-   * }
-   * }
- * - * @param name Required. The parent bucket of the notification. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteNotification(String name) { - DeleteNotificationRequest request = - DeleteNotificationRequest.newBuilder().setName(name).build(); - deleteNotification(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Permanently deletes a notification subscription. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   DeleteNotificationRequest request =
-   *       DeleteNotificationRequest.newBuilder()
-   *           .setName(NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]").toString())
-   *           .build();
-   *   storageClient.deleteNotification(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteNotification(DeleteNotificationRequest request) { - deleteNotificationCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Permanently deletes a notification subscription. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   DeleteNotificationRequest request =
-   *       DeleteNotificationRequest.newBuilder()
-   *           .setName(NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]").toString())
-   *           .build();
-   *   ApiFuture future = storageClient.deleteNotificationCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
-   * }
-   * }
- */ - public final UnaryCallable deleteNotificationCallable() { - return stub.deleteNotificationCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * View a notification config. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   BucketName name = BucketName.of("[PROJECT]", "[BUCKET]");
-   *   Notification response = storageClient.getNotification(name);
-   * }
-   * }
- * - * @param name Required. The parent bucket of the notification. Format: - * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Notification getNotification(BucketName name) { - GetNotificationRequest request = - GetNotificationRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return getNotification(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * View a notification config. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String name = BucketName.of("[PROJECT]", "[BUCKET]").toString();
-   *   Notification response = storageClient.getNotification(name);
-   * }
-   * }
- * - * @param name Required. The parent bucket of the notification. Format: - * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Notification getNotification(String name) { - GetNotificationRequest request = GetNotificationRequest.newBuilder().setName(name).build(); - return getNotification(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * View a notification config. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   GetNotificationRequest request =
-   *       GetNotificationRequest.newBuilder()
-   *           .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString())
-   *           .build();
-   *   Notification response = storageClient.getNotification(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Notification getNotification(GetNotificationRequest request) { - return getNotificationCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * View a notification config. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   GetNotificationRequest request =
-   *       GetNotificationRequest.newBuilder()
-   *           .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString())
-   *           .build();
-   *   ApiFuture future = storageClient.getNotificationCallable().futureCall(request);
-   *   // Do something.
-   *   Notification response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getNotificationCallable() { - return stub.getNotificationCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a notification subscription for a given bucket. These notifications, when triggered, - * publish messages to the specified Pub/Sub topics. See - * https://cloud.google.com/storage/docs/pubsub-notifications. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
-   *   Notification notification = Notification.newBuilder().build();
-   *   Notification response = storageClient.createNotification(parent, notification);
-   * }
-   * }
- * - * @param parent Required. The bucket to which this notification belongs. - * @param notification Required. Properties of the notification to be inserted. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Notification createNotification(ProjectName parent, Notification notification) { - CreateNotificationRequest request = - CreateNotificationRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setNotification(notification) - .build(); - return createNotification(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a notification subscription for a given bucket. These notifications, when triggered, - * publish messages to the specified Pub/Sub topics. See - * https://cloud.google.com/storage/docs/pubsub-notifications. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String parent = ProjectName.of("[PROJECT]").toString();
-   *   Notification notification = Notification.newBuilder().build();
-   *   Notification response = storageClient.createNotification(parent, notification);
-   * }
-   * }
- * - * @param parent Required. The bucket to which this notification belongs. - * @param notification Required. Properties of the notification to be inserted. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Notification createNotification(String parent, Notification notification) { - CreateNotificationRequest request = - CreateNotificationRequest.newBuilder() - .setParent(parent) - .setNotification(notification) - .build(); - return createNotification(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a notification subscription for a given bucket. These notifications, when triggered, - * publish messages to the specified Pub/Sub topics. See - * https://cloud.google.com/storage/docs/pubsub-notifications. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   CreateNotificationRequest request =
-   *       CreateNotificationRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setNotification(Notification.newBuilder().build())
-   *           .build();
-   *   Notification response = storageClient.createNotification(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Notification createNotification(CreateNotificationRequest request) { - return createNotificationCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a notification subscription for a given bucket. These notifications, when triggered, - * publish messages to the specified Pub/Sub topics. See - * https://cloud.google.com/storage/docs/pubsub-notifications. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   CreateNotificationRequest request =
-   *       CreateNotificationRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setNotification(Notification.newBuilder().build())
-   *           .build();
-   *   ApiFuture future =
-   *       storageClient.createNotificationCallable().futureCall(request);
-   *   // Do something.
-   *   Notification response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable createNotificationCallable() { - return stub.createNotificationCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves a list of notification subscriptions for a given bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
-   *   for (Notification element : storageClient.listNotifications(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param parent Required. Name of a Google Cloud Storage bucket. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListNotificationsPagedResponse listNotifications(ProjectName parent) { - ListNotificationsRequest request = - ListNotificationsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); - return listNotifications(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves a list of notification subscriptions for a given bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String parent = ProjectName.of("[PROJECT]").toString();
-   *   for (Notification element : storageClient.listNotifications(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param parent Required. Name of a Google Cloud Storage bucket. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListNotificationsPagedResponse listNotifications(String parent) { - ListNotificationsRequest request = - ListNotificationsRequest.newBuilder().setParent(parent).build(); - return listNotifications(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves a list of notification subscriptions for a given bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ListNotificationsRequest request =
-   *       ListNotificationsRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   for (Notification element : storageClient.listNotifications(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListNotificationsPagedResponse listNotifications(ListNotificationsRequest request) { - return listNotificationsPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves a list of notification subscriptions for a given bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ListNotificationsRequest request =
-   *       ListNotificationsRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   ApiFuture future =
-   *       storageClient.listNotificationsPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (Notification element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listNotificationsPagedCallable() { - return stub.listNotificationsPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves a list of notification subscriptions for a given bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ListNotificationsRequest request =
-   *       ListNotificationsRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   while (true) {
-   *     ListNotificationsResponse response =
-   *         storageClient.listNotificationsCallable().call(request);
-   *     for (Notification element : response.getResponsesList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listNotificationsCallable() { - return stub.listNotificationsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Concatenates a list of existing objects into a new object in the same bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ComposeObjectRequest request =
-   *       ComposeObjectRequest.newBuilder()
-   *           .setDestination(Object.newBuilder().build())
-   *           .addAllSourceObjects(new ArrayList())
-   *           .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0))
-   *           .setIfGenerationMatch(-1086241088)
-   *           .setIfMetagenerationMatch(1043427781)
-   *           .setKmsKey(
-   *               CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
-   *                   .toString())
-   *           .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   Object response = storageClient.composeObject(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Object composeObject(ComposeObjectRequest request) { - return composeObjectCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Concatenates a list of existing objects into a new object in the same bucket. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ComposeObjectRequest request =
-   *       ComposeObjectRequest.newBuilder()
-   *           .setDestination(Object.newBuilder().build())
-   *           .addAllSourceObjects(new ArrayList())
-   *           .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0))
-   *           .setIfGenerationMatch(-1086241088)
-   *           .setIfMetagenerationMatch(1043427781)
-   *           .setKmsKey(
-   *               CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
-   *                   .toString())
-   *           .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = storageClient.composeObjectCallable().futureCall(request);
-   *   // Do something.
-   *   Object response = future.get();
-   * }
-   * }
-   */
-  public final UnaryCallable composeObjectCallable() {
-    return stub.composeObjectCallable();
-  }
-
-  // AUTO-GENERATED DOCUMENTATION AND METHOD.
-  /**
-   * Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for
-   * the bucket, or if the `generation` parameter is used.
-   *
-   * 

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String bucket = "bucket-1378203158";
-   *   String object = "object-1023368385";
-   *   storageClient.deleteObject(bucket, object);
-   * }
-   * }
- * - * @param bucket Required. Name of the bucket in which the object resides. - * @param object Required. The name of the object to delete (when not using a resumable write). - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteObject(String bucket, String object) { - DeleteObjectRequest request = - DeleteObjectRequest.newBuilder().setBucket(bucket).setObject(object).build(); - deleteObject(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for - * the bucket, or if the `generation` parameter is used. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String bucket = "bucket-1378203158";
-   *   String object = "object-1023368385";
-   *   long generation = 305703192;
-   *   storageClient.deleteObject(bucket, object, generation);
-   * }
-   * }
- * - * @param bucket Required. Name of the bucket in which the object resides. - * @param object Required. The name of the object to delete (when not using a resumable write). - * @param generation If present, permanently deletes a specific revision of this object (as - * opposed to the latest version, the default). - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteObject(String bucket, String object, long generation) { - DeleteObjectRequest request = - DeleteObjectRequest.newBuilder() - .setBucket(bucket) - .setObject(object) - .setGeneration(generation) - .build(); - deleteObject(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for - * the bucket, or if the `generation` parameter is used. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   DeleteObjectRequest request =
-   *       DeleteObjectRequest.newBuilder()
-   *           .setBucket("bucket-1378203158")
-   *           .setObject("object-1023368385")
-   *           .setUploadId("uploadId1563990780")
-   *           .setGeneration(305703192)
-   *           .setIfGenerationMatch(-1086241088)
-   *           .setIfGenerationNotMatch(1475720404)
-   *           .setIfMetagenerationMatch(1043427781)
-   *           .setIfMetagenerationNotMatch(1025430873)
-   *           .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   storageClient.deleteObject(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteObject(DeleteObjectRequest request) { - deleteObjectCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for - * the bucket, or if the `generation` parameter is used. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   DeleteObjectRequest request =
-   *       DeleteObjectRequest.newBuilder()
-   *           .setBucket("bucket-1378203158")
-   *           .setObject("object-1023368385")
-   *           .setUploadId("uploadId1563990780")
-   *           .setGeneration(305703192)
-   *           .setIfGenerationMatch(-1086241088)
-   *           .setIfGenerationNotMatch(1475720404)
-   *           .setIfMetagenerationMatch(1043427781)
-   *           .setIfMetagenerationNotMatch(1025430873)
-   *           .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = storageClient.deleteObjectCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
-   * }
-   * }
- */ - public final UnaryCallable deleteObjectCallable() { - return stub.deleteObjectCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves an object's metadata. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String bucket = "bucket-1378203158";
-   *   String object = "object-1023368385";
-   *   Object response = storageClient.getObject(bucket, object);
-   * }
-   * }
- * - * @param bucket Required. Name of the bucket in which the object resides. - * @param object Required. Name of the object. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Object getObject(String bucket, String object) { - GetObjectRequest request = - GetObjectRequest.newBuilder().setBucket(bucket).setObject(object).build(); - return getObject(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves an object's metadata. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String bucket = "bucket-1378203158";
-   *   String object = "object-1023368385";
-   *   long generation = 305703192;
-   *   Object response = storageClient.getObject(bucket, object, generation);
-   * }
-   * }
- * - * @param bucket Required. Name of the bucket in which the object resides. - * @param object Required. Name of the object. - * @param generation If present, selects a specific revision of this object (as opposed to the - * latest version, the default). - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Object getObject(String bucket, String object, long generation) { - GetObjectRequest request = - GetObjectRequest.newBuilder() - .setBucket(bucket) - .setObject(object) - .setGeneration(generation) - .build(); - return getObject(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves an object's metadata. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   GetObjectRequest request =
-   *       GetObjectRequest.newBuilder()
-   *           .setBucket("bucket-1378203158")
-   *           .setObject("object-1023368385")
-   *           .setGeneration(305703192)
-   *           .setIfGenerationMatch(-1086241088)
-   *           .setIfGenerationNotMatch(1475720404)
-   *           .setIfMetagenerationMatch(1043427781)
-   *           .setIfMetagenerationNotMatch(1025430873)
-   *           .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .setReadMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   Object response = storageClient.getObject(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Object getObject(GetObjectRequest request) { - return getObjectCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves an object's metadata. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   GetObjectRequest request =
-   *       GetObjectRequest.newBuilder()
-   *           .setBucket("bucket-1378203158")
-   *           .setObject("object-1023368385")
-   *           .setGeneration(305703192)
-   *           .setIfGenerationMatch(-1086241088)
-   *           .setIfGenerationNotMatch(1475720404)
-   *           .setIfMetagenerationMatch(1043427781)
-   *           .setIfMetagenerationNotMatch(1025430873)
-   *           .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .setReadMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = storageClient.getObjectCallable().futureCall(request);
-   *   // Do something.
-   *   Object response = future.get();
-   * }
-   * }
-   */
-  public final UnaryCallable getObjectCallable() {
-    return stub.getObjectCallable();
-  }
-
-  // AUTO-GENERATED DOCUMENTATION AND METHOD.
-  /**
-   * Reads an object's data.
-   *
-   * 

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ReadObjectRequest request =
-   *       ReadObjectRequest.newBuilder()
-   *           .setBucket("bucket-1378203158")
-   *           .setObject("object-1023368385")
-   *           .setGeneration(305703192)
-   *           .setReadOffset(-715377828)
-   *           .setReadLimit(-164298798)
-   *           .setIfGenerationMatch(-1086241088)
-   *           .setIfGenerationNotMatch(1475720404)
-   *           .setIfMetagenerationMatch(1043427781)
-   *           .setIfMetagenerationNotMatch(1025430873)
-   *           .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .setReadMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   ServerStream stream = storageClient.readObjectCallable().call(request);
-   *   for (ReadObjectResponse response : stream) {
-   *     // Do something when a response is received.
-   *   }
-   * }
-   * }
- */ - public final ServerStreamingCallable readObjectCallable() { - return stub.readObjectCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates an object's metadata. Equivalent to JSON API's storage.objects.patch. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   Object object = Object.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   Object response = storageClient.updateObject(object, updateMask);
-   * }
-   * }
- * - * @param object The object to update. The object's bucket and name fields are used to identify - * the object to update. If present, the object's generation field selects a specific revision - * of this object whose metadata should be updated. Otherwise, assumes the current, live - * version of the object. - * @param updateMask List of fields to be updated. - *

To specify ALL fields, equivalent to the JSON API's "update" function, specify a single - * field with the value `*`. Note: not recommended. If a new field is introduced at a - * later time, an older client updating with the `*` may accidentally reset the new - * field's value. - *

Not specifying any fields is an error. Not specifying a field while setting that field - * to a non-default value is an error. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Object updateObject(Object object, FieldMask updateMask) { - UpdateObjectRequest request = - UpdateObjectRequest.newBuilder().setObject(object).setUpdateMask(updateMask).build(); - return updateObject(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates an object's metadata. Equivalent to JSON API's storage.objects.patch. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   UpdateObjectRequest request =
-   *       UpdateObjectRequest.newBuilder()
-   *           .setObject(Object.newBuilder().build())
-   *           .setIfGenerationMatch(-1086241088)
-   *           .setIfGenerationNotMatch(1475720404)
-   *           .setIfMetagenerationMatch(1043427781)
-   *           .setIfMetagenerationNotMatch(1025430873)
-   *           .setPredefinedAcl(PredefinedObjectAcl.forNumber(0))
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   Object response = storageClient.updateObject(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Object updateObject(UpdateObjectRequest request) { - return updateObjectCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates an object's metadata. Equivalent to JSON API's storage.objects.patch. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   UpdateObjectRequest request =
-   *       UpdateObjectRequest.newBuilder()
-   *           .setObject(Object.newBuilder().build())
-   *           .setIfGenerationMatch(-1086241088)
-   *           .setIfGenerationNotMatch(1475720404)
-   *           .setIfMetagenerationMatch(1043427781)
-   *           .setIfMetagenerationNotMatch(1025430873)
-   *           .setPredefinedAcl(PredefinedObjectAcl.forNumber(0))
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = storageClient.updateObjectCallable().futureCall(request);
-   *   // Do something.
-   *   Object response = future.get();
-   * }
-   * }
-   */
-  public final UnaryCallable updateObjectCallable() {
-    return stub.updateObjectCallable();
-  }
-
-  // AUTO-GENERATED DOCUMENTATION AND METHOD.
-  /**
-   * Stores a new object and metadata.
-   *
-   * 

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

For a resumable write, the client should instead call `StartResumableWrite()` and provide - * that method an `WriteObjectSpec.` They should then attach the returned `upload_id` to the first - * message of each following call to `Create`. If there is an error or the connection is broken - * during the resumable `Create()`, the client should check the status of the `Create()` by - * calling `QueryWriteStatus()` and continue writing from the returned `persisted_size`. This may - * be less than the amount of data the client previously sent. - * - *

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

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ApiStreamObserver responseObserver =
-   *       new ApiStreamObserver() {
-   *         {@literal @}Override
-   *         public void onNext(WriteObjectResponse response) {
-   *           // Do something when a response is received.
-   *         }
-   *
-   *         {@literal @}Override
-   *         public void onError(Throwable t) {
-   *           // Add error-handling
-   *         }
-   *
-   *         {@literal @}Override
-   *         public void onCompleted() {
-   *           // Do something when complete.
-   *         }
-   *       };
-   *   ApiStreamObserver requestObserver =
-   *       storageClient.writeObject().clientStreamingCall(responseObserver);
-   *   WriteObjectRequest request =
-   *       WriteObjectRequest.newBuilder()
-   *           .setWriteOffset(-1559543565)
-   *           .setObjectChecksums(ObjectChecksums.newBuilder().build())
-   *           .setFinishWrite(true)
-   *           .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   requestObserver.onNext(request);
-   * }
-   * }
- */ - public final ClientStreamingCallable - writeObjectCallable() { - return stub.writeObjectCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves a list of objects matching the criteria. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
-   *   for (Object element : storageClient.listObjects(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param parent Required. Name of the bucket in which to look for objects. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListObjectsPagedResponse listObjects(ProjectName parent) { - ListObjectsRequest request = - ListObjectsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); - return listObjects(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves a list of objects matching the criteria. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String parent = ProjectName.of("[PROJECT]").toString();
-   *   for (Object element : storageClient.listObjects(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param parent Required. Name of the bucket in which to look for objects. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListObjectsPagedResponse listObjects(String parent) { - ListObjectsRequest request = ListObjectsRequest.newBuilder().setParent(parent).build(); - return listObjects(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves a list of objects matching the criteria. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ListObjectsRequest request =
-   *       ListObjectsRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .setDelimiter("delimiter-250518009")
-   *           .setIncludeTrailingDelimiter(true)
-   *           .setPrefix("prefix-980110702")
-   *           .setVersions(true)
-   *           .setReadMask(FieldMask.newBuilder().build())
-   *           .setLexicographicStart("lexicographicStart-2093413008")
-   *           .setLexicographicEnd("lexicographicEnd1646968169")
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   for (Object element : storageClient.listObjects(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListObjectsPagedResponse listObjects(ListObjectsRequest request) { - return listObjectsPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves a list of objects matching the criteria. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ListObjectsRequest request =
-   *       ListObjectsRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .setDelimiter("delimiter-250518009")
-   *           .setIncludeTrailingDelimiter(true)
-   *           .setPrefix("prefix-980110702")
-   *           .setVersions(true)
-   *           .setReadMask(FieldMask.newBuilder().build())
-   *           .setLexicographicStart("lexicographicStart-2093413008")
-   *           .setLexicographicEnd("lexicographicEnd1646968169")
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = storageClient.listObjectsPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (Object element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
-   */
-  public final UnaryCallable
-      listObjectsPagedCallable() {
-    return stub.listObjectsPagedCallable();
-  }
-
-  // AUTO-GENERATED DOCUMENTATION AND METHOD.
-  /**
-   * Retrieves a list of objects matching the criteria.
-   *
-   * 

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ListObjectsRequest request =
-   *       ListObjectsRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .setDelimiter("delimiter-250518009")
-   *           .setIncludeTrailingDelimiter(true)
-   *           .setPrefix("prefix-980110702")
-   *           .setVersions(true)
-   *           .setReadMask(FieldMask.newBuilder().build())
-   *           .setLexicographicStart("lexicographicStart-2093413008")
-   *           .setLexicographicEnd("lexicographicEnd1646968169")
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   while (true) {
-   *     ListObjectsResponse response = storageClient.listObjectsCallable().call(request);
-   *     for (Object element : response.getResponsesList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable listObjectsCallable() { - return stub.listObjectsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Rewrites a source object to a destination object. Optionally overrides metadata. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   RewriteObjectRequest request =
-   *       RewriteObjectRequest.newBuilder()
-   *           .setDestinationName("destinationName-1762755655")
-   *           .setDestinationBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString())
-   *           .setDestinationKmsKey(
-   *               CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
-   *                   .toString())
-   *           .setDestination(Object.newBuilder().build())
-   *           .setSourceBucket("sourceBucket841604581")
-   *           .setSourceObject("sourceObject1196439354")
-   *           .setSourceGeneration(1232209852)
-   *           .setRewriteToken("rewriteToken80654285")
-   *           .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0))
-   *           .setIfGenerationMatch(-1086241088)
-   *           .setIfGenerationNotMatch(1475720404)
-   *           .setIfMetagenerationMatch(1043427781)
-   *           .setIfMetagenerationNotMatch(1025430873)
-   *           .setIfSourceGenerationMatch(-1427877280)
-   *           .setIfSourceGenerationNotMatch(1575612532)
-   *           .setIfSourceMetagenerationMatch(1143319909)
-   *           .setIfSourceMetagenerationNotMatch(1900822777)
-   *           .setMaxBytesRewrittenPerCall(1178170730)
-   *           .setCopySourceEncryptionAlgorithm("copySourceEncryptionAlgorithm-1524952548")
-   *           .setCopySourceEncryptionKeyBytes(ByteString.EMPTY)
-   *           .setCopySourceEncryptionKeySha256Bytes(ByteString.EMPTY)
-   *           .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   RewriteResponse response = storageClient.rewriteObject(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final RewriteResponse rewriteObject(RewriteObjectRequest request) { - return rewriteObjectCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Rewrites a source object to a destination object. Optionally overrides metadata. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   RewriteObjectRequest request =
-   *       RewriteObjectRequest.newBuilder()
-   *           .setDestinationName("destinationName-1762755655")
-   *           .setDestinationBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString())
-   *           .setDestinationKmsKey(
-   *               CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
-   *                   .toString())
-   *           .setDestination(Object.newBuilder().build())
-   *           .setSourceBucket("sourceBucket841604581")
-   *           .setSourceObject("sourceObject1196439354")
-   *           .setSourceGeneration(1232209852)
-   *           .setRewriteToken("rewriteToken80654285")
-   *           .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0))
-   *           .setIfGenerationMatch(-1086241088)
-   *           .setIfGenerationNotMatch(1475720404)
-   *           .setIfMetagenerationMatch(1043427781)
-   *           .setIfMetagenerationNotMatch(1025430873)
-   *           .setIfSourceGenerationMatch(-1427877280)
-   *           .setIfSourceGenerationNotMatch(1575612532)
-   *           .setIfSourceMetagenerationMatch(1143319909)
-   *           .setIfSourceMetagenerationNotMatch(1900822777)
-   *           .setMaxBytesRewrittenPerCall(1178170730)
-   *           .setCopySourceEncryptionAlgorithm("copySourceEncryptionAlgorithm-1524952548")
-   *           .setCopySourceEncryptionKeyBytes(ByteString.EMPTY)
-   *           .setCopySourceEncryptionKeySha256Bytes(ByteString.EMPTY)
-   *           .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = storageClient.rewriteObjectCallable().futureCall(request);
-   *   // Do something.
-   *   RewriteResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable rewriteObjectCallable() { - return stub.rewriteObjectCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Starts a resumable write. How long the write operation remains valid, and what happens when the - * write operation becomes invalid, are service-dependent. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   StartResumableWriteRequest request =
-   *       StartResumableWriteRequest.newBuilder()
-   *           .setWriteObjectSpec(WriteObjectSpec.newBuilder().build())
-   *           .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   StartResumableWriteResponse response = storageClient.startResumableWrite(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final StartResumableWriteResponse startResumableWrite(StartResumableWriteRequest request) { - return startResumableWriteCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Starts a resumable write. How long the write operation remains valid, and what happens when the - * write operation becomes invalid, are service-dependent. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   StartResumableWriteRequest request =
-   *       StartResumableWriteRequest.newBuilder()
-   *           .setWriteObjectSpec(WriteObjectSpec.newBuilder().build())
-   *           .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   ApiFuture future =
-   *       storageClient.startResumableWriteCallable().futureCall(request);
-   *   // Do something.
-   *   StartResumableWriteResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable - startResumableWriteCallable() { - return stub.startResumableWriteCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Determines the `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. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String uploadId = "uploadId1563990780";
-   *   QueryWriteStatusResponse response = storageClient.queryWriteStatus(uploadId);
-   * }
-   * }
- * - * @param uploadId Required. The name of the resume token for the object whose write status is - * being requested. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final QueryWriteStatusResponse queryWriteStatus(String uploadId) { - QueryWriteStatusRequest request = - QueryWriteStatusRequest.newBuilder().setUploadId(uploadId).build(); - return queryWriteStatus(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Determines the `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. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   QueryWriteStatusRequest request =
-   *       QueryWriteStatusRequest.newBuilder()
-   *           .setUploadId("uploadId1563990780")
-   *           .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   QueryWriteStatusResponse response = storageClient.queryWriteStatus(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final QueryWriteStatusResponse queryWriteStatus(QueryWriteStatusRequest request) { - return queryWriteStatusCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Determines the `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. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   QueryWriteStatusRequest request =
-   *       QueryWriteStatusRequest.newBuilder()
-   *           .setUploadId("uploadId1563990780")
-   *           .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   ApiFuture future =
-   *       storageClient.queryWriteStatusCallable().futureCall(request);
-   *   // Do something.
-   *   QueryWriteStatusResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable - queryWriteStatusCallable() { - return stub.queryWriteStatusCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the name of a project's Google Cloud Storage service account. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   ServiceAccount response = storageClient.getServiceAccount(project);
-   * }
-   * }
- * - * @param project Required. Project ID. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ServiceAccount getServiceAccount(ProjectName project) { - GetServiceAccountRequest request = - GetServiceAccountRequest.newBuilder() - .setProject(project == null ? null : project.toString()) - .build(); - return getServiceAccount(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the name of a project's Google Cloud Storage service account. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String project = ProjectName.of("[PROJECT]").toString();
-   *   ServiceAccount response = storageClient.getServiceAccount(project);
-   * }
-   * }
- * - * @param project Required. Project ID. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ServiceAccount getServiceAccount(String project) { - GetServiceAccountRequest request = - GetServiceAccountRequest.newBuilder().setProject(project).build(); - return getServiceAccount(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the name of a project's Google Cloud Storage service account. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   GetServiceAccountRequest request =
-   *       GetServiceAccountRequest.newBuilder()
-   *           .setProject(ProjectName.of("[PROJECT]").toString())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   ServiceAccount response = storageClient.getServiceAccount(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ServiceAccount getServiceAccount(GetServiceAccountRequest request) { - return getServiceAccountCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the name of a project's Google Cloud Storage service account. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   GetServiceAccountRequest request =
-   *       GetServiceAccountRequest.newBuilder()
-   *           .setProject(ProjectName.of("[PROJECT]").toString())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   ApiFuture future =
-   *       storageClient.getServiceAccountCallable().futureCall(request);
-   *   // Do something.
-   *   ServiceAccount response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getServiceAccountCallable() { - return stub.getServiceAccountCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a new HMAC key for the given service account. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   String serviceAccountEmail = "serviceAccountEmail1825953988";
-   *   CreateHmacKeyResponse response = storageClient.createHmacKey(project, serviceAccountEmail);
-   * }
-   * }
- * - * @param project Required. The project that the HMAC-owning service account lives in. - * @param serviceAccountEmail Required. The service account to create the HMAC for. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final CreateHmacKeyResponse createHmacKey( - ProjectName project, String serviceAccountEmail) { - CreateHmacKeyRequest request = - CreateHmacKeyRequest.newBuilder() - .setProject(project == null ? null : project.toString()) - .setServiceAccountEmail(serviceAccountEmail) - .build(); - return createHmacKey(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a new HMAC key for the given service account. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String project = ProjectName.of("[PROJECT]").toString();
-   *   String serviceAccountEmail = "serviceAccountEmail1825953988";
-   *   CreateHmacKeyResponse response = storageClient.createHmacKey(project, serviceAccountEmail);
-   * }
-   * }
- * - * @param project Required. The project that the HMAC-owning service account lives in. - * @param serviceAccountEmail Required. The service account to create the HMAC for. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final CreateHmacKeyResponse createHmacKey(String project, String serviceAccountEmail) { - CreateHmacKeyRequest request = - CreateHmacKeyRequest.newBuilder() - .setProject(project) - .setServiceAccountEmail(serviceAccountEmail) - .build(); - return createHmacKey(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a new HMAC key for the given service account. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   CreateHmacKeyRequest request =
-   *       CreateHmacKeyRequest.newBuilder()
-   *           .setProject(ProjectName.of("[PROJECT]").toString())
-   *           .setServiceAccountEmail("serviceAccountEmail1825953988")
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   CreateHmacKeyResponse response = storageClient.createHmacKey(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final CreateHmacKeyResponse createHmacKey(CreateHmacKeyRequest request) { - return createHmacKeyCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a new HMAC key for the given service account. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   CreateHmacKeyRequest request =
-   *       CreateHmacKeyRequest.newBuilder()
-   *           .setProject(ProjectName.of("[PROJECT]").toString())
-   *           .setServiceAccountEmail("serviceAccountEmail1825953988")
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   ApiFuture future =
-   *       storageClient.createHmacKeyCallable().futureCall(request);
-   *   // Do something.
-   *   CreateHmacKeyResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable createHmacKeyCallable() { - return stub.createHmacKeyCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a given HMAC key. Key must be in an INACTIVE state. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String accessId = "accessId-2146437729";
-   *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   storageClient.deleteHmacKey(accessId, project);
-   * }
-   * }
- * - * @param accessId Required. The identifying key for the HMAC to delete. - * @param project Required. The project id the HMAC key lies in. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteHmacKey(String accessId, ProjectName project) { - DeleteHmacKeyRequest request = - DeleteHmacKeyRequest.newBuilder() - .setAccessId(accessId) - .setProject(project == null ? null : project.toString()) - .build(); - deleteHmacKey(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a given HMAC key. Key must be in an INACTIVE state. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String accessId = "accessId-2146437729";
-   *   String project = ProjectName.of("[PROJECT]").toString();
-   *   storageClient.deleteHmacKey(accessId, project);
-   * }
-   * }
- * - * @param accessId Required. The identifying key for the HMAC to delete. - * @param project Required. The project id the HMAC key lies in. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteHmacKey(String accessId, String project) { - DeleteHmacKeyRequest request = - DeleteHmacKeyRequest.newBuilder().setAccessId(accessId).setProject(project).build(); - deleteHmacKey(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a given HMAC key. Key must be in an INACTIVE state. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   DeleteHmacKeyRequest request =
-   *       DeleteHmacKeyRequest.newBuilder()
-   *           .setAccessId("accessId-2146437729")
-   *           .setProject(ProjectName.of("[PROJECT]").toString())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   storageClient.deleteHmacKey(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteHmacKey(DeleteHmacKeyRequest request) { - deleteHmacKeyCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a given HMAC key. Key must be in an INACTIVE state. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   DeleteHmacKeyRequest request =
-   *       DeleteHmacKeyRequest.newBuilder()
-   *           .setAccessId("accessId-2146437729")
-   *           .setProject(ProjectName.of("[PROJECT]").toString())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = storageClient.deleteHmacKeyCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
-   * }
-   * }
- */ - public final UnaryCallable deleteHmacKeyCallable() { - return stub.deleteHmacKeyCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets an existing HMAC key metadata for the given id. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String accessId = "accessId-2146437729";
-   *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   HmacKeyMetadata response = storageClient.getHmacKey(accessId, project);
-   * }
-   * }
- * - * @param accessId Required. The identifying key for the HMAC to delete. - * @param project Required. The project id the HMAC key lies in. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final HmacKeyMetadata getHmacKey(String accessId, ProjectName project) { - GetHmacKeyRequest request = - GetHmacKeyRequest.newBuilder() - .setAccessId(accessId) - .setProject(project == null ? null : project.toString()) - .build(); - return getHmacKey(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets an existing HMAC key metadata for the given id. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String accessId = "accessId-2146437729";
-   *   String project = ProjectName.of("[PROJECT]").toString();
-   *   HmacKeyMetadata response = storageClient.getHmacKey(accessId, project);
-   * }
-   * }
- * - * @param accessId Required. The identifying key for the HMAC to delete. - * @param project Required. The project id the HMAC key lies in. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final HmacKeyMetadata getHmacKey(String accessId, String project) { - GetHmacKeyRequest request = - GetHmacKeyRequest.newBuilder().setAccessId(accessId).setProject(project).build(); - return getHmacKey(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets an existing HMAC key metadata for the given id. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   GetHmacKeyRequest request =
-   *       GetHmacKeyRequest.newBuilder()
-   *           .setAccessId("accessId-2146437729")
-   *           .setProject(ProjectName.of("[PROJECT]").toString())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   HmacKeyMetadata response = storageClient.getHmacKey(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final HmacKeyMetadata getHmacKey(GetHmacKeyRequest request) { - return getHmacKeyCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets an existing HMAC key metadata for the given id. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   GetHmacKeyRequest request =
-   *       GetHmacKeyRequest.newBuilder()
-   *           .setAccessId("accessId-2146437729")
-   *           .setProject(ProjectName.of("[PROJECT]").toString())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = storageClient.getHmacKeyCallable().futureCall(request);
-   *   // Do something.
-   *   HmacKeyMetadata response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getHmacKeyCallable() { - return stub.getHmacKeyCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists HMAC keys under a given project with the additional filters provided. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   for (HmacKeyMetadata element : storageClient.listHmacKeys(project).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param project Required. The project id to list HMAC keys for. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListHmacKeysPagedResponse listHmacKeys(ProjectName project) { - ListHmacKeysRequest request = - ListHmacKeysRequest.newBuilder() - .setProject(project == null ? null : project.toString()) - .build(); - return listHmacKeys(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists HMAC keys under a given project with the additional filters provided. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   String project = ProjectName.of("[PROJECT]").toString();
-   *   for (HmacKeyMetadata element : storageClient.listHmacKeys(project).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param project Required. The project id to list HMAC keys for. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListHmacKeysPagedResponse listHmacKeys(String project) { - ListHmacKeysRequest request = ListHmacKeysRequest.newBuilder().setProject(project).build(); - return listHmacKeys(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists HMAC keys under a given project with the additional filters provided. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ListHmacKeysRequest request =
-   *       ListHmacKeysRequest.newBuilder()
-   *           .setProject(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .setServiceAccountEmail("serviceAccountEmail1825953988")
-   *           .setShowDeletedKeys(true)
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   for (HmacKeyMetadata element : storageClient.listHmacKeys(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListHmacKeysPagedResponse listHmacKeys(ListHmacKeysRequest request) { - return listHmacKeysPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists HMAC keys under a given project with the additional filters provided. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ListHmacKeysRequest request =
-   *       ListHmacKeysRequest.newBuilder()
-   *           .setProject(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .setServiceAccountEmail("serviceAccountEmail1825953988")
-   *           .setShowDeletedKeys(true)
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   ApiFuture future =
-   *       storageClient.listHmacKeysPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (HmacKeyMetadata element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listHmacKeysPagedCallable() { - return stub.listHmacKeysPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists HMAC keys under a given project with the additional filters provided. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   ListHmacKeysRequest request =
-   *       ListHmacKeysRequest.newBuilder()
-   *           .setProject(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .setServiceAccountEmail("serviceAccountEmail1825953988")
-   *           .setShowDeletedKeys(true)
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .build();
-   *   while (true) {
-   *     ListHmacKeysResponse response = storageClient.listHmacKeysCallable().call(request);
-   *     for (HmacKeyMetadata element : response.getResponsesList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable listHmacKeysCallable() { - return stub.listHmacKeysCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates a given HMAC key state between ACTIVE and INACTIVE. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   HmacKeyMetadata hmacKey = HmacKeyMetadata.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   HmacKeyMetadata response = storageClient.updateHmacKey(hmacKey, updateMask);
-   * }
-   * }
- * - * @param hmacKey Required. The HMAC key to update. If present, the hmac_key's `id` field will be - * used to identify the key. Otherwise, the hmac_key's access_id and project fields will be - * used to identify the key. - * @param updateMask Update mask for hmac_key. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final HmacKeyMetadata updateHmacKey(HmacKeyMetadata hmacKey, FieldMask updateMask) { - UpdateHmacKeyRequest request = - UpdateHmacKeyRequest.newBuilder().setHmacKey(hmacKey).setUpdateMask(updateMask).build(); - return updateHmacKey(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates a given HMAC key state between ACTIVE and INACTIVE. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   UpdateHmacKeyRequest request =
-   *       UpdateHmacKeyRequest.newBuilder()
-   *           .setHmacKey(HmacKeyMetadata.newBuilder().build())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   HmacKeyMetadata response = storageClient.updateHmacKey(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final HmacKeyMetadata updateHmacKey(UpdateHmacKeyRequest request) { - return updateHmacKeyCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates a given HMAC key state between ACTIVE and INACTIVE. - * - *

Sample code: - * - *

{@code
-   * try (StorageClient storageClient = StorageClient.create()) {
-   *   UpdateHmacKeyRequest request =
-   *       UpdateHmacKeyRequest.newBuilder()
-   *           .setHmacKey(HmacKeyMetadata.newBuilder().build())
-   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = storageClient.updateHmacKeyCallable().futureCall(request);
-   *   // Do something.
-   *   HmacKeyMetadata response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable updateHmacKeyCallable() { - return stub.updateHmacKeyCallable(); - } - - @Override - public final void close() { - stub.close(); - } - - @Override - public void shutdown() { - stub.shutdown(); - } - - @Override - public boolean isShutdown() { - return stub.isShutdown(); - } - - @Override - public boolean isTerminated() { - return stub.isTerminated(); - } - - @Override - public void shutdownNow() { - stub.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return stub.awaitTermination(duration, unit); - } - - public static class ListBucketsPagedResponse - extends AbstractPagedListResponse< - ListBucketsRequest, - ListBucketsResponse, - Bucket, - ListBucketsPage, - ListBucketsFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListBucketsPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, input -> new ListBucketsPagedResponse(input), MoreExecutors.directExecutor()); - } - - private ListBucketsPagedResponse(ListBucketsPage page) { - super(page, ListBucketsFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListBucketsPage - extends AbstractPage { - - private ListBucketsPage( - PageContext context, - ListBucketsResponse response) { - super(context, response); - } - - private static ListBucketsPage createEmptyPage() { - return new ListBucketsPage(null, null); - } - - @Override - protected ListBucketsPage createPage( - PageContext context, - ListBucketsResponse response) { - return new ListBucketsPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListBucketsFixedSizeCollection - extends AbstractFixedSizeCollection< - ListBucketsRequest, - ListBucketsResponse, - Bucket, - ListBucketsPage, - ListBucketsFixedSizeCollection> { - - private ListBucketsFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListBucketsFixedSizeCollection createEmptyCollection() { - return new ListBucketsFixedSizeCollection(null, 0); - } - - @Override - protected ListBucketsFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListBucketsFixedSizeCollection(pages, collectionSize); - } - } - - public static class ListNotificationsPagedResponse - extends AbstractPagedListResponse< - ListNotificationsRequest, - ListNotificationsResponse, - Notification, - ListNotificationsPage, - ListNotificationsFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListNotificationsPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - input -> new ListNotificationsPagedResponse(input), - MoreExecutors.directExecutor()); - } - - private ListNotificationsPagedResponse(ListNotificationsPage page) { - super(page, ListNotificationsFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListNotificationsPage - extends AbstractPage< - ListNotificationsRequest, - ListNotificationsResponse, - Notification, - ListNotificationsPage> { - - private ListNotificationsPage( - PageContext context, - ListNotificationsResponse response) { - super(context, response); - } - - private static ListNotificationsPage createEmptyPage() { - return new ListNotificationsPage(null, null); - } - - @Override - protected ListNotificationsPage createPage( - PageContext context, - ListNotificationsResponse response) { - return new ListNotificationsPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListNotificationsFixedSizeCollection - extends AbstractFixedSizeCollection< - ListNotificationsRequest, - ListNotificationsResponse, - Notification, - ListNotificationsPage, - ListNotificationsFixedSizeCollection> { - - private ListNotificationsFixedSizeCollection( - List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListNotificationsFixedSizeCollection createEmptyCollection() { - return new ListNotificationsFixedSizeCollection(null, 0); - } - - @Override - protected ListNotificationsFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListNotificationsFixedSizeCollection(pages, collectionSize); - } - } - - public static class ListObjectsPagedResponse - extends AbstractPagedListResponse< - ListObjectsRequest, - ListObjectsResponse, - Object, - ListObjectsPage, - ListObjectsFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListObjectsPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, input -> new ListObjectsPagedResponse(input), MoreExecutors.directExecutor()); - } - - private ListObjectsPagedResponse(ListObjectsPage page) { - super(page, ListObjectsFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListObjectsPage - extends AbstractPage { - - private ListObjectsPage( - PageContext context, - ListObjectsResponse response) { - super(context, response); - } - - private static ListObjectsPage createEmptyPage() { - return new ListObjectsPage(null, null); - } - - @Override - protected ListObjectsPage createPage( - PageContext context, - ListObjectsResponse response) { - return new ListObjectsPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListObjectsFixedSizeCollection - extends AbstractFixedSizeCollection< - ListObjectsRequest, - ListObjectsResponse, - Object, - ListObjectsPage, - ListObjectsFixedSizeCollection> { - - private ListObjectsFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListObjectsFixedSizeCollection createEmptyCollection() { - return new ListObjectsFixedSizeCollection(null, 0); - } - - @Override - protected ListObjectsFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListObjectsFixedSizeCollection(pages, collectionSize); - } - } - - public static class ListHmacKeysPagedResponse - extends AbstractPagedListResponse< - ListHmacKeysRequest, - ListHmacKeysResponse, - HmacKeyMetadata, - ListHmacKeysPage, - ListHmacKeysFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListHmacKeysPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - input -> new ListHmacKeysPagedResponse(input), - MoreExecutors.directExecutor()); - } - - private ListHmacKeysPagedResponse(ListHmacKeysPage page) { - super(page, ListHmacKeysFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListHmacKeysPage - extends AbstractPage< - ListHmacKeysRequest, ListHmacKeysResponse, HmacKeyMetadata, ListHmacKeysPage> { - - private ListHmacKeysPage( - PageContext context, - ListHmacKeysResponse response) { - super(context, response); - } - - private static ListHmacKeysPage createEmptyPage() { - return new ListHmacKeysPage(null, null); - } - - @Override - protected ListHmacKeysPage createPage( - PageContext context, - ListHmacKeysResponse response) { - return new ListHmacKeysPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListHmacKeysFixedSizeCollection - extends AbstractFixedSizeCollection< - ListHmacKeysRequest, - ListHmacKeysResponse, - HmacKeyMetadata, - ListHmacKeysPage, - ListHmacKeysFixedSizeCollection> { - - private ListHmacKeysFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListHmacKeysFixedSizeCollection createEmptyCollection() { - return new ListHmacKeysFixedSizeCollection(null, 0); - } - - @Override - protected ListHmacKeysFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListHmacKeysFixedSizeCollection(pages, collectionSize); - } - } -} 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 deleted file mode 100644 index 9238441139..0000000000 --- a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageSettings.java +++ /dev/null @@ -1,503 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.storage.v2; - -import static com.google.storage.v2.StorageClient.ListBucketsPagedResponse; -import static com.google.storage.v2.StorageClient.ListHmacKeysPagedResponse; -import static com.google.storage.v2.StorageClient.ListNotificationsPagedResponse; -import static com.google.storage.v2.StorageClient.ListObjectsPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.Empty; -import com.google.storage.v2.stub.StorageStubSettings; -import java.io.IOException; -import java.util.List; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Settings class to configure an instance of {@link StorageClient}. - * - *

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

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

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

For example, to set the total timeout of deleteBucket to 30 seconds: - * - *

{@code
- * StorageSettings.Builder storageSettingsBuilder = StorageSettings.newBuilder();
- * storageSettingsBuilder
- *     .deleteBucketSettings()
- *     .setRetrySettings(
- *         storageSettingsBuilder
- *             .deleteBucketSettings()
- *             .getRetrySettings()
- *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * StorageSettings storageSettings = storageSettingsBuilder.build();
- * }
- */ -@Generated("by gapic-generator-java") -public class StorageSettings extends ClientSettings { - - /** Returns the object with the settings used for calls to deleteBucket. */ - public UnaryCallSettings deleteBucketSettings() { - return ((StorageStubSettings) getStubSettings()).deleteBucketSettings(); - } - - /** Returns the object with the settings used for calls to getBucket. */ - public UnaryCallSettings getBucketSettings() { - return ((StorageStubSettings) getStubSettings()).getBucketSettings(); - } - - /** Returns the object with the settings used for calls to createBucket. */ - public UnaryCallSettings createBucketSettings() { - return ((StorageStubSettings) getStubSettings()).createBucketSettings(); - } - - /** Returns the object with the settings used for calls to listBuckets. */ - public PagedCallSettings - listBucketsSettings() { - return ((StorageStubSettings) getStubSettings()).listBucketsSettings(); - } - - /** Returns the object with the settings used for calls to lockBucketRetentionPolicy. */ - public UnaryCallSettings - lockBucketRetentionPolicySettings() { - return ((StorageStubSettings) getStubSettings()).lockBucketRetentionPolicySettings(); - } - - /** Returns the object with the settings used for calls to getIamPolicy. */ - public UnaryCallSettings getIamPolicySettings() { - return ((StorageStubSettings) getStubSettings()).getIamPolicySettings(); - } - - /** Returns the object with the settings used for calls to setIamPolicy. */ - public UnaryCallSettings setIamPolicySettings() { - return ((StorageStubSettings) getStubSettings()).setIamPolicySettings(); - } - - /** Returns the object with the settings used for calls to testIamPermissions. */ - public UnaryCallSettings - testIamPermissionsSettings() { - return ((StorageStubSettings) getStubSettings()).testIamPermissionsSettings(); - } - - /** Returns the object with the settings used for calls to updateBucket. */ - public UnaryCallSettings updateBucketSettings() { - return ((StorageStubSettings) getStubSettings()).updateBucketSettings(); - } - - /** Returns the object with the settings used for calls to deleteNotification. */ - public UnaryCallSettings deleteNotificationSettings() { - return ((StorageStubSettings) getStubSettings()).deleteNotificationSettings(); - } - - /** Returns the object with the settings used for calls to getNotification. */ - public UnaryCallSettings getNotificationSettings() { - return ((StorageStubSettings) getStubSettings()).getNotificationSettings(); - } - - /** Returns the object with the settings used for calls to createNotification. */ - public UnaryCallSettings createNotificationSettings() { - return ((StorageStubSettings) getStubSettings()).createNotificationSettings(); - } - - /** Returns the object with the settings used for calls to listNotifications. */ - public PagedCallSettings< - ListNotificationsRequest, ListNotificationsResponse, ListNotificationsPagedResponse> - listNotificationsSettings() { - return ((StorageStubSettings) getStubSettings()).listNotificationsSettings(); - } - - /** Returns the object with the settings used for calls to composeObject. */ - public UnaryCallSettings composeObjectSettings() { - return ((StorageStubSettings) getStubSettings()).composeObjectSettings(); - } - - /** Returns the object with the settings used for calls to deleteObject. */ - public UnaryCallSettings deleteObjectSettings() { - return ((StorageStubSettings) getStubSettings()).deleteObjectSettings(); - } - - /** Returns the object with the settings used for calls to getObject. */ - public UnaryCallSettings getObjectSettings() { - return ((StorageStubSettings) getStubSettings()).getObjectSettings(); - } - - /** Returns the object with the settings used for calls to readObject. */ - public ServerStreamingCallSettings readObjectSettings() { - return ((StorageStubSettings) getStubSettings()).readObjectSettings(); - } - - /** Returns the object with the settings used for calls to updateObject. */ - public UnaryCallSettings updateObjectSettings() { - return ((StorageStubSettings) getStubSettings()).updateObjectSettings(); - } - - /** Returns the object with the settings used for calls to writeObject. */ - public StreamingCallSettings writeObjectSettings() { - return ((StorageStubSettings) getStubSettings()).writeObjectSettings(); - } - - /** Returns the object with the settings used for calls to listObjects. */ - public PagedCallSettings - listObjectsSettings() { - return ((StorageStubSettings) getStubSettings()).listObjectsSettings(); - } - - /** Returns the object with the settings used for calls to rewriteObject. */ - public UnaryCallSettings rewriteObjectSettings() { - return ((StorageStubSettings) getStubSettings()).rewriteObjectSettings(); - } - - /** Returns the object with the settings used for calls to startResumableWrite. */ - public UnaryCallSettings - startResumableWriteSettings() { - return ((StorageStubSettings) getStubSettings()).startResumableWriteSettings(); - } - - /** Returns the object with the settings used for calls to queryWriteStatus. */ - public UnaryCallSettings - queryWriteStatusSettings() { - return ((StorageStubSettings) getStubSettings()).queryWriteStatusSettings(); - } - - /** Returns the object with the settings used for calls to getServiceAccount. */ - public UnaryCallSettings getServiceAccountSettings() { - return ((StorageStubSettings) getStubSettings()).getServiceAccountSettings(); - } - - /** Returns the object with the settings used for calls to createHmacKey. */ - public UnaryCallSettings createHmacKeySettings() { - return ((StorageStubSettings) getStubSettings()).createHmacKeySettings(); - } - - /** Returns the object with the settings used for calls to deleteHmacKey. */ - public UnaryCallSettings deleteHmacKeySettings() { - return ((StorageStubSettings) getStubSettings()).deleteHmacKeySettings(); - } - - /** Returns the object with the settings used for calls to getHmacKey. */ - public UnaryCallSettings getHmacKeySettings() { - return ((StorageStubSettings) getStubSettings()).getHmacKeySettings(); - } - - /** Returns the object with the settings used for calls to listHmacKeys. */ - public PagedCallSettings - listHmacKeysSettings() { - return ((StorageStubSettings) getStubSettings()).listHmacKeysSettings(); - } - - /** Returns the object with the settings used for calls to updateHmacKey. */ - public UnaryCallSettings updateHmacKeySettings() { - return ((StorageStubSettings) getStubSettings()).updateHmacKeySettings(); - } - - public static final StorageSettings create(StorageStubSettings stub) throws IOException { - return new StorageSettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return StorageStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return StorageStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return StorageStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return StorageStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return StorageStubSettings.defaultGrpcTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return StorageStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return StorageStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected StorageSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for StorageSettings. */ - public static class Builder extends ClientSettings.Builder { - - protected Builder() throws IOException { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(StorageStubSettings.newBuilder(clientContext)); - } - - protected Builder(StorageSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(StorageStubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(StorageStubSettings.newBuilder()); - } - - public StorageStubSettings.Builder getStubSettingsBuilder() { - return ((StorageStubSettings.Builder) getStubSettings()); - } - - /** - * Applies the given settings updater function to all of the unary API methods in this service. - * - *

Note: This method does not support applying settings to streaming methods. - */ - public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) { - super.applyToAllUnaryMethods( - getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); - return this; - } - - /** Returns the builder for the settings used for calls to deleteBucket. */ - public UnaryCallSettings.Builder deleteBucketSettings() { - return getStubSettingsBuilder().deleteBucketSettings(); - } - - /** Returns the builder for the settings used for calls to getBucket. */ - public UnaryCallSettings.Builder getBucketSettings() { - return getStubSettingsBuilder().getBucketSettings(); - } - - /** Returns the builder for the settings used for calls to createBucket. */ - public UnaryCallSettings.Builder createBucketSettings() { - return getStubSettingsBuilder().createBucketSettings(); - } - - /** Returns the builder for the settings used for calls to listBuckets. */ - public PagedCallSettings.Builder< - ListBucketsRequest, ListBucketsResponse, ListBucketsPagedResponse> - listBucketsSettings() { - return getStubSettingsBuilder().listBucketsSettings(); - } - - /** Returns the builder for the settings used for calls to lockBucketRetentionPolicy. */ - public UnaryCallSettings.Builder - lockBucketRetentionPolicySettings() { - return getStubSettingsBuilder().lockBucketRetentionPolicySettings(); - } - - /** Returns the builder for the settings used for calls to getIamPolicy. */ - public UnaryCallSettings.Builder getIamPolicySettings() { - return getStubSettingsBuilder().getIamPolicySettings(); - } - - /** Returns the builder for the settings used for calls to setIamPolicy. */ - public UnaryCallSettings.Builder setIamPolicySettings() { - return getStubSettingsBuilder().setIamPolicySettings(); - } - - /** Returns the builder for the settings used for calls to testIamPermissions. */ - public UnaryCallSettings.Builder - testIamPermissionsSettings() { - return getStubSettingsBuilder().testIamPermissionsSettings(); - } - - /** Returns the builder for the settings used for calls to updateBucket. */ - public UnaryCallSettings.Builder updateBucketSettings() { - return getStubSettingsBuilder().updateBucketSettings(); - } - - /** Returns the builder for the settings used for calls to deleteNotification. */ - public UnaryCallSettings.Builder - deleteNotificationSettings() { - return getStubSettingsBuilder().deleteNotificationSettings(); - } - - /** Returns the builder for the settings used for calls to getNotification. */ - public UnaryCallSettings.Builder - getNotificationSettings() { - return getStubSettingsBuilder().getNotificationSettings(); - } - - /** Returns the builder for the settings used for calls to createNotification. */ - public UnaryCallSettings.Builder - createNotificationSettings() { - return getStubSettingsBuilder().createNotificationSettings(); - } - - /** Returns the builder for the settings used for calls to listNotifications. */ - public PagedCallSettings.Builder< - ListNotificationsRequest, ListNotificationsResponse, ListNotificationsPagedResponse> - listNotificationsSettings() { - return getStubSettingsBuilder().listNotificationsSettings(); - } - - /** Returns the builder for the settings used for calls to composeObject. */ - public UnaryCallSettings.Builder composeObjectSettings() { - return getStubSettingsBuilder().composeObjectSettings(); - } - - /** Returns the builder for the settings used for calls to deleteObject. */ - public UnaryCallSettings.Builder deleteObjectSettings() { - return getStubSettingsBuilder().deleteObjectSettings(); - } - - /** Returns the builder for the settings used for calls to getObject. */ - public UnaryCallSettings.Builder getObjectSettings() { - return getStubSettingsBuilder().getObjectSettings(); - } - - /** Returns the builder for the settings used for calls to readObject. */ - public ServerStreamingCallSettings.Builder - readObjectSettings() { - return getStubSettingsBuilder().readObjectSettings(); - } - - /** Returns the builder for the settings used for calls to updateObject. */ - public UnaryCallSettings.Builder updateObjectSettings() { - return getStubSettingsBuilder().updateObjectSettings(); - } - - /** Returns the builder for the settings used for calls to writeObject. */ - public StreamingCallSettings.Builder - writeObjectSettings() { - return getStubSettingsBuilder().writeObjectSettings(); - } - - /** Returns the builder for the settings used for calls to listObjects. */ - public PagedCallSettings.Builder< - ListObjectsRequest, ListObjectsResponse, ListObjectsPagedResponse> - listObjectsSettings() { - return getStubSettingsBuilder().listObjectsSettings(); - } - - /** Returns the builder for the settings used for calls to rewriteObject. */ - public UnaryCallSettings.Builder - rewriteObjectSettings() { - return getStubSettingsBuilder().rewriteObjectSettings(); - } - - /** Returns the builder for the settings used for calls to startResumableWrite. */ - public UnaryCallSettings.Builder - startResumableWriteSettings() { - return getStubSettingsBuilder().startResumableWriteSettings(); - } - - /** Returns the builder for the settings used for calls to queryWriteStatus. */ - public UnaryCallSettings.Builder - queryWriteStatusSettings() { - return getStubSettingsBuilder().queryWriteStatusSettings(); - } - - /** Returns the builder for the settings used for calls to getServiceAccount. */ - public UnaryCallSettings.Builder - getServiceAccountSettings() { - return getStubSettingsBuilder().getServiceAccountSettings(); - } - - /** Returns the builder for the settings used for calls to createHmacKey. */ - public UnaryCallSettings.Builder - createHmacKeySettings() { - return getStubSettingsBuilder().createHmacKeySettings(); - } - - /** Returns the builder for the settings used for calls to deleteHmacKey. */ - public UnaryCallSettings.Builder deleteHmacKeySettings() { - return getStubSettingsBuilder().deleteHmacKeySettings(); - } - - /** Returns the builder for the settings used for calls to getHmacKey. */ - public UnaryCallSettings.Builder getHmacKeySettings() { - return getStubSettingsBuilder().getHmacKeySettings(); - } - - /** Returns the builder for the settings used for calls to listHmacKeys. */ - public PagedCallSettings.Builder< - ListHmacKeysRequest, ListHmacKeysResponse, ListHmacKeysPagedResponse> - listHmacKeysSettings() { - return getStubSettingsBuilder().listHmacKeysSettings(); - } - - /** Returns the builder for the settings used for calls to updateHmacKey. */ - public UnaryCallSettings.Builder - updateHmacKeySettings() { - return getStubSettingsBuilder().updateHmacKeySettings(); - } - - @Override - public StorageSettings build() throws IOException { - return new StorageSettings(this); - } - } -} diff --git a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/package-info.java b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/package-info.java deleted file mode 100644 index b1536036d7..0000000000 --- a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/package-info.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * The interfaces provided are listed below, along with usage samples. - * - *

======================= StorageClient ======================= - * - *

Service Description: ## API Overview and Naming Syntax - * - *

The Cloud Storage gRPC API allows applications to read and write data through the abstractions - * of buckets and objects. For a description of these abstractions please see - * https://cloud.google.com/storage/docs. - * - *

Resources are named as follows: - Projects are referred to as they are defined by the Resource - * Manager API, using strings like `projects/123456` or `projects/my-string-id`. - Buckets are named - * using string names of the form: `projects/{project}/buckets/{bucket}` For globally unique - * buckets, `_` may be substituted for the project. - Objects are uniquely identified by their name - * along with the name of the bucket they belong to, as separate strings in this API. For example: - * - *

ReadObjectRequest { bucket: 'projects/_/buckets/my-bucket' object: 'my-object' } Note that - * object names can contain `/` characters, which are treated as any other character (no special - * directory semantics). - * - *

Sample for StorageClient: - * - *

{@code
- * try (StorageClient storageClient = StorageClient.create()) {
- *   BucketName name = BucketName.of("[PROJECT]", "[BUCKET]");
- *   storageClient.deleteBucket(name);
- * }
- * }
- */ -@Generated("by gapic-generator-java") -package com.google.storage.v2; - -import javax.annotation.Generated; diff --git a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageCallableFactory.java b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageCallableFactory.java deleted file mode 100644 index 47ef05368a..0000000000 --- a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageCallableFactory.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.storage.v2.stub; - -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC callable factory implementation for the Storage service API. - * - *

This class is for advanced usage. - */ -@Generated("by gapic-generator-java") -public class GrpcStorageCallableFactory implements GrpcStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - GrpcCallSettings grpcCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - GrpcCallSettings grpcCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - GrpcCallSettings grpcCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, callSettings, clientContext, operationsStub); - } - - @Override - public - BidiStreamingCallable createBidiStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ClientStreamingCallable createClientStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } -} diff --git a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageStub.java b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageStub.java deleted file mode 100644 index 3229694d5c..0000000000 --- a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageStub.java +++ /dev/null @@ -1,902 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.storage.v2.stub; - -import static com.google.storage.v2.StorageClient.ListBucketsPagedResponse; -import static com.google.storage.v2.StorageClient.ListHmacKeysPagedResponse; -import static com.google.storage.v2.StorageClient.ListNotificationsPagedResponse; -import static com.google.storage.v2.StorageClient.ListObjectsPagedResponse; - -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.longrunning.stub.GrpcOperationsStub; -import com.google.protobuf.Empty; -import com.google.storage.v2.Bucket; -import com.google.storage.v2.ComposeObjectRequest; -import com.google.storage.v2.CreateBucketRequest; -import com.google.storage.v2.CreateHmacKeyRequest; -import com.google.storage.v2.CreateHmacKeyResponse; -import com.google.storage.v2.CreateNotificationRequest; -import com.google.storage.v2.DeleteBucketRequest; -import com.google.storage.v2.DeleteHmacKeyRequest; -import com.google.storage.v2.DeleteNotificationRequest; -import com.google.storage.v2.DeleteObjectRequest; -import com.google.storage.v2.GetBucketRequest; -import com.google.storage.v2.GetHmacKeyRequest; -import com.google.storage.v2.GetNotificationRequest; -import com.google.storage.v2.GetObjectRequest; -import com.google.storage.v2.GetServiceAccountRequest; -import com.google.storage.v2.HmacKeyMetadata; -import com.google.storage.v2.ListBucketsRequest; -import com.google.storage.v2.ListBucketsResponse; -import com.google.storage.v2.ListHmacKeysRequest; -import com.google.storage.v2.ListHmacKeysResponse; -import com.google.storage.v2.ListNotificationsRequest; -import com.google.storage.v2.ListNotificationsResponse; -import com.google.storage.v2.ListObjectsRequest; -import com.google.storage.v2.ListObjectsResponse; -import com.google.storage.v2.LockBucketRetentionPolicyRequest; -import com.google.storage.v2.Notification; -import com.google.storage.v2.Object; -import com.google.storage.v2.QueryWriteStatusRequest; -import com.google.storage.v2.QueryWriteStatusResponse; -import com.google.storage.v2.ReadObjectRequest; -import com.google.storage.v2.ReadObjectResponse; -import com.google.storage.v2.RewriteObjectRequest; -import com.google.storage.v2.RewriteResponse; -import com.google.storage.v2.ServiceAccount; -import com.google.storage.v2.StartResumableWriteRequest; -import com.google.storage.v2.StartResumableWriteResponse; -import com.google.storage.v2.UpdateBucketRequest; -import com.google.storage.v2.UpdateHmacKeyRequest; -import com.google.storage.v2.UpdateObjectRequest; -import com.google.storage.v2.WriteObjectRequest; -import com.google.storage.v2.WriteObjectResponse; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the Storage service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator-java") -public class GrpcStorageStub extends StorageStub { - private static final MethodDescriptor deleteBucketMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/DeleteBucket") - .setRequestMarshaller(ProtoUtils.marshaller(DeleteBucketRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private static final MethodDescriptor getBucketMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/GetBucket") - .setRequestMarshaller(ProtoUtils.marshaller(GetBucketRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Bucket.getDefaultInstance())) - .build(); - - private static final MethodDescriptor createBucketMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/CreateBucket") - .setRequestMarshaller(ProtoUtils.marshaller(CreateBucketRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Bucket.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - listBucketsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/ListBuckets") - .setRequestMarshaller(ProtoUtils.marshaller(ListBucketsRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(ListBucketsResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - lockBucketRetentionPolicyMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/LockBucketRetentionPolicy") - .setRequestMarshaller( - ProtoUtils.marshaller(LockBucketRetentionPolicyRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Bucket.getDefaultInstance())) - .build(); - - private static final MethodDescriptor getIamPolicyMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/GetIamPolicy") - .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) - .build(); - - private static final MethodDescriptor setIamPolicyMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/SetIamPolicy") - .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - testIamPermissionsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/TestIamPermissions") - .setRequestMarshaller( - ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor updateBucketMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/UpdateBucket") - .setRequestMarshaller(ProtoUtils.marshaller(UpdateBucketRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Bucket.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - deleteNotificationMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/DeleteNotification") - .setRequestMarshaller( - ProtoUtils.marshaller(DeleteNotificationRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - getNotificationMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/GetNotification") - .setRequestMarshaller( - ProtoUtils.marshaller(GetNotificationRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Notification.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - createNotificationMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/CreateNotification") - .setRequestMarshaller( - ProtoUtils.marshaller(CreateNotificationRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Notification.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - listNotificationsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/ListNotifications") - .setRequestMarshaller( - ProtoUtils.marshaller(ListNotificationsRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(ListNotificationsResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - composeObjectMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/ComposeObject") - .setRequestMarshaller( - ProtoUtils.marshaller(ComposeObjectRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Object.getDefaultInstance())) - .build(); - - private static final MethodDescriptor deleteObjectMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/DeleteObject") - .setRequestMarshaller(ProtoUtils.marshaller(DeleteObjectRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private static final MethodDescriptor getObjectMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/GetObject") - .setRequestMarshaller(ProtoUtils.marshaller(GetObjectRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Object.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - readObjectMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.SERVER_STREAMING) - .setFullMethodName("google.storage.v2.Storage/ReadObject") - .setRequestMarshaller(ProtoUtils.marshaller(ReadObjectRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(ReadObjectResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor updateObjectMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/UpdateObject") - .setRequestMarshaller(ProtoUtils.marshaller(UpdateObjectRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Object.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - writeObjectMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.CLIENT_STREAMING) - .setFullMethodName("google.storage.v2.Storage/WriteObject") - .setRequestMarshaller(ProtoUtils.marshaller(WriteObjectRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(WriteObjectResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - listObjectsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/ListObjects") - .setRequestMarshaller(ProtoUtils.marshaller(ListObjectsRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(ListObjectsResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - rewriteObjectMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/RewriteObject") - .setRequestMarshaller( - ProtoUtils.marshaller(RewriteObjectRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(RewriteResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - startResumableWriteMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/StartResumableWrite") - .setRequestMarshaller( - ProtoUtils.marshaller(StartResumableWriteRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(StartResumableWriteResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - queryWriteStatusMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/QueryWriteStatus") - .setRequestMarshaller( - ProtoUtils.marshaller(QueryWriteStatusRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(QueryWriteStatusResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - getServiceAccountMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/GetServiceAccount") - .setRequestMarshaller( - ProtoUtils.marshaller(GetServiceAccountRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(ServiceAccount.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - createHmacKeyMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/CreateHmacKey") - .setRequestMarshaller( - ProtoUtils.marshaller(CreateHmacKeyRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(CreateHmacKeyResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor deleteHmacKeyMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/DeleteHmacKey") - .setRequestMarshaller(ProtoUtils.marshaller(DeleteHmacKeyRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - getHmacKeyMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/GetHmacKey") - .setRequestMarshaller(ProtoUtils.marshaller(GetHmacKeyRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(HmacKeyMetadata.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - listHmacKeysMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/ListHmacKeys") - .setRequestMarshaller(ProtoUtils.marshaller(ListHmacKeysRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(ListHmacKeysResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - updateHmacKeyMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/UpdateHmacKey") - .setRequestMarshaller( - ProtoUtils.marshaller(UpdateHmacKeyRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(HmacKeyMetadata.getDefaultInstance())) - .build(); - - private final UnaryCallable deleteBucketCallable; - private final UnaryCallable getBucketCallable; - private final UnaryCallable createBucketCallable; - private final UnaryCallable listBucketsCallable; - private final UnaryCallable - listBucketsPagedCallable; - private final UnaryCallable - lockBucketRetentionPolicyCallable; - private final UnaryCallable getIamPolicyCallable; - private final UnaryCallable setIamPolicyCallable; - private final UnaryCallable - testIamPermissionsCallable; - private final UnaryCallable updateBucketCallable; - private final UnaryCallable deleteNotificationCallable; - private final UnaryCallable getNotificationCallable; - private final UnaryCallable createNotificationCallable; - private final UnaryCallable - listNotificationsCallable; - private final UnaryCallable - listNotificationsPagedCallable; - private final UnaryCallable composeObjectCallable; - private final UnaryCallable deleteObjectCallable; - private final UnaryCallable getObjectCallable; - private final ServerStreamingCallable readObjectCallable; - private final UnaryCallable updateObjectCallable; - private final ClientStreamingCallable - writeObjectCallable; - private final UnaryCallable listObjectsCallable; - private final UnaryCallable - listObjectsPagedCallable; - private final UnaryCallable rewriteObjectCallable; - private final UnaryCallable - startResumableWriteCallable; - private final UnaryCallable - queryWriteStatusCallable; - private final UnaryCallable getServiceAccountCallable; - private final UnaryCallable createHmacKeyCallable; - private final UnaryCallable deleteHmacKeyCallable; - private final UnaryCallable getHmacKeyCallable; - private final UnaryCallable listHmacKeysCallable; - private final UnaryCallable - listHmacKeysPagedCallable; - private final UnaryCallable updateHmacKeyCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcStorageStub create(StorageStubSettings settings) throws IOException { - return new GrpcStorageStub(settings, ClientContext.create(settings)); - } - - public static final GrpcStorageStub create(ClientContext clientContext) throws IOException { - return new GrpcStorageStub(StorageStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcStorageStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcStorageStub( - StorageStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcStorageStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ - protected GrpcStorageStub(StorageStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new GrpcStorageCallableFactory()); - } - - /** - * Constructs an instance of GrpcStorageStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ - protected GrpcStorageStub( - StorageStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings deleteBucketTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteBucketMethodDescriptor) - .build(); - GrpcCallSettings getBucketTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getBucketMethodDescriptor) - .build(); - GrpcCallSettings createBucketTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createBucketMethodDescriptor) - .build(); - GrpcCallSettings listBucketsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listBucketsMethodDescriptor) - .build(); - GrpcCallSettings - lockBucketRetentionPolicyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(lockBucketRetentionPolicyMethodDescriptor) - .build(); - GrpcCallSettings getIamPolicyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getIamPolicyMethodDescriptor) - .build(); - GrpcCallSettings setIamPolicyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(setIamPolicyMethodDescriptor) - .build(); - GrpcCallSettings - testIamPermissionsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(testIamPermissionsMethodDescriptor) - .build(); - GrpcCallSettings updateBucketTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(updateBucketMethodDescriptor) - .build(); - GrpcCallSettings deleteNotificationTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteNotificationMethodDescriptor) - .build(); - GrpcCallSettings getNotificationTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getNotificationMethodDescriptor) - .build(); - GrpcCallSettings createNotificationTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createNotificationMethodDescriptor) - .build(); - GrpcCallSettings - listNotificationsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listNotificationsMethodDescriptor) - .build(); - GrpcCallSettings composeObjectTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(composeObjectMethodDescriptor) - .build(); - GrpcCallSettings deleteObjectTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteObjectMethodDescriptor) - .build(); - GrpcCallSettings getObjectTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getObjectMethodDescriptor) - .build(); - GrpcCallSettings readObjectTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(readObjectMethodDescriptor) - .build(); - GrpcCallSettings updateObjectTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(updateObjectMethodDescriptor) - .build(); - GrpcCallSettings writeObjectTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(writeObjectMethodDescriptor) - .build(); - GrpcCallSettings listObjectsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listObjectsMethodDescriptor) - .build(); - GrpcCallSettings rewriteObjectTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(rewriteObjectMethodDescriptor) - .build(); - GrpcCallSettings - startResumableWriteTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(startResumableWriteMethodDescriptor) - .build(); - GrpcCallSettings - queryWriteStatusTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(queryWriteStatusMethodDescriptor) - .build(); - GrpcCallSettings getServiceAccountTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getServiceAccountMethodDescriptor) - .build(); - GrpcCallSettings createHmacKeyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createHmacKeyMethodDescriptor) - .build(); - GrpcCallSettings deleteHmacKeyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteHmacKeyMethodDescriptor) - .build(); - GrpcCallSettings getHmacKeyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getHmacKeyMethodDescriptor) - .build(); - GrpcCallSettings listHmacKeysTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listHmacKeysMethodDescriptor) - .build(); - GrpcCallSettings updateHmacKeyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(updateHmacKeyMethodDescriptor) - .build(); - - this.deleteBucketCallable = - callableFactory.createUnaryCallable( - deleteBucketTransportSettings, settings.deleteBucketSettings(), clientContext); - this.getBucketCallable = - callableFactory.createUnaryCallable( - getBucketTransportSettings, settings.getBucketSettings(), clientContext); - this.createBucketCallable = - callableFactory.createUnaryCallable( - createBucketTransportSettings, settings.createBucketSettings(), clientContext); - this.listBucketsCallable = - callableFactory.createUnaryCallable( - listBucketsTransportSettings, settings.listBucketsSettings(), clientContext); - this.listBucketsPagedCallable = - callableFactory.createPagedCallable( - listBucketsTransportSettings, settings.listBucketsSettings(), clientContext); - this.lockBucketRetentionPolicyCallable = - callableFactory.createUnaryCallable( - lockBucketRetentionPolicyTransportSettings, - settings.lockBucketRetentionPolicySettings(), - clientContext); - this.getIamPolicyCallable = - callableFactory.createUnaryCallable( - getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); - this.setIamPolicyCallable = - callableFactory.createUnaryCallable( - setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); - this.testIamPermissionsCallable = - callableFactory.createUnaryCallable( - testIamPermissionsTransportSettings, - settings.testIamPermissionsSettings(), - clientContext); - this.updateBucketCallable = - callableFactory.createUnaryCallable( - updateBucketTransportSettings, settings.updateBucketSettings(), clientContext); - this.deleteNotificationCallable = - callableFactory.createUnaryCallable( - deleteNotificationTransportSettings, - settings.deleteNotificationSettings(), - clientContext); - this.getNotificationCallable = - callableFactory.createUnaryCallable( - getNotificationTransportSettings, settings.getNotificationSettings(), clientContext); - this.createNotificationCallable = - callableFactory.createUnaryCallable( - createNotificationTransportSettings, - settings.createNotificationSettings(), - clientContext); - this.listNotificationsCallable = - callableFactory.createUnaryCallable( - listNotificationsTransportSettings, - settings.listNotificationsSettings(), - clientContext); - this.listNotificationsPagedCallable = - callableFactory.createPagedCallable( - listNotificationsTransportSettings, - settings.listNotificationsSettings(), - clientContext); - this.composeObjectCallable = - callableFactory.createUnaryCallable( - composeObjectTransportSettings, settings.composeObjectSettings(), clientContext); - this.deleteObjectCallable = - callableFactory.createUnaryCallable( - deleteObjectTransportSettings, settings.deleteObjectSettings(), clientContext); - this.getObjectCallable = - callableFactory.createUnaryCallable( - getObjectTransportSettings, settings.getObjectSettings(), clientContext); - this.readObjectCallable = - callableFactory.createServerStreamingCallable( - readObjectTransportSettings, settings.readObjectSettings(), clientContext); - this.updateObjectCallable = - callableFactory.createUnaryCallable( - updateObjectTransportSettings, settings.updateObjectSettings(), clientContext); - this.writeObjectCallable = - callableFactory.createClientStreamingCallable( - writeObjectTransportSettings, settings.writeObjectSettings(), clientContext); - this.listObjectsCallable = - callableFactory.createUnaryCallable( - listObjectsTransportSettings, settings.listObjectsSettings(), clientContext); - this.listObjectsPagedCallable = - callableFactory.createPagedCallable( - listObjectsTransportSettings, settings.listObjectsSettings(), clientContext); - this.rewriteObjectCallable = - callableFactory.createUnaryCallable( - rewriteObjectTransportSettings, settings.rewriteObjectSettings(), clientContext); - this.startResumableWriteCallable = - callableFactory.createUnaryCallable( - startResumableWriteTransportSettings, - settings.startResumableWriteSettings(), - clientContext); - this.queryWriteStatusCallable = - callableFactory.createUnaryCallable( - queryWriteStatusTransportSettings, settings.queryWriteStatusSettings(), clientContext); - this.getServiceAccountCallable = - callableFactory.createUnaryCallable( - getServiceAccountTransportSettings, - settings.getServiceAccountSettings(), - clientContext); - this.createHmacKeyCallable = - callableFactory.createUnaryCallable( - createHmacKeyTransportSettings, settings.createHmacKeySettings(), clientContext); - this.deleteHmacKeyCallable = - callableFactory.createUnaryCallable( - deleteHmacKeyTransportSettings, settings.deleteHmacKeySettings(), clientContext); - this.getHmacKeyCallable = - callableFactory.createUnaryCallable( - getHmacKeyTransportSettings, settings.getHmacKeySettings(), clientContext); - this.listHmacKeysCallable = - callableFactory.createUnaryCallable( - listHmacKeysTransportSettings, settings.listHmacKeysSettings(), clientContext); - this.listHmacKeysPagedCallable = - callableFactory.createPagedCallable( - listHmacKeysTransportSettings, settings.listHmacKeysSettings(), clientContext); - this.updateHmacKeyCallable = - callableFactory.createUnaryCallable( - updateHmacKeyTransportSettings, settings.updateHmacKeySettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable deleteBucketCallable() { - return deleteBucketCallable; - } - - @Override - public UnaryCallable getBucketCallable() { - return getBucketCallable; - } - - @Override - public UnaryCallable createBucketCallable() { - return createBucketCallable; - } - - @Override - public UnaryCallable listBucketsCallable() { - return listBucketsCallable; - } - - @Override - public UnaryCallable listBucketsPagedCallable() { - return listBucketsPagedCallable; - } - - @Override - public UnaryCallable - lockBucketRetentionPolicyCallable() { - return lockBucketRetentionPolicyCallable; - } - - @Override - public UnaryCallable getIamPolicyCallable() { - return getIamPolicyCallable; - } - - @Override - public UnaryCallable setIamPolicyCallable() { - return setIamPolicyCallable; - } - - @Override - public UnaryCallable - testIamPermissionsCallable() { - return testIamPermissionsCallable; - } - - @Override - public UnaryCallable updateBucketCallable() { - return updateBucketCallable; - } - - @Override - public UnaryCallable deleteNotificationCallable() { - return deleteNotificationCallable; - } - - @Override - public UnaryCallable getNotificationCallable() { - return getNotificationCallable; - } - - @Override - public UnaryCallable createNotificationCallable() { - return createNotificationCallable; - } - - @Override - public UnaryCallable - listNotificationsCallable() { - return listNotificationsCallable; - } - - @Override - public UnaryCallable - listNotificationsPagedCallable() { - return listNotificationsPagedCallable; - } - - @Override - public UnaryCallable composeObjectCallable() { - return composeObjectCallable; - } - - @Override - public UnaryCallable deleteObjectCallable() { - return deleteObjectCallable; - } - - @Override - public UnaryCallable getObjectCallable() { - return getObjectCallable; - } - - @Override - public ServerStreamingCallable readObjectCallable() { - return readObjectCallable; - } - - @Override - public UnaryCallable updateObjectCallable() { - return updateObjectCallable; - } - - @Override - public ClientStreamingCallable writeObjectCallable() { - return writeObjectCallable; - } - - @Override - public UnaryCallable listObjectsCallable() { - return listObjectsCallable; - } - - @Override - public UnaryCallable listObjectsPagedCallable() { - return listObjectsPagedCallable; - } - - @Override - public UnaryCallable rewriteObjectCallable() { - return rewriteObjectCallable; - } - - @Override - public UnaryCallable - startResumableWriteCallable() { - return startResumableWriteCallable; - } - - @Override - public UnaryCallable - queryWriteStatusCallable() { - return queryWriteStatusCallable; - } - - @Override - public UnaryCallable getServiceAccountCallable() { - return getServiceAccountCallable; - } - - @Override - public UnaryCallable createHmacKeyCallable() { - return createHmacKeyCallable; - } - - @Override - public UnaryCallable deleteHmacKeyCallable() { - return deleteHmacKeyCallable; - } - - @Override - public UnaryCallable getHmacKeyCallable() { - return getHmacKeyCallable; - } - - @Override - public UnaryCallable listHmacKeysCallable() { - return listHmacKeysCallable; - } - - @Override - public UnaryCallable listHmacKeysPagedCallable() { - return listHmacKeysPagedCallable; - } - - @Override - public UnaryCallable updateHmacKeyCallable() { - return updateHmacKeyCallable; - } - - @Override - public final void close() { - try { - backgroundResources.close(); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new IllegalStateException("Failed to close resource", e); - } - } - - @Override - public void shutdown() { - backgroundResources.shutdown(); - } - - @Override - public boolean isShutdown() { - return backgroundResources.isShutdown(); - } - - @Override - public boolean isTerminated() { - return backgroundResources.isTerminated(); - } - - @Override - public void shutdownNow() { - backgroundResources.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return backgroundResources.awaitTermination(duration, unit); - } -} diff --git a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStub.java b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStub.java deleted file mode 100644 index 1257db961d..0000000000 --- a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStub.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.storage.v2.stub; - -import static com.google.storage.v2.StorageClient.ListBucketsPagedResponse; -import static com.google.storage.v2.StorageClient.ListHmacKeysPagedResponse; -import static com.google.storage.v2.StorageClient.ListNotificationsPagedResponse; -import static com.google.storage.v2.StorageClient.ListObjectsPagedResponse; - -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.Empty; -import com.google.storage.v2.Bucket; -import com.google.storage.v2.ComposeObjectRequest; -import com.google.storage.v2.CreateBucketRequest; -import com.google.storage.v2.CreateHmacKeyRequest; -import com.google.storage.v2.CreateHmacKeyResponse; -import com.google.storage.v2.CreateNotificationRequest; -import com.google.storage.v2.DeleteBucketRequest; -import com.google.storage.v2.DeleteHmacKeyRequest; -import com.google.storage.v2.DeleteNotificationRequest; -import com.google.storage.v2.DeleteObjectRequest; -import com.google.storage.v2.GetBucketRequest; -import com.google.storage.v2.GetHmacKeyRequest; -import com.google.storage.v2.GetNotificationRequest; -import com.google.storage.v2.GetObjectRequest; -import com.google.storage.v2.GetServiceAccountRequest; -import com.google.storage.v2.HmacKeyMetadata; -import com.google.storage.v2.ListBucketsRequest; -import com.google.storage.v2.ListBucketsResponse; -import com.google.storage.v2.ListHmacKeysRequest; -import com.google.storage.v2.ListHmacKeysResponse; -import com.google.storage.v2.ListNotificationsRequest; -import com.google.storage.v2.ListNotificationsResponse; -import com.google.storage.v2.ListObjectsRequest; -import com.google.storage.v2.ListObjectsResponse; -import com.google.storage.v2.LockBucketRetentionPolicyRequest; -import com.google.storage.v2.Notification; -import com.google.storage.v2.Object; -import com.google.storage.v2.QueryWriteStatusRequest; -import com.google.storage.v2.QueryWriteStatusResponse; -import com.google.storage.v2.ReadObjectRequest; -import com.google.storage.v2.ReadObjectResponse; -import com.google.storage.v2.RewriteObjectRequest; -import com.google.storage.v2.RewriteResponse; -import com.google.storage.v2.ServiceAccount; -import com.google.storage.v2.StartResumableWriteRequest; -import com.google.storage.v2.StartResumableWriteResponse; -import com.google.storage.v2.UpdateBucketRequest; -import com.google.storage.v2.UpdateHmacKeyRequest; -import com.google.storage.v2.UpdateObjectRequest; -import com.google.storage.v2.WriteObjectRequest; -import com.google.storage.v2.WriteObjectResponse; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the Storage service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator-java") -public abstract class StorageStub implements BackgroundResource { - - public UnaryCallable deleteBucketCallable() { - throw new UnsupportedOperationException("Not implemented: deleteBucketCallable()"); - } - - public UnaryCallable getBucketCallable() { - throw new UnsupportedOperationException("Not implemented: getBucketCallable()"); - } - - public UnaryCallable createBucketCallable() { - throw new UnsupportedOperationException("Not implemented: createBucketCallable()"); - } - - public UnaryCallable listBucketsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listBucketsPagedCallable()"); - } - - public UnaryCallable listBucketsCallable() { - throw new UnsupportedOperationException("Not implemented: listBucketsCallable()"); - } - - public UnaryCallable - lockBucketRetentionPolicyCallable() { - throw new UnsupportedOperationException("Not implemented: lockBucketRetentionPolicyCallable()"); - } - - public UnaryCallable getIamPolicyCallable() { - throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); - } - - public UnaryCallable setIamPolicyCallable() { - throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); - } - - public UnaryCallable - testIamPermissionsCallable() { - throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); - } - - public UnaryCallable updateBucketCallable() { - throw new UnsupportedOperationException("Not implemented: updateBucketCallable()"); - } - - public UnaryCallable deleteNotificationCallable() { - throw new UnsupportedOperationException("Not implemented: deleteNotificationCallable()"); - } - - public UnaryCallable getNotificationCallable() { - throw new UnsupportedOperationException("Not implemented: getNotificationCallable()"); - } - - public UnaryCallable createNotificationCallable() { - throw new UnsupportedOperationException("Not implemented: createNotificationCallable()"); - } - - public UnaryCallable - listNotificationsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listNotificationsPagedCallable()"); - } - - public UnaryCallable - listNotificationsCallable() { - throw new UnsupportedOperationException("Not implemented: listNotificationsCallable()"); - } - - public UnaryCallable composeObjectCallable() { - throw new UnsupportedOperationException("Not implemented: composeObjectCallable()"); - } - - public UnaryCallable deleteObjectCallable() { - throw new UnsupportedOperationException("Not implemented: deleteObjectCallable()"); - } - - public UnaryCallable getObjectCallable() { - throw new UnsupportedOperationException("Not implemented: getObjectCallable()"); - } - - public ServerStreamingCallable readObjectCallable() { - throw new UnsupportedOperationException("Not implemented: readObjectCallable()"); - } - - public UnaryCallable updateObjectCallable() { - throw new UnsupportedOperationException("Not implemented: updateObjectCallable()"); - } - - public ClientStreamingCallable writeObjectCallable() { - throw new UnsupportedOperationException("Not implemented: writeObjectCallable()"); - } - - public UnaryCallable listObjectsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listObjectsPagedCallable()"); - } - - public UnaryCallable listObjectsCallable() { - throw new UnsupportedOperationException("Not implemented: listObjectsCallable()"); - } - - public UnaryCallable rewriteObjectCallable() { - throw new UnsupportedOperationException("Not implemented: rewriteObjectCallable()"); - } - - public UnaryCallable - startResumableWriteCallable() { - throw new UnsupportedOperationException("Not implemented: startResumableWriteCallable()"); - } - - public UnaryCallable - queryWriteStatusCallable() { - throw new UnsupportedOperationException("Not implemented: queryWriteStatusCallable()"); - } - - public UnaryCallable getServiceAccountCallable() { - throw new UnsupportedOperationException("Not implemented: getServiceAccountCallable()"); - } - - public UnaryCallable createHmacKeyCallable() { - throw new UnsupportedOperationException("Not implemented: createHmacKeyCallable()"); - } - - public UnaryCallable deleteHmacKeyCallable() { - throw new UnsupportedOperationException("Not implemented: deleteHmacKeyCallable()"); - } - - public UnaryCallable getHmacKeyCallable() { - throw new UnsupportedOperationException("Not implemented: getHmacKeyCallable()"); - } - - public UnaryCallable listHmacKeysPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listHmacKeysPagedCallable()"); - } - - public UnaryCallable listHmacKeysCallable() { - throw new UnsupportedOperationException("Not implemented: listHmacKeysCallable()"); - } - - public UnaryCallable updateHmacKeyCallable() { - throw new UnsupportedOperationException("Not implemented: updateHmacKeyCallable()"); - } - - @Override - public abstract void close(); -} diff --git a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStubSettings.java b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStubSettings.java deleted file mode 100644 index 227af4a374..0000000000 --- a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStubSettings.java +++ /dev/null @@ -1,1234 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.storage.v2.stub; - -import static com.google.storage.v2.StorageClient.ListBucketsPagedResponse; -import static com.google.storage.v2.StorageClient.ListHmacKeysPagedResponse; -import static com.google.storage.v2.StorageClient.ListNotificationsPagedResponse; -import static com.google.storage.v2.StorageClient.ListObjectsPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.Empty; -import com.google.storage.v2.Bucket; -import com.google.storage.v2.ComposeObjectRequest; -import com.google.storage.v2.CreateBucketRequest; -import com.google.storage.v2.CreateHmacKeyRequest; -import com.google.storage.v2.CreateHmacKeyResponse; -import com.google.storage.v2.CreateNotificationRequest; -import com.google.storage.v2.DeleteBucketRequest; -import com.google.storage.v2.DeleteHmacKeyRequest; -import com.google.storage.v2.DeleteNotificationRequest; -import com.google.storage.v2.DeleteObjectRequest; -import com.google.storage.v2.GetBucketRequest; -import com.google.storage.v2.GetHmacKeyRequest; -import com.google.storage.v2.GetNotificationRequest; -import com.google.storage.v2.GetObjectRequest; -import com.google.storage.v2.GetServiceAccountRequest; -import com.google.storage.v2.HmacKeyMetadata; -import com.google.storage.v2.ListBucketsRequest; -import com.google.storage.v2.ListBucketsResponse; -import com.google.storage.v2.ListHmacKeysRequest; -import com.google.storage.v2.ListHmacKeysResponse; -import com.google.storage.v2.ListNotificationsRequest; -import com.google.storage.v2.ListNotificationsResponse; -import com.google.storage.v2.ListObjectsRequest; -import com.google.storage.v2.ListObjectsResponse; -import com.google.storage.v2.LockBucketRetentionPolicyRequest; -import com.google.storage.v2.Notification; -import com.google.storage.v2.Object; -import com.google.storage.v2.QueryWriteStatusRequest; -import com.google.storage.v2.QueryWriteStatusResponse; -import com.google.storage.v2.ReadObjectRequest; -import com.google.storage.v2.ReadObjectResponse; -import com.google.storage.v2.RewriteObjectRequest; -import com.google.storage.v2.RewriteResponse; -import com.google.storage.v2.ServiceAccount; -import com.google.storage.v2.StartResumableWriteRequest; -import com.google.storage.v2.StartResumableWriteResponse; -import com.google.storage.v2.UpdateBucketRequest; -import com.google.storage.v2.UpdateHmacKeyRequest; -import com.google.storage.v2.UpdateObjectRequest; -import com.google.storage.v2.WriteObjectRequest; -import com.google.storage.v2.WriteObjectResponse; -import java.io.IOException; -import java.util.List; -import javax.annotation.Generated; -import org.threeten.bp.Duration; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Settings class to configure an instance of {@link StorageStub}. - * - *

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

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

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

For example, to set the total timeout of deleteBucket to 30 seconds: - * - *

{@code
- * StorageStubSettings.Builder storageSettingsBuilder = StorageStubSettings.newBuilder();
- * storageSettingsBuilder
- *     .deleteBucketSettings()
- *     .setRetrySettings(
- *         storageSettingsBuilder
- *             .deleteBucketSettings()
- *             .getRetrySettings()
- *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * StorageStubSettings storageSettings = storageSettingsBuilder.build();
- * }
- */ -@Generated("by gapic-generator-java") -public class StorageStubSettings extends StubSettings { - /** The default scopes of the service. */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = - ImmutableList.builder() - .add("https://www.googleapis.com/auth/cloud-platform") - .add("https://www.googleapis.com/auth/cloud-platform.read-only") - .add("https://www.googleapis.com/auth/devstorage.full_control") - .add("https://www.googleapis.com/auth/devstorage.read_only") - .add("https://www.googleapis.com/auth/devstorage.read_write") - .build(); - - private final UnaryCallSettings deleteBucketSettings; - private final UnaryCallSettings getBucketSettings; - private final UnaryCallSettings createBucketSettings; - private final PagedCallSettings - listBucketsSettings; - private final UnaryCallSettings - lockBucketRetentionPolicySettings; - private final UnaryCallSettings getIamPolicySettings; - private final UnaryCallSettings setIamPolicySettings; - private final UnaryCallSettings - testIamPermissionsSettings; - private final UnaryCallSettings updateBucketSettings; - private final UnaryCallSettings deleteNotificationSettings; - private final UnaryCallSettings getNotificationSettings; - private final UnaryCallSettings - createNotificationSettings; - private final PagedCallSettings< - ListNotificationsRequest, ListNotificationsResponse, ListNotificationsPagedResponse> - listNotificationsSettings; - private final UnaryCallSettings composeObjectSettings; - private final UnaryCallSettings deleteObjectSettings; - private final UnaryCallSettings getObjectSettings; - private final ServerStreamingCallSettings - readObjectSettings; - private final UnaryCallSettings updateObjectSettings; - private final StreamingCallSettings writeObjectSettings; - private final PagedCallSettings - listObjectsSettings; - private final UnaryCallSettings rewriteObjectSettings; - private final UnaryCallSettings - startResumableWriteSettings; - private final UnaryCallSettings - queryWriteStatusSettings; - private final UnaryCallSettings - getServiceAccountSettings; - private final UnaryCallSettings - createHmacKeySettings; - private final UnaryCallSettings deleteHmacKeySettings; - private final UnaryCallSettings getHmacKeySettings; - private final PagedCallSettings< - ListHmacKeysRequest, ListHmacKeysResponse, ListHmacKeysPagedResponse> - listHmacKeysSettings; - private final UnaryCallSettings updateHmacKeySettings; - - private static final PagedListDescriptor - LIST_BUCKETS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListBucketsRequest injectToken(ListBucketsRequest payload, String token) { - return ListBucketsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListBucketsRequest injectPageSize(ListBucketsRequest payload, int pageSize) { - return ListBucketsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListBucketsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListBucketsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListBucketsResponse payload) { - return payload.getBucketsList() == null - ? ImmutableList.of() - : payload.getBucketsList(); - } - }; - - private static final PagedListDescriptor< - ListNotificationsRequest, ListNotificationsResponse, Notification> - LIST_NOTIFICATIONS_PAGE_STR_DESC = - new PagedListDescriptor< - ListNotificationsRequest, ListNotificationsResponse, Notification>() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListNotificationsRequest injectToken( - ListNotificationsRequest payload, String token) { - return ListNotificationsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListNotificationsRequest injectPageSize( - ListNotificationsRequest payload, int pageSize) { - return ListNotificationsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListNotificationsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListNotificationsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListNotificationsResponse payload) { - return payload.getNotificationsList() == null - ? ImmutableList.of() - : payload.getNotificationsList(); - } - }; - - private static final PagedListDescriptor - LIST_OBJECTS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListObjectsRequest injectToken(ListObjectsRequest payload, String token) { - return ListObjectsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListObjectsRequest injectPageSize(ListObjectsRequest payload, int pageSize) { - return ListObjectsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListObjectsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListObjectsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListObjectsResponse payload) { - return payload.getObjectsList() == null - ? ImmutableList.of() - : payload.getObjectsList(); - } - }; - - private static final PagedListDescriptor< - ListHmacKeysRequest, ListHmacKeysResponse, HmacKeyMetadata> - LIST_HMAC_KEYS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListHmacKeysRequest injectToken(ListHmacKeysRequest payload, String token) { - return ListHmacKeysRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListHmacKeysRequest injectPageSize(ListHmacKeysRequest payload, int pageSize) { - return ListHmacKeysRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListHmacKeysRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListHmacKeysResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListHmacKeysResponse payload) { - return payload.getHmacKeysList() == null - ? ImmutableList.of() - : payload.getHmacKeysList(); - } - }; - - private static final PagedListResponseFactory< - ListBucketsRequest, ListBucketsResponse, ListBucketsPagedResponse> - LIST_BUCKETS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListBucketsRequest, ListBucketsResponse, ListBucketsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListBucketsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_BUCKETS_PAGE_STR_DESC, request, context); - return ListBucketsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final PagedListResponseFactory< - ListNotificationsRequest, ListNotificationsResponse, ListNotificationsPagedResponse> - LIST_NOTIFICATIONS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListNotificationsRequest, - ListNotificationsResponse, - ListNotificationsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListNotificationsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext - pageContext = - PageContext.create( - callable, LIST_NOTIFICATIONS_PAGE_STR_DESC, request, context); - return ListNotificationsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final PagedListResponseFactory< - ListObjectsRequest, ListObjectsResponse, ListObjectsPagedResponse> - LIST_OBJECTS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListObjectsRequest, ListObjectsResponse, ListObjectsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListObjectsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_OBJECTS_PAGE_STR_DESC, request, context); - return ListObjectsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final PagedListResponseFactory< - ListHmacKeysRequest, ListHmacKeysResponse, ListHmacKeysPagedResponse> - LIST_HMAC_KEYS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListHmacKeysRequest, ListHmacKeysResponse, ListHmacKeysPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListHmacKeysRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_HMAC_KEYS_PAGE_STR_DESC, request, context); - return ListHmacKeysPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - /** Returns the object with the settings used for calls to deleteBucket. */ - public UnaryCallSettings deleteBucketSettings() { - return deleteBucketSettings; - } - - /** Returns the object with the settings used for calls to getBucket. */ - public UnaryCallSettings getBucketSettings() { - return getBucketSettings; - } - - /** Returns the object with the settings used for calls to createBucket. */ - public UnaryCallSettings createBucketSettings() { - return createBucketSettings; - } - - /** Returns the object with the settings used for calls to listBuckets. */ - public PagedCallSettings - listBucketsSettings() { - return listBucketsSettings; - } - - /** Returns the object with the settings used for calls to lockBucketRetentionPolicy. */ - public UnaryCallSettings - lockBucketRetentionPolicySettings() { - return lockBucketRetentionPolicySettings; - } - - /** Returns the object with the settings used for calls to getIamPolicy. */ - public UnaryCallSettings getIamPolicySettings() { - return getIamPolicySettings; - } - - /** Returns the object with the settings used for calls to setIamPolicy. */ - public UnaryCallSettings setIamPolicySettings() { - return setIamPolicySettings; - } - - /** Returns the object with the settings used for calls to testIamPermissions. */ - public UnaryCallSettings - testIamPermissionsSettings() { - return testIamPermissionsSettings; - } - - /** Returns the object with the settings used for calls to updateBucket. */ - public UnaryCallSettings updateBucketSettings() { - return updateBucketSettings; - } - - /** Returns the object with the settings used for calls to deleteNotification. */ - public UnaryCallSettings deleteNotificationSettings() { - return deleteNotificationSettings; - } - - /** Returns the object with the settings used for calls to getNotification. */ - public UnaryCallSettings getNotificationSettings() { - return getNotificationSettings; - } - - /** Returns the object with the settings used for calls to createNotification. */ - public UnaryCallSettings createNotificationSettings() { - return createNotificationSettings; - } - - /** Returns the object with the settings used for calls to listNotifications. */ - public PagedCallSettings< - ListNotificationsRequest, ListNotificationsResponse, ListNotificationsPagedResponse> - listNotificationsSettings() { - return listNotificationsSettings; - } - - /** Returns the object with the settings used for calls to composeObject. */ - public UnaryCallSettings composeObjectSettings() { - return composeObjectSettings; - } - - /** Returns the object with the settings used for calls to deleteObject. */ - public UnaryCallSettings deleteObjectSettings() { - return deleteObjectSettings; - } - - /** Returns the object with the settings used for calls to getObject. */ - public UnaryCallSettings getObjectSettings() { - return getObjectSettings; - } - - /** Returns the object with the settings used for calls to readObject. */ - public ServerStreamingCallSettings readObjectSettings() { - return readObjectSettings; - } - - /** Returns the object with the settings used for calls to updateObject. */ - public UnaryCallSettings updateObjectSettings() { - return updateObjectSettings; - } - - /** Returns the object with the settings used for calls to writeObject. */ - public StreamingCallSettings writeObjectSettings() { - return writeObjectSettings; - } - - /** Returns the object with the settings used for calls to listObjects. */ - public PagedCallSettings - listObjectsSettings() { - return listObjectsSettings; - } - - /** Returns the object with the settings used for calls to rewriteObject. */ - public UnaryCallSettings rewriteObjectSettings() { - return rewriteObjectSettings; - } - - /** Returns the object with the settings used for calls to startResumableWrite. */ - public UnaryCallSettings - startResumableWriteSettings() { - return startResumableWriteSettings; - } - - /** Returns the object with the settings used for calls to queryWriteStatus. */ - public UnaryCallSettings - queryWriteStatusSettings() { - return queryWriteStatusSettings; - } - - /** Returns the object with the settings used for calls to getServiceAccount. */ - public UnaryCallSettings getServiceAccountSettings() { - return getServiceAccountSettings; - } - - /** Returns the object with the settings used for calls to createHmacKey. */ - public UnaryCallSettings createHmacKeySettings() { - return createHmacKeySettings; - } - - /** Returns the object with the settings used for calls to deleteHmacKey. */ - public UnaryCallSettings deleteHmacKeySettings() { - return deleteHmacKeySettings; - } - - /** Returns the object with the settings used for calls to getHmacKey. */ - public UnaryCallSettings getHmacKeySettings() { - return getHmacKeySettings; - } - - /** Returns the object with the settings used for calls to listHmacKeys. */ - public PagedCallSettings - listHmacKeysSettings() { - return listHmacKeysSettings; - } - - /** Returns the object with the settings used for calls to updateHmacKey. */ - public UnaryCallSettings updateHmacKeySettings() { - return updateHmacKeySettings; - } - - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - public StorageStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcStorageStub.create(this); - } - throw new UnsupportedOperationException( - String.format( - "Transport not supported: %s", getTransportChannelProvider().getTransportName())); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return InstantiatingExecutorProvider.newBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return "storage.googleapis.com:443"; - } - - /** Returns the default mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "storage.mtls.googleapis.com:443"; - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return DEFAULT_SERVICE_SCOPES; - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder() - .setScopesToApply(DEFAULT_SERVICE_SCOPES) - .setUseJwtAccessWithScope(true); - } - - /** Returns a builder for the default ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(StorageStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected StorageStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - deleteBucketSettings = settingsBuilder.deleteBucketSettings().build(); - getBucketSettings = settingsBuilder.getBucketSettings().build(); - createBucketSettings = settingsBuilder.createBucketSettings().build(); - listBucketsSettings = settingsBuilder.listBucketsSettings().build(); - lockBucketRetentionPolicySettings = settingsBuilder.lockBucketRetentionPolicySettings().build(); - getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); - setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); - testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); - updateBucketSettings = settingsBuilder.updateBucketSettings().build(); - deleteNotificationSettings = settingsBuilder.deleteNotificationSettings().build(); - getNotificationSettings = settingsBuilder.getNotificationSettings().build(); - createNotificationSettings = settingsBuilder.createNotificationSettings().build(); - listNotificationsSettings = settingsBuilder.listNotificationsSettings().build(); - composeObjectSettings = settingsBuilder.composeObjectSettings().build(); - deleteObjectSettings = settingsBuilder.deleteObjectSettings().build(); - getObjectSettings = settingsBuilder.getObjectSettings().build(); - readObjectSettings = settingsBuilder.readObjectSettings().build(); - updateObjectSettings = settingsBuilder.updateObjectSettings().build(); - writeObjectSettings = settingsBuilder.writeObjectSettings().build(); - listObjectsSettings = settingsBuilder.listObjectsSettings().build(); - rewriteObjectSettings = settingsBuilder.rewriteObjectSettings().build(); - startResumableWriteSettings = settingsBuilder.startResumableWriteSettings().build(); - queryWriteStatusSettings = settingsBuilder.queryWriteStatusSettings().build(); - getServiceAccountSettings = settingsBuilder.getServiceAccountSettings().build(); - createHmacKeySettings = settingsBuilder.createHmacKeySettings().build(); - deleteHmacKeySettings = settingsBuilder.deleteHmacKeySettings().build(); - getHmacKeySettings = settingsBuilder.getHmacKeySettings().build(); - listHmacKeysSettings = settingsBuilder.listHmacKeysSettings().build(); - updateHmacKeySettings = settingsBuilder.updateHmacKeySettings().build(); - } - - /** Builder for StorageStubSettings. */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder deleteBucketSettings; - private final UnaryCallSettings.Builder getBucketSettings; - private final UnaryCallSettings.Builder createBucketSettings; - private final PagedCallSettings.Builder< - ListBucketsRequest, ListBucketsResponse, ListBucketsPagedResponse> - listBucketsSettings; - private final UnaryCallSettings.Builder - lockBucketRetentionPolicySettings; - private final UnaryCallSettings.Builder getIamPolicySettings; - private final UnaryCallSettings.Builder setIamPolicySettings; - private final UnaryCallSettings.Builder - testIamPermissionsSettings; - private final UnaryCallSettings.Builder updateBucketSettings; - private final UnaryCallSettings.Builder - deleteNotificationSettings; - private final UnaryCallSettings.Builder - getNotificationSettings; - private final UnaryCallSettings.Builder - createNotificationSettings; - private final PagedCallSettings.Builder< - ListNotificationsRequest, ListNotificationsResponse, ListNotificationsPagedResponse> - listNotificationsSettings; - private final UnaryCallSettings.Builder composeObjectSettings; - private final UnaryCallSettings.Builder deleteObjectSettings; - private final UnaryCallSettings.Builder getObjectSettings; - private final ServerStreamingCallSettings.Builder - readObjectSettings; - private final UnaryCallSettings.Builder updateObjectSettings; - private final StreamingCallSettings.Builder - writeObjectSettings; - private final PagedCallSettings.Builder< - ListObjectsRequest, ListObjectsResponse, ListObjectsPagedResponse> - listObjectsSettings; - private final UnaryCallSettings.Builder - rewriteObjectSettings; - private final UnaryCallSettings.Builder - startResumableWriteSettings; - private final UnaryCallSettings.Builder - queryWriteStatusSettings; - private final UnaryCallSettings.Builder - getServiceAccountSettings; - private final UnaryCallSettings.Builder - createHmacKeySettings; - private final UnaryCallSettings.Builder deleteHmacKeySettings; - private final UnaryCallSettings.Builder getHmacKeySettings; - private final PagedCallSettings.Builder< - ListHmacKeysRequest, ListHmacKeysResponse, ListHmacKeysPagedResponse> - listHmacKeysSettings; - private final UnaryCallSettings.Builder - updateHmacKeySettings; - private static final ImmutableMap> - RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = - ImmutableMap.builder(); - definitions.put( - "retry_policy_0_codes", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - RETRYABLE_CODE_DEFINITIONS = definitions.build(); - } - - private static final ImmutableMap RETRY_PARAM_DEFINITIONS; - - static { - ImmutableMap.Builder definitions = ImmutableMap.builder(); - RetrySettings settings = null; - settings = - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(1000L)) - .setRetryDelayMultiplier(2.0) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(60000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(60000L)) - .setTotalTimeout(Duration.ofMillis(60000L)) - .build(); - definitions.put("retry_policy_0_params", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - deleteBucketSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getBucketSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - createBucketSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listBucketsSettings = PagedCallSettings.newBuilder(LIST_BUCKETS_PAGE_STR_FACT); - lockBucketRetentionPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - updateBucketSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - deleteNotificationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getNotificationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - createNotificationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listNotificationsSettings = PagedCallSettings.newBuilder(LIST_NOTIFICATIONS_PAGE_STR_FACT); - composeObjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - deleteObjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getObjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - readObjectSettings = ServerStreamingCallSettings.newBuilder(); - updateObjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - writeObjectSettings = StreamingCallSettings.newBuilder(); - listObjectsSettings = PagedCallSettings.newBuilder(LIST_OBJECTS_PAGE_STR_FACT); - rewriteObjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - startResumableWriteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - queryWriteStatusSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getServiceAccountSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - createHmacKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - deleteHmacKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getHmacKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listHmacKeysSettings = PagedCallSettings.newBuilder(LIST_HMAC_KEYS_PAGE_STR_FACT); - updateHmacKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - deleteBucketSettings, - getBucketSettings, - createBucketSettings, - listBucketsSettings, - lockBucketRetentionPolicySettings, - getIamPolicySettings, - setIamPolicySettings, - testIamPermissionsSettings, - updateBucketSettings, - deleteNotificationSettings, - getNotificationSettings, - createNotificationSettings, - listNotificationsSettings, - composeObjectSettings, - deleteObjectSettings, - getObjectSettings, - updateObjectSettings, - listObjectsSettings, - rewriteObjectSettings, - startResumableWriteSettings, - queryWriteStatusSettings, - getServiceAccountSettings, - createHmacKeySettings, - deleteHmacKeySettings, - getHmacKeySettings, - listHmacKeysSettings, - updateHmacKeySettings); - initDefaults(this); - } - - protected Builder(StorageStubSettings settings) { - super(settings); - - deleteBucketSettings = settings.deleteBucketSettings.toBuilder(); - getBucketSettings = settings.getBucketSettings.toBuilder(); - createBucketSettings = settings.createBucketSettings.toBuilder(); - listBucketsSettings = settings.listBucketsSettings.toBuilder(); - lockBucketRetentionPolicySettings = settings.lockBucketRetentionPolicySettings.toBuilder(); - getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); - setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); - testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); - updateBucketSettings = settings.updateBucketSettings.toBuilder(); - deleteNotificationSettings = settings.deleteNotificationSettings.toBuilder(); - getNotificationSettings = settings.getNotificationSettings.toBuilder(); - createNotificationSettings = settings.createNotificationSettings.toBuilder(); - listNotificationsSettings = settings.listNotificationsSettings.toBuilder(); - composeObjectSettings = settings.composeObjectSettings.toBuilder(); - deleteObjectSettings = settings.deleteObjectSettings.toBuilder(); - getObjectSettings = settings.getObjectSettings.toBuilder(); - readObjectSettings = settings.readObjectSettings.toBuilder(); - updateObjectSettings = settings.updateObjectSettings.toBuilder(); - writeObjectSettings = settings.writeObjectSettings.toBuilder(); - listObjectsSettings = settings.listObjectsSettings.toBuilder(); - rewriteObjectSettings = settings.rewriteObjectSettings.toBuilder(); - startResumableWriteSettings = settings.startResumableWriteSettings.toBuilder(); - queryWriteStatusSettings = settings.queryWriteStatusSettings.toBuilder(); - getServiceAccountSettings = settings.getServiceAccountSettings.toBuilder(); - createHmacKeySettings = settings.createHmacKeySettings.toBuilder(); - deleteHmacKeySettings = settings.deleteHmacKeySettings.toBuilder(); - getHmacKeySettings = settings.getHmacKeySettings.toBuilder(); - listHmacKeysSettings = settings.listHmacKeysSettings.toBuilder(); - updateHmacKeySettings = settings.updateHmacKeySettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - deleteBucketSettings, - getBucketSettings, - createBucketSettings, - listBucketsSettings, - lockBucketRetentionPolicySettings, - getIamPolicySettings, - setIamPolicySettings, - testIamPermissionsSettings, - updateBucketSettings, - deleteNotificationSettings, - getNotificationSettings, - createNotificationSettings, - listNotificationsSettings, - composeObjectSettings, - deleteObjectSettings, - getObjectSettings, - updateObjectSettings, - listObjectsSettings, - rewriteObjectSettings, - startResumableWriteSettings, - queryWriteStatusSettings, - getServiceAccountSettings, - createHmacKeySettings, - deleteHmacKeySettings, - getHmacKeySettings, - listHmacKeysSettings, - updateHmacKeySettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .deleteBucketSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .getBucketSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .createBucketSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .listBucketsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .lockBucketRetentionPolicySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .getIamPolicySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .setIamPolicySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .testIamPermissionsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .updateBucketSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .deleteNotificationSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .getNotificationSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .createNotificationSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .listNotificationsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .composeObjectSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .deleteObjectSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .getObjectSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .readObjectSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .updateObjectSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .listObjectsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .rewriteObjectSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .startResumableWriteSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .queryWriteStatusSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .getServiceAccountSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .createHmacKeySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .deleteHmacKeySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .getHmacKeySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .listHmacKeysSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .updateHmacKeySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - return builder; - } - - /** - * Applies the given settings updater function to all of the unary API methods in this service. - * - *

Note: This method does not support applying settings to streaming methods. - */ - public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) { - super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); - return this; - } - - public ImmutableList> unaryMethodSettingsBuilders() { - return unaryMethodSettingsBuilders; - } - - /** Returns the builder for the settings used for calls to deleteBucket. */ - public UnaryCallSettings.Builder deleteBucketSettings() { - return deleteBucketSettings; - } - - /** Returns the builder for the settings used for calls to getBucket. */ - public UnaryCallSettings.Builder getBucketSettings() { - return getBucketSettings; - } - - /** Returns the builder for the settings used for calls to createBucket. */ - public UnaryCallSettings.Builder createBucketSettings() { - return createBucketSettings; - } - - /** Returns the builder for the settings used for calls to listBuckets. */ - public PagedCallSettings.Builder< - ListBucketsRequest, ListBucketsResponse, ListBucketsPagedResponse> - listBucketsSettings() { - return listBucketsSettings; - } - - /** Returns the builder for the settings used for calls to lockBucketRetentionPolicy. */ - public UnaryCallSettings.Builder - lockBucketRetentionPolicySettings() { - return lockBucketRetentionPolicySettings; - } - - /** Returns the builder for the settings used for calls to getIamPolicy. */ - public UnaryCallSettings.Builder getIamPolicySettings() { - return getIamPolicySettings; - } - - /** Returns the builder for the settings used for calls to setIamPolicy. */ - public UnaryCallSettings.Builder setIamPolicySettings() { - return setIamPolicySettings; - } - - /** Returns the builder for the settings used for calls to testIamPermissions. */ - public UnaryCallSettings.Builder - testIamPermissionsSettings() { - return testIamPermissionsSettings; - } - - /** Returns the builder for the settings used for calls to updateBucket. */ - public UnaryCallSettings.Builder updateBucketSettings() { - return updateBucketSettings; - } - - /** Returns the builder for the settings used for calls to deleteNotification. */ - public UnaryCallSettings.Builder - deleteNotificationSettings() { - return deleteNotificationSettings; - } - - /** Returns the builder for the settings used for calls to getNotification. */ - public UnaryCallSettings.Builder - getNotificationSettings() { - return getNotificationSettings; - } - - /** Returns the builder for the settings used for calls to createNotification. */ - public UnaryCallSettings.Builder - createNotificationSettings() { - return createNotificationSettings; - } - - /** Returns the builder for the settings used for calls to listNotifications. */ - public PagedCallSettings.Builder< - ListNotificationsRequest, ListNotificationsResponse, ListNotificationsPagedResponse> - listNotificationsSettings() { - return listNotificationsSettings; - } - - /** Returns the builder for the settings used for calls to composeObject. */ - public UnaryCallSettings.Builder composeObjectSettings() { - return composeObjectSettings; - } - - /** Returns the builder for the settings used for calls to deleteObject. */ - public UnaryCallSettings.Builder deleteObjectSettings() { - return deleteObjectSettings; - } - - /** Returns the builder for the settings used for calls to getObject. */ - public UnaryCallSettings.Builder getObjectSettings() { - return getObjectSettings; - } - - /** Returns the builder for the settings used for calls to readObject. */ - public ServerStreamingCallSettings.Builder - readObjectSettings() { - return readObjectSettings; - } - - /** Returns the builder for the settings used for calls to updateObject. */ - public UnaryCallSettings.Builder updateObjectSettings() { - return updateObjectSettings; - } - - /** Returns the builder for the settings used for calls to writeObject. */ - public StreamingCallSettings.Builder - writeObjectSettings() { - return writeObjectSettings; - } - - /** Returns the builder for the settings used for calls to listObjects. */ - public PagedCallSettings.Builder< - ListObjectsRequest, ListObjectsResponse, ListObjectsPagedResponse> - listObjectsSettings() { - return listObjectsSettings; - } - - /** Returns the builder for the settings used for calls to rewriteObject. */ - public UnaryCallSettings.Builder - rewriteObjectSettings() { - return rewriteObjectSettings; - } - - /** Returns the builder for the settings used for calls to startResumableWrite. */ - public UnaryCallSettings.Builder - startResumableWriteSettings() { - return startResumableWriteSettings; - } - - /** Returns the builder for the settings used for calls to queryWriteStatus. */ - public UnaryCallSettings.Builder - queryWriteStatusSettings() { - return queryWriteStatusSettings; - } - - /** Returns the builder for the settings used for calls to getServiceAccount. */ - public UnaryCallSettings.Builder - getServiceAccountSettings() { - return getServiceAccountSettings; - } - - /** Returns the builder for the settings used for calls to createHmacKey. */ - public UnaryCallSettings.Builder - createHmacKeySettings() { - return createHmacKeySettings; - } - - /** Returns the builder for the settings used for calls to deleteHmacKey. */ - public UnaryCallSettings.Builder deleteHmacKeySettings() { - return deleteHmacKeySettings; - } - - /** Returns the builder for the settings used for calls to getHmacKey. */ - public UnaryCallSettings.Builder getHmacKeySettings() { - return getHmacKeySettings; - } - - /** Returns the builder for the settings used for calls to listHmacKeys. */ - public PagedCallSettings.Builder< - ListHmacKeysRequest, ListHmacKeysResponse, ListHmacKeysPagedResponse> - listHmacKeysSettings() { - return listHmacKeysSettings; - } - - /** Returns the builder for the settings used for calls to updateHmacKey. */ - public UnaryCallSettings.Builder - updateHmacKeySettings() { - return updateHmacKeySettings; - } - - @Override - public StorageStubSettings build() throws IOException { - return new StorageStubSettings(this); - } - } -} diff --git a/gapic-google-cloud-storage-v2/src/main/resources/com/google/storage/v2/gapic_metadata.json b/gapic-google-cloud-storage-v2/src/main/resources/com/google/storage/v2/gapic_metadata.json deleted file mode 100644 index 5d16f3131d..0000000000 --- a/gapic-google-cloud-storage-v2/src/main/resources/com/google/storage/v2/gapic_metadata.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "java", - "protoPackage": "google.storage.v2", - "libraryPackage": "com.google.storage.v2", - "services": { - "Storage": { - "clients": { - "grpc": { - "libraryClient": "StorageClient", - "rpcs": { - "ComposeObject": { - "methods": ["composeObject", "composeObjectCallable"] - }, - "CreateBucket": { - "methods": ["createBucket", "createBucket", "createBucket", "createBucketCallable"] - }, - "CreateHmacKey": { - "methods": ["createHmacKey", "createHmacKey", "createHmacKey", "createHmacKeyCallable"] - }, - "CreateNotification": { - "methods": ["createNotification", "createNotification", "createNotification", "createNotificationCallable"] - }, - "DeleteBucket": { - "methods": ["deleteBucket", "deleteBucket", "deleteBucket", "deleteBucketCallable"] - }, - "DeleteHmacKey": { - "methods": ["deleteHmacKey", "deleteHmacKey", "deleteHmacKey", "deleteHmacKeyCallable"] - }, - "DeleteNotification": { - "methods": ["deleteNotification", "deleteNotification", "deleteNotification", "deleteNotificationCallable"] - }, - "DeleteObject": { - "methods": ["deleteObject", "deleteObject", "deleteObject", "deleteObjectCallable"] - }, - "GetBucket": { - "methods": ["getBucket", "getBucket", "getBucket", "getBucketCallable"] - }, - "GetHmacKey": { - "methods": ["getHmacKey", "getHmacKey", "getHmacKey", "getHmacKeyCallable"] - }, - "GetIamPolicy": { - "methods": ["getIamPolicy", "getIamPolicy", "getIamPolicy", "getIamPolicyCallable"] - }, - "GetNotification": { - "methods": ["getNotification", "getNotification", "getNotification", "getNotificationCallable"] - }, - "GetObject": { - "methods": ["getObject", "getObject", "getObject", "getObjectCallable"] - }, - "GetServiceAccount": { - "methods": ["getServiceAccount", "getServiceAccount", "getServiceAccount", "getServiceAccountCallable"] - }, - "ListBuckets": { - "methods": ["listBuckets", "listBuckets", "listBuckets", "listBucketsPagedCallable", "listBucketsCallable"] - }, - "ListHmacKeys": { - "methods": ["listHmacKeys", "listHmacKeys", "listHmacKeys", "listHmacKeysPagedCallable", "listHmacKeysCallable"] - }, - "ListNotifications": { - "methods": ["listNotifications", "listNotifications", "listNotifications", "listNotificationsPagedCallable", "listNotificationsCallable"] - }, - "ListObjects": { - "methods": ["listObjects", "listObjects", "listObjects", "listObjectsPagedCallable", "listObjectsCallable"] - }, - "LockBucketRetentionPolicy": { - "methods": ["lockBucketRetentionPolicy", "lockBucketRetentionPolicy", "lockBucketRetentionPolicy", "lockBucketRetentionPolicyCallable"] - }, - "QueryWriteStatus": { - "methods": ["queryWriteStatus", "queryWriteStatus", "queryWriteStatusCallable"] - }, - "ReadObject": { - "methods": ["readObjectCallable"] - }, - "RewriteObject": { - "methods": ["rewriteObject", "rewriteObjectCallable"] - }, - "SetIamPolicy": { - "methods": ["setIamPolicy", "setIamPolicy", "setIamPolicy", "setIamPolicyCallable"] - }, - "StartResumableWrite": { - "methods": ["startResumableWrite", "startResumableWriteCallable"] - }, - "TestIamPermissions": { - "methods": ["testIamPermissions", "testIamPermissions", "testIamPermissions", "testIamPermissionsCallable"] - }, - "UpdateBucket": { - "methods": ["updateBucket", "updateBucket", "updateBucketCallable"] - }, - "UpdateHmacKey": { - "methods": ["updateHmacKey", "updateHmacKey", "updateHmacKeyCallable"] - }, - "UpdateObject": { - "methods": ["updateObject", "updateObject", "updateObjectCallable"] - }, - "WriteObject": { - "methods": ["writeObjectCallable"] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorage.java b/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorage.java deleted file mode 100644 index dbaae70d75..0000000000 --- a/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorage.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.storage.v2; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockStorage implements MockGrpcService { - private final MockStorageImpl serviceImpl; - - public MockStorage() { - serviceImpl = new MockStorageImpl(); - } - - @Override - public List getRequests() { - return serviceImpl.getRequests(); - } - - @Override - public void addResponse(AbstractMessage response) { - serviceImpl.addResponse(response); - } - - @Override - public void addException(Exception exception) { - serviceImpl.addException(exception); - } - - @Override - public ServerServiceDefinition getServiceDefinition() { - return serviceImpl.bindService(); - } - - @Override - public void reset() { - serviceImpl.reset(); - } -} diff --git a/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorageImpl.java b/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorageImpl.java deleted file mode 100644 index 7247ee766e..0000000000 --- a/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorageImpl.java +++ /dev/null @@ -1,683 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.storage.v2; - -import com.google.api.core.BetaApi; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Empty; -import com.google.storage.v2.StorageGrpc.StorageImplBase; -import io.grpc.stub.StreamObserver; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Queue; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockStorageImpl extends StorageImplBase { - private List requests; - private Queue responses; - - public MockStorageImpl() { - requests = new ArrayList<>(); - responses = new LinkedList<>(); - } - - public List getRequests() { - return requests; - } - - public void addResponse(AbstractMessage response) { - responses.add(response); - } - - public void setResponses(List responses) { - this.responses = new LinkedList(responses); - } - - public void addException(Exception exception) { - responses.add(exception); - } - - public void reset() { - requests = new ArrayList<>(); - responses = new LinkedList<>(); - } - - @Override - public void deleteBucket(DeleteBucketRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof Empty) { - requests.add(request); - responseObserver.onNext(((Empty) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method DeleteBucket, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getBucket(GetBucketRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof Bucket) { - requests.add(request); - responseObserver.onNext(((Bucket) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method GetBucket, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Bucket.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void createBucket(CreateBucketRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof Bucket) { - requests.add(request); - responseObserver.onNext(((Bucket) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method CreateBucket, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Bucket.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listBuckets( - ListBucketsRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof ListBucketsResponse) { - requests.add(request); - responseObserver.onNext(((ListBucketsResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method ListBuckets, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListBucketsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void lockBucketRetentionPolicy( - LockBucketRetentionPolicyRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof Bucket) { - requests.add(request); - responseObserver.onNext(((Bucket) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method LockBucketRetentionPolicy, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Bucket.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof Policy) { - requests.add(request); - responseObserver.onNext(((Policy) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Policy.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof Policy) { - requests.add(request); - responseObserver.onNext(((Policy) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Policy.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void testIamPermissions( - TestIamPermissionsRequest request, - StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof TestIamPermissionsResponse) { - requests.add(request); - responseObserver.onNext(((TestIamPermissionsResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - TestIamPermissionsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void updateBucket(UpdateBucketRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof Bucket) { - requests.add(request); - responseObserver.onNext(((Bucket) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method UpdateBucket, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Bucket.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deleteNotification( - DeleteNotificationRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof Empty) { - requests.add(request); - responseObserver.onNext(((Empty) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method DeleteNotification, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getNotification( - GetNotificationRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof Notification) { - requests.add(request); - responseObserver.onNext(((Notification) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method GetNotification, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Notification.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void createNotification( - CreateNotificationRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof Notification) { - requests.add(request); - responseObserver.onNext(((Notification) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method CreateNotification, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Notification.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listNotifications( - ListNotificationsRequest request, - StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof ListNotificationsResponse) { - requests.add(request); - responseObserver.onNext(((ListNotificationsResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method ListNotifications, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListNotificationsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void composeObject(ComposeObjectRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof Object) { - requests.add(request); - responseObserver.onNext(((Object) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method ComposeObject, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Object.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deleteObject(DeleteObjectRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof Empty) { - requests.add(request); - responseObserver.onNext(((Empty) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method DeleteObject, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getObject(GetObjectRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof Object) { - requests.add(request); - responseObserver.onNext(((Object) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method GetObject, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Object.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void readObject( - ReadObjectRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof ReadObjectResponse) { - requests.add(request); - responseObserver.onNext(((ReadObjectResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method ReadObject, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ReadObjectResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void updateObject(UpdateObjectRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof Object) { - requests.add(request); - responseObserver.onNext(((Object) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method UpdateObject, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Object.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public StreamObserver writeObject( - final StreamObserver responseObserver) { - StreamObserver requestObserver = - new StreamObserver() { - @Override - public void onNext(WriteObjectRequest value) { - requests.add(value); - final java.lang.Object response = responses.remove(); - if (response instanceof WriteObjectResponse) { - responseObserver.onNext(((WriteObjectResponse) response)); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method WriteObject, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - WriteObjectResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void onError(Throwable t) { - responseObserver.onError(t); - } - - @Override - public void onCompleted() { - responseObserver.onCompleted(); - } - }; - return requestObserver; - } - - @Override - public void listObjects( - ListObjectsRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof ListObjectsResponse) { - requests.add(request); - responseObserver.onNext(((ListObjectsResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method ListObjects, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListObjectsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void rewriteObject( - RewriteObjectRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof RewriteResponse) { - requests.add(request); - responseObserver.onNext(((RewriteResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method RewriteObject, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - RewriteResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void startResumableWrite( - StartResumableWriteRequest request, - StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof StartResumableWriteResponse) { - requests.add(request); - responseObserver.onNext(((StartResumableWriteResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method StartResumableWrite, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - StartResumableWriteResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void queryWriteStatus( - QueryWriteStatusRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof QueryWriteStatusResponse) { - requests.add(request); - responseObserver.onNext(((QueryWriteStatusResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method QueryWriteStatus, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - QueryWriteStatusResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getServiceAccount( - GetServiceAccountRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof ServiceAccount) { - requests.add(request); - responseObserver.onNext(((ServiceAccount) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method GetServiceAccount, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ServiceAccount.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void createHmacKey( - CreateHmacKeyRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof CreateHmacKeyResponse) { - requests.add(request); - responseObserver.onNext(((CreateHmacKeyResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method CreateHmacKey, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - CreateHmacKeyResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deleteHmacKey(DeleteHmacKeyRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof Empty) { - requests.add(request); - responseObserver.onNext(((Empty) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method DeleteHmacKey, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getHmacKey( - GetHmacKeyRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof HmacKeyMetadata) { - requests.add(request); - responseObserver.onNext(((HmacKeyMetadata) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method GetHmacKey, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - HmacKeyMetadata.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listHmacKeys( - ListHmacKeysRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof ListHmacKeysResponse) { - requests.add(request); - responseObserver.onNext(((ListHmacKeysResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method ListHmacKeys, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListHmacKeysResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void updateHmacKey( - UpdateHmacKeyRequest request, StreamObserver responseObserver) { - java.lang.Object response = responses.poll(); - if (response instanceof HmacKeyMetadata) { - requests.add(request); - responseObserver.onNext(((HmacKeyMetadata) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method UpdateHmacKey, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - HmacKeyMetadata.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/StorageClientTest.java b/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/StorageClientTest.java deleted file mode 100644 index 4c5c1d749d..0000000000 --- a/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/StorageClientTest.java +++ /dev/null @@ -1,2580 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.storage.v2; - -import static com.google.storage.v2.StorageClient.ListBucketsPagedResponse; -import static com.google.storage.v2.StorageClient.ListHmacKeysPagedResponse; -import static com.google.storage.v2.StorageClient.ListNotificationsPagedResponse; -import static com.google.storage.v2.StorageClient.ListObjectsPagedResponse; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.testing.LocalChannelProvider; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.api.gax.grpc.testing.MockServiceHelper; -import com.google.api.gax.grpc.testing.MockStreamObserver; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiStreamObserver; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.resourcenames.ResourceName; -import com.google.common.collect.Lists; -import com.google.iam.v1.Binding; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.ByteString; -import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import com.google.protobuf.Timestamp; -import io.grpc.StatusRuntimeException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.UUID; -import java.util.concurrent.ExecutionException; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class StorageClientTest { - private static MockServiceHelper mockServiceHelper; - private static MockStorage mockStorage; - private LocalChannelProvider channelProvider; - private StorageClient client; - - @BeforeClass - public static void startStaticServer() { - mockStorage = new MockStorage(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockStorage)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - StorageSettings settings = - StorageSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = StorageClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void deleteBucketTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockStorage.addResponse(expectedResponse); - - BucketName name = BucketName.of("[PROJECT]", "[BUCKET]"); - - client.deleteBucket(name); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteBucketRequest actualRequest = ((DeleteBucketRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteBucketExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - BucketName name = BucketName.of("[PROJECT]", "[BUCKET]"); - client.deleteBucket(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteBucketTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockStorage.addResponse(expectedResponse); - - String name = "name3373707"; - - client.deleteBucket(name); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteBucketRequest actualRequest = ((DeleteBucketRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteBucketExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String name = "name3373707"; - client.deleteBucket(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getBucketTest() throws Exception { - Bucket expectedResponse = - Bucket.newBuilder() - .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()) - .setBucketId("bucketId-1603305307") - .setProject(ProjectName.of("[PROJECT]").toString()) - .setMetageneration(1048558813) - .setLocation("location1901043637") - .setLocationType("locationType-58277745") - .setStorageClass("storageClass871353277") - .setRpo("rpo113137") - .addAllAcl(new ArrayList()) - .addAllDefaultObjectAcl(new ArrayList()) - .setLifecycle(Bucket.Lifecycle.newBuilder().build()) - .setCreateTime(Timestamp.newBuilder().build()) - .addAllCors(new ArrayList()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setDefaultEventBasedHold(true) - .putAllLabels(new HashMap()) - .setWebsite(Bucket.Website.newBuilder().build()) - .setVersioning(Bucket.Versioning.newBuilder().build()) - .setLogging(Bucket.Logging.newBuilder().build()) - .setOwner(Owner.newBuilder().build()) - .setEncryption(Bucket.Encryption.newBuilder().build()) - .setBilling(Bucket.Billing.newBuilder().build()) - .setRetentionPolicy(Bucket.RetentionPolicy.newBuilder().build()) - .setIamConfig(Bucket.IamConfig.newBuilder().build()) - .setSatisfiesPzs(true) - .setCustomPlacementConfig(Bucket.CustomPlacementConfig.newBuilder().build()) - .build(); - mockStorage.addResponse(expectedResponse); - - BucketName name = BucketName.of("[PROJECT]", "[BUCKET]"); - - Bucket actualResponse = client.getBucket(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBucketRequest actualRequest = ((GetBucketRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getBucketExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - BucketName name = BucketName.of("[PROJECT]", "[BUCKET]"); - client.getBucket(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getBucketTest2() throws Exception { - Bucket expectedResponse = - Bucket.newBuilder() - .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()) - .setBucketId("bucketId-1603305307") - .setProject(ProjectName.of("[PROJECT]").toString()) - .setMetageneration(1048558813) - .setLocation("location1901043637") - .setLocationType("locationType-58277745") - .setStorageClass("storageClass871353277") - .setRpo("rpo113137") - .addAllAcl(new ArrayList()) - .addAllDefaultObjectAcl(new ArrayList()) - .setLifecycle(Bucket.Lifecycle.newBuilder().build()) - .setCreateTime(Timestamp.newBuilder().build()) - .addAllCors(new ArrayList()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setDefaultEventBasedHold(true) - .putAllLabels(new HashMap()) - .setWebsite(Bucket.Website.newBuilder().build()) - .setVersioning(Bucket.Versioning.newBuilder().build()) - .setLogging(Bucket.Logging.newBuilder().build()) - .setOwner(Owner.newBuilder().build()) - .setEncryption(Bucket.Encryption.newBuilder().build()) - .setBilling(Bucket.Billing.newBuilder().build()) - .setRetentionPolicy(Bucket.RetentionPolicy.newBuilder().build()) - .setIamConfig(Bucket.IamConfig.newBuilder().build()) - .setSatisfiesPzs(true) - .setCustomPlacementConfig(Bucket.CustomPlacementConfig.newBuilder().build()) - .build(); - mockStorage.addResponse(expectedResponse); - - String name = "name3373707"; - - Bucket actualResponse = client.getBucket(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBucketRequest actualRequest = ((GetBucketRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getBucketExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String name = "name3373707"; - client.getBucket(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBucketTest() throws Exception { - Bucket expectedResponse = - Bucket.newBuilder() - .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()) - .setBucketId("bucketId-1603305307") - .setProject(ProjectName.of("[PROJECT]").toString()) - .setMetageneration(1048558813) - .setLocation("location1901043637") - .setLocationType("locationType-58277745") - .setStorageClass("storageClass871353277") - .setRpo("rpo113137") - .addAllAcl(new ArrayList()) - .addAllDefaultObjectAcl(new ArrayList()) - .setLifecycle(Bucket.Lifecycle.newBuilder().build()) - .setCreateTime(Timestamp.newBuilder().build()) - .addAllCors(new ArrayList()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setDefaultEventBasedHold(true) - .putAllLabels(new HashMap()) - .setWebsite(Bucket.Website.newBuilder().build()) - .setVersioning(Bucket.Versioning.newBuilder().build()) - .setLogging(Bucket.Logging.newBuilder().build()) - .setOwner(Owner.newBuilder().build()) - .setEncryption(Bucket.Encryption.newBuilder().build()) - .setBilling(Bucket.Billing.newBuilder().build()) - .setRetentionPolicy(Bucket.RetentionPolicy.newBuilder().build()) - .setIamConfig(Bucket.IamConfig.newBuilder().build()) - .setSatisfiesPzs(true) - .setCustomPlacementConfig(Bucket.CustomPlacementConfig.newBuilder().build()) - .build(); - mockStorage.addResponse(expectedResponse); - - ProjectName parent = ProjectName.of("[PROJECT]"); - Bucket bucket = Bucket.newBuilder().build(); - String bucketId = "bucketId-1603305307"; - - Bucket actualResponse = client.createBucket(parent, bucket, bucketId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBucketRequest actualRequest = ((CreateBucketRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(bucket, actualRequest.getBucket()); - Assert.assertEquals(bucketId, actualRequest.getBucketId()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBucketExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - ProjectName parent = ProjectName.of("[PROJECT]"); - Bucket bucket = Bucket.newBuilder().build(); - String bucketId = "bucketId-1603305307"; - client.createBucket(parent, bucket, bucketId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBucketTest2() throws Exception { - Bucket expectedResponse = - Bucket.newBuilder() - .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()) - .setBucketId("bucketId-1603305307") - .setProject(ProjectName.of("[PROJECT]").toString()) - .setMetageneration(1048558813) - .setLocation("location1901043637") - .setLocationType("locationType-58277745") - .setStorageClass("storageClass871353277") - .setRpo("rpo113137") - .addAllAcl(new ArrayList()) - .addAllDefaultObjectAcl(new ArrayList()) - .setLifecycle(Bucket.Lifecycle.newBuilder().build()) - .setCreateTime(Timestamp.newBuilder().build()) - .addAllCors(new ArrayList()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setDefaultEventBasedHold(true) - .putAllLabels(new HashMap()) - .setWebsite(Bucket.Website.newBuilder().build()) - .setVersioning(Bucket.Versioning.newBuilder().build()) - .setLogging(Bucket.Logging.newBuilder().build()) - .setOwner(Owner.newBuilder().build()) - .setEncryption(Bucket.Encryption.newBuilder().build()) - .setBilling(Bucket.Billing.newBuilder().build()) - .setRetentionPolicy(Bucket.RetentionPolicy.newBuilder().build()) - .setIamConfig(Bucket.IamConfig.newBuilder().build()) - .setSatisfiesPzs(true) - .setCustomPlacementConfig(Bucket.CustomPlacementConfig.newBuilder().build()) - .build(); - mockStorage.addResponse(expectedResponse); - - String parent = "parent-995424086"; - Bucket bucket = Bucket.newBuilder().build(); - String bucketId = "bucketId-1603305307"; - - Bucket actualResponse = client.createBucket(parent, bucket, bucketId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBucketRequest actualRequest = ((CreateBucketRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertEquals(bucket, actualRequest.getBucket()); - Assert.assertEquals(bucketId, actualRequest.getBucketId()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBucketExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String parent = "parent-995424086"; - Bucket bucket = Bucket.newBuilder().build(); - String bucketId = "bucketId-1603305307"; - client.createBucket(parent, bucket, bucketId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listBucketsTest() throws Exception { - Bucket responsesElement = Bucket.newBuilder().build(); - ListBucketsResponse expectedResponse = - ListBucketsResponse.newBuilder() - .setNextPageToken("") - .addAllBuckets(Arrays.asList(responsesElement)) - .build(); - mockStorage.addResponse(expectedResponse); - - ProjectName parent = ProjectName.of("[PROJECT]"); - - ListBucketsPagedResponse pagedListResponse = client.listBuckets(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBucketsList().get(0), resources.get(0)); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBucketsRequest actualRequest = ((ListBucketsRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listBucketsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - ProjectName parent = ProjectName.of("[PROJECT]"); - client.listBuckets(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listBucketsTest2() throws Exception { - Bucket responsesElement = Bucket.newBuilder().build(); - ListBucketsResponse expectedResponse = - ListBucketsResponse.newBuilder() - .setNextPageToken("") - .addAllBuckets(Arrays.asList(responsesElement)) - .build(); - mockStorage.addResponse(expectedResponse); - - String parent = "parent-995424086"; - - ListBucketsPagedResponse pagedListResponse = client.listBuckets(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBucketsList().get(0), resources.get(0)); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBucketsRequest actualRequest = ((ListBucketsRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listBucketsExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String parent = "parent-995424086"; - client.listBuckets(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void lockBucketRetentionPolicyTest() throws Exception { - Bucket expectedResponse = - Bucket.newBuilder() - .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()) - .setBucketId("bucketId-1603305307") - .setProject(ProjectName.of("[PROJECT]").toString()) - .setMetageneration(1048558813) - .setLocation("location1901043637") - .setLocationType("locationType-58277745") - .setStorageClass("storageClass871353277") - .setRpo("rpo113137") - .addAllAcl(new ArrayList()) - .addAllDefaultObjectAcl(new ArrayList()) - .setLifecycle(Bucket.Lifecycle.newBuilder().build()) - .setCreateTime(Timestamp.newBuilder().build()) - .addAllCors(new ArrayList()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setDefaultEventBasedHold(true) - .putAllLabels(new HashMap()) - .setWebsite(Bucket.Website.newBuilder().build()) - .setVersioning(Bucket.Versioning.newBuilder().build()) - .setLogging(Bucket.Logging.newBuilder().build()) - .setOwner(Owner.newBuilder().build()) - .setEncryption(Bucket.Encryption.newBuilder().build()) - .setBilling(Bucket.Billing.newBuilder().build()) - .setRetentionPolicy(Bucket.RetentionPolicy.newBuilder().build()) - .setIamConfig(Bucket.IamConfig.newBuilder().build()) - .setSatisfiesPzs(true) - .setCustomPlacementConfig(Bucket.CustomPlacementConfig.newBuilder().build()) - .build(); - mockStorage.addResponse(expectedResponse); - - BucketName bucket = BucketName.of("[PROJECT]", "[BUCKET]"); - - Bucket actualResponse = client.lockBucketRetentionPolicy(bucket); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - LockBucketRetentionPolicyRequest actualRequest = - ((LockBucketRetentionPolicyRequest) actualRequests.get(0)); - - Assert.assertEquals(bucket.toString(), actualRequest.getBucket()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void lockBucketRetentionPolicyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - BucketName bucket = BucketName.of("[PROJECT]", "[BUCKET]"); - client.lockBucketRetentionPolicy(bucket); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void lockBucketRetentionPolicyTest2() throws Exception { - Bucket expectedResponse = - Bucket.newBuilder() - .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()) - .setBucketId("bucketId-1603305307") - .setProject(ProjectName.of("[PROJECT]").toString()) - .setMetageneration(1048558813) - .setLocation("location1901043637") - .setLocationType("locationType-58277745") - .setStorageClass("storageClass871353277") - .setRpo("rpo113137") - .addAllAcl(new ArrayList()) - .addAllDefaultObjectAcl(new ArrayList()) - .setLifecycle(Bucket.Lifecycle.newBuilder().build()) - .setCreateTime(Timestamp.newBuilder().build()) - .addAllCors(new ArrayList()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setDefaultEventBasedHold(true) - .putAllLabels(new HashMap()) - .setWebsite(Bucket.Website.newBuilder().build()) - .setVersioning(Bucket.Versioning.newBuilder().build()) - .setLogging(Bucket.Logging.newBuilder().build()) - .setOwner(Owner.newBuilder().build()) - .setEncryption(Bucket.Encryption.newBuilder().build()) - .setBilling(Bucket.Billing.newBuilder().build()) - .setRetentionPolicy(Bucket.RetentionPolicy.newBuilder().build()) - .setIamConfig(Bucket.IamConfig.newBuilder().build()) - .setSatisfiesPzs(true) - .setCustomPlacementConfig(Bucket.CustomPlacementConfig.newBuilder().build()) - .build(); - mockStorage.addResponse(expectedResponse); - - String bucket = "bucket-1378203158"; - - Bucket actualResponse = client.lockBucketRetentionPolicy(bucket); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - LockBucketRetentionPolicyRequest actualRequest = - ((LockBucketRetentionPolicyRequest) actualRequests.get(0)); - - Assert.assertEquals(bucket, actualRequest.getBucket()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void lockBucketRetentionPolicyExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String bucket = "bucket-1378203158"; - client.lockBucketRetentionPolicy(bucket); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockStorage.addResponse(expectedResponse); - - ResourceName resource = - CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"); - - Policy actualResponse = client.getIamPolicy(resource); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); - - Assert.assertEquals(resource.toString(), actualRequest.getResource()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getIamPolicyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - ResourceName resource = - CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"); - client.getIamPolicy(resource); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getIamPolicyTest2() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockStorage.addResponse(expectedResponse); - - String resource = "resource-341064690"; - - Policy actualResponse = client.getIamPolicy(resource); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); - - Assert.assertEquals(resource, actualRequest.getResource()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getIamPolicyExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String resource = "resource-341064690"; - client.getIamPolicy(resource); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void setIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockStorage.addResponse(expectedResponse); - - ResourceName resource = - CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"); - Policy policy = Policy.newBuilder().build(); - - Policy actualResponse = client.setIamPolicy(resource, policy); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); - - Assert.assertEquals(resource.toString(), actualRequest.getResource()); - Assert.assertEquals(policy, actualRequest.getPolicy()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void setIamPolicyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - ResourceName resource = - CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"); - Policy policy = Policy.newBuilder().build(); - client.setIamPolicy(resource, policy); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void setIamPolicyTest2() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockStorage.addResponse(expectedResponse); - - String resource = "resource-341064690"; - Policy policy = Policy.newBuilder().build(); - - Policy actualResponse = client.setIamPolicy(resource, policy); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); - - Assert.assertEquals(resource, actualRequest.getResource()); - Assert.assertEquals(policy, actualRequest.getPolicy()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void setIamPolicyExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String resource = "resource-341064690"; - Policy policy = Policy.newBuilder().build(); - client.setIamPolicy(resource, policy); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void testIamPermissionsTest() throws Exception { - TestIamPermissionsResponse expectedResponse = - TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); - mockStorage.addResponse(expectedResponse); - - ResourceName resource = - CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"); - List permissions = new ArrayList<>(); - - TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); - - Assert.assertEquals(resource.toString(), actualRequest.getResource()); - Assert.assertEquals(permissions, actualRequest.getPermissionsList()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void testIamPermissionsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - ResourceName resource = - CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"); - List permissions = new ArrayList<>(); - client.testIamPermissions(resource, permissions); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void testIamPermissionsTest2() throws Exception { - TestIamPermissionsResponse expectedResponse = - TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); - mockStorage.addResponse(expectedResponse); - - String resource = "resource-341064690"; - List permissions = new ArrayList<>(); - - TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); - - Assert.assertEquals(resource, actualRequest.getResource()); - Assert.assertEquals(permissions, actualRequest.getPermissionsList()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void testIamPermissionsExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String resource = "resource-341064690"; - List permissions = new ArrayList<>(); - client.testIamPermissions(resource, permissions); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateBucketTest() throws Exception { - Bucket expectedResponse = - Bucket.newBuilder() - .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()) - .setBucketId("bucketId-1603305307") - .setProject(ProjectName.of("[PROJECT]").toString()) - .setMetageneration(1048558813) - .setLocation("location1901043637") - .setLocationType("locationType-58277745") - .setStorageClass("storageClass871353277") - .setRpo("rpo113137") - .addAllAcl(new ArrayList()) - .addAllDefaultObjectAcl(new ArrayList()) - .setLifecycle(Bucket.Lifecycle.newBuilder().build()) - .setCreateTime(Timestamp.newBuilder().build()) - .addAllCors(new ArrayList()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setDefaultEventBasedHold(true) - .putAllLabels(new HashMap()) - .setWebsite(Bucket.Website.newBuilder().build()) - .setVersioning(Bucket.Versioning.newBuilder().build()) - .setLogging(Bucket.Logging.newBuilder().build()) - .setOwner(Owner.newBuilder().build()) - .setEncryption(Bucket.Encryption.newBuilder().build()) - .setBilling(Bucket.Billing.newBuilder().build()) - .setRetentionPolicy(Bucket.RetentionPolicy.newBuilder().build()) - .setIamConfig(Bucket.IamConfig.newBuilder().build()) - .setSatisfiesPzs(true) - .setCustomPlacementConfig(Bucket.CustomPlacementConfig.newBuilder().build()) - .build(); - mockStorage.addResponse(expectedResponse); - - Bucket bucket = Bucket.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - - Bucket actualResponse = client.updateBucket(bucket, updateMask); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateBucketRequest actualRequest = ((UpdateBucketRequest) actualRequests.get(0)); - - Assert.assertEquals(bucket, actualRequest.getBucket()); - Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void updateBucketExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - Bucket bucket = Bucket.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateBucket(bucket, updateMask); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteNotificationTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockStorage.addResponse(expectedResponse); - - NotificationName name = NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]"); - - client.deleteNotification(name); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteNotificationRequest actualRequest = ((DeleteNotificationRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteNotificationExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - NotificationName name = NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]"); - client.deleteNotification(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteNotificationTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockStorage.addResponse(expectedResponse); - - String name = "name3373707"; - - client.deleteNotification(name); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteNotificationRequest actualRequest = ((DeleteNotificationRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteNotificationExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String name = "name3373707"; - client.deleteNotification(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getNotificationTest() throws Exception { - Notification expectedResponse = - Notification.newBuilder() - .setName(NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]").toString()) - .setTopic("topic110546223") - .addAllEventTypes(new ArrayList()) - .putAllCustomAttributes(new HashMap()) - .setObjectNamePrefix("objectNamePrefix-1978236516") - .setPayloadFormat("payloadFormat-2140609755") - .build(); - mockStorage.addResponse(expectedResponse); - - BucketName name = BucketName.of("[PROJECT]", "[BUCKET]"); - - Notification actualResponse = client.getNotification(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetNotificationRequest actualRequest = ((GetNotificationRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getNotificationExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - BucketName name = BucketName.of("[PROJECT]", "[BUCKET]"); - client.getNotification(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getNotificationTest2() throws Exception { - Notification expectedResponse = - Notification.newBuilder() - .setName(NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]").toString()) - .setTopic("topic110546223") - .addAllEventTypes(new ArrayList()) - .putAllCustomAttributes(new HashMap()) - .setObjectNamePrefix("objectNamePrefix-1978236516") - .setPayloadFormat("payloadFormat-2140609755") - .build(); - mockStorage.addResponse(expectedResponse); - - String name = "name3373707"; - - Notification actualResponse = client.getNotification(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetNotificationRequest actualRequest = ((GetNotificationRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getNotificationExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String name = "name3373707"; - client.getNotification(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createNotificationTest() throws Exception { - Notification expectedResponse = - Notification.newBuilder() - .setName(NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]").toString()) - .setTopic("topic110546223") - .addAllEventTypes(new ArrayList()) - .putAllCustomAttributes(new HashMap()) - .setObjectNamePrefix("objectNamePrefix-1978236516") - .setPayloadFormat("payloadFormat-2140609755") - .build(); - mockStorage.addResponse(expectedResponse); - - ProjectName parent = ProjectName.of("[PROJECT]"); - Notification notification = Notification.newBuilder().build(); - - Notification actualResponse = client.createNotification(parent, notification); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateNotificationRequest actualRequest = ((CreateNotificationRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(notification, actualRequest.getNotification()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createNotificationExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - ProjectName parent = ProjectName.of("[PROJECT]"); - Notification notification = Notification.newBuilder().build(); - client.createNotification(parent, notification); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createNotificationTest2() throws Exception { - Notification expectedResponse = - Notification.newBuilder() - .setName(NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]").toString()) - .setTopic("topic110546223") - .addAllEventTypes(new ArrayList()) - .putAllCustomAttributes(new HashMap()) - .setObjectNamePrefix("objectNamePrefix-1978236516") - .setPayloadFormat("payloadFormat-2140609755") - .build(); - mockStorage.addResponse(expectedResponse); - - String parent = "parent-995424086"; - Notification notification = Notification.newBuilder().build(); - - Notification actualResponse = client.createNotification(parent, notification); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateNotificationRequest actualRequest = ((CreateNotificationRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertEquals(notification, actualRequest.getNotification()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createNotificationExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String parent = "parent-995424086"; - Notification notification = Notification.newBuilder().build(); - client.createNotification(parent, notification); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listNotificationsTest() throws Exception { - Notification responsesElement = Notification.newBuilder().build(); - ListNotificationsResponse expectedResponse = - ListNotificationsResponse.newBuilder() - .setNextPageToken("") - .addAllNotifications(Arrays.asList(responsesElement)) - .build(); - mockStorage.addResponse(expectedResponse); - - ProjectName parent = ProjectName.of("[PROJECT]"); - - ListNotificationsPagedResponse pagedListResponse = client.listNotifications(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getNotificationsList().get(0), resources.get(0)); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListNotificationsRequest actualRequest = ((ListNotificationsRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listNotificationsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - ProjectName parent = ProjectName.of("[PROJECT]"); - client.listNotifications(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listNotificationsTest2() throws Exception { - Notification responsesElement = Notification.newBuilder().build(); - ListNotificationsResponse expectedResponse = - ListNotificationsResponse.newBuilder() - .setNextPageToken("") - .addAllNotifications(Arrays.asList(responsesElement)) - .build(); - mockStorage.addResponse(expectedResponse); - - String parent = "parent-995424086"; - - ListNotificationsPagedResponse pagedListResponse = client.listNotifications(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getNotificationsList().get(0), resources.get(0)); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListNotificationsRequest actualRequest = ((ListNotificationsRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listNotificationsExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String parent = "parent-995424086"; - client.listNotifications(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void composeObjectTest() throws Exception { - Object expectedResponse = - Object.newBuilder() - .setName("name3373707") - .setBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString()) - .setGeneration(305703192) - .setMetageneration(1048558813) - .setStorageClass("storageClass871353277") - .setSize(3530753) - .setContentEncoding("contentEncoding-160088852") - .setContentDisposition("contentDisposition1034341758") - .setCacheControl("cacheControl-1336592517") - .addAllAcl(new ArrayList()) - .setContentLanguage("contentLanguage810066673") - .setDeleteTime(Timestamp.newBuilder().build()) - .setContentType("contentType-389131437") - .setCreateTime(Timestamp.newBuilder().build()) - .setComponentCount(-485073075) - .setChecksums(ObjectChecksums.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setKmsKey( - CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") - .toString()) - .setUpdateStorageClassTime(Timestamp.newBuilder().build()) - .setTemporaryHold(true) - .setRetentionExpireTime(Timestamp.newBuilder().build()) - .putAllMetadata(new HashMap()) - .setEventBasedHold(true) - .setOwner(Owner.newBuilder().build()) - .setCustomerEncryption(CustomerEncryption.newBuilder().build()) - .setCustomTime(Timestamp.newBuilder().build()) - .build(); - mockStorage.addResponse(expectedResponse); - - ComposeObjectRequest request = - ComposeObjectRequest.newBuilder() - .setDestination(Object.newBuilder().build()) - .addAllSourceObjects(new ArrayList()) - .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0)) - .setIfGenerationMatch(-1086241088) - .setIfMetagenerationMatch(1043427781) - .setKmsKey( - CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") - .toString()) - .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) - .build(); - - Object actualResponse = client.composeObject(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ComposeObjectRequest actualRequest = ((ComposeObjectRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getDestination(), actualRequest.getDestination()); - Assert.assertEquals(request.getSourceObjectsList(), actualRequest.getSourceObjectsList()); - Assert.assertEquals( - request.getDestinationPredefinedAcl(), actualRequest.getDestinationPredefinedAcl()); - Assert.assertEquals(request.getIfGenerationMatch(), actualRequest.getIfGenerationMatch()); - Assert.assertEquals( - request.getIfMetagenerationMatch(), actualRequest.getIfMetagenerationMatch()); - Assert.assertEquals(request.getKmsKey(), actualRequest.getKmsKey()); - Assert.assertEquals( - request.getCommonObjectRequestParams(), actualRequest.getCommonObjectRequestParams()); - Assert.assertEquals(request.getCommonRequestParams(), actualRequest.getCommonRequestParams()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void composeObjectExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - ComposeObjectRequest request = - ComposeObjectRequest.newBuilder() - .setDestination(Object.newBuilder().build()) - .addAllSourceObjects(new ArrayList()) - .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0)) - .setIfGenerationMatch(-1086241088) - .setIfMetagenerationMatch(1043427781) - .setKmsKey( - CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") - .toString()) - .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) - .build(); - client.composeObject(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteObjectTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockStorage.addResponse(expectedResponse); - - String bucket = "bucket-1378203158"; - String object = "object-1023368385"; - - client.deleteObject(bucket, object); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteObjectRequest actualRequest = ((DeleteObjectRequest) actualRequests.get(0)); - - Assert.assertEquals(bucket, actualRequest.getBucket()); - Assert.assertEquals(object, actualRequest.getObject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteObjectExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String bucket = "bucket-1378203158"; - String object = "object-1023368385"; - client.deleteObject(bucket, object); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteObjectTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockStorage.addResponse(expectedResponse); - - String bucket = "bucket-1378203158"; - String object = "object-1023368385"; - long generation = 305703192; - - client.deleteObject(bucket, object, generation); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteObjectRequest actualRequest = ((DeleteObjectRequest) actualRequests.get(0)); - - Assert.assertEquals(bucket, actualRequest.getBucket()); - Assert.assertEquals(object, actualRequest.getObject()); - Assert.assertEquals(generation, actualRequest.getGeneration()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteObjectExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String bucket = "bucket-1378203158"; - String object = "object-1023368385"; - long generation = 305703192; - client.deleteObject(bucket, object, generation); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getObjectTest() throws Exception { - Object expectedResponse = - Object.newBuilder() - .setName("name3373707") - .setBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString()) - .setGeneration(305703192) - .setMetageneration(1048558813) - .setStorageClass("storageClass871353277") - .setSize(3530753) - .setContentEncoding("contentEncoding-160088852") - .setContentDisposition("contentDisposition1034341758") - .setCacheControl("cacheControl-1336592517") - .addAllAcl(new ArrayList()) - .setContentLanguage("contentLanguage810066673") - .setDeleteTime(Timestamp.newBuilder().build()) - .setContentType("contentType-389131437") - .setCreateTime(Timestamp.newBuilder().build()) - .setComponentCount(-485073075) - .setChecksums(ObjectChecksums.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setKmsKey( - CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") - .toString()) - .setUpdateStorageClassTime(Timestamp.newBuilder().build()) - .setTemporaryHold(true) - .setRetentionExpireTime(Timestamp.newBuilder().build()) - .putAllMetadata(new HashMap()) - .setEventBasedHold(true) - .setOwner(Owner.newBuilder().build()) - .setCustomerEncryption(CustomerEncryption.newBuilder().build()) - .setCustomTime(Timestamp.newBuilder().build()) - .build(); - mockStorage.addResponse(expectedResponse); - - String bucket = "bucket-1378203158"; - String object = "object-1023368385"; - - Object actualResponse = client.getObject(bucket, object); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetObjectRequest actualRequest = ((GetObjectRequest) actualRequests.get(0)); - - Assert.assertEquals(bucket, actualRequest.getBucket()); - Assert.assertEquals(object, actualRequest.getObject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getObjectExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String bucket = "bucket-1378203158"; - String object = "object-1023368385"; - client.getObject(bucket, object); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getObjectTest2() throws Exception { - Object expectedResponse = - Object.newBuilder() - .setName("name3373707") - .setBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString()) - .setGeneration(305703192) - .setMetageneration(1048558813) - .setStorageClass("storageClass871353277") - .setSize(3530753) - .setContentEncoding("contentEncoding-160088852") - .setContentDisposition("contentDisposition1034341758") - .setCacheControl("cacheControl-1336592517") - .addAllAcl(new ArrayList()) - .setContentLanguage("contentLanguage810066673") - .setDeleteTime(Timestamp.newBuilder().build()) - .setContentType("contentType-389131437") - .setCreateTime(Timestamp.newBuilder().build()) - .setComponentCount(-485073075) - .setChecksums(ObjectChecksums.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setKmsKey( - CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") - .toString()) - .setUpdateStorageClassTime(Timestamp.newBuilder().build()) - .setTemporaryHold(true) - .setRetentionExpireTime(Timestamp.newBuilder().build()) - .putAllMetadata(new HashMap()) - .setEventBasedHold(true) - .setOwner(Owner.newBuilder().build()) - .setCustomerEncryption(CustomerEncryption.newBuilder().build()) - .setCustomTime(Timestamp.newBuilder().build()) - .build(); - mockStorage.addResponse(expectedResponse); - - String bucket = "bucket-1378203158"; - String object = "object-1023368385"; - long generation = 305703192; - - Object actualResponse = client.getObject(bucket, object, generation); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetObjectRequest actualRequest = ((GetObjectRequest) actualRequests.get(0)); - - Assert.assertEquals(bucket, actualRequest.getBucket()); - Assert.assertEquals(object, actualRequest.getObject()); - Assert.assertEquals(generation, actualRequest.getGeneration()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getObjectExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String bucket = "bucket-1378203158"; - String object = "object-1023368385"; - long generation = 305703192; - client.getObject(bucket, object, generation); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void readObjectTest() throws Exception { - ReadObjectResponse expectedResponse = - ReadObjectResponse.newBuilder() - .setChecksummedData(ChecksummedData.newBuilder().build()) - .setObjectChecksums(ObjectChecksums.newBuilder().build()) - .setContentRange(ContentRange.newBuilder().build()) - .setMetadata(Object.newBuilder().build()) - .build(); - mockStorage.addResponse(expectedResponse); - ReadObjectRequest request = - ReadObjectRequest.newBuilder() - .setBucket("bucket-1378203158") - .setObject("object-1023368385") - .setGeneration(305703192) - .setReadOffset(-715377828) - .setReadLimit(-164298798) - .setIfGenerationMatch(-1086241088) - .setIfGenerationNotMatch(1475720404) - .setIfMetagenerationMatch(1043427781) - .setIfMetagenerationNotMatch(1025430873) - .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) - .setReadMask(FieldMask.newBuilder().build()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ServerStreamingCallable callable = - client.readObjectCallable(); - callable.serverStreamingCall(request, responseObserver); - - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); - } - - @Test - public void readObjectExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - ReadObjectRequest request = - ReadObjectRequest.newBuilder() - .setBucket("bucket-1378203158") - .setObject("object-1023368385") - .setGeneration(305703192) - .setReadOffset(-715377828) - .setReadLimit(-164298798) - .setIfGenerationMatch(-1086241088) - .setIfGenerationNotMatch(1475720404) - .setIfMetagenerationMatch(1043427781) - .setIfMetagenerationNotMatch(1025430873) - .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) - .setReadMask(FieldMask.newBuilder().build()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ServerStreamingCallable callable = - client.readObjectCallable(); - callable.serverStreamingCall(request, responseObserver); - - try { - List actualResponses = responseObserver.future().get(); - Assert.fail("No exception thrown"); - } catch (ExecutionException e) { - Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - public void updateObjectTest() throws Exception { - Object expectedResponse = - Object.newBuilder() - .setName("name3373707") - .setBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString()) - .setGeneration(305703192) - .setMetageneration(1048558813) - .setStorageClass("storageClass871353277") - .setSize(3530753) - .setContentEncoding("contentEncoding-160088852") - .setContentDisposition("contentDisposition1034341758") - .setCacheControl("cacheControl-1336592517") - .addAllAcl(new ArrayList()) - .setContentLanguage("contentLanguage810066673") - .setDeleteTime(Timestamp.newBuilder().build()) - .setContentType("contentType-389131437") - .setCreateTime(Timestamp.newBuilder().build()) - .setComponentCount(-485073075) - .setChecksums(ObjectChecksums.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setKmsKey( - CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") - .toString()) - .setUpdateStorageClassTime(Timestamp.newBuilder().build()) - .setTemporaryHold(true) - .setRetentionExpireTime(Timestamp.newBuilder().build()) - .putAllMetadata(new HashMap()) - .setEventBasedHold(true) - .setOwner(Owner.newBuilder().build()) - .setCustomerEncryption(CustomerEncryption.newBuilder().build()) - .setCustomTime(Timestamp.newBuilder().build()) - .build(); - mockStorage.addResponse(expectedResponse); - - Object object = Object.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - - Object actualResponse = client.updateObject(object, updateMask); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateObjectRequest actualRequest = ((UpdateObjectRequest) actualRequests.get(0)); - - Assert.assertEquals(object, actualRequest.getObject()); - Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void updateObjectExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - Object object = Object.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateObject(object, updateMask); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void writeObjectTest() throws Exception { - WriteObjectResponse expectedResponse = WriteObjectResponse.newBuilder().build(); - mockStorage.addResponse(expectedResponse); - WriteObjectRequest request = - WriteObjectRequest.newBuilder() - .setWriteOffset(-1559543565) - .setObjectChecksums(ObjectChecksums.newBuilder().build()) - .setFinishWrite(true) - .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ClientStreamingCallable callable = - client.writeObjectCallable(); - ApiStreamObserver requestObserver = - callable.clientStreamingCall(responseObserver); - - requestObserver.onNext(request); - requestObserver.onCompleted(); - - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); - } - - @Test - public void writeObjectExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - WriteObjectRequest request = - WriteObjectRequest.newBuilder() - .setWriteOffset(-1559543565) - .setObjectChecksums(ObjectChecksums.newBuilder().build()) - .setFinishWrite(true) - .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ClientStreamingCallable callable = - client.writeObjectCallable(); - ApiStreamObserver requestObserver = - callable.clientStreamingCall(responseObserver); - - requestObserver.onNext(request); - - try { - List actualResponses = responseObserver.future().get(); - Assert.fail("No exception thrown"); - } catch (ExecutionException e) { - Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - public void listObjectsTest() throws Exception { - Object responsesElement = Object.newBuilder().build(); - ListObjectsResponse expectedResponse = - ListObjectsResponse.newBuilder() - .setNextPageToken("") - .addAllObjects(Arrays.asList(responsesElement)) - .build(); - mockStorage.addResponse(expectedResponse); - - ProjectName parent = ProjectName.of("[PROJECT]"); - - ListObjectsPagedResponse pagedListResponse = client.listObjects(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getObjectsList().get(0), resources.get(0)); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListObjectsRequest actualRequest = ((ListObjectsRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listObjectsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - ProjectName parent = ProjectName.of("[PROJECT]"); - client.listObjects(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listObjectsTest2() throws Exception { - Object responsesElement = Object.newBuilder().build(); - ListObjectsResponse expectedResponse = - ListObjectsResponse.newBuilder() - .setNextPageToken("") - .addAllObjects(Arrays.asList(responsesElement)) - .build(); - mockStorage.addResponse(expectedResponse); - - String parent = "parent-995424086"; - - ListObjectsPagedResponse pagedListResponse = client.listObjects(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getObjectsList().get(0), resources.get(0)); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListObjectsRequest actualRequest = ((ListObjectsRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listObjectsExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String parent = "parent-995424086"; - client.listObjects(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void rewriteObjectTest() throws Exception { - RewriteResponse expectedResponse = - RewriteResponse.newBuilder() - .setTotalBytesRewritten(-1109205579) - .setObjectSize(-1277221631) - .setDone(true) - .setRewriteToken("rewriteToken80654285") - .setResource(Object.newBuilder().build()) - .build(); - mockStorage.addResponse(expectedResponse); - - RewriteObjectRequest request = - RewriteObjectRequest.newBuilder() - .setDestinationName("destinationName-1762755655") - .setDestinationBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString()) - .setDestinationKmsKey( - CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") - .toString()) - .setDestination(Object.newBuilder().build()) - .setSourceBucket("sourceBucket841604581") - .setSourceObject("sourceObject1196439354") - .setSourceGeneration(1232209852) - .setRewriteToken("rewriteToken80654285") - .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0)) - .setIfGenerationMatch(-1086241088) - .setIfGenerationNotMatch(1475720404) - .setIfMetagenerationMatch(1043427781) - .setIfMetagenerationNotMatch(1025430873) - .setIfSourceGenerationMatch(-1427877280) - .setIfSourceGenerationNotMatch(1575612532) - .setIfSourceMetagenerationMatch(1143319909) - .setIfSourceMetagenerationNotMatch(1900822777) - .setMaxBytesRewrittenPerCall(1178170730) - .setCopySourceEncryptionAlgorithm("copySourceEncryptionAlgorithm-1524952548") - .setCopySourceEncryptionKeyBytes(ByteString.EMPTY) - .setCopySourceEncryptionKeySha256Bytes(ByteString.EMPTY) - .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) - .build(); - - RewriteResponse actualResponse = client.rewriteObject(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - RewriteObjectRequest actualRequest = ((RewriteObjectRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getDestinationName(), actualRequest.getDestinationName()); - Assert.assertEquals(request.getDestinationBucket(), actualRequest.getDestinationBucket()); - Assert.assertEquals(request.getDestinationKmsKey(), actualRequest.getDestinationKmsKey()); - Assert.assertEquals(request.getDestination(), actualRequest.getDestination()); - Assert.assertEquals(request.getSourceBucket(), actualRequest.getSourceBucket()); - Assert.assertEquals(request.getSourceObject(), actualRequest.getSourceObject()); - Assert.assertEquals(request.getSourceGeneration(), actualRequest.getSourceGeneration()); - Assert.assertEquals(request.getRewriteToken(), actualRequest.getRewriteToken()); - Assert.assertEquals( - request.getDestinationPredefinedAcl(), actualRequest.getDestinationPredefinedAcl()); - Assert.assertEquals(request.getIfGenerationMatch(), actualRequest.getIfGenerationMatch()); - Assert.assertEquals(request.getIfGenerationNotMatch(), actualRequest.getIfGenerationNotMatch()); - Assert.assertEquals( - request.getIfMetagenerationMatch(), actualRequest.getIfMetagenerationMatch()); - Assert.assertEquals( - request.getIfMetagenerationNotMatch(), actualRequest.getIfMetagenerationNotMatch()); - Assert.assertEquals( - request.getIfSourceGenerationMatch(), actualRequest.getIfSourceGenerationMatch()); - Assert.assertEquals( - request.getIfSourceGenerationNotMatch(), actualRequest.getIfSourceGenerationNotMatch()); - Assert.assertEquals( - request.getIfSourceMetagenerationMatch(), actualRequest.getIfSourceMetagenerationMatch()); - Assert.assertEquals( - request.getIfSourceMetagenerationNotMatch(), - actualRequest.getIfSourceMetagenerationNotMatch()); - Assert.assertEquals( - request.getMaxBytesRewrittenPerCall(), actualRequest.getMaxBytesRewrittenPerCall()); - Assert.assertEquals( - request.getCopySourceEncryptionAlgorithm(), - actualRequest.getCopySourceEncryptionAlgorithm()); - Assert.assertEquals( - request.getCopySourceEncryptionKeyBytes(), actualRequest.getCopySourceEncryptionKeyBytes()); - Assert.assertEquals( - request.getCopySourceEncryptionKeySha256Bytes(), - actualRequest.getCopySourceEncryptionKeySha256Bytes()); - Assert.assertEquals( - request.getCommonObjectRequestParams(), actualRequest.getCommonObjectRequestParams()); - Assert.assertEquals(request.getCommonRequestParams(), actualRequest.getCommonRequestParams()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void rewriteObjectExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - RewriteObjectRequest request = - RewriteObjectRequest.newBuilder() - .setDestinationName("destinationName-1762755655") - .setDestinationBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString()) - .setDestinationKmsKey( - CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") - .toString()) - .setDestination(Object.newBuilder().build()) - .setSourceBucket("sourceBucket841604581") - .setSourceObject("sourceObject1196439354") - .setSourceGeneration(1232209852) - .setRewriteToken("rewriteToken80654285") - .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0)) - .setIfGenerationMatch(-1086241088) - .setIfGenerationNotMatch(1475720404) - .setIfMetagenerationMatch(1043427781) - .setIfMetagenerationNotMatch(1025430873) - .setIfSourceGenerationMatch(-1427877280) - .setIfSourceGenerationNotMatch(1575612532) - .setIfSourceMetagenerationMatch(1143319909) - .setIfSourceMetagenerationNotMatch(1900822777) - .setMaxBytesRewrittenPerCall(1178170730) - .setCopySourceEncryptionAlgorithm("copySourceEncryptionAlgorithm-1524952548") - .setCopySourceEncryptionKeyBytes(ByteString.EMPTY) - .setCopySourceEncryptionKeySha256Bytes(ByteString.EMPTY) - .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) - .build(); - client.rewriteObject(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void startResumableWriteTest() throws Exception { - StartResumableWriteResponse expectedResponse = - StartResumableWriteResponse.newBuilder().setUploadId("uploadId1563990780").build(); - mockStorage.addResponse(expectedResponse); - - StartResumableWriteRequest request = - StartResumableWriteRequest.newBuilder() - .setWriteObjectSpec(WriteObjectSpec.newBuilder().build()) - .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) - .build(); - - StartResumableWriteResponse actualResponse = client.startResumableWrite(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - StartResumableWriteRequest actualRequest = ((StartResumableWriteRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getWriteObjectSpec(), actualRequest.getWriteObjectSpec()); - Assert.assertEquals( - request.getCommonObjectRequestParams(), actualRequest.getCommonObjectRequestParams()); - Assert.assertEquals(request.getCommonRequestParams(), actualRequest.getCommonRequestParams()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void startResumableWriteExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - StartResumableWriteRequest request = - StartResumableWriteRequest.newBuilder() - .setWriteObjectSpec(WriteObjectSpec.newBuilder().build()) - .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) - .build(); - client.startResumableWrite(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void queryWriteStatusTest() throws Exception { - QueryWriteStatusResponse expectedResponse = QueryWriteStatusResponse.newBuilder().build(); - mockStorage.addResponse(expectedResponse); - - String uploadId = "uploadId1563990780"; - - QueryWriteStatusResponse actualResponse = client.queryWriteStatus(uploadId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - QueryWriteStatusRequest actualRequest = ((QueryWriteStatusRequest) actualRequests.get(0)); - - Assert.assertEquals(uploadId, actualRequest.getUploadId()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void queryWriteStatusExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String uploadId = "uploadId1563990780"; - client.queryWriteStatus(uploadId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getServiceAccountTest() throws Exception { - ServiceAccount expectedResponse = - ServiceAccount.newBuilder().setEmailAddress("emailAddress-1070931784").build(); - mockStorage.addResponse(expectedResponse); - - ProjectName project = ProjectName.of("[PROJECT]"); - - ServiceAccount actualResponse = client.getServiceAccount(project); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetServiceAccountRequest actualRequest = ((GetServiceAccountRequest) actualRequests.get(0)); - - Assert.assertEquals(project.toString(), actualRequest.getProject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getServiceAccountExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - ProjectName project = ProjectName.of("[PROJECT]"); - client.getServiceAccount(project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getServiceAccountTest2() throws Exception { - ServiceAccount expectedResponse = - ServiceAccount.newBuilder().setEmailAddress("emailAddress-1070931784").build(); - mockStorage.addResponse(expectedResponse); - - String project = "project-309310695"; - - ServiceAccount actualResponse = client.getServiceAccount(project); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetServiceAccountRequest actualRequest = ((GetServiceAccountRequest) actualRequests.get(0)); - - Assert.assertEquals(project, actualRequest.getProject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getServiceAccountExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String project = "project-309310695"; - client.getServiceAccount(project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createHmacKeyTest() throws Exception { - CreateHmacKeyResponse expectedResponse = - CreateHmacKeyResponse.newBuilder() - .setMetadata(HmacKeyMetadata.newBuilder().build()) - .setSecretKeyBytes(ByteString.EMPTY) - .build(); - mockStorage.addResponse(expectedResponse); - - ProjectName project = ProjectName.of("[PROJECT]"); - String serviceAccountEmail = "serviceAccountEmail1825953988"; - - CreateHmacKeyResponse actualResponse = client.createHmacKey(project, serviceAccountEmail); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateHmacKeyRequest actualRequest = ((CreateHmacKeyRequest) actualRequests.get(0)); - - Assert.assertEquals(project.toString(), actualRequest.getProject()); - Assert.assertEquals(serviceAccountEmail, actualRequest.getServiceAccountEmail()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createHmacKeyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - ProjectName project = ProjectName.of("[PROJECT]"); - String serviceAccountEmail = "serviceAccountEmail1825953988"; - client.createHmacKey(project, serviceAccountEmail); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createHmacKeyTest2() throws Exception { - CreateHmacKeyResponse expectedResponse = - CreateHmacKeyResponse.newBuilder() - .setMetadata(HmacKeyMetadata.newBuilder().build()) - .setSecretKeyBytes(ByteString.EMPTY) - .build(); - mockStorage.addResponse(expectedResponse); - - String project = "project-309310695"; - String serviceAccountEmail = "serviceAccountEmail1825953988"; - - CreateHmacKeyResponse actualResponse = client.createHmacKey(project, serviceAccountEmail); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateHmacKeyRequest actualRequest = ((CreateHmacKeyRequest) actualRequests.get(0)); - - Assert.assertEquals(project, actualRequest.getProject()); - Assert.assertEquals(serviceAccountEmail, actualRequest.getServiceAccountEmail()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createHmacKeyExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String project = "project-309310695"; - String serviceAccountEmail = "serviceAccountEmail1825953988"; - client.createHmacKey(project, serviceAccountEmail); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteHmacKeyTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockStorage.addResponse(expectedResponse); - - String accessId = "accessId-2146437729"; - ProjectName project = ProjectName.of("[PROJECT]"); - - client.deleteHmacKey(accessId, project); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteHmacKeyRequest actualRequest = ((DeleteHmacKeyRequest) actualRequests.get(0)); - - Assert.assertEquals(accessId, actualRequest.getAccessId()); - Assert.assertEquals(project.toString(), actualRequest.getProject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteHmacKeyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String accessId = "accessId-2146437729"; - ProjectName project = ProjectName.of("[PROJECT]"); - client.deleteHmacKey(accessId, project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteHmacKeyTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockStorage.addResponse(expectedResponse); - - String accessId = "accessId-2146437729"; - String project = "project-309310695"; - - client.deleteHmacKey(accessId, project); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteHmacKeyRequest actualRequest = ((DeleteHmacKeyRequest) actualRequests.get(0)); - - Assert.assertEquals(accessId, actualRequest.getAccessId()); - Assert.assertEquals(project, actualRequest.getProject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteHmacKeyExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String accessId = "accessId-2146437729"; - String project = "project-309310695"; - client.deleteHmacKey(accessId, project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getHmacKeyTest() throws Exception { - HmacKeyMetadata expectedResponse = - HmacKeyMetadata.newBuilder() - .setId("id3355") - .setAccessId("accessId-2146437729") - .setProject(ProjectName.of("[PROJECT]").toString()) - .setServiceAccountEmail("serviceAccountEmail1825953988") - .setState("state109757585") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockStorage.addResponse(expectedResponse); - - String accessId = "accessId-2146437729"; - ProjectName project = ProjectName.of("[PROJECT]"); - - HmacKeyMetadata actualResponse = client.getHmacKey(accessId, project); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetHmacKeyRequest actualRequest = ((GetHmacKeyRequest) actualRequests.get(0)); - - Assert.assertEquals(accessId, actualRequest.getAccessId()); - Assert.assertEquals(project.toString(), actualRequest.getProject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getHmacKeyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String accessId = "accessId-2146437729"; - ProjectName project = ProjectName.of("[PROJECT]"); - client.getHmacKey(accessId, project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getHmacKeyTest2() throws Exception { - HmacKeyMetadata expectedResponse = - HmacKeyMetadata.newBuilder() - .setId("id3355") - .setAccessId("accessId-2146437729") - .setProject(ProjectName.of("[PROJECT]").toString()) - .setServiceAccountEmail("serviceAccountEmail1825953988") - .setState("state109757585") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockStorage.addResponse(expectedResponse); - - String accessId = "accessId-2146437729"; - String project = "project-309310695"; - - HmacKeyMetadata actualResponse = client.getHmacKey(accessId, project); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetHmacKeyRequest actualRequest = ((GetHmacKeyRequest) actualRequests.get(0)); - - Assert.assertEquals(accessId, actualRequest.getAccessId()); - Assert.assertEquals(project, actualRequest.getProject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getHmacKeyExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String accessId = "accessId-2146437729"; - String project = "project-309310695"; - client.getHmacKey(accessId, project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listHmacKeysTest() throws Exception { - HmacKeyMetadata responsesElement = HmacKeyMetadata.newBuilder().build(); - ListHmacKeysResponse expectedResponse = - ListHmacKeysResponse.newBuilder() - .setNextPageToken("") - .addAllHmacKeys(Arrays.asList(responsesElement)) - .build(); - mockStorage.addResponse(expectedResponse); - - ProjectName project = ProjectName.of("[PROJECT]"); - - ListHmacKeysPagedResponse pagedListResponse = client.listHmacKeys(project); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getHmacKeysList().get(0), resources.get(0)); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListHmacKeysRequest actualRequest = ((ListHmacKeysRequest) actualRequests.get(0)); - - Assert.assertEquals(project.toString(), actualRequest.getProject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listHmacKeysExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - ProjectName project = ProjectName.of("[PROJECT]"); - client.listHmacKeys(project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listHmacKeysTest2() throws Exception { - HmacKeyMetadata responsesElement = HmacKeyMetadata.newBuilder().build(); - ListHmacKeysResponse expectedResponse = - ListHmacKeysResponse.newBuilder() - .setNextPageToken("") - .addAllHmacKeys(Arrays.asList(responsesElement)) - .build(); - mockStorage.addResponse(expectedResponse); - - String project = "project-309310695"; - - ListHmacKeysPagedResponse pagedListResponse = client.listHmacKeys(project); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getHmacKeysList().get(0), resources.get(0)); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListHmacKeysRequest actualRequest = ((ListHmacKeysRequest) actualRequests.get(0)); - - Assert.assertEquals(project, actualRequest.getProject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listHmacKeysExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - String project = "project-309310695"; - client.listHmacKeys(project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateHmacKeyTest() throws Exception { - HmacKeyMetadata expectedResponse = - HmacKeyMetadata.newBuilder() - .setId("id3355") - .setAccessId("accessId-2146437729") - .setProject(ProjectName.of("[PROJECT]").toString()) - .setServiceAccountEmail("serviceAccountEmail1825953988") - .setState("state109757585") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockStorage.addResponse(expectedResponse); - - HmacKeyMetadata hmacKey = HmacKeyMetadata.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - - HmacKeyMetadata actualResponse = client.updateHmacKey(hmacKey, updateMask); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockStorage.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateHmacKeyRequest actualRequest = ((UpdateHmacKeyRequest) actualRequests.get(0)); - - Assert.assertEquals(hmacKey, actualRequest.getHmacKey()); - Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void updateHmacKeyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockStorage.addException(exception); - - try { - HmacKeyMetadata hmacKey = HmacKeyMetadata.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateHmacKey(hmacKey, updateMask); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/google-cloud-storage/assets/retry-conformance-tests-diagram.png b/google-cloud-storage/assets/retry-conformance-tests-diagram.png deleted file mode 100644 index e0051e9c78dce233eae1b85e9b75f038e8d94aac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 143852 zcmb?@c|4Zw+OEu*N#-dPDkKRZQ$l4{k-1XHm|4j@h9qSOAxSDBQ-+M0l90?YgiOg; zhQvOecdhm9Z-4*o-`>`G-?w-?&wXFlb)M&O9OrS~;W}Dsv{W2aL_|cir`1*Th=@q@ z@XtIYF}{Jl+Jl3|48vL)Nfv0aJ)IS&%gba z+8tL?6-DOvZ;H1vP`)90o?jdE3T z6=7FR8C$%!0+NhBr6k_^o}75pN{85=$X}6#LvEd9N7_3E!Sh3$&ln_GYX`1tskn?0T< z;^a&c)PC&UU-a(XI~f_7RD;L4QRCy5Cr-RujQd8tNbB}C!zhWHn_E>?)!dAYGJubn zD)ZH=A6GtY8iwA}%8E8>y_d`D=JrcBx^sFZJw5&KA?op@OVgh-<#^^ztCl<~UcY{Q z_yGNQr;w14wCBRebA=;`9|I}qUz?Wyrj8(8|1>o4G+9p?5SLx~KYLyz=$b>(y)>(*Itgh@Pex=!KUByF6tb~`xHg8&F zDuynE@`;IwNk}l0|5e`FUE(-QM?+)h;K1Xk#J3&(;lqdO>gxCJ-`CXCEXI*7-TwUf zGZPyd8#i~WrFf%p+xe; z%lX74B)oE-?L9rKTSwDRuAO9HU~pO*Kh3s6y>4Jq=6ZmSFD*a+Mg^JwrXW6*n3(wT zl`DOAzdc)s*X3=lU#Fs^^jw)@46I>uyjZ!5gOihln3zYwhlaaW_qfMT6GcTuef>^P zYU1^6N__3y>EB6jPA|-Ih>vfiJIDCMi4*e*yZ#>z>;H%m^Nf>C6V8_;E235S7@VY& zSMB(=9ukd@JC}}$G?mn}w=;y+tv7MUt$E8QwfgkX9W~$XAsy!}7g@3x2vn3$^v#TD z;1G?MeKz1yWgcHip>xLES8ekm8wbZmp z&zwGOV{2PCw%E|nfW5kW`7-YT7aJQJJ3HYRb(2!({W0pBO)nb)@Z+f|>r3l=lmRss z8k(9}+NoPLwz9Ia=I?GEyZV9I%WJ(&)KE)H%fq82FtBcUvhC2JL!sOIL`8p2PI`QM zzf-42i208CzU#KO<>lp9#1cvz>n+51PTU+HAAkDv>B?5<()#9|J9mEk`0@I+=#3jU zY;A3?T)85#aYap3{OHln&z}nm3$J}l@UI({UwV?8+1eRB9hwNZg^+P8oIj))ymsFHg)nu$fMtlV0Nzbc*>&8y({l!gp-qV@7|2)!-+4aD!$ExNr%s)+x6eV2eDL6l;o$b>`ZE4J;wZ5|bnige=*v-y<+->IE!G{|*8_R0nCtBi5OG{Dsf|apX>>M0M#>Uuw z-;YIHbdy~#4X$6mzW3ZB>vvp4?TOb2$@};3XJljq1k^T4gdmk8E8~FK^%tH#caE70 z2fX#;N0VZ^#N_0`fq3Mf=B}>urlu!EL^L%tJ`N6U?j1gHg^lUIf+ zyp)5T=K7DZL`=-hiSY9;>CSI%cMcExjx|Ibv+b_Pxl~D$n)MS0yRNRz*vLpnh*?Z3 zRnCivmp8h`LX3@uDp*6B`7EeX?|p6q%}!uFF*fK(b=W^D~;9?{S>@L=gt+n z&33== z+S-jje;SqZ3JWFjb~159HCTw5nwrw{$O#=fM8d?sZJ^J@#Dw?4H`StfZm%y*JTIA< zpRe-yTb4KGOW)kwykp0XiHQks`KsdL?%`nt5s|sEt0)G-qM{9#^T&oVC|~|U(xK;- zXZE4yb+Jd$_4eKjqu-~Xu#I@Zui^lur;oO$pTu#Y3_wg;T3J=uI>`tLQT|Zq>*?v~ z>^$ne>qgya4Gr(bZ)6-%arf>4TOc-3UL1!i*nf>DBqRg`1kh_K`4NBo^l7VPSRLV& zV_Z@l_v-xl^S4%iYMwds&AIgN-@hL7L+`wnzf(v}deP_S=PxcU8VX-fRwfRuyL$C% ziu~=e*ROwe{%jaqMBtcLcrIRjF&%i$z+n6LfaA`cJ2j9lEgRmy|A7i!@Wa8}z`*10 z#;@PMf0u*`CTI{&8^VW?^z@lCGM)<-r%sWzlmA(rZ)<8=Tg&27@TqwEblkQb0cV2j zC?&;uG}7brZWb06>~!5|C3$|tojWLB3THE;Kg8@+o0*;Uw?_#iz=V;SK#!=wROuVv z0{00>21mR)a%#S6d#JlRq{c#;>yyIvrVDmfTa=U~!fo-}ska@QS&J*v zok2mQ@~P3v=}1$bQWbbvSboR+77MKlkBk%+7UmlE5tNW9tf=66PAnS#XJNE%pv2MF z>989hrL^ysH)`vdGgQ*zVq#8ze$Ra^_b4eYzI(HIajbFLRVKbADmT8g2XCBr|IeG*jG6@$GNm_ z-#+p1%-1(psRQ^dth>K{z5V+~AF;oMlhXn&oSmH=_jEKy{bNfDH7#vs=X9)~wpp=V zA0lUH1hiLQ7+ANy+pmii3RM?F*EbQwOfiO z){V;fY`%T^)N*5GnxCJ4dU`tku=&rKnKw8>OG~w*PA?5|AIo|;I6I5;L=)=ArAwoK z|Ey+aW+Kg&n*1DVjNZFh=a^721-b{{%;@E{$pJWWV8f{&J#*1XE6)k5rA>!VXy zokx!z71T(`yHrO`70k42*De+o)r^h@4A_<1p0bm9w1J(iAtj-VnBAi$v zO!F@XCnXspx7A0m;?huhyK~JQt*t$m#+y+q+S}W)Y%gED@EPi77I*pn5qS|gy|}m- zq+)BOQ=2j%O-G24F(%b#qj_k^jE_N#EfNW^F`Bo$v^3xF6_!d>MJ2EA$8neMo;Ppu z9Cs!JKk7$iWu>mJuC;`WpkQd-sPM%%?*|4rmG0fU#~_|4XZ0x=FY5gI^=nU$fu5eT zg~iCX`iR436;4i07UGE=9UaIimIZwd4i1Mdyn3FStKhkimY8_a%#6p{E=w!rChqxt z_^whD2LpqicehrN$51}Ava)cmuCA^?G7lZ4M>4{W>1Szu#rjuQ zE284#m5z>t{Dde(g#Y|no|BW~;_QqcN!s^6O;6XwrD2_Z|8}>vo!x!t!t)m|Bqb%u z$;gmqRL#wOCq6s`NU|s_LLJJ=qBwVmCBoj;7KgI+!w0ZxRrKb~nX_lhZ;Ywl zx>a6QwsE*>6V(u>?BJn84<9`6zJ0rfFIACGNL2Lu^15x$>+=^bkgK}r>c+f%>xs() z2Y7hKw9v`TpKdrVdG*AK8CP6cc`iuB{;qg3=mQSK;lBF zm#3$MgoMdkr}S5^BF|*LzF5!z(6qKVcKrBpK(i!Cdl}y?xd1-oku1GzIiABf!Ta}T zzI$hCWF&Ls$l~|bq`A2{WH8``H$_G7e78a3RzZ3MG#?dSuBSTquzzUC2L&%Ok_IS& zmpAovtiT@1%h#@bpPfCle}DbtGNLOmAOH&sg!L#XNgI$Cx0;!W(rkbEG9mc!;T~>o zKnf0nZ*?zTEPeOx1d`p6BQfgxL~%g7x^_P>J9qBf?c0AtXgR}FE`#?)aY|jtG1@O6 z;Eu3Eu@z7JF*|GP;NUa)DFwL%0ZE9A&d%imgKs!S&(F<#N|CLpP&<3J1=$e!2#H85 zMP@&~1O=_^?U6D}b#?t4$0plSt2`Gk%cS@KD?E6>eB?;}uh|~$MDfhr+`|VC&h!;n zSxek(zP}%5mr!Rud|=wWd+z7Y-%CqWw6wc-?Rxq8wa?l@dP)knr%ZI?GT7b1!ou(0 z7KQs~hqc{U!~`%EM8jq9|Ym<9tI+gn^cjs-Yz zcXxMO91GIZus9DCFgUGX!=W zzN_c8sj;~^FDGYvhwl62jIxH z@Lht+Cr|ETVtQ>-`o?qd+sRNmTE{m1XBs<16l7%w+S;`B^p;RPfbB&^MbE~Ia%b@W z<-{eR6w%KXU_uigby8h zi4=v+$K8{Vkbu}QOfd8E`T`38;hc(K5iu&9qJCfCE!ErK53M9TEDY5Kv{UueDa~YQ zM$(`Dm(C!74j<0Nogx#Py>;57pkRLSqF3vqW3@Jyz$B*H_pn41dCZ&9g_1nji86aI z7HgWWBXs-rZCp#fbs6qFEo0J28bw$8?Ah6w84fNkV78){FKxZNN?*Nt6(1j8TI(MIha>GL z-dE;!D1a~5ylSY}ejrK85l3WcHn&PV@gwd=-fPLy+S z%~YnRU;6ewoKw;c@Lu-j%5(f(Q#0!B-A^yhzkF-raNz<=Y;)wDJHRI>mR((40s;cn zR8e>C+}v2n1{6q6=33kMlzcq);X@>=BI^!*E33(E9<8NB!Nxp8;eYf%i|U=5v<;Kh zPRuM3bMy1LuU_qoQJ3a=jV!SIy%h<A9cWVsV3@HPk_duwY$2o>@1lhf0s z*SiifRDt;@GIm-Qe*E~+-1qN!$QVevMn*Rmzttm=;4HPawgL#FI@-X%z`W2} z7rSX@HiVL5^)VseciTr-w*%LB&C+swV&a&jq(gt94Qh*$k`k7FbaWJl4BKvD*7E-S zK4IZkFJ4?9D7HtM!tMcjE4cqKg!%w}25BRj=R}!BO#lf6-GjKeZ;PJ9{(kkBJFF#y zBybu5FrjqdCfz_Ks{a0lT*1ZGEDN|97uSu%5LGvN;g#VfOUpu(0tPxM)e$FYyg}pG z5jL8&Bt<^I4i%jaL*ZfsY(<3$Frc-y5Xzi{#L8r$IYPBUwO|!Bf#BJTbo}U;EmAOrT`>5m zhlhutU>2w>!W<|1?3pv*Cf%Pt{VW;wk;S6v>+7RlgDyxp4tcLFj3O^LHK_~4vU74C z;^+T1Ki_sap9hNI&`_n*sPfUH1xR2}TtL(zUYvha6^kyTq0k2bcp<`fmVVgFj|+SKgq;frseJz8G9Dgu}WB??gm01H-A z?lIr}QD4Hv|PIKPDc< zuZPlcqvH2h-o6Fq$#$vl?Tw7o)M4O!oJ_x#xyi|_w6uGPi95erl9Q9;+JYA8fGv?4 zK{^<&2hI(Ykl5pGoj{wNwt;Q}{l~#~?l)Wd`fdYFG&MDC|DE@>Fnr(L?XGgX@%{TR z-QCx$tlE-~yFg=vqWSCBFJL#;UAtt#fU&3^bN#dS1w6!e$k{A3y$pH~?kQB8-7e1A-VdGvH2=U5{(Gbf2?Jb7^^ddxI=g zRc+(V=Lbu#fVwz1{2UuAaQIqQQBi?~ZA(?~1(-lOL&3AkH^d)+PEdJpo;}NxQ%~Fy z5T1PS0Ld#3%o8<5Gf6V##I4^zMHF;gVn>gbb(FT2n0os{;0LqkKzK~%vIj;CBVkRNalt8)VeIyz3k_1LC+>Q52R zI06sj<5`)RJ-xhgjEZIu)xs>c78ZQRjy-G~L-L`HFfbem3=CBMi@NL$6#%&fZ2UD| z`z2c+gaLP!Bz@yaR8%XDH6SNB=`MG7QsNzWN-9C@!%}6;1>akntPKW&lk{{wG9(m!q(x z3!ZXdEV0c%Kwy#xU00c}jg4yO&mR*KQa3gI3;2j*j8ZI^+NR*~Gx^=S+lq=r2@iKu zlB(V13Xh61Eq50o58N@7hG@W|`5?~IG;k_@%*_!ZXHa}SlJfkH*k&v`Gb7_3rf@sS zKVW}$lDDviST=%Qk(2XlY3cKqFElhX`xq#ZW|4y_18{1k4;;wO$-1@uWrlRs5ojZT=9d-P{!NGv&NKW!-*Fa-M2VwqedCARRGbrEzrQIN? zVyQ6YdHM3CA|F`Yg$oxX#l^wfPcfhstA6(EnA2O3MwBcm zDJfDV=m;m3mG5#Lf0CA#2jsTkCSqE44rQ&c@3@eVHP8*3M&}L|WoI|n)QsYzam;X> zNr}_T%Q;^aniXAt2*8PE8~74J90DtF>(k84+uq)OU1qwv`7V=MU{D7iK1xVf+gx{P z7Yapt1{%R(6K6@JHsmne)!?8Blx|1Id2^q2vS4NZPXHFzO)fOGPp{x3$DE`klW1pd zbUxEW6Yj_nT@W9H5M{u}B&m4_MyMF99}X~3#tB~ptB2;biFz_PI9ORJfAHap*RRbC z4Z~_ILUKcKB=NOlwXmp&%(kK8-8Nwx? z6b*rGNMYv=cJ=nYEiV3zYh|NpXltWax(5*Xrtb%?5{lWd&mUSP27qSN97IUfyXzBR z^w?fN6L86*l9IM2p(WeN|9AnK)HOBH%Yi}#c8*#rwczFVR|FqT1^=IWR~Fa~V{9{r%8cX2-`#LuOe-O+1&sYl7l!Zf@f4 z51UtdgAz~%+*9Az{u}Dr$VeI%bAe8pi_Tjb+5uj0PFFX*!y4as&MK3#1+55D$^mI< zw&+Gy7M2SJ2D~S3o&#zh8j?qYiBug*=y#}u=qc7%pe>3r-cwu44-u)f^tglsLi|fd zM}A&j9tbAn2}#MgGnr^MK2YBm7a!l#)#Y{bCh3k$u#anGMyg9AQ)E|jqPdtm{_iyF#-YGC({4&8I-R&uMh?nFhQZ96kP zohair^Ss3oqIs8DFiv&eM)!qF! zpzGJc!3(cV!fPzR;}ml)%Jt$h77C3U|APJE5Si4ln>Gmzs0@gaj;QIDXBn5mZe;x4r5Qb z$IX@j`!}}#3~w`#LcZ5Jb*df^R#rx4Yi*1kiH(db7!eQXK&ph6&oBh4hYwHj$DnOm z@a7E{7niVz2)3}$x&y2du;7}twX|)wu+x@d9^_3&2-vifjq;kg+i*m+#UzWSyq_`_H1r zEiAkRh;+Idz}JKVP(zc1EUn%-f`lU6i`Yz+zkRbIk{v6Z*66jhdE8%7k%2U#9)Ve0 zSm<|}8w+mndKV=r^dO`~VHPagp#ul{+S~c|?1ZokpQD>Jc#fsunXXgcI}Eq`4Wh=adf0txw$mHlkI)>^XDkEE&wp=lc@?3)C&__ zwLp7-dcZ}fcwoC|n=?~&0iK*YM@l~KDaRA6%+6RZDk4IA@MBxsVL7?MmX?UtYoL|+ zhQh@DI_J+r-KGBowFspgGBxR_%SakvH@X#OLe}pg_^$0$tQ1Zk6+LulU})$rAHjwd zqh5W1=ng%NDbXeLk16k?TLrvK2=&-z<{?r!N|f3#{q&2`jbjIx&*zHcTENO2F!+NrKzp0#t>9D3LPQxtqzi;@a@MEHhK^=0{AvIHkheSnVR0Vwtk+U zugkX8|M|0?xw+%z%i_|~La#0$rHJJQ*NrMpMyY0mQkc0&a{&Sr-k%sBSN!yEjaDZI zeVVkpIAd#ZxJ}Ou$Rh|oEcM`*FQgo7z^m(~)qyu}-UPv|Y4sOGU+`;J7n#u#tTmL+ zZkNBuRZO|ci1`8jlLrzq5pE4dq6FB5Cwg*r7TQvO$>H%uPteYNOmG*CRQr?Q=75R& z0C!NzgC?OjLVpE!0q=#A%Hl(`g@uKpo*t7oahlTI4vzl)XXA)`39QUgyl-fTCrWh{ zb_;j+0M9%eLDYn+SC4HTZ<4rb z?PIcuWJ$v}zb&pIpCWz`JjNvsH>8tML;`Ab`D28Dz^@f3aZytRBhNz=#xVk06}le~ zpbT3djD2Wm0gaHo*vZCD)XrSPi3&NoOF)rR;@GjByVdcY5aVNF7(?qApJg#!ClR|J z;H}O{*|Pq(pD0R|o|d)?patYPGxHSsIHjfRk%RvGGn%&DNb8FH(b^8J^D^f2%Y_%N7Hd!~x+p#>Y8vS}Tbs+;Vyk!SFK3^- zjtsfB6B%xHHX=McO2=Gz$f0c{Q&II09}G;~$9n3emx_G|XdQh{L&IK_Xe4a>H8*#D z;jE6(gBLFjPVH~DTmnq8y?*^)ewg9nS;Y;}c4i29!F?4lcqVF)-ytLACpOq6ApTdv zZw8tp-)FPuX4Otdqf~e8-c2?v4cpDbhr0z%?E*yUG)Z%Wid=bXRWyLlPLlI!74elF zR|MDnNhr{?GcYmnUSGNj*a%ROolxFT zQPKg)AsQfq0@xG#SA#(TtAe)1#l~I{V*?zFh>AMl@;$P&)C&<0)gnhJ7apot%c>?nS@YhHdecTTuT1eQC6YAf;2Yo@b5B-$Kl~ItB15!ptMV&o+ z_R8hUNPvh5RuLnKD-AT*7x-f&v_tobh~z-0gGe_whnxzHM=Mhgi-1=He?zH;Fr>J$ zjP^bhI{Z7n?QWoI1{%C@JV`nXQU>fn0>B;vhCth=tRbFtXCP&yBo$_%e$Jy)j6?!L zgY*C|0Du=Ogb);~Swpl!$zEmRErF&e=y{%JXQN^5?&gNy%!^z;5wOEJy{xPsz@la1 zSymSH`MN(ZA>^P+BD|sW%BRl5xI8txa( zMk>zFPSB;$M1(GCKtU0Tn?rTcLfKkuw;b3^ZU^of}jD*}IW)3S>U=4$hCRQF2riG0@ zlml1`5l0FF+e1~SG&D4nl>C*`lTX}ohm;Q~u4;R$9GyOFEV>FguU=V87-?zUMbAY^ zX-7moN4`ilwPn>7I z9Dr1XW+>Da@kA4S{Q@W;Rlo{J|2X*ZqNd1fkVGxMx~Zy$AQ~3t0MWO${>VDCmFw2<=t!Z3i_Kw})5+gx8k zsB*gBC0*ou^1vJ8O)(b>t|4_Gae+VcMAXasZkYgGCXnouw!k&OY=JCOJ-I_8L9C{! ziPD>t~^lrz^w^ z3y+g@wW?J?pGEJx;$jxVch#@U-Dcz3U*Ed*E-@rT)x%>IeNJ>$a5G26#jAf%jK_{H zdRFsH&CO|QY4LDyeD3T-x5V1UX2--}Z*MP*e>c9phn@@cjK~LJ2Ba2aDnxjIw?H_7 zT@nptoCatNf7aJWo!&w_JNS_5b8VE(vqMbbPm$}=($Fi@PL|%Ye?M7>O@hWXGqcCx z;ipfX3QkDqMIndPlGtnyoUw(4%t5+*l$Win(BjI6d+87yh-yp(XJ>0G&Kli=)4sk{ zZ{JFDMEMMKC^7`8@59l6PxjZ!ibcL5!(?`5=ELMg9<=abSPmK(!&+RuwNXmi@%_1C`^!?kxbE;!!b^P zK8PBk^urvti!Z=Q+%W`HsmmlgVW6a@j=&0mcoK11LneoqFAY$ikOqm)xYGOh!!s!$ z#&`pGX8amF0OIcMuYm61bmImTshw0*Fup!4G-IdWwF;6+4t{3MC9rSV!M*w8V1|M2lv>(eI zICu~Tq8z=>e@sL>pDhI&fFh$~3rfL2iTYNZHUg#pu*qBaF@*N-@9OOA#CeAU(C_*| zFf%GDeg?|=`g%0VJ)`9iFOVQ0Mm_DE=Az3gC~#@K%WcuH^cO(|`ww~nfO1fI(2@%8S~{}0rrY?UsIc%ETxw9ukt=`xbU*>J z?sx*_1fwTnWJh3y%rkib;~A0=Tn{q0e!nU$T}MF6$;pYDmbw1uJ;D_JeryqtBTmFv z0O8Vak|@WRcDz3A^hC@3hUx+g%eL=I;X)bP-MU?u-lL#l=nyQg`wWY#&$x%0Vr+r=xc??u&-|& z^#V`;Rz9Hmwzgc97GM};3ZcuWk_>^XYl~Od*%Jv3BXaV`(l^j;e%yMkq^QVWV-{8M z)Ts&JFljDPDJc&N3%|NixPW053kwfNS_c1y`xulONeQaqDjai#g^^+`V1|-*y-x78 zLS#XYxuvV?7YY(CSb_sh^G(RHIO6z9YxNs(0U}2i5;i@_q_3TwV=#ni+!xrpcMMG$ zbRDofq)O+`pGTd#7iIH9F zgPa^XDzW{@{Ji!)CIkoC3KWG(5awax8(!u|DxW_vx$38y0enS8O`U66-e4&{?Yi-t z+5w{rkm7^-t8rF8e4w%>p{0$23xz+1@(mrq7Xfv;mKu7Y8aFL7Dm9Qs&or-9g{r>#|obMbQFW|4l-N0xK zc>_BMQU}>mR5{cKYuL@ra((A69I!QaIq)Kd7&Y@>Eii7-US6mB_-+T>3wh2>LXEhcmIZ*j2L92dG_XwGjwO% zD8x=2NbEfHf!c*b(04CiX5!&_jpTIb5Vi9Y3 zO-;=TnzY5nTPQBFvPsRB2M-*$XlQ7W-wWnOFvR5d0;NF>!tu4db`2gKTN|4j(p-5B zfsJF+Q&WDW5%9xkx$P(AZc%`wO-LsXioxoQ51t_zrV?~%*q~Se7aYT3i z#Ud^Q=>%qC+@xPqGE&ezZw*sZ?qrwMpGcjomj=%w5vr;-06D_6iXFdk<498L1zp`6 zPEJ@%_{gwuP*G9N(MMD?5{SjvSa9PQq@9{g>C`rCtnh&YJ5JVO2on05wZtPF-0PUB z04T#R;FkeQfat-mk&9@^>)`A~`ov1$wrI#RuW}L2_hc0}?-ysDV+idu-QW zUma<&v#~+U){HGe-tusA;$sTOWQoNaBW2~w*49m*KZ{FBx`TS-Yy+?4=C*zO_$n() z@YpdoC~xP_cYXY*p{Mr-T@f^a>=JMr&tAW#dvR><-oUz1X&IRSJ*XuuA3j`na1dY$ z=i6nYuOI8=p@fCTqF|on@ng|Fdyd$Aev05iq+qvsqF2EnQH*i0QS$$BtU}a+2B7#@ z5wII5P%M>5c?7cvFvjB+aaq+5GQjTPSiF86W{CKh7=pvkaC$`&CQ7nVev6p7FmvcG z3(d)+m~aWqd`b|lC-MwmL0f`3|NCE%60n*YMRCI{K%#UUP@sGC7tl*2p(kjEd-hx+ zc$1zVCshJS0+pz~V@|3BTmh#mE(7X5);lUn6WTkRe0jAf4`_g*myI1WH&4yU5rKwc zW7FKyLUQspejRxcwV7W<)BjY9X+bAtX%u?V`Q`Cv&>94S67tm#7B=1PcVaipPUTblmS`2 z|M1~eF*Y>BAnep$Fw)ZlZiKZ-M+g=7{LPyipwLQ3?zVFx9--4gynNc`W$>v4Y%`C} z3g;d?`p<$UD{MgkXD6NV2Ro(1nUIv!SYMB( z2y0*sd^f*WSHYtL9ephuud6}C6`Mi#Ik?@~;W zp(BjZ3^_TbB?t?k7Y(1gd5_C^q7fL_rigoOvqU#R^MH=9fxZEevI|MU7cO~Ae7r6qX9 zf$eY)Bxa*?_c0kkvMvU@1Ww(&Z~3|vtPa3^=zk5l)uLlt?W3h=mmUH-vTMc)ydM+~ z1rHLESc?@5e}aNNLqpI&VBbS_P~wta^4;|U&MAvWmxD}08^>V5f}j^zf4N339O^Z! zm0DWRCm<9S6c#?XcP}g|Dn-JEDOmYZzTriOjF7Yc@d8}Dh&DIQJr^BuiLUN0Z)C%LhhzO9UKxPN*Aw(-26P#}BciIF= zsyW&~!mm;!?H>gNy{EjYXKYLuML+`t{fml25$VWrfi+@Bj+8<{b8-WHBMhT^(AL3@ zHC*m-c;CMFKrnAxtWl|eW3sbh5Z3VYL_ySoE)QcFMrqLbg?gUX$;`}*cn8(M7#7Gh z%y|SI)yN1S30bc$w3tin|+2}Hh2zf41C%L^4@vL z@#wIkRRF;aJthqkSgJs&uoS3bu#d7t{K9s@QI2Q@X24;F8;>FFkf0!rKv3ft(mohF zt_Oz^JAomoC{=v}gOa>FI1Z6x9x3?xpm(OomjKf`!)a7E+{3sDwg$s^e9i|U6`;Dj zl3Q9`^^K<{lK4oVxF&D;3WwAbmaAlgs?|3VlDx$&h%p}T`g5=pIr+-QD@R6z`|6Lb zKQ?rikT~!cE0&e*EHEX2RurGe?_isY0%`i!9v)%RUg#Cn! z124dKOHQTS{DIH;?vzOE!Dsoaj6mf=)H>)XWP+3xl|Om7HKuYyGkN(^_HvwAQ`Yey zRCVaT^Zhk%GBU1UvrTtXUiAKm{g3l<`tXjT~LV`B1e zj5Q#X2@)Z!jJyuZB!a(9CzcoKMy)8>Ax}dcXVc;a4Q@&F0kldavN{oqF z%&DsNXlwk$06Am9vjWS5dCI74#e0XLXO1m;qGejmAEYSH)9wi+1_Kethu$d4$Dpn0 zcN0O&<9Ly8SP)h#5_?R1oQ3(QqJCZXUR)e`J<9V5$R~>|6ieniiu#aspfN7SP3Yf4 z(aA-39JF6z=$oSIg1UM2Y9w#V#PJ#n-7A_r@9W==4N?68WaV_)fkuz(HV5~V-)BP2f#ef$Y_|p|saidv)dSqE`+yjKU*&f517xf-<&X$`;T_sJ>Rv_^tE`4g#F> z@YQlUDsAmTaUmrh{X3bq)%9f#N(87VMuvQM{g~xHdUP2en;=zqQi~TugoMam!bzIi zHjkP=H^gse8Ox;gCYUM!%_ojNKQCgm3S)1skl(!G~yBHyYn-tD_$v3RC$Oz5b0isKx@9 zQ&+n_kEjEg!^2*-2{Y(eElo{(yunEvkS9;Rv3lNvrUZRrQ?KDcn{CbkAtCSe4M14b zRP(j;ZAOrVz+UoghmeKxaf+Sn!QKpb=1So5?a)YNd7K~r@87QhBM=^Lvc4{$tXj3Z z;gBWsQgftf)09VuA|DVeXeFelLuK~&wRYG}h@o7bccf~0` zZ&N(S1t()Mj#yj(mU3t5WL&?jzg8C1kh>+!_k5K=R6QdW?2%I%tn(*&$XzL8u-llq zh{lf>t)TObi4a@L-SF_>b!6l-XGOh6gNDoT0N<6`GPl_g!-dIjkf4zC$3)1+%`L89 zml@*s=3H3cgvl#gg3CZwXbozmUer>~u5yfg(1TPw0RCt!Fy=A;S>OYrqJXg>16tlJNIaOaSvgX<2UmbIj6?2-2OuGj ztnRftP4?d&I<&OiTRxxn?9=w`5kbLNBH~MdKcd2f4)WbeOMCmW+rQwT=!|uaQB}_Q zm*-`_l$D(4`YUZz^s`%6t&8eyUzqSkeq(XI=JmfZvrFHyx|M0Y)Saugrh@nElu8e( zaCy8un3m;4x92<{sG*^{4B0(ULnRsFdrt+8&z|f&y$^;5;?D=tPK|&6{={9`6c%F? zK_wY7iIbS0pQh~hzm$No^7(+o4w5|&6B6Fy5gR?C%n|i)%z&(FR>Y#{8Dy%`)ZrMg zFf+^D-jIOXsjQ46^iq+siVEp8rJ^2eQtE1c-C*}uYXZog>MKShNZNB;7yNP+O+g61 z`%{P?r6Ywu-D^z|tbD|}osaN&Ngpaq&z$)HCLAwf+zq?eGm~u$6|qFr^ZITc`RCyz zvhe)FVT#T)9781~tC8$SlT%WRrN!}lDg;nj{~3(^0vBDa{!AvQhK9B_{s0N-_Qnc&P!NgRnw!yYMp^>jGZ8H*EL?#&hSfr+6jIj_EZdng zH}PPghUZc*)6>mj zk!VIH9JvA>ja*N#rohzzqY_jM3@;bqrhvEc7qpE_f!WZu0KNN!;Vw+Z05U`DrUfa) z^nn|9l!EfcWvuGcy+o&h|Mqb2Fk(eX!{y!A+9C3-<#5&eB)=JPi)x}r4Ud`o$I%Za z98Afizhlt~_qEb@vQZvDPs5{vA{izZ6BA4skv@9H$-x2N2F4<;eMu;Ye4~InW3hkDnSc!2%=P+#si~0aS{p zFXE!=p9pu_&OFQd=o#UOOZ2>ixp)jV5De02wO~e+FjtZbEWYq( zz6!(-Z3yhuZyaLgQ}CSW^T$|^`*$3}3<_e&t8urEZ2F{*?2cSmLwm#Y41i|Rk*v^f z)0Is()sgK`p{YZ&G02rlvszIdv+x*}A1|Ul&UIIXA459J==dHvauN1AFu=RK3Yg{? zMDGLO0_~eIgbGUir%!j=CaHsKalkNFBboFLrwEZwnAXHn%(Rg*Kf8izA2>I2dRU z9Yv$tb_9HF=zI}c2ifN;e^EV8X?J;^;@1Op_G79-swBZQFp!dy{2E(Sjol~x{7 zp$fi?Gxk*9npicW#Kp;JYOr(}>-%?e6HTc+%o7qiv-_AdQ{_*<;@R3dheM2>vd4`Z z7cqkZga+US=?hJ43{a@v<+8bU%^hQS3R`P+wY8VgLBR37TF{3Z2!=GO%k8)4YTk`ZRRTThMl-q32BZtniv z?ux~}gp~3;MTZsR+00a@v;3|p&Z%_1>sCp7*$e)#H^pBJI|&8w#JbmP0VpEU^1~-W zA(!xUFnA0=e4y%qpGJ*9U63X_DFVR; zoEKe)(-i*CW(G^4!ylbyHu9^#jQj@m<+1BMmeBnf%%^m*6@O-4=Bj7;#hr(6;(1Ca zsnubiI7g9hEo&Be;qv=1MvicD!n!JwOFm4;Aw?R-Lxu3pac&U9z>wczDKspXqdI;fF+~b(izu9Q!># z%*)KIB128MIigE!luFU<5?>*VAy|V#LhgSeJmQi_ktZ$^?e|=a3KHOkzGfg~aF}@} zjpM@u9@kyFzraBk8mPx_8jK3YL=}wugV!BRbAK|u@-&2~Xcr`K#_NJBFiOqz=3nvj zTzi>v3Oe^T`kFgP$Sb@i(1nRn$B3U`>owB*{UwgkLyXoMLd+X$Yia4{1R)B+os1my z&!!FzE)12iOn=FajfkM0X6~=Sa}IcmS?X>ueL$ZF`ZbR64TyFivc39rTc_34DW@sh z%aAUfVGxdR19&_jAGeanNRC7f9FIye0q$uwM%u;6)yIR*q1`)nQ>OhqJiVQK6(^y+ z6Mk8J-+dI07*sTV;IYce$F5Y|x;Sh926yNZ{0rPc`?~i}P0L2=hxT?)YX?yfEG>T2zDFZy@>3mg)boyhNTts><=e@e>| zW6(1ZWi`ICgQ%Dzq$kZ?ITY&=g-q^-gMM1Ao#WarI&%un}D(ZS05nK8}lCZ59e?^QdPy>OTAx?tMXBQzje`lhCu zGL)OtU$m-iacy<@M-}A--0V?>9jOz;ggpdhc#+VDd(do2Q^(LuGY^R5Nqb$;l?`xLNM3%cDP}L>jVd4t;pmc{4i$X zI6@UhR|FsT5k=i?X8hYX45s11XX?Hu37e4CBgQ~15w4srbnsvq-W!w=&IioK0Cuy7 z04LpnBnzWGa8*MzZ=09~>|>Zjn(D{^xZ-4BSm-hL1#!RwR`9F~OmIWMCOm@(k|N4C z;4MTpHfjQF^<$<9Ld_D$hI$8Jiy8Ajzh()Kih}-^-)9%DvNS`bmyKqQZ_~X!1U&}N zCxbXXLvVs&*gl&5DDX_^ljrbl!nl0Y>eDM=8+euQ*by!|A6jFw6MaS;kLZea$g;19G9_M2@ga?!GFU+bYBU<^9?=*0Qh|= z%4#dKJ@lPL?#G=*h^8rXV$Pu(B;tk^yW37AiZJzk%Jh3S56P!u@^clpJux|HUgm0p zq6%0J8Dhe=$7|O9e1tLpk(7PED@M=Il>|;j(*UhjnxGstEc$8Cq)a3&OvMP|Zd8CL z5oFv^=8AzA@LZF9-08;-!gYaxTLLRNmW|YxV=VP1TY`k-ABtycYHwwwCPP{1&PCS< z{aV&=J2{p36%_G&!0v6yY{gejcD7XX>V(3s~Ogj5Jamb~|^0#Nce^-?;im2<@ z`9(`{8NS^vuPi+1$3(OT+^VT5to0h?`j^+_MC0K_`Y^eSc0j3#DD)OFi)xU5Fl9hf zJ3P{)?B2@ij@*-Tq!r}H2Pm;y$f8;Y4`rWOGuI=2}N=WNeC$_A*7NH zRFtBUVuXqsDTiu^FeD-h9UXEg2FW3Wq)-kS38Rx!5t2jy_q{Xodw#$Feto~sGtba& z@B4G#>t5@+u63<+kO#VDhLFC|wW*lL^-WCPs+8Q$&|JRm8A{%W_FXef(1RbVT^BB1 zl8pyKKEFvn_s^asxxH1S2}it*Ufg@sodvH}(>+7=cIc&#d>eCV?BcKMoSj3Xbx^Y1 zS*WUe&IWR=dixHjc)J>~OByj{;_aQC(@m%UC|0Gc1-HM_+{I|%;K8rSXK}#mr#Z1} z-~RosQDvFk4`5SFNiCMkIk>K@og`6*3#P}v7Yv!DQCfnJcBBXYW+<17M3vpu zK_r|k8tWq#&0yQl5*v3dIq6yz+pD(#1d;~THs)dhC)E`Go20_CJyN%KMVZ3eiE=0) z{af)>UOZ2Ft`)Q6h<}%*`NBr`JByHN#rS<5Hsd{T(ycmv@ z2oC{$MRGM790M?l_cB7n$-PD znnn$C*SVtVCG!W>ff7s9silPAmqPmvA2zI;Q9w1DgTelDCVe6BWJd$HnKFkLJZfKYXqHxoSB9Mpo{diE^e;ZEg<5(g8B18Lk@o4Sv@ zg&Y8|3AHyZG=%f>j=Mi~7p};PRya zqF&A=A*ZS2i0k>&6n~TtPV~@B)TU4TIeu^St?t{sd+LlGn7n}Ri2tKKi+FX*^CZP( zqz7G_k5Q$P`0+k8V6DJ?3VITTz8UO5spnYa`VV3LQ0$AJdbNxnd3tUnEH-U%{1o@s zZW#YvyR!Tq-hrzwDKVgsMbkuvIxeI^01$MSv3Mv4@ckjVN`RDrdBXu_f7s7p8W2b! zmo8mOk+g?CPp+{@B~9wUd(;;Z=7@E_JYDfDu;$)1?9?E5aeT$Og})D)|LeL0UL!?8 zW=u_o!kcU_5BWA&gkk3<&z}d-!lPs3?zzng{!(CwwAN+`(IR#7T$xf|Q+aycCVy zfc>lNoSYhwt9ax^UN{$pAXU7%+**P)n@tmA%ig^&)6C3IAz>8FgdF0}@18y>E(UhS z#d0`$_FtACpa%#RF2bpcgShxf(CY_7z}o=c{NANXOQ`p4t4JQFa=e91wBw(?+y0vo z&=Y|slhoP{*Tpl8Lg z6P@W7ewY)*QeHm;1ET;CI%?Frd&vdxe!zkP;p;si(%*2&*NDO!H^^ZXl$3;vk?)gT z_#AfZxCLn|c{*+LO5F|8>OVOiK19dh;b}OU&(W*;_?3vD)p~!ZX;MIbnta507;R@ad>w zXzS{Fv}qC7Y*gNirzos@8yY^kckg8VLoClStS$35b^Ayx#IaNeRM}WZFSC`RuaWib zumsXQ$$LWT0NVi?fWeDB!v#j@Y8bRj+P^-7y~@?&@C8CM2r!NmnQSqr0E&W`2ZMv z8U$74^cg8dVIcV7=79Zlmm+{>;a@FdalM9jEA=__h9;UkeKtRJ`%BYtp_st(n^9d9 z5kBaw$S98{R`1%qJM{D81+CgBLTLPHoP1w(^jrVRL! z+xQ}y6GE#^ayX1f2_!eZ~*QJP`&ZKvce~_96+4)eM^2;nA#@}TJ?dNKtivS|2=2_{C*XhjNG_3-65k-NQM(YOPUYs7 z-?;bGdo*pLPva1L4w zfU0vw9mZlIh8vzw&o>D5b8bCp281UayJf(3GyqU@(RBlHG8!v+@-KoW5lY0V2>NRC zL07r1emrab@r-N$ZS_a)0YU^sqg{4~oD%o!Lu3d)nuWw@aUkJ?q zO5=r}NtY~dawg7^6kAbJ>JPS(^XYq#PhlG+jVb@(1WwHj-e-R*M{`S+QuH2L7oI{e zSpu63ZxH;^o{M++iWOTnZw?LIKsl(RgM^3gK$A6iD5jR(M*3padck3kmwIIWOPZo1 zJ+96>VVACo>*I#?1+Q{lru2y`p!dCYWukc!zlT(UUVL?Re?yJkR{hnYX@2yHr&STR zm60+WyCA+N;Omk(-wrpaWX8AZq7X4r8`l6hW=#2tstR5$+c5Efkv?E0ZqK!c5C5Ec zKg+7W{g7dffqg%GT@{}aYbi`}9naW>jzI-2{_<}(t7rjUGicwSvDWv&!RF|FDZN13 zM(LUR^Gvgvet`~IovC`g#pUI;qPqr(`*2eAMzhwUW`wCsp z_=yZhEgH`j3nO_0)RpJXoEa@JOpjfl>TrgPsohGf9(1gU)8qT%du& zi^neNL~!cVloV>bdj><4<-6}UzC7=QTj9dYggs@As}7AWvi4nNn$c$wd=Dv&xUG5Q zFBfh-pp#_#sBu3=P}wfQpuAe4ZAeY6BJm6RUO$=sCUF8NigxVCniEbf&i{P;${Uxy>^d&n!-Ql;*S!KK&?hqlGuA}&m~yK5LK^!zEbxaw=T6?AL_}gPzQDKP81|b zfrP$E(sR`$O7H~p&i?BKZWjU|1C`)SUgFeM(tHaSQR0d?m9|4}w9UTs^R~<6zz^-e z4~|dy{Zs8EL0ZZ8?x#li7EPTSu9jc*aWnxBG{b6Lu`2R0T#`ifiQ1QyJY-*uZUf4Pm_OA9-#w#Ye-BZg9x%EZztRFWe0XEfW8m_`afA>z)S)8bT_zEkIOn z;WOJ#vtYd?k|k^YhcvyccHTO5Kz3(C^C<|Ntas_Jp^ldLxPn~Knq?_UQ=Wxf=7!RK zg9dFZ^xkeGQwX)A)B=BUiU+Wa`pO4_NY~0yK_3C)md3LV9jMV(;EW6(SoraB+g@AA zgMH#-z>oNe<8EtJqOSp39I_{id9595i3KuDf*PM~WCoov85yidJo46c+&1B5?Z*AN zb?b55Kkp3$Q4C~M$iC4_dP=Kapi;3Us~Yvil90QLYU@XO!lnPgfMu%27*iFVdpTt|H9lrn{Pu=vbmI{3sl^`ro$#1@Yy1oc z8fXadjw9&0C0D|ijha;B&g|6(q5o|#-|f`tE{W`lzdy2Z!F7Ago#*Lkz-4N(zd17< z=O`LA%Sd)%@L|!D?QYIHfoK5dIdW4}i_bz1BkzxZi`85w{p}W(VA*3 z(;bQS3A#oj%XxyE+QOz`sMbk zWnWjVh7VqH@yAa1*Q$@fW8FI2|A2>p!B?HcJ22e<%^@8T6i1ZJL!q(ukLtk;ie_A4 z5a#>D>*?uvt5+7jhRsJV7U=b6KsO)Vv z3AvoS9N|f+LkBN)`XltPz(l!99x%%nESPI52_XN3Zf(x(`e)y0|p?{z{lnlKS^c|FHXA79Y-SxI#k@qj?w*^IDQ>9 zLI1b{5*1O`(%GJD2cCS1J|O60f5JH18c7Lk;V#p#TqF-9Vk_|^M8d#*MT-x|Nag3Y zb)S*vk?;%_$MD>W_cnkY_;qRldWh7c1@u5fDnJhe8BV&#($l3H4Y`IGhe1y-hBb42 z&>`kDcdjYK&Zs>{ZFPhrH&~}q)CiI#c=C{yE9un#89g)?`;F!=Va=(&tLB|>GO#{8 zb1#B&8ZI_#jIm31=-;<5+LFcCAOWI^zej@>Zsbcz5m`~LJ5qj@3Pk?}1+NjQCMYI? znqVXWM1B(Z_!KnN*7r4(CTDAXBt5~f5O=V9kFH4b|~?uE^=X z@;|^~#_)E?RFHGsH7I!GkytH&AQWI0tu;Rq=8cGB3v&hZ;$@4Je zcT$VP&s5U+`Dz(;<=m&M02MN#-r-FN4Nm*&H_%eLDIsMhevVRdnK&qxPR2)%A8#XF z!erEa@#3cqfy#ACoL>WLaEU*aWUXUyEq(QhOHR#Qz5nRZ53gN|XkmQ8F6W^`r%jk1 zX?0cA5;i)eeNR#WND{yUb{z8)ii`C*RX_(g?Y~EcM1sawb2v2azD>2F?ki$miEnjZU_( zKwpp3jAFOp|3EjPxF_GCk2Xr#nM}?a`;q{z# zagw59eZsDPyy*1#^WRM0ezQYD!fcC>Q9JM`Nl76hu%!&yoghmH2_bVn#@J7GSaOuJ z1(}8Zj=LdrK{&*4E>-cAsT2}o#M_(JhTNk;q zAk9KQ#rpngqq?w9ci0WH~c{?uTR!YJjL{ZZCV>pJ3OZS5DJaMZ!}I;z}F?bUQe zOn^&-viZnWiTarH1W)=5bOEWCt@Re5na%HM5V4LosNoXfbC#lS`+CP!>_#A!oyBh@*cN!&8nbl@JvO47=~->d&$utj|mB`z|aow zy>O%J)vFg9kecK%eyQirAD(#t#tEc!PyWj>Mn)SaY7<0OtXP2_v2^!Jbd=2cyLl5| zhuTu-RgC0g|6^0%S7nCkwO7kXE3Q8GM-ygdX2!3Nii+YB*rfwylIy&^doYTv1Y6Jb z%YTACk|og-Px40UiS%aj=I&mL7D4CnM@&k|(T)0smWMSzN13PC%Vf^< zpL?r&;*f+a@ty4SVmlxa0A7?jLs)-`@VbeqljgX(K5O19Kkj*Tbz0f&>1R&ZR<#a! z4d_BzNdI=hp8Y~PasK@8ixwTJv|ngJ|1_@2r23$ihzqCY_nyzGAy{U-+x$>O_D9FZ z52;cX_HeyM>9pdQ4T<=qLPj%l@no4qQ*i}ymBClhOL@;(;xaJZ0jtA_qIg37a=~ao zw{m+9Ag5TAC}id$H;VLV@I34}`~(n=ZB}#{8QAG{+-sC3OTF zGOk9c0XG~THembB@)_%-(J&cph2%ROJwk5#=FOsertMS8t( ztVKkDHf+Hijhy~7<5Tlu+*MmZZ&#Bcf~Oa-&#MX8oJlCdb2;zqW&AJ(C^ z_qHkP7q1L-baGO!kw2Gr|NeG(<$X{XziPvnnEuk*P?n;+E(ql(mBjR^Q!g8&?LTC< zkaq2V3qC>sWR{*_FQKnH!9-r#gP^N(w{DMD&JO{)eP$*1G4II~)jdxOT`vkIcF;E2sgPYKfE0~%uV@({{OCBh`vv<+H z&Hv|-b-rtG!Skj{i{eTA;$C>Og?)Vmi~4~)=Fq9|6fiYBECqtwfJb|P+*4^zCu>jy zw}k3R$-r9Zu7y%Hq@AU%8h#k?tdgUhtnZ@$A^QR&K3q4L!Z@0U??p* zSA_cFS+5M8fP?KSel>Nx+2Cv5r|48*%*K77*MGMg8+nect(j3o42$r99oKoFs=~N| zDfxfSU@un*nWR|g@TTYTz4>qc3HjC(j0gn3e95ow;rRa~TY^;PxpyTSp*-jfWFm2a z+^;@PLad(Mx%S@SSwkDLedEXusC_{jeoFO;#d6eo_5b`K<93GfhwEDC^6(TpJeVTZ zdZ=eVI|`-nK2&^1Gy4h+bBRv|;38*-_>Y{sES2z4N11UwjtuOoyK`8l7K5IY|P=Lakj&6GeP!3zG^K?T4 z4f3T~F5)@97}nk71yIHQmC}*iy2I~tFJUuO zaPb=lRO|E0`L$G-l%vrH(ug5^)E^`olz|n?&f+t|XQgOh>>0faT$^eN5&R8IRhimV zO}@`qDUdUG1yM&+E}`Y0anJ$|P%uc0&4gRgRhy=xN}Apik*kV z=G)sd&!{BOO-3qqd-3X3zqkU&uh-@+Wf+pD=OM;FQlIe~z|Q%HPO7S&xHL2^Xzh}R zHwp#4fXJ{fCF4JbdkRX1^C+g*v=A$Rrh-`cE_*OYHp`8!EdB*dA)^vVc2_n342As? z{ScsMY}OkE1+yWVNC%rlUrN`m`PZ+LRE5HA1A;=30uprS*b!Gr^xqKpjtssazhYjT zC#|u*r5Pal42}}zIPVb;|Ia`ds#Fpkq8)AeCk2C8TT%l>jo_QYo(bqWsw8l0%o2@` zk@ylHG%3-rsR2mA3xmyyq#HaLaTff}va^44mv5YS06du&IzF~!3}QRP?gw=6M5S<; zneJeje2-{P=1*Bhi#>BLZsBOoFk=L6Mn+9E;K2C&ofEvA&o3HkRa9O)f4;P_&STV` z#jwB}Chp(;`@{aZ(TVjTs~TB9gU0T%Z@n}TZ4j{6LC5@F-ci|u5#2(i$>r>JA%r+# zOtnsDQ03({Tl*ha81hTf-o~7`2pKo8zuenE@);6f3QDpviYro7w35j2SA8m-1+OZqZZyhJ~d!V{u4kgQc-q3>UI(fvITZ8tBon$D;PE@r`1YN z^Oq@3=+oh@_V;H4`GB}l%fpLU^*_(7jDP@xxPs6jLN-A%NC01gUz)pn9U68Lsza%% zB#fYjpQ`Up&`~|T@IJ0~Xg4@iL8N$0Ls~S}Bwa1~)~gTTtJr+7Owb`458ycGHT*HT zIIS{}h_$!SMkXyZ!WlmQCBT#BxR3x+243?{th^L1gXj%=5Wl8_=YV7Jv-|S>E*Tq2 z-!D0xwI%^E%$&(407|H(*UN`t^OdL6zPIJZ=3q{r`Jg89U!h-?Bu^jItjWJzp#=s9 zCn0n}d{mesl-o^?TDybfusz~(_$D|Cz8naPzT*BOaIsE%R7ioeBvU7jchH_R1KbB! zQz>!9uv%f%L`(%qP0_JTvK2k(WHc1A>^;UFqwPUBrI`2E*|R7^lkL9N4hBkMg5+6< zLDfkEV{ZZC<_7L5=6s`FLPec^3?s&ooPF$>R&loWhkkZuRWE|VvAZ*lp?yW9F0Jx1 zl?nj|zzOioVAqfqF+d9;2rkWU}_HTQ`B{iD?n4T<)!b0~rVabobY?SC-_d z_-+w6sZ*NDj#3hVAJ01K@`)@CF_1WcI|X#uXS`UB3AG2Xm!L!1xDY2?a$a$tbj zKu}DvZT|TKmp@Jkz}-_JCwNtWaEF*;cCod%o9Cn3O#H+hK+hKZbuoX1q95XnDu>+* zG?B*HL>eQy(!gNd&d2hRQJ3-PKudL16&PE@h2%tBY&v4ALvu52-g=0hd6vXMjyl&2 zcN$P3R~HCiI&>Hln=qWa%mUK!RA}9rPH6Cpvw)U_OX~9Ilo}MeWS`^0e*TSkHUA}9 zBghzMg5_s3@uR`$nZe{%GN2Ck9a02zLR9n=qf`2dX>r6Yz;qyTkVM}5BkDDrzbNX% z!zHv&5d|R{J`w#-o;kz8@np@AnayOVBc}+jCgifb-V7FslVWut{0o1;m=ea|p5>N= z{AB1PPBe>PI2Yc8VK-~efck+lA+}0uEsWi zfC5PH?#Y><^f?qK<LlMnnQgB146Xq>wFgg} zG4eUy!IGrwM|q_f_F^0#f1Ar{hMAn)xyP=Q?;J_5$`&z;0p`HZcwk z?qSsO#Ao->J8;=>q`p_CqH`kCt9bqT+rGI6P$)6tYuVDJ!A0L>w85IG#(r<8hDc6( z2Ifch;7jpOvl8&o{8Nvq01mA)vuDHmkWN7^$|Tzb1NcGgO8b=rXPWq_We_~0*^p6j zJ&f?Yq3pQ0l_aMlIGEMCa~V7k(fJ@$q*m*!C*IF8v08^{RDqxUK~SNh`GJ`j7B4&# zX5PQ7pAsco9P%rnJ_uVHp8~=pf|xla!!X6|ppj*|u4g=C#?i6&iwZ0!^E^TRdH(!) zR9}ZTdzfuLdFm868ok3l4$GE(fFqL@t!!jzi*dkJQn=zf2VDJa&-@R@s<@thCc|wi zlArV`unMz*)xeXcEReCzo7>hkV*iou!xY!$+n-Ndf4rvQpA(|Lq;AU&OE2uih$GVz zjFJb0iCWMs(_L%gTRF*htm2L!R?#pH!n=Iy9ocwVF#hXQZ7I8No_ORCN$+j1aUlj! z*u}L%bOVQt#Nj#>FQ7I~Q)VJhA*-fmb~_aq=)@R}oP8zzX_D(BdS_BIP2Xb<63Un3b`DF>QAR~XNc(Vx5C4;Lu>NQ4(L@gtE-F&vVuNu! zz5i2A4uLsga!J|B?t2mB9GDaxABfM`$l5!t<9L>)Y%%OT7%t;&rEyY#x4T5lLTbWO| zgEPxK8eMpe);V`f=FOA*AwR`d{MyvS^c}u`YhZEWIC=Y&ws_SYjGw38X4(}=#YmE{ zvn%VdLFf~G&CV5^ZcO2q+RDVuRFAWsUv-!E2X8BQB|UV(#{@N87ew?m@vjKqzrRfTmTTrC>pGKO%jc!3VdmdPPOZ7c^#fULOBCNfHF!Vhn4&v3qc_)q! z*ptgmOrbMCRQ+fYMc)Nl-adj;1IujT)HuwRzeEVzreMKoBc8aM>>91%!&Q2y)b;>< zva>T68;2NA{Ju9ZU?PP8!~J+yMRo>l(#CYj#l=nLZQQjEsi>&rHq}Z28%LZ=G?aEa zRL7wg`Bz2{pMtK4vUu{<{Cs39w7B}T(I{E0O`p7fg;~qaxu(Bq-=cx-B@*kXi%Ld{ zPu?BgW|uy3e00#|=k=^wzCx@2ySz`b#Rx#cR>f#MdE&WS7*$ik!!3($TJkQwdUt|3 zpS82Ur6MjyoFIur+Q#$<(w4uaN5o}z=l@c~K&)82ahfE>=SV%EXAmq5IY4K&2u5#g z51=5d?$c7~vl;vRzm-1OPsqtx>)Wthg?v{qF@PSESs-vCmQ;LRw6;L$T0&bw>a(Bn z32ft!En7@O8g#@0i?$gS7+QAxx;EQdTD2oRj{h()8|;8>*UNfzgyo^xBqKuDjKMP# zuL-YIYohCV$`m|CHhM2xdyKu^c3XfW(|z*v5s`@bC2Q5h+*h$OLRiwrNA^x{x$v3e z=_B&;LeaR~P=ouG>bUe3tx_Z{V|x|>*A^Gokrgtv)xer0kq661qc+8wMUY&F4xxWq zL5D5c1z4r1+Dd+q>OPh!mTGFGWQe-{J|n&RYo)=>>@Y&!Gx)cWn&bYtWQi$pYvTcE zeDHa4Z_<84F$S@&4rGt;fUgTPKhX+3gv_Ly2g?Ik5V9s{NAiD4jErv>8a_MeH4S?j z9PtLlvNmtZFBr!aEVkSSuYZkcTH`JbWJVluij3t;PA@Gm!vCueOXz|8moM*u0GY?% zq-Shw%#1U{ee9v&riOu0dFh#%40eReLCiRY%n5)SBFF8#Be4cqW26)kgzjmM1P!MtHE1 zrLVSV*aCmcyZn0U;twblT5wL`8vI{{pXgZk%uHQ)j)Db3 z0DPM`nVC@hDKk|<()0}!1i2vu9@!|jHv*Ck!3<7*!Cn6>H*OY*(${@oByzZ5f-KO| zGeq0SC|-p8%GrU%w-A=@Zh;xd0>y`bnV+c5Btj4pZB03|OrSoB2MZll+|{aEa>6h5 z^+`IG*;lq-n|Glp)3<9HF(uuh>D@Qz1?H^VW#8I(?FIjif^z3i3$q1NlJC&~fRp0A z@n%0Lb}$6o^H;b=`B7{lug!zm-70uydUQpjmf)FF5)&^8of73q>jnq1S7Is3s^S#_ zg=Vq9=c$`6J@;3SoUu7kZVcC@{YxACCsX*lRL-WB1 z#)8|o_o97c1Y6A#)vPvo`XMKu|J4&m;mIIC=#fa1x^9?gZnXA6@%D{My4_lb&s>xD z{D^4TyA_+MH*Ca+g2F<_P)2R?nlxhvEEBXy_heQjK2vLzp7T>Rydk{tnZM?v#KnE};=@<(96G~9yzpa2)n4Sz6> zR$O67xe0@=x!>N=`X>5b$-ss1tFFBjmCJ>&9|n@@)2MpD#s|DtUAqx0Npe_$yWgc} z_Fkuewm~{~jkrcc-%hc?(E+ZnoQ96a_l3Hi04+H>%h~xciv`(FDzN!aOSqS0@x;*E zUs=7Z7Jqj~(ISf>Oi<9MmY!jFy_Snd7{U;Z1l^E``VsBxzfjl^ONW% zL)Q;LpBnCsR+e|@FfP6N5=~>_XP97z-|1`mRW~nGX7K~M#7Kp4<#e)rrvwI#xUL|3 z0hGL+wB%p0R!gVUZjCnPw@OO`u}T(D`sdSy`I<`c zAgy-~Z_RCq`}({I}pY)qllr?iy`pXo^gLY}qTB=nraAV*gf zoYaJ@&$@MdU$Vl(hq-x09>;hUXi?f9M29|c03q(YdFDchOLX6}r$>trmuy@#MUQvU zP%E~F=*P2w?1WoeKH>^>7tw#VmNI#>Cs)U6dLyOBmrhw8;w!LaMC%Y^BJjHFahFXlf0CUaqig61wR?LK*gjItO^L zC82zM^U2zlBZVrYMI^cHrsuz>NKfy&iH`IX+1vBm4f1%{;^+SBn})McPaRAP!Wmigq9Xyr4|6VMQ>`S5Fy(mx)l@+y#GXP*cg}fPP!Jvvyz7oUuu}Y zUEAjz($X%P;3{G%CDLYmI)bGgl0suD$VmR*LhL>WismgBzA5?CzIoPWwT-#_@3(pm zchK;0HC^!Z@St}QYkyy|^vrMRL4Va|l$`wqCYKCRR@-Qm{BBLnwl@4Sg4I^Fd*=k=6N zv;kcrxKB%vRh)+eu%wgjWaz{6K4t>5jWSvrTv5Lg5!pc-55-+W39|ZsAd*2k=;`f^ zMHN(b&VzfZB$AEzx6J*1jLM#3>z}Hsi?zRzScwtyojTQ5?pXr7_?bMD2-q~eh^9vL zaBvzwFP6XI2B%>~=x)x3)jqoz=Ip#%uVWU3E4bA{Q$0rNpw~eY%tb!TEdKpLf$`>rBxsg>Wj< z?Zd~jyj7f@l7YHcq3khUnv@`0n+WGu(&_d(%j6d~yu8$vheN-$kDidAOT;1x?7rFJ z=*;)XB$2&FL`1NiYq@Ul)#|Y%r=C`)2O7UKj?neQJcK&aq|=Tq_(K*L6fr9*LCol+ z4#uj6Cc(e(x$WP-lAotjKa7A)E{%UH<8|r$Y=RdWq`Hv=7SLD>t^+ZL%Rr|7f**j! zfyky2htv#34AGYflg%upM_wfJt@wx3NzrN)#oH~D5jT-Hec^&?EB#JYM;+a5VH4$|_+l4A@43_&d$AEclVMw8nq7Pe-Md1GpPfUi_9oy@kS!`W*ZdJXB`yp( zK6ftOsI~e;N5@!~qbW8Xz3Boy95a9I!h1c}w|1>w=J~g5MR)UXBNXM`4Sb4!e}7?? zt82oaf8L{M62mJtA{jhiMNFDE{n21g%jCXhwG&P_n|Yw#7GU2SSIZz-G~HvKL4($yU8* zPd67ABl?oj*zQHs!oHxaVbnzSL~Re}&n&^6Tespl|BwY@3h7QSs6NcFm_$`wTT7!f z=F>0|l~|I1WRdwAEP5nppRuS<$vDJ#36NKGP@*47uoJ63Yyg>N%PRFU`J4Y@i&D2= z#b=J4>lo!gdl?-CJGefD*&Oa&6hyWN@TmKK@c5rRdL*bVDjPBVhK?$YZr#Rk9Ko8d z&@2lxG4hL$yhM8RRk=wK!Y2JrE`UeR7vAp4l8Zy=lT=VZE_$8>mIyV<{Zcrmj{(XR z2e+6gAPyt5<>1htMxrRpct}}AQ!P`Kzj*Zp|DAg=^v11Q8HjVyZjOB4mJ8&PnZA~1 zjDWDUH04Z5?%zn=ka@6xsF zmzw+eQuEovu(+#CF0x%$nKbj|jvPByS-+C6e)Mc8*2{Q;04BmQG6)?NQz%m?nLg>~ zci45%51fijo4+#&bsOp-)Q-F#TCmk1z@T=RBqK8(rZ@sjgu%45DZhR#M#00tj`S_5 zMx@}be*M|AW|$Pnc%p(r$Bt)CpBCM~-rkjzqoDNMrB?m#_s745cL$512H^!O&ijKr zEG*544eGsyAdpkr_!t%3G116%4NY@~tq#mPyWnx!jDvi^kt`0oA$zBG@#!8&>Eegb z{C0FE=3+iYo{f<{0Mdz29DQBI*UdYTlpb}*buREHiG z39`4_ZOPw*eG9ce$~s0zmmx-{y5bVxVnFLHFSoYqvjsTwZnnrfdE~P_HRRbjt0{qC zx6_G{Tzn%BYQ0^Y71x@a2wVEJ(po`(Exd2he>?ZkP-co;yXJ*~9ez0H=qr{=gvV^j zC-bGmM<|ZJR&k6O;yu52_Q`h4E2He^`3zI+OjbyD$ecNgFfdnD5S^zqEoUvX$CQLx zg878oXCA!E)>;B4As3r?0TanMmEwscfda?A3WfhHI0 zBIf;IL&Io5$B#!w`4m^sd4zwbZ*k(9pqHF>9yycOfC$A@2vt>7sD55v*Q!1eRtl;< z0u2X1;Jl~s;>zR!a!vNSbNO--9~tq+?7#dyz-dMA*nU&dMvWx3x>3)cJcR48^wrMh z1H`J#;ErY(tS-5|YZ&*t7VE{s3B?HN{>Qc-E;S%=u$!#kk^U({d&$5}GEw>JXqO?X zNsva|he!d+7NrPG1S}*}7jw7na1iK4qi!6evccCi!49&BUTETgYS*sf_8?^2r8jVA zuywh{2sEl2CYFs)v`og?90!;W4GoJP91&tXP)?_vpX%y}UbJ2O&CjwOI9C8ML)~)H zr0l}WH*Z9oqZgw?cY`Tf$~h}t@}4{~*3n5LABKn8jhnw^GHG}E*IHHsxDH}Mf8o8p z)EE$zcYXK@1fx=4A>+b~4zoF7rHQ(dP0eLU@&v5>4Lv0MV`jX|;}i2I)5ynLL4^A4 zPlJ*tf}-@+oqhT?uK8rfzS%C{%!cnif;|?FB_x7$>5fO=$Pd7lVoHXEC7s=~vwS*n z4{`wjM>;zP^EAoy*p|o~+|CDCr#qmXr1NhvRUXM;U41<%-G(h&ghc`vgfV6q5O>tN zjIVqjDxJ^m|B%U=vAr=*23Jo4Yy~Q!cEB2nqxV(jV$6fgCfGC?n$*6UWbI z-6q{);_ya65R_%3(-CKkh5=^v6$Jf& z(bwp>twc2KN$&#rCv_}L*^QUWQqKOX1@JtHz=ENsPXIhgq1k+}cPbnD(#D=#WXD@G zoim%AB+jw#VbH;|Fp2;tYz}w#3RI5BAh_g(yaJgKc{2>32L07AGq^|Hyt$AYleXGU z3K48-(a6CK^rEuz0sE6X3>*f`@C%*xvTNJ{Rl!do(tvbb&Mr%K7!*jSE~Fq90w|YA z&7F2G<}ZQg=}%P*K-Y0|hwl1hJ^Vs6-E2Wu3CKlu57_2W9%$J)Yfc7NOEh*S>mvp}(@Szp50>n_`NRG#dM@W7{+WNz> z?Wsf?HoD(}1*2itYqb&w6Lmn#YE`|>(jA1hia1#^UQvn303c8i*OHDo?F?P*(!by& zM&!JTo~3x(9&+uvqp0fQ$~{$8i+#t1ef<#KcFtEZzc;k-+M1CphOc#4#@8KQkK?}` z`BYuhEI-t3)Q|6f-MM}}rSj#h#dohC4m6crllY*>XTgG5eipAkuDJHH-tD_gcHY^p z4{MKn`kvF^J=CO1Vsx)(=Oi1MHZz=^H*inf?OA=uMkX*^rTWZp%87SPhR;pb@|DqFD+{2E7ve`$?15wQN*x{j=Pw!8Mbt)g(SQ?ZGVUy@EBcA zNJu*sUXL#06CzgLNlr=b^$ZSCnkc@pEB#e`BPWv<-bzVJ@O2~Xb zplWs99SGrRX@7`%g1iq82I>i5+{tR?$JIe!L`iu%Xf2<`-RuTUU%%5;TryB{Nfm7y zeO!q4dYkh5+N(d|ejx5siYf}XB1pC*-U(|`Q4rdth8y|d!x|{}G0`sFaM^Q7%BJB8 z5lqziQ!I`K{5m89g**5{t*#lH0-U^7)m@n>cG;bqw6{%h+L_ElsG}&VmG@rP2T)}K z6s8JQ6JyzT<6~{Hjwj-N**{V=G}oz!Sjr`}zgGvh3n7kraSv;3^uJv?^1Sr&S^!(1 z$GLz2L3{V^<;v*Lwr$&5`Rm~_y*uM_4;U&I$^{X=>?I-I<=x}>&C_-jjb%;zjLkv;iEhFQU3e;(!E_a#l&2< z`?MFGNBiq#n|@*h4?Jz+P6h1FWlf;UY;(<{J>i$uaXC zbnZYqw}$HJnG|&84Oku+MuoDFe@`1@Y|I4m1z_#!otNDgPb1UKT0D)*Yg+?y#GyY* zFbSn_ED_N?otrY&a-{cd^;*^I;R6rinR4mM3rU?_*|4OE+RVA{5vZm=io^J^=gy3r z91Wg=9RM^RwaxNg0l3(hYhG5@*OHSoj;61bi+ihOGNHc2SsaW8#a8CJx=NDf2-;!( z>^F@lm9{Q?#=na{%~iViATY)yHvW@rZHp1UrQ1uwr+)nWIVDDNz4G;II=rWdWrCrH zA;`s;`NXlm#H-+WnoZu0G3i^Q%C{+An*RRAo zNDO8cpNxY4c0mE?R&TMB_%cWXx^(L{mG`DfBOi`gbonBacga`@iL~3LVv2hGpu-^G z9^Mr&YFns@(uD8^x$8Uw`AZ`i;g#KaC-RaIQiIKo7KOmF0jQOa;kK1yi5CHB z9;D^kyIPXA=n3Wxv7FXLQxl1EsPIo~v%b=cjO5qa(t#{pTh3D5GALm-^5*F1JRjxo zJ(!vG(bi5Q{Yvz(+XA{WO>AGXx?ev^UET6nwpk`~;gO^tRFX}3MQMd9sB84Kk+VgY zc&}d5)!Q|^2E|%-_B-X^(A5LSjCtG`e5vGy=Sj>fs5!VM!Vt+(L>gu$cg34j+7)Ei zR>pN4^J#T-{xFK@#_~d-l75QIqm{XEwT4121Sw#@E$oJ$A(#z0+CeV7*%&T1-!Xn) zoFbctmiHrdiJ!@*`ug6Atx_1%8VvG6=2yu66o!JZ3-^PFRc+bw7q0RF~n z)zYW0?I9Z58b^a7nxe8J;|?DC{e+WYjP8&QTsQw$SXe=!QqpOY%=@Lg1!mXXfB?Vi z7>qP=Kk#i?m-*%er`<2h*2=rPAio70u_036^~v^Wx<~#>(qv1_X5{$DmQzECF@c@! zWc97hopV&zV0oY=-(JMALnE8RLWzMVcy?!jFK zYs@gni9!Kr+g7I4EvBr+NKz*C-@epyjEoZQN)z*s^xJn}{Qcij}06V;*kn&>@???@XHC#FYxvgXS~M-sul+C!td<8JMVqY??y` zvceguVuAISoz-X`-O7w9?16InKm!M|viN}N6Bz{u2a!yzd~~KgOHgscdFTZlUEM=5 z?uv#J8dXS)2E|esN?-cAit=;qjJGj)x^VO}+gCCY6%1Hi{x_tEpeW9??*M(T9qD-C zfqWLGQfN^s-bT;3aig|XYl+3ECFNuPeHv1zKye;Sx`^8>@O(2LHAdt{; zUwpOj_EI41C%Q;LLkh@a@t<#U>gUbq7ELRU7^2KZUub$E=&cKvonLNuWo5G+?S1?` z7cMN;+>(FT(Naz=k5L&Sxloor-okvmGyG64X=R>*UlY|BIK~2XZ+^P0wRd=XfYdqw z{?b+F78LbV?daca^*7sS+8ccb=$2Bmi8M~I3GZ`0DzzLKtQf^rU~6383la*o^kZ^d zq+{&GwIk@L;^qFBONd(|yPyp^Y!p|1BvSk8gxO&2@?v78MF zPp~m22Jl$%FUsVbo<&0kGBpXsaYEkZeu$gKnY}cvO=THdMjpE()v3kLAH9c`mnV|vbNnvc#|sV4?*U{uO|0z zbAl=2F}gi{))54%WgWYlt{%&k$2EIL`N{~aC`&qptJrj!AeL@{{18VE z4|)+Bk`Ek^ot_dLj7N2#+^Ngk9#0S%tax3Tp{`teD#(0LEd3^(J{|E^;4|lMOHLlY zLgbpn0D7->VMSUU)8~B$aua>UmjJwRWpws_r#FQu3s-L`EMHo<#p0m2$^#X&xbG0w z72WqSpm?H{IY~*jDfO;T{OBcct)ca3r)Y(@kvV5~xD*gL*~UX~gRWfHbUuK+WHQ^X zUAql2F{E}T;Nr{=!Lb@V9lnMtlC^fh2owDZ0Opw`bF*EZLaC5TV?NaQ?VF#m8=yOL z#+V^8xpqIAHC`3H^t~GTMc*O@v#7uce}QJgl%QU3#5oUhM(~EYOq9!TJPc2_n#he} z4`nX;g~cR&;KRrYhNx`F`hr4fIWx7B?VOnzR&hzj%4m3dC;Rm;DJu-CZTfE?C%tOa zCo+1Ibw?%OJ%I7Q+$21qD1creEB-n}w*Yd-6E+Np1f}cg6DLqLo8;*O7UApg4on`+ z2fP9|I|V%SmM~O9+6}Cr)}_lZ#rfbb#421L!Nv$cP^uA_Wqn^{+m&MYP>f^;u%1V`NV0Qs|pt;(@qF%C z*{ZzW|$_Ow!)=xnEyg z2n!0Li>hV;Ml4ux*dYTy2Xy!G=}AbW3CohGM*fyGCTZ1UIzJEuXM%(5J9@bsNaC)%kS@V=-YTXF~;!ZN&Os!AW0fCQ)>?IkhcQ)=-?I~I2y8!BFAy& z%-n{^J0AEhSQSb6M+VnDMLm5UwHr#t(|l4G zPC+Y1DRx6@h~FW})}!_7*JHT=XnGI9Ab>6R_$rgRM`xnKPX)_^Bzp1j>v~hI>M7|C z^M*O;*$;}X)?8Dy(4afByZK4d)*tp#@cmM2O(T~JA)i=2x@EhMTGaT$D3~XUZy`Gs z&o3~_%|;Qyw&@OY(hgDW9m7WUto!A)0)eia>p^!B&^TDWujW`%BhD;h{4b&*OjA>k zpBr<;aSKTtw@1*8P*d~_Q5xD0kd=g9*>N`x8|ePAmh>ltEq;75nL}upwaB8_=+e?h zGSVPP1NRfT4zU8iCy}pNb@LLYuXMN0scZ{wrKL;(G+caQP~n+}>ucS& z?Xc|kVEkRzqchu?>@RxxqiWMym!sb5Dc;j~0m-dI0odngCa5Z}JenvZy%(q=o(v&1l5>^|oz? zbu7xfQTy)QPfGlw&ZjELO;^|N1cj#nwb;}~5<*$+IR7qn`0#IpzlkF z+t34DyLJ2ey^Dc+5M+$>JRX^}X~cRfnlmXyD2FdV{fWgxs*=j$QQ8jH)?O4~+HwDPXV)^$F)o;c_3EM{5?CgUN^@mw&2Pw2j8ZVScFre3DyrKPbR zyDnY2L_UWnrzNoQ%{*@PXiY{#pm5e1NYiG3;S#HH}>CK5W zUwJrvSG%TlP|U-Nb2~RZoP2k2)8mht_UN<&z&}@n{{z}h1w69Ti#TN^&EdrFkObnw zCYeU^wn;j4fG^j;kyz@qOxYJ@Jy*2@;u<|12$Oy#)BMk)@cp&&W&@3k;*Df??L<;e zg*bz6<#cvgzscoQGCA^bmNg=G_PnLjX8k6q3p^=D13ii9eI&_Dnig4*=kRXV6?YCA zJ$hD>Eo+j<)GkZPMgK#8Dzq{epKZd7bO$P7-|VKZo2f0XpS9^tTifW-XC7Dpd#gnU z=0uUP-A-$Jd=bllDw?d3M>gTLB!8(iCni1HHOy}S91$`O-wu~5?<630aqTlU1Sc>; zu-{_Jk(Xo}0Xb2$PU@=67pCdPF*&1;A5bzQbR~{N1kG1nNLyD)r%PFYlO5Fc!^L(* zAo9t{7&k*07utl;$MItAVQhPvu6{!jK}He3hfsDcKOY{HPFT=f(cppAk-k1ATl5t1 z1tTLOvdQd`{nFhAuuxD`^ab;u6)TvAN$Wq^gkrmP++ZWKD(O{019G( zaNH6LM2i(hYLP6^`qj@!XYO&2&}@o7$nF@b*<=9#o|b2sCs%N67uus#r6+=pP|Owi2Z|E5<9#YCqye~@UD3xOf+{+2hBdb(h;hVg%zP!`yrR5X&33%lnrv#Z^IA*raKEIxUTJ zOG~FWCj)YZ`FQ-nk#5TL%d_d=&rc!~VLOq?P~v>~^a(q`Fg_Xu{QzZo6jd~d;(MNV z@(t>R`0d*}_vrEZ&6`!|n27inS1KLn+Tn$F)xy93IuSEH0xu!h+qoaV=5RrBCaKoe z%Ov&2*+))J&NfxQRrk$8NS>b`W%S2o58!%YGdb2ua_MvykPdBHe%Uegjbe$qn2Q*f-WSuvVYt5`xC;M)yprs;Us2)2#c9&Np%; ze*m@}J5(b*2p+Ipq{=X5wGT7#N}{{X$46&>(F%Wm#DK7e2wF%9IA+rH`ybMl%(L_o z94Ak~SE=s8m-5#@b5I<9xfl}w!SgwA22qb(h?5}BSqLY;2->^dDe(p%BQl9CS*2?+1&DJ*)DHuYH02}@)W0TJyiurt$o-`f1BkXMd{=T#e)3& z1z7IWy^QjZpvcuvQbrR5xFaRhMa0l-8iF<~&)2!{Yaw>YV5sY8)Ls(Vv6tH^nl6L6 z%}I0JogYAk5c*))FJFF+0Dzhcaa9hbjV#3|t=z_()*} zB!gv+5{AJ<41PIH36UP$@4q2bv$LCbX+c}b6b}KiS1=M=S21(#FF2#KLPW^edK4Z# z418=+O+A%-+J>`7Cr?P`7vl@Vp*etuDXtjr_Ab z^ouKIpj;Tpab`O^gL8+XV?yE#d9oi3Hq9Tk)zy!v#&CUNehp<}PxM=u)&Am((+2>x~_`TI>@8PW$czJqqV~h>k z)ZwohR94(U{V3T_QS$JA3tDpgE4&_;9R$V8+Vq+w4yvXmA?kKSz`14 zkcztcO2k23&kT;eg{MXC&rMh7=l65-IsLB|Acne)P5J~^&V z5(MFuTA*{0M2sNhO4Mb^$k1pmTsV+BE2^}Qp`IZ4WOu2ZofGpqMb~lZ(i1^7svosg z6$V(xm!J@F8C)nSnflvrdfa@8M-xO@+Zc6);IjnqtYly~@~)R@Jt07cIQ3tnFcl69-4_kjqXY9rGeu44Xl>3=y=@d$hlSXbCr1^Y}HE5IMX z+6DiWldUtA)T}PTcxYqM0x&>g!0OpASW_l49a#Amj_~FC_s=LqxQMp&xqtP!BlbR4 zfTPjK7E;bRXHZdzax3+?Q`y}LzznL(sM0sq#W>3db;?e!F(-2+f_Xv@uJkiGNR*QB z4zPO{gWkrAnkCZ9`E6UlABPWfp3ycDQ3M1(K}*E&|1QD)rl!wCpl`iPnRX1dXuM|9 z*MGEw*5TrBf*#mMG5^H zwA0sWsol7FGo7o8V3gTS`J^sBwJ*+5OblwOb&59P%B=7J#fvzSoR1G5A z1ASQIL*KR1y!OqdUBhpYqCLOj<*x26%BfD_1kLSfAUgF84Xa)sJtH=qkRTPz>K=db zV%VZZx_SES_=9(3oAsq=zQ85Pl|?QiIyY&iSQnO_pl;~z4!&NvlkAZte)sI+vp;Gi ziN8S)fWs1iIWlgmSDT1ZijYZZK@I`ap~dy;_rO?YUB;N{@+qwfylSY!2yR^bq7EZl z7cIx44ik7JKRhPSwg4y#P-%iVYzV2I-}pAxz5;VoO_`q__^Gzwm+^F!v`}{G85vi$ zsbG7GlLX~aNMl`ZQ68Zk8az0fM0KKtMdTbkPL|nAb`?L}X0p*uK>~}HP(#3hjm_H@ z8}Z!ncq_9ZD+2|3DbbrywDT9Ve!ZwDQ{biq1rk|N;4lcqj-c@3`SZJ(b4|tPLG|DKtEOj;Q3M~#pkUQw+6D!{nS#VRrXY$HYA5pprK8XZZAFe7h~ zFE9%1U0F6?q&RQW_!thDlnC+G&hCubX5NWMh8-Pd%R`wLnOB3;oD8O4*m&l7% z3}^m5m!!aVLnbGxF;K6ue!lq3%61akG@Isxa9lZJ_7Z=tio9e287s;`*M~N;5 z^d1%~1N297VM`ZpQ2LQHVWub9H7?u56_Cx#i~b#SNb+(Ft50`OkdwuC0-)2)?bux( z=|B|(N9+<5v6MID82K+zOq`u_=j0JUFf*;K1+S!@Tlncq&(FHIGnconG7{huAXS|X$#A#I!$FqUI zcke#SZF;6WWLjJmWg?>!FaG>k!-U?KFY~HC&TT#>;4~>@uP+=C#*RRZDat?K8fkqT z5<(#mC(6Gyz5~#NGBp_BSF}?gR74Uq%C{tq4_a0e&lE419YP`{-Qtq8yIgQ$;0(!n zHJ(b+5L?IG(J(6{eDq~|!BJ_cok38X5b z?*PRKHM~aGt_u)%5n{l;nFj-SSh(NRR7*?C#3Yv+kwWCbkK$maE`fW^{rLZ}^(JsR zuWQ@?ElH?^kcd)9Lad@yG!ZF936-df4Thx5DpbZwhA2|fC{vV~5XCYSmB>(JsK}gI zz2EE3diH+)|EJIMzI*MpsqWwJy3XM^j`KKUSzqzCG_#B%tVn6PJo;4unK;L&!wfV< zqEu97t6}NQmh~OZh+G;KFvQ3 z-^os+)ay^EXr54r^V#3x*(41XMT-EQQjb2@*rg(Pt-MluuRc{-dI+X-iq&1dxV(Zk zC_`Nd(vJY|(4@>9_q#zmY2vUKOAucbRFo`Pxu(C_T!VI}{Gr#Jfxc#pp&&fp?T&Ks z#m85#CK{WVjN3ir5El?}G|z?m2>tytqFlRt-MzchURS?;dw5kfbg5XI;HlcLUuIma zztQM9%Y+&RX^%CdFC+@E%;96Zyf}qMfPSlZYfMadRdtLHa+7>BIgAvCpfM!?z!12t z_{|=nemXiJH0caiMHPs*$E~FXZ*cF|v&5$!0G4yf>LCC?UYqNu6na)%Mh?Qk&?<`^ zt_Kg|UQMTo4;!}_py(|89j`{*k*a*uUhB9)e<>6bc(?$Fwa2Yk@Aj^<^O`Zt(aDP{ z)-eNn7NH>~%5gOZ^>0Q=GIp$Bbwo)*EjnlRY%xBERmxxfb)hl%Nd*K1*xTRcJ^*y^ ztSGKm&=^6|@~6d$NJ=8OB_iU_BTLww@elz8B9oC;R$>p2`>ijuCI?Dufw}ot>|{$p zo2++(4O9oGofj6?RJkM^+A&;BCV*>%T0TW~0f_<4gb0(-CeFI=wLX%umtn4@c(Rk@ z@ZI?rXJJfe%xDi2RHM{o*CYL5hc|7;VC2C%@oQg!xd~hM`Xk{o9ZGoEL?4_pYc(1- z0qP*zfRkzqK<3m%rg`%tZl^y!V;!e(%LjHSI~QDM7)l$QA3AXa4Sr!^xA4jIzaTG1 za?N&|?$H#1?>_~Bpfkg%2=qHcYO)nvXexjsu@yw;L|O4Ud-C1pb3BKSNxxcLe4Kd{ zkL-P>WtKRP0ZmRQ86Ze}Q=l(S<0HLCA^Nq*>m ziiAJxhPW!`{YlrGI`vNy9Ri7-35^j{VYv|dB=`jg5k;*BL@njgZEYW(3G64hbU>Uc z)h+GNexuH;q&ZAdqSAvNg@Lw6al938va_kqK(~d(nWhc|8{T60z9}UcO5dAj4M+x~AOG~1jaxMRnKPtP}-)Wu4qS=OkDG>i9^NVB{xA}#cU>J|258aWP}y%Lg& z9+-xU$t07gbzfssy(s?w)WUyMg*|k&I&JE~Ha%b>X5i>sr7#hZhx{P~Fbt$45wBJ0 zWUHZ^J@4Tcv4tbI@u!*IlNoCu?8f{rbiSw$Qvt~1X-k`(-M&gi9B1HdsV>{lET@AMHBgZ60>ewRBH}D(-HJG#(w>@D1Xs|~%+BI?Hft`2 zn8pYQdLgQuT9x;0PtBgj3qyh%C(h*#2XUlmL0o19z)*qu*&)bii%q}aI5s32u;w>$^mM#^BB%B9X@yn%-OR$G&OcdLDn#7>ZJjO^h#P1a*?Wr>Q zk8)+K9s3*T=b!s8W2lJ%4DiYH4laURLetXiBY-{gZMy`iQYTw*i+LtduAmJd8VkYS z{Zk9IBAdl-Cl1h*>F)T4Li877Ce+o&(Y=IgOH<-uZpWO&b97g0cCN8j#ex%v{$UgS znB_b95{w|Qw?ro6p$rc&vM%%vxCcf|2T=Qh=*hQk%>lq~SuohRM3E%`S;TxLM0SF4 z?{#juLGfsBDy@5Uye%aML-y(HVBu2fr@I;7Ia_;_Ri5cGgR^zv4}ZS0DYPE3$D$LzyrM6RoKz@MIHJ zkjaWuLUJZ-WgyIqDsMFd7^r;cJ$jJd+q`$4Dx0RmDD~0M%|S#CI<0|2FDA7zp6;@k z*)~CKqSFFN)=6w0?um8|1V#sjDq1{qiuG|A4u~s{A_8D;bo`nTV!;T=HUmf;J-kwx zds=NyW!pU3dV5?PGhFG-UAOb=i9wRa!M$+=Iyvamu7R)-Qn_z_$aVeAV|%kDhq|)F zBE;F#b05kKK#{dgJvyhD(Gh`#pl<`D7}V=NUDkEl8~kYccG`r&Jbb1>lMbt*q9Qjt zyX47}y~c@F)D!Cws-FZR#J&WfgKz=wBE?W05#d(Hyvdz-O$mT96@6+w1&a2@U%r3X21k6 zD5~W?vEoMvD-#OSBIo8)W6^zx31s#Qock=-EmrRP4?uMOZU$|5WW*rgZ8E5UDORqO zA`MU4rKd3PVrU37q&m{kvAs{9&DYDz&(J^9e;Q6fV#-%SZp31XmP4gqGhQ7hTfIb~ z&jW&6U&=tb&#HQeke*{^MM5ZyKwi#06t_}A-uKK_K&2YSiYVbyre1AXIg$TOKsnu9 zTvVsE_(S&gR+dlK67HJ~&ob&!k@W4;XPtK2mi)S;hw}L7nd&L*JQ9pNcChc9+j23gtnT8MGUewju#b0$}Yjxz!;C#c-&DPp9L;ES( z#9lD2AMztO^<6P^W3WNuEP?<+%aS-0tTdGIAu#COJ0GV!<4wz|2tR+~dZ)__gYxs~ zZLRieRm)2!2MYaW{;M0DrY>}Y7uR@q&cEU{exT9ET$zD^n@^skUW`X@c%GR&grzo3 znyb{Sj~}0x);Sk7pf#DlJ?eDIYrH#8A3KsittInIZQ6)mT#Ag58Yt7nr>AeVOE8TW zsbO@djgpYEOSJLjrJl=#N>fax35f!N`pCSkYsYW0+=p~FMOVnUaXS=)3@nj0rvr8o z=~+69h!S($IN{UDTft96wOE?bB)hl}JsVe^bmT-8reQ=Fmd3J#cCrO8 z^?j|!rT4oH4VbS%f1nPRLJCD9y#Fow=9*Famr+ixTi237 z!Mt2cV9grt10-mglFSuhz$rxAbV87tW(%Lm^0+kxi)+8f8NHfdmLXXg!M$Hrw$pfh zi(^??Oou-O81az{)w{t!+wLJ9hb`cOvw&^wmnv|MoOusphD2RQ-v& z9U6S7_cfvZpa{68w7HpP)r%Kl<*fj@A)dt>M6Dr;s)b9Iyt|vyM*MncA%WhDpmcK~ z25FhAj-Jgx9V$j;xLKlSCa&FSD}^%8v{6tvhv&hjhb%co+6Ug}djiXs0ZgQ&UsmN1-=8Si@3L#pNn9tCkq<-2@9oAp#9@s1$KM~4Ih3JRq=DURtZ zkf${}B%`G>8ULRf zhxFDhyv&3`G`IyXAGTNw>;ZygEBQSl<4PazqD3$dDO4w&sY8zoz$9iC%;Lqn_kqf=4jd&`eBju@_@{_{&JQb9AVzQBOMX4%E z6s}Otk*5_e>fc1~AjDVVXtvvQmDnxbLiCm`w8)hQInH86o|H{>)pTo{9zf)?D~<;m zmD+4t+i8;L%m2_Sc@<{|u>g=uauyv6D?v}4T1qMf4F^i1-GX8*ymjmRvQMc9Pbrx& zn*pE*Z{eY+xL_%KcVkBi9yCNbcqNO%QH1X%ZQ0dZx9YgJLYGbKZ!2c^RJx&qf!n@7 zeut`cb>Aw6YkSkmBIN?Kq7&^k=2~B=3Q>AwfsZ+|l~>ZgRv41Lmd41u zc8EkqMJye)K&*9QZkIsW`3nOA-jp5bkx+kv7z4Q#kwMCNU|zFp7h-vZXIx6dw6u#}v>2Re067-^30)Bg?}R?b#`65} z9R$Z>)5UAs1@F-kboqO0>|LgLGLkPFN}Dk(LC38$tzg3X z_HBDsF^5^A=)#&@z29I3EtS@H)+dgpGNdIpTlA9Y$E86gduK{}$38*Vf?w6tJP;EI zO>b%_rI#R^VeFXy62l0XZ-#3{TNBjAQU{`|@-;>I$t7eB^*orhTcg;J{VI4gLmlj< z9_lmluS>_?5Dmp0-Bh|q+#T~JplSopzn_K!0wN-CfBJDlVj6Y8ySQ;U-RE7tOxpt2 zQ2#6ftm5pf8=bnfe_=$!4i&^Gy}v&Q)D>t!3>^qBu{fmM%bXk~IN>l$hpAH;`(CCL zm-nw0V63|A=OYIXV&B!O!)V1zxH#|&mGm`2d@k+#L|W8NY~hwxjuV0^Lh{@Hh@bPj)+SNYdNk2ZE^9Jlwh?qH#OcKT2? z-;!(l2aU2DYY=mP`ljhtSp|_j)!K}*a?o=gKZu>Z>FaGq_q82(BW79S{a;JJd$d~C zeR1Jsw~Ab$Xz^V#`u^@kFCPh~-*}m8XP4LO*2tURC39PkmOQ5N{l&q)+t*wRng6B} z9g0q|ERlw2Z0z8x7cYhc#Ds73RE^0_zTC8r$GnO{&_U7i@ji_!$V-RDkY0PN?I7{F zv|!yRg#C>~8GAU58>Z|&JOO5Kb7rGvOW)&2NVjpYe8Wr;=0JZ$!t!q_#ba4x0X#smmShZZ zkoBSgo4C@_bySiFkL#B0F4|*Mo2+Hf-fh4VP8{}h%~LlE%Se3EF;gVNEfas)2nq6O zw`tPFTwY?@TWrvlkp!sa=`+0`{#I+tTKxTiZ^hr@H1|<&W-YMR8u`R2lvgJfRA9C2 zg>#oqIU~nuP^4sy*nrma%q^@@Fv8LEsh&?g?H?8(tI=xJ=)@R!HnJKntZJ+xRnLx> zgp8Y^Dw0Ukk84UIF_sqA?6r7Wxk_^4&%=GP?xk!*M^hI`dYhPE2hBA{;^4i%PIi2? z@x|o~Q*{x)5il9fM;L^AjpPX50mCtkNUed6z;jsf+a@C{llj8FZ_CNR*OTtH3rPm| z!%pzbReWmE1tw1j8FiCgd5c;eIdC9J#|Cz^97bd>TQnn~02tv#Wq7lNWDWk-eB>IH z@{o3xysq4RuO&C0%7(ZWElz6JPfzb)#fc8Ie@qh~L}g}-!ANp#&f;&C`BB$z-!@(N zEEL6XzkUG8uNxcshk5S8^%FNL#Qwjc*2#FZ&5rko=3imY7A4*_(4}}?&|;drYh-Ny zK;K!XNg^=chu=C>(0s7M1SsJFgNYEhO!?Fuh5UdDFz(Jz>1S+w1`6cdxs@z!sdrQ+ z48wFPJnr1A)*h4^cL3hkMJHJshBBc^`GN1?N5v1UhS~s2WfKm6q-Z_N3p@16%D(|^ zAqpF|;>%bK<;^Sx7*Xd!9|P95=+Px71;3R?gZI1JVjGbD74e=$8$ROClS0KQ^) zW|F!2MMjXR2icGHS8#)nz-LAc;~$6-2$T`V>VKnF5U z3<~rXNhkwLw6Dy22Qf;tF-bVhpw-%##FQa!O;Ap3bo_w97`B(0RWNukAO1MhFly|7 zdL@{OfVzJFAOsK2(vU1>sRWPfCG!~4U(ifmZHT(erF1GeienZnDpA|3e@KmIqJondCRmg{^ zCLiDpGhW3IgT9`39E3RKmO3JU1<8urB+{`&>AAG{wF{GC5IC{4-GSJug2^0FuS27(NQ_Dh?M^b zM-f^!vgO}&a1aUD;89VaQ^pZ<#*7(#H`YElo`yIYIt+%2S&?dv@Rt)!MPz?S9bck@~M}f58>Q8w?FUwAw*60Ax z&$jze z-~_TsoC3!^Bm2V7$p17j5{snj+wtQ|3I{05hg$CYF&*L($V{MYzFMiOgMR_ zCx$$Tp8{7dU>O%a|I-TMU#A1_)UPlPIg{vphHKiCMnq5+G!I!vpgGA}A@djd`F#Vy z97EXrhU(9E9>VQ0aJ1OVBVH8-Sp(dz>5oO2jvqnv_U#yty?*s-$&b(8RBrIYjr?T_ zDx?*xHLihvV=gW;v+u?v7PHtt+k4kM=WDJi(Hps+_Z=AeSP5|249Apse~k*Q}Vts1T^S>bp3 z5iPsOhm;dU6@~`!?7eFdaujXy@`M*Miq=6v7cw&X)~Fc?lS%YHeFg2cz-WRYOd~yeuEjPE3>ypa?g=p&%0xM4sOHEttt!$KM z*%mse+7YZtg*l9ijV=AP=s30rGiN?uQn9Lx!^4M7NlVK-au4T|>C>h?0Wv3*@Z&+M zH9Kv>NX#(<6aD8ThGoK;_9my72+u65DP?)IbpRJ1O&RY0uU@=BP%n zI9vMq<--RL*fYKI&0~as0WtoLzLEt6_ z)YO8IgO!^6lzx>xD!z2dVpY}JHXSfi;%m~o@rx4hb&-{myZ6XNuM@!K#8qbz*5)YT z;4RjXF0#F~AFoxHRrqc4wSW0p^m2Ut`113U88sED%;k3>mMrxnV517RS{X{76o_Gw zZX$`-7dO?Z&aJgVRl>rqu1?aq_dj)Ng%Wk@gK@ZCXliOwH*YB*IDcDhO~E?3@R?-D zh_YreD}twWI=W}WhB1U5QOF4sr$Z+?B&w4z(RwsXY~vO8wm7YAQ;GQxiCwx;Mnfp5 zMP)`0-A`1!Ov9(y?WUsjx`LkAdbG!WiUsas4qBu0Ka@futNc%sk8q~%s&8pc15kSY zv97`NKlQ&T@`;QnN~L{4$SAh%qBFeP_kIfg>_}9gL#Q5l#}^L_SUWfesp)K-e(S#rho{>PjVAy1-j=a|$^~0Bra@P| zBO}v`IWHQzwYZ;!31-1SUX8VVZ{E7a7|r?Q z7U?E&sVf+6H4Yn6wCkp#I8}k*-kmA`E~t0v)LW%Bu1qq->I9| znO*dLKywD`%eI4G4O59BKUoc7h8t^Ln#|+XeLIM{Nu0L4R+5~=x{+GpCpx%RRac)P z1At9`Sh{P6oT5Ux{ZVTmLYhoc<3}NLGM3r$neVfW#)!GiK#Dxk7y%Epo7X2hpNVrL zqot6p>81d_mGyl^NtBi86N%CU*Ba$<6Ei|n> zzk4U@v`%aGnqKSc(}P|I-(UCXu})ZiyPTXKkBeZ9o+R+<)`X5tr4W>rcyFQ<@+>t; zzsgd^!a^FVqV*K_Np-UA$mN{6l8!6N?GrVUA4zYScnC+A%id_J9*X+&XAl;$+s0r` zuQpbai;Zh;yr2NsK+oiHRlhoo@18E&zbvLE(@nDDy{RuVyvy6)`Eq?A}f=Kn_}N{XxB(iTn&Y+IC02hFd9`NGmEt} zEu|gzAcaLAo>_?}*FwqwNhG%WG?H~TCV8{rL?fyf#7{w`cv>e%%m^FTNm9F}SB0YU zhn{A)Zr)Uw*C)iXtl7QSkIxPj!GySeXK_*%zhS58s-xIk;dG$!*=n1VV{bE+f0vDu zJrkZgRV;N~7iDW?yGN=XbwVtA2AD%etLe#=t45YWMDkeexHP zE~$i=Fk)9)!$enHaIqlDUH9`lu{|=hRJR9fKsbI}}J~K;y$?+|MmKy{p zM{uJ@hnBon;z>TtYyW93ZcS@M7PW6?EVRnT#%kwlx~9+xi&YIw944ofg$uuSLkmKOB8WO&k@weF6+e=nNN3=voE1dYv*A&VC++Re0VZf@?G{Nl2*&Sfmy zDVc%+XjB1;FOoaMW-pJKbF|$CoJ7b<`^=;n^MXz99{l0W-4tekUO_A|`Uz4@t_GLI zn;Hs)X%{q_dr0;i;uOc&`1tcQ_H7#?5+PAJpVV%Q8FQ{qvB$Kr;WwtaS+rdI;*_hK zlZ46dtl6_!brM;DyqP?IWc_R3CRHcK54sHBAsE6rFFUEnGXxU-Y zLgrF%!>1ktb_$bsG-hH;yzY)#PA`bnlEsVd$BkpO2LKJu#eG%%4i=o`=_93}fg#JY zVF*BSMdLS+%)zXy^!Hy5e85u=LS=+VdV5TaShEBxOW)3I1QHjUP4e`yQsv1K1Q-U; z-En~#B3d9ug~Vv!g$qH$b9YPXWkogiBJKZQjk!2-%#dC&KU#W{Ve6NmdS^gYzDsJ6`b_jv1_^>e+rnxRQD;ZROL;Ey6ty zd_{G{3I0iOgxVjd{VN|l?yHX-I+~bazmH@+pVQ)k#DN1r`_h}l`WkvrBvxA_(`WvI z&#JE%nYE{eM&feS*4b!7b%75ElEa6eKX!~Ypw_Eg)LFzG{E1V2^rso<0n2`it(-=U zV&xJFty-@iCO6R>gtxL%xuPu zJ95vIllbZD*IfS>8=0NYa3X~L2BKolpyK?Bom;ky|1>4RS&v5yVL6Xh+H^?Dwi_>O zw6`KKXIsgmf`V5RoB)aa1`LRdh)^Fi{R+U_tidisIj%hI695PQ=cN0a5X?CcBfm@y zv3EjQo`z`YFd6rA{6S&$#`Xt*0CMhciDGAR7ZPJ~*Tt#FX0~D(D(ZWD4RD{PQP&45 z>9KuoID7+n3*HwzOysQ(-&c-RX*@CyE|rOr+J_VvXew~Bcqjac4C#Gci%laoZ^my7 zhchUAMwU6A!@+0yFU%zK^TR!p4RIc$=FKd4#L>^p^gR^lPAH)xnsQ?9^%wqK!uNSo z=HG@$!#KI1>O4Cp6B9iEGI^?7ku{`n?eX}*>H6YD^ZHhaPP)uX7bYfZpg?PTyX|v7 zBM>_&>6AglYaJ$>zsa;Xrc#D55x7bqs{Y5E_4cwbj>^JX8}S4M0)Lp>h6MZ;@4q

rVwwvWU7E3rjG0hb9rDr}hI9 z-(pd~(v4zn|Cp9{jK+3J@n5uvLq+?vWy#B%T?9?Rx7$iJo|2eY36vm?KC;bK+#2c_ z&%v>JSfPN)BiEeN7+4A31dx}J^N_-m*4noX<#p+x+J4RbemVTYdm+sI&$JrqzYq{q;v`>`gGT`q~*+a^Qu+Dm(j;CTI6#$ zogtS1ZeOiSG)affT6tfH`R2%m&ZUEY#megJkvq7qgXGD&<4IYU`(zrjTe|2$-~DS0 z7bObUc@#4scK5LxyKAAQ5SJ?5C>l1zBUE`_pUMTi6jp>h?P6_Tsx-rhh_tgpN*hx77D| z3$cyL_3{gUI1w`pf_ttSs5T(n6HK$INp_;6qO}#x#LL2jadcGKU`%)0nV(FSE`Ho8 zx)54iwm;I4Nag{}^cXyIJ=t#GKFu0E#mzP;)348!Q3-Woku=#6jNl_>5`Fg8BJ>!j z3&7q)QzCZg5Cb>|UU`U-0b<7(TdlpKf0HTpre8&hR74buoPARzY@Fze54t#ZGF41# zCOE4YAG9$f6MO0$N)l09MJ|EE9IP`N1-FVTxZ|6$T6ITz+wR9LA)?-F|Oj zf-jnR8mKziU-PI`L>upHD(kaw@#4LI&5<@M)cacMt5fKKF&#J8&|sZ?0?(UDMzj*D zn)HOfotUs`Q#il9QhkVFd)CE}Ljyw0Moxv$0cB5p8lV;-OGq#JXyH{Cp_AD-1LNY!`; zUm|{2AYINwz^0}kEl$WO*kQiQwz0iUs4w6;_?g$)No^zvysUqdaK(~HIkzUSzBv93 z9XTp@N;o^?Hjl%VFzgo zaKaCkjP6KzE4b+C;GhUA`6Qu~p5t}2i7F1PLS!-E;(vvi#{DuT$-?z%`+f%R!nBUhjM2?A`{_Yos85nF2 zP>vY!u$69~KCeKz`3cLIh!;mm(537I!vSKgxZcc7!K2V!B$2N$#NLGkTGYCQ@?O@e z;S^U2(%w`mXf~jfqKgtvMd~J<3^hZPE(hC+*H@&Ww62(b4PU{S9Xl2psYXbO`U4RF zZT{)KSNVk*ctoKh6#3z5QPEL4I1we8RNsd!=!5(B85fIFv<)z?y14g52i_VjGhgBY zQGoHcv;~SSk_!kfPxmhYFHjO|aASeg?Tuy3r*c{8c7+B(H75-g{IFijjY%Tb5srwk z0{z3s_5H(rS-JxT9DdNHt)y}l(~Zxi&FkNPf2U^?k4Yd!L{nE$(*QT{G9YqC3+xio zijtYjCy7sW%y1sOJMq%kF09*y{kV4}8fGMzR*h%l^Q^Kc#ElAuTPR*FMPq&|i6OUR z7;~l6Zz5x#4f=g1A;Fyilrb&6(<%H-za1J&(R6kCFTGMjI>w2*J9_-O26F{i?>68S z(~fOZt9U2ecA}|B!f~Fece~W0f7B9X>6K_~TB+?RA`KS$d5P)eqU2q-{AA2=^gMU) zph6oD0~@?-Fz>zbVyn{K@kE(jadAQK2V^+my>j@)u=n0@SqM^lMxP6w?CqU#_Uun) zL%gt|`|V+Dzi&J*6W)6d2g_Hr#ZwL+G&BX`SYxRnsCkv9vOMXI)IVq5JUin}^F7B| z+}BUte1Qh<)Tv!JUIe`jTxDfq*c{oZ;tIfg)9hZME-7e2zcgXc zfJ>-J#M4^w@%aWY{|gsPYcv!~>Ef_C{MfLV;sC+|qo}&kYsN9uxZ?ZA6lk5FOM3O` zgQee)e*J8j$}rm%Ne%%1BnOPhQ`HokyvT@fCy0KM!qQmURuS~Gzm)^lGcOQ@<-Fgl zhKC{x1s|tf!T5U9$et0Sn6wEAZ;De5zw4+7j~ANG$Xjod=idYoBIwHvE<@VK^=`}j z1s1*rEj$l}53>Ab8fMv!-s;E^Gr0P@E;>7GIR1ywT})6B1usY%pc6Yj7!syMUioY_ z59r-M&!J3RoN+7bxAO*i3CIt?{_mI6Igjv6NHS*Q!?Sbp2jUL3V&4g=43p~h=~Dpy z#3uz>30yX}ipF{Urm*`8eIz9uebdFIiUt8ZSJo3?v3IeLzQP12rz_#_

x2LfrGdqed5_btAUT!INO0^%8LG5Xw zTD5K4cwdRy6fw;#$~blRtK52!c5{ak3Ir@E+o`F=#l^W66bw2MH65q*9?~}O)oiJG+GjEZ z9Sv2dDf`>_!E`fd6xyold!Su2uya4V_|SzXvEk3CJorO&-Rp&0GO3pMq`nm(tVfSV zvALSuh9KG&5WC>=Wy$+i3V9rVU2W}9agEcpLQ4^S&`~4H5)14G?EER*&=?>lZvf2I zM$m{;wBs_i5||U?ZtfmtY*IJ6r+HBR%e%>fG#$^%`tb21qfmeVl!sv5__o=M8PiT) z7Goj~ld_!S^r7(+gJBz!m_Gc@rza!7|NaX&PrL^N^THRO zL~Pa50SXn^ff)!=GT&nwMh6KAxhy5(@<0a#sR2wD8ad^-CBxt79wY6={#+kknm7MGabXmuoWa; zcucH;TUt3#$s%a0=5UN0d4;(g-aMCLWKRdC2VjtZ&u~`SgoXtCb$|CyV-b9j7*KTb zad)##ddH4ZvIM^-(@I&qSC%zzOk(N^RW-aNeHEXOOxF10^}zZ(j(k@Yl@cBt%r!z> z@-_be7yJzQ6E1ZwI8_diy9eNkXjDV&=q55y(;`vBI zZu`8~3T++M6Qf43X~b%Pi{xb$D;RN>_?0}eE)HPdvy}rRCmRq_z3WFt2cNt7uHu-iab~NV2Uy}#Y4tJblIe+SaIPdy5G3{>Jz`j!5?NIU@1DF%HBZA+!F@D)-Ko9 z$I?Zrp+Sv-Y>gU$$@`~%NH(z_lbQnHiNE}oa~yclqzY`+uv7$#M$I~T=RdF|@tEaW z?vtnaRZ!TY?`i4k8n=9o(z^XY8f{=Sh5m0tFI(FYkKt~cKpi!JVN^2GtUsza06v+9 zC7dIoqbyHQMmNJ4I)m}hW`$KBWMpJ$AP7iHSlP8NOSz+KuSno60nTNY}38#fx3ddXD97yj6H?tQIacC%M z`@lf=g^Ly;Q39!792hu!;WJ!r@_EUo>LGbg;Y65;#`C0m6wT}@ibn7ONA31CuV1rB z5VgUii4!TP9uX1gxOsaA4%BkX4!XKzr-HqUh6SgN1%l4;CWPH;b8g=t7nUm2$V(Dm zpK=p6)3g`ia_-8tuU`Y<{G=Fw4T{*fkx&1lFu36_jEP9_kh(}J5?HPQL$9Ob1r`e* z`qck4Y@MyWy%4d1A#lVq_ld3nBLtQ^&+_v-x^JK7^5s9Ug5ZJr^uL$nq>DBrb^eNU zYOo0|;g*&*nf3ypn#@UDD!6imwu$9_;(7L%G6BgF0iD3YH+?|_+q_}JG9D%( zD-Vyv)2F{v$?`#vUraamqt*)K*_v<@*{$50gH|l23FBTj7fO9fya4aYj?H2zY()a$EK;Qb%iOrj@{c19Y z*RRxln6q~K7q7%p71BRl@rJ9<#LOLPD+bjcJvv7_*SmLbAeM!JfrwwYoQ#dniuqK*$wmH1N`YUvdA zy8&4WZf4O*-udJTObPi+KPvBB`1SFI>lAjDK|}k@|Bho!$xz&hg@oVrCyBarWh?bFpxtQe1V%*$OE-dR5vbRzIMQ9Mkgp-*hM+1qTxt~ z+V!v=;htV``BytizgxtV=9$x=XBwBv)|c;w(&+G06`je4tDQM<=`)(k#ie$&PAppgB8>Xe|8l!7D7Zc52ewL7VHUH=6~=qROyvCfQ=8++a_9Y)v)9I-f}wY+>a zl&kN<4_TA2{u4@cffdn3QGXsoM=ww&YAxC;$<%@u{v;C-6T%&o0amHM5mGT1dxm3H zkDkkI+Qf+|Va6Q-x&fiMF+9~(a03EGf#1buKP#Z?(Kd;Hj;D3H?DKJCN$tprt)tf(| z4iJbNK++gvnd%t&KhZKHO3GUCb-wf^!x|6{dNt`EV7TD9M5nuJ&^3PwXYngu$1s1> zCM^NgQDmXWkR;^mE7;0KjF(Q^OC(2CT1y?9B@&@}r~W10No5O&3NRHCtvN#o7g?Vy zpf}R;pVL)dfgA;){lg7E=9*}3yH4tO$g5Inxnpr&-d68t?*}mmD)i#~_#2EpiO-8( z96VDJ040Q|+e{!3XHrZb+Qa;QCZhoJPK%Ut&EJY)+YHg(GK*xlK`j#)L;6E!sHW0x ziXUoWeI8jo!6Rn~zyy$TUjqXJWFY{6P!V0abfL`QB7P%ib6=;?%l=C=Rug9sGU}L^ zO!;mt1|CEiF(!dx)j_3<-~jtX7T(iILKgE(z9Ibq}$PUb_cW?5P7_( zX^S>FW+0ZBkI5PxEn%Iqks!nWO7MV6d|6rPhaIM9HeS8L;%eCP&)1sVpwLlGXzaM! za~BOh*fNd=h+2^^#ih17Z}hG6`&&^j*jd39ua2R1BdGC8)E1KC{yd16ly6cM)8)2_ zQaKB&59tKn741Xh`-Fe$yAkRXCHzc?BesPu2g#>5QkI8)UQS-8OeC$7CdRAuQkEy0 z?1_&4K#vg`Doa8q58pi^bqJIs4$;&7)Xc!{#*2^mSyNXOQ`S(!*4~hT%%M8-jzf;( zy?F5nsJaa!Aw|=?%aKvwM*`sR+YcfWg#?4$dxtHf+TOZrmlyDd1Ki~(+R%0DM)Pwx za44y8;vj#43;FYyxgsn#u5U+v=hd;I;n~}_^JmQp^Of%!O6wp>Fso6cK)%X*Z@UhX zrY%+4&hqdW|9To#3Q$FuwSG}HNCK)B$(hK4Ds>~jkpF}fHptv6Z86Ja3CDy&&Rfg>70pMyuIG@#^P;%gj+trFdoO20sllz4Vi{MZqDr(=59V1rhJ9tv!>= zLi}om9FSsdl8y=#Mc^&7r)Uj?|43sQz&T?I{n;aneQ9 z#F-fBdsa?+;6UN1#)lb1Smuce0<82TGFNs|<^(r3)Xuudx8fmA`E>Bqim!)HXn{j{ zskXM3uTT*ELTJ^&nsd4iyDokR7|OUZrHeA z#p=9S7g@Cd*e{9j5{&fR)_4uP+%NNotvu2&tPvz2YT|ghsI^jyI6uN8E8UWhhr}Fo z&)pj!D=7*b);+3M=isOB;%E`~YuG9+CG1@Chgc;gnw#=A!5T*nv$7fVRY(L9aiA3LQJ6H#>M# z3%H5`1!oSwD_MOWbzvJNCBcHK%VyW1k^b{eZ$@j47R;2CLD8#ct22|Bd{c?U+LDq` zqDRX|)+HnP{wxUm;J`^9r%*@Pq3fciFEj`*In-F9;zeyQZty>}!1#5>{q4P)2 zyfo2^^D$~T`20R0F*Ho8|2!YU^9T{ON69lB*6?qhlN^<5>CA-iZQ1W1hQ?c)TRCw4 z1%&2$c5#2voAqJ_j;kmw6-fF31=>wXpVpelD3U&PsGuB;{VFBWzX7u}`+ARtW|g@l z{M5}HFTTuYgi9xY==D=zfl%-uFs%1ypLW2A5qb1@%l}sM>LSRnNnPbU+CsxLod{9; za3boitb1q=RspU=i-Ll+dGqGrqp@RS(18=d92_)NTI0nJL(AX-xC-Bq>Yif0B#J%2 zg<4pgv8MP4v$-{_r=&9YQq>3Ir=^r5P6jXs*0I(; z@FdAGgK$h?&qiFnsMXJ6iW56_2!I+k;afdbGn{@TH2z`}Wp91`_n41WeOQX{4uBmO zfixYP-rEohj?n8g&^0^#*fD~3EWhfHH^&RFogbOL4f}pElh8LrFlcWaCQV8`a-{Hu zzsOUMuj-ElKVQAN*&o&igbviu#drVM-k&~yc4In{q79S>FHD_{cZt#S1VbICC ziD~Sy+^(MUn9YfK;VC4WJB`1d_>42t55fo-8KYV-vG>_$vNkH|*7yeAH5SS@I z`)+*ZXM{`vH%|f%-Me?ih4UkOYJMuOtdMWpR*YJ1T)&>_PD$;$vAu1_jcdH3L~r!( zHImZHLXh2qb$D$1tEU=6)yoPA@UZYy?~O^&*b^sqv~r*_2XPU@CN}l$2a~qDDXq)< z{_{6lXTT&Or9wF%)GEsI@)x>sNGGAg{KdtjH$Y1*@sf;J4hm_?{QCMpu2adk)NQ2` z-5EtB^X)~)Mr@>iK=#4O08?VrQj9hM0)ePRX+&G|2Ef$D6th1e{>)w>L+hV@@Zd1! zrFdby5?jdAki)Rk;6uhnMkSB%69+=8|Mh(ll0Z;Vo-S#~QH34Nj9hh7RrQ)Z`wKf| z(7nW^(w#phML_C{M9k}eixIjeL@OD4r~7z%u3mH0!knIije3gQ&hZOyaTF$u7*l}r zFg_`A|77W1D*+L>+b+9V=H?*Y_PRVAQBe0BI{g9giO~2ECn)53%WZvp4zNI6QSs1e zOKv!dC_IOs0tf)N5e?t`{GC0u|DJgBEe1{Dq!NGGto?+mo56qTlD{dp#GSiNIGO36W9&RRIIh^KGf44ePRh|qGBa-hn< z<2X~^m9in!_W?LTVYvGHERDBcxPb~T5v3JRN!H9&TwrR887ENt+}uSVS|q~kuF4Yg zbyDR_NdAVxR|9c?#2#zAwRZAxe0X&9bVqbiRW(@fWDlvaNrsJig(xWN$LOfsrnW;g z!$sv!o3DNT^r;2W-6M1h{t>?`-)MO32ILW%Y6Lgv-X!(;*RFY?RuUGsg9d5Fw~(l5 zcaK^EvLcktjHVh z-}~KdCrJ#Fmz8l^D|v4=U3Io72c#3^Ty?%^Zlz?VZ~3OW8U@VIx%U}jM`zn-z|M!@*=I(AtpQK`bas+>ea3Ab`5t#qlro|V z(Q|QClQgu;(}$%X>`|}IWm1%byWQpm=Z1*H=77H`0=PWF;d#oGma?*YOjo(4I1+RQ z>gYfb+`fGI84G8quip}j=s}U&mD2&k&=R#C)5&fccmcnU?s@u<6jP=EeVjUTW-+2s z0ytAkD?5Z$#GpNpe3%52gouHl&9`Y88Oa5nVO@gfF6Iw@;cf&J zfoP04M8(6@BLBdD<xL4Q zc(^zeFK~5LvvMGe@^AQpi&zh!dnYLjd><~6&1%BV3Ohp+le6^l81K;r5%(El!cLJi z&HbWquP3L~s(oY-1HzZDcez`5J=nqs_6%QI4z&{FOVp^5k<*TPT;jh&dI=(y?oABK zLsj$XaBgx9KHe;#b5y}5_7_tbbDS`dCnM^p2ssXWtb`m09YQ5{I0tPZ8fz;0`YWpm z9W!QB(W&D~j^>?mr02kag^wQn;wjQyP#tlOu_oq4Z-|IMh{OyqAEb0N+jc>$xW#9X zL9pnDf=o=K>hf=R&3yCz{pUf8u3DDkxcmKy7k^(c{w`Cx!?l6b)Hzzr}Y z2lqZ_diu)rEVlu3RA2Hgz|R!&?mv7u#np8bgAjZ?p?Hlmr1Px(UCQn^yJ8sbeL9p1 zpw7E?@1CGikF5cY_c~0DBl`s8DX6+*FxAB+1JfWA=vbtCsrPyu;D_wp+uh26i{pNL zHVZJRn|(2RZs|^K-!V@gqclchF(akW1a{{7axoy_##vj7#c9m`=PsYaZX~((t9xMq zN!t(NU~9ZSpT#~qqN7)zUV|KgGbLbCDi?uZ$0xEUwz`@TkzHIv1|2B5cvbaN4eUg% zM6Fg>xZqBbm3U8xtFF(aFo5iNNHV8pWV7!?-Hz+>glwsQ|B3D&1&f684dh)5` zH(Z@QVL~x6btR_2CxlT4Yf z11*RZ2gO#)&Vy5Q{sHwUDanSKKt2IN!#UDLp1EOzH?E7+_sr=*WcCWPy!6zM90RoM zb1$n$hb~=~vGx6Px?~7@GKLK!-wW)SEOW7utzOK$R4|dkB(0Q~#1a6UHuFMRdAT4R zhg1HN1ni5ECM*qbi8jVdUb7svtgmFagZ5ZHjN$l9^iQ^^#j7C_h9j{d zLLD-U?kG_+Xu|m$d)O5dM`$=52mWLjOGi3xi_wK<{gvA&!kK<%kV;_(F z)Qw(~QVBAb7>g~GX#y@6D0>k{;U z{&gwmbjZA-z>pWt$FdD1C1Gb)9(a&G)!jY!%(Q18mgcC*F*5LV@?K0ToGL2)PnVu7 zrBCr`n82S{ZhPyY4t7#7zl9XuH_KDfj#b8?Ng?kND|(t!<~w4I`6W^FrR4 z&6q0AIZy+8Nq^t}rfsfOSzBvE@mQ&5NvLXTyFp^*z}wXpNW_x2-9)_;xOL}F@Nfg3 zJ(dz%{~7PqW#vXB31J`g&e8M`ec{}7%UicRB#5|2aZI!029 z+JAU=GtO{RQaXvi=linK;eVBIO;B450+6HUt?$H0E!gj;TW{{{U-zvsYe|BqgWJ3w z7YjRiw3&ED!*26>4-1R^>30$b-O*MX@n-t;p{iMlSz-5Q*s5IZbXK-&Qj$u$vmQyK zT3C6vUh}!8)62BqC<*m@~^*K=A%)Rh`wv08a4taH_aiGKgZZQhAQkZe!sQXV>!mfGoYURGkA< zLQk!eYCxZ`>XUh52I2f3`)5er@BL#obuN~!jqNCtM~_~&SXr`kimE0P5hdm2af@3g zww>D2C{oMTwz=e7FV?bDeSpwj@1q=dj=)?Tnb=B4egjfN>ZP$JEsB=FUX-^BNd@XD zZzqwcncx<}%`WZVuXRyqtFX&pKSlQY#NTnuIGB;K55vIB^z=maW?q+}Ti=_ZSiVk9 znlfegV&xFIwD~3$CSko3HMDu|2d4Dsa%wIjoNO(L9R*V|phaTV@e?OrT22`vv1C}A z>TzGZWe4fgn>)5+bIWTKgx;eiaYU?9CITBXV7md%qiYwpwln{?RdCRe*4Gk=QR^0( z?8Qc4kUc@Nit=<}H&LESB-6y|1Fz9VvIePrSo6l0_yZ)R{ruj>h{x(g!C&MoA9fj# z<1U|1syAOM_dicga`81Ns}iGAq>f}hG}L4y>wc5?3<#=mikUq5FNII3181s^8nCmU z%EmG?2Rpk6G*-nOn)O%6^PAbie{7dklazzFnAvM3v-tdbaE-51F~7xU#0qAFNehX2 z2P~)VB`0gg%vv@KRn#$B7A6e$$>WN8W;pnNh{Rtx>+9V0ZMzQHJj+E&c(b-6Vw~A;Vf6vnRR8sBS!wAkmoNLHOykHWLRY?-T?!qJQ_oR? z>njwavZN_UU*h5Nh1w7ERo1tNDr3={j6;V6mx)VkFh7)D!qwRs-ak@xP)|L*HWVgqZ^&gF zI_Gvbq^p!ZJQ6@kAEt}=#d$a7$7b15-SWsf_jmnFe&w5s&2=?3t6-Ke2U*l(C`0G% zEa3`-9-E6S)`S#AN({uJUL^huRgBkBk(Z@k;z=LN&b~>8wYJ`6=o^F5g2LTe+Xps{ z+NdPQo&O)<52YCu48K3`*|q*gY2ypBOo8Ro;D|-&eDD>F0WgGIL8d~F5XY0FY<}VY zoiNIh${{7$;|_WS{vv4G zB2EFU5f^dD;K2w`e&UctOGTU3v0Jw{uU_HnJIBN0D1VEmiEJYPuP|Qp2*YpPvD!>l zx9EV01;q|uUTKmaIB1!h$P@*@`H6sLq^Y4H>XBJ4F|!^}HYu^AlKQQn3LvJW;uh1` zcw{Rd;~LU!q0u@x_3XWyH|IiXLHVWNkbkwWb4A60Z-N^=&l?_0X*@#g8Hj*WxrQb8wY7}8x3lEUTWgEmiCnGHpC$M1rKY7(Qzrq+Ant?k5e+k

La zYTAA3ETS27?pOA07ryFXnVplv3^q=FaACo}>nFpi1pdtm^J(M9kN>K>+T3IMbW3@5 zO3+*aKu4`#&-heO{X+=iE!Sr@zP^6djka~} z@Qw+~Z*^ZfLGK3IxP?r#r*7U#0R*c>a=t(Yy2Dv!_k7r5T0?u*JJV^Lrt?3erX9-Y z=1K`9s$fcvn*j5FbdeazBQyRD9K`e@)a${uA9TyK=9*`jp9pqmPes%%K&_&;c?~Xl=co!DE80S-cgYf8sR0kuFNQ0kss@pXQ*^_8j*V6G5cOyx{lbrI138q-&!@{t2Dbj*c_rAs={ z#}OpuD&A$NKd9P;is>OfRj6;pY8JYMiBW?tFkK&2_)3%=*xn)&Y^9`RO1Hw|IX*1D zOo%IyC6IU6qbH1WqOBPk1=p>iTwv+(q-`CFxyj@97=2)#k=@jvPmekM-be2SaD6HB z28*}It!pB@474>gkk9?PS_iU77h`K@hdCi@I>4*g|I6;Hf-1Yc!-Qm-xjavodriYE zfkTx^IDGyGJoZ9$;U7vQT=g!2kv_nvk{g99QD_1GFz3mrG5{9s2N(}O1agh1*cK#a z=l)u)-Me>FMtx0q0`5~!?noZ5L&Bjbt9kkI%k%3U=FOW2lSX2K&w&skhO!n+Du}$# zc2Cgo;lt0r>Xds&vcm=^LDpJ0@aE4rxP%xt6)EN;sJDNO8wY=JAt2r?u<^&v3sW!yj2JjnKsR5#xxx*bPt;@Vhr|pQPQs^xevD zZkB*AufhlIW`QiAbFi`N2<#;vWqWTsapDW1E+Xu&%D;64nYq{EVXH`?q?BlcvWF&c zf<^tXiTtMByPKlM`|*=3#YA>-LBYC7*Mj#!{7^ao?BPrscyiL^Oor$tLw2O|p9TCs z$wiZ|cSiT{4hnyM_9O4Lv3Nq0%ORcdy_tJY_St!Z`j{qSGh-F$C!u+`Bke44O2Quk z@dlf#Z4GB=VLsOlu27|Qi&2HmD7ch5(-oUA`yTe=_)v>awMUM#PWKd5I-LnuJaZ_P zZl+jI4cG~GvfFc4NQh+ln6BzEv$&?c+PA9HP-ODcnj$bDz<~0~ef)UkI(hSA@+*}j z?7cEq{lSA}@GgPz-Jb?Ovwzr1CGH@fpod22_FB@ zz<5v$l;QKuWyyoMT>G6J})mn8LYGNc^wf z)DP6&f?vL*e-i-4JFQ5z>9ZsG7F8{-AQfKJ+hSsbdfU7M0^gg_nw`C5_;%LYe45(# zqDn3^yuyV0GHLZHYMN&bj@r zf_!@2edqS=*IxL8Q%ZpZP-@xbgSx7-l!gTwO_8wDogy`yjB0Lf{#aul&<|WmP3p5a zIx|+O(F$}_Bt%pPoPlX=ZXDx{yM3D<(s#djAwb|9*aei)q7Tev zNwDa??EW8LZyr};`@Q||5|U|CNQ%mwq$1LwK}bjvG7pIcQz)SnGN*(}XhJF>A#>(T zp-`x9$r!mKB7}P0=id2zKi}W)c|H3d_f74+uj@L`bspz43jV!G z^Vr?8G|!%Sgd80Ywz@X}oOS3$Ag zNs5h=#ahD5hEuBilT-ZKwGAqicL$Ff`rk3psaNmbS-6Tbk-0*fb>Y+la_9i*C~y+A z#ROZC>tgv^pX-KfW3jN*(Q7?up(xpzT3nwQ4~JR@g$eK}td9YoC(#T7K7)_53<%P+ zoiJ5ZJd>Ry_zaMfZ)TC?B%z92Mib#8jS;N?dc`i;)$Cw(*uO?_H$ueacU=sLh zi&_c}anV#{)8sCGAOG3pC6$~(rN`f1_5{>%!k1)vN002bpK_q}BSYJbr&KGOoolgZ z3PlSM;LMP2Knd)0aDNs>BMhh6<_L|mbTV?NeRG4xeDyi1&-B`t3rtK*cHe7Q8TR)O zK+d^|nDU+ih}hOzpaLU9Ly+Im$z$?Bd1hw27aY2A7hpl@zR!XQdIIj*J32lN=n}k) z2yLn~zq@twzX|r`El9f>C@NCWGGH;yRS3SJ$j`hc3-qvW9Qxp>ip zg?zG|iqUcviLy?Jdm%emeFpM9P}X zEv)R-lA9GQwWaeJO6>6d{X62~9L>=gte1y1{~O?cP77)-B<>OqWfhTSp*EF$gx{K1 z!pAG0-^TvJ6UM%VvLU5I#eDvh{~P^QOuR*}+=H{X1uSB)#{AMZ4%$|4(xDS9sC5#(2Z+7sY@cbq)aPLX~d>g}y zUAZNZ+OpDzi+v^b4oMv}QmJF{rtd57c#wpH(clT(-QRGFAlO(~)YWKTqZ)uG6zZl0 z^XDHiP-M0gNgI`0bfEmeGaDwio&lAMwuOqS04Q8alL58Arp{UNcypUxBH|O{$V5$; z6<8#sXbEGOe}d+R@R*==;7Zo>hGM2cbnnTS9mSJ|kUj>$U3VTDnv$A|Rn8o21hGnW zND@?wb1F-QVaybkxImUKmwh-$lW#R_*v->Ii?A9@foas+-r)_zjg%y`|Fq1;HJRt% zx$`SR1N?$^2wdgH?3bVy(f^EEfZ`ZwVqkWTmX?-K#zeJ;n}P10+)=;+arBq`T0`BZ zl`Rc(0PH`%f78r5RJo^~9_@qrIiP|GlP8<&>dvAh0ITo&>q+;vTZog&1dTXZ;N)HM zHYQ9-dTR4m3s7teeI0LfY&u^BJwhmk{%~>{%K1UHB;S zKPp%hT+PhP$~z0Bi5zz6^M?Hz32-Fm=J+IyrXNqn`hRMAl`5GgmOzgm`;k_Fm}1E^ zt{DO@f6^(%%sO)Jx36Bg&6^kS`WEiDvnUt7d*{zgLyjC?-&zsF9g-e$($x$KzF1!F zmEj8C=`?oi*v_ptv6WfeLstvp=>ED-jXnk1n4)VqcM~TnUcOemdw)a2W3~6em5?)m zAC)0es0)AKuCIL?a$_O?oqq9&+U`?4Nypv&HuED zz(T4)+X0wTHki-vE<4S}&7a>} z=K%YUoS0J95r|wZl^&NbncsXNSk_=O{hYjjPDlKJ*@g4yv z+4p||0fi>b>a8sn!|edLF8*4?7vt5uK|>uKk@8b2Cdtol6T%we zGlKT74eexg5%?J}sL@oA2!k2_@MYK?$d#Z(_Hnu7xaGT@fF}%#^6Qt^<1ZGH1lPdV z3x-%Nr0%)jEWincr5ajcKHO-sdhFjwPS^x}3u+wnUDcuPl5C18y@QPFn%gman7NwM zWiethzEpk}MZp200K+~fE5F5yi>Sy$ttlxg6gXL5q4!Ok@%YBe5{=*+YupQ=_2lgO zZ5RYv3#NQ`Bk^Zq({qM4ZH@@uOl^u|p&vDc(EmjJiJ4w)#EoC6JpC%wNg3%cE}s)@ zU8}3nQe`EwMa~=9tDnAFh@F00@?1(CU+J*BSy)_Lf6^$kn1)O(Zc=)NXCb&lj5Xrw zKZaW{m`Yg>HF0o>oP)#oZ+wsHEP7(L(}a8Ol zeMOSRp8tF8Gk1vtO?HCIo}G-$=Nn(XgnYE;j@u<)$H{CILfs43Z?se95XCG3Xu3MA zrDRky6)|98?%&5$k`D=s^4?yVTZ7-z5zbp)bbheD@a-n~88JPR)@2Gbb&pPXaatgt zIC(Ug1dIb}RjdmU8ATEDlppOrDND*ZwvR&pJMpJ1eNJJbD1!D>mkV_i!kb;gQXtB` zp(3+)TzaSx_`yoeu313fk^XTYL6c&?M9;jTVIK1hiO=N|jG8g-opNN(akQ~yh2?9} z>C#Ip#)~6er=X{wL%#_vzVuU3Z9}=k745>?S^+OccB9aY zr&jrnhqd|&B@^Tb-LM(W!{|2w)OVQu5*F41Y}p*V;p8^4TCSIXC^6~VHw{m$=NJD_ z5cq*SP1ACPi$OHnfx_I}Pp6-+%DH=2NM;cODeI8KbK!^}btBMnz9K1u+edwat{+Yg z4|I|#b`C!yx2~%7WRJSJAxYbXs0UD!`}C)QO`^{+8(yZ*` z^da_ccdQSwn1eFrFv=Yu0$WBIXIiuI)23Yn$KU}-h-Dqp zNDLDB!QLRHLw*VL{lksx+WIzas)!wgy}XySbpA2@oCrrH057uAVJku}r%`VoEmA5H zx8A{rg`*Yom`|zRuPM8x&!?lcX9gYz-ei zgdxDRln~yn^`_e2Ril}1Px3>jhza0@gxn)<^m?f?%L!dZ-dqKbX6ox{rEe%g1v9vL z)vdev%5uV|)P*nl8X9VcP}y0zV#T3Py$=^Ba$nh1cs)LQW~rxl=)eKHKZjlQIiJ~# zR6P-$WoN%3&Gt=it+EcvQ2OO|_jtT+SgK60qKEBM{2EWRwI4pDx$%FwgvWvc{9bsH zOl`(dy%ReiwpuGlx6TJm0>#WE=R)h7jV1T4)oV8Bmq$a9MK(%J9-bNOqO1cF#7hsy z6jC8n6_C>*(vIN_M|PS#d4w`K_Tz#AHd_a?r5=umrx*zEN(&tO>mq&5 z6ysRx2icaas48|N_otZYFA?^jB}~Wim({*FroWO{2s(m5_!ZkpGa&_NK!z_Gv@V^97q98hBE*m_9BdyyPlTJBIdkT>)8LYj_3LYM2GkYN zX#yY3*ze@^d*W2A+bt_{M7v8&cIqKAM;wwk0##+vST@>7K|z6NESv-ojluPF_!>%O zfwM_a|HkePYvbN&F+@RpD`eFLedj3b?&w?Gq`qo^@`=?=nL`wpMbyAiM--Q#7csRE z_*O`j;yPT1!9W7S4Znnxpt|}Z3_sDOgMl!qWvTl560w5*Oxb?pEhmJpQ14+{`h^eO z6%&(s8p|41T3zn|;wC}(|8xhG)zrCOz?Q;0w53jwF} zW*0nokf^1Upg@V|p-e0xIHOHlwg~9}y+90n)rqjD7)~~3Z?0^8jgUixJ}7u2cQwJc zi8l<>@7-Kd*`HJt+SKLr;U3niH)4g+*6?Z5I?_p`^O|E$#BMTbAt^}6*wfE*I}W*2 z&LE?jhq)IrT}4h44W}k6jxpAda19igT1Z%AVhsut+*`7Rel)G3T9<>#{{^VHG!lz0 zvoh4b4{c!cMBzSe7hDT}tLc|%EcEa0*iz%^IS7fdA zz5)~qrUN?!d%nj~3SED({lxzI`k`|Aj%X!7F5j17Z^Hz+!D%XpT}gAQXK=f}w+x@D zpL6F8LeSdXzmQRUa#Y&d{FT3iP&*>e{}bIoT^%i)YmeV`eKH^pSl^5Qi?P=Jk-P)pE@Mz=X`?~!-PVT;EEgWp z)H%}6R=YYoKV+K&FjP_f+S*TMXAWX7uI-F`p-VV98+PqJQ9oe1M0fca*p~}bmees;6nCvQ}Q2CFLHrrgO7u{)$Y+_ zV{Td9mz+Mx=;-=5e*6pNOysrY1EV?xejURt`ry}ASqWu|ehyyN&uDVtB*4G9jn08p zHc3uBVCegLK0LrgH!-FtJDd65UdVt6ViXwEwqygi7a~%H*dPEc#D$%aoFn5b3a?#z z1v|qz4C?;GuuPrV%o9fHQVXPsZ)!mR=bq8f6F^l6i7UfmnJad9)27>W3<6qT;lTkq zB)kLFxZ7K@U(%FF!LxJc{U{>em6r=+1Mp(6K7FEZ&+gc6ho-lSjt1Zqw!)b1?Vp+GRInNFc;i>rE(0y6fk7d3*O2R%8d9Q(1yyq9)P= z_5{KIB2bWogQ0H}ZMA~lRW5}8-5`p9KEl1SyQsZr?8ZQd+{5eG;lqL`6^+?w%o!`Q z;(i(1qxkntS{drf?3|+98Tg4aNb}~+o9K|d!G?&@lK1a_1cyS(x#%Idp=r@)VBChs*;1l-=8dYOb);svkDG5y$jLC{JXu71p_) zUHqnQiUc{>+&Ob5O`e?QJ&EC0nk0uV3E&5TS)uEY?ls_wUoOLZihVKQ%5BsT7UU7)l+WHXt;a6Bua3UBMHZ zoO1n!4dnT!y$T%usO20dDP?lepZ$r6I`O#^+J)dcjdV#XY#fsGthB*C&2x_TsqL9K z+}6gPNkQ?ywzOFE2oNne3i&xhIglBACs2ptfrK#FtWTfONzP2UK|0jW}e#$)w&uiqbnVHmxzO|$P?d|Eg z9M-OP?;~8z_*&Y0Mr(G96CVHzfAojyDZcp1V7 zlg~jdPF@{h)J&B*k;oTIJKD0$sY7Dt1WaFNOU@YN;pv&7pC)Qx@7qleNbLBM%{qdk z=UFW>Dk#Edy;?8=u>mwJnMO^AQFs;q`u7A~7SyYezdAe9-9haz3g`Q_Z4XYf9XhH@ zYth}omV}X`eW8!#I-VguNipI3UfzAVzA_7b&La}s%oXr z+quA)y?giO50E00`?vV?=pJeesDtn-E-E6)%Fw5U26nc`j@w|wgrglvY$gp*qT)1{ z)*8Zokj74CCkQHrLF{}>+F=lxpw4HAGH~U@i6zWbM%V(GZr^3GpWow$552hKv`nnC zoynU43-TL}NnZ!lrY#cifr{bi(T|j>V1>x9NNEnnY2xhYyL4$u;oMQmIg?M4=;EV!*_ai0uBSc z-Z-n;*E>cl>y$T1Ls~~i5|!WFZ;cKkUkCesSQTKfo|U;|Togf`L4Qjck7;Suwq3ib zp8-CVs5ocl^H!#5bM17_)$pxmdQ&r z2RR^6Nl7HT$4;G^#s9!2q9C%#x-pW@GuZdI;`tErq|OVM8vqRO;=rSM>eOdw9c!}R zwh!3`$4&#AFsoR&{Ae`OP!Lk-M%=o2bC`bH0oQx(?zq}oN}sA+(W{?h+-(2FcJ0q# zo5~3SotRHa_;*K%#Q!v3-D8-43{rY1lU+ zeES!Y55R?NA*D(4=30XSsGL$qz5`EX*s;LBN8}xbdXp)AfA?T;7SSLjx(XYhF++x| zV-f^mxFB@v#&Z?dG4C5}ZoihEVxk@kZH#oyrAt;+@W4ejmafT>wiAgqlbPDkyH4p85%lK zXb)>3$-TC7jI)zdC2smiCBF)DD$aA^{vhfX{cJ#fDA~jikwZ5AmyYRoz$je4%poH= ziiOU7&%hc>Vg|RkgJjN`zT`uAfAL# z>&EZjy~61JdkyU^_5}Cl*wxp~Z^nRDtj5!jQ`CmdUdfoS;gj#cg4*kBU;K;TH zcs~yHYa2Y^T7<@G)rDUQaNH7=MIBCK@%EH~X(W&&c!E=ahSSe1N=!=Xib5!Ti+f?c zFrSne=nEMoTY-0X*@zWLqn%iRyY(^Eq4s}&mr;Y9sLQ_?Q2-q+B(wGH6B_s@Js=QX zpJl{KtDG)(*9z`d+TS*KsPb6390Xzit6L8r@(e0>Pde#gW4@*vybb*0`Lkyqa8u<) zkp$7oSzjBWpwl+;1?)YoTp}$GvHcww@(49dFk;mAaIJ!Vsj1&?`ue}2jKq&|%8CkL z$SGBcwQ|p1y~t|d+1v2VtlQ@t_ZXSmhO8B)aGzLvz%8-%gno&&cZa2iO!@@Hv~{*N zh!vb}7~X}xw`a{Rnx#%0l#~`=Ai>Y5s;krNAu(+zD=Ys0q$2efU0>L^kLTYc&?{*G z4TRiz3cYB8xOm#gBS`<5(7Z%EDnW7ZsNR__eytpS6Hx6tnTo5guW!$xUavX3_Qu8* zgtt*?7=Cjy^7bv~$?`q=x4V2E_Xw=gb$_@WD&zibp&EH z{W8H?;vaGL>~iKu0|JFGkgIWJXSZrq-;%=JB{!1E-q81n$cIBevI5E@h(%`K-cBjf z?V(hXV$`g!h;cH-9d}kjyZa=vc2b)$s)~~2(g~b-5{XU-3P;*~U55?pZfP0o*A{-m z#^$fyMiZh>I|L5xUQFNaIy$TA(n)AZq}#_iP5vUZMO$Pc&OXwVBQ_7?^+aJ2WyD`{NluFrB0$PQ@VLp&mQB$m z(t*e5aR5BYJ?K!QFYBCTa(wilJ+j%?*N@L5X8Zb@Wb5S{<6TEZ({;KyU;%Rb+FUPBx@&PUcSjtQBd<%E^<3H?3M(aT5#*ksVG)Eyw`F~6%r#fuoau5@in^4jGV(`fw{T?&H& zy|6PbFF(Yzanikc^Y$|P2Sf88r469X3H4?13X+nbX4mdgYDc(oa&13TnN)NXOoMO( zV6{-|0NIn9K}T1AdJaeO?b|ozkK-Z@`CkVd!e5(ol~Q^cq_wd6q5Mt_iEqL*F)j(h zWhsSu6pffI{13!1qfvUa??(csXGN76%~(JpXN%t++rW>kTQxri&8 zwKuk7IH=1Z>X9)c+cGlV(^E8)(1gb+N*Cl5Ezv(q0Rso4{aB%Mnvp4FG1Ha@HnxW2 zz<;4kUFM-n^_KPm;61?;Njr)dM!5z0W_-n3=WSUTe!)ChST_8Vg6JJ1cjW+w4Z!~l z>H{Q1saSla7A;U1pp@(YVV{-thsV~axyEZa$7TDVNXa`z`oL`g&(N^L?ISm#174Vv z<>rb9Pn&l^XJ3A5K8;!`nTKU4c)$`rvP6GVxT0%<6YK6bjy3C}AiKv1N(IspMFbtt?F>BLEL=Fa+7 z6h+Dh&6gcK)N&Q2YwjQqBuo@M@03+Ra>O^?78kdGo@%z3jt>Uu`>C=!D>Qb2K3#*nJ|KYg8kl*1*-Syskji^aJ#%IG0^r z8to32v!Q%@BnO<=bJ;WyBLt`lg4d`~_jq<f@>pD8GvsH#M5pCZ-+pPS#L$d_P!!%RfZ8I<&w%%Sc3i$g!wMRD;(GEg)}6xFY&@1fGH!z3phnF_knt0 ze%h^OT4rBC<>36sj~;a}o^20%k2H~wImui|eAY0LH8(X)X=#o&gMvm)PI_9}6%Hgw z0B9sg^>9{DGiBvG3|KyY{t0u;=*CZP-rxk_=H=y}{Nl4eCtUf_OWadbaf+*hr4Qk& zA;U2&$ip{-eZiWeewK0a!uO4WaKpMWp0OrHl_jRbi#Va^ko+ESP3=IO9RfnNnUQ1uOW0(+gDC}&!mNLZe;bN)o2j!i3|`=!g6Vw}OnYF>0DSXM zqaF#(@)UC<`ZI#NLEC6(IB>tf${663PaA&O$2C0cl@RRf*rmF_=ic2jAY5S5aJiNX ztpovd~*tGJ=1FoI7C~75oW$3Y21)8og8Djd0 zdIZr@qQz-cfKTZ1F9+DV3-JTF2ESbL)fAM5f7I0E1`;#TNzzbW&|cyrAf@5 zph27Me6Q?PS}XL-$~n+G8L}AnA%Z#%J5M~+QM(LR^I@J4uj1>DLN!GIt$30iZ;hV3 zq2!&L`dcJ8;#SI2S*fi(x_)ffIr~F)(+bewyR0+X;#FzsF(zZt4)Bm(g#Zg% zZy3#)B9qft2cQ0;ouY)cn$i|HN+au^PC`-~4T@DRF2kU63csGdX+(%vX{WTGSF?*b@+aXUyJ z1cKKTxh|tUWIPng$eFuXJo4Vx|64H|j`Hc#UE&^#T4vha22_h>a##Ws@lKF8Ksz<@ zrlK_f0a!O%`Zir$An}KH*?!srt&MnHGZ{HvFA}9W$5ofsCV4$2C1W8sWU56E#i7cZ z2zAUr5?N29%>zZF+J$`R1hVX^m(`eaLfwJ{+QpwEGJ_PMH>R(+JZAq;XqyyoLrPef zKae2cu=p?*7z`Mm9$QIv%HzhBnVt}B=|;PKxb-og^F>frUt49&jG8Me<3PSVHdf)x z`p%ZO(eF~i5N*_goKtpctE&3wQcw`jYBva%4<^l$Y+ZxAoL^#W6Km$&Yd7_w-F9$Y zJtH0X7L=Q6%%hp1yZlRtbQX9fJv|;E6dgT*nagN=qTI0-BZNSj5-*u<7^06e1JI6| zFeN@p4xHimUND#UP--gf0g*Xx&|P7R!?Bu>PzucE#3fIa6&TXbotvZ=Nj-tt(m)y_ z3t#fv$7hJDh=`Oc+<8NpsBwa~tlh9%L_^TQ9?YjeMc0%~f zU3_2e`|CGvI0*5|V!(wT86{c72zz@pv)}?4$b!d@$A7{{>^RVpsx}-wy_Ui`fLRx0 zEu3TksWY4aTyqn`z8Q7$2MB0J3B4CCsytJ2L)w=i8#vAI!N!OI<|wy}es^Ncoi|@V z03ZwCg5~lrkPcl@vaAH0IwT3(A^3h0GBSz_vv0Silw-S*R$orkW5={Z5PBohpfqXU zZ3i8QWY}9fTACrhr}gIMD^_>24*mbd>;QAIS!fqH6_G{`e7LqlsfkguS06s?*}He7 zjQJMk7nOCWjws$zG9fh4=q-kVD*t4R9^;0N@x(Yq(iE>Izp5Xk5}76k9A>Zhi%sgRAQ}6vxjR(p? z3I6)=gU5L<-s<_~%ccB3@4}rOh43ghmx%Vgx|%0aQc{xANWrwJj1Ie8mzJ7}seAhx&t5+MI^(%DC%PGZ@+PmWqEQ<(R6Rf>? z#*iTyTQY`?+V`M`#)yBry}ka_J5*!q(5+d~_G=!fZ`IJz7-46VG1I1%^zhQCQ|48x zT&J(n?6^UMPNi?&z*#4vi9}|L7@DKJ!hoR4s{`oGY*)3~ z*c+~-&hS{zQ5f=YSf!V$leak}@d=P#ibbI$)}{k~ifN(7K|ytOzss!hdj^*PCQ>^~l7!MOBd0~m1zZezX8)!9EL7kxO+i)u3CW&r0{ z^$Z_5a;HNQN&t2T=}g_JyPoZFcf*fo&f@B2F{A773QqkXuPLX6sExe%#bcjHS%Y?OC+1c(0nJDrL%R;|qZlOM!7><2| ztQB^|c(DvHF|lMOHV+*kgz#VG{&L?qTvp;kN08uo7#HTKLS`2VVS9%T#mS>PRcuUQ zg2{+eMkXczH$U8mIr*qq6ZfDs_=$LWc+AYrc}6Q)TpR?jYWMEknS}C!qj$(OO&e*P z#qxa*JcyUqssh|ERZD7ybP4LPs3`aJ*MImn;acXfe}mAeJM@X5vwk_hcKdy;_9Tvw zVIP8bA!OJ`d}DPzB%ho;1mD2aI`T^nk2SxezPcK+tf>|0zqdvF&*hJM7=>md8LIF24CfB=Yog0bEH`3qx2PRPOmKM2ianY-cFcd^6>8sgVQlipGC@-WY zNG=wRIPp%0y@#I5sbZ=@baXAW0>>~@6C(BfU@y8VJVZef9#$Ms~Z_PuV0+TNxHtz5~y*#OV%B9V^L79K3<&;y@uTfvSJPCk$^c z{`zQ6HeIeQ85dUe6Va|ya$du|#-bNZ(&h`Y74ClYL~k|8A(Lhy;xC zr-xVf(ysZA8#TSU^Y;n;_|J6&4!WUzRT7p}mfDmnTlXZtBnDz#+>}8mG%bi{y?Ps{ zGRb*3H-}lh8@LF->3*R@kgTxl66s>dkyo-teL+|sdB-wlxF{ZVM}MA)S{%Ureq_-q{u8YNog^x3eDhL zKwuC(4>wG@hPjRAs3(wppFMXj$|4`MM`OXm$wD2$h82!j?*k`JngloK3)h>pfqoHE z;At52Kb#x~Cjk@5qv_H8C;JD>Mug7pvu1r6Z?zZ}lKMTeMK`A1Z=M$fuqG~GwgcrH zTJ}@)`$XOWOHiaE39peW(jbK{tx-u6Zol$D0+agH!J%| zO3g|7aP$|7l-s*b2EWrP(T9we6Pl}=N79204j!VnXN!{*A!Y{?FPGzVw)fak z4xQ#r#QAv}-7N6wX4UWF+FL+e8bcAK94@WK*aSpeG&rJY^&-(a5^q(9?i`vJ?wY%6 zu;b5@=apQ%s#0Q5T`ds@c!fCUa`F0*3B!{fg4M^cvYUn6g+jZ0IhaLrO+h!}8sn_3 z2e3V!aAw?aB};*~YoTc>#W?E2haB~)&z~O*a@j|Uk~#WIc@!}=G$SM=ghz3W8Je%h z#EgV-pD^duL)H*1mlYR=2nlubQ~K)Y0!MSidjk2k!LXynqT?HAPI|yuK*p`sy0rjS zFs50o3cj>AH6gddEFnSAH*eni&ue%$WE!SS@?qX9_3e?}VCyE)Bek|s^SAe7i`mm6 z#6pR~(?b~p1boMje+(eSeCKl2Z+Pr{uWyJ2H1LnxyZ5fo6eKn#8uuVHkVm3fMRa(F z;}h9qmBlAIT);LjU(#q&+v1X%f18^=x&v)DdMg)lSx)8(%`#Q@wL{QD{%<|SG%RiU zrHk6iERMXA9R$P5I&kcrvtdVHPX1yMk2mJ=&lKVBXuiSe7jXsQUrkBJ%BpV1=s}oy z{3OzITJPAk>kMsl$PpPp0eGRp;|qO3;)5>)xew5T(-e`Jm@X$D2*}ZU=ie;o2Tc0P z|2ZoLB-63@w@(GBAz>CHApDCEuA$3o*)P;Svdjc%P(Lcv|V`$$#1HE0OAs}|q2(WTA*M%<}LyLYu;KR)#^-5$C zAc|P7v+Ff=H^f!d$kgxOKgwN&BLb8#z)N^jBC( zVW~k$hzgo@xwB-NG(_}alR%M10C4&<-X|mD!JwVA_p(m;F~U=%rVkjLG>qXa#blje zY}{AX-QWP;*sWR2>F$-E^5chpx%Rjg4Rl2Cl}eRf5WtON?qVIWGM7sz&h$>sIwCVo zB14?^D~n4O()!y`U2`k-IKHXu;J9h~3q@YOW8x%Y0t=ld`S|`y>Zs=*!Q_$D0*OXT zmB9HluT_jO?H%@tjjZm5L*pezBIsY_HthK9tZ{h-@wxXaHkTwB!B}Kwufg_$#d`C4WKU?c^Ola$H%|NrWwDVZ_t! z1AReF%1#$BF&yYd3L*gr7Y&iB4-;gNO_OUSpClE9@wST=w(RWdYzps{;m7m8`;?d&CH^Hj?KG&e}TvkTWJ0u8(SWiJ|R7h zDkf&89J#>F2jno@dt+Tko%a_;g!f|2zh|zT8;T&G=5bLZBA#(Dex=3iIC+?jRKvvU zH9o*QcYej|=1_qb28LKU6dW3tLn+C^LQIilF->JQy&IZ$=mPS6#u%TvIg- zJ-F}2@@3%IL&xw*=vnoaR32N}X~v~he-1c%Lc*xKk)9$?+<{-RDFM$9dFI`m9NvU* zht|ISaK>@%ocqsL&8EA8z@AcoXkZVn5#r~{%9u1DlUP6E?D866 zN&-vAwTm8$`3Mb6wu$Pv#@*f!X&e(;wtVYQj@2bqZ%6URvSr`XFV+bE4dQgNw~aL4 z%lEzNtV~%xQp8&69v|Sm!f^c;&U*rcv+TT2i4Bg{b8XkuBy#`$&a#`7zW0$49UIeE z)}Y1LuWQVAO~as!BSTBYu9Fopc((2!*5cod^9XhXJ{em$LufrVqMP z6#ys3CpPXBu!!_@!hjwI229sJ3vooT_jchCzEn{M4uF@-FLJ0R&7BbOYI!Y8rC`Fz z@eHNM;UMxIC2s#>HfL86vI`SUwM?9mBE8AyOltjIh$mzc=ePHnZnYCQ# z19*M%U=O8Ru5GpS;OiL)cDhZJm3INW$#ADH_MAdkCu9@Tu}rvC^_wsKe!F6Od8#5Y ziLul5e0;bNtV7N_GPdE@7Aus;m@D+z^!nV)9|Lq{UcYu=-J#U6DO_&5y{O;2-Wy+U zcDT^p71WzEF-_(AD?sf*s0)(BVZa_q!gkLOmVi!9^39%=N9>axYMJ|qtm#5;SJsBt z?>G0ITBRF&ZnkgD0KR^{1p%0diqNL*!7Hb;efHX$-6nbBaU+CiM5^?ir#yzVOq4l9 z66ACn!JE&s((?}?W``lWK!DKmB_3l!4C!e2Pqz%klvAxZ-;P|e3O(vTEPG2-)S%56yi7{ zDO}hs(gB{#G1j&nL0p8j$B(1H&P$k4%soLiPwF7apDoZsd0ILF%}z@x!PYcPb$Hh{ zjclW6G-L0Iuz#e1?so{7vE*?nG5&F*9UO%JD@j#b43|jsE09wQi%vGV z*+}85s*Dqmq_if1pezAL-14AJ)^SMgimgnCq+W32DI5$l0frA&VC{&Ik!Pm8ShhZ_ zqX&T$$^9SB-7KoQpy!YXyLT))Uxp&XVW13N*0e*zC-y1RtHazbU<>Qi)S*exOf=@ zQHiFfh?IrFIo8ZTvL0qAtGF88a3#;j{WTM`nmK8duwNTiPez<}5`98qEd&2F)j!XAzLtXU42|S}hB(SqSx%N=~w7kWk2@1ezCKc7lRQ zpB~Tc`chdbNTGgYaEMx$qer1+CO)E%*v#GAvzZwagrO3~PIuFY=S)O%xUoxH83!j&Y}fB#fTo=nH2I~*v0D}SOy zvb4D@FWDH&e0Q`jG+gyX9xZNtvY~XJpW-xI=%*JebR-ccGBWthJEYTws*1r;_O<;l zn}pm2*E4^KfQWr_OCobfQ4 z%1{C^60Uqy7wSNP)B{(0?$^g%13)XDD8N^cGi2X_0n3^(XU=078F8;iN<+W^a#G{p zJCVKkA6DDfn(7L+e~;$shQam3+t#6dX?Yj2E%WW`{+R&V&6WI8sBhb-Wtzx-~Rm#ZSqR0zP=wjWlXpJkS#xw zwoIhOzC(Ni+!r()haILfF%<)=?KwiZ9 zB9j{*XcOY$KJ<`Cb{a~J*V&SHC9@8&D6Jxz6=md6-vC7AKd??lOc6T$+%9%{vxO3x zcvewy!3}X*pa&4ue?z`H5@OaXrYcQ+rII{v0%TJT0E&PRx@V^hV%8Gf&gFL2Zls9f z*@@GHv8G}AuE!(=`z20;n6=5~5g=M$?;192gkywhkQXQ66^y%n)9y&(Ovu=oXRfH- z5ulgtyOv**$I;c>sEm7ttK6A=TvU-zTe9mlZ;mNboGJ)iMBO4lX`S``Fdh*j8#~W? zjrNqYi`U7|7E%^gyur`oKylC?%ctYaF4~_m6`?MLtOH8sGolMk2O^g&Jdh@_E(Cdq2x?>#Uwh}NDs)=DIk)@WbP&NlJN-zbm2e1xFY zJs))=#vf)`x~`jY7uiv);IsC9;kkjkjv#*fejfQ;{vXG*b~aKnTQV!EGJ~Et_W~QzIB72t9zz?;p}FVhtng52U1cz=&ZB8`ICz znRJUX{;FRU18k&-A~`w6>5ap69sM*KqhXyy;c`Ea7BBdnMt)?x+qOxmxf4a1xFkv{ zN$uY9kbD00YutDP&EJR>`g!GhP^jZI?yH_nR}hYqUSvMgozs0ZC#>z2>Hy%N@{}3m z9DEBIEX8^!X1?k9Dru37kX9C{nwuO&|Pt5fZOG9b?^3vqmgBS(~aE}AGC`8z!K62L<(Q4t7#Ku9y-;G zCm#JmGgw5>d1(dZoHL}Puiw7Czh}TFjsOG+qehQ@QW8V60Fj;K;XYkKmX=eGjE9bI zvPN6k7VroXVwQ)ft3$f%rOy<>2YVP8$eGFm7be40)Q3+J)JbOlL)ywnn_2ffV#<-< zSVZ^ZEGPT!=<5GgN0)VE^bTleqWY6L>@%#7P`}Y%l8_aAE zwUmkVwXrcvbViJ~Idy&jveUst8)?Y)VuZL*33*Z~@KD*-M z)3Z*5knk5Ce}i9>?cl+jr&UzEtndzmHi2d1x5O{}oEx!7lM2=&l*jAVuQxL_C31M( zbjh1bSzuVMRI-!e;Ktc!=ZSFjl1dFmpb-&cWNa8*XJ`h~H*W0WFYSS^9-Z_8T}O`I zd063^&)#Z@)~`={k?g=-86Eu7%0EuV9q#<6r}CQW`>m;$QLr;Y{@`xhKDVl9!Zqdz z8y$4f%SjI{Gj%)^I6+1R#&@W;ei_ zfc2k8Cw%G|)BtdRDH~yiMivwRc*XoUa#0JqL*q&-+kD5%BV2tPUtb?HYh&oSLY$$%ZQ?M!)G5 zIPm#o=0CAB=083hL*?3S9@&b!gBBAn(4x%5VdPIMl;KbyaWOHT?(RsnIA__NqMcb4^gvl1#Z-zzJzN!%D3n!jo#Uk!<(pek#79!zLS z^>0f{1%-qF^fugOc}7bA1g}JJ&B-98wH^T4F~jn-Wc~J&Yu1jgcwiOwN;n^|`nUh` zW&$CoNoCLxZDmT_qA*tc_ADElBM3(>tTz&}lG!Bgr^ZnGzP3wv*QFnAG>y}qSmCwM zyYYw{yBN%KJC;)NlM?(5iec%EZXDrm!saM8TU-oVX9s8!e-|_JYNNFfaGzZGd=+jzZ3>^}fHA8W{|bA{d?#VTOBm+@8HU-X{FoC~-ii`E#Z1*%FFt&j zjND4_c$uoYr)OSkRIaS+i&CrS*n_j(-7$o{1e->}1o9NqF~Lee@Hw8IJPk4Ts$<6m z3m1m3mg;2#PQ8B5wPx-cvz%bU8wgrNZ~tASz_UO5NKcR=icIgFmd+R_Cqv|N++SGg zDu@Ntl}DzYuSSk`r7GZde_|bc_i1#kcbk}mA_Q8!TAoN~-Xv6PlP3}!+8{MpimzS) zABgK+@E^g>XcvbsaZssorfaM_H1j$|$f07i zQ6v^7TZb|Tc>3R5{1)w26um_&KRR>1s_dc?aY06McwC`Zf)G@A%E;Dop z+}!RvUc`4#u}z7U1aFq!e%|OuyJ&DYCSqffB`f3^&Q4*v#`6`S0VM*xImZ$bglK|< z<^KJ!SEk5m0m;t<@u8h>%?`M+Ay}3$f}XtO0w3%Ic#&|eKr;xdy_57Kwe!a4*w|-j zo$f+=0NTQg1kB~E@$6%)l%hsl_^;fDoOAJ#C8SGmYnISo0>vKeB{Od1SBjHQ<)~R$P{cO$+6ZnGtNTv! z0}tH62g`m}=#(UqjcRhbSjM5>V)jo=Onbowwkfl7Wcf6ZxZ$SRI{JX(Y#Ko1 zCwwvuL)>X3=STH9odymRq>@OLH;HL%GeVzT3hGpUtuz7D3!qT>Q1udb8I%q6x|66p z6z+HFY$CaM#9xRgtPv5<>PsRL-E|^T@DePLV7RVsUZM-FD*0?J4qGL!?$@v0yxBNN zSkz|0Ll+wIWA^0vaGx5Y+$~5kQCNe?7*%#&>v(n63ZU zV{9b3@f1Fv6o$VHo~EkwLdJCowWyeQM}!c3Drg6azyY))%k{s!PmX_iVuqv#3Ge&D z6G+VDZ0f874?K7$B^zj9LE{QK??Q}2QW0OeILZxLK2y)}V|vE}Nn#L$pfI4o z!MJSaE1y=-6a1Kcfm#UeaWT;2$)H?dGTsEwm(#8xF=^094u9s2e~l#Yt9j0SK=R6J z^JXC^3y`ZS56xiT{UH<@ z$IRocpt^z(ry-*uCjE;~7K7o~rid1RiDeM9G$mn_L7*&}tEx1Uq=kcf64pQPy z4C~_DJ9yv#@lX^Y(vN=IO}z$~PU>ObWjj~thXDxF7?B!%`TSY9hUZpsgg|;u&-5Bc zjaUO>wq|8R8-L{Kmgy&~@rv`8vF*&Q7Ae4QY6IF4Hp40k7?=dSg=p=2Xk-B=4ayD`e) z_B1gfisl!>0)*^G(FW;PVLV_!AFchzj#WZn5PT`(yUt8A1>Gw&o%VXE)L&sr33`niHx|@8l}L=BV2AJW{K}uCkB+sS{u_BI zk~5y%>`)FpdQj;{y73gqHFe4qbvHmdko=qwE{@uR`hf|t5WrM`+y{pBD%?UpG#oFA&<> zj~p@J{Pc?U(<8TSGsHw=${BkDBclf;CDRg}oEj@g{&ZEoN;V5=mI9$PW$-O1Trk2Y zDjA-2FO?pk2P5iRB4ArEcW!dle4?(WXR6k|lMUi%{cj}Qpu zMb4Y9Hzh)n6ST;?pGMfLF#N^lNc9X1#0g7-oY;4;^jRxb&w|f&qtD;&SJK+GgIBCL zm!7^5)I>thjRskXks2%oKmOR;>E^wA^RqX%LAxkM+dWLm;Z`qtpKyylb`@DP-#WBP zkec=J*(oYHc`nLN8f(Uk5#%ooj?s_@#>Gr+Cxa03eikg<0+hSSZCY}yJ3BkGHerRJ z?lU*!H)^IX23^8e1=apc{@QmhtQX4{u4*6|9Rdjq5pxdL!t>F_wF1P(%AznygzE2+ zcbUxf>Q!B1J`mVh~mVcLf$#QW0ii79uVD;Uw2bT za2a9hj+4wC6=h|*8>T^0;tIeTr7G?|V}{e54iydkS%M71TuDU0H5E#S>`L(4tOhRh zayw8#`FLLxqI-eHF%8jgBpu@JZ5{KC}=FGXnx zNJ>~9kfcNAViJW!Bjd!0Jr>IsgV9cIFsN&uTgCPpW^22Ko^iSGg%cjX1)>UP_#LZr zXoQ_k%+wa)h+PL%SP z1Kz%Jz#S?5kp+eUW#fR{mLrtkZ%qirnE$H@sxTvs402{NMI zQun}k<8}Fgp9I@7c355?xEEoA_zi_504l z&%GBcs73x1S>oDlhe%uQzBvybDC)o|6lz3fi@GFoVCVcNPfpK{yhVf4*Mds+XVEXn zp3Lw4#PG^%>yu9VEL)bobKKxWGv=8!8lTbL~f%p)9^ z1m?Mp6Acxwcji)4O{;v8APD z>HS#0KEvT0_V0xXM~oTD%}s8h_-PiX{4b&++RMKR@L*wgNI`s*)L}b@4sGO%hfi=_ z6M-OuPbb7SLV&jJQ7DOABYFZ@X$(uMuPmcH)?=b-CE64o*(H$kdzI!X(`2Y%by1Uy z%IfNlCSGd%v>0I~zCDVU`{ay|n+$w1pA@hmFr{OA@*VlQ|2Cs?=#?v12wh3Z zHqab}#g$*bUVj-?BO!2A4yB&dD&H}9#`JQh%e+O3;pF;H#A4h@Js-g;(g*|;xU zI9f|-Bi`4^tNzpoFa%p>DP)l@O-78!p%~$moYD~_lXc<3H1pnK-0!%P|7b?(6=cDB zJWd_kxceB&Q%WK>a+S&G+yLVBogY)0A7zTBqhgz}_j9t<)Aq&A($2SJ5nt{gmYnS6 zW%}P463@l%{5)NjsQ55)__uw(PX{aSr*%g}tMuVUxG5eC;Zn`WX@6H_&teg-_Ts$0` z*Rca?Agd@X)g!=OK@GW%Q?|BHY|ublgD|iKL??=Sp^q-bNOOOvGj*(xwHM_fp%^>-lq`o0^lQ&G<|TlM=)H5!Tg zIXUEtk5=`JDD9lTyR*LjJPurWJyudPVzPOwPMt<;9k?@7dv<6BQHG)`BH3!niA5_p zn0$oSg-e1PUYk@}SOK9pH_4PNd7UYTO+t)DSq63y?4%P=a$DVvE($WNPJQQuvUx;^ z6fZ3#P^e^y#h5sAVDJN2q1z*jNI=ym8r59(j_lT}XV*0vjb!^;_h+$$O^qD=v7;-R z7xGk?dTe*h)TFpfcNOgUyh7u0<%H>gKmKWOtm2{TppZrP457PpBe22W#TqKru%#h& zobjK@uCC0=0)pdg6WYJcyJ?K>65L8js~*=VZ3z`(Lzhjg1)ixSkY|X1dIZl9-kztz zV3WuI&snpKp&$W{t%fSLCUpHDw$3~*=e2A5O>(g{NYWq@k`zfYL@Gs_B$+cb2vM0O zG$(}2QxX+QC`Dz6QijY*q%sSIQW-<){hrzTe(v{qUw=HG=ibuwyUyQvuJc&OI@YlU zJ#etpAeRD~#XCq(glFVld6g8yO(`(_-ThO4c0&J87$5gW+Mu#~hjU;j_WbW9WU_!` zr^H}`wrXl@D@x-3we97a*G#$Rf6nK`7`0s}@Q1+=lft~Q@B#cXe;Q=j>-)U8vc z*B)Em#$uyZKKMSKt}74ZXT^`8S&(&xUyN0Bnt^;g+xN#%D`mLz$fo&U?vR3@t#J9( zYxLiLZ?jwEU+EHYIDUUSxsbt^qkof&k&-a%MHB4>e}ea2MlN&t@+?3^rF+k?iXVi@ zGcaHj-H&$~DZ%R>ShevFF%zr8;0V!z)bh3qV^XgeE1Y`2WX;yT38D@)apI8EVBfoU zGf$sBzM;pu`Q5s7iKB$V)@t)i%5el(kCa4oAu1pBhmBxkGkR;V-SUS(ZJ|OH@~BRx zo(1TNmUV7*Q~3VVKJ;T)(~o<{l|WR6rl#reiUSvanHZ`ge9vIkkS3TvDf5LZBPooQa1C6Jdc@M^yyVHd0aQnH>SBKBvp)FJC$~s}EyEA3ot#Py-Lz zTIQTRf1Xyk#0NcNN7>Vf->V9y4#OM*0@2VqW9o#2_naR7ApBeP=lb3Wp-)u)Li7Jh zOG_#7X~+)ksMkqy+lq!HD4|L}0f>4@ProHX%7Cwpo7i2SqgN zB$_vz-9H)3KVnYD#Yba~=KhCqstp?c_T9Tdj9mxsE`;C_ET6D77GI1Z_3V|S<1KgX zHJRNSloIRD*k6olMS&@!ols6*q%9$8%IeEc_#n& z!BiXUpkdktUZ$dg(;!95e{MqJa`T35-Z@8!2*FLZ@U#M|oO(kLq`w60(`$APH$N;+ z{JS*T{V(0R;CS4Ma>*TiKGbz8O}x$nd)AXWY;J9 z$~3e2Qc?}QD9x6aBS2aGr&ES11Tpt5O9J!W2(C5NjHK2J`$RjN7?(}23hHF04?-^h zxJ<4=bwV;_1T{5sNfSXnk~j11@7=t4>dYCs+*0vIq_Kd~B6gI+AhS5WeXrr`3atB$ zkR8|X$B!R#AB;QV6k`$K%rq6A1}8Alm&QOI;s@0Q%oKcxyl>tJHj54vlWW4is<{cs zsv*y+e@IsfgaBq7%^5R1jPwB0&s{;PgX9(UtcW0UMN>u$&O2 z2Gu&T<3)eRQV<6^>Ur0mnK>DZ+x_i0HV>kV056(+uSbUDAu8Z758`4N#Y)Wb6glB@cxXq;@V!U{sGV#@wDg z$1%qBKl#3pJpOxH;zoMA9k(QY$qy}tVvMVTHdIC|?SXu_#>uscy_2$jvSaaF!hS*0VzWpnvTvT#0TcRk4-R$vZn|?Hfh59moG6i zsc-nP^l6S`|1Cn8+N3}&y8@#CdswjmN}=L>Z|^?(XxHFC`~WltE$Jo#7ZrEw>NN}K zvBV%QWboCd4dnx`?HzHbXFwv|J}YOgo_45E66*N#0LC{2^#c`*e?y3Kc!B|T1qqXm z584b1C|rFOEvl`n)4&NIY@{)3wndO^`Mu8cD<^Noz5k zD&Aq-XYgbVRn%YPK1pE>C&Atn(gA>_z2a+nbX!zs`VkAy_58q5AZe6;( z6s@x`a}XZDwghbn-XiU=0Hu7wscI=Nf78PR4^KvEqKc@muP3FR{M`@M47w?oUNQ&^ zM385fRw#<@u8V$kG@qTJPKh!|@Iap8|?ZPq#9FhF_QBneo zq^R9A2XWDv66b6Enm9c>);C^$c=Z}ZQIw_53a4+l)HQi9WtU099p}Ue!4zTmiN7E- zYO%os9V=;>3ClrxX;>s$a~pw*{KJkaD)AExuqk4EfyOL^ZTt+C1w|z#vPS1WWkEWz zO>xqoG)0ruy9usCERtoJcUa#V?Ooc?L?eN8R7P zf4^aLZCpB)JGQ+yU+;lc>?cg@SN;pN!C&U)2az>Cq+4XUr)MP}qtdP&gKT`U88}b@ zM?Gkp$}w!NHZWCz^wdi!080jMnB^*9A+{K`x_-Cr5Ue}A0SgfW`*m)B;t)|#qw^(Fv0f` zdx>LhRc)hSMi=J;hY4*7N5DJCuJ6RivM@~KUIwMEI)Wh@EOea1I0bPhZM-SI-=%5# zLF1yJdJ$0v!kof!VhC#4^wMA4q@z8xmCs?7L)!H_v@Ajs(qQ7K-g{cg$@vphh)YG2 z&WFuBhYkPoHSev4WVBP4l(IIgp_eF+Qx+ufI5npV1%2pofskx10uL?+_`C2VJN`c6 z6cp5injeE+H@yb~&;dPYd#ok+FL~O4f6L@jQU)%RBEMHZURNh;dC#p`*&A%|vZ8`0 zZh`#QvD5!F?fA)BYWx8^aigiSJZSqO2MjlUV8(uN83|~{ zVu`eZMq(8;wGko{LO)hJpzr$PW+HTg68J~RuAA|XShZTUn>2`IDCf2=i#(t2%bS?$v`S!9k=_O|xpUW%r$JY6^Ki zd;6L;d3wrb>t&@ooI3VOZLZIZi67>-H$RcQ{MF3mULUNlwki(MYTw>*ao6GBc8>|R zw3BSL+Wx%rqdvndJlpqLWI1z7j;Y6xr7KoG{}oXFd;U5lEXl3_ZuSlJW4}VrpQ+WR z6CfH_{jzgX2PpEcS+VA>)#{rLmx7h40=<8Hrq8pUQjN%~Hm;BhPNW|9LR)&7;q=~* zo<7yCQH>o#6n?RKaRCv43c%x+VIQAe6yqwZa>0dH^7Hxq6hjSFBAm@TTq>fQCY;|N zVyUxX0=nq#CeQ`@0+Qquqrtsr@wLmXwvfijjGt2gbN|O`Z>trI!+izy}Xh zYjk42($a~PXq^7e;(*8O5e_QDlJt7?Ksthy|J?Kg+qU&3KpO1Q)YP2s>Y7T@178Q| zrG){JwD44;1V|MY`)cw&I;h-uU0WWqU|coD*6)@Yieqt2dN zxL9K7b(VR3s+R{O&O}isCzWvPb1Og3@%O(l#qjRUn`A-O*q>_S zh4IT|G$Zx;^to47rdgxoqj*=@y0lfTlD>J|o7gHjPdyaFdt3r@&0Bc3^O@iqPfI;! z(PPI72ur3&83TTY{D3J1%%!a3rBQoiRGJAoArO-o;)Pt8QYkX%5+IUju%o?|cy!~< zCj?|vR#?YwJ$m3wCDu(8Rlijw(TfYTr#J_Crbr?FEC1@+*dR*UTzMS3rG#=WYrZ;# z9X!=ZMgzD;A;d^ssZBS)`;v-L`W-Ri8fOF&ZWX?=A(pi?W5T0@x+6z~>DbYyZ`aNF zlt)BH##dmavxVjZPty&>)INf{OD8MdbV%R&ZD&kyzdv|5c@EqYMfW!Hmq{AX%Gl_} z=@0fPGnEemdDiiUuMKj>ReIU7bY3;WPJ2COyH=uVev~{7BVscyO$_JWEPQ$)D z`jaR7MA>KiR`1KoGWWF=9WU%GbGN)T_nL(7RY{`1VuX!&8aiqj+2G$#=hESxHl=|YBq3WzqPyo7wWqdnT~s1WH5IIsRc+^) zIu~uUZY3uZZk?N82YtbwkF3Gks*#N+ungD<&qE;{EqZ+L^^%q4{t+eJj*FkVY$P8x zZt`Rl8);*$lx>bU*}kzE`>z%N=k%u9uT-r`x|%Nk6+IXQ78K6h>{e2-;V-t2L-%V{ z+A7%cp>%RfEh$g=Z;CV2KhEy4-o_on{|)i%nq@0iJO?j>SMc_?7@S3R$AlPw6jd3< z*7+`9?$akFR_KgVkm7Cqe*X1>hOh&$)@xSC6{J~~M)a;?#jc#GS`!`pm_2=V`bXqgz(>(ZMoMk{5~;xV z!bfoMK6s61W-=4T;lPk{b&D0(?bx*|gLXRx7&#?T)V%H?O6nLy;A`L?5P%p5C!Wi$ z#<;{gs(!7jL-ue3MSf4!QA{S}MAiE@a(tob^UCXR@h)ypD%nKgdSJ)R04J^9Z3{MI zaI^kTTs<)(OO3cH9j@iu%t2TjwAVxT@Qz*CUsJ*N>LF;%4e?ZmXl+?G_+onc1l?`i z$58kfv!S12%v*>hGT~Sz`F;J0vUt+8X%srK9OCwaEFv|B6+#(FDnR%o`9%tW+w!7;WPltDT5?K8V!KNJ z7OEW5DOKB2?@X#!P&(*3uwJ2NTXYYXe8NRd?+^|&*ATXjL2tKT>8&v%-LvhJ;Sx*p zVCgPS==srge0k;-8x#9Jc(>RJX7)x3&P0Y~ZWItHs7DT{U#^Bkmnt%x1BG_xTMyI= zk#h-G44WFsUZrThN#y_VrPY%YB!^V z&_>a_&Y{jlIl{)jCQxpM)Xo^sF1tpx2!Gf70xUgl-*7s3dSPY1XFV@91)pli z4+O}1DzwGRfk;)(O{w&4inC&`HVT$qEe;Nwd$;3-@xf*k$hIsjZDllW`t%FvL-m&w z6e92LTqB8*4Y8bZdXB=go@KJP{}_u&Sy+vpqhZ8cCcrG&V?e+~=j6u2-`7nYA?-PK z(OTuC19eQG!2&!t4NGj67Om>KSN&CYDShQkA}sWsSjEaMOZER^K`1pe6NxbQ;J znQAN0EW~x<|Na+KN~3H-7Z^xYO9#$#^p$Clz3JdN$SBHLGri-^n997p_IkXzu7q{2 zw5ewn%wWQp*`78V;sLeS%sbRKot@4%AFN>XPRr73Jpz!i(Pj!Ys!~CG&J}Z+OGSXw z+Rajf)p!Twn*Y25r6VO}k|_I5#9Hz!C^SdatLBP++}MTIax!jgLcc^$B_5~w8~TTC z*&Tx)7w40>H`c*ng!1e0w-(97p8v6|#-u!9eM29Iznaa-Yao(6sk**<*8clo{rmooVO-k1K zHRywq7Wn7V!82zDh>c2wt>dlie*IdEo(5N@M*u-UO|coUkF}c%2I0bsf{w#r7lNgubla|g`6sVYu?GEI6l5~;Ba z689S^r47Au6(Mw;gLK&yevP?xX$0aO21okV$C8=vr1xlbE$kxBBHru9w$#2u!K;oh z#IOg{880|!TWb}AhXJeww&wQ-{QmlgU+njj@i$^o)R3Grlu}0Ecwq5~>Ssd`f`Noz zEjeeSJ5F~ShNRtl^tk153TGICweao1qBN?X7z&G=1SxVYGADR4T!DU4kT%#Q&=q=Q zR7HI2q=)Y@t*vPct0BYmNKlh~l{()`9J$YAImwT?JlbNiuZ!x9%wiMi>+c=1(q!G`sDX=hx8$4u;kBS0Xs|&g3n2po zZfAF$#eAzr9gzza}FIaB)~C*W7+YOfM>b&%YTPw4ur z(;g+&`N+`OJzliw@`)}Q1YMUdS&G~Yp6Qa|>$2O-tLV|ArAW;Fc5rwGii1*kW@Y&y zdRR~+uf)gOyR7mz^HOn9!=;@Ooe2y%dGW$hZwJWE0#HqxI)mPT31|&khogMM8(3H+ zk3Fzy;;>cZ3OpUV>L=5!FzwXaan-#JlqhIGD%=?H?%PMx$!BPqDO0Cn%}zTy;#ce} z50s2Nq%V~2yLX#0q!y=9Ze>+l5{RTEx`k$gC-Du&Pz+%L=&YyOMi^63agEekrvqvI z$|dMGqEJIRev;x2sy1E-`32Y*<+xQOgO#ZkZ3 zp|BN!gy$PD^u_&&xxvbXo~F(wM-1zYOX@ral`xmewWeTV#@Ct|bl`I&n5fb;z^y&0 za5Gr99VZh~u&n4k(e zP#x&W$VZ1Vl_S2KdwOfL@td(7NT-5VtZ^7V`ltLqvCeb0k%kTTY;)h5=fZ`<=oqY; z^o?FdNJyIzBLZK9Q)1H7n*#w0q9a46sdZt)c$|6hIfCRB=JdU1(5~-2XU^Jyt!Zg^ zJW&FsMGi;~Fh@TN;3H!aeBZ87@M1k<98MlRTK}M}j#TXUFzGJb3r)etWC805yXB2W zc2jXD=5F4z=MhRzZ11sCgaORK0BKA1Hv$wLw~4U=E# zHR69RIrjvEck`iqogfkiE(IK$2{&w(^XCWSKS<#X2C8F6|JT>sYDRwJ;3D*ccF1hF zFBJsO>o>B}H2v^G%QZ>gZg`xcE8*b1d~?aAsE`n=@}cUMf3Y-dSXpsQy6m`t=M)jt zucdVImdh`3!v^hU`Yok#3VW49Bb83<6!t4jkODj%I53k0p{MEwmV||a1H^1)Lp)^& z*5&1*fx6oywuSU`!_l$%LGPH_tJ?B!>7bftsu^MPs?Lv(Ln8YfvK`AfMi4WK!O+M^ zYgkNvInTA;MprY^j2xdEW5*4Ts#g4NY>~Xp=*lm9@`P`^jd}reK#wi?%<-L{u?oQq z*T2qcxXHZo`V!1$qp|e!lWU8`gxg&G3&G+H%V#Eef*1 z9@l^t%nRewTdFIwSR+O!>}=6le&oiC=FclJU*;CGsw_a&_J+rjxlxh{z4y4BU)HKd z^+nL7#*{bd9#e?`&EG8@*2=SkGO{H7F`Jf-ZbYX;BX$@pUyFoSD#l5 zk}h9z&M&d@<`wrkjy+9^(z8FB$MTw9X~!*P&OP8V-`sXJ$;2P5)z1HHm5sgqZ4N=^ z!sjy`9fNfw8{%=`-SMn5pswJ+i&d=vT#eGK_x|1gNvL?PYS+`(z43L@QV3Pl7ng!0 zCTzr^!tHm|<=5Ep8wDt4@dx0LCGb?FdS4j<0O{El^N5vKYS=BS^5sm@Zz7hwA<+N|MQk; z>-hHk{rmUuiVcmwY8LG9B|ss)4X?DNU(Dmo3(z^5%b48a7-sCN`KA`?ZLR?rcu|cb2}%N9a?Md8FaMLr z@dk|323oqR&1oijMkG)2y0NC**{=7V%SQdG*V=XCcQ+^=-r;` z%GrrkYepS8cH+d9UP_n#nxI{<#Mvan)N_zH%RFQ3oq-({|104tDItS9_pU1{8n|1( zH`0EXxb_!kKro-zh+5DbV*k5?A4sS?jYJrblX=OD`ezyMu(MEy5ItcmFPv_EmSqEt z49PDmRbRAu*|ampZuIDA5CC$Ai3aVnlPrG`W(0c>Jcp(0Kynjo_HTA|osuLi@xeNF z)D0h1U)qC) zmdO>Fmjk$yCMEH`d3JW=XjGA&pc#~32dSf(dH5z$MM>J}Fkb{T+NyIH>MA%8`L zi-1`I+63cXe4b(hIW%UJ^gjPWXTf9AG<}?HY2n%a|7vY@sa*2HeA74S0|0b6rdP>H+k|3_*?F+*{4hW zddSrO53K01=N1X|t4++EJ?Izsb2h7Yu%R1imskQdC>oDhU-T@Haj9DwoZzD`K6JC?ov&Rn~B;{T&RE zE72Rj{AFH?-g`DKG$?4~Oc@FClr!~+XeELMz~t=ggbV`Qz^7&BE@?d7U9>%0+TP%E zCrWsj=3Zg6)1N=-Mgxbh-)eVwPP?(}0veSre3H6wY1vX|MKh^_HrwphoRXW-J}g&9 zIrgsygO5%yfFCw*Q7GV|DI#+?Q%}W=KQwef~j@I;h9!s(TuI`??hy?uJ}-$M5*B z8dV?8)jy9LygT$m_r{*)A%bW7zZeUisJ&HbghNZXedV1o1-guve|C0pS5cLs0V3qT zt5Rq>X>?){Jlm00k$`ds>eA4{4&Ah(b!{sGMA$#)Zl5Wab+z;y4O^bo-cV6_Z}`*? z%s6hYZb2udq$r9L%a}_jc7RJ;WP1d&7#V+=v?-hZLB}v-|1P&`8%bM+ULPuKh8q73 zOL+K6kTHX`&7#RY9R%z27qAbzG#{VH70SW=&?E4T@2IyKAp)#}^k8NF+SQfAbiUi* zm}eAT@jbc_wyXt)@p*YN&^WsPyrzG-5-F*I*|}d;{zGbURqqq*q`KIA?rG|CW`CIe zpUAJJm4((qME*!ogM)5Be{j`Yrg92W%gM>k;UdnE-?rfd+!9pD@Zmg^h4l13W!C7$ zxT&uExs>dN510LS<={#7q40$R77>`AgR3Z(5#O4v*1TGG121b>|Fc>JPJkdVD9$5xbjjj8oiTG7Vu4i6B!^6kMC@YWcKnf$BCp(Y12=^ks92X8>A`8#h|9 zL0V&EUGbSC+ynIf7}r7pIjR1XmTIuwQjW~-5m^7SrO~(n>JX-)WqaG zeFzmtWa{f-V<=lZ57=+1GlW5Qe4c|FhfiqG&U9UGs3ts$synu7XbBsRoeUFAKV=1# zrOg^ibcKj{Jgj}?C>z~E0<9>=eLRTL023M{`xm~AeV9Z;Z6k9dnpU=CqgB6rxfp#{ z@tB8;!9=gnZz0#oH@7n9>Vqx^SUE zHYg)CHQ1+WJh{z1e;(s$?+Yd81e;pco@2jkjdqQyQq*V(vl(>)F)v>v1|8HY|rccX+^q@1MSZ=Wp?l zB?GMQ%x}d?VK{2iXI7VnbyJBrc+iC@=Ii>ru>?^5a|oRO`iHE>C*sI|{pZ&I|Ns2H z-FxLsEl~sonftYTCzm=qd|Ca~hf|mMDj!TgYtis}bCcKn4?eP)L!}x|D}Mbv??Z9b zu%J@KjGblsCIw6-S#C%f_sc6rnnj?@W@>7xN@?@Wo5<=Gm_F(jUb~ini+tK{#Slvd zt3himOG=!}T|SR+tAJ^d$p|4dM`{fwVcf(+Te2-g~fpP*qbii~h0CUJr%y(7t`s z7SCuGVPh8ULwWMqO$Iue3>`|o`tHMrp!(qyn5Gz}96bs<&MY8&dTzbRY#2Fh=FHy8 zk`nJssM4164`<2(`jsWk#epu$5F6}r^obL%R(yW9Y*l&K{EYL*j*Ze+z4>Md zUE35Dakh!~JU(CtmB%cv-8%erBcA60$!Ixk^mRkl-Y?! zE?QN0?P?$K<>Z}lkY{dg6p+3AJ8F~RpaTOfzFFa6wbVHbpv9lf1)4gN?a|S_w%KVmZHzxk`oH?| z@U$t2?VnI7C$m>-&@Ur;%(k^{aq!+;V|AapM()nm;WEDl6c2b&=SLa)qSqh`i)Tz> zz8nz7aa&>Dg=R)7_nj5Os@JoBsA4)f;TbZ&VF##+c2K;*=&H=pUJLz3xgPkYw()D> z*mn}mm>YKSf9_Go9|(Q zVqgGzFU57UaD3BQ@0?8Oh7Lgt*y>lGc?9q!ocuf_E1)&?T@;*PIaOP9X^^yLbZDzJ z%F|Avrm0y*v5;4kS(uU%jwC{;Bnf4BnZc3JoU+~SFmbv5*DsD09kmpno}i_j)d~RavVqNzZHv~5Lv9oqskooU!K?S4UaGCJTBu>3zzOe^ z?CeIkdU>Tz4F_8eLav(4U=Q(GGmkjo-|EU8-}&j?=cD5s_cMa4n+omU($5b~P>*x; zqiutR0`FmWT#d1n+o*IhNsWDn@^l7k3x`fXhz=|zZD&o;zC68i$Ea7Y48v?K>!+ZAFz9qTp|V$K35gwRV)0}E27%JW zt^Q_0ilaX5Q1*KLbaY}NbUQ07{q*{8#dW7$b7f$^(V)}QeXa8+paR@123nIzCI`73w)WobtBc)Gcp>JJn4I7VOXxKn9qQKuycTrPg1K)%Y1}948 z&fJ2k-~1~EF(^CT-RLk8!_yS{rZY0{(Plj|oPVP!qGE*#IG+1O5{k1AUlU|@`*^WMWY{& zIAQW+3}!!*3gI`=QIVF28af9c!QpzT`uJ0No;p>S=5l2+1|cvon+1rl0iH%v?g`aF z=mLoWIuvea1auVa7^>Ll3Xf6#6|v*)n@jJ4b?Wp^AtlmDVZ;-eDw;W0$kPn zhCIV?a>xU7Ycrz+e1zr$$q3EtS1LYt zSNWR`_(_x0igTANTZVWd(K*=y9$LUCYingWu5SoB90ZxSmuK>wlY^wvz~ESV`p!FZ zgiJKQ{3+cB)JPaUbn8vy84J(RhBMC77d&S!?=))#u9ToJ7-~zM)F~&}cXVz!CQm}& zf`T2%@*J!`TZij*@BW6Jj8dBo`Sj^;C^(iKSI#!_UCqqYYzwI>3aKDnUyo&(c4ng9 z1|c~$SLKK+wAIx8@Fy}7JGo8ypJ?MKs3H1WyH?)2KX`j)PGHQv3jUm)a)P&u|8Nb( zfBY)Ge)@#91zQBG=dRoA(BRy?d-u;IEy}tjB?D3Rm6i?y_KY}$i5K?b{9$+_+kP@t zFl^iO^ok!otn(WJH+^n;VBITQ#Kk-;c@HI8a1RY7X!DpAL)51PN|lXhhwP4P52lj; zLg@*|@W>H_SWTp31mAf5V}}lnpD{xi*`U7Zz2`%9HSH#-mcC-coHoVV)zz3Vz|3Rf z6_N|$62)Tskt17LDT7Cc3ONRzjgs&@vJd=J+DXAhE= zS4WJ+4yHHT#MIQ|bg74lhHW7+n$<*u$0Xk%l5(WQ7{~m9TL!>b!BAig(aeb9*|Fv+yJxeqnn;7- zv}w^Hw2TSr3X|YqZ+|6l0oQHHi4&XfaP8UCEo}-mD5o+r>A%K>UpW0075$~CxS943 zOl;Viub2Gb`>@%>mCqa%#zuP^rA{%VmdQLHo`r4$$}rr4EVtUm?rIx3j5}ju?z~)- zTA?E`!S{pMwd<-o6&~_IdO`DU-SQ&Ra1Tcg^XDrOanX-fUE096qQ1}cWmWoPxlAykqx4P(0^eg~V$oE?-O0(K4|CqUo)I>vertlIWx05%r?GFqsvLT# z{7Eh@yo6tG?`WyoGPFmO&d~7#W>CcK+q+jzUY^`@&!{7~(K0FZeBFtYI6sjRN7*;R z_G5Ji+{KZmy{6{R#|v{fH{4(7&;fLWAZl{E_UvKS`Yk+9`t+ephJ9@Vxi3G#w1T~y zVYF=Y{gf}EGF3r(3@&YMGMooLSFBm^?#s1eafJlC!+;C%u@Am@m%ai^;L<_!{02y^Hc@`=0Ub&#N`eQ)D@iSvHxSwC9;Cm1NS zYK6ncTq>F)4hchyq@-3%+${9O(7!zeOAH$bht1w4VhlInl#2;TBGWW7NB+9Bgs-sz z06Tqp$H);#7O9D|_xTMZUib@Q?^5~==7PJ+aK{ZglxEMys^t(qn!Et~#b6yoJ=^Sk zf}u;cKQWGi6!_zDW;GF#iv(OQW^~oplG{}mCr9HjKnBcW^Iz}0S<*triUfzi${(`) zf2-Z`j{3laFUXs5a0LK<`TCVgNyu_*&Bt@mb+Qo&8Q!Jz+>oSLg~=1y^tyG^k-Xvr zmX}|ibDE7_U0xm*e%Mi;i-OtWDJi{)%S38*V;#mmu^G6Kx2#`JCCDGzflWjMTj8?R zj8@dj96>iB+75zGJ8kV5pfe;0RN5yEdfwQ16VnYj5t@;6P)JRAq+!c9EjEPK3t0Q8)S@MHw78hE}HtH{!qR~x-!vTg~$b3r#6Ksb_Zsd_8@dX*iMUv)1 zp?_9qDkQVavk5zd=GNiXd{0h?_qfAHjtmWI#OJvUaPLyE^x1hkH+FGV~??7|&xgH*HIV!f}03X-BK0FUMwT`BcE)sl^Hg_Df1jRY&+_zKud|-{z(^KEPlk>irCij7X4wxtP48&#KtM7p zvX!q~B2AbB2cC_O&%1GB9(#!7v`d#R78Wy;Cqb^Q^7CV8C2D@4Fv4Go12OTi)MUFL zh5W(e&|cc>waY3V+fC)7{|^&}KE*kr?!r0A0BcQ3{2dh&Po3I+uL7XCd*@Ef4C?$Y zeEPKHL_gd?>;1ExldlE3OG0<<+BKElb+AyJ;}!0+ZrzNd?A10hU$o-m$3T{o8;D$% zoALGQFF*2sPWzFcaOez+@2X%Dd4AQbl*1UPMFlWXo3fVB{?yytO=sPqt7ILjX1X5E1 z-pZmIK5(Fuii#5gPLwS``=#fe0Jb>TUgW17OLx*3Y$eIA38K#cUy_K zS@fL*M}4k2{@KWJ6XG24@}U(#G=}pc2}F>C^cyR0h%bqsV-n@FYWg~d#M7nTP=r_| z|Bk-l5wE`?UO&n{!6}I*SQ}l+;jrS9juRJX9@9shsyY+|O52v1CcGw)N?*T{<_WY+ zJ$h7-EHJ80ciVpEZk#w_$baF3NAETy22pseDLm9NbM&O+55+_9OCb6-#B&pZ5)FIy zEG3=gqT6vpOv~bCo?@t$>8#P_8jC|5x7Xdq{YwNR%_gH>1)u=haMt-@AOs5n>cCB6 zw7x3t&a~CBR$wUPAgFod!xl3ii`pNXfuCoDm)geVIChYGg3FsIHX}tb)vP916GT)t zUS){`zEx>N-vK8e1Ug}(3p^+})(!prLTTGV%>8O>QOo|uii<>5uX}g=Vj#8Py@rur zq1uM~%XOs%S3az8*^28PCZcKB!~~^xRdqF7dwG3XiJ6&3`ySQE}V$-G}j5LLL z^7Lftst+G(V`Jmt(T%U};9#-jwIo!hgdLV(*Nw@lqC(0Ca=ihc=VIiIWQx$V%`V;J zh6>vH#66PgcOJM%%Inng-wDVK;~c@4 z6)31UVI;>e+oYH{bdkD4BM5UF(aNsSPb7 z?rErPD1Wh&(qcUMG5R^+Z&Ib8L3vNZni@_ci_gvuB;{pHNV9-`Ip84EUs>)4c$)Tj zejFFY-3Jcbbx#w6{+b#CydTYKR@6ruRe*`mkuk^UC_f56ivW^y>1qmYU1z2 zqUSyvohP5pmiB$pdfHlm3_>QFg}~vwCN}?vOHbi-;7Q0Vs2mH~?@xJBq0Nzz0SkMG znrbE{0XKL|Jg{1~X|wZ&2iu5qEmWIDnW{f>ymYiCt3{5WL~}VX0*x4S2CeHQxS9Kw zx7u;zuu~Ej3y|qfW(8>v+m_s7oW3flA6E)_sYw*Ayq_uyyH*|c`~_PcnbiYJ7o+ZU zOO{wrH{c5IM$Bbbla9K$3>z|}fsA)b=U|7#S$o!!mXP)Kp~IGHD1MM+9q~o)_&6v% z@3NDZ&oAOtauh5q8dZa8#REO`8w`wsM-0#;nquzfd?#L@nLPW<@ zWBR`$wD;s|qQ#Q)-qKlJy`GoME`^AMy$1yaaW#=@NJ4Q|VAB#Bi#$!4H?OUYylft; z?39#xt(%2KAV0@@mXnDy`Zn--Q~ws~a#pE|o2D2lN+g_v7V9o!f5TCP$wKGi_xUX~ zVfc$uycr{_|3dP)3Y#~gL7^vIdJL>V5ZYD_1wX+3?wvb)4pn2(h+ODdGQ*+7)}GXg zvMa+p=%CxkOT?0p7Lw*(1Z=-M_;&Q=fw*N2)n*Ns#W2(x)^I7JSAJr|A)xfsR9ERx zol!?V5i3h}GrpY(rS%Xk2y;U+d=T zO54kkqIb0aa5^_`*)nX&>-F|}$4{JqWBtHUfC5HCIn{6ydP>k1S=ThTA3=@N(hF#o z1G0rKe+q~uK|XQ(xK^i52jF7^e)%e{qq~QuogC_}U>nkn^19UVzA!e#ZXs&^@#zS? zF8Fk8*#gCv1bNLtEdMoYvTRq0u!SWQKpvz`IlZ~#L=00Tg;n~J#9QBD%Y zO5$E|VQQ+Y8{%SMqsvuGfbgWz)7xw{N;-&AK@h&$*az(ag5U3iWYj;rGE}f8=H`#V zg`gdRBD;_SceQsgvoP2?AL#<+KBlo6?E9wz+LlzC$O9hX|Kfiq*!H=jkvXph!;$(7 zm^Pi-5|tM|<^bAEoSSan9s*0a?lL-3AwZ3D*WFeL=A%=PbG&5We&1=kB2yP{V;74t zw-bhRS_s$%q>@pLI?~%Yol)fzCQfW2FP}2)3^U{yveZZlhssSK;6)<6h zaC5;Xg54BZ@wc*E8t*wHBl+Y>l97UqWA~4QiK~qvbGI}?4=?Ve{fuyjg z=?ba9BrU8r5IQqB!*D>ulqXMrr({0t0AgwXrp!wgtsHWD`oizvu@-W{bQD5Xb) zIM^4i4xr4n+}sfKBDhGB?7@#18AWoMuU%tbK*%U%J(Sbh@Z{{`u>5j#3lRJ0?v*r6 zkCv){_BU+WG(F2VIV)>5V{(X(+#uVcqrK+OFXIzvgLKbPtXd<^kLF1k+i_nu_Q|$X zhUMrXb~YQ4Hbw|^YEICB;5c8a2Rsif_w>n=F#wN=iW)@!fqYm<%z?aTEzSR44*y$q z_Zjw|W`lPw;$p#T0+#|ueTrtNKpAL8yD*QC#$Y%!?Q~J_j$vw@`7>>r`Jh3x@D_Nc zqe!MBcLH4l*RBzPzN3MI>>ARk=IIvY*5T|7U~7J$1vdfP`AwZ)_wL={q2Y^3B_*L4 zc*3MGat=q04Od?!Oy0cs-1MsZn<*^Ij~)!m^!<5QQy9D||ZK6dCC%!r+`a zdh0H0Fwl@j%@9lE-l)>g;S37Qi1ayvw03}R;O(bR#XuEkq;H=-iGPILmE8TbZ#gHD zz{u(3j03Tfv*j6Pi5`}-(N+%5oojdzpAf1uKEXbXv2Di2^$_!^=KUDzHL&AdunLY_ z2T{{Qz)@tT{EosH&;-+BV{1!!%GLZ9u%@8Ek-z2jU`n93?h}i-vk&WBOo_3`uiXZ5Y-dC)K$#gUW_ftvyx+SjnH8n<1nfq| z0Y8ytd8Cn$e32(*w9y zuPV+X5jGz_V~eM4{^uqyiME973`>YD@6qg({#)3enp&a=b85tWBMQp5oS;^ko z9}S45qj07yym$vYl-8|UxD<-RCASqV9?!{9B7-R_m`JF#Rv9umd|6e!7(4-y^C0GL^v}K__>VKkVKH{ z0IC3$ZcR>8C#}uI=FaB#(-@`UeKaDVW4JX}?Jrh8HD&a~iMtq620)j{SrbzTBn!N} zaOGRCJteN_9X4;6`P_f>h^Bbqjf8FysX;vx%ppYpl`NClW>1_?z-v&HQw@vpXA3gMf^VG`eBaR2~__M*6R65(VjeQ9Vgx4QRLIk^c9E3Y z>b5oO5KiNz?;(Q_OV0~?&V$mRjB<0OKkUJujbo}SL0shp5*jmk7A|=)=^#8}e90hs zI;;|l@TJB^G0#1XuNM|3>-*pe+AQigps3> zAJF-hfBr!>fTcJO%?%|9C1AR?oVV{ij04$NogWp7E1Aoo=GiSbZ;r}vo-L6B9n5JBfA%so&4fphZP&p%4y5~$_#POi~Fk~P&< zUsYEU`t;oB#GGE;r)AF4rL_a;AYp&y=B{dPZw{PkvsZOAz3PSUGH6^ z7z{^1Z+dpR9ZqBB4<|ZeGOi=_w~f^V^IxRjB~g}XQ>q}JYHD1Zoi{uU`c*V`m?$3A z{h*Zz4rQH6Um%{rF87LA+=~GL0d(x4>qh~Uk)a@w3`D;S!$bO=17(M9Wy+L+YydFG zq~qA>`fA70=|g)R_E*4ifXop12VN0{?LU4XZ6#|c#ZjAjYP%90GbJxrekjUW>t0hi zOiO<7@ZneSoWWajU4as>@K4}oAZqO&uy7`2h||8aSZt_yw#eAACygfQ7SByiNx7ys zn;au#f&q!=>PeG!)0Go_2TB@fMCl5qo61MYI}2}jS?`%Z91|=SiTT`;G?`;Q)^XYx z5ZcK=#bVCq=^nk8nC z(my%lnd=q*#+#&s`)- zXs1X>md3WSaVTZhYklsz8pBMam9C;b6ft8gqGQd(xci=_q`xBk&nh7_aYc5K06@ws zEBAtobd;aXxJw$1>1|$i1`kIkhVKCB2pe6Mh?49!S;fbpS4zKa%1B|~z!#$iyWt@Q zjcTL{mb$)#$wPR$N+O7i|`K;@^Ez;dzQa3=1Vc^!mH#~$?*!xXAu<_OX>$lm!lX11|9EBmo1Q7Kf1&xL?qd|#0h zw{T$%SDq1rQ?n*jKQ~=)ucUV$W*)#Sky{WG9zFz1Ubw5A{V1#Yv?!b9G*KTP8L2sY z{(M0WklG~lK|aQX&Rlg!bRrSc`vMuZnDzTS@RJhAixhnCNXT7xdY})Xp5UZ zZd@0&jWnGh?EmP2zn5yLj(b`OsQ}mPrAxv2+DPAhvxFREc%J!OSc}{V5e*f+r zxi|$01iJkXlyt)RIUB^1if}(Y{mQq2k;9}_ZP9tLv!EPpb;p%^$U)Ne-a{#yH+GA! zOtD_IHC8IzI+P&dk1|Y%0OhFqhNP{NQnVqXI#S<#yvMljtL|%M<)YS`%ac%h}}F?JT8-<>t37_s7 z3a+8|DyX^*Ff}E%$2r=?Ii`kb)KrgmpBvfBzyLw`hIrmt$(slI8_d3??fdAuukjaz zKd66&jm;YD0{NOyzWau@oc7#3ZAzRYObW21YQ7V31|s;|yP}Z{g6z;C=lgm+O6{jk z?W0|X7Q9qfM13TiJjD}oFd!vqB2(%-t8SFMn&0#;4m$-p=Mod=k|{6@?G!0D_z6{{ z#XbB2H^OXM<~1)Wp%t)Jq$ z@iS*`PELTa@*c2hM&{22#@>yx$aOPRn@(Q*rRe$oy;jS>({|R@>TcK9Dl4m6?cU(p zHsDh6#KjK^^NZ^qJgPgkJpD+>u3wPmctX&w`$v1P6}QVvsG@p z<+oq?KYo8IPkc4YYuB-g&wJ)fzdQ8%+b63(4ticA{iu_im1Sku`rDP45C4F~&7p*} zB_B&3)C_{g+jwxKGP8rzv$C}I&w`xtHq+X871Ee0zp+Q|nxG?sJ^a80PfsR=yt;4Y@OXwN*cE$G_Jq}{{q-h`Tw>Y*vy>?JDL^T|j+SlW} z2c7{PQFz*iyyDJ)=d=XbjUNWDux#*9BO_87g^gE_J$x^?;?z_!Hfd;|>1S&p;pM-cm~@=V^0vNZgDDapD#RY`@SuZ?;vo^5>Ad&MstAUl z>>ac;Vb7ip+w6uAwIfF`+~gEwo~!E%#7705UkKh)4CPzRnP~8E>34a!m?^kd0Z-Au z;9)hoX-!<*%ca%*?8@5c?I#0hc;3_q?rBmqlVmEH%oC$nt|o`ncgOFNgC3Sxzt36b z$f`Pjc?Ma8=)U+yLY!;>e4cB)uEsREH(8{B=j4vW}Z1i*a}NDGR~=tmP!s8b>w|zCBcLZ zs`Gi+(Ya|;+H7}6#k_gbrr=GT5E#O7NJ4`>A2!hbW2H7xH zm1duPV0n3dre_vBdPF*S0_OPa&n=raEjl+HSF7H8{*wO;%CX!5Wki{*|BbE8o)F`V zFo`hL^jWx2X{IU8#u5o)1$p@}>Bv^QMrj9lnf^R+`Q;)cL~R^&Br;Ajwba!Y4eVH; zx+Ob{!JCYlnI%TJilMVFuBN1Vr z8xHrpRvA65U@T3+Qpuh7=AodV`#2q%3c-n(2F-KPU$oF~*|X)BdMmD*mgXLg#rOK> z_``NlmqVUC)UQ@&{Tm(ukK(`uBMi9%&YYo^RQvU7ixrW=dyD~NZQF9UlgJEZTobno zi67$u^^_%$%%Fen$v1D`e%p|SHj*J6C|9iZI^s}(9rMhkF7RucH#^{V1aIZ*YgU;u zf$n}d9mkS3t)pQE6EIG5V^TB&9d%EGL!hlZ^_*{)eeTq_luIr_z z_bV3o&=TXBPWx)@n956m~iWe&70>Kt3$qc zF=XuZjB^XV2FARGh|ryOeGu`b0qo3HDL$bLRLm znNx2^)c*Y!;2>dQD&N0HaTxp~L=(=6(~I)z4S{ZC) zRE=FeTZp@oTJMNMK<-7SWoDL=nXtWRYhYKX2O|1rpmsmBGgRHl{fyQ5uqcAHR8~^?r z>t|@9A+%!y5|=LR$JJBl3HO4Ol@uHV#l}7d$%8R%Tq)rye9M-xetrY}+S;%Ev8DQ& zizM6{Jvk~E|L;#%{3*;`qiB53!z8zx)1A4NhRa9|0lOnduH(vPC=_LpT>n(c_K-Jk z-|jwm@L)`gP%ZZND#k8$?CBQDbt)Pf2s?z{)~nMZ9Z6`eE5CqT#>z{X`WB@Sa^cYZ zgONLT@7}_+%ys+gDco5uaCm&#$Ey#k7O{MgjOX?%7l**naHH+3h^k&Yg1ik4dwfeUj%c>bolKfQ#w8``!4- z!is*9G5(6%>=+(#sKYwH(TfH?!E+iyl@c;H6HYSzagOSpJCioIel=$8x^>vCp@cQ< zx;z-7bJwnk4i1~4ou)i(g*a=>FMrMm6d2qUB@lS<;^IlhGi27d_6Kte7?2acpGzU9 zsnJ|yVXuxw)Qf_(OteAU}P-J^>-$-$WFjxdaTa=`}wyNEXzJ7jL z1-}>81h?q@n1r()q!e(sLF=55XGmcZ*$9=mt@cA4${v(v5D+q{AzA^%_((uoP~ zm}oH3*7ho6xh6O{nHU?p&Yw?*c+*>@@r|KvtwSsw0ab;C6oURb@XJ7T!|vT`owiVo zX=5SeO4FyGh-w47ybRgsqDQF2mO>0QHU?rE2i&4D1OqdAQ_k{~6veFLL`h(Nyi*cH zF%qKFrFdltvu?sQ-B#G`BXeTet(0*GhHJ%02&Sc~>b9#f+0uH=lPM_+=FPjoUGwo{ z?_RxRtItvt<948g&UqljT3JbN$(Kz!zIxRv%O$629z#2a{t{se_W+nX;Q_AX9oqZ~ zH5`b_fZCX)4rw|ziYTw)rPvyf5~SI}tG<~MokZUYQ|&IjTm;zIW7o}f3!3z?W4Fwy zxwPyAVha|8s2%1hrsPp=YaM=yVJM*IX1^Wy=Z`O6);-d@0DM9Iq%*R+x;`b2`P>9O zdlnAS+-cX14YjXyDzp&Wgj?!SVIkQ8(hxF6z9dWsm$$(#15;C0_|3(O7om+@hpf9- zG0S)_=nnk;^XDo#D@XmE2=kg6?lsXxgE|e48~X%!fLhsSB$1Htz~c0bjHOGL{_t-k zzAYX&9XXWUU;||dzXQ9+DEp7^-#arZ8`R@w2D>Q}qC@D~R2up@4$bmaccgPW><;7f zDj#MQ=SZ^^j9x#tJUIpiAivu>td^n)l{rEe+m@$9#4r^0JSZp!p*YTpP=~`B>$Wh# z5XBGOP^jEbAZ}f@#Bx#6+f-bVesJi)KA4VzpX4tGz}33i%>3tUzoD+;>Ff|`}kJ$r%~ZTq`;67nmn*orC92yKLKGa3S`QD z>`-LaHo7-%-~RILTQ=mojg4H4gOZ|R;5#Sfg`s!m(C+~pzZ2C}Sz@^=j!lh6I$83; z!OKTYp8WmuyZ3~}P@=vhb~UVDFncBl?(p)*mozEA6L6!Xrf z=R{8L{r&4#qUOgBA1L-y=*D{IF5cf%bYZjX_5M;&sIII`J#z*GDtMGlo351CQFE5E zS_Q!5LpwLsuS2aT*-Aw_GcD~0j6AE0|J5mcM~H2RI2)0d@r8?ui*a}WLQoKJOq#$& z8SA3pkW2^?QV`x9DnTk2@a#Z48{NfuYg)0NxCn`p=$e9P+W}jhE=5h3>z*bWngA#i z3{k{*enCO^^VhE*{uU+AE6Nm*;6HgX#Kgp%dXj5yXpaB<&gusgXujeW*|<@5oC2SK zsE^QyS6=`A6OTBd*5Dn|NCQoA{5Vt}$zyBXx=Yiz@S6pF*o#gw*!8o%o{bIN%1sYI z@7M1%Gz;S;iK=smo^%hwwdsU1_eMJ`7Y{jfU*LR$UFWe)KH@}L%6xd*huN4TM~tw{ z&LaL363Ffj`2Qsr3dH&Jqha!c&y~fo{7pti`;KD@G`HS(%}MkUJ&q>EXN-8<(W5us z@c8!iD=?YtRek?6*gYPII{<$WYA6F&eL0FonBM4-cF1_fQ<@Sa(5j zWHSYLNKOJRv3THqcnVlU^c3^%k|W)AheJ!Zyso?MGTz9k85sd&>EJbrr!#|cw>;W; z@L->9cIs``zLodl{lX3~o`Td1VEq$?>AC42ku{0#C<FDu4Rv_`}!+;NXf2#ZiWI zE>%`qDjz;~Zffs6Ui06b`xa%ROEsT%8RQThY#yQKK0{UI>{)Va1dX`#EqI)XE3u)P z*W9^h2*>!pA-4SRL91=sxN|2__TxtOV)CS^Q%mpP{{*ZffKvmvV3Y~G2D~(opJ5+# z%o(a7?_|BU9H>`_oDI#1_Jyxb)t$WR|8#c#aW&t291kasMvh7~OGRlht5XX}S|<_K zXfe7;9TH*`v5GhjiKLlA)}kiqL)H&gaMb{rdH8I8P8g*EqA2Lk%w@xMB#3F!0{j_cbFD_*{tovtZN&~$$@*OCxu=-44T9W#H_`CxgIapoqV|RR&}){6I`pS-HWzN5ij)4cH>$k zgP$2hY#)ZNku0JVjjLT;^h z@7y_=m&e00j5S()vM8=PyYOqK{xZu}N2mQQGcfwTIK(}$LO;{K^?P*TZb_rjupD#f>Xw`ptp>AQdGaoT_VVU@lCm!2kv@8M!-fbt`+(X%b0 zC#(z8f7H&MK`);dIB*MNJC!oANJ!G#s7NTL_bi9S= zjDrheKv`BhMIP2nP6sbxh!kmb*c)gNuNwE*KiqDeJospv znW{*p2$UbW+50QM4?^vO>T++^PdIUYfZLcwQz;@knp^>17k>HPf_n(`8l1E6w=x&9d%|@z|x4r)znZcMlBe(teJL0Yx%FuC1w0^;xe%)Fh zUteDzSC~0J?V-i?OC)8#+7%eFV@E^zOHXRrtROZXFh$#uVg0)dab_(j*hFCqe;GLc zz>o`WX)#5G;Dkd?M+%5@kj}#+%oJ)Zy{^ZJ|11MN$*UzgcFVHrMsgzI#$1xk0Hl|| z8X;*uVfDMYMMSdBkS$A>KB6|ily6=21{PXXCNYZ>L^~)#_XMs@_}m*86%(2qBtLP< zo0_gDi0Zd_D`iIU_g~G4wT%tr{}FpE5EA%VM~t z-leg&nf+|Qbk%ut=Q20|{1j-x%frLAesq{;QURIK86y5S*cb^4szA&F-pzm+Rm5sgoU}5*WDk^o**bQp$gdvN+F3L6WmvJhkeXlsSU%dJp~03o#^u zW)b0@Z+>%ACGXYw^NkFSwIR5JtalgF?p0rOys`kX!2VsI9OT43foKGOR*=r4&#P|T zLUxOSgV)(V3*ibz6kf*(EK(TOQLb`emWqnxrl19gE-PyMOp!iS{O1~$h&D^*v0uGg zwc@aZXs!QiNtdXP{A*V@seLOR`R5C6G(wuop+~fP!3QszkdXjV0(IdJ-M5bizLf9S zD*pQ`woez>h}QZ~CE`o@h6+!52x1SY$(&6l2fr|mF8ioeyyVFe><3?tg1NGraJLi6s>kX=p9jR}A4ubfFL)KXD>nP_6J1 zG6ET!i&Qi#A;F%tdF6`WqN4vtqfeuSTa&?S%mV1MP<`-V_*9r*h(@P9dNRpH;w^G= zUSQm%k66rz04P!VD~ffhw;9H+bm;6c9DV40D8HxzAQk70W%I1$R;77yJ$^Df`+9YC zqrWw^4vJvKi${^vCY0c6+hJ501gAhn6jgeqvXTy*dY|iepjgaDpP82S29G-;3PhUu z`S~2rx|*67mRi!oQP8tHb9^dXOm9%cg66MBI$v37q3evykfR%^Hm*JLQc&W&e9iYV z38rZ6+H9al!c!qJ{H+BE0Lh$ptE)+E`$?>x*1 z)K(ij_#CVccO()jz8S9t3v~4Kx~XR9vTcqKc?Sqa5HllJR-f^hO$PnC*PwMXjhTZa zv~muKsYI*{83M)uJ7Ku5oL&$#o{1mAB~k2EaKPBo`r2kHw3ysb4cNgatXVLj?V3xnxy$@NJN}o z*-Le=606NvJGLwOJJ_$C=~EM3LhKZ<$y#bYga`;4{Gnu->B(XcKl3$?=mt+SayM(7fAV7l~J1d#0gYH|HbdDAP8`l_(NS+)U zu6UM~SmbOHK&K&#f!n5^Qz)N#p~|PF(NlLaiv#cFN6Xz)K>B0t?BXvx#1jN2#l#Pu zehnoFHwXQ$Fjyul>p?+qF4;b8P1qR(Kgc5?Fj4kX*Mf{ngg9f6pXfI*GQRZfb+k8s*q)Xf*jJjbP@yvBDM| zHVl=$KG0KZ;hW6F#Kmw8dg@IegX_+8v*EzKJ&LxR;}rJyKf!|6`(Xd94O9eh05s6B zcAt$Jbqwqu(KF5j#wk9bfb?o${(ZQ?r2rzT0q-esp1hY<3u#%_P;}25OMN?0DkbyBR^J?N2#zWwdE{yt z8#}@#{rs~T_b`~SI80yy?wzS&1Khp4k-3X_N7>ydwS$9k?X$z~bC1yX!#i;j2H6UA z0vG!lKR@~<&}(GyxZy~UV`X_iHxDnt&;k#^GGZmN$X4OdW*(V(L>+}QV^40Z>;NI7 zXyEkd?a+WgnN5MkiLxK?4S_XGQccai%4H0gKwLr*f+&T)WZAO*({Ea_8~Ajg)ZoTx zVX1S6ioleBBqscV`Y8syo=yFD-Zy)Q*5N%P|gcRHdW< zAPQq4uPJ&0=rH8>S~;PB;-*QArP8XhGAFe7vr|y9cfEd1Y(Ai7(I_YNzpksQO@OO= zW+l%@KQw;4sz{XJlG@m~WWwPQT3S}9-^jR=OZlRYe?CI$6Ot;@E@)ov-@G{tHo?s; zH92`agF#I8JwZ@qX^DgTU$r?A5d*ZNfYkv(Sq?1xjMP+8Xp!WhX+{Yd5EwY%D7Goq z7-J_*wTAEBVJO}`9mW;8C}kF>-;eygw6teTY_f0NS@ugXZCl|d5-~R~Wb@t`j*^R{ zt5;R|rz>eP043NTH$oPfYK`4Livx))a6>W8tuS2(WHa=2syK{jY<@6aWZ~HTL;{4i zqB|!Ak=b5r)}U6Ch^~|SmyO+-P7|GZwq^c1acmO zKv8;r`-lPW0PiBj+byWvc-zr5#l*+|*4TI~BLnX{GQHs6?xC_}F{Y(DeMeZ zWtoHsSwkqd61fy0ZFz1jSTL9H-iludGrn@=DP0%4Lf&3oUOv-M!VS0Gfuv6KmUqO> zLqin+wbDGXBSe!_U#dmB={&1Ny9^CJy-^;sTs1y9TRhN=hIOcHru` z3eGJ)58guXzT%@)6b)G_D^J;QD>A^nbk{Jh6NaOs3eyfVG}bttm$x9N3=soP-w0zdv=n##0z_SxG_yeZu z;)&;2h`b0?%2|euf!LR(mjHW!{d@@2TFqK(&)fs8KR(ah&20r$*~*pfo}T)enp0D1 zi1lxL^yo%i9dj};ud}!LYxJdDnS}9hP%@o@9n34QU273>K_=OTPe1Y^pK)$&ix7TQ zXeW}9`7=z7;#gHZV%3^83?Or-O#C9Pl=I=D^B+JE$f=y1XbV>Q`Z6H6!T&V7fp89p zb3_IN>+(sO#Su9`1n|U-Mzk=rPq@*L_JCtcqDp%mJMeq_e&G7`2<=n~tla|wa$QXC z@t|nkV6_h&KI~;-GhnMOj%+QG9ss|<-+?Bt{Q81}5BwY&1WJe*9Qx6>@7xi3eeEcp zrAwi%lBlaG6oo-$T(k0!7jw26z3+P43lCZP>~b+Z3Ds?BnRDVq)%EKZoRV`#E4#ai z9^h%o!D3EK`BHhN3Cxqfze}0`@}OErQ;M$_nJVBCe-1#D?+V-c3wW6z+jwS&02(mo z%)<H4RQEez39b^# zS^OjVIy%Cx=+#FfoIIA5RfHL#YPqIZwDQz&nM5Py@1FYz*?w# zSPjY~j>^rxr*P8ns!i0Y5Q;S89LT`f6ci+{Y$S>hFZjfXfs`lN*?lgog=YYb8UUqQ}|3_^n4`lzKv&%od<%nb3s z2c7>-Eq=XUfkLcy!}@(I*P4XJ4NJh|$0k~8unuT)Wa-1h458upppcDUcu2$!J}2H- zkqmYO9Xz)XWHf)+extKU#;&aWX2Ox#RK)$f5V)YYX>Dl%NRx-EopP`IrH!h~L_3Oa zuUJhJJ?ODxc)(ctb4`B$)eaqGL05z9aJ?O*5v?+{G5G>0=TZ?uH#Dfk9swocou|;n z62@6!Wp$&r_6(31$&S52-ssvmW}q)MA^|5Tx&RG3&pIStuBgB;AIqr%>Er8*DyfET z7gY+R@u8j`^$2h?mm$~)9UI6dNCIH8&&SaJSp0~fWMk+@qm!|)vf|GBal-21+EHjb z$MiZWIHTmbwR{FM6$%9#4wq9J1(GoB4rnIC?k$%N$3u`UF&~r;r}FYRyCg&CM|mwm z*)Wb!Qlg#}I}&u{om-3Ep|0+u??(U8-VV^gDa8%D-QlZ6i-dR}Ldo~f;{UPEG1MLr ziX&!tjMI*)TxKL*;^Q+drG^1C-rh!-q=}4{OUb$-J&mdK7?Ba1JfsU!>lA3RzECPn-h04>mWJBE-H=K}E;(h9CZh5Z(@AWF}>H zXJ@*{8CSD7Mp>@I2KvjQ)QPHpwOQgYJ6CCi>HC#d_1~ZYzxCfO{@$>^ZtwrWCwg?| X8~GV^Yt0K00$gWKo9&qCAP@TwOYkt1 diff --git a/google-cloud-storage/assets/retry-conformance-tests-diagram.txt b/google-cloud-storage/assets/retry-conformance-tests-diagram.txt deleted file mode 100644 index 1146f2e2ab..0000000000 --- a/google-cloud-storage/assets/retry-conformance-tests-diagram.txt +++ /dev/null @@ -1,59 +0,0 @@ -# This is a text representation of retry-conformance-tests.diagram.png generated -# using https://www.websequencediagrams.com/ - -participant ITRetryConformanceTest -participant ITRetryConformanceTest.Static -participant RetryTestCaseResolver -participant GracefulConformanceEnforcement -participant RetryTestFixture -participant TestBench -participant Docker -participant RpcMethodMappings - -ITRetryConformanceTest->+ITRetryConformanceTest.Static: testCases - ITRetryConformanceTest.Static->RpcMethodMappings: - ITRetryConformanceTest.Static->+RetryTestCaseResolver: getRetryTestCases - RetryTestCaseResolver->RetryTestCaseResolver: loadRetryTestDefinitions - RetryTestCaseResolver->RetryTestCaseResolver: generateTestCases - RetryTestCaseResolver->RetryTestCaseResolver: shuffle - RetryTestCaseResolver->RetryTestCaseResolver: validateGeneratedTestCases - RetryTestCaseResolver->-ITRetryConformanceTest.Static: -ITRetryConformanceTest.Static->-ITRetryConformanceTest: - -ITRetryConformanceTest->+TestBench: apply - TestBench->TestBench: mktemp stdout - TestBench->TestBench: mktemp stderr - TestBench->+Docker: pull - Docker->-TestBench: - TestBench->+Docker: run - TestBench->+TestBench: await testbench up - TestBench->+Docker: GET /retry_tests - Docker->-TestBench: - deactivate TestBench - loop forEach test - ITRetryConformanceTest->+GracefulConformanceEnforcement: apply - ITRetryConformanceTest->+RetryTestFixture: apply - RetryTestFixture->+TestBench: createRetryTest - TestBench->+Docker: POST /retry_test - Docker->-TestBench: - TestBench->-RetryTestFixture: - ITRetryConformanceTest->ITRetryConformanceTest: test - RetryTestFixture->+TestBench: getRetryTest - TestBench->+Docker: GET /retry_test/{id} - Docker->-TestBench: - TestBench->-RetryTestFixture: - RetryTestFixture->RetryTestFixture: assert completion - RetryTestFixture->+TestBench: deleteRetryTest - TestBench->+Docker: DELETE /retry_test/{id} - Docker->-TestBench: - TestBench->-RetryTestFixture: - RetryTestFixture->-ITRetryConformanceTest: - opt if running in CI - GracefulConformanceEnforcement->GracefulConformanceEnforcement: check allow list - end - GracefulConformanceEnforcement->-ITRetryConformanceTest: - end - Docker->-TestBench: docker stop - TestBench->TestBench: rmtemp stdout - TestBench->TestBench: rmtemp stderr -TestBench->-ITRetryConformanceTest: diff --git a/google-cloud-storage/clirr-ignored-differences.xml b/google-cloud-storage/clirr-ignored-differences.xml index 8374be3fc9..8c668bb97f 100644 --- a/google-cloud-storage/clirr-ignored-differences.xml +++ b/google-cloud-storage/clirr-ignored-differences.xml @@ -1,15 +1,35 @@ + + 7012 + com/google/cloud/storage/Storage + *.Blob createFrom(*.BlobInfo, java.nio.file.Path, *.Storage$BlobWriteOption[]) + + + 7012 + com/google/cloud/storage/Storage + *.Blob createFrom(*.BlobInfo, java.io.InputStream, *.Storage$BlobWriteOption[]) + + + 7012 + com/google/cloud/storage/spi/v1/StorageRpc + *.StorageObject writeWithResponse(*.String, byte[], int, long, int, boolean) + com/google/cloud/storage/BucketInfo$Builder - com.google.cloud.storage.BucketInfo$Builder setRpo(com.google.cloud.storage.Rpo) + com.google.cloud.storage.BucketInfo$Builder deleteLifecycleRules() 7013 - com/google/cloud/storage/BucketInfo$LifecycleRule$LifecycleAction - BucketInfo$LifecycleRule$LifecycleAction() - 7004 + com/google/cloud/storage/BucketInfo$Builder + com.google.cloud.storage.BucketInfo$Builder setUpdateTime(java.lang.Long) + 7013 + + + com/google/cloud/storage/spi/v1/StorageRpc + long getCurrentUploadOffset(java.lang.String) + 7012 com/google/cloud/storage/Storage diff --git a/google-cloud-storage/conformance-testing.md b/google-cloud-storage/conformance-testing.md deleted file mode 100644 index 6b75bb502a..0000000000 --- a/google-cloud-storage/conformance-testing.md +++ /dev/null @@ -1,45 +0,0 @@ -# Conformance Testing - -This library leverages the conformance tests defined in [googleapis/conformance-tests](https://github.com/googleapis/conformance-tests) -to ensure adherence to expected behaviors. - -Access to the conformance tests is achieved via dependencies on -[`com.google.cloud:google-cloud-conformance-tests`](https://github.com/googleapis/java-conformance-tests) -which contains all generated protos and associated files necessary for loading -and accessing the tests. - -## Running the Conformance Tests - -Conformance tests are written and run as part of the JUnit tests suite. - -## Suites - -### Automatic Retries - -The JUnit tests class is [`ITRetryConformanceTest.java`](./src/test/java/com/google/cloud/storage/conformance/retry/ITRetryConformanceTest.java) -and is considered part of the integration test suite. - -This tests suite ensures that automatic retries for operations are properly defined -and handled to ensure data integrity. - -#### Prerequisites -1. Java 8+ -2. Maven -3. Docker (Docker for MacOS has been tested and verified to work as well) - -#### Test Suite Overview - -The test suite uses the [storage-testbench](https://github.com/googleapis/storage-testbench) -to configure and generate tests cases which use fault injection to ensure conformance. - -`ITRetryConformanceTest` encapsulates all the necessary lifecycle points needed -to run the test suite, including: -1. Running the testbench server via docker -2. Setup, validation, cleanup of individual test cases with the testbench -3. CI Graceful enforcement of test failures (enforce no regressions, but allow - for some cases to not pass without failing the whole run) - -A sequence diagram of how the tests are loaded run, and interact with testbench -can be seen below. Time moves from top to bottom, while component interactions -are shown via arrows laterally. -![](./assets/retry-conformance-tests-diagram.png) diff --git a/google-cloud-storage/pom.xml b/google-cloud-storage/pom.xml index 976f60f6c6..35f4eb0c32 100644 --- a/google-cloud-storage/pom.xml +++ b/google-cloud-storage/pom.xml @@ -1,8 +1,8 @@ - + 4.0.0 google-cloud-storage - 2.4.6-SNAPSHOT + 1.113.5-SNAPSHOT jar Google Cloud Storage https://github.com/googleapis/java-storage @@ -12,11 +12,11 @@ com.google.cloud google-cloud-storage-parent - 2.4.6-SNAPSHOT + 1.113.5-SNAPSHOT google-cloud-storage - 0.95.1 + 0.87.2 @@ -34,6 +34,7 @@ com.google.api-client google-api-client + 1.31.1 com.google.apis @@ -87,11 +88,6 @@ org.threeten threetenbp - - - com.fasterxml.jackson.core - jackson-core - @@ -182,11 +178,6 @@ httpcore test - - com.google.errorprone - error_prone_annotations - test - diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/Blob.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/Blob.java index a198969953..6faef6c0f7 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/Blob.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/Blob.java @@ -16,16 +16,18 @@ package com.google.cloud.storage; +import static com.google.cloud.RetryHelper.runWithRetries; import static com.google.cloud.storage.Blob.BlobSourceOption.toGetOptions; import static com.google.cloud.storage.Blob.BlobSourceOption.toSourceOptions; import static com.google.common.base.Preconditions.checkNotNull; import static java.util.concurrent.Executors.callable; -import com.google.api.gax.retrying.ResultRetryAlgorithm; import com.google.api.services.storage.model.StorageObject; import com.google.auth.ServiceAccountSigner; import com.google.auth.ServiceAccountSigner.SigningException; import com.google.cloud.ReadChannel; +import com.google.cloud.RetryHelper; +import com.google.cloud.Tuple; import com.google.cloud.WriteChannel; import com.google.cloud.storage.Acl.Entity; import com.google.cloud.storage.Storage.BlobTargetOption; @@ -33,6 +35,7 @@ import com.google.cloud.storage.Storage.CopyRequest; import com.google.cloud.storage.Storage.SignUrlOption; import com.google.cloud.storage.spi.v1.StorageRpc; +import com.google.common.base.Function; import com.google.common.io.BaseEncoding; import com.google.common.io.CountingOutputStream; import java.io.IOException; @@ -47,7 +50,6 @@ import java.util.Map; import java.util.Objects; import java.util.concurrent.TimeUnit; -import java.util.function.Function; /** * An object in Google Cloud Storage. A {@code Blob} object includes the {@code BlobId} instance, @@ -76,9 +78,18 @@ public class Blob extends BlobInfo { private static final long serialVersionUID = -6806832496717441434L; private final StorageOptions options; - private final RetryAlgorithmManager retryAlgorithmManager; private transient Storage storage; + static final Function, Blob> BLOB_FROM_PB_FUNCTION = + new Function, Blob>() { + @Override + public Blob apply(Tuple pb) { + return Blob.fromPb(pb.x(), pb.y()); + } + }; + + private static final int DEFAULT_CHUNK_SIZE = 2 * 1024 * 1024; + /** Class for specifying blob source options when {@code Blob} methods are used. */ public static class BlobSourceOption extends Option { @@ -106,8 +117,6 @@ private Storage.BlobSourceOption toSourceOptions(BlobInfo blobInfo) { return Storage.BlobSourceOption.decryptionKey((String) getValue()); case USER_PROJECT: return Storage.BlobSourceOption.userProject((String) getValue()); - case RETURN_RAW_INPUT_STREAM: - return Storage.BlobSourceOption.shouldReturnRawInputStream((boolean) getValue()); default: throw new AssertionError("Unexpected enum value"); } @@ -127,8 +136,6 @@ private Storage.BlobGetOption toGetOption(BlobInfo blobInfo) { return Storage.BlobGetOption.userProject((String) getValue()); case CUSTOMER_SUPPLIED_KEY: return Storage.BlobGetOption.decryptionKey((String) getValue()); - case RETURN_RAW_INPUT_STREAM: - return Storage.BlobGetOption.shouldReturnRawInputStream((boolean) getValue()); default: throw new AssertionError("Unexpected enum value"); } @@ -193,16 +200,6 @@ public static BlobSourceOption userProject(String userProject) { return new BlobSourceOption(StorageRpc.Option.USER_PROJECT, userProject); } - /** - * Returns an option for whether the request should return the raw input stream, instead of - * automatically decompressing the content. By default, this is false for Blob.downloadTo(), but - * true for ReadChannel.read(). - */ - public static BlobSourceOption shouldReturnRawInputStream(boolean shouldReturnRawInputStream) { - return new BlobSourceOption( - StorageRpc.Option.RETURN_RAW_INPUT_STREAM, shouldReturnRawInputStream); - } - static Storage.BlobSourceOption[] toSourceOptions( BlobInfo blobInfo, BlobSourceOption... options) { Storage.BlobSourceOption[] convertedOptions = new Storage.BlobSourceOption[options.length]; @@ -247,18 +244,26 @@ public void downloadTo(Path path, BlobSourceOption... options) { public void downloadTo(OutputStream outputStream, BlobSourceOption... options) { final CountingOutputStream countingOutputStream = new CountingOutputStream(outputStream); final StorageRpc storageRpc = this.options.getStorageRpcV1(); - StorageObject pb = getBlobId().toPb(); final Map requestOptions = StorageImpl.optionMap(getBlobId(), options); - ResultRetryAlgorithm algorithm = retryAlgorithmManager.getForObjectsGet(pb, requestOptions); - Retrying.run( - this.options, - algorithm, - callable( - () -> { - storageRpc.read( - pb, requestOptions, countingOutputStream.getCount(), countingOutputStream); - }), - Function.identity()); + try { + runWithRetries( + callable( + new Runnable() { + @Override + public void run() { + storageRpc.read( + getBlobId().toPb(), + requestOptions, + countingOutputStream.getCount(), + countingOutputStream); + } + }), + this.options.getRetrySettings(), + StorageImpl.EXCEPTION_HANDLER, + this.options.getClock()); + } catch (RetryHelper.RetryHelperException e) { + StorageException.translateAndThrow(e); + } } /** @@ -487,7 +492,6 @@ public Blob build() { super(infoBuilder); this.storage = checkNotNull(storage); this.options = storage.getOptions(); - this.retryAlgorithmManager = storage.getOptions().getRetryAlgorithmManager(); } /** diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobId.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobId.java index 599f45e2af..6a0953f908 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobId.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobId.java @@ -22,7 +22,6 @@ import com.google.common.base.MoreObjects; import java.io.Serializable; import java.util.Objects; -import java.util.regex.Pattern; /** * Google Storage Object identifier. A {@code BlobId} object includes the name of the containing @@ -57,11 +56,6 @@ public Long getGeneration() { return generation; } - /** Returns this blob's Storage url which can be used with gsutil */ - public String toGsUtilUri() { - return "gs://" + bucket + "/" + name; - } - @Override public String toString() { return MoreObjects.toStringHelper(this) @@ -120,23 +114,6 @@ public static BlobId of(String bucket, String name, Long generation) { return new BlobId(checkNotNull(bucket), checkNotNull(name), generation); } - /** - * Creates a {@code BlobId} object. - * - * @param gsUtilUri the Storage url to create the blob from - */ - public static BlobId fromGsUtilUri(String gsUtilUri) { - if (!Pattern.matches("gs://.*/.*", gsUtilUri)) { - throw new IllegalArgumentException( - gsUtilUri + " is not a valid gsutil URI (i.e. \"gs://bucket/blob\")"); - } - int blobNameStartIndex = gsUtilUri.indexOf('/', 5); - String bucketName = gsUtilUri.substring(5, blobNameStartIndex); - String blobName = gsUtilUri.substring(blobNameStartIndex + 1); - - return BlobId.of(bucketName, blobName); - } - static BlobId fromPb(StorageObject storageObject) { return BlobId.of( storageObject.getBucket(), storageObject.getName(), storageObject.getGeneration()); diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobReadChannel.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobReadChannel.java index 8d51ab3b86..c5fce5bd1b 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobReadChannel.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobReadChannel.java @@ -18,7 +18,6 @@ import static com.google.cloud.RetryHelper.runWithRetries; -import com.google.api.gax.retrying.ResultRetryAlgorithm; import com.google.api.services.storage.model.StorageObject; import com.google.cloud.ReadChannel; import com.google.cloud.RestorableState; @@ -32,6 +31,7 @@ import java.nio.channels.ClosedChannelException; import java.util.Map; import java.util.Objects; +import java.util.concurrent.Callable; /** Default implementation for ReadChannel. */ class BlobReadChannel implements ReadChannel { @@ -41,7 +41,6 @@ class BlobReadChannel implements ReadChannel { private final StorageOptions serviceOptions; private final BlobId blob; private final Map requestOptions; - private final RetryAlgorithmManager retryAlgorithmManager; private String lastEtag; private long position; private boolean isOpen; @@ -58,7 +57,6 @@ class BlobReadChannel implements ReadChannel { this.serviceOptions = serviceOptions; this.blob = blob; this.requestOptions = requestOptions; - this.retryAlgorithmManager = serviceOptions.getRetryAlgorithmManager(); isOpen = true; storageRpc = serviceOptions.getStorageRpcV1(); storageObject = blob.toPb(); @@ -121,21 +119,24 @@ public int read(ByteBuffer byteBuffer) throws IOException { } final int toRead = Math.max(byteBuffer.remaining(), chunkSize); try { - ResultRetryAlgorithm algorithm = - retryAlgorithmManager.getForObjectsGet(storageObject, requestOptions); Tuple result = runWithRetries( - () -> storageRpc.read(storageObject, requestOptions, position, toRead), + new Callable>() { + @Override + public Tuple call() { + return storageRpc.read(storageObject, requestOptions, position, toRead); + } + }, serviceOptions.getRetrySettings(), - algorithm, + StorageImpl.EXCEPTION_HANDLER, serviceOptions.getClock()); - String etag = result.x(); - byte[] bytes = result.y(); - if (bytes.length > 0 && lastEtag != null && !Objects.equals(etag, lastEtag)) { - throw new IOException("Blob " + blob + " was updated while reading"); + if (result.y().length > 0 && lastEtag != null && !Objects.equals(result.x(), lastEtag)) { + StringBuilder messageBuilder = new StringBuilder(); + messageBuilder.append("Blob ").append(blob).append(" was updated while reading"); + throw new IOException(messageBuilder.toString()); } - lastEtag = etag; - buffer = bytes; + lastEtag = result.x(); + buffer = result.y(); } catch (RetryHelper.RetryHelperException e) { throw new IOException(e); } diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobWriteChannel.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobWriteChannel.java index e19d013486..2e9c0a3804 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobWriteChannel.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobWriteChannel.java @@ -17,259 +17,164 @@ package com.google.cloud.storage; import static com.google.cloud.RetryHelper.runWithRetries; -import static java.util.Objects.requireNonNull; import static java.util.concurrent.Executors.callable; -import com.google.api.gax.retrying.ResultRetryAlgorithm; import com.google.api.services.storage.model.StorageObject; import com.google.cloud.BaseWriteChannel; import com.google.cloud.RestorableState; import com.google.cloud.RetryHelper; import com.google.cloud.WriteChannel; -import java.math.BigInteger; -import java.util.function.Supplier; -import org.checkerframework.checker.nullness.qual.NonNull; +import com.google.cloud.storage.spi.v1.StorageRpc; +import java.net.URL; +import java.util.Map; +import java.util.concurrent.Callable; /** Write channel implementation to upload Google Cloud Storage blobs. */ class BlobWriteChannel extends BaseWriteChannel { - private final ResultRetryAlgorithm algorithmForWrite; - // Detect if flushBuffer() is being retried or not. - // TODO: I don't think this is thread safe, and there's probably a better way to detect a retry - // occuring. - private boolean retrying = false; - private boolean checkingForLastChunk = false; - - // Contains metadata of the updated object or null if upload is not completed. - private StorageObject storageObject; - - BlobWriteChannel( - StorageOptions storageOptions, - BlobInfo blobInfo, - String uploadId, - ResultRetryAlgorithm algorithmForWrite) { - super(storageOptions, blobInfo, uploadId); - this.algorithmForWrite = algorithmForWrite; + BlobWriteChannel(StorageOptions options, BlobInfo blob, Map optionsMap) { + this(options, blob, open(options, blob, optionsMap)); } - boolean isRetrying() { - return retrying; + BlobWriteChannel(StorageOptions options, URL signedURL) { + this(options, open(signedURL, options)); } - StorageObject getStorageObject() { - return storageObject; + BlobWriteChannel(StorageOptions options, BlobInfo blobInfo, String uploadId) { + super(options, blobInfo, uploadId); } - private StorageObject transmitChunk( - int chunkOffset, int chunkLength, long position, boolean last) { - return getOptions() - .getStorageRpcV1() - .writeWithResponse(getUploadId(), getBuffer(), chunkOffset, position, chunkLength, last); + BlobWriteChannel(StorageOptions options, String uploadId) { + super(options, null, uploadId); } - private long getRemotePosition() { - return getOptions().getStorageRpcV1().getCurrentUploadOffset(getUploadId()); - } + // Contains metadata of the updated object or null if upload is not completed. + private StorageObject storageObject; - private static StorageException unrecoverableState( - String uploadId, - int chunkOffset, - int chunkLength, - long localPosition, - long remotePosition, - boolean last) { - return unrecoverableState( - uploadId, - chunkOffset, - chunkLength, - localPosition, - remotePosition, - last, - "Unable to recover in upload.\nThis may be a symptom of multiple clients uploading to the same upload session."); - } + // Detect if flushBuffer() is being retried or not. + // TODO: I don't think this is thread safe, and there's probably a better way to detect a retry + // occuring. + private boolean retrying = false; - private static StorageException errorResolvingMetadataLastChunk( - String uploadId, - int chunkOffset, - int chunkLength, - long localPosition, - long remotePosition, - boolean last) { - return unrecoverableState( - uploadId, - chunkOffset, - chunkLength, - localPosition, - remotePosition, - last, - "Unable to load object metadata to determine if last chunk was successfully written"); + boolean isRetrying() { + return retrying; } - private static StorageException unrecoverableState( - String uploadId, - int chunkOffset, - int chunkLength, - long localPosition, - long remotePosition, - boolean last, - String message) { - StringBuilder sb = new StringBuilder(); - sb.append(message).append("\n\n"); - sb.append("For debugging purposes:\n"); - sb.append("uploadId: ").append(uploadId).append('\n'); - sb.append("chunkOffset: ").append(chunkOffset).append('\n'); - sb.append("chunkLength: ").append(chunkLength).append('\n'); - sb.append("localOffset: ").append(localPosition).append('\n'); - sb.append("remoteOffset: ").append(remotePosition).append('\n'); - sb.append("lastChunk: ").append(last).append("\n\n"); - return new StorageException(0, sb.toString()); + StorageObject getStorageObject() { + return storageObject; } - // Retriable interruption occurred. - // Variables: - // chunk = getBuffer() - // localNextByteOffset == getPosition() - // chunkSize = getChunkSize() - // - // Case 1: localNextByteOffset == remoteNextByteOffset: - // Retrying the entire chunk - // - // Case 2: localNextByteOffset < remoteNextByteOffset - // && driftOffset < chunkSize: - // Upload progressed and localNextByteOffset is not in-sync with - // remoteNextByteOffset and driftOffset is less than chunkSize. - // driftOffset must be less than chunkSize for it to retry using - // chunk maintained in memory. - // Find the driftOffset by subtracting localNextByteOffset from - // remoteNextByteOffset. - // Use driftOffset to determine where to restart from using the chunk in - // memory. - // - // Case 3: localNextByteOffset < remoteNextByteOffset - // && driftOffset == chunkSize: - // Special case of Case 2. - // If chunkSize is equal to driftOffset then remoteNextByteOffset has moved on - // to the next chunk. - // - // Case 4: localNextByteOffset < remoteNextByteOffset - // && driftOffset > chunkSize: - // Throw exception as remoteNextByteOffset has drifted beyond the retriable - // chunk maintained in memory. This is not possible unless there's multiple - // clients uploading to the same resumable upload session. - // - // Case 5: localNextByteOffset > remoteNextByteOffset: - // For completeness, this case is not possible because it would require retrying - // a 400 status code which is not allowed. - // - // Case 6: remoteNextByteOffset==-1 && last == true - // Upload is complete and retry occurred in the "last" chunk. Data sent was - // received by the service. - // - // Case 7: remoteNextByteOffset==-1 && last == false && !checkingForLastChunk - // Not last chunk and are not checkingForLastChunk, allow for the client to - // catch up to final chunk which meets - // Case 6. - // - // Case 8: remoteNextByteOffset==-1 && last == false && checkingForLastChunk - // Not last chunk and checkingForLastChunk means this is the second time we - // hit this case, meaning the upload was completed by a different client. - // - // Case 9: Only possible if the client local offset continues beyond the remote - // offset which is not possible. - // @Override - protected void flushBuffer(final int length, final boolean lastChunk) { + protected void flushBuffer(final int length, final boolean last) { try { runWithRetries( callable( new Runnable() { @Override public void run() { - // Get remote offset from API - final long localPosition = getPosition(); - // For each request it should be possible to retry from its location in this code - final long remotePosition = isRetrying() ? getRemotePosition() : localPosition; - final int chunkOffset = (int) (remotePosition - localPosition); - final int chunkLength = length - chunkOffset; - final boolean uploadAlreadyComplete = remotePosition == -1; - // Enable isRetrying state to reduce number of calls to getRemotePosition() if (!isRetrying()) { + // Enable isRetrying state to reduce number of calls to getCurrentUploadOffset() retrying = true; - } - if (uploadAlreadyComplete && lastChunk) { - // Case 6 - // Request object metadata if not available - long totalBytes = getPosition() + length; - if (storageObject == null) { + storageObject = + getOptions() + .getStorageRpcV1() + .writeWithResponse( + getUploadId(), getBuffer(), 0, getPosition(), length, last); + } else { + // Retriable interruption occurred. + // Variables: + // chunk = getBuffer() + // localNextByteOffset == getPosition() + // chunkSize = getChunkSize() + // + // Case 1: localNextByteOffset == 0 && remoteNextByteOffset == 0: + // we are retrying from first chunk start from 0 offset. + // + // Case 2: localNextByteOffset == remoteNextByteOffset: + // Special case of Case 1 when a chunk is retried. + // + // Case 3: localNextByteOffset < remoteNextByteOffset + // && driftOffset < chunkSize: + // Upload progressed and localNextByteOffset is not in-sync with + // remoteNextByteOffset and driftOffset is less than chunkSize. + // driftOffset must be less than chunkSize for it to retry using + // chunk maintained in memory. + // Find the driftOffset by subtracting localNextByteOffset from + // remoteNextByteOffset. + // Use driftOffset to determine where to restart from using the chunk in + // memory. + // + // Case 4: localNextByteOffset < remoteNextByteOffset + // && driftOffset == chunkSize: + // Special case of Case 3. + // If chunkSize is equal to driftOffset then remoteNextByteOffset has moved on + // to the next chunk. + // + // Case 5: localNextByteOffset < remoteNextByteOffset + // && driftOffset > chunkSize: + // Throw exception as remoteNextByteOffset has drifted beyond the retriable + // chunk maintained in memory. This is not possible unless there's multiple + // clients uploading to the same resumable upload session. + // + // Case 6: localNextByteOffset > remoteNextByteOffset: + // For completeness, this case is not possible because it would require retrying + // a 400 status code which is not allowed. + // + // Get remote offset from API + long remoteNextByteOffset = + getOptions().getStorageRpcV1().getCurrentUploadOffset(getUploadId()); + long localNextByteOffset = getPosition(); + int driftOffset = (int) (remoteNextByteOffset - localNextByteOffset); + int retryChunkLength = length - driftOffset; + + if (localNextByteOffset == 0 && remoteNextByteOffset == 0 + || localNextByteOffset == remoteNextByteOffset) { + // Case 1 and 2 storageObject = getOptions() .getStorageRpcV1() - .queryCompletedResumableUpload(getUploadId(), totalBytes); - } - // the following checks are defined here explicitly to provide a more - // informative if either storageObject is unable to be resolved or it's size is - // unable to be determined. This scenario is a very rare case of failure that - // can arise when packets are lost. - if (storageObject == null) { - throw errorResolvingMetadataLastChunk( - getUploadId(), - chunkOffset, - chunkLength, - localPosition, - remotePosition, - lastChunk); - } - // Verify that with the final chunk we match the blob length - BigInteger size = storageObject.getSize(); - if (size == null) { - throw errorResolvingMetadataLastChunk( - getUploadId(), - chunkOffset, - chunkLength, - localPosition, - remotePosition, - lastChunk); - } - if (size.longValue() != totalBytes) { - throw unrecoverableState( - getUploadId(), - chunkOffset, - chunkLength, - localPosition, - remotePosition, - lastChunk); + .writeWithResponse( + getUploadId(), getBuffer(), 0, getPosition(), length, last); + } else if (localNextByteOffset < remoteNextByteOffset + && driftOffset < getChunkSize()) { + // Case 3 + storageObject = + getOptions() + .getStorageRpcV1() + .writeWithResponse( + getUploadId(), + getBuffer(), + driftOffset, + remoteNextByteOffset, + retryChunkLength, + last); + } else if (localNextByteOffset < remoteNextByteOffset + && driftOffset == getChunkSize()) { + // Case 4 + // Continue to next chunk + retrying = false; + return; + } else { + // Case 5 + StringBuilder sb = new StringBuilder(); + sb.append( + "Remote offset has progressed beyond starting byte offset of next chunk."); + sb.append( + "This may be a symptom of multiple clients uploading to the same upload session.\n\n"); + sb.append("For debugging purposes:\n"); + sb.append("uploadId: ").append(getUploadId()).append('\n'); + sb.append("localNextByteOffset: ").append(localNextByteOffset).append('\n'); + sb.append("remoteNextByteOffset: ").append(remoteNextByteOffset).append('\n'); + sb.append("driftOffset: ").append(driftOffset).append("\n\n"); + throw new StorageException(0, sb.toString()); } - retrying = false; - } else if (uploadAlreadyComplete && !lastChunk && !checkingForLastChunk) { - // Case 7 - // Make sure this is the second to last chunk. - checkingForLastChunk = true; - // Continue onto next chunk in case this is the last chunk - } else if (localPosition <= remotePosition && chunkOffset < getChunkSize()) { - // Case 1 && Case 2 - // We are in a position to send a chunk - storageObject = - transmitChunk(chunkOffset, chunkLength, remotePosition, lastChunk); - retrying = false; - } else if (localPosition < remotePosition && chunkOffset == getChunkSize()) { - // Case 3 - // Continue to next chunk to catch up with remotePosition we are one chunk - // behind - retrying = false; - } else { - // Case 4 && Case 8 && Case 9 - throw unrecoverableState( - getUploadId(), - chunkOffset, - chunkLength, - localPosition, - remotePosition, - lastChunk); } + // Request was successful and retrying state is now disabled. + retrying = false; } }), getOptions().getRetrySettings(), - algorithmForWrite, + StorageImpl.EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelper.RetryHelperException e) { throw StorageException.translateAndThrow(e); @@ -277,73 +182,83 @@ public void run() { } protected StateImpl.Builder stateBuilder() { - return StateImpl.builder(getOptions(), getEntity(), getUploadId()) - .setResultRetryAlgorithm(algorithmForWrite); + return StateImpl.builder(getOptions(), getEntity(), getUploadId()); } - static Builder newBuilder() { - return new Builder(); - } - - static final class Builder { - private StorageOptions storageOptions; - private BlobInfo blobInfo; - private Supplier<@NonNull String> uploadIdSupplier; - private ResultRetryAlgorithm algorithmForWrite; - - public Builder setStorageOptions(StorageOptions storageOptions) { - this.storageOptions = storageOptions; - return this; - } - - public Builder setBlobInfo(BlobInfo blobInfo) { - this.blobInfo = blobInfo; - return this; - } - - public Builder setUploadIdSupplier(Supplier uploadIdSupplier) { - this.uploadIdSupplier = uploadIdSupplier; - return this; + private static String open( + final StorageOptions options, + final BlobInfo blob, + final Map optionsMap) { + try { + return runWithRetries( + new Callable() { + @Override + public String call() { + return options.getStorageRpcV1().open(blob.toPb(), optionsMap); + } + }, + options.getRetrySettings(), + StorageImpl.EXCEPTION_HANDLER, + options.getClock()); + } catch (RetryHelper.RetryHelperException e) { + throw StorageException.translateAndThrow(e); } + } - public Builder setAlgorithmForWrite(ResultRetryAlgorithm algorithmForWrite) { - this.algorithmForWrite = algorithmForWrite; - return this; + private static String open(final URL signedURL, final StorageOptions options) { + try { + return runWithRetries( + new Callable() { + @Override + public String call() { + if (!isValidSignedURL(signedURL.getQuery())) { + throw new StorageException(2, "invalid signedURL"); + } + return options.getStorageRpcV1().open(signedURL.toString()); + } + }, + options.getRetrySettings(), + StorageImpl.EXCEPTION_HANDLER, + options.getClock()); + } catch (RetryHelper.RetryHelperException e) { + throw StorageException.translateAndThrow(e); } + } - BlobWriteChannel build() { - String uploadId = requireNonNull(uploadIdSupplier, "uploadId must be non null").get(); - return new BlobWriteChannel( - requireNonNull(storageOptions, "storageOptions must be non null"), - blobInfo, - requireNonNull(uploadId, "uploadId must be non null"), - requireNonNull(algorithmForWrite, "algorithmForWrite must be non null")); + private static boolean isValidSignedURL(String signedURLQuery) { + boolean isValid = true; + if (signedURLQuery.startsWith("X-Goog-Algorithm=")) { + if (!signedURLQuery.contains("&X-Goog-Credential=") + || !signedURLQuery.contains("&X-Goog-Date=") + || !signedURLQuery.contains("&X-Goog-Expires=") + || !signedURLQuery.contains("&X-Goog-SignedHeaders=") + || !signedURLQuery.contains("&X-Goog-Signature=")) { + isValid = false; + } + } else if (signedURLQuery.startsWith("GoogleAccessId=")) { + if (!signedURLQuery.contains("&Expires=") || !signedURLQuery.contains("&Signature=")) { + isValid = false; + } + } else { + isValid = false; } + return isValid; } static class StateImpl extends BaseWriteChannel.BaseState { private static final long serialVersionUID = -9028324143780151286L; - private final ResultRetryAlgorithm algorithmForWrite; - StateImpl(Builder builder) { super(builder); - this.algorithmForWrite = builder.algorithmForWrite; } static class Builder extends BaseWriteChannel.BaseState.Builder { - private ResultRetryAlgorithm algorithmForWrite; private Builder(StorageOptions options, BlobInfo blobInfo, String uploadId) { super(options, blobInfo, uploadId); } - public Builder setResultRetryAlgorithm(ResultRetryAlgorithm algorithmForWrite) { - this.algorithmForWrite = algorithmForWrite; - return this; - } - @Override public RestorableState build() { return new StateImpl(this); @@ -356,19 +271,9 @@ static Builder builder(StorageOptions options, BlobInfo blobInfo, String uploadI @Override public WriteChannel restore() { - try { - BlobWriteChannel channel = - BlobWriteChannel.newBuilder() - .setStorageOptions(serviceOptions) - .setBlobInfo(entity) - .setUploadIdSupplier(() -> uploadId) - .setAlgorithmForWrite(algorithmForWrite) - .build(); - channel.restore(this); - return channel; - } catch (Exception e) { - throw StorageException.coalesce(e); - } + BlobWriteChannel channel = new BlobWriteChannel(serviceOptions, entity, uploadId); + channel.restore(this); + return channel; } } } diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/Bucket.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/Bucket.java index 95acd19d63..3714e6e94a 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/Bucket.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/Bucket.java @@ -577,12 +577,6 @@ public Builder deleteLifecycleRules() { return this; } - @Override - public Builder setRpo(Rpo rpo) { - infoBuilder.setRpo(rpo); - return this; - } - @Override public Builder setStorageClass(StorageClass storageClass) { infoBuilder.setStorageClass(storageClass); diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java index 5e06b6ce24..602be08ac9 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java @@ -43,13 +43,11 @@ import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; -import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; -import java.util.logging.Logger; /** * Google Storage bucket metadata; @@ -92,7 +90,6 @@ public com.google.api.services.storage.model.Bucket apply(BucketInfo bucketInfo) private final List acl; private final List defaultAcl; private final String location; - private final Rpo rpo; private final StorageClass storageClass; private final Map labels; private final String defaultKmsKeyName; @@ -104,68 +101,17 @@ public com.google.api.services.storage.model.Bucket apply(BucketInfo bucketInfo) private final String locationType; private final Logging logging; - private static final Logger log = Logger.getLogger(BucketInfo.class.getName()); - - /** - * Public Access Prevention enum with expected values. - * - * @see public-access-prevention - */ - public enum PublicAccessPrevention { - ENFORCED("enforced"), - /** - * Default value for Public Access Prevention - * - * @deprecated use {@link #INHERITED} - */ - @Deprecated - UNSPECIFIED("inherited"), - /** - * If the api returns a value that isn't defined in {@link PublicAccessPrevention} this value - * will be returned. - */ - UNKNOWN(null), - INHERITED("inherited"); - - private final String value; - - PublicAccessPrevention(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PublicAccessPrevention parse(String value) { - String upper = value.toUpperCase(); - switch (upper) { - case "ENFORCED": - return ENFORCED; - case "UNSPECIFIED": - case "INHERITED": - return INHERITED; - default: - return UNKNOWN; - } - } - } - /** * The Bucket's IAM Configuration. * * @see uniform * bucket-level access - * @see public-access-prevention */ public static class IamConfiguration implements Serializable { private static final long serialVersionUID = -8671736104909424616L; - private final Boolean isUniformBucketLevelAccessEnabled; - private final Long uniformBucketLevelAccessLockedTime; - private final PublicAccessPrevention publicAccessPrevention; + private Boolean isUniformBucketLevelAccessEnabled; + private Long uniformBucketLevelAccessLockedTime; @Override public boolean equals(Object o) { @@ -179,16 +125,12 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash( - isUniformBucketLevelAccessEnabled, - uniformBucketLevelAccessLockedTime, - publicAccessPrevention); + return Objects.hash(isUniformBucketLevelAccessEnabled, uniformBucketLevelAccessLockedTime); } private IamConfiguration(Builder builder) { this.isUniformBucketLevelAccessEnabled = builder.isUniformBucketLevelAccessEnabled; this.uniformBucketLevelAccessLockedTime = builder.uniformBucketLevelAccessLockedTime; - this.publicAccessPrevention = builder.publicAccessPrevention; } public static Builder newBuilder() { @@ -199,7 +141,6 @@ public Builder toBuilder() { Builder builder = new Builder(); builder.isUniformBucketLevelAccessEnabled = isUniformBucketLevelAccessEnabled; builder.uniformBucketLevelAccessLockedTime = uniformBucketLevelAccessLockedTime; - builder.publicAccessPrevention = publicAccessPrevention; return builder; } @@ -223,11 +164,6 @@ public Long getUniformBucketLevelAccessLockedTime() { return uniformBucketLevelAccessLockedTime; } - /** Returns the Public Access Prevention. * */ - public PublicAccessPrevention getPublicAccessPrevention() { - return publicAccessPrevention; - } - Bucket.IamConfiguration toPb() { Bucket.IamConfiguration iamConfiguration = new Bucket.IamConfiguration(); @@ -240,8 +176,6 @@ Bucket.IamConfiguration toPb() { : new DateTime(uniformBucketLevelAccessLockedTime)); iamConfiguration.setUniformBucketLevelAccess(uniformBucketLevelAccess); - iamConfiguration.setPublicAccessPrevention( - publicAccessPrevention == null ? null : publicAccessPrevention.getValue()); return iamConfiguration; } @@ -250,17 +184,10 @@ static IamConfiguration fromPb(Bucket.IamConfiguration iamConfiguration) { Bucket.IamConfiguration.UniformBucketLevelAccess uniformBucketLevelAccess = iamConfiguration.getUniformBucketLevelAccess(); DateTime lockedTime = uniformBucketLevelAccess.getLockedTime(); - String publicAccessPrevention = iamConfiguration.getPublicAccessPrevention(); - - PublicAccessPrevention publicAccessPreventionValue = null; - if (publicAccessPrevention != null) { - publicAccessPreventionValue = PublicAccessPrevention.parse(publicAccessPrevention); - } return newBuilder() .setIsUniformBucketLevelAccessEnabled(uniformBucketLevelAccess.getEnabled()) .setUniformBucketLevelAccessLockedTime(lockedTime == null ? null : lockedTime.getValue()) - .setPublicAccessPrevention(publicAccessPreventionValue) .build(); } @@ -268,7 +195,6 @@ static IamConfiguration fromPb(Bucket.IamConfiguration iamConfiguration) { public static class Builder { private Boolean isUniformBucketLevelAccessEnabled; private Long uniformBucketLevelAccessLockedTime; - private PublicAccessPrevention publicAccessPrevention; /** Deprecated in favor of setIsUniformBucketLevelAccessEnabled(). */ @Deprecated @@ -309,18 +235,6 @@ Builder setUniformBucketLevelAccessLockedTime(Long uniformBucketLevelAccessLocke return this; } - /** - * Sets the bucket's Public Access Prevention configuration. Currently supported options are - * {@link PublicAccessPrevention#INHERITED} or {@link PublicAccessPrevention#ENFORCED} - * - * @see public-access-prevention - */ - public Builder setPublicAccessPrevention(PublicAccessPrevention publicAccessPrevention) { - this.publicAccessPrevention = publicAccessPrevention; - return this; - } - /** Builds an {@code IamConfiguration} object */ public IamConfiguration build() { return new IamConfiguration(this); @@ -423,11 +337,6 @@ public Logging build() { * Lifecycle rule for a bucket. Allows supported Actions, such as deleting and changing storage * class, to be executed when certain Conditions are met. * - *

Versions 1.50.0-1.111.2 of this library don’t support the CustomTimeBefore, - * DaysSinceCustomTime, DaysSinceNoncurrentTime and NoncurrentTimeBefore lifecycle conditions. To - * read GCS objects with those lifecycle conditions, update your Java client library to the latest - * version. - * * @see Object Lifecycle * Management */ @@ -447,11 +356,9 @@ public LifecycleRule(LifecycleAction action, LifecycleCondition condition) { && condition.getNoncurrentTimeBefore() == null && condition.getCustomTimeBefore() == null && condition.getDaysSinceCustomTime() == null) { - log.warning( - "Creating a lifecycle condition with no supported conditions:\n" - + this - + "\nAttempting to update with this rule may cause errors. Please update " - + " to the latest version of google-cloud-storage"); + throw new IllegalArgumentException( + "You must specify at least one condition to use object lifecycle " + + "management. Please see https://cloud.google.com/storage/docs/lifecycle for details."); } this.lifecycleAction = action; @@ -549,13 +456,8 @@ static LifecycleRule fromPb(Rule rule) { StorageClass.valueOf(action.getStorageClass())); break; default: - log.warning( - "The lifecycle action " - + action.getType() - + " is not supported by this version of the library. " - + "Attempting to update with this rule may cause errors. Please " - + "update to the latest version of google-cloud-storage."); - lifecycleAction = LifecycleAction.newLifecycleAction("Unknown action"); + throw new UnsupportedOperationException( + "The specified lifecycle action " + action.getType() + " is not currently supported"); } Rule.Condition condition = rule.getCondition(); @@ -805,21 +707,13 @@ public LifecycleCondition build() { } /** - * Base class for the Action to take when a Lifecycle Condition is met. Supported Actions are + * Base class for the Action to take when a Lifecycle Condition is met. Specific Actions are * expressed as subclasses of this class, accessed by static factory methods. */ - public static class LifecycleAction implements Serializable { + public abstract static class LifecycleAction implements Serializable { private static final long serialVersionUID = 5801228724709173284L; - private final String actionType; - - public LifecycleAction(String actionType) { - this.actionType = actionType; - } - - public String getActionType() { - return actionType; - } + public abstract String getActionType(); @Override public String toString() { @@ -844,24 +738,17 @@ public static SetStorageClassLifecycleAction newSetStorageClassAction( StorageClass storageClass) { return new SetStorageClassLifecycleAction(storageClass); } - - /** - * Creates a new {@code LifecycleAction , with no specific supported action associated with it. This - * is only intended as a "backup" for when the library doesn't recognize the type, and should - * generally not be used, instead use the supported actions, and upgrade the library if necessary - * to get new supported actions. - */ - public static LifecycleAction newLifecycleAction(String actionType) { - return new LifecycleAction(actionType); - } } public static class DeleteLifecycleAction extends LifecycleAction { public static final String TYPE = "Delete"; private static final long serialVersionUID = -2050986302222644873L; - private DeleteLifecycleAction() { - super(TYPE); + private DeleteLifecycleAction() {} + + @Override + public String getActionType() { + return TYPE; } } @@ -872,10 +759,14 @@ public static class SetStorageClassLifecycleAction extends LifecycleAction { private final StorageClass storageClass; private SetStorageClassLifecycleAction(StorageClass storageClass) { - super(TYPE); this.storageClass = storageClass; } + @Override + public String getActionType() { + return TYPE; + } + @Override public String toString() { return MoreObjects.toStringHelper(this) @@ -1024,11 +915,7 @@ static class RawDeleteRule extends DeleteRule { @Override void populateCondition(Rule.Condition condition) { - log.warning( - "The lifecycle condition " - + condition - + " is not currently supported. Please update to the latest version of google-cloud-java." - + " Also, use LifecycleRule rather than the deprecated DeleteRule."); + throw new UnsupportedOperationException(); } private void writeObject(ObjectOutputStream out) throws IOException { @@ -1206,15 +1093,6 @@ public abstract static class Builder { /** Deletes the lifecycle rules of this bucket. */ public abstract Builder deleteLifecycleRules(); - /** - * Sets the bucket's Recovery Point Objective (RPO). This can only be set for a dual-region - * bucket, and determines the speed at which data will be replicated between regions. See the - * {@code Rpo} class for supported values, and here for additional - * details. - */ - public abstract Builder setRpo(Rpo rpo); - /** * Sets the bucket's storage class. This defines how blobs in the bucket are stored and * determines the SLA and the cost of storage. A list of supported values is available deleteRules; private List lifecycleRules; - private Rpo rpo; private StorageClass storageClass; private String location; private String etag; @@ -1348,7 +1225,6 @@ static final class BuilderImpl extends Builder { updateTime = bucketInfo.updateTime; metageneration = bucketInfo.metageneration; location = bucketInfo.location; - rpo = bucketInfo.rpo; storageClass = bucketInfo.storageClass; cors = bucketInfo.cors; acl = bucketInfo.acl; @@ -1442,12 +1318,6 @@ public Builder deleteLifecycleRules() { return this; } - @Override - public Builder setRpo(Rpo rpo) { - this.rpo = rpo; - return this; - } - @Override public Builder setStorageClass(StorageClass storageClass) { this.storageClass = storageClass; @@ -1586,7 +1456,6 @@ public BucketInfo build() { updateTime = builder.updateTime; metageneration = builder.metageneration; location = builder.location; - rpo = builder.rpo; storageClass = builder.storageClass; cors = builder.cors; acl = builder.acl; @@ -1748,16 +1617,6 @@ public String getLocationType() { return locationType; } - /** - * Returns the bucket's recovery point objective (RPO). This defines how quickly data is - * replicated between regions in a dual-region bucket. Not defined for single-region buckets. - * - * @see - */ - public Rpo getRpo() { - return rpo; - } - /** * Returns the bucket's storage class. This defines how blobs in the bucket are stored and * determines the SLA and the cost of storage. @@ -1928,9 +1787,6 @@ com.google.api.services.storage.model.Bucket toPb() { if (locationType != null) { bucketPb.setLocationType(locationType); } - if (rpo != null) { - bucketPb.setRpo(rpo.toString()); - } if (storageClass != null) { bucketPb.setStorageClass(storageClass.toString()); } @@ -1977,52 +1833,33 @@ public ObjectAccessControl apply(Acl acl) { website.setNotFoundPage(notFoundPage); bucketPb.setWebsite(website); } + Set rules = new HashSet<>(); + if (deleteRules != null) { + rules.addAll( + transform( + deleteRules, + new Function() { + @Override + public Rule apply(DeleteRule deleteRule) { + return deleteRule.toPb(); + } + })); + } + if (lifecycleRules != null) { + rules.addAll( + transform( + lifecycleRules, + new Function() { + @Override + public Rule apply(LifecycleRule lifecycleRule) { + return lifecycleRule.toPb(); + } + })); + } - if (deleteRules != null || lifecycleRules != null) { + if (rules != null) { Lifecycle lifecycle = new Lifecycle(); - - // Here we determine if we need to "clear" any defined Lifecycle rules by explicitly setting - // the Rule list of lifecycle to the empty list. - // In order for us to clear the rules, one of the three following must be true: - // 1. deleteRules is null while lifecycleRules is non-null and empty - // 2. lifecycleRules is null while deleteRules is non-null and empty - // 3. lifecycleRules is non-null and empty while deleteRules is non-null and empty - // If none of the above three is true, we will interpret as the Lifecycle rules being - // updated to the defined set of DeleteRule and LifecycleRule. - if ((deleteRules == null && lifecycleRules.isEmpty()) - || (lifecycleRules == null && deleteRules.isEmpty()) - || (deleteRules != null && deleteRules.isEmpty() && lifecycleRules.isEmpty())) { - lifecycle.setRule(Collections.emptyList()); - } else { - Set rules = new HashSet<>(); - if (deleteRules != null) { - rules.addAll( - transform( - deleteRules, - new Function() { - @Override - public Rule apply(DeleteRule deleteRule) { - return deleteRule.toPb(); - } - })); - } - if (lifecycleRules != null) { - rules.addAll( - transform( - lifecycleRules, - new Function() { - @Override - public Rule apply(LifecycleRule lifecycleRule) { - return lifecycleRule.toPb(); - } - })); - } - - if (!rules.isEmpty()) { - lifecycle.setRule(ImmutableList.copyOf(rules)); - } - } - + lifecycle.setRule(ImmutableList.copyOf(rules)); bucketPb.setLifecycle(lifecycle); } @@ -2094,9 +1931,6 @@ static BucketInfo fromPb(com.google.api.services.storage.model.Bucket bucketPb) if (bucketPb.getLocation() != null) { builder.setLocation(bucketPb.getLocation()); } - if (bucketPb.getRpo() != null) { - builder.setRpo(Rpo.valueOf(bucketPb.getRpo())); - } if (bucketPb.getStorageClass() != null) { builder.setStorageClass(StorageClass.valueOf(bucketPb.getStorageClass())); } diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/CopyWriter.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/CopyWriter.java index d621d14920..4f9018bac0 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/CopyWriter.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/CopyWriter.java @@ -16,8 +16,11 @@ package com.google.cloud.storage; +import static com.google.cloud.RetryHelper.runWithRetries; + import com.google.cloud.Restorable; import com.google.cloud.RestorableState; +import com.google.cloud.RetryHelper; import com.google.cloud.storage.spi.v1.StorageRpc; import com.google.cloud.storage.spi.v1.StorageRpc.RewriteRequest; import com.google.cloud.storage.spi.v1.StorageRpc.RewriteResponse; @@ -25,7 +28,7 @@ import java.io.Serializable; import java.util.Map; import java.util.Objects; -import java.util.function.Function; +import java.util.concurrent.Callable; /** * Google Storage blob copy writer. A {@code CopyWriter} object allows to copy both blob's data and @@ -97,13 +100,21 @@ public long getTotalBytesCopied() { */ public void copyChunk() { if (!isDone()) { - RewriteRequest rewriteRequest = rewriteResponse.rewriteRequest; - this.rewriteResponse = - Retrying.run( - serviceOptions, - serviceOptions.getRetryAlgorithmManager().getForObjectsRewrite(rewriteRequest), - () -> storageRpc.continueRewrite(rewriteResponse), - Function.identity()); + try { + this.rewriteResponse = + runWithRetries( + new Callable() { + @Override + public RewriteResponse call() { + return storageRpc.continueRewrite(rewriteResponse); + } + }, + serviceOptions.getRetrySettings(), + StorageImpl.EXCEPTION_HANDLER, + serviceOptions.getClock()); + } catch (RetryHelper.RetryHelperException e) { + throw StorageException.translateAndThrow(e); + } } } diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/DefaultStorageRetryStrategy.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/DefaultStorageRetryStrategy.java deleted file mode 100644 index 4d11d665c2..0000000000 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/DefaultStorageRetryStrategy.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage; - -import com.fasterxml.jackson.core.io.JsonEOFException; -import com.google.api.client.http.HttpResponseException; -import com.google.cloud.BaseServiceException; -import com.google.cloud.ExceptionHandler; -import com.google.cloud.ExceptionHandler.Interceptor; -import com.google.common.collect.ImmutableSet; -import com.google.gson.stream.MalformedJsonException; -import java.io.IOException; -import java.util.Set; - -final class DefaultStorageRetryStrategy implements StorageRetryStrategy { - - private static final long serialVersionUID = -6145057244885961913L; - - private static final Interceptor INTERCEPTOR_IDEMPOTENT = - new InterceptorImpl(true, StorageException.RETRYABLE_ERRORS); - private static final Interceptor INTERCEPTOR_NON_IDEMPOTENT = - new InterceptorImpl(false, ImmutableSet.of()); - - private static final ExceptionHandler IDEMPOTENT_HANDLER = - newHandler(new EmptyJsonParsingExceptionInterceptor(), INTERCEPTOR_IDEMPOTENT); - private static final ExceptionHandler NON_IDEMPOTENT_HANDLER = - newHandler(INTERCEPTOR_NON_IDEMPOTENT); - - @Override - public ExceptionHandler getIdempotentHandler() { - return IDEMPOTENT_HANDLER; - } - - @Override - public ExceptionHandler getNonidempotentHandler() { - return NON_IDEMPOTENT_HANDLER; - } - - private static ExceptionHandler newHandler(Interceptor... interceptors) { - return ExceptionHandler.newBuilder().addInterceptors(interceptors).build(); - } - - private static class InterceptorImpl implements BaseInterceptor { - - private static final long serialVersionUID = -5153236691367895096L; - private final boolean idempotent; - private final ImmutableSet retryableErrors; - - private InterceptorImpl(boolean idempotent, Set retryableErrors) { - this.idempotent = idempotent; - this.retryableErrors = ImmutableSet.copyOf(retryableErrors); - } - - @Override - public RetryResult beforeEval(Exception exception) { - if (exception instanceof BaseServiceException) { - BaseServiceException baseServiceException = (BaseServiceException) exception; - return deepShouldRetry(baseServiceException); - } else if (exception instanceof HttpResponseException) { - int code = ((HttpResponseException) exception).getStatusCode(); - return shouldRetryCodeReason(code, null); - } else if (exception instanceof IOException) { - IOException ioException = (IOException) exception; - return shouldRetryIOException(ioException); - } - return RetryResult.CONTINUE_EVALUATION; - } - - private RetryResult shouldRetryCodeReason(Integer code, String reason) { - if (BaseServiceException.isRetryable(code, reason, idempotent, retryableErrors)) { - return RetryResult.RETRY; - } else { - return RetryResult.NO_RETRY; - } - } - - private RetryResult shouldRetryIOException(IOException ioException) { - if (ioException instanceof JsonEOFException && idempotent) { // Jackson - return RetryResult.RETRY; - } else if (ioException instanceof MalformedJsonException && idempotent) { // Gson - return RetryResult.RETRY; - } else if (BaseServiceException.isRetryable(idempotent, ioException)) { - return RetryResult.RETRY; - } else { - return RetryResult.NO_RETRY; - } - } - - private RetryResult deepShouldRetry(BaseServiceException baseServiceException) { - if (baseServiceException.getCode() == BaseServiceException.UNKNOWN_CODE - && baseServiceException.getReason() == null) { - final Throwable cause = baseServiceException.getCause(); - if (cause instanceof IOException) { - IOException ioException = (IOException) cause; - return shouldRetryIOException(ioException); - } - } - - int code = baseServiceException.getCode(); - String reason = baseServiceException.getReason(); - return shouldRetryCodeReason(code, reason); - } - } - - private static final class EmptyJsonParsingExceptionInterceptor implements BaseInterceptor { - private static final long serialVersionUID = -3320984020388043628L; - - @Override - public RetryResult beforeEval(Exception exception) { - if (exception instanceof IllegalArgumentException) { - IllegalArgumentException illegalArgumentException = (IllegalArgumentException) exception; - if (illegalArgumentException.getMessage().equals("no JSON input found")) { - return RetryResult.RETRY; - } - } - return RetryResult.CONTINUE_EVALUATION; - } - } - - private interface BaseInterceptor extends Interceptor { - @Override - default RetryResult afterEval(Exception exception, RetryResult retryResult) { - return RetryResult.CONTINUE_EVALUATION; - } - } -} diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/PolicyHelper.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/PolicyHelper.java index ca3e8bc31a..e198d853bf 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/PolicyHelper.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/PolicyHelper.java @@ -34,8 +34,8 @@ class PolicyHelper { static Policy convertFromApiPolicy(com.google.api.services.storage.model.Policy apiPolicy) { Policy.Builder policyBuilder = Policy.newBuilder(); List bindings = apiPolicy.getBindings(); - ImmutableList.Builder coreBindings = ImmutableList.builder(); if (null != bindings && !bindings.isEmpty()) { + ImmutableList.Builder coreBindings = ImmutableList.builder(); for (Bindings binding : bindings) { Binding.Builder bindingBuilder = Binding.newBuilder(); bindingBuilder.setRole(binding.getRole()); @@ -49,8 +49,10 @@ static Policy convertFromApiPolicy(com.google.api.services.storage.model.Policy } coreBindings.add(bindingBuilder.build()); } + policyBuilder.setBindings(coreBindings.build()); + } else { + throw new IllegalStateException("Missing required bindings."); } - policyBuilder.setBindings(coreBindings.build()); return policyBuilder.setEtag(apiPolicy.getEtag()).setVersion(apiPolicy.getVersion()).build(); } diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/PostPolicyV4.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/PostPolicyV4.java index 2cd2311477..96afca06e1 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/PostPolicyV4.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/PostPolicyV4.java @@ -21,9 +21,11 @@ import java.net.URI; import java.net.URISyntaxException; import java.text.SimpleDateFormat; +import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.LinkedHashSet; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; @@ -52,6 +54,7 @@ private PostPolicyV4(String url, Map fields) { } catch (URISyntaxException e) { throw new IllegalArgumentException(e); } + PostFieldsV4.validateFields(fields); this.url = url; this.fields = Collections.unmodifiableMap(fields); @@ -90,12 +93,40 @@ public Map getFields() { */ public static final class PostFieldsV4 { private final Map fieldsMap; + private static final List VALID_FIELDS = + Arrays.asList( + "acl", + "bucket", + "cache-control", + "content-disposition", + "content-encoding", + "content-type", + "expires", + "file", + "key", + "policy", + "success_action_redirect", + "success_action_status", + "x-goog-algorithm", + "x-goog-credential", + "x-goog-date", + "x-goog-signature"); + + private static void validateFields(Map fields) { + for (String key : fields.keySet()) { + if (!VALID_FIELDS.contains(key.toLowerCase()) + && !key.startsWith(Builder.CUSTOM_FIELD_PREFIX)) { + throw new IllegalArgumentException("Invalid key: " + key); + } + } + } private PostFieldsV4(Builder builder) { this(builder.fieldsMap); } private PostFieldsV4(Map fields) { + validateFields(fields); this.fieldsMap = Collections.unmodifiableMap(fields); } @@ -412,21 +443,13 @@ public String toJson() { StringBuilder escapedJson = new StringBuilder(); // Certain characters in a policy must be escaped - char[] jsonArray = json.toCharArray(); - for (int i = 0; i < jsonArray.length; i++) { - char c = jsonArray[i]; + for (char c : json.toCharArray()) { if (c >= 128) { // is a unicode character escapedJson.append(String.format("\\u%04x", (int) c)); } else { switch (c) { case '\\': - // The JsonObject/JsonArray operations above handle quote escapes, so leave any "\"" - // found alone - if (jsonArray[i + 1] == '"') { - escapedJson.append("\\"); - } else { - escapedJson.append("\\\\"); - } + escapedJson.append("\\\\"); break; case '\b': escapedJson.append("\\b"); diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/ResumableMedia.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/ResumableMedia.java deleted file mode 100644 index 9f1e19006e..0000000000 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/ResumableMedia.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage; - -import com.google.api.gax.retrying.ResultRetryAlgorithm; -import com.google.cloud.storage.spi.v1.StorageRpc; -import java.net.URL; -import java.util.Map; -import java.util.function.Function; -import java.util.function.Supplier; - -final class ResumableMedia { - - static Supplier startUploadForBlobInfo( - final StorageOptions storageOptions, - final BlobInfo blob, - final Map optionsMap, - ResultRetryAlgorithm algorithm) { - return () -> - Retrying.run( - storageOptions, - algorithm, - () -> storageOptions.getStorageRpcV1().open(blob.toPb(), optionsMap), - Function.identity()); - } - - static Supplier startUploadForSignedUrl( - final StorageOptions storageOptions, final URL signedURL, ResultRetryAlgorithm algorithm) { - if (!isValidSignedURL(signedURL.getQuery())) { - throw new StorageException(2, "invalid signedURL"); - } - return () -> - Retrying.run( - storageOptions, - algorithm, - () -> storageOptions.getStorageRpcV1().open(signedURL.toString()), - Function.identity()); - } - - private static boolean isValidSignedURL(String signedURLQuery) { - boolean isValid = true; - if (signedURLQuery.startsWith("X-Goog-Algorithm=")) { - if (!signedURLQuery.contains("&X-Goog-Credential=") - || !signedURLQuery.contains("&X-Goog-Date=") - || !signedURLQuery.contains("&X-Goog-Expires=") - || !signedURLQuery.contains("&X-Goog-SignedHeaders=") - || !signedURLQuery.contains("&X-Goog-Signature=")) { - isValid = false; - } - } else if (signedURLQuery.startsWith("GoogleAccessId=")) { - if (!signedURLQuery.contains("&Expires=") || !signedURLQuery.contains("&Signature=")) { - isValid = false; - } - } else { - isValid = false; - } - return isValid; - } -} diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/RetryAlgorithmManager.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/RetryAlgorithmManager.java deleted file mode 100644 index 20a13f66a0..0000000000 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/RetryAlgorithmManager.java +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage; - -import com.google.api.gax.retrying.ResultRetryAlgorithm; -import com.google.api.services.storage.model.Bucket; -import com.google.api.services.storage.model.BucketAccessControl; -import com.google.api.services.storage.model.HmacKeyMetadata; -import com.google.api.services.storage.model.ObjectAccessControl; -import com.google.api.services.storage.model.Policy; -import com.google.api.services.storage.model.StorageObject; -import com.google.cloud.storage.spi.v1.StorageRpc; -import com.google.cloud.storage.spi.v1.StorageRpc.RewriteRequest; -import java.io.Serializable; -import java.util.List; -import java.util.Map; - -final class RetryAlgorithmManager implements Serializable { - - private static final long serialVersionUID = -8615379702537758604L; - private final StorageRetryStrategy retryStrategy; - - RetryAlgorithmManager(StorageRetryStrategy retryStrategy) { - this.retryStrategy = retryStrategy; - } - - public ResultRetryAlgorithm getForBucketAclCreate( - BucketAccessControl pb, Map optionsMap) { - return retryStrategy.getNonidempotentHandler(); - } - - public ResultRetryAlgorithm getForBucketAclDelete( - String pb, Map optionsMap) { - return retryStrategy.getNonidempotentHandler(); - } - - public ResultRetryAlgorithm getForBucketAclGet( - String pb, Map optionsMap) { - return retryStrategy.getIdempotentHandler(); - } - - public ResultRetryAlgorithm getForBucketAclUpdate( - BucketAccessControl pb, Map optionsMap) { - return retryStrategy.getNonidempotentHandler(); - } - - public ResultRetryAlgorithm getForBucketAclList( - String pb, Map optionsMap) { - return retryStrategy.getIdempotentHandler(); - } - - public ResultRetryAlgorithm getForBucketsCreate( - Bucket pb, Map optionsMap) { - return retryStrategy.getIdempotentHandler(); - } - - public ResultRetryAlgorithm getForBucketsDelete( - Bucket pb, Map optionsMap) { - return retryStrategy.getIdempotentHandler(); - } - - public ResultRetryAlgorithm getForBucketsGet(Bucket pb, Map optionsMap) { - return retryStrategy.getIdempotentHandler(); - } - - public ResultRetryAlgorithm getForBucketsUpdate( - Bucket pb, Map optionsMap) { - // TODO: Include etag when it is supported by the library - return optionsMap.containsKey(StorageRpc.Option.IF_METAGENERATION_MATCH) - ? retryStrategy.getIdempotentHandler() - : retryStrategy.getNonidempotentHandler(); - } - - public ResultRetryAlgorithm getForBucketsList(Map optionsMap) { - return retryStrategy.getIdempotentHandler(); - } - - public ResultRetryAlgorithm getForBucketsLockRetentionPolicy( - Bucket pb, Map optionsMap) { - // Always idempotent because IfMetagenerationMatch is required - return retryStrategy.getIdempotentHandler(); - } - - public ResultRetryAlgorithm getForBucketsGetIamPolicy( - String bucket, Map optionsMap) { - return retryStrategy.getIdempotentHandler(); - } - - public ResultRetryAlgorithm getForBucketsSetIamPolicy( - String bucket, Policy pb, Map optionsMap) { - return pb.getEtag() != null - ? retryStrategy.getIdempotentHandler() - : retryStrategy.getNonidempotentHandler(); - } - - public ResultRetryAlgorithm getForBucketsTestIamPermissions( - String bucket, List permissions, Map optionsMap) { - return retryStrategy.getIdempotentHandler(); - } - - public ResultRetryAlgorithm getForDefaultObjectAclCreate(ObjectAccessControl pb) { - return retryStrategy.getNonidempotentHandler(); - } - - public ResultRetryAlgorithm getForDefaultObjectAclDelete(String pb) { - return retryStrategy.getNonidempotentHandler(); - } - - public ResultRetryAlgorithm getForDefaultObjectAclGet(String pb) { - return retryStrategy.getIdempotentHandler(); - } - - public ResultRetryAlgorithm getForDefaultObjectAclUpdate(ObjectAccessControl pb) { - return retryStrategy.getNonidempotentHandler(); - } - - public ResultRetryAlgorithm getForDefaultObjectAclList(String pb) { - return retryStrategy.getIdempotentHandler(); - } - - public ResultRetryAlgorithm getForHmacKeyCreate( - String pb, Map optionsMap) { - return retryStrategy.getNonidempotentHandler(); - } - - public ResultRetryAlgorithm getForHmacKeyDelete( - HmacKeyMetadata pb, Map optionsMap) { - return retryStrategy.getIdempotentHandler(); - } - - public ResultRetryAlgorithm getForHmacKeyGet( - String accessId, Map optionsMap) { - return retryStrategy.getIdempotentHandler(); - } - - public ResultRetryAlgorithm getForHmacKeyUpdate( - HmacKeyMetadata pb, Map optionsMap) { - // TODO: Include etag when it is supported by the library - return retryStrategy.getNonidempotentHandler(); - } - - public ResultRetryAlgorithm getForHmacKeyList(Map optionsMap) { - return retryStrategy.getIdempotentHandler(); - } - - public ResultRetryAlgorithm getForObjectAclCreate(ObjectAccessControl aclPb) { - return retryStrategy.getNonidempotentHandler(); - } - - public ResultRetryAlgorithm getForObjectAclDelete( - String bucket, String name, Long generation, String pb) { - return retryStrategy.getNonidempotentHandler(); - } - - public ResultRetryAlgorithm getForObjectAclList(String bucket, String name, Long generation) { - return retryStrategy.getIdempotentHandler(); - } - - public ResultRetryAlgorithm getForObjectAclGet( - String bucket, String name, Long generation, String pb) { - return retryStrategy.getIdempotentHandler(); - } - - public ResultRetryAlgorithm getForObjectAclUpdate(ObjectAccessControl aclPb) { - return retryStrategy.getNonidempotentHandler(); - } - - public ResultRetryAlgorithm getForObjectsCreate( - StorageObject pb, Map optionsMap) { - if (pb.getGeneration() != null && pb.getGeneration() == 0) { - return retryStrategy.getIdempotentHandler(); - } - return optionsMap.containsKey(StorageRpc.Option.IF_GENERATION_MATCH) - ? retryStrategy.getIdempotentHandler() - : retryStrategy.getNonidempotentHandler(); - } - - public ResultRetryAlgorithm getForObjectsDelete( - StorageObject pb, Map optionsMap) { - return optionsMap.containsKey(StorageRpc.Option.IF_GENERATION_MATCH) - ? retryStrategy.getIdempotentHandler() - : retryStrategy.getNonidempotentHandler(); - } - - public ResultRetryAlgorithm getForObjectsGet( - StorageObject pb, Map optionsMap) { - return retryStrategy.getIdempotentHandler(); - } - - public ResultRetryAlgorithm getForObjectsUpdate( - StorageObject pb, Map optionsMap) { - return optionsMap.containsKey(StorageRpc.Option.IF_METAGENERATION_MATCH) - ? retryStrategy.getIdempotentHandler() - : retryStrategy.getNonidempotentHandler(); - } - - public ResultRetryAlgorithm getForObjectsList( - String bucket, Map optionsMap) { - return retryStrategy.getIdempotentHandler(); - } - - public ResultRetryAlgorithm getForObjectsRewrite(RewriteRequest pb) { - return pb.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) - ? retryStrategy.getIdempotentHandler() - : retryStrategy.getNonidempotentHandler(); - } - - public ResultRetryAlgorithm getForResumableUploadSessionCreate( - Map optionsMap) { - return optionsMap.containsKey(StorageRpc.Option.IF_GENERATION_MATCH) - ? retryStrategy.getIdempotentHandler() - : retryStrategy.getNonidempotentHandler(); - } - - public ResultRetryAlgorithm getForResumableUploadSessionWrite( - Map optionsMap) { - return optionsMap.containsKey(StorageRpc.Option.IF_GENERATION_MATCH) - ? retryStrategy.getIdempotentHandler() - : retryStrategy.getNonidempotentHandler(); - } - - public ResultRetryAlgorithm getForServiceAccountGet(String pb) { - return retryStrategy.getIdempotentHandler(); - } -} diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/Retrying.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/Retrying.java deleted file mode 100644 index 3daf2c17ec..0000000000 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/Retrying.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage; - -import static com.google.cloud.RetryHelper.runWithRetries; - -import com.google.api.core.ApiClock; -import com.google.api.gax.retrying.ResultRetryAlgorithm; -import com.google.api.gax.retrying.RetrySettings; -import com.google.cloud.RetryHelper.RetryHelperException; -import java.util.concurrent.Callable; -import java.util.function.Function; - -final class Retrying { - - /** - * A convenience wrapper around {@link com.google.cloud.RetryHelper#runWithRetries(Callable, - * RetrySettings, ResultRetryAlgorithm, ApiClock)} that gives us centralized error translation and - * reduces some duplication in how we resolved the {@link RetrySettings} and {@link ApiClock}. - * - * @param The result type of {@code c} - * @param The result type of any mapping that takes place via {@code f} - * @param options The {@link StorageOptions} which {@link RetrySettings} and {@link ApiClock} will - * be resolved from. - * @param algorithm The {@link ResultRetryAlgorithm} to use when determining if a retry is - * possible - * @param c The {@link Callable} which will be passed to runWithRetries producing some {@code T}, - * can optionally return null - * @param f A post process mapping {@link Function} which can be used to transform the result from - * {@code c} if it is successful and non-null - * @return A {@code U} (possibly null) after applying {@code f} to the result of {@code c} - * @throws StorageException if {@code c} fails due to any retry exhaustion - */ - static U run( - StorageOptions options, ResultRetryAlgorithm algorithm, Callable c, Function f) { - try { - T result = runWithRetries(c, options.getRetrySettings(), algorithm, options.getClock()); - return result == null ? null : f.apply(result); - } catch (RetryHelperException e) { - throw StorageException.coalesce(e); - } - } -} diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/Rpo.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/Rpo.java deleted file mode 100644 index ca6a4b0abf..0000000000 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/Rpo.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.storage; - -import com.google.api.core.ApiFunction; -import com.google.cloud.StringEnumType; -import com.google.cloud.StringEnumValue; - -/** - * Enums for the Recovery Point Objective (RPO) of dual-region buckets, which determines how fast - * data is replicated between regions. - * - * @see https://cloud.google.com/storage/docs/turbo-replication - */ -public final class Rpo extends StringEnumValue { - - private static final long serialVersionUID = -3954216195295821508L; - - private Rpo(String constant) { - super(constant); - } - - private static final ApiFunction CONSTRUCTOR = Rpo::new; - - private static final StringEnumType type = new StringEnumType<>(Rpo.class, CONSTRUCTOR); - - /** - * Default recovery point objective. With this setting, there is no guarantee on the amount of - * time it takes for data to replicate between regions. - */ - public static final Rpo DEFAULT = type.createAndRegister("DEFAULT"); - - /** - * Turbo recovery point objective. With this setting, data in a dual-region bucket will replicate - * between regions within 15 minutes. - */ - public static final Rpo ASYNC_TURBO = type.createAndRegister("ASYNC_TURBO"); - - /** - * Get the Rpo for the given String constant, and throw an exception if the constant is not - * recognized. - */ - public static Rpo valueOfStrict(String constant) { - return type.valueOfStrict(constant); - } - - /** Get the Rpo for the given String constant, and allow unrecognized values. */ - public static Rpo valueOf(String constant) { - return type.valueOf(constant); - } - - /** Return the known values for Rpo. */ - public static Rpo[] values() { - return type.values(); - } -} 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 634155f244..ec866237db 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 @@ -847,16 +847,6 @@ public static BlobSourceOption decryptionKey(String key) { public static BlobSourceOption userProject(String userProject) { return new BlobSourceOption(StorageRpc.Option.USER_PROJECT, userProject); } - - /** - * Returns an option for whether the request should return the raw input stream, instead of - * automatically decompressing the content. By default, this is false for Blob.downloadTo(), but - * true for ReadChannel.read(). - */ - public static BlobSourceOption shouldReturnRawInputStream(boolean shouldReturnRawInputStream) { - return new BlobSourceOption( - StorageRpc.Option.RETURN_RAW_INPUT_STREAM, shouldReturnRawInputStream); - } } /** Class for specifying blob get options. */ @@ -872,10 +862,6 @@ private BlobGetOption(StorageRpc.Option rpcOption, String value) { super(rpcOption, value); } - private BlobGetOption(StorageRpc.Option rpcOption, boolean value) { - super(rpcOption, value); - } - /** * Returns an option for blob's data generation match. If this option is used the request will * fail if blob's generation does not match. The generation value to compare with the actual @@ -967,16 +953,6 @@ public static BlobGetOption decryptionKey(Key key) { public static BlobGetOption decryptionKey(String key) { return new BlobGetOption(StorageRpc.Option.CUSTOMER_SUPPLIED_KEY, key); } - - /** - * Returns an option for whether the request should return the raw input stream, instead of - * automatically decompressing the content. By default, this is false for Blob.downloadTo(), but - * true for ReadChannel.read(). - */ - public static BlobGetOption shouldReturnRawInputStream(boolean shouldReturnRawInputStream) { - return new BlobGetOption( - StorageRpc.Option.RETURN_RAW_INPUT_STREAM, shouldReturnRawInputStream); - } } /** Class for specifying bucket list options. */ @@ -3540,11 +3516,6 @@ HmacKeyMetadata updateHmacKeyState( /** * Gets the IAM policy for the provided bucket. * - *

It's possible for bindings to be empty and instead have permissions inherited through - * Project or Organization IAM Policies. To prevent corrupting policies when you update an IAM - * policy with {@code Storage.setIamPolicy}, the ETAG value is used to perform optimistic - * concurrency. - * *

Example of getting the IAM policy for a bucket. * *

{@code
@@ -3561,9 +3532,6 @@ HmacKeyMetadata updateHmacKeyState(
   /**
    * Updates the IAM policy on the specified bucket.
    *
-   * 

To prevent corrupting policies when you update an IAM policy with {@code - * Storage.setIamPolicy}, the ETAG value is used to perform optimistic concurrency. - * *

Example of updating the IAM policy on a bucket. * *

{@code
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 194c9d217e..f4b8d0c424 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
@@ -37,7 +37,7 @@ public final class StorageException extends BaseHttpServiceException {
   private static final String CONNECTION_CLOSED_PREMATURELY = "connectionClosedPrematurely";
 
   // see: https://cloud.google.com/storage/docs/resumable-uploads-xml#practices
-  static final Set RETRYABLE_ERRORS =
+  private static final Set RETRYABLE_ERRORS =
       ImmutableSet.of(
           new Error(504, null),
           new Error(503, null),
@@ -78,26 +78,7 @@ public StorageException(GoogleJsonError error) {
    */
   public static StorageException translateAndThrow(RetryHelperException ex) {
     BaseServiceException.translate(ex);
-    throw getStorageException(ex);
-  }
-
-  private static StorageException getStorageException(Throwable t) {
-    return new StorageException(UNKNOWN_CODE, t.getMessage(), t.getCause());
-  }
-
-  /**
-   * Attempt to find an Exception which is a {@link BaseServiceException} If neither {@code t} or
-   * {@code t.getCause()} are a {@code BaseServiceException} a {@link StorageException} will be
-   * created with an unknown status code.
-   */
-  static BaseServiceException coalesce(Throwable t) {
-    if (t instanceof BaseServiceException) {
-      return (BaseServiceException) t;
-    }
-    if (t.getCause() instanceof BaseServiceException) {
-      return (BaseServiceException) t.getCause();
-    }
-    return getStorageException(t);
+    throw new StorageException(UNKNOWN_CODE, ex.getMessage(), ex.getCause());
   }
 
   /**
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 3d0f9bafe9..8639f0d864 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
@@ -16,6 +16,8 @@
 
 package com.google.cloud.storage;
 
+import static com.google.cloud.RetryHelper.runWithRetries;
+import static com.google.cloud.storage.PolicyHelper.convertFromApiPolicy;
 import static com.google.cloud.storage.PolicyHelper.convertToApiPolicy;
 import static com.google.cloud.storage.SignedUrlEncodingHelper.Rfc3986UriEncode;
 import static com.google.cloud.storage.spi.v1.StorageRpc.Option.DELIMITER;
@@ -33,10 +35,10 @@
 import static java.nio.charset.StandardCharsets.UTF_8;
 
 import com.google.api.gax.paging.Page;
-import com.google.api.gax.retrying.ResultRetryAlgorithm;
 import com.google.api.services.storage.model.BucketAccessControl;
 import com.google.api.services.storage.model.ObjectAccessControl;
 import com.google.api.services.storage.model.StorageObject;
+import com.google.api.services.storage.model.TestIamPermissionsResponse;
 import com.google.auth.ServiceAccountSigner;
 import com.google.cloud.BaseService;
 import com.google.cloud.BatchResult;
@@ -44,6 +46,7 @@
 import com.google.cloud.PageImpl.NextPageFetcher;
 import com.google.cloud.Policy;
 import com.google.cloud.ReadChannel;
+import com.google.cloud.RetryHelper.RetryHelperException;
 import com.google.cloud.Tuple;
 import com.google.cloud.WriteChannel;
 import com.google.cloud.storage.Acl.Entity;
@@ -53,8 +56,9 @@
 import com.google.cloud.storage.PostPolicyV4.PostFieldsV4;
 import com.google.cloud.storage.PostPolicyV4.PostPolicyV4Document;
 import com.google.cloud.storage.spi.v1.StorageRpc;
-import com.google.cloud.storage.spi.v1.StorageRpc.RewriteRequest;
+import com.google.cloud.storage.spi.v1.StorageRpc.RewriteResponse;
 import com.google.common.base.CharMatcher;
+import com.google.common.base.Function;
 import com.google.common.base.Preconditions;
 import com.google.common.base.Strings;
 import com.google.common.collect.ImmutableList;
@@ -90,7 +94,6 @@
 import java.util.TimeZone;
 import java.util.concurrent.Callable;
 import java.util.concurrent.TimeUnit;
-import java.util.function.Function;
 
 final class StorageImpl extends BaseService implements Storage {
 
@@ -106,23 +109,41 @@ final class StorageImpl extends BaseService implements Storage {
   private static final int DEFAULT_BUFFER_SIZE = 15 * 1024 * 1024;
   private static final int MIN_BUFFER_SIZE = 256 * 1024;
 
-  private final RetryAlgorithmManager retryAlgorithmManager;
+  private static final Function, Boolean> DELETE_FUNCTION =
+      new Function, Boolean>() {
+        @Override
+        public Boolean apply(Tuple tuple) {
+          return tuple.y();
+        }
+      };
+
   private final StorageRpc storageRpc;
 
   StorageImpl(StorageOptions options) {
     super(options);
-    this.retryAlgorithmManager = options.getRetryAlgorithmManager();
-    this.storageRpc = options.getStorageRpcV1();
+    storageRpc = options.getStorageRpcV1();
   }
 
   @Override
   public Bucket create(BucketInfo bucketInfo, BucketTargetOption... options) {
     final com.google.api.services.storage.model.Bucket bucketPb = bucketInfo.toPb();
     final Map optionsMap = optionMap(bucketInfo, options);
-    ResultRetryAlgorithm algorithm =
-        retryAlgorithmManager.getForBucketsCreate(bucketPb, optionsMap);
-    return run(
-        algorithm, () -> storageRpc.create(bucketPb, optionsMap), (b) -> Bucket.fromPb(this, b));
+    try {
+      return Bucket.fromPb(
+          this,
+          runWithRetries(
+              new Callable() {
+                @Override
+                public com.google.api.services.storage.model.Bucket call() {
+                  return storageRpc.create(bucketPb, optionsMap);
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock()));
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
@@ -190,14 +211,23 @@ private Blob internalCreate(
     Preconditions.checkNotNull(content);
     final StorageObject blobPb = info.toPb();
     final Map optionsMap = optionMap(info, options);
-    ResultRetryAlgorithm algorithm =
-        retryAlgorithmManager.getForObjectsCreate(blobPb, optionsMap);
-    return run(
-        algorithm,
-        () ->
-            storageRpc.create(
-                blobPb, new ByteArrayInputStream(content, offset, length), optionsMap),
-        (x) -> Blob.fromPb(this, x));
+    try {
+      return Blob.fromPb(
+          this,
+          runWithRetries(
+              new Callable() {
+                @Override
+                public StorageObject call() {
+                  return storageRpc.create(
+                      blobPb, new ByteArrayInputStream(content, offset, length), optionsMap);
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock()));
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
@@ -258,10 +288,22 @@ private static void uploadHelper(ReadableByteChannel reader, WriteChannel writer
   public Bucket get(String bucket, BucketGetOption... options) {
     final com.google.api.services.storage.model.Bucket bucketPb = BucketInfo.of(bucket).toPb();
     final Map optionsMap = optionMap(options);
-    ResultRetryAlgorithm algorithm =
-        retryAlgorithmManager.getForBucketsGet(bucketPb, optionsMap);
-    return run(
-        algorithm, () -> storageRpc.get(bucketPb, optionsMap), (b) -> Bucket.fromPb(this, b));
+    try {
+      com.google.api.services.storage.model.Bucket answer =
+          runWithRetries(
+              new Callable() {
+                @Override
+                public com.google.api.services.storage.model.Bucket call() {
+                  return storageRpc.get(bucketPb, optionsMap);
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock());
+      return answer == null ? null : Bucket.fromPb(this, answer);
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
@@ -273,10 +315,22 @@ public Blob get(String bucket, String blob, BlobGetOption... options) {
   public Blob get(BlobId blob, BlobGetOption... options) {
     final StorageObject storedObject = blob.toPb();
     final Map optionsMap = optionMap(blob, options);
-    ResultRetryAlgorithm algorithm =
-        retryAlgorithmManager.getForObjectsGet(storedObject, optionsMap);
-    return run(
-        algorithm, () -> storageRpc.get(storedObject, optionsMap), (x) -> Blob.fromPb(this, x));
+    try {
+      StorageObject storageObject =
+          runWithRetries(
+              new Callable() {
+                @Override
+                public StorageObject call() {
+                  return storageRpc.get(storedObject, optionsMap);
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock());
+      return storageObject == null ? null : Blob.fromPb(this, storageObject);
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
@@ -331,21 +385,16 @@ private static class HmacKeyMetadataPageFetcher implements NextPageFetcher options;
 
-    HmacKeyMetadataPageFetcher(
-        StorageOptions serviceOptions,
-        RetryAlgorithmManager retryAlgorithmManager,
-        Map options) {
+    HmacKeyMetadataPageFetcher(StorageOptions serviceOptions, Map options) {
       this.serviceOptions = serviceOptions;
-      this.retryAlgorithmManager = retryAlgorithmManager;
       this.options = options;
     }
 
     @Override
     public Page getNextPage() {
-      return listHmacKeys(serviceOptions, retryAlgorithmManager, options);
+      return listHmacKeys(serviceOptions, options);
     }
   }
 
@@ -361,65 +410,116 @@ public Page list(final String bucket, BlobListOption... options) {
 
   private static Page listBuckets(
       final StorageOptions serviceOptions, final Map optionsMap) {
-    ResultRetryAlgorithm algorithm =
-        serviceOptions.getRetryAlgorithmManager().getForBucketsList(optionsMap);
-    return Retrying.run(
-        serviceOptions,
-        algorithm,
-        () -> serviceOptions.getStorageRpcV1().list(optionsMap),
-        (result) -> {
-          String cursor = result.x();
-          Iterable buckets =
-              result.y() == null
-                  ? ImmutableList.of()
-                  : Iterables.transform(
-                      result.y(), bucketPb -> Bucket.fromPb(serviceOptions.getService(), bucketPb));
-          return new PageImpl<>(
-              new BucketPageFetcher(serviceOptions, cursor, optionsMap), cursor, buckets);
-        });
+    try {
+      Tuple> result =
+          runWithRetries(
+              new Callable<
+                  Tuple>>() {
+                @Override
+                public Tuple>
+                    call() {
+                  return serviceOptions.getStorageRpcV1().list(optionsMap);
+                }
+              },
+              serviceOptions.getRetrySettings(),
+              EXCEPTION_HANDLER,
+              serviceOptions.getClock());
+      String cursor = result.x();
+      Iterable buckets =
+          result.y() == null
+              ? ImmutableList.of()
+              : Iterables.transform(
+                  result.y(),
+                  new Function() {
+                    @Override
+                    public Bucket apply(com.google.api.services.storage.model.Bucket bucketPb) {
+                      return Bucket.fromPb(serviceOptions.getService(), bucketPb);
+                    }
+                  });
+      return new PageImpl<>(
+          new BucketPageFetcher(serviceOptions, cursor, optionsMap), cursor, buckets);
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   private static Page listBlobs(
       final String bucket,
       final StorageOptions serviceOptions,
       final Map optionsMap) {
-    ResultRetryAlgorithm algorithm =
-        serviceOptions.getRetryAlgorithmManager().getForObjectsList(bucket, optionsMap);
-    return Retrying.run(
-        serviceOptions,
-        algorithm,
-        () -> serviceOptions.getStorageRpcV1().list(bucket, optionsMap),
-        (result) -> {
-          String cursor = result.x();
-          Iterable blobs =
-              result.y() == null
-                  ? ImmutableList.of()
-                  : Iterables.transform(
-                      result.y(),
-                      storageObject -> Blob.fromPb(serviceOptions.getService(), storageObject));
-          return new PageImpl<>(
-              new BlobPageFetcher(bucket, serviceOptions, cursor, optionsMap), cursor, blobs);
-        });
+    try {
+      Tuple> result =
+          runWithRetries(
+              new Callable>>() {
+                @Override
+                public Tuple> call() {
+                  return serviceOptions.getStorageRpcV1().list(bucket, optionsMap);
+                }
+              },
+              serviceOptions.getRetrySettings(),
+              EXCEPTION_HANDLER,
+              serviceOptions.getClock());
+      String cursor = result.x();
+      Iterable blobs =
+          result.y() == null
+              ? ImmutableList.of()
+              : Iterables.transform(
+                  result.y(),
+                  new Function() {
+                    @Override
+                    public Blob apply(StorageObject storageObject) {
+                      return Blob.fromPb(serviceOptions.getService(), storageObject);
+                    }
+                  });
+      return new PageImpl<>(
+          new BlobPageFetcher(bucket, serviceOptions, cursor, optionsMap), cursor, blobs);
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
   public Bucket update(BucketInfo bucketInfo, BucketTargetOption... options) {
     final com.google.api.services.storage.model.Bucket bucketPb = bucketInfo.toPb();
     final Map optionsMap = optionMap(bucketInfo, options);
-    ResultRetryAlgorithm algorithm =
-        retryAlgorithmManager.getForBucketsUpdate(bucketPb, optionsMap);
-    return run(
-        algorithm, () -> storageRpc.patch(bucketPb, optionsMap), (x) -> Bucket.fromPb(this, x));
+    try {
+      return Bucket.fromPb(
+          this,
+          runWithRetries(
+              new Callable() {
+                @Override
+                public com.google.api.services.storage.model.Bucket call() {
+                  return storageRpc.patch(bucketPb, optionsMap);
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock()));
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
   public Blob update(BlobInfo blobInfo, BlobTargetOption... options) {
     final StorageObject storageObject = blobInfo.toPb();
     final Map optionsMap = optionMap(blobInfo, options);
-    ResultRetryAlgorithm algorithm =
-        retryAlgorithmManager.getForObjectsUpdate(storageObject, optionsMap);
-    return run(
-        algorithm, () -> storageRpc.patch(storageObject, optionsMap), (x) -> Blob.fromPb(this, x));
+    try {
+      return Blob.fromPb(
+          this,
+          runWithRetries(
+              new Callable() {
+                @Override
+                public StorageObject call() {
+                  return storageRpc.patch(storageObject, optionsMap);
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock()));
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
@@ -431,9 +531,20 @@ public Blob update(BlobInfo blobInfo) {
   public boolean delete(String bucket, BucketSourceOption... options) {
     final com.google.api.services.storage.model.Bucket bucketPb = BucketInfo.of(bucket).toPb();
     final Map optionsMap = optionMap(options);
-    ResultRetryAlgorithm algorithm =
-        retryAlgorithmManager.getForBucketsDelete(bucketPb, optionsMap);
-    return run(algorithm, () -> storageRpc.delete(bucketPb, optionsMap), Function.identity());
+    try {
+      return runWithRetries(
+          new Callable() {
+            @Override
+            public Boolean call() {
+              return storageRpc.delete(bucketPb, optionsMap);
+            }
+          },
+          getOptions().getRetrySettings(),
+          EXCEPTION_HANDLER,
+          getOptions().getClock());
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
@@ -445,9 +556,20 @@ public boolean delete(String bucket, String blob, BlobSourceOption... options) {
   public boolean delete(BlobId blob, BlobSourceOption... options) {
     final StorageObject storageObject = blob.toPb();
     final Map optionsMap = optionMap(blob, options);
-    ResultRetryAlgorithm algorithm =
-        retryAlgorithmManager.getForObjectsDelete(storageObject, optionsMap);
-    return run(algorithm, () -> storageRpc.delete(storageObject, optionsMap), Function.identity());
+    try {
+      return runWithRetries(
+          new Callable() {
+            @Override
+            public Boolean call() {
+              return storageRpc.delete(storageObject, optionsMap);
+            }
+          },
+          getOptions().getRetrySettings(),
+          EXCEPTION_HANDLER,
+          getOptions().getClock());
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
@@ -475,12 +597,22 @@ public Blob compose(final ComposeRequest composeRequest) {
             composeRequest.getTarget().getGeneration(),
             composeRequest.getTarget().getMetageneration(),
             composeRequest.getTargetOptions());
-    ResultRetryAlgorithm algorithm =
-        retryAlgorithmManager.getForObjectsCompose(sources, target, targetOptions);
-    return run(
-        algorithm,
-        () -> storageRpc.compose(sources, target, targetOptions),
-        (x) -> Blob.fromPb(this, x));
+    try {
+      return Blob.fromPb(
+          this,
+          runWithRetries(
+              new Callable() {
+                @Override
+                public StorageObject call() {
+                  return storageRpc.compose(sources, target, targetOptions);
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock()));
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
@@ -495,19 +627,29 @@ public CopyWriter copy(final CopyRequest copyRequest) {
             copyRequest.getTarget().getGeneration(),
             copyRequest.getTarget().getMetageneration(),
             copyRequest.getTargetOptions());
-    RewriteRequest rewriteRequest =
-        new RewriteRequest(
-            source,
-            sourceOptions,
-            copyRequest.overrideInfo(),
-            targetObject,
-            targetOptions,
-            copyRequest.getMegabytesCopiedPerChunk());
-    ResultRetryAlgorithm algorithm = retryAlgorithmManager.getForObjectsRewrite(rewriteRequest);
-    return run(
-        algorithm,
-        () -> storageRpc.openRewrite(rewriteRequest),
-        (r) -> new CopyWriter(getOptions(), r));
+    try {
+      RewriteResponse rewriteResponse =
+          runWithRetries(
+              new Callable() {
+                @Override
+                public RewriteResponse call() {
+                  return storageRpc.openRewrite(
+                      new StorageRpc.RewriteRequest(
+                          source,
+                          sourceOptions,
+                          copyRequest.overrideInfo(),
+                          targetObject,
+                          targetOptions,
+                          copyRequest.getMegabytesCopiedPerChunk()));
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock());
+      return new CopyWriter(getOptions(), rewriteResponse);
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
@@ -519,9 +661,20 @@ public byte[] readAllBytes(String bucket, String blob, BlobSourceOption... optio
   public byte[] readAllBytes(BlobId blob, BlobSourceOption... options) {
     final StorageObject storageObject = blob.toPb();
     final Map optionsMap = optionMap(blob, options);
-    ResultRetryAlgorithm algorithm =
-        retryAlgorithmManager.getForObjectsGet(storageObject, optionsMap);
-    return run(algorithm, () -> storageRpc.load(storageObject, optionsMap), Function.identity());
+    try {
+      return runWithRetries(
+          new Callable() {
+            @Override
+            public byte[] call() {
+              return storageRpc.load(storageObject, optionsMap);
+            }
+          },
+          getOptions().getRetrySettings(),
+          EXCEPTION_HANDLER,
+          getOptions().getClock());
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
@@ -549,32 +702,12 @@ public BlobWriteChannel writer(BlobInfo blobInfo, BlobWriteOption... options) {
 
   @Override
   public BlobWriteChannel writer(URL signedURL) {
-    ResultRetryAlgorithm forResumableUploadSessionCreate =
-        retryAlgorithmManager.getForResumableUploadSessionCreate(
-            Collections
-                .emptyMap()); // TODO: is it possible to know if a signed url is configured to have
-    // a constraint which makes it idempotent?
-    return BlobWriteChannel.newBuilder()
-        .setStorageOptions(getOptions())
-        .setUploadIdSupplier(
-            ResumableMedia.startUploadForSignedUrl(
-                getOptions(), signedURL, forResumableUploadSessionCreate))
-        .setAlgorithmForWrite(retryAlgorithmManager.getForResumableUploadSessionWrite(optionMap()))
-        .build();
+    return new BlobWriteChannel(getOptions(), signedURL);
   }
 
   private BlobWriteChannel writer(BlobInfo blobInfo, BlobTargetOption... options) {
     final Map optionsMap = optionMap(blobInfo, options);
-    return BlobWriteChannel.newBuilder()
-        .setStorageOptions(getOptions())
-        .setUploadIdSupplier(
-            ResumableMedia.startUploadForBlobInfo(
-                getOptions(),
-                blobInfo,
-                optionsMap,
-                retryAlgorithmManager.getForResumableUploadSessionCreate(optionsMap)))
-        .setAlgorithmForWrite(retryAlgorithmManager.getForResumableUploadSessionWrite(optionsMap))
-        .build();
+    return new BlobWriteChannel(getOptions(), blobInfo, optionsMap);
   }
 
   @Override
@@ -909,7 +1042,8 @@ private SignatureInfo buildSignatureInfo(
 
     signatureInfoBuilder.setTimestamp(getOptions().getClock().millisTime());
 
-    ImmutableMap.Builder extHeadersBuilder = new ImmutableMap.Builder<>();
+    ImmutableMap.Builder extHeadersBuilder =
+        new ImmutableMap.Builder();
 
     boolean isV4 =
         SignUrlOption.SignatureVersion.V4.equals(
@@ -931,15 +1065,16 @@ private SignatureInfo buildSignatureInfo(
           (Map) optionMap.get(SignUrlOption.Option.EXT_HEADERS));
     }
 
-    ImmutableMap.Builder queryParamsBuilder = new ImmutableMap.Builder<>();
+    ImmutableMap.Builder queryParamsBuilder =
+        new ImmutableMap.Builder();
     if (optionMap.containsKey(SignUrlOption.Option.QUERY_PARAMS)) {
       queryParamsBuilder.putAll(
           (Map) optionMap.get(SignUrlOption.Option.QUERY_PARAMS));
     }
 
     return signatureInfoBuilder
-        .setCanonicalizedExtensionHeaders(extHeadersBuilder.build())
-        .setCanonicalizedQueryParams(queryParamsBuilder.build())
+        .setCanonicalizedExtensionHeaders((Map) extHeadersBuilder.build())
+        .setCanonicalizedQueryParams((Map) queryParamsBuilder.build())
         .build();
   }
 
@@ -1052,10 +1187,23 @@ public void error(StorageException exception) {
 
   @Override
   public Acl getAcl(final String bucket, final Entity entity, BucketSourceOption... options) {
-    String pb = entity.toPb();
-    final Map optionsMap = optionMap(options);
-    ResultRetryAlgorithm algorithm = retryAlgorithmManager.getForBucketAclGet(pb, optionsMap);
-    return run(algorithm, () -> storageRpc.getAcl(bucket, pb, optionsMap), Acl::fromPb);
+    try {
+      final Map optionsMap = optionMap(options);
+      BucketAccessControl answer =
+          runWithRetries(
+              new Callable() {
+                @Override
+                public BucketAccessControl call() {
+                  return storageRpc.getAcl(bucket, entity.toPb(), optionsMap);
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock());
+      return answer == null ? null : Acl.fromPb(answer);
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
@@ -1066,10 +1214,21 @@ public Acl getAcl(final String bucket, final Entity entity) {
   @Override
   public boolean deleteAcl(
       final String bucket, final Entity entity, BucketSourceOption... options) {
-    final String pb = entity.toPb();
-    final Map optionsMap = optionMap(options);
-    ResultRetryAlgorithm algorithm = retryAlgorithmManager.getForBucketAclDelete(pb, optionsMap);
-    return run(algorithm, () -> storageRpc.deleteAcl(bucket, pb, optionsMap), Function.identity());
+    try {
+      final Map optionsMap = optionMap(options);
+      return runWithRetries(
+          new Callable() {
+            @Override
+            public Boolean call() {
+              return storageRpc.deleteAcl(bucket, entity.toPb(), optionsMap);
+            }
+          },
+          getOptions().getRetrySettings(),
+          EXCEPTION_HANDLER,
+          getOptions().getClock());
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
@@ -1080,10 +1239,22 @@ public boolean deleteAcl(final String bucket, final Entity entity) {
   @Override
   public Acl createAcl(String bucket, Acl acl, BucketSourceOption... options) {
     final BucketAccessControl aclPb = acl.toBucketPb().setBucket(bucket);
-    final Map optionsMap = optionMap(options);
-    ResultRetryAlgorithm algorithm =
-        retryAlgorithmManager.getForBucketAclCreate(aclPb, optionsMap);
-    return run(algorithm, () -> storageRpc.createAcl(aclPb, optionsMap), Acl::fromPb);
+    try {
+      final Map optionsMap = optionMap(options);
+      return Acl.fromPb(
+          runWithRetries(
+              new Callable() {
+                @Override
+                public BucketAccessControl call() {
+                  return storageRpc.createAcl(aclPb, optionsMap);
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock()));
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
@@ -1094,10 +1265,22 @@ public Acl createAcl(String bucket, Acl acl) {
   @Override
   public Acl updateAcl(String bucket, Acl acl, BucketSourceOption... options) {
     final BucketAccessControl aclPb = acl.toBucketPb().setBucket(bucket);
-    final Map optionsMap = optionMap(options);
-    ResultRetryAlgorithm algorithm =
-        retryAlgorithmManager.getForBucketAclUpdate(aclPb, optionsMap);
-    return run(algorithm, () -> storageRpc.patchAcl(aclPb, optionsMap), Acl::fromPb);
+    try {
+      final Map optionsMap = optionMap(options);
+      return Acl.fromPb(
+          runWithRetries(
+              new Callable() {
+                @Override
+                public BucketAccessControl call() {
+                  return storageRpc.patchAcl(aclPb, optionsMap);
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock()));
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
@@ -1107,16 +1290,23 @@ public Acl updateAcl(String bucket, Acl acl) {
 
   @Override
   public List listAcls(final String bucket, BucketSourceOption... options) {
-    final Map optionsMap = optionMap(options);
-    ResultRetryAlgorithm algorithm =
-        retryAlgorithmManager.getForBucketAclList(bucket, optionsMap);
-    return run(
-        algorithm,
-        () -> storageRpc.listAcls(bucket, optionsMap),
-        (answer) ->
-            answer.stream()
-                .map(Acl.FROM_BUCKET_PB_FUNCTION)
-                .collect(ImmutableList.toImmutableList()));
+    try {
+      final Map optionsMap = optionMap(options);
+      List answer =
+          runWithRetries(
+              new Callable>() {
+                @Override
+                public List call() {
+                  return storageRpc.listAcls(bucket, optionsMap);
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock());
+      return Lists.transform(answer, Acl.FROM_BUCKET_PB_FUNCTION);
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
@@ -1126,65 +1316,140 @@ public List listAcls(final String bucket) {
 
   @Override
   public Acl getDefaultAcl(final String bucket, final Entity entity) {
-    String pb = entity.toPb();
-    ResultRetryAlgorithm algorithm = retryAlgorithmManager.getForDefaultObjectAclGet(pb);
-    return run(algorithm, () -> storageRpc.getDefaultAcl(bucket, pb), Acl::fromPb);
+    try {
+      ObjectAccessControl answer =
+          runWithRetries(
+              new Callable() {
+                @Override
+                public ObjectAccessControl call() {
+                  return storageRpc.getDefaultAcl(bucket, entity.toPb());
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock());
+      return answer == null ? null : Acl.fromPb(answer);
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
   public boolean deleteDefaultAcl(final String bucket, final Entity entity) {
-    String pb = entity.toPb();
-    ResultRetryAlgorithm algorithm = retryAlgorithmManager.getForDefaultObjectAclDelete(pb);
-    return run(algorithm, () -> storageRpc.deleteDefaultAcl(bucket, pb), Function.identity());
+    try {
+      return runWithRetries(
+          new Callable() {
+            @Override
+            public Boolean call() {
+              return storageRpc.deleteDefaultAcl(bucket, entity.toPb());
+            }
+          },
+          getOptions().getRetrySettings(),
+          EXCEPTION_HANDLER,
+          getOptions().getClock());
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
   public Acl createDefaultAcl(String bucket, Acl acl) {
     final ObjectAccessControl aclPb = acl.toObjectPb().setBucket(bucket);
-    ResultRetryAlgorithm algorithm = retryAlgorithmManager.getForDefaultObjectAclCreate(aclPb);
-    return run(algorithm, () -> storageRpc.createDefaultAcl(aclPb), Acl::fromPb);
+    try {
+      return Acl.fromPb(
+          runWithRetries(
+              new Callable() {
+                @Override
+                public ObjectAccessControl call() {
+                  return storageRpc.createDefaultAcl(aclPb);
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock()));
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
   public Acl updateDefaultAcl(String bucket, Acl acl) {
     final ObjectAccessControl aclPb = acl.toObjectPb().setBucket(bucket);
-    ResultRetryAlgorithm algorithm = retryAlgorithmManager.getForDefaultObjectAclUpdate(aclPb);
-    return run(algorithm, () -> storageRpc.patchDefaultAcl(aclPb), Acl::fromPb);
+    try {
+      return Acl.fromPb(
+          runWithRetries(
+              new Callable() {
+                @Override
+                public ObjectAccessControl call() {
+                  return storageRpc.patchDefaultAcl(aclPb);
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock()));
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
   public List listDefaultAcls(final String bucket) {
-    ResultRetryAlgorithm algorithm = retryAlgorithmManager.getForDefaultObjectAclList(bucket);
-    return run(
-        algorithm,
-        () -> storageRpc.listDefaultAcls(bucket),
-        (answer) ->
-            answer.stream()
-                .map(Acl.FROM_OBJECT_PB_FUNCTION)
-                .collect(ImmutableList.toImmutableList()));
+    try {
+      List answer =
+          runWithRetries(
+              new Callable>() {
+                @Override
+                public List call() {
+                  return storageRpc.listDefaultAcls(bucket);
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock());
+      return Lists.transform(answer, Acl.FROM_OBJECT_PB_FUNCTION);
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
   public Acl getAcl(final BlobId blob, final Entity entity) {
-    String bucket = blob.getBucket();
-    String name = blob.getName();
-    Long generation = blob.getGeneration();
-    String pb = entity.toPb();
-    ResultRetryAlgorithm algorithm =
-        retryAlgorithmManager.getForObjectAclGet(bucket, name, generation, pb);
-    return run(algorithm, () -> storageRpc.getAcl(bucket, name, generation, pb), Acl::fromPb);
+    try {
+      ObjectAccessControl answer =
+          runWithRetries(
+              new Callable() {
+                @Override
+                public ObjectAccessControl call() {
+                  return storageRpc.getAcl(
+                      blob.getBucket(), blob.getName(), blob.getGeneration(), entity.toPb());
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock());
+      return answer == null ? null : Acl.fromPb(answer);
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
   public boolean deleteAcl(final BlobId blob, final Entity entity) {
-    String bucket = blob.getBucket();
-    String name = blob.getName();
-    Long generation = blob.getGeneration();
-    String pb = entity.toPb();
-    ResultRetryAlgorithm algorithm =
-        retryAlgorithmManager.getForObjectAclDelete(bucket, name, generation, pb);
-    return run(
-        algorithm, () -> storageRpc.deleteAcl(bucket, name, generation, pb), Function.identity());
+    try {
+      return runWithRetries(
+          new Callable() {
+            @Override
+            public Boolean call() {
+              return storageRpc.deleteAcl(
+                  blob.getBucket(), blob.getName(), blob.getGeneration(), entity.toPb());
+            }
+          },
+          getOptions().getRetrySettings(),
+          EXCEPTION_HANDLER,
+          getOptions().getClock());
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
@@ -1194,8 +1459,21 @@ public Acl createAcl(final BlobId blob, final Acl acl) {
             .setBucket(blob.getBucket())
             .setObject(blob.getName())
             .setGeneration(blob.getGeneration());
-    ResultRetryAlgorithm algorithm = retryAlgorithmManager.getForObjectAclCreate(aclPb);
-    return run(algorithm, () -> storageRpc.createAcl(aclPb), Acl::fromPb);
+    try {
+      return Acl.fromPb(
+          runWithRetries(
+              new Callable() {
+                @Override
+                public ObjectAccessControl call() {
+                  return storageRpc.createAcl(aclPb);
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock()));
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
@@ -1205,56 +1483,104 @@ public Acl updateAcl(BlobId blob, Acl acl) {
             .setBucket(blob.getBucket())
             .setObject(blob.getName())
             .setGeneration(blob.getGeneration());
-    ResultRetryAlgorithm algorithm = retryAlgorithmManager.getForObjectAclUpdate(aclPb);
-    return run(algorithm, () -> storageRpc.patchAcl(aclPb), Acl::fromPb);
+    try {
+      return Acl.fromPb(
+          runWithRetries(
+              new Callable() {
+                @Override
+                public ObjectAccessControl call() {
+                  return storageRpc.patchAcl(aclPb);
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock()));
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
   public List listAcls(final BlobId blob) {
-    String bucket = blob.getBucket();
-    String name = blob.getName();
-    Long generation = blob.getGeneration();
-    ResultRetryAlgorithm algorithm =
-        retryAlgorithmManager.getForObjectAclList(bucket, name, generation);
-    return run(
-        algorithm,
-        () -> storageRpc.listAcls(bucket, name, generation),
-        (answer) ->
-            answer.stream()
-                .map(Acl.FROM_OBJECT_PB_FUNCTION)
-                .collect(ImmutableList.toImmutableList()));
+    try {
+      List answer =
+          runWithRetries(
+              new Callable>() {
+                @Override
+                public List call() {
+                  return storageRpc.listAcls(
+                      blob.getBucket(), blob.getName(), blob.getGeneration());
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock());
+      return Lists.transform(answer, Acl.FROM_OBJECT_PB_FUNCTION);
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   public HmacKey createHmacKey(
       final ServiceAccount serviceAccount, final CreateHmacKeyOption... options) {
-    String pb = serviceAccount.getEmail();
-    Map optionsMap = optionMap(options);
-    ResultRetryAlgorithm algorithm = retryAlgorithmManager.getForHmacKeyCreate(pb, optionsMap);
-    return run(algorithm, () -> storageRpc.createHmacKey(pb, optionsMap), HmacKey::fromPb);
+    try {
+      return HmacKey.fromPb(
+          runWithRetries(
+              new Callable() {
+                @Override
+                public com.google.api.services.storage.model.HmacKey call() {
+                  return storageRpc.createHmacKey(serviceAccount.getEmail(), optionMap(options));
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock()));
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
   public Page listHmacKeys(ListHmacKeysOption... options) {
-    return listHmacKeys(getOptions(), retryAlgorithmManager, optionMap(options));
+    return listHmacKeys(getOptions(), optionMap(options));
   }
 
   @Override
   public HmacKeyMetadata getHmacKey(final String accessId, final GetHmacKeyOption... options) {
-    Map optionsMap = optionMap(options);
-    ResultRetryAlgorithm algorithm =
-        retryAlgorithmManager.getForHmacKeyGet(accessId, optionsMap);
-    return run(
-        algorithm,
-        () -> storageRpc.getHmacKey(accessId, optionMap(options)),
-        HmacKeyMetadata::fromPb);
+    try {
+      return HmacKeyMetadata.fromPb(
+          runWithRetries(
+              new Callable() {
+                @Override
+                public com.google.api.services.storage.model.HmacKeyMetadata call() {
+                  return storageRpc.getHmacKey(accessId, optionMap(options));
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock()));
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   private HmacKeyMetadata updateHmacKey(
       final HmacKeyMetadata hmacKeyMetadata, final UpdateHmacKeyOption... options) {
-    com.google.api.services.storage.model.HmacKeyMetadata pb = hmacKeyMetadata.toPb();
-    Map optionsMap = optionMap(options);
-    ResultRetryAlgorithm algorithm = retryAlgorithmManager.getForHmacKeyUpdate(pb, optionsMap);
-    return run(algorithm, () -> storageRpc.updateHmacKey(pb, optionsMap), HmacKeyMetadata::fromPb);
+    try {
+      return HmacKeyMetadata.fromPb(
+          runWithRetries(
+              new Callable() {
+                @Override
+                public com.google.api.services.storage.model.HmacKeyMetadata call() {
+                  return storageRpc.updateHmacKey(hmacKeyMetadata.toPb(), optionMap(options));
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock()));
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
@@ -1273,105 +1599,176 @@ public HmacKeyMetadata updateHmacKeyState(
 
   @Override
   public void deleteHmacKey(final HmacKeyMetadata metadata, final DeleteHmacKeyOption... options) {
-    com.google.api.services.storage.model.HmacKeyMetadata pb = metadata.toPb();
-    Map optionsMap = optionMap(options);
-    ResultRetryAlgorithm algorithm = retryAlgorithmManager.getForHmacKeyDelete(pb, optionsMap);
-    run(
-        algorithm,
-        (Callable)
-            () -> {
-              storageRpc.deleteHmacKey(pb, optionsMap);
+    try {
+      runWithRetries(
+          new Callable() {
+            @Override
+            public Void call() {
+              storageRpc.deleteHmacKey(metadata.toPb(), optionMap(options));
               return null;
-            },
-        Function.identity());
+            }
+          },
+          getOptions().getRetrySettings(),
+          EXCEPTION_HANDLER,
+          getOptions().getClock());
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   private static Page listHmacKeys(
-      final StorageOptions serviceOptions,
-      final RetryAlgorithmManager retryAlgorithmManager,
-      final Map options) {
-    ResultRetryAlgorithm algorithm = retryAlgorithmManager.getForHmacKeyList(options);
-    return Retrying.run(
-        serviceOptions,
-        algorithm,
-        () -> serviceOptions.getStorageRpcV1().listHmacKeys(options),
-        (result) -> {
-          String cursor = result.x();
-          final Iterable metadata =
-              result.y() == null
-                  ? ImmutableList.of()
-                  : Iterables.transform(result.y(), HmacKeyMetadata::fromPb);
-          return new PageImpl<>(
-              new HmacKeyMetadataPageFetcher(serviceOptions, retryAlgorithmManager, options),
-              cursor,
-              metadata);
-        });
+      final StorageOptions serviceOptions, final Map options) {
+    try {
+      Tuple> result =
+          runWithRetries(
+              new Callable<
+                  Tuple<
+                      String, Iterable>>() {
+                @Override
+                public Tuple<
+                        String, Iterable>
+                    call() {
+                  return serviceOptions.getStorageRpcV1().listHmacKeys(options);
+                }
+              },
+              serviceOptions.getRetrySettings(),
+              EXCEPTION_HANDLER,
+              serviceOptions.getClock());
+      String cursor = result.x();
+      final Iterable metadata =
+          result.y() == null
+              ? ImmutableList.of()
+              : Iterables.transform(
+                  result.y(),
+                  new Function<
+                      com.google.api.services.storage.model.HmacKeyMetadata, HmacKeyMetadata>() {
+                    @Override
+                    public HmacKeyMetadata apply(
+                        com.google.api.services.storage.model.HmacKeyMetadata metadataPb) {
+                      return HmacKeyMetadata.fromPb(metadataPb);
+                    }
+                  });
+      return new PageImpl<>(
+          new HmacKeyMetadataPageFetcher(serviceOptions, options), cursor, metadata);
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
   public Policy getIamPolicy(final String bucket, BucketSourceOption... options) {
-    final Map optionsMap = optionMap(options);
-    ResultRetryAlgorithm algorithm =
-        retryAlgorithmManager.getForBucketsGetIamPolicy(bucket, optionsMap);
-    return run(
-        algorithm,
-        () -> storageRpc.getIamPolicy(bucket, optionsMap),
-        PolicyHelper::convertFromApiPolicy);
+    try {
+      final Map optionsMap = optionMap(options);
+      return convertFromApiPolicy(
+          runWithRetries(
+              new Callable() {
+                @Override
+                public com.google.api.services.storage.model.Policy call() {
+                  return storageRpc.getIamPolicy(bucket, optionsMap);
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock()));
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
   public Policy setIamPolicy(
       final String bucket, final Policy policy, BucketSourceOption... options) {
-    com.google.api.services.storage.model.Policy pb = convertToApiPolicy(policy);
-    final Map optionsMap = optionMap(options);
-    ResultRetryAlgorithm algorithm =
-        retryAlgorithmManager.getForBucketsSetIamPolicy(bucket, pb, optionsMap);
-    return run(
-        algorithm,
-        () -> storageRpc.setIamPolicy(bucket, pb, optionsMap),
-        PolicyHelper::convertFromApiPolicy);
+    try {
+      final Map optionsMap = optionMap(options);
+      return convertFromApiPolicy(
+          runWithRetries(
+              new Callable() {
+                @Override
+                public com.google.api.services.storage.model.Policy call() {
+                  return storageRpc.setIamPolicy(bucket, convertToApiPolicy(policy), optionsMap);
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock()));
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
   public List testIamPermissions(
       final String bucket, final List permissions, BucketSourceOption... options) {
-    final Map optionsMap = optionMap(options);
-    ResultRetryAlgorithm algorithm =
-        retryAlgorithmManager.getForBucketsTestIamPermissions(bucket, permissions, optionsMap);
-    return run(
-        algorithm,
-        () -> storageRpc.testIamPermissions(bucket, permissions, optionsMap),
-        (response) -> {
-          final Set heldPermissions =
-              response.getPermissions() != null
-                  ? ImmutableSet.copyOf(response.getPermissions())
-                  : ImmutableSet.of();
-          return permissions.stream()
-              .map(heldPermissions::contains)
-              .collect(ImmutableList.toImmutableList());
-        });
+    try {
+      final Map optionsMap = optionMap(options);
+      TestIamPermissionsResponse response =
+          runWithRetries(
+              new Callable() {
+                @Override
+                public TestIamPermissionsResponse call() {
+                  return storageRpc.testIamPermissions(bucket, permissions, optionsMap);
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock());
+      final Set heldPermissions =
+          response.getPermissions() != null
+              ? ImmutableSet.copyOf(response.getPermissions())
+              : ImmutableSet.of();
+      return Lists.transform(
+          permissions,
+          new Function() {
+            @Override
+            public Boolean apply(String permission) {
+              return heldPermissions.contains(permission);
+            }
+          });
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
   public Bucket lockRetentionPolicy(BucketInfo bucketInfo, BucketTargetOption... options) {
     final com.google.api.services.storage.model.Bucket bucketPb = bucketInfo.toPb();
     final Map optionsMap = optionMap(bucketInfo, options);
-    ResultRetryAlgorithm algorithm =
-        retryAlgorithmManager.getForBucketsLockRetentionPolicy(bucketPb, optionsMap);
-    return run(
-        algorithm,
-        () -> storageRpc.lockRetentionPolicy(bucketPb, optionsMap),
-        (x) -> Bucket.fromPb(this, x));
+    try {
+      return Bucket.fromPb(
+          this,
+          runWithRetries(
+              new Callable() {
+                @Override
+                public com.google.api.services.storage.model.Bucket call() {
+                  return storageRpc.lockRetentionPolicy(bucketPb, optionsMap);
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock()));
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
   public ServiceAccount getServiceAccount(final String projectId) {
-    ResultRetryAlgorithm algorithm = retryAlgorithmManager.getForServiceAccountGet(projectId);
-    return run(algorithm, () -> storageRpc.getServiceAccount(projectId), ServiceAccount::fromPb);
-  }
-
-  private  U run(ResultRetryAlgorithm algorithm, Callable c, Function f) {
-    return Retrying.run(getOptions(), algorithm, c, f);
+    try {
+      com.google.api.services.storage.model.ServiceAccount answer =
+          runWithRetries(
+              new Callable() {
+                @Override
+                public com.google.api.services.storage.model.ServiceAccount call() {
+                  return storageRpc.getServiceAccount(projectId);
+                }
+              },
+              getOptions().getRetrySettings(),
+              EXCEPTION_HANDLER,
+              getOptions().getClock());
+      return answer == null ? null : ServiceAccount.fromPb(answer);
+    } catch (RetryHelperException e) {
+      throw StorageException.translateAndThrow(e);
+    }
   }
 
   @Override
diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java
index f3de842fbd..4a25e549b9 100644
--- a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java
+++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java
@@ -16,8 +16,6 @@
 
 package com.google.cloud.storage;
 
-import static java.util.Objects.requireNonNull;
-
 import com.google.cloud.NoCredentials;
 import com.google.cloud.ServiceDefaults;
 import com.google.cloud.ServiceOptions;
@@ -27,7 +25,6 @@
 import com.google.cloud.storage.spi.StorageRpcFactory;
 import com.google.cloud.storage.spi.v1.HttpStorageRpc;
 import com.google.cloud.storage.spi.v1.StorageRpc;
-import com.google.common.base.MoreObjects;
 import com.google.common.collect.ImmutableSet;
 import java.util.Set;
 
@@ -39,8 +36,6 @@ public class StorageOptions extends ServiceOptions {
   private static final Set SCOPES = ImmutableSet.of(GCS_SCOPE);
   private static final String DEFAULT_HOST = "https://storage.googleapis.com";
 
-  private final RetryAlgorithmManager retryAlgorithmManager;
-
   public static class DefaultStorageFactory implements StorageFactory {
 
     private static final StorageFactory INSTANCE = new DefaultStorageFactory();
@@ -63,8 +58,6 @@ public ServiceRpc create(StorageOptions options) {
 
   public static class Builder extends ServiceOptions.Builder {
 
-    private StorageRetryStrategy storageRetryStrategy;
-
     private Builder() {}
 
     private Builder(StorageOptions options) {
@@ -80,31 +73,14 @@ public Builder setTransportOptions(TransportOptions transportOptions) {
       return super.setTransportOptions(transportOptions);
     }
 
-    /**
-     * Override the default retry handling behavior with an alternate strategy.
-     *
-     * @param storageRetryStrategy a non-null storageRetryStrategy to use
-     * @return the builder
-     * @see StorageRetryStrategy#getDefaultStorageRetryStrategy()
-     */
-    public Builder setStorageRetryStrategy(StorageRetryStrategy storageRetryStrategy) {
-      this.storageRetryStrategy =
-          requireNonNull(storageRetryStrategy, "storageRetryStrategy must be non null");
-      return this;
-    }
-
     @Override
     public StorageOptions build() {
-      return new StorageOptions(this, new StorageDefaults());
+      return new StorageOptions(this);
     }
   }
 
-  private StorageOptions(Builder builder, StorageDefaults serviceDefaults) {
-    super(StorageFactory.class, StorageRpcFactory.class, builder, serviceDefaults);
-    this.retryAlgorithmManager =
-        new RetryAlgorithmManager(
-            MoreObjects.firstNonNull(
-                builder.storageRetryStrategy, serviceDefaults.getStorageRetryStrategy()));
+  private StorageOptions(Builder builder) {
+    super(StorageFactory.class, StorageRpcFactory.class, builder, new StorageDefaults());
   }
 
   private static class StorageDefaults implements ServiceDefaults {
@@ -123,10 +99,6 @@ public StorageRpcFactory getDefaultRpcFactory() {
     public TransportOptions getDefaultTransportOptions() {
       return getDefaultHttpTransportOptions();
     }
-
-    public StorageRetryStrategy getStorageRetryStrategy() {
-      return StorageRetryStrategy.getDefaultStorageRetryStrategy();
-    }
   }
 
   public static HttpTransportOptions getDefaultHttpTransportOptions() {
@@ -149,10 +121,6 @@ protected StorageRpc getStorageRpcV1() {
     return (StorageRpc) getRpc();
   }
 
-  RetryAlgorithmManager getRetryAlgorithmManager() {
-    return retryAlgorithmManager;
-  }
-
   /** Returns a default {@code StorageOptions} instance. */
   public static StorageOptions getDefaultInstance() {
     return newBuilder().build();
@@ -166,7 +134,7 @@ public static StorageOptions getUnauthenticatedInstance() {
   @SuppressWarnings("unchecked")
   @Override
   public Builder toBuilder() {
-    return new Builder(this);
+    return new Builder(this).setHost(DEFAULT_HOST);
   }
 
   @Override
diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageRetryStrategy.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageRetryStrategy.java
deleted file mode 100644
index 7175c5882c..0000000000
--- a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageRetryStrategy.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright 2021 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.cloud.storage;
-
-import com.google.api.gax.retrying.ResultRetryAlgorithm;
-import com.google.cloud.BaseService;
-import java.io.Serializable;
-
-/**
- * A factory class which is used to provide access to {@link ResultRetryAlgorithm} for idempotent
- * and non-idempotent calls made via {@link Storage}. Before {@link Storage} performs an operation
- * it will determine if the operation is idempotent and select the appropriate {@link
- * ResultRetryAlgorithm} to use for that invocation.
- *
- * @see #getDefaultStorageRetryStrategy()
- * @see #getUniformStorageRetryStrategy()
- */
-public interface StorageRetryStrategy extends Serializable {
-
-  /**
-   * Factory method to provide a {@link ResultRetryAlgorithm} which will be used to evaluate whether
-   * a retry can happen for an operation which has been deemed idempotent.
-   *
-   * @return
-   */
-  ResultRetryAlgorithm getIdempotentHandler();
-
-  ResultRetryAlgorithm getNonidempotentHandler();
-
-  /**
-   * Factory method to get an instance of the default implementation of {@link
-   * StorageRetryStrategy}. The returned instance is provides handler which are appropriate for
-   * calls which are known to be idempotent vs non-idempotent.
-   *
-   * 

All non-idempotent calls will not be retried - * - *

The set of retryable cases handled by this strategy is more comprehensive than that of the - * legacy strategy and should always be preferred. - * - *

The following HTTP Status Codes will be retried for all idempotent calls: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
CodeName
408Request Timeout
429Too Many Requests
500Internal Server Error
502Bad Gateway
503Service Unavailable
504Gateway Timeout
- * - * @see StorageOptions.Builder#setStorageRetryStrategy(StorageRetryStrategy) - * @see #getUniformStorageRetryStrategy() - */ - static StorageRetryStrategy getDefaultStorageRetryStrategy() { - return new DefaultStorageRetryStrategy(); - } - - /** - * Factory method to get an instance of {@link StorageRetryStrategy} which will uniformly retry - * all calls as if they were idempotent. - * - *

NOTE:This strategy is unsafe and will result in retying some non-idempotent - * calls. Care should be taken to ensure calls which would not normally be considered idempotent - * are made idempotent by some other means in your program. - * - * @see StorageOptions.Builder#setStorageRetryStrategy(StorageRetryStrategy) - * @see #getDefaultStorageRetryStrategy() - */ - static StorageRetryStrategy getUniformStorageRetryStrategy() { - return new UniformStorageRetryStrategy(getDefaultStorageRetryStrategy().getIdempotentHandler()); - } - - /** - * Factory method to get an instance of {@link StorageRetryStrategy} with the behavior which was - * used prior to version 2.1.8. This strategy is unsafe and will result in retying some - * non-idempotent calls. - * - * @deprecated please migrate to using {@link #getDefaultStorageRetryStrategy()} which is capable - * of providing handlers which are appropriate for idempotent and non-idempotent calls. - * @see StorageOptions.Builder#setStorageRetryStrategy(StorageRetryStrategy) - * @see #getDefaultStorageRetryStrategy() - */ - @Deprecated - static StorageRetryStrategy getLegacyStorageRetryStrategy() { - return new UniformStorageRetryStrategy(BaseService.EXCEPTION_HANDLER); - } -} diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/UniformStorageRetryStrategy.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/UniformStorageRetryStrategy.java deleted file mode 100644 index a2f2915b6c..0000000000 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/UniformStorageRetryStrategy.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage; - -import com.google.api.gax.retrying.ResultRetryAlgorithm; - -/** - * An implementation of {@link StorageRetryStrategy} where a single algorithm will be returned for - * both idempotent and non-idempotent cases. - */ -final class UniformStorageRetryStrategy implements StorageRetryStrategy { - - private static final long serialVersionUID = -1656941189344618393L; - private final ResultRetryAlgorithm algorithm; - - public UniformStorageRetryStrategy(ResultRetryAlgorithm algorithm) { - this.algorithm = algorithm; - } - - @Override - public ResultRetryAlgorithm getIdempotentHandler() { - return algorithm; - } - - @Override - public ResultRetryAlgorithm getNonidempotentHandler() { - return algorithm; - } -} 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 d0c1ff8a96..b9f703a5b2 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 @@ -24,7 +24,6 @@ import com.google.api.client.googleapis.batch.json.JsonBatchCallback; import com.google.api.client.googleapis.json.GoogleJsonError; import com.google.api.client.http.ByteArrayContent; -import com.google.api.client.http.EmptyContent; import com.google.api.client.http.GenericUrl; import com.google.api.client.http.HttpHeaders; import com.google.api.client.http.HttpRequest; @@ -32,7 +31,6 @@ import com.google.api.client.http.HttpRequestInitializer; import com.google.api.client.http.HttpResponse; import com.google.api.client.http.HttpResponseException; -import com.google.api.client.http.HttpStatusCodes; import com.google.api.client.http.HttpTransport; import com.google.api.client.http.InputStreamContent; import com.google.api.client.http.json.JsonHttpContent; @@ -681,6 +679,7 @@ private Get createReadRequest(StorageObject from, Map options) throws .setIfGenerationNotMatch(Option.IF_GENERATION_NOT_MATCH.getLong(options)) .setUserProject(Option.USER_PROJECT.getString(options)); setEncryptionHeaders(req.getRequestHeaders(), ENCRYPTION_KEY_PREFIX, options); + req.setReturnRawInputStream(true); return req; } @@ -691,15 +690,9 @@ public long read( Scope scope = tracer.withSpan(span); try { Get req = createReadRequest(from, options); - Boolean shouldReturnRawInputStream = Option.RETURN_RAW_INPUT_STREAM.getBoolean(options); - if (shouldReturnRawInputStream != null) { - req.setReturnRawInputStream(shouldReturnRawInputStream); - } else { - req.setReturnRawInputStream(false); - } req.getMediaHttpDownloader().setBytesDownloaded(position); req.getMediaHttpDownloader().setDirectDownloadEnabled(true); - req.executeMedia().download(outputStream); + req.executeMediaAndDownloadTo(outputStream); return req.getMediaHttpDownloader().getNumBytesDownloaded(); } catch (IOException ex) { span.setStatus(Status.UNKNOWN.withDescription(ex.getMessage())); @@ -722,12 +715,6 @@ public Tuple read( try { checkArgument(position >= 0, "Position should be non-negative, is " + position); Get req = createReadRequest(from, options); - Boolean shouldReturnRawInputStream = Option.RETURN_RAW_INPUT_STREAM.getBoolean(options); - if (shouldReturnRawInputStream != null) { - req.setReturnRawInputStream(shouldReturnRawInputStream); - } else { - req.setReturnRawInputStream(true); - } StringBuilder range = new StringBuilder(); range.append("bytes=").append(position).append("-").append(position + bytes - 1); HttpHeaders requestHeaders = req.getRequestHeaders(); @@ -764,8 +751,7 @@ public void write( public long getCurrentUploadOffset(String uploadId) { try { GenericUrl url = new GenericUrl(uploadId); - HttpRequest httpRequest = - storage.getRequestFactory().buildPutRequest(url, new EmptyContent()); + HttpRequest httpRequest = storage.getRequestFactory().buildPutRequest(url, null); httpRequest.getHeaders().setContentRange("bytes */*"); // Turn off automatic redirects. @@ -777,9 +763,9 @@ public long getCurrentUploadOffset(String uploadId) { try { response = httpRequest.execute(); int code = response.getStatusCode(); - if (HttpStatusCodes.isSuccess(code)) { - // Upload completed successfully - return -1; + String message = response.getStatusMessage(); + if (code == 201 || code == 200) { + throw new StorageException(0, "Resumable upload is already complete."); } StringBuilder sb = new StringBuilder(); sb.append("Not sure what occurred. Here's debugging information:\n"); @@ -787,18 +773,14 @@ public long getCurrentUploadOffset(String uploadId) { throw new StorageException(0, sb.toString()); } catch (HttpResponseException ex) { int code = ex.getStatusCode(); - if (code == 308) { - if (ex.getHeaders().getRange() == null) { - // No progress has been made. - return 0; - } + if (code == 308 && ex.getHeaders().getRange() == null) { + // No progress has been made. + return 0; + } else { // API returns last byte received offset String range = ex.getHeaders().getRange(); // Return next byte offset by adding 1 to last byte received offset return Long.parseLong(range.substring(range.indexOf("-") + 1)) + 1; - } else { - // Something else occurred like a 5xx so translate and throw. - throw translate(ex); } } finally { if (response != null) { @@ -810,25 +792,6 @@ public long getCurrentUploadOffset(String uploadId) { } } - @Override - public StorageObject queryCompletedResumableUpload(String uploadId, long totalBytes) { - try { - GenericUrl url = new GenericUrl(uploadId); - HttpRequest req = storage.getRequestFactory().buildPutRequest(url, new EmptyContent()); - req.getHeaders().setContentRange(String.format("bytes */%s", totalBytes)); - req.setParser(storage.getObjectParser()); - HttpResponse response = req.execute(); - // If the response is 200 - if (response.getStatusCode() == 200) { - return response.parseAs(StorageObject.class); - } else { - throw buildStorageException(response.getStatusCode(), response.getStatusMessage()); - } - } catch (IOException ex) { - throw translate(ex); - } - } - @Override public StorageObject writeWithResponse( String uploadId, @@ -894,7 +857,10 @@ public StorageObject writeWithResponse( if (exception != null) { throw exception; } - throw buildStorageException(code, message); + GoogleJsonError error = new GoogleJsonError(); + error.setCode(code); + error.setMessage(message); + throw translate(error); } } catch (IOException ex) { span.setStatus(Status.UNKNOWN.withDescription(ex.getMessage())); @@ -915,33 +881,44 @@ public String open(StorageObject object, Map options) { if (kmsKeyName != null && kmsKeyName.contains("cryptoKeyVersions")) { object.setKmsKeyName(""); } - Insert req = - storage - .objects() - .insert(object.getBucket(), object) - .setName(object.getName()) - .setProjection(Option.PROJECTION.getString(options)) - .setPredefinedAcl(Option.PREDEFINED_ACL.getString(options)) - .setIfMetagenerationMatch(Option.IF_METAGENERATION_MATCH.getLong(options)) - .setIfMetagenerationNotMatch(Option.IF_METAGENERATION_NOT_MATCH.getLong(options)) - .setIfGenerationMatch(Option.IF_GENERATION_MATCH.getLong(options)) - .setIfGenerationNotMatch(Option.IF_GENERATION_NOT_MATCH.getLong(options)) - .setUserProject(Option.USER_PROJECT.getString(options)) - .setKmsKeyName(Option.KMS_KEY_NAME.getString(options)); - GenericUrl url = req.buildHttpRequestUrl(); - url.setRawPath("/upload" + url.getRawPath()); + Insert req = storage.objects().insert(object.getBucket(), object); + GenericUrl url = req.buildHttpRequest().getUrl(); + String scheme = url.getScheme(); + String host = url.getHost(); + int port = url.getPort(); + port = port > 0 ? port : url.toURL().getDefaultPort(); + String path = "/upload" + url.getRawPath(); + url = new GenericUrl(scheme + "://" + host + ":" + port + path); url.set("uploadType", "resumable"); - + url.set("name", object.getName()); + for (Option option : options.keySet()) { + Object content = option.get(options); + if (content != null) { + url.set(option.value(), content.toString()); + } + } JsonFactory jsonFactory = storage.getJsonFactory(); HttpRequestFactory requestFactory = storage.getRequestFactory(); HttpRequest httpRequest = requestFactory.buildPostRequest(url, new JsonHttpContent(jsonFactory, object)); HttpHeaders requestHeaders = httpRequest.getHeaders(); requestHeaders.set("X-Upload-Content-Type", detectContentType(object, options)); - setEncryptionHeaders(requestHeaders, "x-goog-encryption-", options); + String key = Option.CUSTOMER_SUPPLIED_KEY.getString(options); + if (key != null) { + BaseEncoding base64 = BaseEncoding.base64(); + HashFunction hashFunction = Hashing.sha256(); + requestHeaders.set("x-goog-encryption-algorithm", "AES256"); + requestHeaders.set("x-goog-encryption-key", key); + requestHeaders.set( + "x-goog-encryption-key-sha256", + base64.encode(hashFunction.hashBytes(base64.decode(key)).asBytes())); + } HttpResponse response = httpRequest.execute(); if (response.getStatusCode() != 200) { - throw buildStorageException(response.getStatusCode(), response.getStatusMessage()); + GoogleJsonError error = new GoogleJsonError(); + error.setCode(response.getStatusCode()); + error.setMessage(response.getStatusMessage()); + throw translate(error); } return response.getHeaders().getLocation(); } catch (IOException ex) { @@ -969,13 +946,12 @@ public String open(String signedURL) { HttpHeaders requestHeaders = httpRequest.getHeaders(); requestHeaders.set("X-Upload-Content-Type", ""); requestHeaders.set("x-goog-resumable", "start"); - // Using the x-goog-api-client header causes a signature mismatch with signed URLs generated - // outside the Java storage client - requestHeaders.remove("x-goog-api-client"); - HttpResponse response = httpRequest.execute(); if (response.getStatusCode() != 201) { - throw buildStorageException(response.getStatusCode(), response.getStatusMessage()); + GoogleJsonError error = new GoogleJsonError(); + error.setCode(response.getStatusCode()); + error.setMessage(response.getStatusMessage()); + throw translate(error); } return response.getHeaders().getLocation(); } catch (IOException ex) { @@ -1654,11 +1630,4 @@ public ServiceAccount getServiceAccount(String projectId) { span.end(HttpStorageRpcSpans.END_SPAN_OPTIONS); } } - - private static StorageException buildStorageException(int statusCode, String statusMessage) { - GoogleJsonError error = new GoogleJsonError(); - error.setCode(statusCode); - error.setMessage(statusMessage); - return translate(error); - } } diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/HttpStorageRpcSpans.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/HttpStorageRpcSpans.java index 3f3d27d94c..11a33d8d02 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/HttpStorageRpcSpans.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/HttpStorageRpcSpans.java @@ -27,7 +27,7 @@ class HttpStorageRpcSpans { static final String SPAN_NAME_CREATE_OBJECT = getTraceSpanName("create(StorageObject,InputStream,Map)"); static final String SPAN_NAME_LIST_BUCKETS = getTraceSpanName("list(Map)"); - static final String SPAN_NAME_LIST_OBJECTS = getTraceSpanName("list(String,Map)"); + static final String SPAN_NAME_LIST_OBJECTS = getTraceSpanName("create(String,Map)"); static final String SPAN_NAME_GET_BUCKET = getTraceSpanName("get(Bucket,Map)"); static final String SPAN_NAME_GET_OBJECT = getTraceSpanName("get(StorageObject,Map)"); static final String SPAN_NAME_PATCH_BUCKET = getTraceSpanName("patch(Bucket,Map)"); 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 c600723bd6..2cca58a1e0 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 @@ -68,8 +68,7 @@ enum Option { SERVICE_ACCOUNT_EMAIL("serviceAccount"), SHOW_DELETED_KEYS("showDeletedKeys"), REQUESTED_POLICY_VERSION("optionsRequestedPolicyVersion"), - DETECT_CONTENT_TYPE("detectContentType"), - RETURN_RAW_INPUT_STREAM("returnRawInputStream"); + DETECT_CONTENT_TYPE("detectContentType"); private final String value; @@ -338,24 +337,6 @@ void write( */ long getCurrentUploadOffset(String uploadId); - /** - * Attempts to retrieve the StorageObject from a completed resumable upload. When a resumable - * upload completes, the response will be the up-to-date StorageObject metadata. This up-to-date - * metadata can then be used to validate the total size of the object along with new generation - * and other information. - * - *

If for any reason, the response to the final PUT to a resumable upload is not received, this - * method can be used to query for the up-to-date StorageObject. If the upload is complete, this - * method can be used to access the StorageObject independently from any other liveness or - * conditional criteria requirements that are otherwise applicable when using {@link - * #get(StorageObject, Map)}. - * - * @param uploadId resumable upload ID URL - * @param totalBytes the total number of bytes that should have been written. - * @throws StorageException if the upload is incomplete or does not exist - */ - StorageObject queryCompletedResumableUpload(String uploadId, long totalBytes); - /** * Writes the provided bytes to a storage object at the provided location. If {@code last=true} * returns metadata of the updated object, otherwise returns null. 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 81e7eee586..c82eb45069 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 @@ -144,11 +144,6 @@ public long getCurrentUploadOffset(String uploadId) { throw new UnsupportedOperationException("Not implemented yet"); } - @Override - public StorageObject queryCompletedResumableUpload(String uploadId, long totalBytes) { - throw new UnsupportedOperationException("Not implemented yet"); - } - @Override public StorageObject writeWithResponse( String uploadId, diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobIdTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobIdTest.java index d90760a43d..d503fb76aa 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobIdTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobIdTest.java @@ -31,14 +31,6 @@ public void testOf() { assertEquals("n", blobId.getName()); } - @Test - public void testToFromGsUtilUri() { - BlobId blobId = BlobId.fromGsUtilUri("gs://bucket/path/to/blob"); - assertEquals("bucket", blobId.getBucket()); - assertEquals("path/to/blob", blobId.getName()); - assertEquals("gs://bucket/path/to/blob", blobId.toGsUtilUri()); - } - @Test public void testEquals() { compareBlobIds(BLOB, BlobId.of("b", "n")); diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobTest.java index 555349752c..36752a4dc5 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobTest.java @@ -169,8 +169,6 @@ public long millisTime() { private Blob expectedBlob; private Storage serviceMockReturnsOptions = createMock(Storage.class); private StorageOptions mockOptions = createMock(StorageOptions.class); - private final RetryAlgorithmManager retryAlgorithmManager = - StorageOptions.getDefaultInstance().getRetryAlgorithmManager(); @Before public void setUp() { @@ -182,10 +180,8 @@ public void tearDown() throws Exception { verify(storage); } - private void initializeExpectedBlob() { - expect(serviceMockReturnsOptions.getOptions()).andReturn(mockOptions).anyTimes(); - expect(mockOptions.getRetryAlgorithmManager()).andReturn(retryAlgorithmManager).anyTimes(); - replay(mockOptions); + private void initializeExpectedBlob(int optionsCalls) { + expect(serviceMockReturnsOptions.getOptions()).andReturn(mockOptions).times(optionsCalls); replay(serviceMockReturnsOptions); expectedBlob = new Blob(serviceMockReturnsOptions, new BlobInfo.BuilderImpl(BLOB_INFO)); } @@ -196,9 +192,9 @@ private void initializeBlob() { @Test public void testExists_True() throws Exception { - initializeExpectedBlob(); + initializeExpectedBlob(1); Storage.BlobGetOption[] expectedOptions = {Storage.BlobGetOption.fields()}; - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + expect(storage.getOptions()).andReturn(mockOptions); expect(storage.get(expectedBlob.getBlobId(), expectedOptions)).andReturn(expectedBlob); replay(storage); initializeBlob(); @@ -208,7 +204,7 @@ public void testExists_True() throws Exception { @Test public void testExists_False() throws Exception { Storage.BlobGetOption[] expectedOptions = {Storage.BlobGetOption.fields()}; - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + expect(storage.getOptions()).andReturn(null); expect(storage.get(BLOB_INFO.getBlobId(), expectedOptions)).andReturn(null); replay(storage); initializeBlob(); @@ -217,9 +213,9 @@ public void testExists_False() throws Exception { @Test public void testContent() throws Exception { - initializeExpectedBlob(); + initializeExpectedBlob(2); byte[] content = {1, 2}; - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + expect(storage.getOptions()).andReturn(mockOptions); expect(storage.readAllBytes(BLOB_INFO.getBlobId())).andReturn(content); replay(storage); initializeBlob(); @@ -228,9 +224,9 @@ public void testContent() throws Exception { @Test public void testContentWithDecryptionKey() throws Exception { - initializeExpectedBlob(); + initializeExpectedBlob(2); byte[] content = {1, 2}; - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + expect(storage.getOptions()).andReturn(mockOptions); expect( storage.readAllBytes( BLOB_INFO.getBlobId(), Storage.BlobSourceOption.decryptionKey(BASE64_KEY))) @@ -244,9 +240,9 @@ public void testContentWithDecryptionKey() throws Exception { @Test public void testReload() throws Exception { - initializeExpectedBlob(); + initializeExpectedBlob(2); Blob expectedReloadedBlob = expectedBlob.toBuilder().setCacheControl("c").build(); - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + expect(storage.getOptions()).andReturn(mockOptions); expect(storage.get(BLOB_INFO_NO_GENERATION.getBlobId(), new Storage.BlobGetOption[0])) .andReturn(expectedReloadedBlob); replay(storage); @@ -257,8 +253,8 @@ public void testReload() throws Exception { @Test public void testReloadNull() throws Exception { - initializeExpectedBlob(); - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + initializeExpectedBlob(1); + expect(storage.getOptions()).andReturn(mockOptions); expect(storage.get(BLOB_INFO_NO_GENERATION.getBlobId(), new Storage.BlobGetOption[0])) .andReturn(null); replay(storage); @@ -269,10 +265,10 @@ public void testReloadNull() throws Exception { @Test public void testReloadWithOptions() throws Exception { - initializeExpectedBlob(); + initializeExpectedBlob(2); Blob expectedReloadedBlob = expectedBlob.toBuilder().setCacheControl("c").build(); Storage.BlobGetOption[] options = {Storage.BlobGetOption.metagenerationMatch(42L)}; - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + expect(storage.getOptions()).andReturn(mockOptions); expect(storage.get(BLOB_INFO_NO_GENERATION.getBlobId(), options)) .andReturn(expectedReloadedBlob); replay(storage); @@ -283,9 +279,9 @@ public void testReloadWithOptions() throws Exception { @Test public void testUpdate() throws Exception { - initializeExpectedBlob(); + initializeExpectedBlob(2); Blob expectedUpdatedBlob = expectedBlob.toBuilder().setCacheControl("c").build(); - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + expect(storage.getOptions()).andReturn(mockOptions).times(2); expect(storage.update(eq(expectedUpdatedBlob), new Storage.BlobTargetOption[0])) .andReturn(expectedUpdatedBlob); replay(storage); @@ -297,8 +293,8 @@ public void testUpdate() throws Exception { @Test public void testDelete() throws Exception { - initializeExpectedBlob(); - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + initializeExpectedBlob(2); + expect(storage.getOptions()).andReturn(mockOptions); expect(storage.delete(BLOB_INFO.getBlobId(), new Storage.BlobSourceOption[0])).andReturn(true); replay(storage); initializeBlob(); @@ -307,11 +303,11 @@ public void testDelete() throws Exception { @Test public void testCopyToBucket() throws Exception { - initializeExpectedBlob(); + initializeExpectedBlob(2); BlobInfo target = BlobInfo.newBuilder(BlobId.of("bt", "n")).build(); CopyWriter copyWriter = createMock(CopyWriter.class); Capture capturedCopyRequest = Capture.newInstance(); - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + expect(storage.getOptions()).andReturn(mockOptions); expect(storage.copy(capture(capturedCopyRequest))).andReturn(copyWriter); replay(storage); initializeBlob(); @@ -326,11 +322,11 @@ public void testCopyToBucket() throws Exception { @Test public void testCopyTo() throws Exception { - initializeExpectedBlob(); + initializeExpectedBlob(2); BlobInfo target = BlobInfo.newBuilder(BlobId.of("bt", "nt")).build(); CopyWriter copyWriter = createMock(CopyWriter.class); Capture capturedCopyRequest = Capture.newInstance(); - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + expect(storage.getOptions()).andReturn(mockOptions); expect(storage.copy(capture(capturedCopyRequest))).andReturn(copyWriter); replay(storage); initializeBlob(); @@ -345,12 +341,12 @@ public void testCopyTo() throws Exception { @Test public void testCopyToBlobId() throws Exception { - initializeExpectedBlob(); + initializeExpectedBlob(2); BlobInfo target = BlobInfo.newBuilder(BlobId.of("bt", "nt")).build(); BlobId targetId = BlobId.of("bt", "nt"); CopyWriter copyWriter = createMock(CopyWriter.class); Capture capturedCopyRequest = Capture.newInstance(); - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + expect(storage.getOptions()).andReturn(mockOptions); expect(storage.copy(capture(capturedCopyRequest))).andReturn(copyWriter); replay(storage); initializeBlob(); @@ -365,9 +361,9 @@ public void testCopyToBlobId() throws Exception { @Test public void testReader() throws Exception { - initializeExpectedBlob(); + initializeExpectedBlob(2); ReadChannel channel = createMock(ReadChannel.class); - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + expect(storage.getOptions()).andReturn(mockOptions); expect(storage.reader(BLOB_INFO.getBlobId())).andReturn(channel); replay(storage); initializeBlob(); @@ -376,9 +372,9 @@ public void testReader() throws Exception { @Test public void testReaderWithDecryptionKey() throws Exception { - initializeExpectedBlob(); + initializeExpectedBlob(2); ReadChannel channel = createMock(ReadChannel.class); - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + expect(storage.getOptions()).andReturn(mockOptions); expect( storage.reader( BLOB_INFO.getBlobId(), Storage.BlobSourceOption.decryptionKey(BASE64_KEY))) @@ -392,9 +388,9 @@ public void testReaderWithDecryptionKey() throws Exception { @Test public void testWriter() throws Exception { - initializeExpectedBlob(); + initializeExpectedBlob(2); BlobWriteChannel channel = createMock(BlobWriteChannel.class); - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + expect(storage.getOptions()).andReturn(mockOptions); expect(storage.writer(eq(expectedBlob))).andReturn(channel); replay(storage); initializeBlob(); @@ -403,9 +399,9 @@ public void testWriter() throws Exception { @Test public void testWriterWithEncryptionKey() throws Exception { - initializeExpectedBlob(); + initializeExpectedBlob(2); BlobWriteChannel channel = createMock(BlobWriteChannel.class); - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + expect(storage.getOptions()).andReturn(mockOptions); expect(storage.writer(eq(expectedBlob), eq(BlobWriteOption.encryptionKey(BASE64_KEY)))) .andReturn(channel) .times(2); @@ -417,9 +413,9 @@ public void testWriterWithEncryptionKey() throws Exception { @Test public void testWriterWithKmsKeyName() throws Exception { - initializeExpectedBlob(); + initializeExpectedBlob(2); BlobWriteChannel channel = createMock(BlobWriteChannel.class); - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + expect(storage.getOptions()).andReturn(mockOptions); expect(storage.writer(eq(expectedBlob), eq(BlobWriteOption.kmsKeyName(KMS_KEY_NAME)))) .andReturn(channel); replay(storage); @@ -429,9 +425,9 @@ public void testWriterWithKmsKeyName() throws Exception { @Test public void testSignUrl() throws Exception { - initializeExpectedBlob(); + initializeExpectedBlob(2); URL url = new URL("http://localhost:123/bla"); - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + expect(storage.getOptions()).andReturn(mockOptions); expect(storage.signUrl(expectedBlob, 100, TimeUnit.SECONDS)).andReturn(url); replay(storage); initializeBlob(); @@ -440,8 +436,8 @@ public void testSignUrl() throws Exception { @Test public void testGetAcl() throws Exception { - initializeExpectedBlob(); - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + initializeExpectedBlob(1); + expect(storage.getOptions()).andReturn(mockOptions); expect(storage.getAcl(BLOB_INFO.getBlobId(), User.ofAllAuthenticatedUsers())).andReturn(ACL); replay(storage); initializeBlob(); @@ -450,8 +446,8 @@ public void testGetAcl() throws Exception { @Test public void testDeleteAcl() throws Exception { - initializeExpectedBlob(); - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + initializeExpectedBlob(1); + expect(storage.getOptions()).andReturn(mockOptions); expect(storage.deleteAcl(BLOB_INFO.getBlobId(), User.ofAllAuthenticatedUsers())) .andReturn(true); replay(storage); @@ -461,8 +457,8 @@ public void testDeleteAcl() throws Exception { @Test public void testCreateAcl() throws Exception { - initializeExpectedBlob(); - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + initializeExpectedBlob(1); + expect(storage.getOptions()).andReturn(mockOptions); Acl returnedAcl = ACL.toBuilder().setEtag("ETAG").setId("ID").build(); expect(storage.createAcl(BLOB_INFO.getBlobId(), ACL)).andReturn(returnedAcl); replay(storage); @@ -472,8 +468,8 @@ public void testCreateAcl() throws Exception { @Test public void testUpdateAcl() throws Exception { - initializeExpectedBlob(); - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + initializeExpectedBlob(1); + expect(storage.getOptions()).andReturn(mockOptions); Acl returnedAcl = ACL.toBuilder().setEtag("ETAG").setId("ID").build(); expect(storage.updateAcl(BLOB_INFO.getBlobId(), ACL)).andReturn(returnedAcl); replay(storage); @@ -483,8 +479,8 @@ public void testUpdateAcl() throws Exception { @Test public void testListAcls() throws Exception { - initializeExpectedBlob(); - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + initializeExpectedBlob(1); + expect(storage.getOptions()).andReturn(mockOptions); expect(storage.listAcls(BLOB_INFO.getBlobId())).andReturn(ACLS); replay(storage); initializeBlob(); @@ -493,10 +489,8 @@ public void testListAcls() throws Exception { @Test public void testToBuilder() { - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); - expect(mockOptions.getRetryAlgorithmManager()).andReturn(retryAlgorithmManager).anyTimes(); + expect(storage.getOptions()).andReturn(mockOptions).times(6); replay(storage); - replay(mockOptions); Blob fullBlob = new Blob(storage, new BlobInfo.BuilderImpl(FULL_BLOB_INFO)); assertEquals(fullBlob, fullBlob.toBuilder().build()); Blob simpleBlob = new Blob(storage, new BlobInfo.BuilderImpl(BLOB_INFO)); @@ -507,8 +501,8 @@ public void testToBuilder() { @Test public void testBuilder() { - initializeExpectedBlob(); - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + initializeExpectedBlob(4); + expect(storage.getOptions()).andReturn(mockOptions).times(6); replay(storage); Blob.Builder builder = new Blob.Builder(new Blob(storage, new BlobInfo.BuilderImpl(BLOB_INFO))); Blob blob = @@ -615,12 +609,11 @@ public void testBuilder() { private StorageRpc prepareForDownload() { StorageRpc mockStorageRpc = createNiceMock(StorageRpc.class); - expect(storage.getOptions()).andReturn(mockOptions).anyTimes(); + expect(storage.getOptions()).andReturn(mockOptions); replay(storage); expect(mockOptions.getStorageRpcV1()).andReturn(mockStorageRpc); expect(mockOptions.getRetrySettings()).andReturn(RETRY_SETTINGS); expect(mockOptions.getClock()).andReturn(API_CLOCK); - expect(mockOptions.getRetryAlgorithmManager()).andReturn(retryAlgorithmManager).anyTimes(); replay(mockOptions); blob = new Blob(storage, new BlobInfo.BuilderImpl(BLOB_INFO)); return mockStorageRpc; diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobWriteChannelTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobWriteChannelTest.java index 000a925c02..b6d7bbf3a3 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobWriteChannelTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobWriteChannelTest.java @@ -34,22 +34,18 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import com.google.api.gax.retrying.ResultRetryAlgorithm; import com.google.api.services.storage.model.StorageObject; -import com.google.cloud.NoCredentials; import com.google.cloud.RestorableState; import com.google.cloud.WriteChannel; import com.google.cloud.storage.spi.StorageRpcFactory; import com.google.cloud.storage.spi.v1.StorageRpc; import com.google.common.collect.ImmutableMap; import java.io.IOException; -import java.math.BigInteger; import java.net.MalformedURLException; import java.net.SocketException; import java.net.URL; import java.nio.ByteBuffer; import java.util.Arrays; -import java.util.Collections; import java.util.Map; import java.util.Random; import org.easymock.Capture; @@ -65,25 +61,19 @@ public class BlobWriteChannelTest { private static final String BLOB_NAME = "n"; private static final String UPLOAD_ID = "uploadid"; private static final BlobInfo BLOB_INFO = BlobInfo.newBuilder(BUCKET_NAME, BLOB_NAME).build(); - private static final BlobInfo BLOB_INFO_WITH_GENERATION = - BlobInfo.newBuilder(BUCKET_NAME, BLOB_NAME, 1L).build(); private static final StorageObject UPDATED_BLOB = new StorageObject(); private static final Map EMPTY_RPC_OPTIONS = ImmutableMap.of(); - private static final Map RPC_OPTIONS_GENERATION = - ImmutableMap.of(StorageRpc.Option.IF_GENERATION_MATCH, 1L); private static final int MIN_CHUNK_SIZE = 256 * 1024; private static final int DEFAULT_CHUNK_SIZE = 60 * MIN_CHUNK_SIZE; // 15MiB private static final int CUSTOM_CHUNK_SIZE = 4 * MIN_CHUNK_SIZE; private static final Random RANDOM = new Random(); private static final String SIGNED_URL = "http://www.test.com/test-bucket/test1.txt?GoogleAccessId=testClient-test@test.com&Expires=1553839761&Signature=MJUBXAZ7"; - private static final StorageException socketClosedException = - new StorageException(new SocketException("Socket closed")); + private StorageOptions options; private StorageRpcFactory rpcFactoryMock; private StorageRpc storageRpcMock; private BlobWriteChannel writer; - private RetryAlgorithmManager retryAlgorithmManager; @Before public void setUp() { @@ -95,9 +85,7 @@ public void setUp() { StorageOptions.newBuilder() .setProjectId("projectid") .setServiceRpcFactory(rpcFactoryMock) - .setCredentials(NoCredentials.getInstance()) .build(); - retryAlgorithmManager = options.getRetryAlgorithmManager(); } @After @@ -109,19 +97,18 @@ public void tearDown() throws Exception { public void testCreate() { expect(storageRpcMock.open(BLOB_INFO.toPb(), EMPTY_RPC_OPTIONS)).andReturn(UPLOAD_ID); replay(storageRpcMock); - writer = newWriter(); + writer = new BlobWriteChannel(options, BLOB_INFO, EMPTY_RPC_OPTIONS); assertTrue(writer.isOpen()); assertNull(writer.getStorageObject()); } @Test public void testCreateRetryableError() { - expect(storageRpcMock.open(BLOB_INFO_WITH_GENERATION.toPb(), RPC_OPTIONS_GENERATION)) - .andThrow(socketClosedException); - expect(storageRpcMock.open(BLOB_INFO_WITH_GENERATION.toPb(), RPC_OPTIONS_GENERATION)) - .andReturn(UPLOAD_ID); + StorageException exception = new StorageException(new SocketException("Socket closed")); + expect(storageRpcMock.open(BLOB_INFO.toPb(), EMPTY_RPC_OPTIONS)).andThrow(exception); + expect(storageRpcMock.open(BLOB_INFO.toPb(), EMPTY_RPC_OPTIONS)).andReturn(UPLOAD_ID); replay(storageRpcMock); - writer = newWriter(true); + writer = new BlobWriteChannel(options, BLOB_INFO, EMPTY_RPC_OPTIONS); assertTrue(writer.isOpen()); assertNull(writer.getStorageObject()); } @@ -132,7 +119,7 @@ public void testCreateNonRetryableError() { .andThrow(new RuntimeException()); replay(storageRpcMock); try { - newWriter(); + new BlobWriteChannel(options, BLOB_INFO, EMPTY_RPC_OPTIONS); Assert.fail(); } catch (RuntimeException ex) { assertNotNull(ex.getMessage()); @@ -140,19 +127,19 @@ public void testCreateNonRetryableError() { } @Test - public void testWriteWithoutFlush() throws Exception { + public void testWriteWithoutFlush() throws IOException { expect(storageRpcMock.open(BLOB_INFO.toPb(), EMPTY_RPC_OPTIONS)).andReturn(UPLOAD_ID); replay(storageRpcMock); - writer = newWriter(); + writer = new BlobWriteChannel(options, BLOB_INFO, EMPTY_RPC_OPTIONS); assertEquals(MIN_CHUNK_SIZE, writer.write(ByteBuffer.allocate(MIN_CHUNK_SIZE))); } @Test - public void testWriteWithFlushRetryChunk() throws Exception { + public void testWriteWithFlushRetryChunk() throws IOException { + StorageException exception = new StorageException(new SocketException("Socket closed")); ByteBuffer buffer = randomBuffer(MIN_CHUNK_SIZE); Capture capturedBuffer = Capture.newInstance(); - expect(storageRpcMock.open(BLOB_INFO_WITH_GENERATION.toPb(), RPC_OPTIONS_GENERATION)) - .andReturn(UPLOAD_ID); + expect(storageRpcMock.open(BLOB_INFO.toPb(), EMPTY_RPC_OPTIONS)).andReturn(UPLOAD_ID); expect( storageRpcMock.writeWithResponse( eq(UPLOAD_ID), @@ -161,7 +148,7 @@ public void testWriteWithFlushRetryChunk() throws Exception { eq(0L), eq(MIN_CHUNK_SIZE), eq(false))) - .andThrow(socketClosedException); + .andThrow(exception); expect(storageRpcMock.getCurrentUploadOffset(eq(UPLOAD_ID))).andReturn(0L); expect( storageRpcMock.writeWithResponse( @@ -173,7 +160,7 @@ public void testWriteWithFlushRetryChunk() throws Exception { eq(false))) .andReturn(null); replay(storageRpcMock); - writer = newWriter(true); + writer = new BlobWriteChannel(options, BLOB_INFO, EMPTY_RPC_OPTIONS); writer.setChunkSize(MIN_CHUNK_SIZE); assertEquals(MIN_CHUNK_SIZE, writer.write(buffer)); assertTrue(writer.isOpen()); @@ -182,50 +169,11 @@ public void testWriteWithFlushRetryChunk() throws Exception { } @Test - public void testWriteWithRetryFullChunk() throws Exception { + public void testWriteWithFlushRetryChunkWithDrift() throws IOException { + StorageException exception = new StorageException(new SocketException("Socket closed")); ByteBuffer buffer = randomBuffer(MIN_CHUNK_SIZE); Capture capturedBuffer = Capture.newInstance(); - expect(storageRpcMock.open(BLOB_INFO_WITH_GENERATION.toPb(), RPC_OPTIONS_GENERATION)) - .andReturn(UPLOAD_ID); - expect( - storageRpcMock.writeWithResponse( - eq(UPLOAD_ID), (byte[]) anyObject(), eq(0), eq(0L), eq(MIN_CHUNK_SIZE), eq(false))) - .andThrow(socketClosedException); - expect(storageRpcMock.getCurrentUploadOffset(eq(UPLOAD_ID))).andReturn(0L); - expect( - storageRpcMock.writeWithResponse( - eq(UPLOAD_ID), - capture(capturedBuffer), - eq(0), - eq(0L), - eq(MIN_CHUNK_SIZE), - eq(false))) - .andReturn(null); - expect( - storageRpcMock.writeWithResponse( - eq(UPLOAD_ID), - (byte[]) anyObject(), - eq(0), - eq((long) MIN_CHUNK_SIZE), - eq(0), - eq(true))) - .andReturn(BLOB_INFO.toPb()); - replay(storageRpcMock); - writer = newWriter(true); - writer.setChunkSize(MIN_CHUNK_SIZE); - assertEquals(MIN_CHUNK_SIZE, writer.write(buffer)); - writer.close(); - assertFalse(writer.isOpen()); - assertNotNull(writer.getStorageObject()); - assertArrayEquals(buffer.array(), capturedBuffer.getValue()); - } - - @Test - public void testWriteWithRemoteProgressMade() throws Exception { - ByteBuffer buffer = randomBuffer(MIN_CHUNK_SIZE); - Capture capturedBuffer = Capture.newInstance(); - expect(storageRpcMock.open(BLOB_INFO_WITH_GENERATION.toPb(), RPC_OPTIONS_GENERATION)) - .andReturn(UPLOAD_ID); + expect(storageRpcMock.open(BLOB_INFO.toPb(), EMPTY_RPC_OPTIONS)).andReturn(UPLOAD_ID); expect( storageRpcMock.writeWithResponse( eq(UPLOAD_ID), @@ -234,8 +182,7 @@ public void testWriteWithRemoteProgressMade() throws Exception { eq(0L), eq(MIN_CHUNK_SIZE), eq(false))) - .andThrow(socketClosedException); - // Simulate GCS received 10 bytes but not the rest of the chunk + .andThrow(exception); expect(storageRpcMock.getCurrentUploadOffset(eq(UPLOAD_ID))).andReturn(10L); expect( storageRpcMock.writeWithResponse( @@ -247,282 +194,16 @@ public void testWriteWithRemoteProgressMade() throws Exception { eq(false))) .andReturn(null); replay(storageRpcMock); - writer = newWriter(true); - writer.setChunkSize(MIN_CHUNK_SIZE); - assertEquals(MIN_CHUNK_SIZE, writer.write(buffer)); - assertTrue(writer.isOpen()); - assertNull(writer.getStorageObject()); - assertArrayEquals(buffer.array(), capturedBuffer.getValue()); - } - - @Test - public void testWriteWithDriftRetryCase4() throws Exception { - ByteBuffer buffer = randomBuffer(MIN_CHUNK_SIZE); - Capture capturedBuffer = Capture.newInstance(); - expect(storageRpcMock.open(BLOB_INFO_WITH_GENERATION.toPb(), RPC_OPTIONS_GENERATION)) - .andReturn(UPLOAD_ID); - expect( - storageRpcMock.writeWithResponse( - eq(UPLOAD_ID), - capture(capturedBuffer), - eq(0), - eq(0L), - eq(MIN_CHUNK_SIZE), - eq(false))) - .andThrow(socketClosedException); - expect(storageRpcMock.getCurrentUploadOffset(eq(UPLOAD_ID))).andReturn((long) MIN_CHUNK_SIZE); - expect( - storageRpcMock.writeWithResponse( - eq(UPLOAD_ID), - capture(capturedBuffer), - eq(0), - eq((long) MIN_CHUNK_SIZE), - eq(MIN_CHUNK_SIZE), - eq(false))) - .andReturn(null); - replay(storageRpcMock); - writer = newWriter(true); + writer = new BlobWriteChannel(options, BLOB_INFO, EMPTY_RPC_OPTIONS); writer.setChunkSize(MIN_CHUNK_SIZE); assertEquals(MIN_CHUNK_SIZE, writer.write(buffer)); - assertArrayEquals(buffer.array(), capturedBuffer.getValue()); - capturedBuffer.reset(); - buffer.rewind(); - assertEquals(MIN_CHUNK_SIZE, writer.write(buffer)); - assertArrayEquals(buffer.array(), capturedBuffer.getValue()); - assertTrue(writer.isOpen()); - assertNull(writer.getStorageObject()); - } - - @Test - public void testWriteWithUnreachableRemoteOffset() throws Exception { - ByteBuffer buffer = randomBuffer(MIN_CHUNK_SIZE); - Capture capturedBuffer = Capture.newInstance(); - expect(storageRpcMock.open(BLOB_INFO_WITH_GENERATION.toPb(), RPC_OPTIONS_GENERATION)) - .andReturn(UPLOAD_ID); - expect( - storageRpcMock.writeWithResponse( - eq(UPLOAD_ID), - capture(capturedBuffer), - eq(0), - eq(0L), - eq(MIN_CHUNK_SIZE), - eq(false))) - .andThrow(socketClosedException); - expect(storageRpcMock.getCurrentUploadOffset(eq(UPLOAD_ID))).andReturn(MIN_CHUNK_SIZE + 10L); - replay(storageRpcMock); - writer = newWriter(true); - writer.setChunkSize(MIN_CHUNK_SIZE); - try { - writer.write(buffer); - fail("Expected StorageException"); - } catch (StorageException storageException) { - // expected storageException - } assertTrue(writer.isOpen()); assertNull(writer.getStorageObject()); assertArrayEquals(buffer.array(), capturedBuffer.getValue()); } @Test - public void testWriteWithRetryAndObjectMetadata() throws Exception { - ByteBuffer buffer = randomBuffer(MIN_CHUNK_SIZE); - Capture capturedBuffer = Capture.newInstance(); - expect(storageRpcMock.open(BLOB_INFO_WITH_GENERATION.toPb(), RPC_OPTIONS_GENERATION)) - .andReturn(UPLOAD_ID); - expect( - storageRpcMock.writeWithResponse( - eq(UPLOAD_ID), - capture(capturedBuffer), - eq(0), - eq(0L), - eq(MIN_CHUNK_SIZE), - eq(false))) - .andThrow(socketClosedException); - expect(storageRpcMock.getCurrentUploadOffset(eq(UPLOAD_ID))).andReturn(10L); - expect( - storageRpcMock.writeWithResponse( - eq(UPLOAD_ID), - capture(capturedBuffer), - eq(10), - eq(10L), - eq(MIN_CHUNK_SIZE - 10), - eq(false))) - .andThrow(socketClosedException); - expect(storageRpcMock.getCurrentUploadOffset(eq(UPLOAD_ID))).andReturn(-1L); - expect(storageRpcMock.getCurrentUploadOffset(eq(UPLOAD_ID))).andReturn(-1L); - expect(storageRpcMock.queryCompletedResumableUpload(eq(UPLOAD_ID), eq((long) MIN_CHUNK_SIZE))) - .andThrow(socketClosedException); - expect(storageRpcMock.getCurrentUploadOffset(eq(UPLOAD_ID))).andReturn(-1L); - expect(storageRpcMock.queryCompletedResumableUpload(eq(UPLOAD_ID), eq((long) MIN_CHUNK_SIZE))) - .andReturn(BLOB_INFO.toPb().setSize(BigInteger.valueOf(MIN_CHUNK_SIZE))); - replay(storageRpcMock); - writer = newWriter(true); - writer.setChunkSize(MIN_CHUNK_SIZE); - assertEquals(MIN_CHUNK_SIZE, writer.write(buffer)); - writer.close(); - assertFalse(writer.isOpen()); - assertNotNull(writer.getStorageObject()); - assertArrayEquals(buffer.array(), capturedBuffer.getValue()); - } - - @Test - public void testWriteWithUploadCompletedByAnotherClient() throws Exception { - ByteBuffer buffer = randomBuffer(MIN_CHUNK_SIZE); - Capture capturedBuffer = Capture.newInstance(); - expect(storageRpcMock.open(BLOB_INFO_WITH_GENERATION.toPb(), RPC_OPTIONS_GENERATION)) - .andReturn(UPLOAD_ID); - expect( - storageRpcMock.writeWithResponse( - eq(UPLOAD_ID), - capture(capturedBuffer), - eq(0), - eq(0L), - eq(MIN_CHUNK_SIZE), - eq(false))) - .andReturn(null); - expect( - storageRpcMock.writeWithResponse( - eq(UPLOAD_ID), - capture(capturedBuffer), - eq(0), - eq((long) MIN_CHUNK_SIZE), - eq(MIN_CHUNK_SIZE), - eq(false))) - .andThrow(socketClosedException); - expect(storageRpcMock.getCurrentUploadOffset(eq(UPLOAD_ID))).andReturn(-1L); - expect(storageRpcMock.getCurrentUploadOffset(eq(UPLOAD_ID))).andReturn(-1L); - replay(storageRpcMock); - writer = newWriter(true); - writer.setChunkSize(MIN_CHUNK_SIZE); - try { - writer.write(buffer); - buffer.rewind(); - writer.write(buffer); - buffer.rewind(); - writer.write(buffer); - fail("Expected completed exception."); - } catch (StorageException ex) { - - } - assertTrue(writer.isOpen()); - } - - @Test - public void testWriteWithLocalOffsetGoingBeyondRemoteOffset() throws Exception { - ByteBuffer buffer = randomBuffer(MIN_CHUNK_SIZE); - Capture capturedBuffer = Capture.newInstance(); - expect(storageRpcMock.open(BLOB_INFO_WITH_GENERATION.toPb(), RPC_OPTIONS_GENERATION)) - .andReturn(UPLOAD_ID); - expect( - storageRpcMock.writeWithResponse( - eq(UPLOAD_ID), - capture(capturedBuffer), - eq(0), - eq(0L), - eq(MIN_CHUNK_SIZE), - eq(false))) - .andReturn(null); - expect( - storageRpcMock.writeWithResponse( - eq(UPLOAD_ID), - capture(capturedBuffer), - eq(0), - eq((long) MIN_CHUNK_SIZE), - eq(MIN_CHUNK_SIZE), - eq(false))) - .andThrow(socketClosedException); - expect(storageRpcMock.getCurrentUploadOffset(eq(UPLOAD_ID))).andReturn(0L); - replay(storageRpcMock); - writer = newWriter(true); - writer.setChunkSize(MIN_CHUNK_SIZE); - try { - writer.write(buffer); - buffer.rewind(); - writer.write(buffer); - writer.close(); - fail("Expected completed exception."); - } catch (StorageException ex) { - } - assertTrue(writer.isOpen()); - } - - @Test - public void testGetCurrentUploadOffset() throws Exception { - ByteBuffer buffer = randomBuffer(MIN_CHUNK_SIZE); - Capture capturedBuffer = Capture.newInstance(); - expect(storageRpcMock.open(BLOB_INFO_WITH_GENERATION.toPb(), RPC_OPTIONS_GENERATION)) - .andReturn(UPLOAD_ID); - expect( - storageRpcMock.writeWithResponse( - eq(UPLOAD_ID), - capture(capturedBuffer), - eq(0), - eq(0L), - eq(MIN_CHUNK_SIZE), - eq(false))) - .andThrow(socketClosedException); - expect(storageRpcMock.getCurrentUploadOffset(eq(UPLOAD_ID))).andThrow(socketClosedException); - expect(storageRpcMock.getCurrentUploadOffset(eq(UPLOAD_ID))).andReturn(0L); - expect( - storageRpcMock.writeWithResponse( - eq(UPLOAD_ID), - capture(capturedBuffer), - eq(0), - eq(0L), - eq(MIN_CHUNK_SIZE), - eq(false))) - .andReturn(null); - expect( - storageRpcMock.writeWithResponse( - eq(UPLOAD_ID), - (byte[]) anyObject(), - eq(0), - eq((long) MIN_CHUNK_SIZE), - eq(0), - eq(true))) - .andReturn(BLOB_INFO.toPb()); - replay(storageRpcMock); - writer = newWriter(true); - writer.setChunkSize(MIN_CHUNK_SIZE); - assertEquals(MIN_CHUNK_SIZE, writer.write(buffer)); - writer.close(); - assertFalse(writer.isOpen()); - assertNotNull(writer.getStorageObject()); - assertArrayEquals(buffer.array(), capturedBuffer.getValue()); - } - - @Test - public void testWriteWithLastFlushRetryChunkButCompleted() throws Exception { - ByteBuffer buffer = randomBuffer(MIN_CHUNK_SIZE); - Capture capturedBuffer = Capture.newInstance(); - expect(storageRpcMock.open(BLOB_INFO_WITH_GENERATION.toPb(), RPC_OPTIONS_GENERATION)) - .andReturn(UPLOAD_ID); - expect( - storageRpcMock.writeWithResponse( - eq(UPLOAD_ID), - capture(capturedBuffer), - eq(0), - eq(0L), - eq(MIN_CHUNK_SIZE), - eq(true))) - .andThrow(socketClosedException); - expect(storageRpcMock.getCurrentUploadOffset(eq(UPLOAD_ID))).andReturn(-1L); - expect(storageRpcMock.queryCompletedResumableUpload(eq(UPLOAD_ID), eq((long) MIN_CHUNK_SIZE))) - .andReturn(BLOB_INFO.toPb().setSize(BigInteger.valueOf(MIN_CHUNK_SIZE))); - replay(storageRpcMock); - writer = newWriter(true); - assertEquals(MIN_CHUNK_SIZE, writer.write(buffer)); - writer.close(); - assertFalse(writer.isRetrying()); - assertFalse(writer.isOpen()); - assertNotNull(writer.getStorageObject()); - // Capture captures entire buffer of a chunk even when not completely used. - // Making assert selective up to the size of MIN_CHUNK_SIZE - assertArrayEquals(Arrays.copyOf(capturedBuffer.getValue(), MIN_CHUNK_SIZE), buffer.array()); - } - - @Test - public void testWriteWithFlush() throws Exception { + public void testWriteWithFlush() throws IOException { expect(storageRpcMock.open(BLOB_INFO.toPb(), EMPTY_RPC_OPTIONS)).andReturn(UPLOAD_ID); Capture capturedBuffer = Capture.newInstance(); expect( @@ -535,7 +216,7 @@ public void testWriteWithFlush() throws Exception { eq(false))) .andReturn(null); replay(storageRpcMock); - writer = newWriter(); + writer = new BlobWriteChannel(options, BLOB_INFO, EMPTY_RPC_OPTIONS); writer.setChunkSize(CUSTOM_CHUNK_SIZE); ByteBuffer buffer = randomBuffer(CUSTOM_CHUNK_SIZE); assertEquals(CUSTOM_CHUNK_SIZE, writer.write(buffer)); @@ -544,7 +225,7 @@ public void testWriteWithFlush() throws Exception { } @Test - public void testWritesAndFlush() throws Exception { + public void testWritesAndFlush() throws IOException { expect(storageRpcMock.open(BLOB_INFO.toPb(), EMPTY_RPC_OPTIONS)).andReturn(UPLOAD_ID); Capture capturedBuffer = Capture.newInstance(); expect( @@ -557,7 +238,7 @@ public void testWritesAndFlush() throws Exception { eq(false))) .andReturn(null); replay(storageRpcMock); - writer = newWriter(); + writer = new BlobWriteChannel(options, BLOB_INFO, EMPTY_RPC_OPTIONS); ByteBuffer[] buffers = new ByteBuffer[DEFAULT_CHUNK_SIZE / MIN_CHUNK_SIZE]; for (int i = 0; i < buffers.length; i++) { buffers[i] = randomBuffer(MIN_CHUNK_SIZE); @@ -573,7 +254,7 @@ public void testWritesAndFlush() throws Exception { } @Test - public void testCloseWithoutFlush() throws Exception { + public void testCloseWithoutFlush() throws IOException { expect(storageRpcMock.open(BLOB_INFO.toPb(), EMPTY_RPC_OPTIONS)).andReturn(UPLOAD_ID); Capture capturedBuffer = Capture.newInstance(); expect( @@ -581,7 +262,7 @@ public void testCloseWithoutFlush() throws Exception { eq(UPLOAD_ID), capture(capturedBuffer), eq(0), eq(0L), eq(0), eq(true))) .andReturn(UPDATED_BLOB); replay(storageRpcMock); - writer = newWriter(); + writer = new BlobWriteChannel(options, BLOB_INFO, EMPTY_RPC_OPTIONS); assertTrue(writer.isOpen()); writer.close(); assertArrayEquals(new byte[0], capturedBuffer.getValue()); @@ -590,7 +271,7 @@ public void testCloseWithoutFlush() throws Exception { } @Test - public void testCloseWithFlush() throws Exception { + public void testCloseWithFlush() throws IOException { expect(storageRpcMock.open(BLOB_INFO.toPb(), EMPTY_RPC_OPTIONS)).andReturn(UPLOAD_ID); Capture capturedBuffer = Capture.newInstance(); ByteBuffer buffer = randomBuffer(MIN_CHUNK_SIZE); @@ -604,7 +285,7 @@ public void testCloseWithFlush() throws Exception { eq(true))) .andReturn(UPDATED_BLOB); replay(storageRpcMock); - writer = newWriter(); + writer = new BlobWriteChannel(options, BLOB_INFO, EMPTY_RPC_OPTIONS); assertTrue(writer.isOpen()); writer.write(buffer); writer.close(); @@ -615,7 +296,7 @@ public void testCloseWithFlush() throws Exception { } @Test - public void testWriteClosed() throws Exception { + public void testWriteClosed() throws IOException { expect(storageRpcMock.open(BLOB_INFO.toPb(), EMPTY_RPC_OPTIONS)).andReturn(UPLOAD_ID); Capture capturedBuffer = Capture.newInstance(); expect( @@ -623,7 +304,7 @@ public void testWriteClosed() throws Exception { eq(UPLOAD_ID), capture(capturedBuffer), eq(0), eq(0L), eq(0), eq(true))) .andReturn(UPDATED_BLOB); replay(storageRpcMock); - writer = newWriter(); + writer = new BlobWriteChannel(options, BLOB_INFO, EMPTY_RPC_OPTIONS); writer.close(); try { writer.write(ByteBuffer.allocate(MIN_CHUNK_SIZE)); @@ -635,7 +316,7 @@ public void testWriteClosed() throws Exception { } @Test - public void testSaveAndRestore() throws Exception { + public void testSaveAndRestore() throws IOException { expect(storageRpcMock.open(BLOB_INFO.toPb(), EMPTY_RPC_OPTIONS)).andReturn(UPLOAD_ID); Capture capturedBuffer = Capture.newInstance(CaptureType.ALL); Capture capturedPosition = Capture.newInstance(CaptureType.ALL); @@ -652,7 +333,7 @@ public void testSaveAndRestore() throws Exception { replay(storageRpcMock); ByteBuffer buffer1 = randomBuffer(DEFAULT_CHUNK_SIZE); ByteBuffer buffer2 = randomBuffer(DEFAULT_CHUNK_SIZE); - writer = newWriter(); + writer = new BlobWriteChannel(options, BLOB_INFO, EMPTY_RPC_OPTIONS); assertEquals(DEFAULT_CHUNK_SIZE, writer.write(buffer1)); assertArrayEquals(buffer1.array(), capturedBuffer.getValues().get(0)); assertEquals(new Long(0L), capturedPosition.getValues().get(0)); @@ -664,7 +345,7 @@ public void testSaveAndRestore() throws Exception { } @Test - public void testSaveAndRestoreClosed() throws Exception { + public void testSaveAndRestoreClosed() throws IOException { expect(storageRpcMock.open(BLOB_INFO.toPb(), EMPTY_RPC_OPTIONS)).andReturn(UPLOAD_ID); Capture capturedBuffer = Capture.newInstance(); expect( @@ -672,7 +353,7 @@ public void testSaveAndRestoreClosed() throws Exception { eq(UPLOAD_ID), capture(capturedBuffer), eq(0), eq(0L), eq(0), eq(true))) .andReturn(UPDATED_BLOB); replay(storageRpcMock); - writer = newWriter(); + writer = new BlobWriteChannel(options, BLOB_INFO, EMPTY_RPC_OPTIONS); writer.close(); RestorableState writerState = writer.capture(); RestorableState expectedWriterState = @@ -691,10 +372,10 @@ public void testSaveAndRestoreClosed() throws Exception { public void testStateEquals() { expect(storageRpcMock.open(BLOB_INFO.toPb(), EMPTY_RPC_OPTIONS)).andReturn(UPLOAD_ID).times(2); replay(storageRpcMock); - writer = newWriter(); + writer = new BlobWriteChannel(options, BLOB_INFO, EMPTY_RPC_OPTIONS); // avoid closing when you don't want partial writes to GCS upon failure @SuppressWarnings("resource") - WriteChannel writer2 = newWriter(); + WriteChannel writer2 = new BlobWriteChannel(options, BLOB_INFO, EMPTY_RPC_OPTIONS); RestorableState state = writer.capture(); RestorableState state2 = writer2.capture(); assertEquals(state, state2); @@ -703,7 +384,15 @@ public void testStateEquals() { } @Test - public void testWriteWithSignedURLAndWithFlush() throws Exception { + public void testWriteWithSignedURLAndWithoutFlush() throws IOException { + expect(storageRpcMock.open(SIGNED_URL)).andReturn(UPLOAD_ID); + replay(storageRpcMock); + writer = new BlobWriteChannel(options, new URL(SIGNED_URL)); + assertEquals(MIN_CHUNK_SIZE, writer.write(ByteBuffer.allocate(MIN_CHUNK_SIZE))); + } + + @Test + public void testWriteWithSignedURLAndWithFlush() throws IOException { expect(storageRpcMock.open(SIGNED_URL)).andReturn(UPLOAD_ID); Capture capturedBuffer = Capture.newInstance(); expect( @@ -716,7 +405,7 @@ public void testWriteWithSignedURLAndWithFlush() throws Exception { eq(false))) .andReturn(null); replay(storageRpcMock); - writer = newWriterForSignedUrl(); + writer = new BlobWriteChannel(options, new URL(SIGNED_URL)); writer.setChunkSize(CUSTOM_CHUNK_SIZE); ByteBuffer buffer = randomBuffer(CUSTOM_CHUNK_SIZE); assertEquals(CUSTOM_CHUNK_SIZE, writer.write(buffer)); @@ -724,7 +413,7 @@ public void testWriteWithSignedURLAndWithFlush() throws Exception { } @Test - public void testWriteWithSignedURLAndFlush() throws Exception { + public void testWriteWithSignedURLAndFlush() throws IOException { expect(storageRpcMock.open(SIGNED_URL)).andReturn(UPLOAD_ID); Capture capturedBuffer = Capture.newInstance(); expect( @@ -737,7 +426,7 @@ public void testWriteWithSignedURLAndFlush() throws Exception { eq(false))) .andReturn(null); replay(storageRpcMock); - writer = newWriterForSignedUrl(); + writer = new BlobWriteChannel(options, new URL(SIGNED_URL)); ByteBuffer[] buffers = new ByteBuffer[DEFAULT_CHUNK_SIZE / MIN_CHUNK_SIZE]; for (int i = 0; i < buffers.length; i++) { buffers[i] = randomBuffer(MIN_CHUNK_SIZE); @@ -752,7 +441,7 @@ public void testWriteWithSignedURLAndFlush() throws Exception { } @Test - public void testCloseWithSignedURLWithoutFlush() throws Exception { + public void testCloseWithSignedURLWithoutFlush() throws IOException { expect(storageRpcMock.open(SIGNED_URL)).andReturn(UPLOAD_ID); Capture capturedBuffer = Capture.newInstance(); expect( @@ -760,7 +449,7 @@ public void testCloseWithSignedURLWithoutFlush() throws Exception { eq(UPLOAD_ID), capture(capturedBuffer), eq(0), eq(0L), eq(0), eq(true))) .andReturn(UPDATED_BLOB); replay(storageRpcMock); - writer = newWriterForSignedUrl(); + writer = new BlobWriteChannel(options, new URL(SIGNED_URL)); assertTrue(writer.isOpen()); writer.close(); assertArrayEquals(new byte[0], capturedBuffer.getValue()); @@ -768,7 +457,7 @@ public void testCloseWithSignedURLWithoutFlush() throws Exception { } @Test - public void testCloseWithSignedURLWithFlush() throws Exception { + public void testCloseWithSignedURLWithFlush() throws IOException { expect(storageRpcMock.open(SIGNED_URL)).andReturn(UPLOAD_ID); Capture capturedBuffer = Capture.newInstance(); ByteBuffer buffer = randomBuffer(MIN_CHUNK_SIZE); @@ -782,7 +471,7 @@ public void testCloseWithSignedURLWithFlush() throws Exception { eq(true))) .andReturn(UPDATED_BLOB); replay(storageRpcMock); - writer = newWriterForSignedUrl(); + writer = new BlobWriteChannel(options, new URL(SIGNED_URL)); assertTrue(writer.isOpen()); writer.write(buffer); writer.close(); @@ -792,7 +481,7 @@ public void testCloseWithSignedURLWithFlush() throws Exception { } @Test - public void testWriteWithSignedURLClosed() throws Exception { + public void testWriteWithSignedURLClosed() throws IOException { expect(storageRpcMock.open(SIGNED_URL)).andReturn(UPLOAD_ID); Capture capturedBuffer = Capture.newInstance(); expect( @@ -800,7 +489,7 @@ public void testWriteWithSignedURLClosed() throws Exception { eq(UPLOAD_ID), capture(capturedBuffer), eq(0), eq(0L), eq(0), eq(true))) .andReturn(UPDATED_BLOB); replay(storageRpcMock); - writer = newWriterForSignedUrl(); + writer = new BlobWriteChannel(options, new URL(SIGNED_URL)); writer.close(); try { writer.write(ByteBuffer.allocate(MIN_CHUNK_SIZE)); @@ -811,7 +500,7 @@ public void testWriteWithSignedURLClosed() throws Exception { } @Test - public void testSaveAndRestoreWithSignedURL() throws Exception { + public void testSaveAndRestoreWithSignedURL() throws IOException { expect(storageRpcMock.open(SIGNED_URL)).andReturn(UPLOAD_ID); Capture capturedBuffer = Capture.newInstance(CaptureType.ALL); Capture capturedPosition = Capture.newInstance(CaptureType.ALL); @@ -828,7 +517,7 @@ public void testSaveAndRestoreWithSignedURL() throws Exception { replay(storageRpcMock); ByteBuffer buffer1 = randomBuffer(DEFAULT_CHUNK_SIZE); ByteBuffer buffer2 = randomBuffer(DEFAULT_CHUNK_SIZE); - writer = newWriterForSignedUrl(); + writer = new BlobWriteChannel(options, new URL(SIGNED_URL)); assertEquals(DEFAULT_CHUNK_SIZE, writer.write(buffer1)); assertArrayEquals(buffer1.array(), capturedBuffer.getValues().get(0)); assertEquals(new Long(0L), capturedPosition.getValues().get(0)); @@ -839,41 +528,18 @@ public void testSaveAndRestoreWithSignedURL() throws Exception { assertEquals(new Long(DEFAULT_CHUNK_SIZE), capturedPosition.getValues().get(1)); } - private BlobWriteChannel newWriter() { - return newWriter(false); - } - - private BlobWriteChannel newWriter(boolean withGeneration) { - Map optionsMap = - withGeneration ? RPC_OPTIONS_GENERATION : EMPTY_RPC_OPTIONS; - ResultRetryAlgorithm createResultAlgorithm = - retryAlgorithmManager.getForResumableUploadSessionCreate(optionsMap); - ResultRetryAlgorithm writeResultAlgorithm = - retryAlgorithmManager.getForResumableUploadSessionWrite(optionsMap); - final BlobInfo blobInfo = withGeneration ? BLOB_INFO_WITH_GENERATION : BLOB_INFO; - return BlobWriteChannel.newBuilder() - .setStorageOptions(options) - .setBlobInfo(blobInfo) - .setUploadIdSupplier( - ResumableMedia.startUploadForBlobInfo( - options, blobInfo, optionsMap, createResultAlgorithm)) - .setAlgorithmForWrite(writeResultAlgorithm) - .build(); - } - - private BlobWriteChannel newWriterForSignedUrl() throws MalformedURLException { - Map optionsMap = Collections.emptyMap(); - ResultRetryAlgorithm createResultAlgorithm = - retryAlgorithmManager.getForResumableUploadSessionCreate(optionsMap); - ResultRetryAlgorithm writeResultAlgorithm = - retryAlgorithmManager.getForResumableUploadSessionWrite(optionsMap); - return BlobWriteChannel.newBuilder() - .setStorageOptions(options) - .setUploadIdSupplier( - ResumableMedia.startUploadForSignedUrl( - options, new URL(SIGNED_URL), createResultAlgorithm)) - .setAlgorithmForWrite(writeResultAlgorithm) - .build(); + @Test + public void testRuntimeExceptionWithSignedURL() throws MalformedURLException { + String exceptionMessage = "invalid signedURL"; + expect(new BlobWriteChannel(options, new URL(SIGNED_URL))) + .andThrow(new RuntimeException(exceptionMessage)); + replay(storageRpcMock); + try { + writer = new BlobWriteChannel(options, new URL(SIGNED_URL)); + Assert.fail(); + } catch (StorageException ex) { + assertNotNull(ex.getMessage()); + } } private static ByteBuffer randomBuffer(int size) { diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketInfoTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketInfoTest.java index 2041de556a..8def7c306d 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketInfoTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketInfoTest.java @@ -18,16 +18,11 @@ import static com.google.cloud.storage.Acl.Project.ProjectRole.VIEWERS; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; -import com.google.api.client.json.JsonGenerator; -import com.google.api.client.json.jackson2.JacksonFactory; import com.google.api.client.util.DateTime; import com.google.api.services.storage.model.Bucket; -import com.google.api.services.storage.model.Bucket.Lifecycle; import com.google.api.services.storage.model.Bucket.Lifecycle.Rule; import com.google.cloud.storage.Acl.Project; import com.google.cloud.storage.Acl.Role; @@ -36,19 +31,14 @@ import com.google.cloud.storage.BucketInfo.CreatedBeforeDeleteRule; import com.google.cloud.storage.BucketInfo.DeleteRule; import com.google.cloud.storage.BucketInfo.DeleteRule.Type; -import com.google.cloud.storage.BucketInfo.IamConfiguration; import com.google.cloud.storage.BucketInfo.IsLiveDeleteRule; import com.google.cloud.storage.BucketInfo.LifecycleRule; import com.google.cloud.storage.BucketInfo.LifecycleRule.LifecycleAction; import com.google.cloud.storage.BucketInfo.LifecycleRule.LifecycleCondition; import com.google.cloud.storage.BucketInfo.NumNewerVersionsDeleteRule; -import com.google.cloud.storage.BucketInfo.PublicAccessPrevention; import com.google.cloud.storage.BucketInfo.RawDeleteRule; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import java.io.IOException; -import java.io.StringWriter; -import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -86,7 +76,6 @@ public class BucketInfoTest { BucketInfo.IamConfiguration.newBuilder() .setIsUniformBucketLevelAccessEnabled(true) .setUniformBucketLevelAccessLockedTime(System.currentTimeMillis()) - .setPublicAccessPrevention(BucketInfo.PublicAccessPrevention.ENFORCED) .build(); private static final BucketInfo.Logging LOGGING = BucketInfo.Logging.newBuilder() @@ -183,8 +172,6 @@ public class BucketInfoTest { .setLogging(LOGGING) .build(); - private static final Lifecycle EMPTY_LIFECYCLE = lifecycle(Collections.emptyList()); - @Test public void testToBuilder() { compareBuckets(BUCKET_INFO, BUCKET_INFO.toBuilder().build()); @@ -314,10 +301,6 @@ public void testDeleteRules() { for (DeleteRule delRule : rules) { assertEquals(delRule, DeleteRule.fromPb(delRule.toPb())); } - Rule unsupportedRule = - new Rule().setAction(new Rule.Action().setType("This action doesn't exist")); - DeleteRule.fromPb( - unsupportedRule); // if this doesn't throw an exception, unsupported rules work } @Test @@ -367,17 +350,6 @@ public void testLifecycleRules() { assertEquals(StorageClass.COLDLINE.toString(), lifecycleRule.getAction().getStorageClass()); assertEquals(30, lifecycleRule.getCondition().getDaysSinceCustomTime().intValue()); assertNotNull(lifecycleRule.getCondition().getCustomTimeBefore()); - - Rule unsupportedRule = - new LifecycleRule( - LifecycleAction.newLifecycleAction("This action type doesn't exist"), - LifecycleCondition.newBuilder().setAge(10).build()) - .toPb(); - unsupportedRule.setAction( - unsupportedRule.getAction().setType("This action type also doesn't exist")); - - LifecycleRule.fromPb( - unsupportedRule); // If this doesn't throw an exception, unsupported rules are working } @Test @@ -386,45 +358,11 @@ public void testIamConfiguration() { BucketInfo.IamConfiguration.newBuilder() .setIsUniformBucketLevelAccessEnabled(true) .setUniformBucketLevelAccessLockedTime(System.currentTimeMillis()) - .setPublicAccessPrevention(BucketInfo.PublicAccessPrevention.ENFORCED) .build() .toPb(); assertEquals(Boolean.TRUE, iamConfiguration.getUniformBucketLevelAccess().getEnabled()); assertNotNull(iamConfiguration.getUniformBucketLevelAccess().getLockedTime()); - assertEquals( - BucketInfo.PublicAccessPrevention.ENFORCED.getValue(), - iamConfiguration.getPublicAccessPrevention()); - } - - @Test - public void testPublicAccessPrevention_ensureAbsentWhenUnknown() throws IOException { - StringWriter stringWriter = new StringWriter(); - JsonGenerator jsonGenerator = - JacksonFactory.getDefaultInstance().createJsonGenerator(stringWriter); - - jsonGenerator.serialize( - BucketInfo.IamConfiguration.newBuilder() - .setIsUniformBucketLevelAccessEnabled(true) - .setUniformBucketLevelAccessLockedTime(System.currentTimeMillis()) - .setPublicAccessPrevention(PublicAccessPrevention.UNKNOWN) - .build() - .toPb()); - jsonGenerator.flush(); - - assertFalse(stringWriter.getBuffer().toString().contains("publicAccessPrevention")); - } - - @Test - public void testPapValueOfIamConfiguration() { - Bucket.IamConfiguration iamConfiguration = new Bucket.IamConfiguration(); - Bucket.IamConfiguration.UniformBucketLevelAccess uniformBucketLevelAccess = - new Bucket.IamConfiguration.UniformBucketLevelAccess(); - iamConfiguration.setUniformBucketLevelAccess(uniformBucketLevelAccess); - iamConfiguration.setPublicAccessPrevention("random-string"); - IamConfiguration fromPb = IamConfiguration.fromPb(iamConfiguration); - - assertEquals(PublicAccessPrevention.UNKNOWN, fromPb.getPublicAccessPrevention()); } @Test @@ -438,70 +376,4 @@ public void testLogging() { assertEquals("test-bucket", logging.getLogBucket()); assertEquals("test-", logging.getLogObjectPrefix()); } - - @Test - public void testRuleMappingIsCorrect_noMutations() { - Bucket bucket = bi().build().toPb(); - assertNull(bucket.getLifecycle()); - } - - @Test - public void testRuleMappingIsCorrect_deleteLifecycleRules() { - Bucket bucket = bi().deleteLifecycleRules().build().toPb(); - assertEquals(EMPTY_LIFECYCLE, bucket.getLifecycle()); - } - - @Test - @SuppressWarnings({"deprecation"}) - public void testRuleMappingIsCorrect_setDeleteRules_null() { - Bucket bucket = bi().setDeleteRules(null).build().toPb(); - assertNull(bucket.getLifecycle()); - } - - @Test - @SuppressWarnings({"deprecation"}) - public void testRuleMappingIsCorrect_setDeleteRules_empty() { - Bucket bucket = bi().setDeleteRules(Collections.emptyList()).build().toPb(); - assertEquals(EMPTY_LIFECYCLE, bucket.getLifecycle()); - } - - @Test - public void testRuleMappingIsCorrect_setLifecycleRules_empty() { - Bucket bucket = bi().setLifecycleRules(Collections.emptyList()).build().toPb(); - assertEquals(EMPTY_LIFECYCLE, bucket.getLifecycle()); - } - - @Test - public void testRuleMappingIsCorrect_setLifeCycleRules_nonEmpty() { - LifecycleRule lifecycleRule = - new LifecycleRule( - LifecycleAction.newDeleteAction(), LifecycleCondition.newBuilder().setAge(10).build()); - Rule lifecycleDeleteAfter10 = lifecycleRule.toPb(); - Bucket bucket = bi().setLifecycleRules(ImmutableList.of(lifecycleRule)).build().toPb(); - assertEquals(lifecycle(lifecycleDeleteAfter10), bucket.getLifecycle()); - } - - @Test - @SuppressWarnings({"deprecation"}) - public void testRuleMappingIsCorrect_setDeleteRules_nonEmpty() { - DeleteRule deleteRule = DELETE_RULES.get(0); - Rule deleteRuleAge5 = deleteRule.toPb(); - Bucket bucket = bi().setDeleteRules(ImmutableList.of(deleteRule)).build().toPb(); - assertEquals(lifecycle(deleteRuleAge5), bucket.getLifecycle()); - } - - private static Lifecycle lifecycle(Rule... rules) { - return lifecycle(Arrays.asList(rules)); - } - - private static Lifecycle lifecycle(List rules) { - Lifecycle emptyLifecycle = new Lifecycle(); - emptyLifecycle.setRule(rules); - return emptyLifecycle; - } - - private static BucketInfo.Builder bi() { - String bucketId = "bucketId"; - return BucketInfo.newBuilder(bucketId); - } } diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketTest.java index 5d9e622f1c..e8a8e3f46a 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketTest.java @@ -136,8 +136,6 @@ public class BucketTest { private static final String BASE64_KEY = "JVzfVl8NLD9FjedFuStegjRfES5ll5zc59CIXw572OA="; private static final Key KEY = new SecretKeySpec(BaseEncoding.base64().decode(BASE64_KEY), "AES256"); - private final RetryAlgorithmManager retryAlgorithmManager = - StorageOptions.getDefaultInstance().getRetryAlgorithmManager(); private Storage storage; private Storage serviceMockReturnsOptions = createMock(Storage.class); @@ -156,11 +154,9 @@ public void tearDown() throws Exception { verify(storage); } - private void initializeExpectedBucket() { - expect(serviceMockReturnsOptions.getOptions()).andReturn(mockOptions).anyTimes(); + private void initializeExpectedBucket(int optionsCalls) { + expect(serviceMockReturnsOptions.getOptions()).andReturn(mockOptions).times(optionsCalls); replay(serviceMockReturnsOptions); - expect(mockOptions.getRetryAlgorithmManager()).andReturn(retryAlgorithmManager).anyTimes(); - replay(mockOptions); expectedBucket = new Bucket(serviceMockReturnsOptions, new BucketInfo.BuilderImpl(BUCKET_INFO)); blobResults = ImmutableList.of( @@ -181,7 +177,7 @@ private void initializeBucket() { @Test public void testExists_True() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(4); Storage.BucketGetOption[] expectedOptions = {Storage.BucketGetOption.fields()}; expect(storage.getOptions()).andReturn(mockOptions); expect(storage.get(BUCKET_INFO.getName(), expectedOptions)).andReturn(expectedBucket); @@ -192,7 +188,7 @@ public void testExists_True() throws Exception { @Test public void testExists_False() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(4); Storage.BucketGetOption[] expectedOptions = {Storage.BucketGetOption.fields()}; expect(storage.getOptions()).andReturn(mockOptions); expect(storage.get(BUCKET_INFO.getName(), expectedOptions)).andReturn(null); @@ -203,7 +199,7 @@ public void testExists_False() throws Exception { @Test public void testReload() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(5); BucketInfo updatedInfo = BUCKET_INFO.toBuilder().setNotFoundPage("p").build(); Bucket expectedUpdatedBucket = new Bucket(serviceMockReturnsOptions, new BucketInfo.BuilderImpl(updatedInfo)); @@ -217,7 +213,7 @@ public void testReload() throws Exception { @Test public void testReloadNull() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(4); expect(storage.getOptions()).andReturn(mockOptions); expect(storage.get(BUCKET_INFO.getName())).andReturn(null); replay(storage); @@ -227,7 +223,7 @@ public void testReloadNull() throws Exception { @Test public void testReloadWithOptions() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(5); BucketInfo updatedInfo = BUCKET_INFO.toBuilder().setNotFoundPage("p").build(); Bucket expectedUpdatedBucket = new Bucket(serviceMockReturnsOptions, new BucketInfo.BuilderImpl(updatedInfo)); @@ -242,7 +238,7 @@ public void testReloadWithOptions() throws Exception { @Test public void testUpdate() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(5); Bucket expectedUpdatedBucket = expectedBucket.toBuilder().setNotFoundPage("p").build(); expect(storage.getOptions()).andReturn(mockOptions).times(2); expect(storage.update(expectedUpdatedBucket)).andReturn(expectedUpdatedBucket); @@ -255,7 +251,7 @@ public void testUpdate() throws Exception { @Test public void testDelete() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(4); expect(storage.getOptions()).andReturn(mockOptions); expect(storage.delete(BUCKET_INFO.getName())).andReturn(true); replay(storage); @@ -265,7 +261,7 @@ public void testDelete() throws Exception { @Test public void testList() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(4); PageImpl expectedBlobPage = new PageImpl<>(null, "c", blobResults); expect(storage.getOptions()).andReturn(mockOptions); expect(storage.list(BUCKET_INFO.getName())).andReturn(expectedBlobPage); @@ -284,7 +280,7 @@ public void testList() throws Exception { @Test public void testGet() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(5); Blob expectedBlob = new Blob( serviceMockReturnsOptions, @@ -300,7 +296,7 @@ public void testGet() throws Exception { @Test public void testGetAllArray() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(4); expect(storage.getOptions()).andReturn(mockOptions); List blobIds = Lists.transform( @@ -319,7 +315,7 @@ public BlobId apply(Blob blob) { @Test public void testGetAllIterable() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(4); expect(storage.getOptions()).andReturn(mockOptions); List blobIds = Lists.transform( @@ -338,7 +334,7 @@ public BlobId apply(Blob blob) { @Test public void testCreate() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(5); BlobInfo info = BlobInfo.newBuilder("b", "n").setContentType(CONTENT_TYPE).build(); Blob expectedBlob = new Blob(serviceMockReturnsOptions, new BlobInfo.BuilderImpl(info)); byte[] content = {0xD, 0xE, 0xA, 0xD}; @@ -352,7 +348,7 @@ public void testCreate() throws Exception { @Test public void testCreateNoContentType() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(5); BlobInfo info = BlobInfo.newBuilder("b", "n").build(); Blob expectedBlob = new Blob(serviceMockReturnsOptions, new BlobInfo.BuilderImpl(info)); byte[] content = {0xD, 0xE, 0xA, 0xD}; @@ -366,7 +362,7 @@ public void testCreateNoContentType() throws Exception { @Test public void testCreateWithOptions() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(5); BlobInfo info = BlobInfo.newBuilder(BlobId.of("b", "n", 42L)) .setContentType(CONTENT_TYPE) @@ -403,7 +399,7 @@ public void testCreateWithOptions() throws Exception { @Test public void testCreateWithEncryptionKey() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(5); BlobInfo info = BlobInfo.newBuilder(BlobId.of("b", "n")).setContentType(CONTENT_TYPE).build(); Blob expectedBlob = new Blob(serviceMockReturnsOptions, new BlobInfo.BuilderImpl(info)); byte[] content = {0xD, 0xE, 0xA, 0xD}; @@ -419,7 +415,7 @@ public void testCreateWithEncryptionKey() throws Exception { @Test public void testCreateWithKmsKeyName() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(5); BlobInfo info = BlobInfo.newBuilder(BlobId.of("b", "n")).setContentType(CONTENT_TYPE).build(); Blob expectedBlob = new Blob(serviceMockReturnsOptions, new BlobInfo.BuilderImpl(info)); byte[] content = {0xD, 0xE, 0xA, 0xD}; @@ -436,7 +432,7 @@ public void testCreateWithKmsKeyName() throws Exception { @Test public void testCreateNotExists() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(5); BlobInfo info = BlobInfo.newBuilder(BlobId.of("b", "n", 0L)).setContentType(CONTENT_TYPE).build(); Blob expectedBlob = new Blob(serviceMockReturnsOptions, new BlobInfo.BuilderImpl(info)); @@ -452,7 +448,7 @@ public void testCreateNotExists() throws Exception { @Test public void testCreateWithWrongGenerationOptions() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(4); expect(storage.getOptions()).andReturn(mockOptions); replay(storage); initializeBucket(); @@ -472,7 +468,7 @@ public void testCreateWithWrongGenerationOptions() throws Exception { @Test public void testCreateWithWrongMetagenerationOptions() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(4); expect(storage.getOptions()).andReturn(mockOptions); replay(storage); initializeBucket(); @@ -493,7 +489,7 @@ public void testCreateWithWrongMetagenerationOptions() throws Exception { @Test @SuppressWarnings({"unchecked", "deprecation"}) public void testCreateFromStream() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(5); BlobInfo info = BlobInfo.newBuilder("b", "n").setContentType(CONTENT_TYPE).build(); Blob expectedBlob = new Blob(serviceMockReturnsOptions, new BlobInfo.BuilderImpl(info)); byte[] content = {0xD, 0xE, 0xA, 0xD}; @@ -509,7 +505,7 @@ public void testCreateFromStream() throws Exception { @Test @SuppressWarnings({"unchecked", "deprecation"}) public void testCreateFromStreamNoContentType() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(5); BlobInfo info = BlobInfo.newBuilder("b", "n").build(); Blob expectedBlob = new Blob(serviceMockReturnsOptions, new BlobInfo.BuilderImpl(info)); byte[] content = {0xD, 0xE, 0xA, 0xD}; @@ -525,7 +521,7 @@ public void testCreateFromStreamNoContentType() throws Exception { @Test @SuppressWarnings({"unchecked", "deprecation"}) public void testCreateFromStreamWithOptions() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(5); BlobInfo info = BlobInfo.newBuilder(BlobId.of("b", "n", 42L)) .setContentType(CONTENT_TYPE) @@ -570,7 +566,7 @@ public void testCreateFromStreamWithOptions() throws Exception { @Test @SuppressWarnings({"unchecked", "deprecation"}) public void testCreateFromStreamWithEncryptionKey() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(5); BlobInfo info = BlobInfo.newBuilder(BlobId.of("b", "n")).setContentType(CONTENT_TYPE).build(); Blob expectedBlob = new Blob(serviceMockReturnsOptions, new BlobInfo.BuilderImpl(info)); byte[] content = {0xD, 0xE, 0xA, 0xD}; @@ -588,7 +584,7 @@ public void testCreateFromStreamWithEncryptionKey() throws Exception { @Test @SuppressWarnings({"unchecked", "deprecation"}) public void testCreateFromStreamNotExists() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(5); BlobInfo info = BlobInfo.newBuilder(BlobId.of("b", "n", 0L)).setContentType(CONTENT_TYPE).build(); Blob expectedBlob = new Blob(serviceMockReturnsOptions, new BlobInfo.BuilderImpl(info)); @@ -606,7 +602,7 @@ public void testCreateFromStreamNotExists() throws Exception { @Test public void testCreateFromStreamWithWrongGenerationOptions() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(4); expect(storage.getOptions()).andReturn(mockOptions); replay(storage); initializeBucket(); @@ -627,7 +623,7 @@ public void testCreateFromStreamWithWrongGenerationOptions() throws Exception { @Test public void testCreateFromStreamWithWrongMetagenerationOptions() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(4); expect(storage.getOptions()).andReturn(mockOptions); replay(storage); initializeBucket(); @@ -648,7 +644,7 @@ public void testCreateFromStreamWithWrongMetagenerationOptions() throws Exceptio @Test public void testGetAcl() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(4); expect(storage.getOptions()).andReturn(mockOptions); expect(storage.getAcl(BUCKET_INFO.getName(), User.ofAllAuthenticatedUsers())).andReturn(ACL); replay(storage); @@ -658,7 +654,7 @@ public void testGetAcl() throws Exception { @Test public void testDeleteAcl() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(4); expect(storage.getOptions()).andReturn(mockOptions); expect(storage.deleteAcl(BUCKET_INFO.getName(), User.ofAllAuthenticatedUsers())) .andReturn(true); @@ -669,7 +665,7 @@ public void testDeleteAcl() throws Exception { @Test public void testCreateAcl() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(4); expect(storage.getOptions()).andReturn(mockOptions); Acl returnedAcl = ACL.toBuilder().setEtag("ETAG").setId("ID").build(); expect(storage.createAcl(BUCKET_INFO.getName(), ACL)).andReturn(returnedAcl); @@ -680,7 +676,7 @@ public void testCreateAcl() throws Exception { @Test public void testUpdateAcl() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(4); expect(storage.getOptions()).andReturn(mockOptions); Acl returnedAcl = ACL.toBuilder().setEtag("ETAG").setId("ID").build(); expect(storage.updateAcl(BUCKET_INFO.getName(), ACL)).andReturn(returnedAcl); @@ -691,7 +687,7 @@ public void testUpdateAcl() throws Exception { @Test public void testListAcls() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(4); expect(storage.getOptions()).andReturn(mockOptions); expect(storage.listAcls(BUCKET_INFO.getName())).andReturn(ACLS); replay(storage); @@ -701,7 +697,7 @@ public void testListAcls() throws Exception { @Test public void testGetDefaultAcl() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(4); expect(storage.getOptions()).andReturn(mockOptions); expect(storage.getDefaultAcl(BUCKET_INFO.getName(), User.ofAllAuthenticatedUsers())) .andReturn(ACL); @@ -712,7 +708,7 @@ public void testGetDefaultAcl() throws Exception { @Test public void testDeleteDefaultAcl() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(4); expect(storage.getOptions()).andReturn(mockOptions); expect(storage.deleteDefaultAcl(BUCKET_INFO.getName(), User.ofAllAuthenticatedUsers())) .andReturn(true); @@ -723,7 +719,7 @@ public void testDeleteDefaultAcl() throws Exception { @Test public void testCreateDefaultAcl() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(4); expect(storage.getOptions()).andReturn(mockOptions); Acl returnedAcl = ACL.toBuilder().setEtag("ETAG").setId("ID").build(); expect(storage.createDefaultAcl(BUCKET_INFO.getName(), ACL)).andReturn(returnedAcl); @@ -734,7 +730,7 @@ public void testCreateDefaultAcl() throws Exception { @Test public void testUpdateDefaultAcl() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(4); expect(storage.getOptions()).andReturn(mockOptions); Acl returnedAcl = ACL.toBuilder().setEtag("ETAG").setId("ID").build(); expect(storage.updateDefaultAcl(BUCKET_INFO.getName(), ACL)).andReturn(returnedAcl); @@ -745,7 +741,7 @@ public void testUpdateDefaultAcl() throws Exception { @Test public void testListDefaultAcls() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(4); expect(storage.getOptions()).andReturn(mockOptions); expect(storage.listDefaultAcls(BUCKET_INFO.getName())).andReturn(ACLS); replay(storage); @@ -755,7 +751,7 @@ public void testListDefaultAcls() throws Exception { @Test public void testLockRetention() throws Exception { - initializeExpectedBucket(); + initializeExpectedBucket(5); Bucket expectedRetentionLockedBucket = expectedBucket .toBuilder() @@ -794,7 +790,7 @@ public void testToBuilder() { @Test @SuppressWarnings({"unchecked", "deprecation"}) public void testBuilder() { - initializeExpectedBucket(); + initializeExpectedBucket(4); expect(storage.getOptions()).andReturn(mockOptions).times(4); replay(storage); Bucket.Builder builder = @@ -858,7 +854,7 @@ public void testBuilder() { @Test public void testDeleteLifecycleRules() { - initializeExpectedBucket(); + initializeExpectedBucket(6); Bucket bucket = new Bucket(serviceMockReturnsOptions, new BucketInfo.BuilderImpl(FULL_BUCKET_INFO)); assertThat(bucket.getLifecycleRules()).hasSize(1); @@ -874,7 +870,7 @@ public void testDeleteLifecycleRules() { @Test public void testUpdateBucketLogging() { - initializeExpectedBucket(); + initializeExpectedBucket(6); BucketInfo.Logging logging = BucketInfo.Logging.newBuilder() .setLogBucket("logs-bucket") @@ -897,7 +893,7 @@ public void testUpdateBucketLogging() { @Test public void testRemoveBucketCORS() { - initializeExpectedBucket(); + initializeExpectedBucket(6); List origins = ImmutableList.of(Cors.Origin.of("http://cloud.google.com")); List httpMethods = ImmutableList.of(HttpMethod.GET); List responseHeaders = ImmutableList.of("Content-Type"); diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/DataGeneration.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/DataGeneration.java deleted file mode 100644 index be3f6e756a..0000000000 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/DataGeneration.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage; - -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.util.Random; -import java.util.UUID; -import org.junit.rules.TestRule; -import org.junit.runner.Description; -import org.junit.runners.model.Statement; - -public final class DataGeneration implements TestRule { - - private final Random rand; - private final String bucketName; - - public DataGeneration(Random rand) { - this.rand = rand; - this.bucketName = String.format("rand-bkt-%s", UUID.randomUUID()); - } - - public String getBucketName() { - return bucketName; - } - - public ByteBuffer randByteBuffer(int limit) { - ByteBuffer b = ByteBuffer.allocate(limit); - fillByteBuffer(b); - return b; - } - - public void fillByteBuffer(ByteBuffer b) { - while (b.position() < b.limit()) { - int i = rand.nextInt('z'); - char c = (char) i; - if (Character.isLetter(c) || Character.isDigit(c)) { - b.put(Character.toString(c).getBytes(StandardCharsets.UTF_8)); - } - } - b.position(0); - } - - @Override - public Statement apply(Statement base, Description description) { - return new Statement() { - @Override - public void evaluate() throws Throwable { - base.evaluate(); - } - }; - } -} diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/DefaultRetryHandlingBehaviorTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/DefaultRetryHandlingBehaviorTest.java deleted file mode 100644 index ad5653cffe..0000000000 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/DefaultRetryHandlingBehaviorTest.java +++ /dev/null @@ -1,994 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage; - -import static com.google.common.collect.ImmutableList.toImmutableList; -import static com.google.common.collect.ImmutableSet.toImmutableSet; -import static com.google.common.truth.Truth.assertWithMessage; - -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.core.io.JsonEOFException; -import com.google.api.client.googleapis.json.GoogleJsonError; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.HttpResponseException; -import com.google.api.gax.retrying.ResultRetryAlgorithm; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Sets; -import com.google.gson.stream.MalformedJsonException; -import java.io.IOException; -import java.net.SocketException; -import java.net.SocketTimeoutException; -import java.security.cert.CertificateException; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.function.Function; -import javax.net.ssl.SSLException; -import javax.net.ssl.SSLHandshakeException; -import javax.net.ssl.SSLProtocolException; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameters; - -/** - * Validate the behavior of our new "default" ResultRetryAlgorithms against that of the legacy retry - * handling behavior. - */ -@RunWith(Parameterized.class) -public final class DefaultRetryHandlingBehaviorTest { - private static final String DEFAULT_MESSAGE = "err_default_message"; - - private final Case c; - private final DefaultStorageRetryStrategy defaultStrategy; - private final StorageRetryStrategy legacyStrategy; - - @SuppressWarnings("deprecation") - public DefaultRetryHandlingBehaviorTest(Case c) { - this.c = c; - defaultStrategy = new DefaultStorageRetryStrategy(); - legacyStrategy = StorageRetryStrategy.getLegacyStorageRetryStrategy(); - } - - /** - * For a specified {@link Case} - * - *

    - *
  1. Resolve the ResultRetryAlgorithm for the specific {@link HandlerCategory} for both - * default and legacy - *
  2. Evaluate the retryability of the throwable {@link Case#getThrowable()} against both of - * the resolved {@code ResultRetryAlgorithm}s - *
  3. Resolve the {@link Behavior} change if any between the two evaluation results - *
  4. Assert the behavior change matches the {@link Case#expectedBehavior expected behavior} - *
- */ - @SuppressWarnings("ConstantConditions") - @Test - public void validateBehavior() { - ResultRetryAlgorithm defaultAlgorithm = c.handlerCategory.apply(defaultStrategy); - ResultRetryAlgorithm legacyAlgorithm = c.handlerCategory.apply(legacyStrategy); - Throwable throwable = c.getThrowable(); - - boolean defaultShouldRetryResult = defaultAlgorithm.shouldRetry(throwable, null); - boolean legacyShouldRetryResult = legacyAlgorithm.shouldRetry(throwable, null); - - Behavior actualBehavior = null; - String message = null; - boolean shouldRetry = c.getExpectRetry().shouldRetry; - if (shouldRetry && !defaultShouldRetryResult && legacyShouldRetryResult) { - actualBehavior = Behavior.DEFAULT_MORE_STRICT; - message = "default is more strict"; - } else if (shouldRetry && !defaultShouldRetryResult && !legacyShouldRetryResult) { - actualBehavior = Behavior.SAME; - message = "both are rejecting when we want a retry"; - } else if (shouldRetry && defaultShouldRetryResult && legacyShouldRetryResult) { - actualBehavior = Behavior.SAME; - message = "both are allowing"; - } else if (shouldRetry && defaultShouldRetryResult && !legacyShouldRetryResult) { - actualBehavior = Behavior.DEFAULT_MORE_PERMISSIBLE; - message = "default is more permissive"; - } else if (!shouldRetry && !defaultShouldRetryResult && legacyShouldRetryResult) { - actualBehavior = Behavior.DEFAULT_MORE_STRICT; - message = "default is more strict"; - } else if (!shouldRetry && !defaultShouldRetryResult && !legacyShouldRetryResult) { - actualBehavior = Behavior.SAME; - message = "both are rejecting as expected"; - } else if (!shouldRetry && defaultShouldRetryResult && legacyShouldRetryResult) { - actualBehavior = Behavior.SAME; - message = "both are too permissive"; - } else if (!shouldRetry && defaultShouldRetryResult && !legacyShouldRetryResult) { - actualBehavior = Behavior.DEFAULT_MORE_PERMISSIBLE; - message = "default is too permissive"; - } - - assertWithMessage(message).that(actualBehavior).isEqualTo(c.expectedBehavior); - } - - /** Resolve all the test cases and assert all permutations have a case defined. */ - @Parameters(name = "{0}") - public static Collection testCases() { - - // define the list of cases to be validated - List cases = getAllCases(); - - /* perform validation of the defined list of cases to ensure all permutations are defined */ - - // calculate all the possible permutations - ImmutableSet expectedTokens = - Arrays.stream(HandlerCategory.values()) - .flatMap( - handlerCategory -> - Arrays.stream(ThrowableCategory.values()) - .map(throwableCategory -> token(throwableCategory, handlerCategory))) - .collect(toImmutableSet()); - - // calculate the actual defined permutations - ImmutableSet actualTokens = - cases.stream() - .map(c -> token(c.throwableCategory, c.handlerCategory)) - .collect(toImmutableSet()); - - // calculate the difference if any between expected and actual, then sort and listify - ImmutableList difference = - Sets.difference(expectedTokens, actualTokens).stream().sorted().collect(toImmutableList()); - - // ensure all permutations are accounted for, reporting any that haven't been and providing - // a stub which can be used to easily define them. - assertWithMessage("Missing mappings for tokens").that(difference).isEmpty(); - - // wrap our case in an array for ultimate passing to the constructor - return cases.stream().map(c -> new Object[] {c}).collect(toImmutableList()); - } - - /** - * Generate a token which represents a permutation for which a {@link Case} must be defined. - * - *

If a case is not defined, this value will be reported and functions as a stub to easily - * define a new {@code Case}. - */ - private static String token(ThrowableCategory t, HandlerCategory h) { - return String.format( - "new Case(ThrowableCategory.%s, HandlerCategory.%s, /*TODO*/ null, /*TODO*/ null)", - t.name(), h.name()); - } - - /** - * An individual case we want to validate. - * - *

Given a {@link HandlerCategory} and {@link ThrowableCategory} validate the retryability and - * behavior between default and legacy handlers. - */ - static final class Case { - - private final HandlerCategory handlerCategory; - private final ThrowableCategory throwableCategory; - private final ExpectRetry expectRetry; - private final Behavior expectedBehavior; - - Case( - ThrowableCategory throwableCategory, - HandlerCategory handlerCategory, - ExpectRetry expectRetry, - Behavior expectedBehavior) { - this.handlerCategory = handlerCategory; - this.throwableCategory = throwableCategory; - this.expectRetry = expectRetry; - this.expectedBehavior = expectedBehavior; - } - - Throwable getThrowable() { - return throwableCategory.throwable; - } - - public ExpectRetry getExpectRetry() { - return expectRetry; - } - - @Override - public String toString() { - return "Case{" - + "handlerCategory=" - + handlerCategory - + ", throwableCategory=" - + throwableCategory - + ", expectRetry=" - + expectRetry - + ", expectedBehavior=" - + expectedBehavior - + '}'; - } - } - - /** Whether to expect a retry to happen or not */ - enum ExpectRetry { - YES(true), - NO(false); - - private final boolean shouldRetry; - - ExpectRetry(boolean shouldRetry) { - this.shouldRetry = shouldRetry; - } - } - - /** - * A category of handler type, and the ability to resolve the {@link ResultRetryAlgorithm} given a - * {@link StorageRetryStrategy} - */ - enum HandlerCategory implements Function> { - IDEMPOTENT, - NONIDEMPOTENT; - - @Override - public ResultRetryAlgorithm apply(StorageRetryStrategy storageRetryStrategy) { - switch (this) { - case IDEMPOTENT: - return storageRetryStrategy.getIdempotentHandler(); - case NONIDEMPOTENT: - return storageRetryStrategy.getNonidempotentHandler(); - default: - throw new IllegalStateException("Unmappable HandlerCategory: " + this.name()); - } - } - } - - /** Some states comparing behavior between default and legacy */ - enum Behavior { - DEFAULT_MORE_PERMISSIBLE, - SAME, - DEFAULT_MORE_STRICT - } - - /** - * A set of exceptions we want to validate behavior for. - * - *

This class is an enum for convenience of specifying a closed set, along with providing easy - * to read names in code thereby forgoing the need to maintain a separate set of strings. - */ - enum ThrowableCategory { - SOCKET_TIMEOUT_EXCEPTION(C.SOCKET_TIMEOUT_EXCEPTION), - SOCKET_EXCEPTION(C.SOCKET_EXCEPTION), - SSL_EXCEPTION(C.SSL_EXCEPTION), - SSL_EXCEPTION_CONNECTION_SHUTDOWN(C.SSL_EXCEPTION_CONNECTION_SHUTDOWN), - SSL_HANDSHAKE_EXCEPTION(C.SSL_HANDSHAKE_EXCEPTION), - SSL_HANDSHAKE_EXCEPTION_CAUSED_BY_CERTIFICATE_EXCEPTION( - C.SSL_HANDSHAKE_EXCEPTION_CERTIFICATE_EXCEPTION), - INSUFFICIENT_DATA(C.INSUFFICIENT_DATA_WRITTEN), - ERROR_WRITING_REQUEST_BODY(C.ERROR_WRITING_REQUEST_BODY), - HTTP_RESPONSE_EXCEPTION_401(C.HTTP_401), - HTTP_RESPONSE_EXCEPTION_403(C.HTTP_403), - HTTP_RESPONSE_EXCEPTION_404(C.HTTP_404), - HTTP_RESPONSE_EXCEPTION_408(C.HTTP_409), - HTTP_RESPONSE_EXCEPTION_429(C.HTTP_429), - HTTP_RESPONSE_EXCEPTION_500(C.HTTP_500), - HTTP_RESPONSE_EXCEPTION_502(C.HTTP_502), - HTTP_RESPONSE_EXCEPTION_503(C.HTTP_503), - HTTP_RESPONSE_EXCEPTION_504(C.HTTP_504), - STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_401(new StorageException(C.HTTP_401)), - STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_403(new StorageException(C.HTTP_403)), - STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_404(new StorageException(C.HTTP_404)), - STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_408(new StorageException(C.HTTP_409)), - STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_429(new StorageException(C.HTTP_429)), - STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_500(new StorageException(C.HTTP_500)), - STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_502(new StorageException(C.HTTP_502)), - STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_503(new StorageException(C.HTTP_503)), - STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_504(new StorageException(C.HTTP_504)), - STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_401(new StorageException(C.JSON_401)), - STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_403(new StorageException(C.JSON_403)), - STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_404(new StorageException(C.JSON_404)), - STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_408(new StorageException(C.JSON_408)), - STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_429(new StorageException(C.JSON_429)), - STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_500(new StorageException(C.JSON_500)), - STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_502(new StorageException(C.JSON_502)), - STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_503(new StorageException(C.JSON_503)), - STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_504(new StorageException(C.JSON_504)), - STORAGE_EXCEPTION_SOCKET_TIMEOUT_EXCEPTION(new StorageException(C.SOCKET_TIMEOUT_EXCEPTION)), - STORAGE_EXCEPTION_SOCKET_EXCEPTION(new StorageException(C.SOCKET_EXCEPTION)), - STORAGE_EXCEPTION_SSL_EXCEPTION(new StorageException(C.SSL_EXCEPTION)), - STORAGE_EXCEPTION_SSL_EXCEPTION_CONNECTION_SHUTDOWN( - new StorageException(C.SSL_EXCEPTION_CONNECTION_SHUTDOWN)), - STORAGE_EXCEPTION_SSL_HANDSHAKE_EXCEPTION(new StorageException(C.SSL_HANDSHAKE_EXCEPTION)), - STORAGE_EXCEPTION_SSL_HANDSHAKE_EXCEPTION_CAUSED_BY_CERTIFICATE_EXCEPTION( - new StorageException(C.SSL_HANDSHAKE_EXCEPTION_CERTIFICATE_EXCEPTION)), - STORAGE_EXCEPTION_INSUFFICIENT_DATA(new StorageException(C.INSUFFICIENT_DATA_WRITTEN)), - STORAGE_EXCEPTION_ERROR_WRITING_REQUEST_BODY( - new StorageException(C.ERROR_WRITING_REQUEST_BODY)), - ILLEGAL_ARGUMENT_EXCEPTION(C.ILLEGAL_ARGUMENT_EXCEPTION), - STORAGE_EXCEPTION_ILLEGAL_ARGUMENT_EXCEPTION( - StorageException.coalesce(C.ILLEGAL_ARGUMENT_EXCEPTION)), - STORAGE_EXCEPTION_0_INTERNAL_ERROR( - new StorageException(0, "internalError", "internalError", null)), - STORAGE_EXCEPTION_0_CONNECTION_CLOSED_PREMATURELY( - new StorageException( - 0, "connectionClosedPrematurely", "connectionClosedPrematurely", null)), - STORAGE_EXCEPTION_0_CONNECTION_CLOSED_PREMATURELY_IO_CAUSE( - new StorageException( - 0, - "connectionClosedPrematurely", - "connectionClosedPrematurely", - C.CONNECTION_CLOSED_PREMATURELY)), - EMPTY_JSON_PARSE_ERROR(new IllegalArgumentException("no JSON input found")), - JACKSON_EOF_EXCEPTION(C.JACKSON_EOF_EXCEPTION), - STORAGE_EXCEPTION_0_JACKSON_EOF_EXCEPTION( - new StorageException(0, "parse error", C.JACKSON_EOF_EXCEPTION)), - GSON_MALFORMED_EXCEPTION(C.GSON_MALFORMED_EXCEPTION), - STORAGE_EXCEPTION_0_GSON_MALFORMED_EXCEPTION( - new StorageException(0, "parse error", C.GSON_MALFORMED_EXCEPTION)), - IO_EXCEPTION(new IOException("no retry")), - ; - - private final Throwable throwable; - - ThrowableCategory(Throwable throwable) { - this.throwable = throwable; - } - - public Throwable getThrowable() { - return throwable; - } - - /** - * A class of constants for use by the containing enum. - * - *

Enums can't have static fields, so we use this class to hold constants which are used by - * the enum values. - */ - private static final class C { - private static final SocketTimeoutException SOCKET_TIMEOUT_EXCEPTION = - new SocketTimeoutException(); - private static final SocketException SOCKET_EXCEPTION = new SocketException(); - private static final SSLException SSL_EXCEPTION = new SSLException("unknown"); - private static final SSLException SSL_EXCEPTION_CONNECTION_SHUTDOWN = - new SSLException("Connection has been shutdown: asdf"); - private static final SSLHandshakeException SSL_HANDSHAKE_EXCEPTION = - newSslHandshakeExceptionWithCause(new SSLProtocolException(DEFAULT_MESSAGE)); - private static final SSLHandshakeException SSL_HANDSHAKE_EXCEPTION_CERTIFICATE_EXCEPTION = - newSslHandshakeExceptionWithCause(new CertificateException()); - private static final IOException INSUFFICIENT_DATA_WRITTEN = - new IOException("insufficient data written"); - private static final IOException ERROR_WRITING_REQUEST_BODY = - new IOException("Error writing request body to server"); - private static final HttpResponseException HTTP_401 = - newHttpResponseException(401, "Unauthorized"); - private static final HttpResponseException HTTP_403 = - newHttpResponseException(403, "Forbidden"); - private static final HttpResponseException HTTP_404 = - newHttpResponseException(404, "Not Found"); - private static final HttpResponseException HTTP_409 = - newHttpResponseException(408, "Request Timeout"); - private static final HttpResponseException HTTP_429 = - newHttpResponseException(429, "Too Many Requests"); - private static final HttpResponseException HTTP_500 = - newHttpResponseException(500, "Internal Server Error"); - private static final HttpResponseException HTTP_502 = - newHttpResponseException(502, "Bad Gateway"); - private static final HttpResponseException HTTP_503 = - newHttpResponseException(503, "Service Unavailable"); - private static final HttpResponseException HTTP_504 = - newHttpResponseException(504, "Gateway Timeout"); - private static final GoogleJsonError JSON_401 = newGoogleJsonError(401, "Unauthorized"); - private static final GoogleJsonError JSON_403 = newGoogleJsonError(403, "Forbidden"); - private static final GoogleJsonError JSON_404 = newGoogleJsonError(404, "Not Found"); - private static final GoogleJsonError JSON_408 = newGoogleJsonError(408, "Request Timeout"); - private static final GoogleJsonError JSON_429 = newGoogleJsonError(429, "Too Many Requests"); - private static final GoogleJsonError JSON_500 = - newGoogleJsonError(500, "Internal Server Error"); - private static final GoogleJsonError JSON_502 = newGoogleJsonError(502, "Bad Gateway"); - private static final GoogleJsonError JSON_503 = - newGoogleJsonError(503, "Service Unavailable"); - private static final GoogleJsonError JSON_504 = newGoogleJsonError(504, "Gateway Timeout"); - private static final IllegalArgumentException ILLEGAL_ARGUMENT_EXCEPTION = - new IllegalArgumentException("illegal argument"); - private static final IOException CONNECTION_CLOSED_PREMATURELY = - new IOException("simulated Connection closed prematurely"); - private static final JsonEOFException JACKSON_EOF_EXCEPTION = - new JsonEOFException(null, JsonToken.VALUE_STRING, "parse-exception"); - private static final MalformedJsonException GSON_MALFORMED_EXCEPTION = - new MalformedJsonException("parse-exception"); - - private static HttpResponseException newHttpResponseException( - int httpStatusCode, String name) { - return new HttpResponseException.Builder(httpStatusCode, name, new HttpHeaders()).build(); - } - - private static GoogleJsonError newGoogleJsonError(int code, String message) { - GoogleJsonError error = new GoogleJsonError(); - error.setCode(code); - error.setMessage(message); - return error; - } - - private static SSLHandshakeException newSslHandshakeExceptionWithCause(Throwable cause) { - SSLHandshakeException sslHandshakeException = new SSLHandshakeException(DEFAULT_MESSAGE); - Throwable throwable = sslHandshakeException.initCause(cause); - return (SSLHandshakeException) throwable; - } - } - } - - /** - * A corralled method which allows us to move the individual cases away from the rest of the code - * since our code formatter is very strict and seems to feel 475 lines of code at 100 columns is - * better than 90 lines at 200 columns. - * - *

this method returns a list that essentially is a table of where each row is an individual - * test case - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
{@link ThrowableCategory throwable category}{@link HandlerCategory handler category}{@link ExpectRetry whether retry is expected}{@link Behavior what the expected behavior comparison is}
{@link ThrowableCategory#STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_500 STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_500}{@link HandlerCategory#NONIDEMPOTENT NONIDEMPOTENT}{@link ExpectRetry#NO NO}{@link Behavior#DEFAULT_MORE_STRICT DEFAULT_MORE_STRICT}
- */ - private static ImmutableList getAllCases() { - return ImmutableList.builder() - .add( - new Case( - ThrowableCategory.ERROR_WRITING_REQUEST_BODY, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.DEFAULT_MORE_PERMISSIBLE), - new Case( - ThrowableCategory.ERROR_WRITING_REQUEST_BODY, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.HTTP_RESPONSE_EXCEPTION_401, - HandlerCategory.IDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.HTTP_RESPONSE_EXCEPTION_401, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.HTTP_RESPONSE_EXCEPTION_403, - HandlerCategory.IDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.HTTP_RESPONSE_EXCEPTION_403, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.HTTP_RESPONSE_EXCEPTION_404, - HandlerCategory.IDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.HTTP_RESPONSE_EXCEPTION_404, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.HTTP_RESPONSE_EXCEPTION_408, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.DEFAULT_MORE_PERMISSIBLE), - new Case( - ThrowableCategory.HTTP_RESPONSE_EXCEPTION_408, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.HTTP_RESPONSE_EXCEPTION_429, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.DEFAULT_MORE_PERMISSIBLE), - new Case( - ThrowableCategory.HTTP_RESPONSE_EXCEPTION_429, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.HTTP_RESPONSE_EXCEPTION_500, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.DEFAULT_MORE_PERMISSIBLE), - new Case( - ThrowableCategory.HTTP_RESPONSE_EXCEPTION_500, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.HTTP_RESPONSE_EXCEPTION_502, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.DEFAULT_MORE_PERMISSIBLE), - new Case( - ThrowableCategory.HTTP_RESPONSE_EXCEPTION_502, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.HTTP_RESPONSE_EXCEPTION_503, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.DEFAULT_MORE_PERMISSIBLE), - new Case( - ThrowableCategory.HTTP_RESPONSE_EXCEPTION_503, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.HTTP_RESPONSE_EXCEPTION_504, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.DEFAULT_MORE_PERMISSIBLE), - new Case( - ThrowableCategory.HTTP_RESPONSE_EXCEPTION_504, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.ILLEGAL_ARGUMENT_EXCEPTION, - HandlerCategory.IDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.ILLEGAL_ARGUMENT_EXCEPTION, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.INSUFFICIENT_DATA, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.DEFAULT_MORE_PERMISSIBLE), - new Case( - ThrowableCategory.INSUFFICIENT_DATA, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.SOCKET_EXCEPTION, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.DEFAULT_MORE_PERMISSIBLE), - new Case( - ThrowableCategory.SOCKET_EXCEPTION, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.SOCKET_TIMEOUT_EXCEPTION, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.DEFAULT_MORE_PERMISSIBLE), - new Case( - ThrowableCategory.SOCKET_TIMEOUT_EXCEPTION, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.SSL_EXCEPTION, - HandlerCategory.IDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.SSL_EXCEPTION, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.SSL_EXCEPTION_CONNECTION_SHUTDOWN, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.DEFAULT_MORE_PERMISSIBLE), - new Case( - ThrowableCategory.SSL_EXCEPTION_CONNECTION_SHUTDOWN, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.SSL_HANDSHAKE_EXCEPTION, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.DEFAULT_MORE_PERMISSIBLE), - new Case( - ThrowableCategory.SSL_HANDSHAKE_EXCEPTION, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.SSL_HANDSHAKE_EXCEPTION_CAUSED_BY_CERTIFICATE_EXCEPTION, - HandlerCategory.IDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.SSL_HANDSHAKE_EXCEPTION_CAUSED_BY_CERTIFICATE_EXCEPTION, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_ERROR_WRITING_REQUEST_BODY, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_ERROR_WRITING_REQUEST_BODY, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.DEFAULT_MORE_STRICT), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_401, - HandlerCategory.IDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_401, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_403, - HandlerCategory.IDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_403, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_404, - HandlerCategory.IDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_404, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_408, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_408, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.DEFAULT_MORE_STRICT), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_429, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_429, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.DEFAULT_MORE_STRICT), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_500, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_500, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.DEFAULT_MORE_STRICT), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_502, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_502, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.DEFAULT_MORE_STRICT), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_503, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_503, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.DEFAULT_MORE_STRICT), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_504, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_GOOGLE_JSON_ERROR_504, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.DEFAULT_MORE_STRICT), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_401, - HandlerCategory.IDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_401, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_403, - HandlerCategory.IDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_403, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_404, - HandlerCategory.IDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_404, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_408, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_408, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.DEFAULT_MORE_STRICT), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_429, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_429, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.DEFAULT_MORE_STRICT), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_500, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_500, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.DEFAULT_MORE_STRICT), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_502, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_502, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.DEFAULT_MORE_STRICT), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_503, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_503, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.DEFAULT_MORE_STRICT), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_504, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_HTTP_RESPONSE_EXCEPTION_504, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.DEFAULT_MORE_STRICT), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_ILLEGAL_ARGUMENT_EXCEPTION, - HandlerCategory.IDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_ILLEGAL_ARGUMENT_EXCEPTION, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_INSUFFICIENT_DATA, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_INSUFFICIENT_DATA, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.DEFAULT_MORE_STRICT), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_SOCKET_EXCEPTION, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_SOCKET_EXCEPTION, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.DEFAULT_MORE_STRICT), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_SOCKET_TIMEOUT_EXCEPTION, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_SOCKET_TIMEOUT_EXCEPTION, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.DEFAULT_MORE_STRICT), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_SSL_EXCEPTION, - HandlerCategory.IDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_SSL_EXCEPTION, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_SSL_EXCEPTION_CONNECTION_SHUTDOWN, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_SSL_EXCEPTION_CONNECTION_SHUTDOWN, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.DEFAULT_MORE_STRICT), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_SSL_HANDSHAKE_EXCEPTION, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_SSL_HANDSHAKE_EXCEPTION, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.DEFAULT_MORE_STRICT), - new Case( - ThrowableCategory - .STORAGE_EXCEPTION_SSL_HANDSHAKE_EXCEPTION_CAUSED_BY_CERTIFICATE_EXCEPTION, - HandlerCategory.IDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory - .STORAGE_EXCEPTION_SSL_HANDSHAKE_EXCEPTION_CAUSED_BY_CERTIFICATE_EXCEPTION, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_0_CONNECTION_CLOSED_PREMATURELY, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_0_CONNECTION_CLOSED_PREMATURELY, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.DEFAULT_MORE_STRICT), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_0_CONNECTION_CLOSED_PREMATURELY_IO_CAUSE, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_0_CONNECTION_CLOSED_PREMATURELY_IO_CAUSE, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.DEFAULT_MORE_STRICT), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_0_INTERNAL_ERROR, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_0_INTERNAL_ERROR, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.DEFAULT_MORE_STRICT), - new Case( - ThrowableCategory.EMPTY_JSON_PARSE_ERROR, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.DEFAULT_MORE_PERMISSIBLE), - new Case( - ThrowableCategory.EMPTY_JSON_PARSE_ERROR, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.IO_EXCEPTION, - HandlerCategory.IDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.IO_EXCEPTION, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.JACKSON_EOF_EXCEPTION, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.DEFAULT_MORE_PERMISSIBLE), - new Case( - ThrowableCategory.JACKSON_EOF_EXCEPTION, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_0_JACKSON_EOF_EXCEPTION, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.DEFAULT_MORE_PERMISSIBLE), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_0_JACKSON_EOF_EXCEPTION, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.GSON_MALFORMED_EXCEPTION, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.DEFAULT_MORE_PERMISSIBLE), - new Case( - ThrowableCategory.GSON_MALFORMED_EXCEPTION, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_0_GSON_MALFORMED_EXCEPTION, - HandlerCategory.IDEMPOTENT, - ExpectRetry.YES, - Behavior.DEFAULT_MORE_PERMISSIBLE), - new Case( - ThrowableCategory.STORAGE_EXCEPTION_0_GSON_MALFORMED_EXCEPTION, - HandlerCategory.NONIDEMPOTENT, - ExpectRetry.NO, - Behavior.SAME)) - .build(); - } -} 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 deleted file mode 100644 index 738832ef3c..0000000000 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/PackagePrivateMethodWorkarounds.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage; - -import com.google.api.services.storage.model.StorageObject; -import com.google.cloud.WriteChannel; -import com.google.cloud.storage.BucketInfo.BuilderImpl; -import java.util.Optional; -import java.util.function.Function; - -/** - * Several classes in the High Level Model for storage include package-local constructors and - * methods. For conformance testing we don't want to exist in the com.google.cloud.storage package - * to ensure we're interacting with the public api, however in a few select cases we need to change - * the instance of {@link Storage} which an object holds on to. The utilities in this class allow us - * to perform these operations. - */ -public final class PackagePrivateMethodWorkarounds { - - private PackagePrivateMethodWorkarounds() {} - - public static Bucket bucketCopyWithStorage(Bucket b, Storage s) { - BucketInfo.BuilderImpl builder = (BuilderImpl) BucketInfo.fromPb(b.toPb()).toBuilder(); - return new Bucket(s, builder); - } - - public static Blob blobCopyWithStorage(Blob b, Storage s) { - BlobInfo.BuilderImpl builder = (BlobInfo.BuilderImpl) BlobInfo.fromPb(b.toPb()).toBuilder(); - return new Blob(s, builder); - } - - public static Function> maybeGetStorageObjectFunction() { - return (w) -> { - if (w instanceof BlobWriteChannel) { - BlobWriteChannel blobWriteChannel = (BlobWriteChannel) w; - return Optional.of(blobWriteChannel.getStorageObject()); - } else { - return Optional.empty(); - } - }; - } -} diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/PolicyHelperTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/PolicyHelperTest.java index a34538c11b..dd5c0f78a6 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/PolicyHelperTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/PolicyHelperTest.java @@ -65,15 +65,11 @@ public void testEquivalence() { assertTrue(new ApiPolicyMatcher(apiPolicy).matches(actualApiPolicy)); } - @Test + @Test(expected = IllegalStateException.class) public void testApiPolicyWithoutBinding() { List bindings = null; com.google.api.services.storage.model.Policy apiPolicy = - new com.google.api.services.storage.model.Policy() - .setBindings(bindings) - .setEtag(ETAG) - .setVersion(1); - Policy policy = PolicyHelper.convertFromApiPolicy(apiPolicy); - assertEquals(policy.getBindings().size(), 0); + new com.google.api.services.storage.model.Policy().setBindings(bindings).setEtag(ETAG); + PolicyHelper.convertFromApiPolicy(apiPolicy); } } diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/PostPolicyV4Test.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/PostPolicyV4Test.java index 6d7946cd88..8213f6093a 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/PostPolicyV4Test.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/PostPolicyV4Test.java @@ -17,6 +17,7 @@ package com.google.cloud.storage; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -32,7 +33,8 @@ public class PostPolicyV4Test { private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); - private void assertMapsEquals(Map expected, Map returned) { + private void assertNotSameButEqual(Map expected, Map returned) { + assertNotSame(expected, returned); assertEquals("map sizes", expected.size(), returned.size()); for (String key : expected.keySet()) { assertEquals("value of $" + key, expected.get(key), returned.get(key)); @@ -76,7 +78,7 @@ public void testPostPolicyV4_of() { String url = "http://example.com"; PostPolicyV4 policy = PostPolicyV4.of(url, ALL_FIELDS); assertEquals(url, policy.getUrl()); - assertMapsEquals(ALL_FIELDS, policy.getFields()); + assertNotSameButEqual(ALL_FIELDS, policy.getFields()); } @Test @@ -98,10 +100,34 @@ public void testPostPolicyV4_ofMalformedURL() { } } + @Test + public void testPostPolicyV4_ofInvalidField() { + Map fields = new HashMap<>(ALL_FIELDS); + fields.put("$file", "file.txt"); + try { + PostPolicyV4.of("http://google.com", fields); + fail(); + } catch (IllegalArgumentException e) { + assertEquals("Invalid key: $file", e.getMessage()); + } + } + @Test public void testPostFieldsV4_of() { PostPolicyV4.PostFieldsV4 fields = PostPolicyV4.PostFieldsV4.of(ALL_FIELDS); - assertMapsEquals(ALL_FIELDS, fields.getFieldsMap()); + assertNotSameButEqual(ALL_FIELDS, fields.getFieldsMap()); + } + + @Test + public void testPostFieldsV4_ofInvalidField() { + Map map = new HashMap<>(); + map.put("$file", "file.txt"); + try { + PostPolicyV4.PostFieldsV4.of(map); + fail(); + } catch (IllegalArgumentException e) { + assertEquals("Invalid key: $file", e.getMessage()); + } } @Test @@ -131,7 +157,7 @@ public void testPostPolicyV4_builder() { expectedUpdated.put("content-type", "new-content-type"); expectedUpdated.put("success_action_status", "42"); Map updated = builder.build().getFieldsMap(); - assertMapsEquals(expectedUpdated, updated); + assertNotSameButEqual(expectedUpdated, updated); } @Test diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/ResumableMediaTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/ResumableMediaTest.java deleted file mode 100644 index d6fc7d6741..0000000000 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/ResumableMediaTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage; - -import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertNotNull; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -import com.google.cloud.BaseService; -import com.google.cloud.ExceptionHandler; -import com.google.cloud.storage.spi.v1.StorageRpc; -import java.net.URL; -import java.util.function.Supplier; -import org.junit.Assert; -import org.junit.Test; - -public final class ResumableMediaTest { - private static final String SIGNED_URL_INVALID = - "http://localhost/test-bucket/test1.txt?GoogAccessId=testClient-test@test.com&Expires=1553839761&Signature=MJUBXAZ7"; - private static final String SIGNED_URL_VALID = - "http://localhost/test-bucket/test1.txt?GoogleAccessId=testClient-test@test.com&Expires=1553839761&Signature=MJUBXAZ7"; - - private final ExceptionHandler createResultExceptionHandler = BaseService.EXCEPTION_HANDLER; - - @Test - public void startUploadForSignedUrl_expectStorageException_whenUrlInvalid() throws Exception { - try { - ResumableMedia.startUploadForSignedUrl( - StorageOptions.newBuilder().build(), - new URL(SIGNED_URL_INVALID), - createResultExceptionHandler) - .get(); - Assert.fail(); - } catch (StorageException ex) { - assertNotNull(ex.getMessage()); - } - } - - @Test - public void startUploadForSignedUrl_whenUrlValid() throws Exception { - StorageRpc rpc = mock(StorageRpc.class); - StorageOptions options = StorageOptions.newBuilder().setServiceRpcFactory(opts -> rpc).build(); - - URL url = new URL(SIGNED_URL_VALID); - when(rpc.open(url.toString())).thenReturn("upload-id"); - - Supplier uploadIdSupplier = - ResumableMedia.startUploadForSignedUrl(options, url, createResultExceptionHandler); - assertThat(uploadIdSupplier.get()).isEqualTo("upload-id"); - } -} diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/SerializationTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/SerializationTest.java index 002380f7f7..ae49f13f05 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/SerializationTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/SerializationTest.java @@ -16,7 +16,6 @@ package com.google.cloud.storage; -import com.google.api.gax.retrying.ResultRetryAlgorithm; import com.google.cloud.BaseSerializationTest; import com.google.cloud.NoCredentials; import com.google.cloud.PageImpl; @@ -100,14 +99,12 @@ protected Serializable[] serializableObjects() { @Override protected Restorable[] restorableObjects() { StorageOptions options = StorageOptions.newBuilder().setProjectId("p2").build(); - ResultRetryAlgorithm algorithm = - options.getRetryAlgorithmManager().getForResumableUploadSessionWrite(EMPTY_RPC_OPTIONS); ReadChannel reader = new BlobReadChannel(options, BlobId.of("b", "n"), EMPTY_RPC_OPTIONS); // avoid closing when you don't want partial writes to GCS upon failure @SuppressWarnings("resource") BlobWriteChannel writer = new BlobWriteChannel( - options, BlobInfo.newBuilder(BlobId.of("b", "n")).build(), "upload-id", algorithm); + options, BlobInfo.newBuilder(BlobId.of("b", "n")).build(), "upload-id"); return new Restorable[] {reader, writer}; } } diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageBatchTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageBatchTest.java index 978cffe0c6..3943e1409f 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageBatchTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageBatchTest.java @@ -54,8 +54,6 @@ public class StorageBatchTest { BlobTargetOption.generationMatch(), BlobTargetOption.metagenerationMatch() }; private static final GoogleJsonError GOOGLE_JSON_ERROR = new GoogleJsonError(); - private final RetryAlgorithmManager retryAlgorithmManager = - StorageOptions.getDefaultInstance().getRetryAlgorithmManager(); private StorageOptions optionsMock; private StorageRpc storageRpcMock; @@ -69,9 +67,6 @@ public void setUp() { storageRpcMock = EasyMock.createMock(StorageRpc.class); batchMock = EasyMock.createMock(RpcBatch.class); EasyMock.expect(optionsMock.getStorageRpcV1()).andReturn(storageRpcMock); - EasyMock.expect(optionsMock.getRetryAlgorithmManager()) - .andReturn(retryAlgorithmManager) - .anyTimes(); EasyMock.expect(storageRpcMock.createBatch()).andReturn(batchMock); EasyMock.replay(optionsMock, storageRpcMock, batchMock, storage); storageBatch = new StorageBatch(optionsMock); @@ -170,11 +165,8 @@ public void testUpdate() { @Test public void testUpdateWithOptions() { EasyMock.reset(storage, batchMock, optionsMock); - EasyMock.expect(storage.getOptions()).andReturn(optionsMock).anyTimes(); - EasyMock.expect(optionsMock.getService()).andReturn(storage).anyTimes(); - EasyMock.expect(optionsMock.getRetryAlgorithmManager()) - .andReturn(retryAlgorithmManager) - .anyTimes(); + EasyMock.expect(storage.getOptions()).andReturn(optionsMock).times(2); + EasyMock.expect(optionsMock.getService()).andReturn(storage); Capture> callback = Capture.newInstance(); Capture> capturedOptions = Capture.newInstance(); batchMock.addPatch( @@ -224,11 +216,8 @@ public void testGet() { @Test public void testGetWithOptions() { EasyMock.reset(storage, batchMock, optionsMock); - EasyMock.expect(storage.getOptions()).andReturn(optionsMock).anyTimes(); - EasyMock.expect(optionsMock.getService()).andReturn(storage).anyTimes(); - EasyMock.expect(optionsMock.getRetryAlgorithmManager()) - .andReturn(retryAlgorithmManager) - .anyTimes(); + EasyMock.expect(storage.getOptions()).andReturn(optionsMock).times(2); + EasyMock.expect(optionsMock.getService()).andReturn(storage); Capture> callback = Capture.newInstance(); Capture> capturedOptions = Capture.newInstance(); batchMock.addGet( diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageImplMockitoTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageImplMockitoTest.java index e69e3fe091..aa1b78a8d3 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageImplMockitoTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageImplMockitoTest.java @@ -36,7 +36,6 @@ import com.google.cloud.ServiceOptions; import com.google.cloud.Tuple; import com.google.cloud.WriteChannel; -import com.google.cloud.storage.Storage.BlobTargetOption; import com.google.cloud.storage.spi.StorageRpcFactory; import com.google.cloud.storage.spi.v1.StorageRpc; import com.google.common.collect.ImmutableList; @@ -123,8 +122,6 @@ public class StorageImplMockitoTest { // Empty StorageRpc options private static final Map EMPTY_RPC_OPTIONS = ImmutableMap.of(); - private static final Map BLOB_INFO1_RPC_OPTIONS_WITH_GENERATION = - ImmutableMap.of(StorageRpc.Option.IF_GENERATION_MATCH, 24L); // Bucket target options private static final Storage.BucketTargetOption BUCKET_TARGET_METAGENERATION = @@ -761,10 +758,7 @@ public void testCreateBlobRetry() throws IOException { .doReturn(BLOB_INFO1.toPb()) .doThrow(UNEXPECTED_CALL_EXCEPTION) .when(storageRpcMock) - .create( - Mockito.eq(storageObject), - capturedStream.capture(), - Mockito.eq(BLOB_INFO1_RPC_OPTIONS_WITH_GENERATION)); + .create(Mockito.eq(storageObject), capturedStream.capture(), Mockito.eq(EMPTY_RPC_OPTIONS)); storage = options @@ -774,7 +768,7 @@ public void testCreateBlobRetry() throws IOException { .getService(); initializeServiceDependentObjects(); - Blob blob = storage.create(BLOB_INFO1, BLOB_CONTENT, BlobTargetOption.generationMatch()); + Blob blob = storage.create(BLOB_INFO1, BLOB_CONTENT); assertEquals(expectedBlob1, blob); diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageImplTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageImplTest.java index 5619e5f7b9..590fe37af9 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageImplTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageImplTest.java @@ -38,6 +38,7 @@ import com.google.cloud.Identity; import com.google.cloud.Policy; import com.google.cloud.ServiceOptions; +import com.google.cloud.WriteChannel; import com.google.cloud.storage.Acl.Project; import com.google.cloud.storage.Acl.Project.ProjectRole; import com.google.cloud.storage.Acl.Role; @@ -54,6 +55,7 @@ import com.google.common.collect.ImmutableMap; import com.google.common.io.BaseEncoding; import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; import java.net.URL; import java.net.URLDecoder; import java.security.InvalidKeyException; @@ -2146,6 +2148,16 @@ public void testRuntimeException() { } } + @Test + public void testWriterWithSignedURL() throws MalformedURLException { + EasyMock.expect(storageRpcMock.open(SIGNED_URL)).andReturn("upload-id"); + EasyMock.replay(storageRpcMock); + initializeService(); + WriteChannel writer = new BlobWriteChannel(options, new URL(SIGNED_URL)); + assertNotNull(writer); + assertTrue(writer.isOpen()); + } + @Test public void testV4PostPolicy() { EasyMock.replay(storageRpcMock); diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageOptionsTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageOptionsTest.java index 5c9c708c10..18ff0343c5 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageOptionsTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageOptionsTest.java @@ -16,8 +16,6 @@ package com.google.cloud.storage; -import static com.google.common.truth.Truth.assertThat; - import com.google.cloud.TransportOptions; import org.easymock.EasyMock; import org.junit.Assert; @@ -35,34 +33,4 @@ public void testInvalidTransport() { Assert.assertNotNull(ex.getMessage()); } } - - @Test - public void testConfigureHostShouldBeKeptOnToBuilder() { - StorageOptions opts1 = StorageOptions.newBuilder().setHost("custom-host").build(); - StorageOptions opts2 = opts1.toBuilder().build(); - - assertThat(opts2.getHost()).isEqualTo("custom-host"); - } - - @Test - public void testToBuilderShouldSpecifyDefaultIfNotOtherwiseSet() { - StorageOptions opts1 = StorageOptions.newBuilder().build(); - StorageOptions opts2 = opts1.toBuilder().build(); - - assertThat(opts2.getHost()).isEqualTo("https://storage.googleapis.com"); - } - - @Test - public void testNewBuilderSpecifiesCorrectHost() { - StorageOptions opts1 = StorageOptions.newBuilder().build(); - - assertThat(opts1.getHost()).isEqualTo("https://storage.googleapis.com"); - } - - @Test - public void testDefaultInstanceSpecifiesCorrectHost() { - StorageOptions opts1 = StorageOptions.getDefaultInstance(); - - assertThat(opts1.getHost()).isEqualTo("https://storage.googleapis.com"); - } } diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/V4PostPolicyTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/V4PostPolicyTest.java index fc7f59f921..161fb36404 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/V4PostPolicyTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/V4PostPolicyTest.java @@ -28,6 +28,7 @@ import com.google.cloud.conformance.storage.v1.UrlStyle; import com.google.cloud.storage.testing.RemoteStorageHelper; import com.google.common.base.Charsets; +import com.google.common.base.Strings; import com.google.common.io.BaseEncoding; import com.google.protobuf.Timestamp; import com.google.protobuf.util.JsonFormat; @@ -116,6 +117,17 @@ public void test() { PolicyConditions conditions = policyInput.getConditions(); + if (!Strings.isNullOrEmpty(fields.get("success_action_redirect"))) { + builder.addSuccessActionRedirectUrlCondition( + PostPolicyV4.ConditionV4Type.MATCHES, fields.get("success_action_redirect")); + } + + if (!Strings.isNullOrEmpty(fields.get("success_action_status"))) { + builder.addSuccessActionStatusCondition( + PostPolicyV4.ConditionV4Type.MATCHES, + Integer.parseInt(fields.get("success_action_status"))); + } + if (conditions != null) { if (!conditions.getStartsWithList().isEmpty()) { builder.addCustomCondition( @@ -154,25 +166,17 @@ public void test() { style); String expectedPolicy = testData.getPolicyOutput().getExpectedDecodedPolicy(); - StringBuilder escapedPolicy = new StringBuilder(); // Java automatically unescapes the unicode escapes in the conformance tests, so we need to // manually re-escape them - char[] expectedPolicyArray = expectedPolicy.toCharArray(); - for (int i = 0; i < expectedPolicyArray.length; i++) { - char c = expectedPolicyArray[i]; + for (char c : expectedPolicy.toCharArray()) { if (c >= 128) { escapedPolicy.append(String.format("\\u%04x", (int) c)); } else { switch (c) { case '\\': - // quotes aren't unescaped, so leave any "\"" found alone - if (expectedPolicyArray[i + 1] == '"') { - escapedPolicy.append("\\"); - } else { - escapedPolicy.append("\\\\"); - } + escapedPolicy.append("\\\\"); break; case '\b': escapedPolicy.append("\\b"); @@ -198,7 +202,6 @@ public void test() { } } assertEquals(testData.getPolicyOutput().getFieldsMap(), policy.getFields()); - assertEquals( escapedPolicy.toString(), new String(BaseEncoding.base64().decode(policy.getFields().get("policy")))); diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/CleanupStrategy.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/CleanupStrategy.java deleted file mode 100644 index 60185dff1b..0000000000 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/CleanupStrategy.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage.conformance.retry; - -public enum CleanupStrategy { - ALWAYS, - ONLY_ON_SUCCESS, - NEVER -} diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/Ctx.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/Ctx.java deleted file mode 100644 index fa24be23c4..0000000000 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/Ctx.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage.conformance.retry; - -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.conformance.retry.Functions.EConsumer; -import com.google.cloud.storage.conformance.retry.Functions.EFunction; -import com.google.errorprone.annotations.Immutable; - -/** - * A simple context object used to track an instance of {@link Storage} along with {@link State} and - * provide some convenience methods for creating new instances. - */ -@Immutable -final class Ctx { - - private final Storage storage; - private final State state; - - private Ctx(Storage s, State t) { - this.storage = s; - this.state = t; - } - - /** Create a new instance of {@link Ctx} */ - static Ctx ctx(Storage storage, State state) { - return new Ctx(storage, state); - } - - public Storage getStorage() { - return storage; - } - - public State getState() { - return state; - } - - /** - * Create a new instance of {@link Ctx} by first applying {@code f} to {@code this.storage}. - * {@code this.state} is passed along unchanged. - */ - public Ctx leftMap(EFunction f) throws Throwable { - return new Ctx(f.apply(storage), state); - } - - /** - * Create a new instance of {@link Ctx} by first applying {@code f} to {@code this.state}. {@code - * this.storage} is passed along unchanged. - */ - public Ctx map(EFunction f) throws Throwable { - return new Ctx(storage, f.apply(state)); - } - - /** - * Apply {@code f} by providing {@code this.state}. - * - *

This method is provided as convenience for those methods which have void return. In general - * {@link Ctx#map(EFunction)} should be used. - */ - public Ctx peek(EConsumer f) throws Throwable { - f.consume(state); - return this; - } -} diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/CtxFunctions.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/CtxFunctions.java deleted file mode 100644 index 5e8e04fce2..0000000000 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/CtxFunctions.java +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage.conformance.retry; - -import static com.google.common.collect.Sets.newHashSet; - -import com.google.api.gax.paging.Page; -import com.google.cloud.conformance.storage.v1.Resource; -import com.google.cloud.storage.Acl; -import com.google.cloud.storage.Acl.Role; -import com.google.cloud.storage.Acl.User; -import com.google.cloud.storage.Blob; -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.BlobInfo; -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.BucketInfo; -import com.google.cloud.storage.HmacKey; -import com.google.cloud.storage.HmacKey.HmacKeyMetadata; -import com.google.cloud.storage.HmacKey.HmacKeyState; -import com.google.cloud.storage.ServiceAccount; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.Storage.BlobTargetOption; -import com.google.cloud.storage.Storage.ComposeRequest; -import com.google.cloud.storage.conformance.retry.Functions.CtxFunction; -import com.google.common.base.Joiner; -import java.util.HashSet; - -/** - * Define a set of {@link CtxFunction} which are used in mappings as well as general setup/tear down - * of specific tests. - * - *

Functions are grouped into nested classes which try to hint at the area they operate within. - * Client side-only, or performing an RPC, setup or tear down and so on. - * - * @see RpcMethodMapping - * @see RpcMethodMapping.Builder - * @see RpcMethodMappings - */ -final class CtxFunctions { - - static final class Local { - - /** - * Populate a copy destination for the state present in the ctx. - * - * @see State#getCopyDest() - */ - static final CtxFunction blobCopy = - (ctx, c) -> ctx.map(s -> s.withCopyDest(BlobId.of(c.getBucketName2(), c.getObjectName()))); - - /** - * Populate a bucket info for the state present in the ctx. - * - *

this is primarily useful in the case when you want to insert a bucket during the test - * - * @see State#getBucketInfo() - */ - static final CtxFunction bucketInfo = - (ctx, c) -> ctx.map(s -> s.with(BucketInfo.of(c.getBucketName()))); - /** - * Populate a compose request for the state present in the ctx. - * - * @see State#getComposeRequest() - */ - static final CtxFunction composeRequest = - (ctx, c) -> - ctx.map( - state -> { - Blob blob = state.getBlob(); - String bucket = blob.getBucket(); - final BlobInfo target; - if (c.isPreconditionsProvided()) { - target = BlobInfo.newBuilder(BlobId.of(bucket, "blob-full", 0L)).build(); - } else { - target = BlobInfo.newBuilder(BlobId.of(bucket, "blob-full")).build(); - } - ComposeRequest.Builder builder = - ComposeRequest.newBuilder() - // source bucket is resolved from the target, as compose must be within - // the same bucket - .addSource(blob.getName(), blob.getGeneration()) - .addSource(blob.getName(), blob.getGeneration()) - .setTarget(target); - if (c.isPreconditionsProvided()) { - builder = builder.setTargetOptions(BlobTargetOption.generationMatch()); - } - ComposeRequest r = builder.build(); - return state.with(r); - }); - - private static final CtxFunction blobIdAndBlobInfo = - (ctx, c) -> ctx.map(state -> state.with(BlobInfo.newBuilder(state.getBlobId()).build())); - private static final CtxFunction blobIdWithoutGeneration = - (ctx, c) -> ctx.map(s -> s.with(BlobId.of(c.getBucketName(), c.getObjectName()))); - private static final CtxFunction blobIdWithGenerationZero = - (ctx, c) -> ctx.map(s -> s.with(BlobId.of(c.getBucketName(), c.getObjectName(), 0L))); - /** - * Populate a blobId and blob info for the state present in the ctx which specifies a null - * generation. Use when a generation value shouldn't be part of a request or other evaluation. - * - * @see State#getBlobId() - * @see State#getBlobInfo() - */ - static final CtxFunction blobInfoWithoutGeneration = - blobIdWithoutGeneration.andThen(blobIdAndBlobInfo); - /** - * Populate a blobId and blob info for the state present in the ctx which specifies a generation - * of 0 (zero). - * - * @see State#getBlobId() - * @see State#getBlobInfo() - */ - static final CtxFunction blobInfoWithGenerationZero = - blobIdWithGenerationZero.andThen(blobIdAndBlobInfo); - } - - static final class Rpc { - static final CtxFunction createEmptyBlob = - (ctx, c) -> ctx.map(state -> state.with(ctx.getStorage().create(state.getBlobInfo()))); - } - - static final class ResourceSetup { - private static final CtxFunction bucket = - (ctx, c) -> { - BucketInfo bucketInfo = BucketInfo.newBuilder(c.getBucketName()).build(); - Bucket resolvedBucket = ctx.getStorage().create(bucketInfo); - return ctx.map(s -> s.with(resolvedBucket)); - }; - /** - * Create a new object in the {@link State#getBucket()} and populate a blobId, blob info and - * blob for the state present in the ctx. - * - *

This method will issue an RPC. - * - * @see State#getBlob() - * @see State#getBlobId() - * @see State#getBlobInfo() - */ - static final CtxFunction object = - (ctx, c) -> { - BlobInfo blobInfo = - BlobInfo.newBuilder(ctx.getState().getBucket().getName(), c.getObjectName()).build(); - Blob resolvedBlob = ctx.getStorage().create(blobInfo, c.getHelloWorldUtf8Bytes()); - return ctx.map( - s -> - s.with(resolvedBlob) - .with((BlobInfo) resolvedBlob) - .with(resolvedBlob.getBlobId())); - }; - - static final CtxFunction serviceAccount = - (ctx, c) -> - ctx.map(s -> s.with(ServiceAccount.of(c.getServiceAccountSigner().getAccount()))); - private static final CtxFunction hmacKey = - (ctx, c) -> - ctx.map( - s -> { - HmacKey hmacKey1 = ctx.getStorage().createHmacKey(s.getServiceAccount()); - return s.withHmacKey(hmacKey1).with(hmacKey1.getMetadata()); - }); - - private static final CtxFunction processResources = - (ctx, c) -> { - HashSet resources = newHashSet(c.getMethod().getResourcesList()); - CtxFunction f = CtxFunction.identity(); - if (resources.contains(Resource.BUCKET)) { - f = f.andThen(ResourceSetup.bucket); - resources.remove(Resource.BUCKET); - } - - if (resources.contains(Resource.OBJECT)) { - f = f.andThen(ResourceSetup.object); - resources.remove(Resource.OBJECT); - } - - if (resources.contains(Resource.HMAC_KEY)) { - f = f.andThen(serviceAccount).andThen(hmacKey); - resources.remove(Resource.HMAC_KEY); - } - - if (!resources.isEmpty()) { - throw new IllegalStateException( - String.format("Unhandled Method Resource [%s]", Joiner.on(", ").join(resources))); - } - - return f.apply(ctx, c); - }; - - private static final CtxFunction allUsersReaderAcl = - (ctx, c) -> ctx.map(s -> s.with(Acl.of(User.ofAllUsers(), Role.READER))); - - static final CtxFunction defaultSetup = processResources.andThen(allUsersReaderAcl); - } - - static final class ResourceTeardown { - private static final CtxFunction deleteAllObjects = - (ctx, c) -> - ctx.map( - s -> { - Storage storage = ctx.getStorage(); - deleteBucket(storage, c.getBucketName()); - deleteBucket(storage, c.getBucketName2()); - State newState = - s.with((Blob) null) - .with((BlobInfo) null) - .with((BlobId) null) - .with((Bucket) null); - - if (s.hasHmacKeyMetadata()) { - HmacKeyMetadata metadata = s.getHmacKeyMetadata(); - if (metadata.getState() == HmacKeyState.ACTIVE) { - metadata = storage.updateHmacKeyState(metadata, HmacKeyState.INACTIVE); - } - storage.deleteHmacKey(metadata); - newState.with((HmacKeyMetadata) null).withHmacKey(null); - } - - return newState; - }); - - static final CtxFunction defaultTeardown = deleteAllObjects; - - private static void deleteBucket(Storage storage, String bucketName) { - Bucket bucket = storage.get(bucketName); - if (bucket != null) { - emptyBucket(storage, bucketName); - bucket.delete(); - } - } - - private static void emptyBucket(Storage storage, String bucketName) { - Page blobs = storage.list(bucketName); - for (Blob blob : blobs.iterateAll()) { - blob.delete(); - } - } - } -} diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/Functions.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/Functions.java deleted file mode 100644 index 46d5643e0b..0000000000 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/Functions.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage.conformance.retry; - -/** - * A set of Functional interface types which are used in Retry Conformance tests. - * - *

All functions allow checked exceptions to be thrown, whereas their siblings in {@code - * java.util.function} do not. - */ -final class Functions { - - /** - * A specialized BiFunction which cuts down on boilerplate and provides an {@link - * CtxFunction#andThen(CtxFunction) andThen} which carries through the BiFunction-ness. - */ - @FunctionalInterface - interface CtxFunction { - - Ctx apply(Ctx ctx, TestRetryConformance trc) throws Throwable; - - default CtxFunction andThen(CtxFunction f) { - return (Ctx ctx, TestRetryConformance trc) -> f.apply(apply(ctx, trc), trc); - } - - static CtxFunction identity() { - return (ctx, c) -> ctx; - } - } - - /** - * Define a Function which can throw, this simplifies the code where a checked exception is - * declared. These Functions only exist in the context of tests so if a throw happens it will be - * handled at a per-test level. - */ - @FunctionalInterface - interface EFunction { - B apply(A a) throws Throwable; - } - - /** - * Define a Consumer which can throw, this simplifies the code where a checked exception is - * declared. These Consumers only exist in the context of tests so if a throw happens it will be - * handled at a per-test level. - */ - @FunctionalInterface - interface EConsumer { - void consume(A a) throws Throwable; - } -} diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/GracefulConformanceEnforcement.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/GracefulConformanceEnforcement.java deleted file mode 100644 index 7d792c423d..0000000000 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/GracefulConformanceEnforcement.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage.conformance.retry; - -import static org.junit.Assert.assertNotNull; - -import com.google.common.collect.ImmutableSet; -import com.google.common.io.CharStreams; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.Set; -import org.junit.AssumptionViolatedException; -import org.junit.rules.TestRule; -import org.junit.runner.Description; -import org.junit.runners.model.Statement; - -/** - * As the adherence of {@link com.google.cloud.storage.Storage} to the retry conformance test suite - * is an ongoing effort, we need a way in which those tests which are not yet in compliance do not - * serve as blockers for other features and commits. - * - *

This class provides a transparent means of enforcing the reporting of failed tests when ran in - * a CI environment. When a test is run, if it fails for any reason the test name will be checked - * against an allow list of known failing tests. If the tests name is present in the allow list, - * then the failure will be wrapped in an assumption failure to show up as a skipped test rather - * than a failed one. - */ -final class GracefulConformanceEnforcement implements TestRule { - - private final String testName; - private final Set testNamesWhichCanFail; - - public GracefulConformanceEnforcement(String testName) { - this.testName = testName; - this.testNamesWhichCanFail = loadTestNamesWhichCanFail(); - } - - @Override - public Statement apply(Statement base, Description description) { - return new Statement() { - @Override - public void evaluate() throws Throwable { - try { - base.evaluate(); - } catch (AssumptionViolatedException e) { - // pass through any assumption/ignore errors as they are - throw e; - } catch (Throwable t) { - if (!testNamesWhichCanFail.contains(testName)) { - throw t; - } else { - if (isRunningInCI()) { - throw new AssumptionViolatedException( - String.format( - "Test %s is allowed to fail, downgrading failure to ignored.", testName), - t); - } else { - throw t; - } - } - } - } - }; - } - - private static boolean isRunningInCI() { - return "test".equals(System.getenv("JOB_TYPE")) - || "integration".equals(System.getenv("JOB_TYPE")); - } - - private static Set loadTestNamesWhichCanFail() { - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - InputStream inputStream = - cl.getResourceAsStream( - "com/google/cloud/storage/conformance/retry/testNamesWhichCanFail.txt"); - assertNotNull(inputStream); - try { - return CharStreams.readLines(new InputStreamReader(inputStream)).stream() - .map(String::trim) - .filter(s -> !s.isEmpty() && !s.startsWith("#")) - .collect(ImmutableSet.toImmutableSet()); - } catch (IOException e) { - throw new RuntimeException(e); - } finally { - try { - inputStream.close(); - } catch (IOException ignore) { - } - } - } -} diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ITRetryConformanceTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ITRetryConformanceTest.java deleted file mode 100644 index cacc0d5574..0000000000 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ITRetryConformanceTest.java +++ /dev/null @@ -1,471 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage.conformance.retry; - -import static com.google.cloud.storage.PackagePrivateMethodWorkarounds.blobCopyWithStorage; -import static com.google.cloud.storage.PackagePrivateMethodWorkarounds.bucketCopyWithStorage; -import static com.google.cloud.storage.conformance.retry.Ctx.ctx; -import static com.google.cloud.storage.conformance.retry.State.empty; -import static com.google.common.truth.Truth.assertThat; -import static java.util.Objects.requireNonNull; -import static org.junit.Assert.assertNotNull; - -import com.google.cloud.conformance.storage.v1.InstructionList; -import com.google.cloud.conformance.storage.v1.Method; -import com.google.cloud.conformance.storage.v1.RetryTest; -import com.google.cloud.conformance.storage.v1.RetryTests; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.conformance.retry.Functions.CtxFunction; -import com.google.common.base.Charsets; -import com.google.common.base.Joiner; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableSet; -import com.google.protobuf.util.JsonFormat; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.math.BigInteger; -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.Random; -import java.util.Set; -import java.util.function.BiPredicate; -import java.util.logging.Logger; -import java.util.stream.Collectors; -import org.junit.After; -import org.junit.AssumptionViolatedException; -import org.junit.Before; -import org.junit.ClassRule; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized.Parameters; - -/** - * Load and dynamically generate a series of test cases to verify if the {@link Storage} and - * associated high level classes adhere to expected retry behavior. - * - *

This class dynamically generates test cases based on resources from the - * google-cloud-conformance-tests artifact and a set of defined mappings from {@link - * RpcMethodMappings}. - */ -@RunWith(ParallelParameterized.class) -public class ITRetryConformanceTest { - private static final Logger LOGGER = Logger.getLogger(ITRetryConformanceTest.class.getName()); - - @ClassRule public static final TestBench TEST_BENCH = TestBench.newBuilder().build(); - - @Rule(order = 1) - public final GracefulConformanceEnforcement gracefulConformanceEnforcement; - - @Rule(order = 2) - public final RetryTestFixture retryTestFixture; - - private final TestRetryConformance testRetryConformance; - private final RpcMethodMapping mapping; - private Storage nonTestStorage; - private Storage testStorage; - private Ctx ctx; - - public ITRetryConformanceTest( - TestRetryConformance testRetryConformance, RpcMethodMapping mapping) { - this.testRetryConformance = testRetryConformance; - this.mapping = mapping; - this.gracefulConformanceEnforcement = - new GracefulConformanceEnforcement(testRetryConformance.getTestName()); - this.retryTestFixture = - new RetryTestFixture(CleanupStrategy.ALWAYS, TEST_BENCH, testRetryConformance); - } - - @Before - public void setUp() throws Throwable { - LOGGER.fine("Running setup..."); - nonTestStorage = retryTestFixture.getNonTestStorage(); - testStorage = retryTestFixture.getTestStorage(); - // it's important to keep these two ctx assignments separate to allow for teardown to work in - // the case setup fails for some reason - ctx = ctx(nonTestStorage, empty()); - ctx = mapping.getSetup().apply(ctx, testRetryConformance).leftMap(s -> testStorage); - LOGGER.fine("Running setup complete"); - } - - @After - public void tearDown() throws Throwable { - LOGGER.fine("Running teardown..."); - getReplaceStorageInObjectsFromCtx() - .andThen(mapping.getTearDown()) - .apply(ctx, testRetryConformance); - LOGGER.fine("Running teardown complete"); - } - - /** - * Run an individual test case. 1. Create two storage clients, one for setup/teardown and one for - * test execution 2. Run setup 3. Run test 4. Run teardown - */ - @Test - public void test() throws Throwable { - LOGGER.fine("Running test..."); - ctx = - getReplaceStorageInObjectsFromCtx() - .andThen(mapping.getTest()) - .apply(ctx, testRetryConformance) - .leftMap(s -> nonTestStorage); - LOGGER.fine("Running test complete"); - } - - /** - * Load all of the tests and return a {@code Collection} representing the set of tests. - * Each entry in the returned collection is the set of parameters to the constructor of this test - * class. - * - *

The results of this method will then be run by JUnit's Parameterized test runner - */ - @Parameters(name = "{0}") - public static Collection testCases() throws IOException { - RetryTestCaseResolver resolver = - RetryTestCaseResolver.newBuilder() - .setRetryTestsJsonResourcePath( - "com/google/cloud/conformance/storage/v1/retry_tests.json") - .setMappings(new RpcMethodMappings()) - .setProjectId("conformance-tests") - .setHost(TEST_BENCH.getBaseUri().replaceAll("https?://", "")) - .setTestAllowFilter(RetryTestCaseResolver.includeAll()) - .build(); - - List retryTestCases = resolver.getRetryTestCases(); - assertThat(retryTestCases).isNotEmpty(); - return retryTestCases.stream() - .map(rtc -> new Object[] {rtc.testRetryConformance, rtc.rpcMethodMapping}) - .collect(ImmutableList.toImmutableList()); - } - - /** - * When a "higher level object" ({@link com.google.cloud.storage.Bucket}, {@link - * com.google.cloud.storage.Blob}, etc.) is created as part of setup it keeps a reference to the - * instance of {@link Storage} used to create it. When we run our tests we need the instance of - * {@link Storage} to be the instance with the headers to signal the retry test. - * - *

The function returned will inspect the {@link State} and create copies of any "higher level - * objects" which are present replacing the instance of {@link Storage} from the provided ctx. - */ - private static CtxFunction getReplaceStorageInObjectsFromCtx() { - return (ctx, c) -> { - State s = ctx.getState(); - if (s.hasBucket()) { - s = s.with(bucketCopyWithStorage(s.getBucket(), ctx.getStorage())); - } - if (s.hasBlob()) { - s = s.with(blobCopyWithStorage(s.getBlob(), ctx.getStorage())); - } - final State state = s; - return ctx.map(x -> state); - }; - } - - /** - * Helper class which encapsulates all the logic necessary to resolve and crete a test case for - * each defined scenario from google-cloud-conformance-tests and our defined {@link - * RpcMethodMappings}. - */ - private static final class RetryTestCaseResolver { - private static final String HEX_SHUFFLE_SEED_OVERRIDE = - System.getProperty("HEX_SHUFFLE_SEED_OVERRIDE"); - - private final String retryTestsJsonResourcePath; - private final RpcMethodMappings mappings; - private final BiPredicate testAllowFilter; - private final Random rand; - private final String host; - private final String projectId; - - RetryTestCaseResolver( - String retryTestsJsonResourcePath, - RpcMethodMappings mappings, - BiPredicate testAllowFilter, - Random rand, - String host, - String projectId) { - this.retryTestsJsonResourcePath = retryTestsJsonResourcePath; - this.mappings = mappings; - this.testAllowFilter = testAllowFilter; - this.rand = rand; - this.host = host; - this.projectId = projectId; - } - - /** Load, permute and generate all RetryTestCases which are to be run in this suite */ - List getRetryTestCases() throws IOException { - RetryTests retryTests = loadRetryTestsDefinition(); - - // sort the defined RetryTest by id, so we have a stable ordering while generating cases. - List retryTestCases = - retryTests.getRetryTestsList().stream() - .sorted(Comparator.comparingInt(RetryTest::getId)) - .collect(Collectors.toList()); - - List testCases = generateTestCases(mappings, retryTestCases); - - // Shuffle our test cases to ensure we don't have any between case ordering weirdness - Collections.shuffle(testCases, rand); - - validateGeneratedTestCases(mappings, testCases); - - return testCases; - } - - /** Load the defined scenarios from google-cloud-conformance-tests */ - private RetryTests loadRetryTestsDefinition() throws IOException { - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - - InputStream dataJson = cl.getResourceAsStream(retryTestsJsonResourcePath); - assertNotNull( - String.format("Unable to load test definition: %s", retryTestsJsonResourcePath), - dataJson); - - InputStreamReader reader = new InputStreamReader(dataJson, Charsets.UTF_8); - RetryTests.Builder testBuilder = RetryTests.newBuilder(); - JsonFormat.parser().merge(reader, testBuilder); - return testBuilder.build(); - } - - /** Permute the RetryTest, Instructions and methods with our mappings */ - private List generateTestCases( - RpcMethodMappings rpcMethodMappings, List retryTests) { - - List testCases = new ArrayList<>(); - for (RetryTest testCase : retryTests) { - for (InstructionList instructionList : testCase.getCasesList()) { - for (Method method : testCase.getMethodsList()) { - String methodName = method.getName(); - RpcMethod key = RpcMethod.storage.lookup.get(methodName); - assertNotNull( - String.format("Unable to resolve RpcMethod for value '%s'", methodName), key); - // get all RpcMethodMappings which are defined for key - List mappings = - rpcMethodMappings.get(key).stream() - .sorted(Comparator.comparingInt(RpcMethodMapping::getMappingId)) - .collect(Collectors.toList()); - // if we don't have any mappings defined for the provide key, generate a case that when - // run reports an ignored test. This is done for the sake of completeness and to be - // aware of a lack of mapping. - if (mappings.isEmpty()) { - TestRetryConformance testRetryConformance = - new TestRetryConformance( - projectId, - host, - testCase.getId(), - method, - instructionList, - testCase.getPreconditionProvided(), - false); - if (testAllowFilter.test(key, testRetryConformance)) { - testCases.add( - new RetryTestCase(testRetryConformance, RpcMethodMapping.notImplemented(key))); - } - } else { - for (RpcMethodMapping mapping : mappings) { - TestRetryConformance testRetryConformance = - new TestRetryConformance( - projectId, - host, - testCase.getId(), - method, - instructionList, - testCase.getPreconditionProvided(), - testCase.getExpectSuccess(), - mapping.getMappingId()); - // check that this case is allowed based on the provided filter - if (testAllowFilter.test(key, testRetryConformance)) { - // check that the defined mapping is applicable to the case we've resolved. - // Many mappings are conditionally valid and depend on the defined case. - if (mapping.getApplicable().test(testRetryConformance)) { - testCases.add(new RetryTestCase(testRetryConformance, mapping)); - } else { - // when the mapping is determined to not be applicable to this case, generate - // a synthetic mapping which will report as an ignored test. This is done for - // the sake of completeness. - RpcMethodMapping build = - mapping - .toBuilder() - .withSetup(CtxFunction.identity()) - .withTest( - (s, c) -> { - throw new AssumptionViolatedException( - "applicability predicate evaluated to false"); - }) - .withTearDown(CtxFunction.identity()) - .build(); - testCases.add(new RetryTestCase(testRetryConformance, build)); - } - } - } - } - } - } - } - return testCases; - } - - private void validateGeneratedTestCases( - RpcMethodMappings rpcMethodMappings, List data) { - Set unusedMappings = - rpcMethodMappings.differenceMappingIds( - data.stream() - .map(rtc -> rtc.testRetryConformance.getMappingId()) - .collect(Collectors.toSet())); - - if (!unusedMappings.isEmpty()) { - LOGGER.warning( - String.format( - "Declared but unused mappings with ids: [%s]", - Joiner.on(", ").join(unusedMappings))); - } - } - - static Builder newBuilder() { - return new Builder(); - } - - /** Filtering predicate in which all test cases will be included and run. */ - static BiPredicate includeAll() { - return (m, c) -> true; - } - - /** - * Filtering predicate in which only those test cases which match up to the specified {@code - * mappingIds} will be included and run. - */ - static BiPredicate specificMappings(int... mappingIds) { - ImmutableSet set = - Arrays.stream(mappingIds).boxed().collect(ImmutableSet.toImmutableSet()); - return (m, c) -> set.contains(c.getMappingId()); - } - - static final class Builder { - private String retryTestsJsonResourcePath; - private RpcMethodMappings mappings; - private String host; - private BiPredicate testAllowFilter; - private final Random rand; - private String projectId; - - public Builder() { - this.rand = resolveRand(); - } - - /** - * Set the resource path of where to resolve the retry_tests.json from - * google-cloud-conformance-tests - */ - public Builder setRetryTestsJsonResourcePath(String retryTestsJsonResourcePath) { - this.retryTestsJsonResourcePath = retryTestsJsonResourcePath; - return this; - } - - /** Set the defined mappings which are to be used in test generation */ - public Builder setMappings(RpcMethodMappings mappings) { - this.mappings = requireNonNull(mappings, "mappings must be non null"); - return this; - } - - /** Set the host string of where the testbench will be available during a test run */ - public Builder setHost(String host) { - this.host = host; - return this; - } - - public Builder setProjectId(String projectId) { - this.projectId = projectId; - return this; - } - - /** - * Set the allow filter for determining if a particular {@link RpcMethod} and {@link - * TestRetryConformance} should be included in the generated test suite. - */ - public Builder setTestAllowFilter( - BiPredicate testAllowFilter) { - this.testAllowFilter = requireNonNull(testAllowFilter, "testAllowFilter must be non null"); - return this; - } - - public RetryTestCaseResolver build() { - return new RetryTestCaseResolver( - requireNonNull( - retryTestsJsonResourcePath, "retryTestsJsonResourcePath must be non null"), - requireNonNull(mappings, "mappings must be non null"), - requireNonNull(testAllowFilter, "testAllowList must be non null"), - rand, - requireNonNull(host, "host must be non null"), - requireNonNull(projectId, "projectId must be non null")); - } - - /** - * As part of test generation and execution we are shuffling the order to ensure there is no - * ordering dependency between individual cases. Given this fact, we report the seed used for - * performing the shuffle. If an explicit seed is provided via environment variable that will - * take precedence. - */ - private static Random resolveRand() { - try { - long seed; - if (HEX_SHUFFLE_SEED_OVERRIDE != null) { - LOGGER.info( - "Shuffling test order using Random with override seed: " - + HEX_SHUFFLE_SEED_OVERRIDE); - seed = new BigInteger(HEX_SHUFFLE_SEED_OVERRIDE.replace("0x", ""), 16).longValue(); - } else { - seed = - SecureRandom.getInstanceStrong() - .longs(100) - .reduce((first, second) -> second) - .orElseThrow( - () -> { - throw new IllegalStateException("Unable to generate seed"); - }); - String msg = - String.format("Shuffling test order using Random with seed: 0x%016X", seed); - LOGGER.info(msg); - } - return new Random(seed); - } catch (NoSuchAlgorithmException e) { - throw new RuntimeException(e); - } - } - } - } - - /** - * Simple typed tuple class to bind together a {@link TestRetryConformance} and {@link - * RpcMethodMapping} during resolution. - */ - private static final class RetryTestCase { - private final TestRetryConformance testRetryConformance; - private final RpcMethodMapping rpcMethodMapping; - - RetryTestCase(TestRetryConformance testRetryConformance, RpcMethodMapping rpcMethodMapping) { - this.testRetryConformance = testRetryConformance; - this.rpcMethodMapping = rpcMethodMapping; - } - } -} diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ParallelParameterized.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ParallelParameterized.java deleted file mode 100644 index 4e7ae241c0..0000000000 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ParallelParameterized.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage.conformance.retry; - -import com.google.common.util.concurrent.ThreadFactoryBuilder; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Phaser; -import java.util.concurrent.ThreadFactory; -import java.util.logging.Logger; -import org.junit.runners.Parameterized; -import org.junit.runners.model.RunnerScheduler; - -/** - * Extends off the provided {@link Parameterized} runner provided by junit, only augmenting which - * scheduler is used so that tests can run in parallel by using a thread pool. - */ -public final class ParallelParameterized extends Parameterized { - - public ParallelParameterized(Class klass) throws Throwable { - super(klass); - this.setScheduler(new ParallelScheduler()); - } - - private static class ParallelScheduler implements RunnerScheduler { - private static final Logger LOGGER = Logger.getLogger(ParallelScheduler.class.getName()); - - private final Phaser childCounter; - private final ExecutorService executorService; - - private ParallelScheduler() { - ThreadFactory threadFactory = - new ThreadFactoryBuilder() - .setDaemon(true) - .setNameFormat("parallel-test-runner-%02d") - .build(); - // attempt to leave some space for the testbench server running alongside these tests - int coreCount = Runtime.getRuntime().availableProcessors(); - int threadCount = Math.max(1, coreCount) * 2; - LOGGER.info("Using up to " + threadCount + " threads to run tests."); - executorService = Executors.newFixedThreadPool(threadCount, threadFactory); - childCounter = new Phaser(); - } - - @Override - public void schedule(Runnable childStatement) { - childCounter.register(); - executorService.submit( - () -> { - try { - childStatement.run(); - } finally { - childCounter.arrive(); - } - }); - } - - @Override - public void finished() { - try { - childCounter.awaitAdvance(0); - } finally { - executorService.shutdownNow(); - } - } - } -} diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java deleted file mode 100644 index b324a57ea9..0000000000 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage.conformance.retry; - -import static org.junit.Assert.assertTrue; - -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.FixedHeaderProvider; -import com.google.cloud.NoCredentials; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import com.google.cloud.storage.conformance.retry.TestBench.RetryTestResource; -import com.google.common.collect.ImmutableMap; -import java.util.logging.Logger; -import org.junit.AssumptionViolatedException; -import org.junit.rules.TestRule; -import org.junit.runner.Description; -import org.junit.runners.model.Statement; - -/** - * A JUnit 4 {@link TestRule} which integrates with {@link TestBench} and {@link - * TestRetryConformance} to provide transparent lifecycle integration of setup/validation/cleanup of - * {@code /retry_test} resources. This rule expects to be bound as an {@link org.junit.Rule @Rule} - * field. - * - *

Provides pre-configured instances of {@link Storage} for setup/teardown & test. - */ -final class RetryTestFixture implements TestRule { - private static final Logger LOGGER = Logger.getLogger(RetryTestFixture.class.getName()); - - private final CleanupStrategy cleanupStrategy; - private final TestBench testBench; - private final TestRetryConformance testRetryConformance; - - private RetryTestResource retryTest; - private Storage nonTestStorage; - private Storage testStorage; - - RetryTestFixture( - CleanupStrategy cleanupStrategy, - TestBench testBench, - TestRetryConformance testRetryConformance) { - this.cleanupStrategy = cleanupStrategy; - this.testBench = testBench; - this.testRetryConformance = testRetryConformance; - } - - public Storage getNonTestStorage() { - if (nonTestStorage == null) { - this.nonTestStorage = newStorage(false); - } - return nonTestStorage; - } - - public Storage getTestStorage() { - if (testStorage == null) { - this.testStorage = newStorage(true); - } - return testStorage; - } - - @Override - public Statement apply(final Statement base, Description description) { - return new Statement() { - @Override - public void evaluate() throws Throwable { - boolean testSuccess = false; - boolean testSkipped = false; - try { - LOGGER.fine("Setting up retry_test resource..."); - RetryTestResource retryTestResource = - RetryTestResource.newRetryTestResource( - testRetryConformance.getMethod(), testRetryConformance.getInstruction()); - retryTest = testBench.createRetryTest(retryTestResource); - LOGGER.fine("Setting up retry_test resource complete"); - base.evaluate(); - testSuccess = true; - } catch (AssumptionViolatedException e) { - testSkipped = true; - throw e; - } finally { - LOGGER.fine("Verifying end state of retry_test resource..."); - try { - if (retryTest != null) { - RetryTestResource postTestState = testBench.getRetryTest(retryTest); - if (testSuccess) { - assertTrue("expected completed to be true, but was false", postTestState.completed); - } - } - } finally { - LOGGER.fine("Verifying end state of retry_test resource complete"); - if ((shouldCleanup(testSuccess, testSkipped)) && retryTest != null) { - testBench.deleteRetryTest(retryTest); - retryTest = null; - } - } - } - } - }; - } - - private boolean shouldCleanup(boolean testSuccess, boolean testSkipped) { - return cleanupStrategy == CleanupStrategy.ALWAYS - || ((testSuccess || testSkipped) && cleanupStrategy == CleanupStrategy.ONLY_ON_SUCCESS); - } - - private Storage newStorage(boolean forTest) { - StorageOptions.Builder builder = - StorageOptions.newBuilder() - .setHost(testBench.getBaseUri()) - .setCredentials(NoCredentials.getInstance()) - .setProjectId(testRetryConformance.getProjectId()); - RetrySettings.Builder retrySettingsBuilder = - StorageOptions.getDefaultRetrySettings().toBuilder(); - if (forTest) { - builder - .setHeaderProvider( - FixedHeaderProvider.create( - ImmutableMap.of( - "x-retry-test-id", retryTest.id, "User-Agent", fmtUserAgent("test")))) - .setRetrySettings(retrySettingsBuilder.setMaxAttempts(3).build()); - } else { - builder - .setHeaderProvider( - FixedHeaderProvider.create(ImmutableMap.of("User-Agent", fmtUserAgent("non-test")))) - .setRetrySettings(retrySettingsBuilder.setMaxAttempts(1).build()); - } - return builder.build().getService(); - } - - private String fmtUserAgent(String testDescriptor) { - return String.format( - "%s/ (%s) java-conformance-tests/", testDescriptor, testRetryConformance.getTestName()); - } -} diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethod.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethod.java deleted file mode 100644 index 2227e6bf76..0000000000 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethod.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage.conformance.retry; - -import java.util.Arrays; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -interface RpcMethod { - - String getFullyQualifiedMethodName(); - - /** - * Enumerate the hierarchy of storage rpc methods. - * - *

These class names intentionally do not follow java convention, because they are mapping - * directly to lower level values. - */ - final class storage { - private static String getFullQualifiedMethodName(Enum e) { - return String.format("storage.%s.%s", e.getClass().getSimpleName(), e.name()); - } - - enum bucket_acl implements RpcMethod { - delete, - get, - insert, - list, - patch, - update; - - @Override - public String getFullyQualifiedMethodName() { - return getFullQualifiedMethodName(this); - } - } - - enum buckets implements RpcMethod { - delete, - get, - insert, - list, - patch, - update, - getIamPolicy, - lockRetentionPolicy, - setIamPolicy, - testIamPermissions; - - @Override - public String getFullyQualifiedMethodName() { - return getFullQualifiedMethodName(this); - } - } - - enum default_object_acl implements RpcMethod { - delete, - get, - insert, - list, - patch, - update; - - @Override - public String getFullyQualifiedMethodName() { - return getFullQualifiedMethodName(this); - } - } - - enum hmacKey implements RpcMethod { - delete, - get, - list, - update, - create; - - @Override - public String getFullyQualifiedMethodName() { - return getFullQualifiedMethodName(this); - } - } - - enum notifications implements RpcMethod { - delete, - get, - insert, - list; - - @Override - public String getFullyQualifiedMethodName() { - return getFullQualifiedMethodName(this); - } - } - - enum object_acl implements RpcMethod { - delete, - get, - insert, - list, - patch, - update; - - @Override - public String getFullyQualifiedMethodName() { - return getFullQualifiedMethodName(this); - } - } - - enum objects implements RpcMethod { - delete, - get, - insert, - list, - patch, - update, - compose, - rewrite, - copy; - - @Override - public String getFullyQualifiedMethodName() { - return getFullQualifiedMethodName(this); - } - } - - enum serviceaccount implements RpcMethod { - get; - - @Override - public String getFullyQualifiedMethodName() { - return getFullQualifiedMethodName(this); - } - } - - // create a map, which can be used to do a reverse lookup of an RpcMethod by its associated - // string value. - static final Map lookup = - Stream.>of( - Arrays.stream(bucket_acl.values()), - Arrays.stream(buckets.values()), - Arrays.stream(default_object_acl.values()), - Arrays.stream(hmacKey.values()), - Arrays.stream(notifications.values()), - Arrays.stream(object_acl.values()), - Arrays.stream(objects.values()), - Arrays.stream(serviceaccount.values())) - .flatMap(Function.identity()) // .flatten() - .collect(Collectors.toMap(RpcMethod::getFullyQualifiedMethodName, Function.identity())); - } -} diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMapping.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMapping.java deleted file mode 100644 index 1c3947adbf..0000000000 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMapping.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage.conformance.retry; - -import static com.google.common.collect.Sets.newHashSet; -import static java.util.Objects.requireNonNull; -import static org.junit.Assert.fail; - -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.conformance.retry.CtxFunctions.ResourceSetup; -import com.google.cloud.storage.conformance.retry.CtxFunctions.ResourceTeardown; -import com.google.cloud.storage.conformance.retry.Functions.CtxFunction; -import com.google.common.base.Preconditions; -import com.google.errorprone.annotations.Immutable; -import java.util.HashSet; -import java.util.function.Predicate; -import org.junit.AssumptionViolatedException; - -/** - * Immutable class which represents a mapping between an {@link RpcMethod} and a method in the - * public {@code com.google.cloud.storage} API. - * - *

This class defines a semi-declarative why in which mappings can be declared independent of the - * actual environment & state necessary to actually invoke a method. - * - * @see ITRetryConformanceTest#test() - * @see RpcMethodMappings - */ -@Immutable -final class RpcMethodMapping { - - private final int mappingId; - private final RpcMethod method; - private final Predicate applicable; - private final CtxFunction setup; - private final CtxFunction test; - private final CtxFunction tearDown; - - RpcMethodMapping( - int mappingId, - RpcMethod method, - Predicate applicable, - CtxFunction setup, - CtxFunction test, - CtxFunction tearDown) { - this.mappingId = mappingId; - this.method = method; - this.applicable = applicable; - this.setup = setup; - this.test = test; - this.tearDown = tearDown; - } - - public int getMappingId() { - return mappingId; - } - - public RpcMethod getMethod() { - return method; - } - - public Predicate getApplicable() { - return applicable; - } - - public CtxFunction getSetup() { - return setup; - } - - public CtxFunction getTest() { - return (ctx, c) -> { - if (c.isExpectSuccess()) { - return test.apply(ctx, c); - } else { - try { - test.apply(ctx, c); - fail("expected failure, but succeeded"); - } catch (StorageException e) { - // We expect an exception to be thrown by mapping and test retry conformance config - // Verify that the exception we received is actually what we expect. - boolean matchExpectedCode = false; - int code = e.getCode(); - HashSet instructions = newHashSet(c.getInstruction().getInstructionsList()); - if (instructions.contains("return-503") && code == 503) { - matchExpectedCode = true; - } - if (instructions.contains("return-400") && code == 400) { - matchExpectedCode = true; - } - if (instructions.contains("return-401") && code == 401) { - matchExpectedCode = true; - } - if (instructions.contains("return-reset-connection") && code == 0) { - matchExpectedCode = true; - } - - if (matchExpectedCode) { - return ctx; - } else { - throw e; - } - } - } - throw new IllegalStateException( - "Unable to determine applicability of mapping for provided TestCaseConfig"); - }; - } - - public CtxFunction getTearDown() { - return tearDown; - } - - public Builder toBuilder() { - return new Builder(mappingId, method, applicable, setup, test, tearDown); - } - - static Builder newBuilder(int mappingId, RpcMethod method) { - Preconditions.checkArgument(mappingId >= 1, "mappingId must be >= 1, but was %d", mappingId); - return new Builder(mappingId, method); - } - - static RpcMethodMapping notImplemented(RpcMethod method) { - return new Builder(0, method) - .withSetup( - (s, c) -> { - throw new AssumptionViolatedException("not implemented"); - }) - .withTest(CtxFunction.identity()) - .build(); - } - - static final class Builder { - - private final int mappingId; - private final RpcMethod method; - private final Predicate applicable; - private final CtxFunction setup; - private final CtxFunction test; - private CtxFunction tearDown; - - Builder(int mappingId, RpcMethod method) { - this( - mappingId, - method, - x -> true, - ResourceSetup.defaultSetup, - null, - ResourceTeardown.defaultTeardown); - } - - private Builder( - int mappingId, - RpcMethod method, - Predicate applicable, - CtxFunction setup, - CtxFunction test, - CtxFunction tearDown) { - this.mappingId = mappingId; - this.method = method; - this.applicable = applicable; - this.setup = setup; - this.test = test; - this.tearDown = tearDown; - } - - public Builder withApplicable(Predicate applicable) { - return new Builder(mappingId, method, applicable, setup, test, tearDown); - } - - public Builder withSetup(CtxFunction setup) { - return new Builder(mappingId, method, applicable, setup, null, tearDown); - } - - public Builder withTest(CtxFunction test) { - return new Builder(mappingId, method, applicable, setup, test, tearDown); - } - - public Builder withTearDown(CtxFunction tearDown) { - this.tearDown = tearDown; - return this; - } - - public RpcMethodMapping build() { - return new RpcMethodMapping( - mappingId, - requireNonNull(method, "method must be non null"), - requireNonNull(applicable, "applicable must be non null"), - requireNonNull(setup, "setup must be non null"), - requireNonNull(test, "test must be non null"), - requireNonNull(tearDown, "tearDown must be non null")); - } - } -} diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java deleted file mode 100644 index 668fa902c5..0000000000 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java +++ /dev/null @@ -1,1935 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage.conformance.retry; - -import static com.google.cloud.storage.conformance.retry.CtxFunctions.ResourceSetup.defaultSetup; -import static com.google.cloud.storage.conformance.retry.CtxFunctions.ResourceSetup.serviceAccount; -import static com.google.common.base.Predicates.not; -import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertTrue; - -import com.google.cloud.BaseServiceException; -import com.google.cloud.Binding; -import com.google.cloud.Identity; -import com.google.cloud.Policy; -import com.google.cloud.ReadChannel; -import com.google.cloud.RetryHelper.RetryHelperException; -import com.google.cloud.WriteChannel; -import com.google.cloud.storage.Acl.User; -import com.google.cloud.storage.Blob; -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.HmacKey.HmacKeyMetadata; -import com.google.cloud.storage.HmacKey.HmacKeyState; -import com.google.cloud.storage.HttpMethod; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.Storage.BlobGetOption; -import com.google.cloud.storage.Storage.BlobSourceOption; -import com.google.cloud.storage.Storage.BlobTargetOption; -import com.google.cloud.storage.Storage.BlobWriteOption; -import com.google.cloud.storage.Storage.BucketSourceOption; -import com.google.cloud.storage.Storage.BucketTargetOption; -import com.google.cloud.storage.Storage.CopyRequest; -import com.google.cloud.storage.Storage.SignUrlOption; -import com.google.cloud.storage.Storage.UriScheme; -import com.google.cloud.storage.StorageRoles; -import com.google.cloud.storage.conformance.retry.CtxFunctions.Local; -import com.google.cloud.storage.conformance.retry.CtxFunctions.ResourceSetup; -import com.google.cloud.storage.conformance.retry.CtxFunctions.Rpc; -import com.google.cloud.storage.conformance.retry.Functions.EConsumer; -import com.google.cloud.storage.conformance.retry.RpcMethod.storage.bucket_acl; -import com.google.cloud.storage.conformance.retry.RpcMethod.storage.buckets; -import com.google.cloud.storage.conformance.retry.RpcMethod.storage.default_object_acl; -import com.google.cloud.storage.conformance.retry.RpcMethod.storage.hmacKey; -import com.google.cloud.storage.conformance.retry.RpcMethod.storage.object_acl; -import com.google.cloud.storage.conformance.retry.RpcMethod.storage.objects; -import com.google.cloud.storage.conformance.retry.RpcMethod.storage.serviceaccount; -import com.google.cloud.storage.conformance.retry.RpcMethodMappings.Mappings.BucketAcl; -import com.google.cloud.storage.conformance.retry.RpcMethodMappings.Mappings.Buckets; -import com.google.cloud.storage.conformance.retry.RpcMethodMappings.Mappings.DefaultObjectAcl; -import com.google.cloud.storage.conformance.retry.RpcMethodMappings.Mappings.HmacKey; -import com.google.cloud.storage.conformance.retry.RpcMethodMappings.Mappings.Notification; -import com.google.cloud.storage.conformance.retry.RpcMethodMappings.Mappings.ObjectAcl; -import com.google.cloud.storage.conformance.retry.RpcMethodMappings.Mappings.Objects; -import com.google.cloud.storage.conformance.retry.RpcMethodMappings.Mappings.ServiceAccount; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ListMultimap; -import com.google.common.collect.Multimap; -import com.google.common.collect.MultimapBuilder; -import com.google.common.collect.Multimaps; -import com.google.common.collect.Sets; -import com.google.common.io.ByteStreams; -import com.google.errorprone.annotations.Immutable; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.net.URL; -import java.nio.ByteBuffer; -import java.nio.channels.Channels; -import java.nio.channels.WritableByteChannel; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Map.Entry; -import java.util.OptionalInt; -import java.util.Set; -import java.util.concurrent.TimeUnit; -import java.util.logging.Logger; -import java.util.stream.Collectors; - -/** - * A class which serves to try and organize all of the {@link RpcMethodMapping} for the retry - * conformance tests. - * - *

Individual mappings are grouped via inner classes corresponding to the {@link RpcMethod} for - * which they are defined. - * - *

As part of construction mappingIds are enforced to be unique, throwing an error if not. - */ -@Immutable -@SuppressWarnings("Guava") -final class RpcMethodMappings { - private static final Logger LOGGER = Logger.getLogger(RpcMethodMappings.class.getName()); - - static final int _2MiB = 2 * 1024 * 1024; - final Multimap funcMap; - - RpcMethodMappings() { - ArrayList a = new ArrayList<>(); - - BucketAcl.delete(a); - BucketAcl.get(a); - BucketAcl.insert(a); - BucketAcl.list(a); - BucketAcl.patch(a); - - Buckets.delete(a); - Buckets.get(a); - Buckets.insert(a); - Buckets.list(a); - Buckets.patch(a); - Buckets.update(a); - Buckets.getIamPolicy(a); - Buckets.lockRetentionPolicy(a); - Buckets.setIamPolicy(a); - Buckets.testIamPermission(a); - - DefaultObjectAcl.delete(a); - DefaultObjectAcl.get(a); - DefaultObjectAcl.insert(a); - DefaultObjectAcl.list(a); - DefaultObjectAcl.patch(a); - DefaultObjectAcl.update(a); - - HmacKey.delete(a); - HmacKey.get(a); - HmacKey.list(a); - HmacKey.update(a); - HmacKey.create(a); - - Notification.delete(a); - Notification.get(a); - Notification.insert(a); - Notification.list(a); - - ObjectAcl.delete(a); - ObjectAcl.get(a); - ObjectAcl.insert(a); - ObjectAcl.list(a); - ObjectAcl.patch(a); - ObjectAcl.update(a); - - Objects.delete(a); - Objects.get(a); - Objects.insert(a); - Objects.list(a); - Objects.patch(a); - Objects.update(a); - Objects.compose(a); - Objects.rewrite(a); - Objects.copy(a); - - ServiceAccount.get(a); - ServiceAccount.put(a); - - validateMappingDefinitions(a); - - funcMap = Multimaps.index(a, RpcMethodMapping::getMethod); - reportMappingSummary(); - } - - public Collection get(RpcMethod key) { - return funcMap.get(key); - } - - public Set differenceMappingIds(Set usedMappingIds) { - return Sets.difference( - funcMap.values().stream().map(RpcMethodMapping::getMappingId).collect(Collectors.toSet()), - usedMappingIds); - } - - private void validateMappingDefinitions(ArrayList a) { - ListMultimap idMappings = - MultimapBuilder.hashKeys() - .arrayListValues() - .build(Multimaps.index(a, RpcMethodMapping::getMappingId)); - String duplicateIds = - idMappings.asMap().entrySet().stream() - .filter(e -> e.getValue().size() > 1) - .map(Entry::getKey) - .map(i -> Integer.toString(i)) - .collect(Collectors.joining(", ")); - if (!duplicateIds.isEmpty()) { - String message = "duplicate mapping ids present: [" + duplicateIds + "]"; - throw new IllegalStateException(message); - } - } - - private void reportMappingSummary() { - int mappingCount = funcMap.values().stream().mapToInt(m -> 1).sum(); - LOGGER.info("Current total number of mappings defined: " + mappingCount); - String counts = - funcMap.asMap().entrySet().stream() - .map( - e -> { - RpcMethod rpcMethod = e.getKey(); - Collection mappings = e.getValue(); - return String.format( - "\t%s.%s: %d", - rpcMethod - .getClass() - .getName() - .replace("com.google.cloud.storage.conformance.retry.RpcMethod$", "") - .replace("$", "."), - rpcMethod, - mappings.size()); - }) - .sorted() - .collect(Collectors.joining("\n", "\n", "")); - LOGGER.info("Current number of mappings per rpc method: " + counts); - OptionalInt max = - funcMap.values().stream().map(RpcMethodMapping::getMappingId).mapToInt(i -> i).max(); - if (max.isPresent()) { - LOGGER.info(String.format("Current max mapping index is: %d%n", max.getAsInt())); - } else { - throw new IllegalStateException("No mappings defined"); - } - } - - private static void withTempFile(String prefix, String suffix, EConsumer f) - throws Throwable { - Path tmpOutFile = Files.createTempFile(prefix, suffix); - try { - f.consume(tmpOutFile); - } finally { - Files.delete(tmpOutFile); - } - } - - static final class Mappings { - - static final class BucketAcl { - - private static void delete(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(1, bucket_acl.delete) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest( - (ctx, c) -> - ctx.map( - state -> { - boolean deleteSuccess = - ctx.getStorage().deleteAcl(c.getBucketName(), User.ofAllUsers()); - assertTrue(deleteSuccess); - return state.with(deleteSuccess); - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(2, bucket_acl.delete) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest( - (ctx, c) -> - ctx.map( - state -> { - boolean success = - ctx.getStorage() - .deleteAcl( - c.getBucketName(), - User.ofAllUsers(), - BucketSourceOption.userProject(c.getUserProject())); - assertTrue(success); - return state.with(success); - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(87, bucket_acl.delete) - .withTest( - (ctx, c) -> - ctx.map( - state -> { - boolean success = - state.getBucket().deleteAcl(state.getAcl().getEntity()); - assertTrue(success); - return state.with(success); - })) - .build()); - } - - private static void get(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(3, bucket_acl.get) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage().getAcl(c.getBucketName(), User.ofAllUsers())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(4, bucket_acl.get) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .getAcl( - c.getBucketName(), - User.ofAllUsers(), - BucketSourceOption.userProject(c.getUserProject()))))) - .build()); - a.add( - RpcMethodMapping.newBuilder(88, bucket_acl.get) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with(state.getBucket().getAcl(state.getAcl().getEntity())))) - .build()); - } - - private static void insert(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(5, bucket_acl.insert) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage().createAcl(c.getBucketName(), state.getAcl())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(6, bucket_acl.insert) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .createAcl( - c.getBucketName(), - state.getAcl(), - BucketSourceOption.userProject(c.getUserProject()))))) - .build()); - a.add( - RpcMethodMapping.newBuilder(89, bucket_acl.insert) - .withTest( - (ctx, c) -> - ctx.map(state -> state.with(state.getBucket().createAcl(state.getAcl())))) - .build()); - } - - private static void list(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(7, bucket_acl.list) - .withTest( - (ctx, c) -> - ctx.map( - state -> state.withAcls(ctx.getStorage().listAcls(c.getBucketName())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(8, bucket_acl.list) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.withAcls( - ctx.getStorage() - .listAcls( - c.getBucketName(), - BucketSourceOption.userProject(c.getUserProject()))))) - .build()); - a.add( - RpcMethodMapping.newBuilder(90, bucket_acl.list) - .withTest( - (ctx, c) -> ctx.map(state -> state.withAcls(state.getBucket().listAcls()))) - .build()); - } - - private static void patch(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(9, bucket_acl.patch) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage().updateAcl(c.getBucketName(), state.getAcl())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(10, bucket_acl.patch) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .updateAcl( - c.getBucketName(), - state.getAcl(), - BucketSourceOption.userProject(c.getUserProject()))))) - .build()); - a.add( - RpcMethodMapping.newBuilder(91, bucket_acl.patch) - .withTest( - (ctx, c) -> - ctx.map(state -> state.with(state.getBucket().updateAcl(state.getAcl())))) - .build()); - } - } - - static final class Buckets { - private static void delete(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(11, buckets.delete) - .withTest( - (ctx, c) -> - ctx.map( - state -> { - boolean success = - ctx.getStorage() - .delete( - c.getBucketName(), - BucketSourceOption.userProject(c.getUserProject())); - assertTrue(success); - return state.with(success); - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(92, buckets.delete) - .withTest( - (ctx, c) -> - ctx.map( - state -> { - boolean success = state.getBucket().delete(); - assertTrue(success); - return state.with(success); - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(93, buckets.delete) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withTest( - (ctx, c) -> - ctx.map( - state -> { - boolean success = - state - .getBucket() - .delete(Bucket.BucketSourceOption.metagenerationMatch()); - assertTrue(success); - return state.with(success); - })) - .build()); - } - - private static void get(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(12, buckets.get) - .withTest( - (ctx, c) -> - ctx.map(state -> state.with(ctx.getStorage().get(c.getBucketName())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(94, buckets.get) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest( - (ctx, c) -> - ctx.map( - state -> { - boolean success = state.getBucket().exists(); - assertTrue(success); - return state.with(success); - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(95, buckets.get) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withTest( - (ctx, c) -> - ctx.map( - state -> { - boolean success = - state - .getBucket() - .exists(Bucket.BucketSourceOption.metagenerationMatch()); - assertTrue(success); - return state.with(success); - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(96, buckets.get) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest((ctx, c) -> ctx.map(state -> state.with(state.getBucket().reload()))) - .build()); - a.add( - RpcMethodMapping.newBuilder(97, buckets.get) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBucket() - .reload(Bucket.BucketSourceOption.metagenerationMatch())))) - .build()); - } - - private static void insert(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(14, buckets.insert) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withSetup(defaultSetup.andThen(Local.bucketInfo)) - .withTest( - (ctx, c) -> - ctx.map( - state -> state.with(ctx.getStorage().create(state.getBucketInfo())))) - .build()); - } - - private static void list(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(15, buckets.list) - .withTest((ctx, c) -> ctx.map(state -> state.consume(ctx.getStorage().list()))) - .build()); - } - - private static void patch(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(17, buckets.patch) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest( - (ctx, c) -> - ctx.map(state -> state.with(ctx.getStorage().update(state.getBucket())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(122, buckets.patch) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .update( - state.getBucket(), - BucketTargetOption.metagenerationMatch())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(101, buckets.patch) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBucket() - .update(BucketTargetOption.metagenerationMatch())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(243, buckets.patch) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest((ctx, c) -> ctx.map(state -> state.with(state.getBucket().update()))) - .build()); - } - - private static void update(ArrayList a) {} - - private static void getIamPolicy(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(13, buckets.getIamPolicy) - .withTest( - (ctx, c) -> - ctx.map( - state -> state.with(ctx.getStorage().getIamPolicy(c.getBucketName())))) - .build()); - } - - private static void lockRetentionPolicy(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(16, buckets.lockRetentionPolicy) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .lockRetentionPolicy( - state.getBucket(), - BucketTargetOption.metagenerationMatch())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(100, buckets.lockRetentionPolicy) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBucket() - .lockRetentionPolicy( - BucketTargetOption.metagenerationMatch())))) - .build()); - } - - private static void setIamPolicy(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(18, buckets.setIamPolicy) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .setIamPolicy( - state.getBucket().getName(), - Policy.newBuilder() - .setVersion(3) - .setBindings( - ImmutableList.of( - Binding.newBuilder() - .setRole( - StorageRoles.legacyBucketOwner() - .toString()) - .setMembers( - ImmutableList.of( - Identity.projectOwner( - c.getProjectId()) - .getValue())) - .build())) - .build())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(240, buckets.setIamPolicy) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .setIamPolicy( - state.getBucket().getName(), - Policy.newBuilder() - .setEtag("h??") - .setVersion(3) - .setBindings( - ImmutableList.of( - Binding.newBuilder() - .setRole( - StorageRoles.legacyBucketOwner() - .toString()) - .setMembers( - ImmutableList.of( - Identity.projectOwner( - c.getProjectId()) - .getValue())) - .build())) - .build(), - BucketSourceOption.userProject(c.getProjectId()))))) - .build()); - } - - private static void testIamPermission(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(19, buckets.testIamPermissions) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.withTestIamPermissionsResults( - ctx.getStorage() - .testIamPermissions( - c.getBucketName(), - Collections.singletonList("todo: permissions"))))) - .build()); - } - } - - static final class DefaultObjectAcl { - - private static void delete(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(20, default_object_acl.delete) - .withTest( - (ctx, c) -> - ctx.map( - state -> { - boolean success = - ctx.getStorage() - .deleteDefaultAcl( - c.getBucketName(), state.getAcl().getEntity()); - assertTrue(success); - return state.with(success); - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(102, default_object_acl.delete) - .withTest( - (ctx, c) -> - ctx.map( - state -> { - boolean success = - state.getBucket().deleteDefaultAcl(state.getAcl().getEntity()); - assertTrue(success); - return state.with(success); - })) - .build()); - } - - private static void get(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(21, default_object_acl.get) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .getDefaultAcl( - c.getBucketName(), state.getAcl().getEntity())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(103, default_object_acl.get) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - state.getBucket().getDefaultAcl(state.getAcl().getEntity())))) - .build()); - } - - private static void insert(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(22, default_object_acl.insert) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .createDefaultAcl(c.getBucketName(), state.getAcl())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(104, default_object_acl.insert) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with(state.getBucket().createDefaultAcl(state.getAcl())))) - .build()); - } - - private static void list(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(23, default_object_acl.list) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.withAcls( - ctx.getStorage().listDefaultAcls(c.getBucketName())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(105, default_object_acl.list) - .withTest( - (ctx, c) -> - ctx.map(state -> state.withAcls(state.getBucket().listDefaultAcls()))) - .build()); - } - - private static void patch(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(24, default_object_acl.patch) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .updateDefaultAcl(c.getBucketName(), state.getAcl())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(106, default_object_acl.patch) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with(state.getBucket().updateDefaultAcl(state.getAcl())))) - .build()); - } - - private static void update(ArrayList a) {} - } - - static final class HmacKey { - - private static void delete(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(26, hmacKey.delete) - .withSetup( - defaultSetup.andThen( - (ctx, c) -> - ctx.map( - state -> { - Storage storage = ctx.getStorage(); - HmacKeyMetadata metadata = state.getHmacKey().getMetadata(); - // for delete we're only using the metadata, clear the key that - // was populated in defaultSetup and specify the updated metadata - return state - .withHmacKey(null) - .with( - storage.updateHmacKeyState( - metadata, HmacKeyState.INACTIVE)); - }))) - .withTest( - (ctx, c) -> - ctx.map( - state -> { - ctx.getStorage().deleteHmacKey(state.getHmacKeyMetadata()); - // clear the metadata from the state now that we've deleted it - return state.with((HmacKeyMetadata) null); - })) - .build()); - } - - private static void get(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(27, hmacKey.get) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .getHmacKey( - state.getHmacKey().getMetadata().getAccessId())))) - .build()); - } - - private static void list(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(28, hmacKey.list) - .withTest( - (ctx, c) -> ctx.map(state -> state.consume(ctx.getStorage().listHmacKeys()))) - .build()); - } - - private static void update(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(29, hmacKey.update) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .updateHmacKeyState( - state.getHmacKey().getMetadata(), - HmacKeyState.ACTIVE)))) - .build()); - } - - private static void create(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(25, hmacKey.create) - .withSetup(defaultSetup.andThen(serviceAccount)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.withHmacKey( - ctx.getStorage().createHmacKey(state.getServiceAccount())))) - .build()); - } - } - - static final class Notification { - - private static void delete(ArrayList a) {} - - private static void get(ArrayList a) {} - - private static void insert(ArrayList a) {} - - private static void list(ArrayList a) {} - } - - static final class ObjectAcl { - - private static void delete(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(30, object_acl.delete) - .withTest( - (ctx, c) -> - ctx.map( - state -> { - boolean success = - ctx.getStorage() - .deleteAcl( - state.getBlob().getBlobId(), state.getAcl().getEntity()); - assertTrue(success); - return state.with(success); - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(62, object_acl.delete) - .withTest( - (ctx, c) -> - ctx.map( - state -> { - boolean success = - state.getBlob().deleteAcl(state.getAcl().getEntity()); - assertTrue(success); - return state.with(success); - })) - .build()); - } - - private static void get(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(31, object_acl.get) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .getAcl( - state.getBlob().getBlobId(), - state.getAcl().getEntity())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(63, object_acl.get) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with(state.getBlob().getAcl(state.getAcl().getEntity())))) - .build()); - } - - private static void insert(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(32, object_acl.insert) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .createAcl(state.getBlob().getBlobId(), state.getAcl())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(64, object_acl.insert) - .withTest( - (ctx, c) -> - ctx.map(state -> state.with(state.getBlob().createAcl(state.getAcl())))) - .build()); - } - - private static void list(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(33, object_acl.list) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.withAcls( - ctx.getStorage().listAcls(state.getBlob().getBlobId())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(65, object_acl.list) - .withTest((ctx, c) -> ctx.map(state -> state.withAcls(state.getBlob().listAcls()))) - .build()); - } - - private static void patch(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(34, object_acl.patch) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .updateAcl(state.getBlob().getBlobId(), state.getAcl())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(66, object_acl.patch) - .withTest( - (ctx, c) -> - ctx.map(state -> state.with(state.getBlob().updateAcl(state.getAcl())))) - .build()); - } - - private static void update(ArrayList a) {} - } - - static final class Objects { - - private static void delete(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(36, objects.delete) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest( - (ctx, c) -> - ctx.map( - state -> { - boolean success = - ctx.getStorage().delete(state.getBlob().getBlobId()); - assertTrue(success); - return state.with(success); - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(37, objects.delete) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withTest( - (ctx, c) -> - ctx.map( - state -> { - boolean success = - ctx.getStorage() - .delete( - state.getBlob().getBlobId(), - BlobSourceOption.generationMatch()); - assertTrue(success); - return state.with(success); - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(38, objects.delete) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withTest( - (ctx, c) -> - ctx.map( - state -> { - boolean success = - ctx.getStorage() - .delete( - state.getBlob().getBlobId().getBucket(), - state.getBlob().getBlobId().getName(), - BlobSourceOption.generationMatch( - state.getBlob().getGeneration())); - assertTrue(success); - return state.with(success); - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(67, objects.delete) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest((ctx, c) -> ctx.peek(state -> state.getBlob().delete())) - .build()); - a.add( - RpcMethodMapping.newBuilder(68, objects.delete) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withTest( - (ctx, c) -> - ctx.peek( - state -> - state.getBlob().delete(Blob.BlobSourceOption.generationMatch()))) - .build()); - } - - private static void get(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(39, objects.get) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withSetup(defaultSetup.andThen(Local.blobInfoWithoutGeneration)) - .withTest( - (ctx, c) -> - ctx.map( - state -> state.with(ctx.getStorage().get(state.getBlob().getBlobId())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(239, objects.get) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withTest( - (ctx, c) -> - ctx.peek(state -> ctx.getStorage().get(state.getBlob().getBlobId()))) - .build()); - a.add( - RpcMethodMapping.newBuilder(40, objects.get) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .get( - state.getBlob().getBlobId(), - BlobGetOption.metagenerationMatch( - state.getBlob().getMetageneration()))))) - .build()); - a.add( - RpcMethodMapping.newBuilder(41, objects.get) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .get( - state.getBlob().getBlobId().getBucket(), - state.getBlob().getBlobId().getName(), - BlobGetOption.metagenerationMatch( - state.getBlob().getMetageneration()))))) - .build()); - a.add( - RpcMethodMapping.newBuilder(42, objects.get) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .readAllBytes( - state.getBlob().getBlobId(), - BlobSourceOption.metagenerationMatch( - state.getBlob().getMetageneration()))))) - .build()); - a.add( - RpcMethodMapping.newBuilder(43, objects.get) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .readAllBytes( - state.getBlob().getBlobId().getBucket(), - state.getBlob().getBlobId().getName(), - BlobSourceOption.metagenerationMatch( - state.getBlob().getMetageneration()))))) - .build()); - a.add( - RpcMethodMapping.newBuilder(44, objects.get) - .withTest( - (ctx, c) -> - ctx.peek( - state -> { - try { - ReadChannel reader = - ctx.getStorage().reader(ctx.getState().getBlob().getBlobId()); - WritableByteChannel write = - Channels.newChannel(ByteStreams.nullOutputStream()); - ByteStreams.copy(reader, write); - } catch (IOException e) { - if (e.getCause() instanceof RetryHelperException) { - RetryHelperException cause = (RetryHelperException) e.getCause(); - if (cause.getCause() instanceof BaseServiceException) { - throw cause.getCause(); - } - } - } - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(45, objects.get) - .withTest( - (ctx, c) -> - ctx.peek( - state -> { - try { - ReadChannel reader = - ctx.getStorage() - .reader( - ctx.getState().getBlob().getBlobId().getBucket(), - ctx.getState().getBlob().getBlobId().getName()); - WritableByteChannel write = - Channels.newChannel(ByteStreams.nullOutputStream()); - ByteStreams.copy(reader, write); - } catch (IOException e) { - if (e.getCause() instanceof RetryHelperException) { - RetryHelperException cause = (RetryHelperException) e.getCause(); - if (cause.getCause() instanceof BaseServiceException) { - throw cause.getCause(); - } - } - } - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(60, objects.get) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest((ctx, c) -> ctx.peek(state -> assertTrue(state.getBlob().exists()))) - .build()); - a.add( - RpcMethodMapping.newBuilder(61, objects.get) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withTest( - (ctx, c) -> - ctx.peek( - state -> - assertTrue( - state - .getBlob() - .exists(Blob.BlobSourceOption.generationMatch())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(69, objects.get) - .withTest( - (ctx, c) -> - ctx.peek( - state -> - withTempFile( - c.getMethod().getName(), - ".txt", - (tmpOutFile) -> { - state.getBlob().downloadTo(tmpOutFile); - byte[] downloadedBytes = Files.readAllBytes(tmpOutFile); - assertThat(downloadedBytes) - .isEqualTo(c.getHelloWorldUtf8Bytes()); - }))) - .build()); - a.add( - RpcMethodMapping.newBuilder(70, objects.get) - .withTest( - (ctx, c) -> - ctx.peek( - state -> - withTempFile( - c.getMethod().getName(), - ".txt", - (tmpOutFile) -> { - state - .getBlob() - .downloadTo( - tmpOutFile, Blob.BlobSourceOption.generationMatch()); - byte[] downloadedBytes = Files.readAllBytes(tmpOutFile); - assertThat(downloadedBytes) - .isEqualTo(c.getHelloWorldUtf8Bytes()); - }))) - .build()); - a.add( - RpcMethodMapping.newBuilder(71, objects.get) - .withTest( - (ctx, c) -> - ctx.peek( - state -> { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - state.getBlob().downloadTo(baos); - byte[] downloadedBytes = baos.toByteArray(); - assertThat(downloadedBytes).isEqualTo(c.getHelloWorldUtf8Bytes()); - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(72, objects.get) - .withTest( - (ctx, c) -> - ctx.peek( - state -> { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - state - .getBlob() - .downloadTo(baos, Blob.BlobSourceOption.generationMatch()); - byte[] downloadedBytes = baos.toByteArray(); - assertThat(downloadedBytes).isEqualTo(c.getHelloWorldUtf8Bytes()); - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(73, objects.get) - .withTest( - (ctx, c) -> - ctx.peek( - state -> { - byte[] downloadedBytes = state.getBlob().getContent(); - assertThat(downloadedBytes).isEqualTo(c.getHelloWorldUtf8Bytes()); - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(74, objects.get) - .withTest( - (ctx, c) -> - ctx.peek( - state -> { - byte[] downloadedBytes = - state - .getBlob() - .getContent(Blob.BlobSourceOption.metagenerationMatch()); - assertThat(downloadedBytes).isEqualTo(c.getHelloWorldUtf8Bytes()); - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(75, objects.get) - .withTest((ctx, c) -> ctx.peek(state -> state.getBlob().reload())) - .build()); - a.add( - RpcMethodMapping.newBuilder(76, objects.get) - .withTest( - (ctx, c) -> - ctx.peek( - state -> - state - .getBlob() - .reload(Blob.BlobSourceOption.metagenerationMatch()))) - .build()); - a.add( - RpcMethodMapping.newBuilder(107, objects.get) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest( - (ctx, c) -> - ctx.map(state -> state.with(state.getBucket().get(c.getObjectName())))) - .build()); - } - - private static void insert(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(46, objects.insert) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withSetup(defaultSetup.andThen(Local.blobInfoWithGenerationZero)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .create( - ctx.getState().getBlobInfo(), - c.getHelloWorldUtf8Bytes(), - BlobTargetOption.generationMatch())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(47, objects.insert) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withSetup(defaultSetup.andThen(Local.blobInfoWithGenerationZero)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .create( - ctx.getState().getBlobInfo(), - c.getHelloWorldUtf8Bytes(), - 0, - c.getHelloWorldUtf8Bytes().length / 2, - BlobTargetOption.generationMatch())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(48, objects.insert) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withSetup(defaultSetup.andThen(Local.blobInfoWithGenerationZero)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .create( - ctx.getState().getBlobInfo(), - new ByteArrayInputStream(c.getHelloWorldUtf8Bytes()), - BlobWriteOption.generationMatch())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(49, objects.insert) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withSetup(defaultSetup.andThen(Local.blobInfoWithGenerationZero)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .createFrom( - ctx.getState().getBlobInfo(), - new ByteArrayInputStream(c.getHelloWorldUtf8Bytes()), - BlobWriteOption.generationMatch())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(50, objects.insert) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withSetup(defaultSetup.andThen(Local.blobInfoWithGenerationZero)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .createFrom( - ctx.getState().getBlobInfo(), - c.getHelloWorldFilePath(), - BlobWriteOption.generationMatch())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(51, objects.insert) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withSetup(defaultSetup.andThen(Local.blobInfoWithGenerationZero)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .createFrom( - ctx.getState().getBlobInfo(), - c.getHelloWorldFilePath(), - _2MiB, - BlobWriteOption.generationMatch())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(52, objects.insert) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withSetup(defaultSetup.andThen(Local.blobInfoWithoutGeneration)) - .withTest( - (ctx, c) -> - ctx.peek( - state -> { - try (WriteChannel writer = - ctx.getStorage().writer(ctx.getState().getBlobInfo())) { - writer.write(ByteBuffer.wrap(c.getHelloWorldUtf8Bytes())); - } - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(53, objects.insert) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withSetup(defaultSetup.andThen(Local.blobInfoWithGenerationZero)) - .withTest( - (ctx, c) -> - ctx.peek( - state -> { - try (WriteChannel writer = - ctx.getStorage() - .writer( - ctx.getState().getBlobInfo(), - BlobWriteOption.generationMatch())) { - writer.write(ByteBuffer.wrap(c.getHelloWorldUtf8Bytes())); - } - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(54, objects.insert) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withSetup(defaultSetup.andThen(Local.blobInfoWithoutGeneration)) - .withTest( - (ctx, c) -> - ctx.peek( - state -> { - Storage storage = ctx.getStorage(); - URL signedUrl = - storage.signUrl( - state.getBlobInfo(), - 1, - TimeUnit.HOURS, - SignUrlOption.httpMethod(HttpMethod.POST), - // TODO(#1094): Instead of using bucketBoundHostname fix - // Signer to get BaseUri from StorageOptions - // NOTE(frankyn/benwhitehead): testbench expects HTTP scheme - // and we are using a hack to get around the lack of scheme - // manipulation by using bucketBoundHostname to select HTTP - // scheme instead. Bucket name is not present explicitly in - // bucketBoundHostname because it's expected to be referred to - // by the Bucket Bound Hostname so we must append it, being - // the hack, to get around the limitation. - SignUrlOption.withBucketBoundHostname( - c.getHost() - + "/" - + c.getBucketName() - + "/" - + c.getObjectName(), - UriScheme.HTTP), - SignUrlOption.withExtHeaders( - ImmutableMap.of("x-goog-resumable", "start")), - SignUrlOption.signWith(c.getServiceAccountSigner()), - SignUrlOption.withV4Signature()); - try (WriteChannel writer = storage.writer(signedUrl)) { - writer.write(ByteBuffer.wrap(c.getHelloWorldUtf8Bytes())); - } - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(77, objects.insert) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withSetup( - defaultSetup - .andThen(Local.blobInfoWithoutGeneration) - .andThen(Rpc.createEmptyBlob)) - .withTest( - (ctx, c) -> - ctx.peek( - state -> { - try (WriteChannel writer = state.getBlob().writer()) { - writer.write(ByteBuffer.wrap(c.getHelloWorldUtf8Bytes())); - } - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(78, objects.insert) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withSetup( - defaultSetup - .andThen(Local.blobInfoWithoutGeneration) - .andThen(ResourceSetup.object)) - .withTest( - (ctx, c) -> - ctx.peek( - state -> { - try (WriteChannel writer = - state.getBlob().writer(BlobWriteOption.generationMatch())) { - writer.write(ByteBuffer.wrap(c.getHelloWorldUtf8Bytes())); - } - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(108, objects.insert) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBucket() - .create(c.getObjectName(), c.getHelloWorldUtf8Bytes())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(109, objects.insert) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBucket() - .create( - c.getObjectName(), - c.getHelloWorldUtf8Bytes(), - "text/plain);charset=utf-8")))) - .build()); - a.add( - RpcMethodMapping.newBuilder(110, objects.insert) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBucket() - .create( - c.getObjectName(), - new ByteArrayInputStream(c.getHelloWorldUtf8Bytes()))))) - .build()); - a.add( - RpcMethodMapping.newBuilder(111, objects.insert) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBucket() - .create( - c.getObjectName(), - new ByteArrayInputStream(c.getHelloWorldUtf8Bytes()), - "text/plain);charset=utf-8")))) - .build()); - a.add( - RpcMethodMapping.newBuilder(112, objects.insert) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withSetup(defaultSetup.andThen(Local.blobInfoWithoutGeneration)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .create( - ctx.getState().getBlobInfo(), - c.getHelloWorldUtf8Bytes())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(113, objects.insert) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withSetup(defaultSetup.andThen(Local.blobInfoWithoutGeneration)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .create( - ctx.getState().getBlobInfo(), - c.getHelloWorldUtf8Bytes(), - 0, - c.getHelloWorldUtf8Bytes().length / 2)))) - .build()); - a.add( - RpcMethodMapping.newBuilder(114, objects.insert) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withSetup(defaultSetup.andThen(Local.blobInfoWithoutGeneration)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .create( - ctx.getState().getBlobInfo(), - new ByteArrayInputStream(c.getHelloWorldUtf8Bytes()))))) - .build()); - a.add( - RpcMethodMapping.newBuilder(115, objects.insert) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withSetup(defaultSetup.andThen(Local.blobInfoWithoutGeneration)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .createFrom( - ctx.getState().getBlobInfo(), - new ByteArrayInputStream(c.getHelloWorldUtf8Bytes()))))) - .build()); - a.add( - RpcMethodMapping.newBuilder(116, objects.insert) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withSetup(defaultSetup.andThen(Local.blobInfoWithoutGeneration)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .createFrom( - ctx.getState().getBlobInfo(), - c.getHelloWorldFilePath())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(117, objects.insert) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withSetup(defaultSetup.andThen(Local.blobInfoWithoutGeneration)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .createFrom( - ctx.getState().getBlobInfo(), - c.getHelloWorldFilePath(), - _2MiB)))) - .build()); - a.add( - RpcMethodMapping.newBuilder(118, objects.insert) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBucket() - .create( - c.getObjectName(), - c.getHelloWorldUtf8Bytes(), - Bucket.BlobTargetOption.doesNotExist())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(119, objects.insert) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBucket() - .create( - c.getObjectName(), - c.getHelloWorldUtf8Bytes(), - "text/plain);charset=utf-8", - Bucket.BlobTargetOption.doesNotExist())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(120, objects.insert) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBucket() - .create( - c.getObjectName(), - new ByteArrayInputStream(c.getHelloWorldUtf8Bytes()), - Bucket.BlobWriteOption.doesNotExist())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(121, objects.insert) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBucket() - .create( - c.getObjectName(), - new ByteArrayInputStream(c.getHelloWorldUtf8Bytes()), - "text/plain);charset=utf-8", - Bucket.BlobWriteOption.doesNotExist())))) - .build()); - } - - private static void list(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(55, objects.list) - .withTest( - (ctx, c) -> - ctx.map(state -> state.consume(ctx.getStorage().list(c.getBucketName())))) - .build()); - } - - private static void patch(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(56, objects.patch) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest( - (ctx, c) -> - ctx.map( - state -> state.with(ctx.getStorage().update(ctx.getState().getBlob())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(57, objects.patch) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - ctx.getStorage() - .update( - ctx.getState().getBlob(), - BlobTargetOption.metagenerationMatch())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(79, objects.patch) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest((ctx, c) -> ctx.peek(state -> state.getBlob().update())) - .build()); - a.add( - RpcMethodMapping.newBuilder(80, objects.patch) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBlob() - .update(BlobTargetOption.metagenerationMatch())))) - .build()); - } - - private static void update(ArrayList a) {} - - private static void compose(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(35, objects.compose) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withSetup(defaultSetup.andThen(Local.composeRequest)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with(ctx.getStorage().compose(state.getComposeRequest())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(241, objects.compose) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withSetup(defaultSetup.andThen(Local.composeRequest)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with(ctx.getStorage().compose(state.getComposeRequest())))) - .build()); - } - - private static void rewrite(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(58, objects.rewrite) - .withApplicable(TestRetryConformance::isPreconditionsProvided) - .withTest( - (ctx, c) -> - ctx.map( - state -> { - CopyRequest copyRequest = - CopyRequest.newBuilder() - .setSource(c.getBucketName(), c.getObjectName()) - .setTarget( - BlobId.of(c.getBucketName(), "destination-blob"), - BlobTargetOption.doesNotExist()) - .build(); - return state.with(ctx.getStorage().copy(copyRequest)); - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(242, objects.rewrite) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withTest( - (ctx, c) -> - ctx.map( - state -> { - CopyRequest copyRequest = - CopyRequest.newBuilder() - .setSource(c.getBucketName(), c.getObjectName()) - .setTarget(BlobId.of(c.getBucketName(), "destination-blob")) - .build(); - return state.with(ctx.getStorage().copy(copyRequest)); - })) - .build()); - a.add( - RpcMethodMapping.newBuilder(81, objects.rewrite) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withSetup(defaultSetup.andThen(Local.blobCopy)) - .withTest( - (ctx, c) -> - ctx.map(state -> state.with(state.getBlob().copyTo(state.getCopyDest())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(82, objects.rewrite) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withSetup(defaultSetup.andThen(Local.blobCopy)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBlob() - .copyTo( - state.getCopyDest(), - Blob.BlobSourceOption.metagenerationMatch())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(83, objects.rewrite) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withSetup(defaultSetup.andThen(Local.blobCopy)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - state.getBlob().copyTo(state.getCopyDest().getBucket())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(84, objects.rewrite) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withSetup(defaultSetup.andThen(Local.blobCopy)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBlob() - .copyTo( - state.getCopyDest().getBucket(), - Blob.BlobSourceOption.metagenerationMatch())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(85, objects.rewrite) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withSetup(defaultSetup.andThen(Local.blobCopy)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBlob() - .copyTo( - state.getCopyDest().getBucket(), - state.getCopyDest().getName())))) - .build()); - a.add( - RpcMethodMapping.newBuilder(86, objects.rewrite) - .withApplicable(not(TestRetryConformance::isPreconditionsProvided)) - .withSetup(defaultSetup.andThen(Local.blobCopy)) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with( - state - .getBlob() - .copyTo( - state.getCopyDest().getBucket(), - state.getCopyDest().getName(), - Blob.BlobSourceOption.metagenerationMatch())))) - .build()); - } - - private static void copy(ArrayList a) {} - } - - static final class ServiceAccount { - - private static void get(ArrayList a) { - a.add( - RpcMethodMapping.newBuilder(59, serviceaccount.get) - .withTest( - (ctx, c) -> - ctx.map( - state -> - state.with(ctx.getStorage().getServiceAccount(c.getUserProject())))) - .build()); - } - - private static void put(ArrayList a) {} - } - } -} diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/State.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/State.java deleted file mode 100644 index 94d1542cac..0000000000 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/State.java +++ /dev/null @@ -1,353 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage.conformance.retry; - -import static java.util.Objects.requireNonNull; - -import com.google.api.gax.paging.Page; -import com.google.cloud.Policy; -import com.google.cloud.storage.Acl; -import com.google.cloud.storage.Blob; -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.BlobInfo; -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.BucketInfo; -import com.google.cloud.storage.CopyWriter; -import com.google.cloud.storage.HmacKey; -import com.google.cloud.storage.HmacKey.HmacKeyMetadata; -import com.google.cloud.storage.ServiceAccount; -import com.google.cloud.storage.Storage.ComposeRequest; -import com.google.common.collect.ImmutableMap; -import com.google.errorprone.annotations.Immutable; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; -import java.util.stream.StreamSupport; - -/** - * A specialized wrapper around an immutable map allowing for declaration of named get/has/with - * methods without the need for individual fields. - * - *

Every mutation returns a copy with the mutation result. - * - *

Over the course of executing an individual test for a specific mapping some fields will be - * updated. - * - *

This approach was taken after multiple attempts to create more type safe alternatives which - * turned into far too much duplication given the possible permutations of state for various - * mappings. - */ -@Immutable -final class State { - - private static final State EMPTY = new State(); - private static final Key KEY_ACL = new Key<>("acl"); - private static final Key KEY_BLOB = new Key<>("blob"); - private static final Key KEY_BLOB_ID = new Key<>("blobId"); - private static final Key KEY_COPY_DEST = new Key<>("copyDest"); - private static final Key KEY_BLOB_INFO = new Key<>("blobInfo"); - private static final Key KEY_BOOL = new Key<>("bool"); - private static final Key KEY_BUCKET = new Key<>("bucket"); - private static final Key KEY_BUCKET_INFO = new Key<>("bucketInfo"); - private static final Key KEY_COPY = new Key<>("copy"); - private static final Key KEY_HMAC_KEY = new Key<>("hmacKey"); - private static final Key KEY_HMAC_KEY_METADATA = new Key<>("hmacKeyMetadata"); - private static final Key KEY_POLICY = new Key<>("policy"); - private static final Key KEY_SERVICE_ACCOUNT = new Key<>("serviceAccount"); - private static final Key> KEY_LIST_OBJECTS = new Key<>("list"); - private static final Key> KEY_TEST_IAM_PERMISSIONS_RESULTS = - new Key<>("testIamPermissionsResults"); - private static final Key> KEY_ACLS = new Key<>("acls"); - private static final Key KEY_BYTES = new Key<>("bytes"); - private static final Key KEY_COMPOSE_REQUEST = new Key<>("composeRequest"); - - private final ImmutableMap, Object> data; - - public State() { - this(ImmutableMap.of()); - } - - public State(ImmutableMap, Object> data) { - this.data = data; - } - - static State empty() { - return EMPTY; - } - - public boolean hasAcl() { - return hasValue(KEY_ACL); - } - - public Acl getAcl() { - return getValue(KEY_ACL); - } - - public State with(Acl acl) { - return newStateWith(KEY_ACL, acl); - } - - public boolean hasBlob() { - return hasValue(KEY_BLOB); - } - - public Blob getBlob() { - return getValue(KEY_BLOB); - } - - public State with(Blob blob) { - return newStateWith(KEY_BLOB, blob); - } - - public boolean hasBlobId() { - return hasValue(KEY_BLOB_ID); - } - - public BlobId getBlobId() { - return getValue(KEY_BLOB_ID); - } - - public State with(BlobId blobId) { - return newStateWith(KEY_BLOB_ID, blobId); - } - - public boolean hasCopyDest() { - return hasValue(KEY_COPY_DEST); - } - - public BlobId getCopyDest() { - return getValue(KEY_COPY_DEST); - } - - public State withCopyDest(BlobId copyDest) { - return newStateWith(KEY_COPY_DEST, copyDest); - } - - public boolean hasBlobInfo() { - return hasValue(KEY_BLOB_INFO); - } - - public BlobInfo getBlobInfo() { - return getValue(KEY_BLOB_INFO); - } - - public State with(BlobInfo blobInfo) { - return newStateWith(KEY_BLOB_INFO, blobInfo); - } - - public boolean hasBool() { - return hasValue(KEY_BOOL); - } - - public Boolean getBool() { - return getValue(KEY_BOOL); - } - - public State with(Boolean bool) { - return newStateWith(KEY_BOOL, bool); - } - - public boolean hasBucket() { - return hasValue(KEY_BUCKET); - } - - public Bucket getBucket() { - return getValue(KEY_BUCKET); - } - - public State with(Bucket bucket) { - return newStateWith(KEY_BUCKET, bucket); - } - - public boolean hasBucketInfo() { - return hasValue(KEY_BUCKET_INFO); - } - - public BucketInfo getBucketInfo() { - return getValue(KEY_BUCKET_INFO); - } - - public State with(BucketInfo bucketInfo) { - return newStateWith(KEY_BUCKET_INFO, bucketInfo); - } - - public boolean hasCopy() { - return hasValue(KEY_COPY); - } - - public CopyWriter getCopy() { - return getValue(KEY_COPY); - } - - public State with(CopyWriter copy) { - return newStateWith(KEY_COPY, copy); - } - - public boolean hasHmacKey() { - return hasValue(KEY_HMAC_KEY); - } - - public HmacKey getHmacKey() { - return getValue(KEY_HMAC_KEY); - } - - public State withHmacKey(HmacKey hmacKey) { - return newStateWith(KEY_HMAC_KEY, hmacKey); - } - - public boolean hasHmacKeyMetadata() { - return hasValue(KEY_HMAC_KEY_METADATA); - } - - public HmacKeyMetadata getHmacKeyMetadata() { - return getValue(KEY_HMAC_KEY_METADATA); - } - - public State with(HmacKeyMetadata hmacKeyMetadata) { - return newStateWith(KEY_HMAC_KEY_METADATA, hmacKeyMetadata); - } - - public boolean hasPolicy() { - return hasValue(KEY_POLICY); - } - - public Policy getPolicy() { - return getValue(KEY_POLICY); - } - - public State with(Policy policy) { - return newStateWith(KEY_POLICY, policy); - } - - public boolean hasServiceAccount() { - return hasValue(KEY_SERVICE_ACCOUNT); - } - - public ServiceAccount getServiceAccount() { - return getValue(KEY_SERVICE_ACCOUNT); - } - - public State with(ServiceAccount serviceAccount) { - return newStateWith(KEY_SERVICE_ACCOUNT, serviceAccount); - } - - public boolean hasBytes() { - return hasValue(KEY_BYTES); - } - - public byte[] getBytes() { - return getValue(KEY_BYTES); - } - - public State with(byte[] bytes) { - return newStateWith(KEY_BYTES, bytes); - } - - public boolean hasTestIamPermissionsResults() { - return hasValue(KEY_TEST_IAM_PERMISSIONS_RESULTS); - } - - public List getTestIamPermissionsResults() { - return getValue(KEY_TEST_IAM_PERMISSIONS_RESULTS); - } - - public State withTestIamPermissionsResults(List testIamPermissionsResults) { - return newStateWith(KEY_TEST_IAM_PERMISSIONS_RESULTS, testIamPermissionsResults); - } - - public boolean hasAcls() { - return hasValue(KEY_ACLS); - } - - public List getAcls() { - return getValue(KEY_ACLS); - } - - public State withAcls(List acls) { - return newStateWith(KEY_ACLS, acls); - } - - public State consume(Page page) { - List collect = - StreamSupport.stream(page.iterateAll().spliterator(), false).collect(Collectors.toList()); - return newStateWith(KEY_LIST_OBJECTS, collect); - } - - public State with(ComposeRequest composeRequest) { - return newStateWith(KEY_COMPOSE_REQUEST, composeRequest); - } - - public ComposeRequest getComposeRequest() { - return getValue(KEY_COMPOSE_REQUEST); - } - - public boolean hasComposeRequest() { - return hasValue(KEY_COMPOSE_REQUEST); - } - - private T getValue(Key key) { - Object o = data.get(key); - requireNonNull(o, () -> String.format("%s was not found in state", key.name)); - return key.cast(o); - } - - private boolean hasValue(Key key) { - return data.containsKey(key); - } - - private State newStateWith(Key key, T t) { - Map, Object> tmp = new HashMap<>(data); - if (t != null) { - tmp.put(key, t); - } else { - tmp.remove(key); - } - return new State(ImmutableMap.copyOf(tmp)); - } - - private static final class Key { - - private final String name; - - public Key(String name) { - this.name = requireNonNull(name, "name must be non null"); - } - - T cast(Object t) { - return (T) t; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof Key)) { - return false; - } - Key key = (Key) o; - return name.equals(key.name); - } - - @Override - public int hashCode() { - return Objects.hash(name); - } - } -} diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/TestBench.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/TestBench.java deleted file mode 100644 index 557cfe3ca1..0000000000 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/TestBench.java +++ /dev/null @@ -1,417 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage.conformance.retry; - -import static com.google.cloud.RetryHelper.runWithRetries; -import static java.util.Objects.requireNonNull; - -import com.google.api.client.http.ByteArrayContent; -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpContent; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpRequestFactory; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.javanet.NetHttpTransport; -import com.google.api.core.NanoClock; -import com.google.api.gax.retrying.BasicResultRetryAlgorithm; -import com.google.api.gax.retrying.RetrySettings; -import com.google.cloud.RetryHelper.RetryHelperException; -import com.google.cloud.conformance.storage.v1.InstructionList; -import com.google.cloud.conformance.storage.v1.Method; -import com.google.common.collect.ImmutableList; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.net.SocketException; -import java.net.URI; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; -import java.util.concurrent.TimeUnit; -import java.util.logging.Logger; -import org.junit.rules.TestRule; -import org.junit.runner.Description; -import org.junit.runners.model.Statement; -import org.threeten.bp.Duration; - -/** - * A JUnit 4 {@link TestRule} which integrates with the storage-testbench by pulling the - * docker image, starting the container, providing methods for interacting with the {@code - * /retry_test} rest api, stopping the container. - * - *

This rule expects to be bound as an {@link org.junit.ClassRule @ClassRule} field. - */ -public final class TestBench implements TestRule { - - private static final Logger LOGGER = Logger.getLogger(TestBench.class.getName()); - - private final boolean ignorePullError; - private final String baseUri; - private final String dockerImageName; - private final String dockerImageTag; - private final CleanupStrategy cleanupStrategy; - private final String containerName; - - private final Gson gson; - private final HttpRequestFactory requestFactory; - - private TestBench( - boolean ignorePullError, - String baseUri, - String dockerImageName, - String dockerImageTag, - CleanupStrategy cleanupStrategy, - String containerName) { - this.ignorePullError = ignorePullError; - this.baseUri = baseUri; - this.dockerImageName = dockerImageName; - this.dockerImageTag = dockerImageTag; - this.cleanupStrategy = cleanupStrategy; - this.containerName = containerName; - this.gson = new Gson(); - this.requestFactory = - new NetHttpTransport.Builder() - .build() - .createRequestFactory( - request -> { - request.setCurlLoggingEnabled(false); - request.getHeaders().setAccept("application/json"); - request - .getHeaders() - .setUserAgent(String.format("%s/ test-bench/", this.containerName)); - }); - } - - public String getBaseUri() { - return baseUri; - } - - public RetryTestResource createRetryTest(RetryTestResource retryTestResource) throws IOException { - GenericUrl url = new GenericUrl(baseUri + "/retry_test"); - String jsonString = gson.toJson(retryTestResource); - HttpContent content = - new ByteArrayContent("application/json", jsonString.getBytes(StandardCharsets.UTF_8)); - HttpRequest req = requestFactory.buildPostRequest(url, content); - HttpResponse resp = req.execute(); - RetryTestResource result = gson.fromJson(resp.parseAsString(), RetryTestResource.class); - resp.disconnect(); - return result; - } - - public void deleteRetryTest(RetryTestResource retryTestResource) throws IOException { - GenericUrl url = new GenericUrl(baseUri + "/retry_test/" + retryTestResource.id); - HttpRequest req = requestFactory.buildDeleteRequest(url); - HttpResponse resp = req.execute(); - resp.disconnect(); - } - - public RetryTestResource getRetryTest(RetryTestResource retryTestResource) throws IOException { - GenericUrl url = new GenericUrl(baseUri + "/retry_test/" + retryTestResource.id); - HttpRequest req = requestFactory.buildGetRequest(url); - HttpResponse resp = req.execute(); - RetryTestResource result = gson.fromJson(resp.parseAsString(), RetryTestResource.class); - resp.disconnect(); - return result; - } - - public List listRetryTests() throws IOException { - GenericUrl url = new GenericUrl(baseUri + "/retry_tests"); - HttpRequest req = requestFactory.buildGetRequest(url); - HttpResponse resp = req.execute(); - JsonObject result = gson.fromJson(resp.parseAsString(), JsonObject.class); - JsonArray retryTest = (JsonArray) result.get("retry_test"); - ImmutableList.Builder b = ImmutableList.builder(); - for (JsonElement e : retryTest) { - b.add(gson.fromJson(e, RetryTestResource.class)); - } - resp.disconnect(); - return b.build(); - } - - @Override - public Statement apply(final Statement base, Description description) { - return new Statement() { - @Override - public void evaluate() throws Throwable { - String fullContainerName = String.format("storage-testbench_%s", containerName); - Path tempDirectory = Files.createTempDirectory(fullContainerName); - Path outPath = tempDirectory.resolve("stdout"); - Path errPath = tempDirectory.resolve("stderr"); - - File outFile = outPath.toFile(); - File errFile = errPath.toFile(); - LOGGER.info("Redirecting server stdout to: " + outFile.getAbsolutePath()); - LOGGER.info("Redirecting server stderr to: " + errFile.getAbsolutePath()); - String dockerImage = String.format("%s:%s", dockerImageName, dockerImageTag); - // First try and pull the docker image, this validates docker is available and running - // on the host, as well as gives time for the image to be downloaded independently of - // trying to start the container. (Below, when we first start the container we then attempt - // to issue a call against the api before we yield to run our tests.) - try { - Process p = - new ProcessBuilder() - .command("docker", "pull", dockerImage) - .redirectOutput(outFile) - .redirectError(errFile) - .start(); - p.waitFor(5, TimeUnit.MINUTES); - if (!ignorePullError && p.exitValue() != 0) { - dumpServerLogs(outFile, errFile); - throw new IllegalStateException( - String.format( - "Non-zero status while attempting to pull docker image '%s'", dockerImage)); - } - } catch (InterruptedException | IllegalThreadStateException e) { - dumpServerLogs(outFile, errFile); - throw new IllegalStateException( - String.format("Timeout while attempting to pull docker image '%s'", dockerImage)); - } - - int port = URI.create(baseUri).getPort(); - final Process process = - new ProcessBuilder() - .command( - "docker", - "run", - "-i", - "--rm", - "--publish", - port + ":9000", - String.format("--name=%s", fullContainerName), - dockerImage) - .redirectOutput(outFile) - .redirectError(errFile) - .start(); - boolean success = false; - try { - // wait a small amount of time for the server to come up before probing - Thread.sleep(500); - // wait for the server to come up - List existingResources = - runWithRetries( - TestBench.this::listRetryTests, - RetrySettings.newBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .setInitialRetryDelay(Duration.ofMillis(500)) - .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofSeconds(5)) - .build(), - new BasicResultRetryAlgorithm>() { - @Override - public boolean shouldRetry( - Throwable previousThrowable, List previousResponse) { - return previousThrowable instanceof SocketException; - } - }, - NanoClock.getDefaultClock()); - if (!existingResources.isEmpty()) { - LOGGER.info( - "Test Server already has retry tests in it, is it running outside the tests?"); - } - base.evaluate(); - success = true; - } catch (RetryHelperException e) { - dumpServerLogs(outFile, errFile); - throw new IllegalStateException( - "Failed to connect to server within a reasonable amount of time. Host url: " - + baseUri, - e.getCause()); - } finally { - process.destroy(); - // wait for the server to shutdown - runWithRetries( - () -> { - try { - listRetryTests(); - } catch (SocketException e) { - // desired result - return null; - } - throw new NotShutdownException(); - }, - RetrySettings.newBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .setInitialRetryDelay(Duration.ofMillis(500)) - .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofSeconds(5)) - .build(), - new BasicResultRetryAlgorithm>() { - @Override - public boolean shouldRetry(Throwable previousThrowable, List previousResponse) { - return previousThrowable instanceof NotShutdownException; - } - }, - NanoClock.getDefaultClock()); - if (cleanupStrategy == CleanupStrategy.ALWAYS - || (success && cleanupStrategy == CleanupStrategy.ONLY_ON_SUCCESS)) { - Files.delete(errPath); - Files.delete(outPath); - Files.delete(tempDirectory); - } - } - } - }; - } - - private void dumpServerLogs(File outFile, File errFile) throws IOException { - try { - LOGGER.warning("Dumping contents of stdout"); - dumpServerLog("stdout", outFile); - } finally { - LOGGER.warning("Dumping contents of stderr"); - dumpServerLog("stderr", errFile); - } - } - - private void dumpServerLog(String prefix, File out) throws IOException { - try (BufferedReader reader = new BufferedReader(new FileReader(out))) { - String line; - while ((line = reader.readLine()) != null) { - LOGGER.warning("<" + prefix + "> " + line); - } - } - } - - public static Builder newBuilder() { - return new Builder(); - } - - public static final class RetryTestResource { - public String id; - public Boolean completed; - public JsonObject instructions; - - public RetryTestResource() {} - - public RetryTestResource(JsonObject instructions) { - this.instructions = instructions; - } - - public static RetryTestResource newRetryTestResource(Method m, InstructionList l) { - RetryTestResource resource = new RetryTestResource(); - resource.instructions = new JsonObject(); - JsonArray instructions = new JsonArray(); - for (String s : l.getInstructionsList()) { - instructions.add(s); - } - resource.instructions.add(m.getName(), instructions); - return resource; - } - - @Override - public String toString() { - return "RetryTestResource{" - + "id='" - + id - + '\'' - + ", completed=" - + completed - + ", instructions=" - + instructions - + '}'; - } - } - - public static final class Builder { - private static final String DEFAULT_BASE_URI = "http://localhost:9000"; - private static final String DEFAULT_IMAGE_NAME = - "gcr.io/cloud-devrel-public-resources/storage-testbench"; - private static final String DEFAULT_IMAGE_TAG = "v0.11.0"; - private static final String DEFAULT_CONTAINER_NAME = "default"; - - private boolean ignorePullError; - private String baseUri; - private String dockerImageName; - private String dockerImageTag; - private CleanupStrategy cleanupStrategy; - private String containerName; - - private Builder() { - this( - false, - DEFAULT_BASE_URI, - DEFAULT_IMAGE_NAME, - DEFAULT_IMAGE_TAG, - CleanupStrategy.ALWAYS, - DEFAULT_CONTAINER_NAME); - } - - private Builder( - boolean ignorePullError, - String baseUri, - String dockerImageName, - String dockerImageTag, - CleanupStrategy cleanupStrategy, - String containerName) { - this.ignorePullError = ignorePullError; - this.baseUri = baseUri; - this.dockerImageName = dockerImageName; - this.dockerImageTag = dockerImageTag; - this.cleanupStrategy = cleanupStrategy; - this.containerName = containerName; - } - - public Builder setCleanupStrategy(CleanupStrategy cleanupStrategy) { - this.cleanupStrategy = requireNonNull(cleanupStrategy, "cleanupStrategy must be non null"); - return this; - } - - public Builder setIgnorePullError(boolean ignorePullError) { - this.ignorePullError = ignorePullError; - return this; - } - - public Builder setBaseUri(String baseUri) { - this.baseUri = requireNonNull(baseUri, "host must be non null"); - return this; - } - - public Builder setDockerImageName(String dockerImageName) { - this.dockerImageName = requireNonNull(dockerImageName, "dockerImageName must be non null"); - return this; - } - - public Builder setDockerImageTag(String dockerImageTag) { - this.dockerImageTag = requireNonNull(dockerImageTag, "dockerImageTag must be non null"); - return this; - } - - public Builder setContainerName(String containerName) { - this.containerName = requireNonNull(containerName, "containerName must be non null"); - return this; - } - - public TestBench build() { - return new TestBench( - ignorePullError, - baseUri, - dockerImageName, - dockerImageTag, - cleanupStrategy, - containerName); - } - } - - private static final class NotShutdownException extends RuntimeException {} -} diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/TestRetryConformance.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/TestRetryConformance.java deleted file mode 100644 index 027da5377d..0000000000 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/TestRetryConformance.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage.conformance.retry; - -import static java.util.Objects.requireNonNull; -import static org.junit.Assert.assertNotNull; - -import com.google.auth.ServiceAccountSigner; -import com.google.auth.oauth2.ServiceAccountCredentials; -import com.google.cloud.conformance.storage.v1.InstructionList; -import com.google.cloud.conformance.storage.v1.Method; -import com.google.common.base.Joiner; -import com.google.errorprone.annotations.Immutable; -import java.io.IOException; -import java.io.InputStream; -import java.net.URISyntaxException; -import java.net.URL; -import java.nio.charset.StandardCharsets; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.time.Clock; -import java.time.Instant; -import java.time.ZoneId; -import java.time.ZoneOffset; -import java.time.format.DateTimeFormatter; -import java.util.stream.Collectors; - -/** - * An individual resolved test case correlating config from {@link - * com.google.cloud.conformance.storage.v1.RetryTest}s: the specific rpc method being tested, the - * instructions and the corresponding mapping id. - * - *

Generates some unique values for use in parallel test execution such as bucket names, object - * names, etc. - */ -@Immutable -final class TestRetryConformance { - static final String BASE_ID; - - static { - Instant now = Clock.systemUTC().instant(); - DateTimeFormatter formatter = - DateTimeFormatter.ISO_LOCAL_TIME.withZone(ZoneId.from(ZoneOffset.UTC)); - BASE_ID = formatter.format(now).replaceAll("[:]", "").substring(0, 6); - } - - private final String projectId; - private final String bucketName; - private final String bucketName2; - private final String userProject; - private final String objectName; - - private final byte[] helloWorldUtf8Bytes = "Hello, World!!!".getBytes(StandardCharsets.UTF_8); - private final Path helloWorldFilePath = resolvePathForResource(); - private final ServiceAccountCredentials serviceAccountCredentials = - resolveServiceAccountCredentials(); - - private final String host; - - private final int scenarioId; - private final Method method; - private final InstructionList instruction; - private final boolean preconditionsProvided; - private final boolean expectSuccess; - private final int mappingId; - - TestRetryConformance( - String projectId, - String host, - int scenarioId, - Method method, - InstructionList instruction, - boolean preconditionsProvided, - boolean expectSuccess) { - this(projectId, host, scenarioId, method, instruction, preconditionsProvided, expectSuccess, 0); - } - - TestRetryConformance( - String projectId, - String host, - int scenarioId, - Method method, - InstructionList instruction, - boolean preconditionsProvided, - boolean expectSuccess, - int mappingId) { - this.projectId = projectId; - this.host = host; - this.scenarioId = scenarioId; - this.method = requireNonNull(method, "method must be non null"); - this.instruction = requireNonNull(instruction, "instruction must be non null"); - this.preconditionsProvided = preconditionsProvided; - this.expectSuccess = expectSuccess; - this.mappingId = mappingId; - String instructionsString = - this.instruction.getInstructionsList().stream() - .map(s -> s.replace("return-", "")) - .collect(Collectors.joining("_")); - this.bucketName = - String.format("%s_s%03d-%s-m%03d_bkt1", BASE_ID, scenarioId, instructionsString, mappingId); - this.bucketName2 = - String.format("%s_s%03d-%s-m%03d_bkt2", BASE_ID, scenarioId, instructionsString, mappingId); - this.userProject = - String.format("%s_s%03d-%s-m%03d_prj1", BASE_ID, scenarioId, instructionsString, mappingId); - this.objectName = - String.format("%s_s%03d-%s-m%03d_obj1", BASE_ID, scenarioId, instructionsString, mappingId); - } - - public String getProjectId() { - return projectId; - } - - public String getHost() { - return host; - } - - public String getBucketName() { - return bucketName; - } - - public String getBucketName2() { - return bucketName2; - } - - public String getUserProject() { - return userProject; - } - - public String getObjectName() { - return objectName; - } - - public byte[] getHelloWorldUtf8Bytes() { - return helloWorldUtf8Bytes; - } - - public Path getHelloWorldFilePath() { - return helloWorldFilePath; - } - - public int getScenarioId() { - return scenarioId; - } - - public Method getMethod() { - return method; - } - - public InstructionList getInstruction() { - return instruction; - } - - public boolean isPreconditionsProvided() { - return preconditionsProvided; - } - - public boolean isExpectSuccess() { - return expectSuccess; - } - - public int getMappingId() { - return mappingId; - } - - public ServiceAccountSigner getServiceAccountSigner() { - return serviceAccountCredentials; - } - - public String getTestName() { - String instructionsDesc = Joiner.on("_").join(instruction.getInstructionsList()); - return String.format( - "TestRetryConformance/%d-[%s]-%s-%d", - scenarioId, instructionsDesc, method.getName(), mappingId); - } - - @Override - public String toString() { - return getTestName(); - } - - private static Path resolvePathForResource() { - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - URL url = cl.getResource("com/google/cloud/storage/conformance/retry/hello-world.txt"); - assertNotNull(url); - try { - return Paths.get(url.toURI()); - } catch (URISyntaxException e) { - throw new RuntimeException(e); - } - } - - private static ServiceAccountCredentials resolveServiceAccountCredentials() { - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - InputStream inputStream = - cl.getResourceAsStream( - "com/google/cloud/conformance/storage/v1/test_service_account.not-a-test.json"); - assertNotNull(inputStream); - try { - return ServiceAccountCredentials.fromStream(inputStream); - } catch (IOException e) { - throw new RuntimeException(e); - } - } -} diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBlobWriteChannelTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBlobWriteChannelTest.java deleted file mode 100644 index 32ea48e576..0000000000 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBlobWriteChannelTest.java +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.storage.it; - -import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertTrue; - -import com.google.api.client.json.JsonParser; -import com.google.api.gax.rpc.FixedHeaderProvider; -import com.google.api.services.storage.model.StorageObject; -import com.google.cloud.NoCredentials; -import com.google.cloud.WriteChannel; -import com.google.cloud.conformance.storage.v1.InstructionList; -import com.google.cloud.conformance.storage.v1.Method; -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.DataGeneration; -import com.google.cloud.storage.PackagePrivateMethodWorkarounds; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.Storage.BlobWriteOption; -import com.google.cloud.storage.StorageOptions; -import com.google.cloud.storage.conformance.retry.TestBench; -import com.google.cloud.storage.conformance.retry.TestBench.RetryTestResource; -import com.google.cloud.storage.spi.v1.StorageRpc; -import com.google.common.collect.ImmutableMap; -import com.google.common.reflect.Reflection; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.util.Optional; -import java.util.Random; -import java.util.logging.Logger; -import org.junit.ClassRule; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TestName; -import org.threeten.bp.Clock; -import org.threeten.bp.Instant; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZoneOffset; -import org.threeten.bp.format.DateTimeFormatter; - -public final class ITBlobWriteChannelTest { - private static final Logger LOGGER = Logger.getLogger(ITBlobWriteChannelTest.class.getName()); - private static final String NOW_STRING; - - static { - Instant now = Clock.systemUTC().instant(); - DateTimeFormatter formatter = - DateTimeFormatter.ISO_LOCAL_DATE_TIME.withZone(ZoneId.from(ZoneOffset.UTC)); - NOW_STRING = formatter.format(now); - } - - @ClassRule - public static final TestBench testBench = - TestBench.newBuilder().setContainerName("blob-write-channel-test").build(); - - @Rule public final TestName testName = new TestName(); - - @Rule public final DataGeneration dataGeneration = new DataGeneration(new Random(1234567890)); - - /** - * Test for unexpected EOF at the beginning of trying to read the json response. - * - *

The error of this case shows up as an IllegalArgumentException rather than a json parsing - * error which comes from {@link JsonParser}{@code #startParsing()} which fails to find a node to - * start parsing. - */ - @Test - public void testJsonEOF_0B() throws IOException { - int contentSize = 512 * 1024; - int cappedByteCount = 0; - - doJsonUnexpectedEOFTest(contentSize, cappedByteCount); - } - - /** Test for unexpected EOF 10 bytes into the json response */ - @Test - public void testJsonEOF_10B() throws IOException { - int contentSize = 512 * 1024; - int cappedByteCount = 10; - - doJsonUnexpectedEOFTest(contentSize, cappedByteCount); - } - - private void doJsonUnexpectedEOFTest(int contentSize, int cappedByteCount) throws IOException { - String blobPath = String.format("%s/%s/blob", testName.getMethodName(), NOW_STRING); - - BucketInfo bucketInfo = BucketInfo.of(dataGeneration.getBucketName()); - BlobInfo blobInfoGen0 = BlobInfo.newBuilder(bucketInfo, blobPath, 0L).build(); - - RetryTestResource retryTestResource = - RetryTestResource.newRetryTestResource( - Method.newBuilder().setName("storage.objects.insert").build(), - InstructionList.newBuilder() - .addInstructions( - String.format("return-broken-stream-final-chunk-after-%dB", cappedByteCount)) - .build()); - RetryTestResource retryTest = testBench.createRetryTest(retryTestResource); - - StorageOptions baseOptions = - StorageOptions.newBuilder() - .setCredentials(NoCredentials.getInstance()) - .setHost(testBench.getBaseUri()) - .setProjectId("project-id") - .build(); - StorageRpc noHeader = (StorageRpc) baseOptions.getRpc(); - StorageRpc yesHeader = - (StorageRpc) - baseOptions - .toBuilder() - .setHeaderProvider( - FixedHeaderProvider.create(ImmutableMap.of("x-retry-test-id", retryTest.id))) - .build() - .getRpc(); - //noinspection UnstableApiUsage - StorageOptions storageOptions = - baseOptions - .toBuilder() - .setServiceRpcFactory( - options -> - Reflection.newProxy( - StorageRpc.class, - (proxy, method, args) -> { - try { - if ("writeWithResponse".equals(method.getName())) { - boolean lastChunk = (boolean) args[5]; - LOGGER.info( - String.format( - "writeWithResponse called. (lastChunk = %b)", lastChunk)); - if (lastChunk) { - return method.invoke(yesHeader, args); - } - } - return method.invoke(noHeader, args); - } catch (Exception e) { - if (e.getCause() != null) { - throw e.getCause(); - } else { - throw e; - } - } - })) - .build(); - - Storage testStorage = storageOptions.getService(); - - testStorage.create(bucketInfo); - - ByteBuffer content = dataGeneration.randByteBuffer(contentSize); - // create a duplicate to preserve the initial offset and limit for assertion later - ByteBuffer expected = content.duplicate(); - - WriteChannel w = testStorage.writer(blobInfoGen0, BlobWriteOption.generationMatch()); - w.write(content); - w.close(); - - RetryTestResource postRunState = testBench.getRetryTest(retryTest); - assertTrue(postRunState.completed); - - Optional optionalStorageObject = - PackagePrivateMethodWorkarounds.maybeGetStorageObjectFunction().apply(w); - - assertTrue(optionalStorageObject.isPresent()); - StorageObject storageObject = optionalStorageObject.get(); - assertThat(storageObject.getName()).isEqualTo(blobInfoGen0.getName()); - - // construct a new blob id, without a generation, so we get the latest when we perform a get - BlobId blobIdGen1 = BlobId.of(storageObject.getBucket(), storageObject.getName()); - Blob blobGen2 = testStorage.get(blobIdGen1); - assertEquals(contentSize, (long) blobGen2.getSize()); - assertNotEquals(blobInfoGen0.getGeneration(), blobGen2.getGeneration()); - ByteArrayOutputStream actualData = new ByteArrayOutputStream(); - blobGen2.downloadTo(actualData); - ByteBuffer actual = ByteBuffer.wrap(actualData.toByteArray()); - assertEquals(expected, actual); - } -} diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITStorageTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITStorageTest.java index a9fb7ae92d..6b2098a36a 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITStorageTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITStorageTest.java @@ -69,15 +69,12 @@ import com.google.cloud.storage.BucketInfo.LifecycleRule.LifecycleCondition; import com.google.cloud.storage.CopyWriter; import com.google.cloud.storage.Cors; -import com.google.cloud.storage.DataGeneration; import com.google.cloud.storage.HmacKey; -import com.google.cloud.storage.HmacKey.HmacKeyState; import com.google.cloud.storage.HttpMethod; import com.google.cloud.storage.Notification; import com.google.cloud.storage.NotificationInfo; import com.google.cloud.storage.PostPolicyV4; import com.google.cloud.storage.PostPolicyV4.PostFieldsV4; -import com.google.cloud.storage.Rpo; import com.google.cloud.storage.ServiceAccount; import com.google.cloud.storage.Storage; import com.google.cloud.storage.Storage.BlobField; @@ -89,9 +86,6 @@ import com.google.cloud.storage.StorageException; import com.google.cloud.storage.StorageOptions; import com.google.cloud.storage.StorageRoles; -import com.google.cloud.storage.spi.StorageRpcFactory; -import com.google.cloud.storage.spi.v1.StorageRpc; -import com.google.cloud.storage.spi.v1.StorageRpc.Option; import com.google.cloud.storage.testing.RemoteStorageHelper; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -100,8 +94,6 @@ import com.google.common.collect.Lists; import com.google.common.io.BaseEncoding; import com.google.common.io.ByteStreams; -import com.google.common.reflect.AbstractInvocationHandler; -import com.google.common.reflect.Reflection; import com.google.iam.v1.Binding; import com.google.iam.v1.GetIamPolicyRequest; import com.google.iam.v1.IAMPolicyGrpc; @@ -117,10 +109,8 @@ import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; -import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; -import java.lang.reflect.Method; import java.net.URL; import java.net.URLConnection; import java.nio.ByteBuffer; @@ -140,11 +130,9 @@ import java.util.UUID; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; import java.util.logging.Level; import java.util.logging.Logger; import java.util.zip.GZIPInputStream; -import java.util.zip.GZIPOutputStream; import javax.crypto.spec.SecretKeySpec; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; @@ -155,14 +143,7 @@ import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; import org.junit.AfterClass; import org.junit.BeforeClass; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.TestName; -import org.threeten.bp.Clock; -import org.threeten.bp.Instant; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZoneOffset; -import org.threeten.bp.format.DateTimeFormatter; public class ITStorageTest { @@ -231,8 +212,6 @@ public class ITStorageTest { private static final Notification.PayloadFormat PAYLOAD_FORMAT = Notification.PayloadFormat.JSON_API_V1.JSON_API_V1; private static final Map CUSTOM_ATTRIBUTES = ImmutableMap.of("label1", "value1"); - @Rule public final TestName testName = new TestName(); - @Rule public final DataGeneration dataGeneration = new DataGeneration(new Random(1234567890)); @BeforeClass public static void beforeClass() throws IOException { @@ -864,40 +843,6 @@ public void testGetBlobFailNonExistingGeneration() { } } - @Test - public void testGetBlobRawInput() throws IOException { - Path file = File.createTempFile("temp", ".txt").toPath(); - Files.write(file, "hello world".getBytes()); - - File gzippedFile = File.createTempFile("temp", ".gz"); - - GZIPOutputStream gzipOutputStream = new GZIPOutputStream(new FileOutputStream(gzippedFile)); - Files.copy(file, gzipOutputStream); - gzipOutputStream.close(); - - String blobName = "zipped_blob"; - BlobId blobId = BlobId.of(BUCKET, blobName); - BlobInfo blobInfo = - BlobInfo.newBuilder(blobId).setContentEncoding("gzip").setContentType("text/plain").build(); - - storage.createFrom(blobInfo, gzippedFile.toPath()); - - Path rawInputGzippedFile = File.createTempFile("rawinputgzippedfile", ".txt").toPath(); - Blob blob = storage.get(blobId); - - blob.downloadTo(rawInputGzippedFile, Blob.BlobSourceOption.shouldReturnRawInputStream(true)); - - assertArrayEquals( - Files.readAllBytes(gzippedFile.toPath()), Files.readAllBytes(rawInputGzippedFile)); - - Path unzippedFile = File.createTempFile("unzippedfile", ".txt").toPath(); - storage - .get(blobId) - .downloadTo(unzippedFile, Blob.BlobSourceOption.shouldReturnRawInputStream(false)); - - assertArrayEquals("hello world".getBytes(), Files.readAllBytes(unzippedFile)); - } - @Test(timeout = 5000) public void testListBlobsSelectedFields() throws InterruptedException { String[] blobNames = { @@ -2221,11 +2166,11 @@ public void testDownloadPublicBlobWithoutAuthentication() { // try to download blobs from a public bucket String landsatBucket = "gcp-public-data-landsat"; - String landsatPrefix = "LC08/01/001/002/LC08_L1GT_001002_20160817_20170322_01_T2/"; - String landsatBlob = landsatPrefix + "LC08_L1GT_001002_20160817_20170322_01_T2_ANG.txt"; + String landsatPrefix = "LC08/PRE/044/034/LC80440342016259LGN00/"; + String landsatBlob = landsatPrefix + "LC80440342016259LGN00_MTL.txt"; byte[] bytes = unauthorizedStorage.readAllBytes(landsatBucket, landsatBlob); - assertThat(bytes.length).isEqualTo(117255); + assertThat(bytes.length).isEqualTo(7903); int numBlobs = 0; Iterator blobIterator = unauthorizedStorage @@ -2236,7 +2181,7 @@ public void testDownloadPublicBlobWithoutAuthentication() { numBlobs++; blobIterator.next(); } - assertThat(numBlobs).isEqualTo(14); + assertThat(numBlobs).isEqualTo(13); // try to download blobs from a bucket that requires authentication // authenticated client will succeed @@ -2468,11 +2413,8 @@ public void testBlobAcl() { @Test public void testHmacKey() { - String serviceAccountEmail = System.getenv("IT_SERVICE_ACCOUNT_EMAIL"); - assertNotNull("Unable to determine service account email", serviceAccountEmail); - ServiceAccount serviceAccount = ServiceAccount.of(serviceAccountEmail); + ServiceAccount serviceAccount = ServiceAccount.of(System.getenv("IT_SERVICE_ACCOUNT_EMAIL")); try { - cleanUpHmacKeys(serviceAccount); HmacKey hmacKey = storage.createHmacKey(serviceAccount); String secretKey = hmacKey.getSecretKey(); @@ -2545,18 +2487,10 @@ public void testHmacKey() { assertEquals(2, Iterators.size(metadatas.getValues().iterator())); } finally { - cleanUpHmacKeys(serviceAccount); - } - } - - private void cleanUpHmacKeys(ServiceAccount serviceAccount) { - Page metadatas = - storage.listHmacKeys(Storage.ListHmacKeysOption.serviceAccount(serviceAccount)); - for (HmacKey.HmacKeyMetadata hmacKeyMetadata : metadatas.iterateAll()) { - if (hmacKeyMetadata.getState() == HmacKeyState.ACTIVE) { - hmacKeyMetadata = storage.updateHmacKeyState(hmacKeyMetadata, HmacKeyState.INACTIVE); - } - if (hmacKeyMetadata.getState() == HmacKeyState.INACTIVE) { + Page metadatas = + storage.listHmacKeys(Storage.ListHmacKeysOption.serviceAccount(serviceAccount)); + for (HmacKey.HmacKeyMetadata hmacKeyMetadata : metadatas.iterateAll()) { + storage.updateHmacKeyState(hmacKeyMetadata, HmacKey.HmacKeyState.INACTIVE); storage.deleteHmacKey(hmacKeyMetadata); } } @@ -3057,7 +2991,7 @@ private void retentionPolicyLockRequesterPays(boolean requesterPays) storage.update(bucketInfo, Storage.BucketTargetOption.userProject(projectId)); assertFalse(updateBucket.requesterPays()); } - RemoteStorageHelper.forceDelete(storage, bucketName, 5, TimeUnit.SECONDS, projectId); + RemoteStorageHelper.forceDelete(storage, bucketName, 5, TimeUnit.SECONDS); } } @@ -3342,173 +3276,20 @@ public void testEnableAndDisableUniformBucketLevelAccessOnExistingBucket() throw } } - private Bucket generatePublicAccessPreventionBucket(String bucketName, boolean enforced) { - return storage.create( - Bucket.newBuilder(bucketName) - .setIamConfiguration( - BucketInfo.IamConfiguration.newBuilder() - .setPublicAccessPrevention( - enforced - ? BucketInfo.PublicAccessPrevention.ENFORCED - : BucketInfo.PublicAccessPrevention.INHERITED) - .build()) - .build()); - } - - @Test - public void testEnforcedPublicAccessPreventionOnBucket() throws Exception { - String papBucket = RemoteStorageHelper.generateBucketName(); - try { - Bucket bucket = generatePublicAccessPreventionBucket(papBucket, true); - // Making bucket public should fail. - try { - storage.setIamPolicy( - papBucket, - Policy.newBuilder() - .setVersion(3) - .setBindings( - ImmutableList.of( - com.google.cloud.Binding.newBuilder() - .setRole("roles/storage.objectViewer") - .addMembers("allUsers") - .build())) - .build()); - fail("pap: expected adding allUsers policy to bucket should fail"); - } catch (StorageException storageException) { - // Creating a bucket with roles/storage.objectViewer is not - // allowed when publicAccessPrevention is enabled. - assertEquals(storageException.getCode(), 412); - } - - // Making object public via ACL should fail. - try { - // Create a public object - bucket.create( - "pap-test-object", - "".getBytes(), - Bucket.BlobTargetOption.predefinedAcl(Storage.PredefinedAcl.PUBLIC_READ)); - fail("pap: expected adding allUsers ACL to object should fail"); - } catch (StorageException storageException) { - // Creating an object with allUsers roles/storage.viewer permission - // is not allowed. When Public Access Prevention is enabled. - assertEquals(storageException.getCode(), 412); - } - } finally { - RemoteStorageHelper.forceDelete(storage, papBucket, 1, TimeUnit.MINUTES); - } - } - - @Test - public void testUnspecifiedPublicAccessPreventionOnBucket() throws Exception { - String papBucket = RemoteStorageHelper.generateBucketName(); - try { - Bucket bucket = generatePublicAccessPreventionBucket(papBucket, false); - - // Now, making object public or making bucket public should succeed. - try { - // Create a public object - bucket.create( - "pap-test-object", - "".getBytes(), - Bucket.BlobTargetOption.predefinedAcl(Storage.PredefinedAcl.PUBLIC_READ)); - } catch (StorageException storageException) { - fail("pap: expected adding allUsers ACL to object to succeed"); - } - - // Now, making bucket public should succeed. - try { - storage.setIamPolicy( - papBucket, - Policy.newBuilder() - .setVersion(3) - .setBindings( - ImmutableList.of( - com.google.cloud.Binding.newBuilder() - .setRole("roles/storage.objectViewer") - .addMembers("allUsers") - .build())) - .build()); - } catch (StorageException storageException) { - fail("pap: expected adding allUsers policy to bucket to succeed"); - } - } finally { - RemoteStorageHelper.forceDelete(storage, papBucket, 1, TimeUnit.MINUTES); - } - } - - @Test - public void testUBLAWithPublicAccessPreventionOnBucket() throws Exception { - String papBucket = RemoteStorageHelper.generateBucketName(); - try { - Bucket bucket = generatePublicAccessPreventionBucket(papBucket, false); - assertEquals( - bucket.getIamConfiguration().getPublicAccessPrevention(), - BucketInfo.PublicAccessPrevention.INHERITED); - assertFalse(bucket.getIamConfiguration().isUniformBucketLevelAccessEnabled()); - assertFalse(bucket.getIamConfiguration().isBucketPolicyOnlyEnabled()); - - // Update PAP setting to ENFORCED and should not affect UBLA setting. - bucket - .toBuilder() - .setIamConfiguration( - bucket - .getIamConfiguration() - .toBuilder() - .setPublicAccessPrevention(BucketInfo.PublicAccessPrevention.ENFORCED) - .build()) - .build() - .update(); - bucket = storage.get(papBucket, Storage.BucketGetOption.fields(BucketField.IAMCONFIGURATION)); - assertEquals( - bucket.getIamConfiguration().getPublicAccessPrevention(), - BucketInfo.PublicAccessPrevention.ENFORCED); - assertFalse(bucket.getIamConfiguration().isUniformBucketLevelAccessEnabled()); - assertFalse(bucket.getIamConfiguration().isBucketPolicyOnlyEnabled()); - - // Updating UBLA should not affect PAP setting. - bucket = - bucket - .toBuilder() - .setIamConfiguration( - bucket - .getIamConfiguration() - .toBuilder() - .setIsUniformBucketLevelAccessEnabled(true) - .build()) - .build() - .update(); - assertTrue(bucket.getIamConfiguration().isUniformBucketLevelAccessEnabled()); - assertTrue(bucket.getIamConfiguration().isBucketPolicyOnlyEnabled()); - assertEquals( - bucket.getIamConfiguration().getPublicAccessPrevention(), - BucketInfo.PublicAccessPrevention.ENFORCED); - } finally { - RemoteStorageHelper.forceDelete(storage, papBucket, 1, TimeUnit.MINUTES); - } - } - @Test public void testUploadUsingSignedURL() throws Exception { String blobName = "test-signed-url-upload"; BlobInfo blob = BlobInfo.newBuilder(BUCKET, blobName).build(); assertNotNull(storage.create(blob)); - Map extensionHeaders = new HashMap<>(); - extensionHeaders.put("x-goog-resumable", "start"); for (Storage.SignUrlOption urlStyle : Arrays.asList( Storage.SignUrlOption.withPathStyle(), Storage.SignUrlOption.withVirtualHostedStyle())) { URL signUrl = storage.signUrl( - blob, - 1, - TimeUnit.HOURS, - Storage.SignUrlOption.httpMethod(HttpMethod.POST), - Storage.SignUrlOption.withExtHeaders(extensionHeaders), - urlStyle); + blob, 1, TimeUnit.HOURS, Storage.SignUrlOption.httpMethod(HttpMethod.POST), urlStyle); byte[] bytesArrayToUpload = BLOB_STRING_CONTENT.getBytes(); - Storage unauthenticatedStorage = StorageOptions.getUnauthenticatedInstance().getService(); - try (WriteChannel writer = unauthenticatedStorage.writer(signUrl)) { + try (WriteChannel writer = storage.writer(signUrl)) { writer.write(ByteBuffer.wrap(bytesArrayToUpload, 0, bytesArrayToUpload.length)); } @@ -3630,7 +3411,7 @@ public void testBlobReload() throws Exception { fail("StorageException was expected"); } catch (StorageException e) { assertEquals(412, e.getCode()); - assertEquals("conditionNotMet", e.getReason()); + assertEquals("Precondition Failed", e.getMessage()); } Blob updated = blob.reload(); @@ -3931,141 +3712,4 @@ public void testWriterWithKmsKeyName() throws IOException { assertThat(blob.getKmsKeyName()).isNotNull(); assertThat(storage.delete(BUCKET, blobName)).isTrue(); } - - @Test - public void blobWriteChannel_handlesRecoveryOnLastChunkWhenGenerationIsPresent_multipleChunks() - throws IOException { - int _2MiB = 256 * 1024; - int contentSize = 292_617; - - blobWriteChannel_handlesRecoveryOnLastChunkWhenGenerationIsPresent(_2MiB, contentSize); - } - - @Test - public void blobWriteChannel_handlesRecoveryOnLastChunkWhenGenerationIsPresent_singleChunk() - throws IOException { - int _4MiB = 256 * 1024 * 2; - int contentSize = 292_617; - - blobWriteChannel_handlesRecoveryOnLastChunkWhenGenerationIsPresent(_4MiB, contentSize); - } - - private void blobWriteChannel_handlesRecoveryOnLastChunkWhenGenerationIsPresent( - int chunkSize, int contentSize) throws IOException { - Instant now = Clock.systemUTC().instant(); - DateTimeFormatter formatter = - DateTimeFormatter.ISO_LOCAL_DATE_TIME.withZone(ZoneId.from(ZoneOffset.UTC)); - String nowString = formatter.format(now); - - String blobPath = String.format("%s/%s/blob", testName.getMethodName(), nowString); - BlobId blobId = BlobId.of(BUCKET, blobPath); - BlobInfo blobInfo = BlobInfo.newBuilder(blobId).build(); - - ByteBuffer contentGen1 = dataGeneration.randByteBuffer(contentSize); - ByteBuffer contentGen2 = dataGeneration.randByteBuffer(contentSize); - ByteBuffer contentGen2Expected = contentGen2.duplicate(); - Storage storage = StorageOptions.getDefaultInstance().getService(); - WriteChannel ww = storage.writer(blobInfo); - ww.setChunkSize(chunkSize); - ww.write(contentGen1); - ww.close(); - - Blob blobGen1 = storage.get(blobId); - - final AtomicBoolean exceptionThrown = new AtomicBoolean(false); - - Storage testStorage = - StorageOptions.newBuilder() - .setServiceRpcFactory( - new StorageRpcFactory() { - /** - * Here we're creating a proxy of StorageRpc where we can delegate all calls to - * the normal implementation, except in the case of {@link - * StorageRpc#writeWithResponse(String, byte[], int, long, int, boolean)} where - * {@code lastChunk == true}. We allow the call to execute, but instead of - * returning the result we throw an IOException to simulate a prematurely close - * connection. This behavior is to ensure appropriate handling of a completed - * upload where the ACK wasn't received. In particular, if an upload is initiated - * against an object where an {@link Option#IF_GENERATION_MATCH} simply calling - * get on an object can result in a 404 because the object that is created while - * the BlobWriteChannel is executing will be a new generation. - */ - @SuppressWarnings("UnstableApiUsage") - @Override - public StorageRpc create(final StorageOptions options) { - return Reflection.newProxy( - StorageRpc.class, - new AbstractInvocationHandler() { - final StorageRpc delegate = - (StorageRpc) StorageOptions.getDefaultInstance().getRpc(); - - @Override - protected Object handleInvocation( - Object proxy, Method method, Object[] args) throws Throwable { - if ("writeWithResponse".equals(method.getName())) { - Object result = method.invoke(delegate, args); - boolean lastChunk = (boolean) args[5]; - // if we're on the lastChunk simulate a connection failure which - // happens after the request was processed but before response could - // be received by the client. - if (lastChunk) { - exceptionThrown.set(true); - throw StorageException.translate( - new IOException("simulated Connection closed prematurely")); - } else { - return result; - } - } - return method.invoke(delegate, args); - } - }); - } - }) - .build() - .getService(); - - try (WriteChannel w = testStorage.writer(blobGen1, BlobWriteOption.generationMatch())) { - w.setChunkSize(chunkSize); - - w.write(contentGen2); - } - - assertTrue("Expected an exception to be thrown for the last chunk", exceptionThrown.get()); - - Blob blobGen2 = storage.get(blobId); - assertEquals(contentSize, (long) blobGen2.getSize()); - assertNotEquals(blobInfo.getGeneration(), blobGen2.getGeneration()); - ByteArrayOutputStream actualData = new ByteArrayOutputStream(); - blobGen2.downloadTo(actualData); - assertEquals(contentGen2Expected, ByteBuffer.wrap(actualData.toByteArray())); - } - - @Test - public void testRpoConfig() { - String rpoBucket = RemoteStorageHelper.generateBucketName(); - try { - Bucket bucket = - storage.create( - BucketInfo.newBuilder(rpoBucket).setLocation("NAM4").setRpo(Rpo.ASYNC_TURBO).build()); - assertEquals("ASYNC_TURBO", bucket.getRpo().toString()); - - bucket.toBuilder().setRpo(Rpo.DEFAULT).build().update(); - - assertEquals("DEFAULT", storage.get(rpoBucket).getRpo().toString()); - } finally { - storage.delete(rpoBucket); - } - } - - private static String randString(Random rand, int length) { - final StringBuilder sb = new StringBuilder(); - while (sb.length() < length) { - int i = rand.nextInt('z'); - char c = (char) i; - if (Character.isLetter(c) || Character.isDigit(c)) { - sb.append(c); - } - } - return sb.toString(); - } } diff --git a/google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/hello-world.txt b/google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/hello-world.txt deleted file mode 100644 index 5ac001b76f..0000000000 --- a/google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/hello-world.txt +++ /dev/null @@ -1 +0,0 @@ -Hello, World!!! diff --git a/google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/testNamesWhichCanFail.txt b/google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/testNamesWhichCanFail.txt deleted file mode 100644 index e09579972e..0000000000 --- a/google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/testNamesWhichCanFail.txt +++ /dev/null @@ -1,7 +0,0 @@ -# Each line should be a full test name -# Each test name present in the file will be expected to pass in a CI environment -# -# This list can be regenerated by running the following command in a shell: -# mvn -Penable-integration-test clean verify && xq '//testsuite/testcase[./error or ./failure]/@name' google-cloud-storage/target/failsafe-reports/TEST-com.google.cloud.storage.conformance.retry.ITRetryConformanceTest-sponge_log.xml | tail -n+2 | head -n-1 | sed 's# test\[##g' | sed 's#\]##g' | sort | tee -a google-cloud-storage/src/test/resources/com/google/cloud/storage/conformance/retry/testNamesWhichCanFail.txt -# where xq is the package from https://github.com/jeffbr13/xq - diff --git a/grpc-google-cloud-storage-v2/pom.xml b/grpc-google-cloud-storage-v2/pom.xml deleted file mode 100644 index 56e5f2ac52..0000000000 --- a/grpc-google-cloud-storage-v2/pom.xml +++ /dev/null @@ -1,60 +0,0 @@ - - 4.0.0 - com.google.api.grpc - grpc-google-cloud-storage-v2 - 2.4.6-alpha-SNAPSHOT - grpc-google-cloud-storage-v2 - GRPC library for grpc-google-cloud-storage-v2 - - com.google.cloud - google-cloud-storage-parent - 2.4.6-SNAPSHOT - - - - io.grpc - grpc-api - - - io.grpc - grpc-stub - - - io.grpc - grpc-protobuf - - - com.google.protobuf - protobuf-java - - - com.google.api.grpc - proto-google-cloud-storage-v2 - - - com.google.guava - guava - - - com.google.api.grpc - proto-google-iam-v1 - - - - - - java9 - - [9,) - - - - javax.annotation - javax.annotation-api - - - - - 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 deleted file mode 100644 index f3774e9a5f..0000000000 --- a/grpc-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageGrpc.java +++ /dev/null @@ -1,3609 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.storage.v2; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - * - * - *

- * ## API Overview and Naming Syntax
- * The Cloud Storage gRPC API allows applications to read and write data through
- * the abstractions of buckets and objects. For a description of these
- * abstractions please see https://cloud.google.com/storage/docs.
- * Resources are named as follows:
- *   - Projects are referred to as they are defined by the Resource Manager API,
- *     using strings like `projects/123456` or `projects/my-string-id`.
- *   - Buckets are named using string names of the form:
- *     `projects/{project}/buckets/{bucket}`
- *     For globally unique buckets, `_` may be substituted for the project.
- *   - Objects are uniquely identified by their name along with the name of the
- *     bucket they belong to, as separate strings in this API. For example:
- *       ReadObjectRequest {
- *         bucket: 'projects/_/buckets/my-bucket'
- *         object: 'my-object'
- *       }
- *     Note that object names can contain `/` characters, which are treated as
- *     any other character (no special directory semantics).
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/storage/v2/storage.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class StorageGrpc { - - private StorageGrpc() {} - - public static final String SERVICE_NAME = "google.storage.v2.Storage"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.DeleteBucketRequest, com.google.protobuf.Empty> - getDeleteBucketMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "DeleteBucket", - requestType = com.google.storage.v2.DeleteBucketRequest.class, - responseType = com.google.protobuf.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.DeleteBucketRequest, com.google.protobuf.Empty> - getDeleteBucketMethod() { - io.grpc.MethodDescriptor - getDeleteBucketMethod; - if ((getDeleteBucketMethod = StorageGrpc.getDeleteBucketMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getDeleteBucketMethod = StorageGrpc.getDeleteBucketMethod) == null) { - StorageGrpc.getDeleteBucketMethod = - getDeleteBucketMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteBucket")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.DeleteBucketRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("DeleteBucket")) - .build(); - } - } - } - return getDeleteBucketMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.GetBucketRequest, com.google.storage.v2.Bucket> - getGetBucketMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetBucket", - requestType = com.google.storage.v2.GetBucketRequest.class, - responseType = com.google.storage.v2.Bucket.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.GetBucketRequest, com.google.storage.v2.Bucket> - getGetBucketMethod() { - io.grpc.MethodDescriptor - getGetBucketMethod; - if ((getGetBucketMethod = StorageGrpc.getGetBucketMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getGetBucketMethod = StorageGrpc.getGetBucketMethod) == null) { - StorageGrpc.getGetBucketMethod = - getGetBucketMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBucket")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.GetBucketRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.Bucket.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("GetBucket")) - .build(); - } - } - } - return getGetBucketMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.CreateBucketRequest, com.google.storage.v2.Bucket> - getCreateBucketMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "CreateBucket", - requestType = com.google.storage.v2.CreateBucketRequest.class, - responseType = com.google.storage.v2.Bucket.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.CreateBucketRequest, com.google.storage.v2.Bucket> - getCreateBucketMethod() { - io.grpc.MethodDescriptor< - com.google.storage.v2.CreateBucketRequest, com.google.storage.v2.Bucket> - getCreateBucketMethod; - if ((getCreateBucketMethod = StorageGrpc.getCreateBucketMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getCreateBucketMethod = StorageGrpc.getCreateBucketMethod) == null) { - StorageGrpc.getCreateBucketMethod = - getCreateBucketMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateBucket")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.CreateBucketRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.Bucket.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("CreateBucket")) - .build(); - } - } - } - return getCreateBucketMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.ListBucketsRequest, com.google.storage.v2.ListBucketsResponse> - getListBucketsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListBuckets", - requestType = com.google.storage.v2.ListBucketsRequest.class, - responseType = com.google.storage.v2.ListBucketsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.ListBucketsRequest, com.google.storage.v2.ListBucketsResponse> - getListBucketsMethod() { - io.grpc.MethodDescriptor< - com.google.storage.v2.ListBucketsRequest, com.google.storage.v2.ListBucketsResponse> - getListBucketsMethod; - if ((getListBucketsMethod = StorageGrpc.getListBucketsMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getListBucketsMethod = StorageGrpc.getListBucketsMethod) == null) { - StorageGrpc.getListBucketsMethod = - getListBucketsMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListBuckets")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.ListBucketsRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.ListBucketsResponse.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("ListBuckets")) - .build(); - } - } - } - return getListBucketsMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.LockBucketRetentionPolicyRequest, com.google.storage.v2.Bucket> - getLockBucketRetentionPolicyMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "LockBucketRetentionPolicy", - requestType = com.google.storage.v2.LockBucketRetentionPolicyRequest.class, - responseType = com.google.storage.v2.Bucket.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.LockBucketRetentionPolicyRequest, com.google.storage.v2.Bucket> - getLockBucketRetentionPolicyMethod() { - io.grpc.MethodDescriptor< - com.google.storage.v2.LockBucketRetentionPolicyRequest, com.google.storage.v2.Bucket> - getLockBucketRetentionPolicyMethod; - if ((getLockBucketRetentionPolicyMethod = StorageGrpc.getLockBucketRetentionPolicyMethod) - == null) { - synchronized (StorageGrpc.class) { - if ((getLockBucketRetentionPolicyMethod = StorageGrpc.getLockBucketRetentionPolicyMethod) - == null) { - StorageGrpc.getLockBucketRetentionPolicyMethod = - getLockBucketRetentionPolicyMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - generateFullMethodName(SERVICE_NAME, "LockBucketRetentionPolicy")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.LockBucketRetentionPolicyRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.Bucket.getDefaultInstance())) - .setSchemaDescriptor( - new StorageMethodDescriptorSupplier("LockBucketRetentionPolicy")) - .build(); - } - } - } - return getLockBucketRetentionPolicyMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> - getGetIamPolicyMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetIamPolicy", - requestType = com.google.iam.v1.GetIamPolicyRequest.class, - responseType = com.google.iam.v1.Policy.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> - getGetIamPolicyMethod() { - io.grpc.MethodDescriptor - getGetIamPolicyMethod; - if ((getGetIamPolicyMethod = StorageGrpc.getGetIamPolicyMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getGetIamPolicyMethod = StorageGrpc.getGetIamPolicyMethod) == null) { - StorageGrpc.getGetIamPolicyMethod = - getGetIamPolicyMethod = - io.grpc.MethodDescriptor - .newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetIamPolicy")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.iam.v1.GetIamPolicyRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.iam.v1.Policy.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("GetIamPolicy")) - .build(); - } - } - } - return getGetIamPolicyMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> - getSetIamPolicyMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "SetIamPolicy", - requestType = com.google.iam.v1.SetIamPolicyRequest.class, - responseType = com.google.iam.v1.Policy.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> - getSetIamPolicyMethod() { - io.grpc.MethodDescriptor - getSetIamPolicyMethod; - if ((getSetIamPolicyMethod = StorageGrpc.getSetIamPolicyMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getSetIamPolicyMethod = StorageGrpc.getSetIamPolicyMethod) == null) { - StorageGrpc.getSetIamPolicyMethod = - getSetIamPolicyMethod = - io.grpc.MethodDescriptor - .newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetIamPolicy")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.iam.v1.SetIamPolicyRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.iam.v1.Policy.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("SetIamPolicy")) - .build(); - } - } - } - return getSetIamPolicyMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> - getTestIamPermissionsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "TestIamPermissions", - requestType = com.google.iam.v1.TestIamPermissionsRequest.class, - responseType = com.google.iam.v1.TestIamPermissionsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> - getTestIamPermissionsMethod() { - io.grpc.MethodDescriptor< - com.google.iam.v1.TestIamPermissionsRequest, - com.google.iam.v1.TestIamPermissionsResponse> - getTestIamPermissionsMethod; - if ((getTestIamPermissionsMethod = StorageGrpc.getTestIamPermissionsMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getTestIamPermissionsMethod = StorageGrpc.getTestIamPermissionsMethod) == null) { - StorageGrpc.getTestIamPermissionsMethod = - getTestIamPermissionsMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "TestIamPermissions")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.iam.v1.TestIamPermissionsRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.iam.v1.TestIamPermissionsResponse.getDefaultInstance())) - .setSchemaDescriptor( - new StorageMethodDescriptorSupplier("TestIamPermissions")) - .build(); - } - } - } - return getTestIamPermissionsMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.UpdateBucketRequest, com.google.storage.v2.Bucket> - getUpdateBucketMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "UpdateBucket", - requestType = com.google.storage.v2.UpdateBucketRequest.class, - responseType = com.google.storage.v2.Bucket.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.UpdateBucketRequest, com.google.storage.v2.Bucket> - getUpdateBucketMethod() { - io.grpc.MethodDescriptor< - com.google.storage.v2.UpdateBucketRequest, com.google.storage.v2.Bucket> - getUpdateBucketMethod; - if ((getUpdateBucketMethod = StorageGrpc.getUpdateBucketMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getUpdateBucketMethod = StorageGrpc.getUpdateBucketMethod) == null) { - StorageGrpc.getUpdateBucketMethod = - getUpdateBucketMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateBucket")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.UpdateBucketRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.Bucket.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("UpdateBucket")) - .build(); - } - } - } - return getUpdateBucketMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.DeleteNotificationRequest, com.google.protobuf.Empty> - getDeleteNotificationMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "DeleteNotification", - requestType = com.google.storage.v2.DeleteNotificationRequest.class, - responseType = com.google.protobuf.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.DeleteNotificationRequest, com.google.protobuf.Empty> - getDeleteNotificationMethod() { - io.grpc.MethodDescriptor< - com.google.storage.v2.DeleteNotificationRequest, com.google.protobuf.Empty> - getDeleteNotificationMethod; - if ((getDeleteNotificationMethod = StorageGrpc.getDeleteNotificationMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getDeleteNotificationMethod = StorageGrpc.getDeleteNotificationMethod) == null) { - StorageGrpc.getDeleteNotificationMethod = - getDeleteNotificationMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteNotification")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.DeleteNotificationRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor( - new StorageMethodDescriptorSupplier("DeleteNotification")) - .build(); - } - } - } - return getDeleteNotificationMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.GetNotificationRequest, com.google.storage.v2.Notification> - getGetNotificationMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetNotification", - requestType = com.google.storage.v2.GetNotificationRequest.class, - responseType = com.google.storage.v2.Notification.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.GetNotificationRequest, com.google.storage.v2.Notification> - getGetNotificationMethod() { - io.grpc.MethodDescriptor< - com.google.storage.v2.GetNotificationRequest, com.google.storage.v2.Notification> - getGetNotificationMethod; - if ((getGetNotificationMethod = StorageGrpc.getGetNotificationMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getGetNotificationMethod = StorageGrpc.getGetNotificationMethod) == null) { - StorageGrpc.getGetNotificationMethod = - getGetNotificationMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetNotification")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.GetNotificationRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.Notification.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("GetNotification")) - .build(); - } - } - } - return getGetNotificationMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.CreateNotificationRequest, com.google.storage.v2.Notification> - getCreateNotificationMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "CreateNotification", - requestType = com.google.storage.v2.CreateNotificationRequest.class, - responseType = com.google.storage.v2.Notification.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.CreateNotificationRequest, com.google.storage.v2.Notification> - getCreateNotificationMethod() { - io.grpc.MethodDescriptor< - com.google.storage.v2.CreateNotificationRequest, com.google.storage.v2.Notification> - getCreateNotificationMethod; - if ((getCreateNotificationMethod = StorageGrpc.getCreateNotificationMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getCreateNotificationMethod = StorageGrpc.getCreateNotificationMethod) == null) { - StorageGrpc.getCreateNotificationMethod = - getCreateNotificationMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateNotification")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.CreateNotificationRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.Notification.getDefaultInstance())) - .setSchemaDescriptor( - new StorageMethodDescriptorSupplier("CreateNotification")) - .build(); - } - } - } - return getCreateNotificationMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.ListNotificationsRequest, - com.google.storage.v2.ListNotificationsResponse> - getListNotificationsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListNotifications", - requestType = com.google.storage.v2.ListNotificationsRequest.class, - responseType = com.google.storage.v2.ListNotificationsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.ListNotificationsRequest, - com.google.storage.v2.ListNotificationsResponse> - getListNotificationsMethod() { - io.grpc.MethodDescriptor< - com.google.storage.v2.ListNotificationsRequest, - com.google.storage.v2.ListNotificationsResponse> - getListNotificationsMethod; - if ((getListNotificationsMethod = StorageGrpc.getListNotificationsMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getListNotificationsMethod = StorageGrpc.getListNotificationsMethod) == null) { - StorageGrpc.getListNotificationsMethod = - getListNotificationsMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListNotifications")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.ListNotificationsRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.ListNotificationsResponse.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("ListNotifications")) - .build(); - } - } - } - return getListNotificationsMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.ComposeObjectRequest, com.google.storage.v2.Object> - getComposeObjectMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ComposeObject", - requestType = com.google.storage.v2.ComposeObjectRequest.class, - responseType = com.google.storage.v2.Object.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.ComposeObjectRequest, com.google.storage.v2.Object> - getComposeObjectMethod() { - io.grpc.MethodDescriptor< - com.google.storage.v2.ComposeObjectRequest, com.google.storage.v2.Object> - getComposeObjectMethod; - if ((getComposeObjectMethod = StorageGrpc.getComposeObjectMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getComposeObjectMethod = StorageGrpc.getComposeObjectMethod) == null) { - StorageGrpc.getComposeObjectMethod = - getComposeObjectMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ComposeObject")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.ComposeObjectRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.Object.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("ComposeObject")) - .build(); - } - } - } - return getComposeObjectMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.DeleteObjectRequest, com.google.protobuf.Empty> - getDeleteObjectMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "DeleteObject", - requestType = com.google.storage.v2.DeleteObjectRequest.class, - responseType = com.google.protobuf.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.DeleteObjectRequest, com.google.protobuf.Empty> - getDeleteObjectMethod() { - io.grpc.MethodDescriptor - getDeleteObjectMethod; - if ((getDeleteObjectMethod = StorageGrpc.getDeleteObjectMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getDeleteObjectMethod = StorageGrpc.getDeleteObjectMethod) == null) { - StorageGrpc.getDeleteObjectMethod = - getDeleteObjectMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteObject")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.DeleteObjectRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("DeleteObject")) - .build(); - } - } - } - return getDeleteObjectMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.GetObjectRequest, com.google.storage.v2.Object> - getGetObjectMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetObject", - requestType = com.google.storage.v2.GetObjectRequest.class, - responseType = com.google.storage.v2.Object.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.GetObjectRequest, com.google.storage.v2.Object> - getGetObjectMethod() { - io.grpc.MethodDescriptor - getGetObjectMethod; - if ((getGetObjectMethod = StorageGrpc.getGetObjectMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getGetObjectMethod = StorageGrpc.getGetObjectMethod) == null) { - StorageGrpc.getGetObjectMethod = - getGetObjectMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetObject")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.GetObjectRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.Object.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("GetObject")) - .build(); - } - } - } - return getGetObjectMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.ReadObjectRequest, com.google.storage.v2.ReadObjectResponse> - getReadObjectMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ReadObject", - requestType = com.google.storage.v2.ReadObjectRequest.class, - responseType = com.google.storage.v2.ReadObjectResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.ReadObjectRequest, com.google.storage.v2.ReadObjectResponse> - getReadObjectMethod() { - io.grpc.MethodDescriptor< - com.google.storage.v2.ReadObjectRequest, com.google.storage.v2.ReadObjectResponse> - getReadObjectMethod; - if ((getReadObjectMethod = StorageGrpc.getReadObjectMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getReadObjectMethod = StorageGrpc.getReadObjectMethod) == null) { - StorageGrpc.getReadObjectMethod = - getReadObjectMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ReadObject")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.ReadObjectRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.ReadObjectResponse.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("ReadObject")) - .build(); - } - } - } - return getReadObjectMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.UpdateObjectRequest, com.google.storage.v2.Object> - getUpdateObjectMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "UpdateObject", - requestType = com.google.storage.v2.UpdateObjectRequest.class, - responseType = com.google.storage.v2.Object.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.UpdateObjectRequest, com.google.storage.v2.Object> - getUpdateObjectMethod() { - io.grpc.MethodDescriptor< - com.google.storage.v2.UpdateObjectRequest, com.google.storage.v2.Object> - getUpdateObjectMethod; - if ((getUpdateObjectMethod = StorageGrpc.getUpdateObjectMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getUpdateObjectMethod = StorageGrpc.getUpdateObjectMethod) == null) { - StorageGrpc.getUpdateObjectMethod = - getUpdateObjectMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateObject")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.UpdateObjectRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.Object.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("UpdateObject")) - .build(); - } - } - } - return getUpdateObjectMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.WriteObjectRequest, com.google.storage.v2.WriteObjectResponse> - getWriteObjectMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "WriteObject", - requestType = com.google.storage.v2.WriteObjectRequest.class, - responseType = com.google.storage.v2.WriteObjectResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.WriteObjectRequest, com.google.storage.v2.WriteObjectResponse> - getWriteObjectMethod() { - io.grpc.MethodDescriptor< - com.google.storage.v2.WriteObjectRequest, com.google.storage.v2.WriteObjectResponse> - getWriteObjectMethod; - if ((getWriteObjectMethod = StorageGrpc.getWriteObjectMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getWriteObjectMethod = StorageGrpc.getWriteObjectMethod) == null) { - StorageGrpc.getWriteObjectMethod = - getWriteObjectMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "WriteObject")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.WriteObjectRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.WriteObjectResponse.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("WriteObject")) - .build(); - } - } - } - return getWriteObjectMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.ListObjectsRequest, com.google.storage.v2.ListObjectsResponse> - getListObjectsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListObjects", - requestType = com.google.storage.v2.ListObjectsRequest.class, - responseType = com.google.storage.v2.ListObjectsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.ListObjectsRequest, com.google.storage.v2.ListObjectsResponse> - getListObjectsMethod() { - io.grpc.MethodDescriptor< - com.google.storage.v2.ListObjectsRequest, com.google.storage.v2.ListObjectsResponse> - getListObjectsMethod; - if ((getListObjectsMethod = StorageGrpc.getListObjectsMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getListObjectsMethod = StorageGrpc.getListObjectsMethod) == null) { - StorageGrpc.getListObjectsMethod = - getListObjectsMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListObjects")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.ListObjectsRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.ListObjectsResponse.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("ListObjects")) - .build(); - } - } - } - return getListObjectsMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.RewriteObjectRequest, com.google.storage.v2.RewriteResponse> - getRewriteObjectMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "RewriteObject", - requestType = com.google.storage.v2.RewriteObjectRequest.class, - responseType = com.google.storage.v2.RewriteResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.RewriteObjectRequest, com.google.storage.v2.RewriteResponse> - getRewriteObjectMethod() { - io.grpc.MethodDescriptor< - com.google.storage.v2.RewriteObjectRequest, com.google.storage.v2.RewriteResponse> - getRewriteObjectMethod; - if ((getRewriteObjectMethod = StorageGrpc.getRewriteObjectMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getRewriteObjectMethod = StorageGrpc.getRewriteObjectMethod) == null) { - StorageGrpc.getRewriteObjectMethod = - getRewriteObjectMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RewriteObject")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.RewriteObjectRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.RewriteResponse.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("RewriteObject")) - .build(); - } - } - } - return getRewriteObjectMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.StartResumableWriteRequest, - com.google.storage.v2.StartResumableWriteResponse> - getStartResumableWriteMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "StartResumableWrite", - requestType = com.google.storage.v2.StartResumableWriteRequest.class, - responseType = com.google.storage.v2.StartResumableWriteResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.StartResumableWriteRequest, - com.google.storage.v2.StartResumableWriteResponse> - getStartResumableWriteMethod() { - io.grpc.MethodDescriptor< - com.google.storage.v2.StartResumableWriteRequest, - com.google.storage.v2.StartResumableWriteResponse> - getStartResumableWriteMethod; - if ((getStartResumableWriteMethod = StorageGrpc.getStartResumableWriteMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getStartResumableWriteMethod = StorageGrpc.getStartResumableWriteMethod) == null) { - StorageGrpc.getStartResumableWriteMethod = - getStartResumableWriteMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - generateFullMethodName(SERVICE_NAME, "StartResumableWrite")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.StartResumableWriteRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.StartResumableWriteResponse - .getDefaultInstance())) - .setSchemaDescriptor( - new StorageMethodDescriptorSupplier("StartResumableWrite")) - .build(); - } - } - } - return getStartResumableWriteMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.QueryWriteStatusRequest, - com.google.storage.v2.QueryWriteStatusResponse> - getQueryWriteStatusMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "QueryWriteStatus", - requestType = com.google.storage.v2.QueryWriteStatusRequest.class, - responseType = com.google.storage.v2.QueryWriteStatusResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.QueryWriteStatusRequest, - com.google.storage.v2.QueryWriteStatusResponse> - getQueryWriteStatusMethod() { - io.grpc.MethodDescriptor< - com.google.storage.v2.QueryWriteStatusRequest, - com.google.storage.v2.QueryWriteStatusResponse> - getQueryWriteStatusMethod; - if ((getQueryWriteStatusMethod = StorageGrpc.getQueryWriteStatusMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getQueryWriteStatusMethod = StorageGrpc.getQueryWriteStatusMethod) == null) { - StorageGrpc.getQueryWriteStatusMethod = - getQueryWriteStatusMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "QueryWriteStatus")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.QueryWriteStatusRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.QueryWriteStatusResponse.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("QueryWriteStatus")) - .build(); - } - } - } - return getQueryWriteStatusMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.GetServiceAccountRequest, com.google.storage.v2.ServiceAccount> - getGetServiceAccountMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetServiceAccount", - requestType = com.google.storage.v2.GetServiceAccountRequest.class, - responseType = com.google.storage.v2.ServiceAccount.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.GetServiceAccountRequest, com.google.storage.v2.ServiceAccount> - getGetServiceAccountMethod() { - io.grpc.MethodDescriptor< - com.google.storage.v2.GetServiceAccountRequest, com.google.storage.v2.ServiceAccount> - getGetServiceAccountMethod; - if ((getGetServiceAccountMethod = StorageGrpc.getGetServiceAccountMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getGetServiceAccountMethod = StorageGrpc.getGetServiceAccountMethod) == null) { - StorageGrpc.getGetServiceAccountMethod = - getGetServiceAccountMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetServiceAccount")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.GetServiceAccountRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.ServiceAccount.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("GetServiceAccount")) - .build(); - } - } - } - return getGetServiceAccountMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.CreateHmacKeyRequest, com.google.storage.v2.CreateHmacKeyResponse> - getCreateHmacKeyMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "CreateHmacKey", - requestType = com.google.storage.v2.CreateHmacKeyRequest.class, - responseType = com.google.storage.v2.CreateHmacKeyResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.CreateHmacKeyRequest, com.google.storage.v2.CreateHmacKeyResponse> - getCreateHmacKeyMethod() { - io.grpc.MethodDescriptor< - com.google.storage.v2.CreateHmacKeyRequest, com.google.storage.v2.CreateHmacKeyResponse> - getCreateHmacKeyMethod; - if ((getCreateHmacKeyMethod = StorageGrpc.getCreateHmacKeyMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getCreateHmacKeyMethod = StorageGrpc.getCreateHmacKeyMethod) == null) { - StorageGrpc.getCreateHmacKeyMethod = - getCreateHmacKeyMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateHmacKey")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.CreateHmacKeyRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.CreateHmacKeyResponse.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("CreateHmacKey")) - .build(); - } - } - } - return getCreateHmacKeyMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.DeleteHmacKeyRequest, com.google.protobuf.Empty> - getDeleteHmacKeyMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "DeleteHmacKey", - requestType = com.google.storage.v2.DeleteHmacKeyRequest.class, - responseType = com.google.protobuf.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.DeleteHmacKeyRequest, com.google.protobuf.Empty> - getDeleteHmacKeyMethod() { - io.grpc.MethodDescriptor - getDeleteHmacKeyMethod; - if ((getDeleteHmacKeyMethod = StorageGrpc.getDeleteHmacKeyMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getDeleteHmacKeyMethod = StorageGrpc.getDeleteHmacKeyMethod) == null) { - StorageGrpc.getDeleteHmacKeyMethod = - getDeleteHmacKeyMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteHmacKey")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.DeleteHmacKeyRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("DeleteHmacKey")) - .build(); - } - } - } - return getDeleteHmacKeyMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.GetHmacKeyRequest, com.google.storage.v2.HmacKeyMetadata> - getGetHmacKeyMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetHmacKey", - requestType = com.google.storage.v2.GetHmacKeyRequest.class, - responseType = com.google.storage.v2.HmacKeyMetadata.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.GetHmacKeyRequest, com.google.storage.v2.HmacKeyMetadata> - getGetHmacKeyMethod() { - io.grpc.MethodDescriptor< - com.google.storage.v2.GetHmacKeyRequest, com.google.storage.v2.HmacKeyMetadata> - getGetHmacKeyMethod; - if ((getGetHmacKeyMethod = StorageGrpc.getGetHmacKeyMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getGetHmacKeyMethod = StorageGrpc.getGetHmacKeyMethod) == null) { - StorageGrpc.getGetHmacKeyMethod = - getGetHmacKeyMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetHmacKey")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.GetHmacKeyRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.HmacKeyMetadata.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("GetHmacKey")) - .build(); - } - } - } - return getGetHmacKeyMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.ListHmacKeysRequest, com.google.storage.v2.ListHmacKeysResponse> - getListHmacKeysMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListHmacKeys", - requestType = com.google.storage.v2.ListHmacKeysRequest.class, - responseType = com.google.storage.v2.ListHmacKeysResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.ListHmacKeysRequest, com.google.storage.v2.ListHmacKeysResponse> - getListHmacKeysMethod() { - io.grpc.MethodDescriptor< - com.google.storage.v2.ListHmacKeysRequest, com.google.storage.v2.ListHmacKeysResponse> - getListHmacKeysMethod; - if ((getListHmacKeysMethod = StorageGrpc.getListHmacKeysMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getListHmacKeysMethod = StorageGrpc.getListHmacKeysMethod) == null) { - StorageGrpc.getListHmacKeysMethod = - getListHmacKeysMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListHmacKeys")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.ListHmacKeysRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.ListHmacKeysResponse.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("ListHmacKeys")) - .build(); - } - } - } - return getListHmacKeysMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.UpdateHmacKeyRequest, com.google.storage.v2.HmacKeyMetadata> - getUpdateHmacKeyMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "UpdateHmacKey", - requestType = com.google.storage.v2.UpdateHmacKeyRequest.class, - responseType = com.google.storage.v2.HmacKeyMetadata.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.storage.v2.UpdateHmacKeyRequest, com.google.storage.v2.HmacKeyMetadata> - getUpdateHmacKeyMethod() { - io.grpc.MethodDescriptor< - com.google.storage.v2.UpdateHmacKeyRequest, com.google.storage.v2.HmacKeyMetadata> - getUpdateHmacKeyMethod; - if ((getUpdateHmacKeyMethod = StorageGrpc.getUpdateHmacKeyMethod) == null) { - synchronized (StorageGrpc.class) { - if ((getUpdateHmacKeyMethod = StorageGrpc.getUpdateHmacKeyMethod) == null) { - StorageGrpc.getUpdateHmacKeyMethod = - getUpdateHmacKeyMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateHmacKey")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.UpdateHmacKeyRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.HmacKeyMetadata.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("UpdateHmacKey")) - .build(); - } - } - } - return getUpdateHmacKeyMethod; - } - - /** Creates a new async stub that supports all call types for the service */ - public static StorageStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public StorageStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new StorageStub(channel, callOptions); - } - }; - return StorageStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static StorageBlockingStub newBlockingStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public StorageBlockingStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new StorageBlockingStub(channel, callOptions); - } - }; - return StorageBlockingStub.newStub(factory, channel); - } - - /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ - public static StorageFutureStub newFutureStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public StorageFutureStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new StorageFutureStub(channel, callOptions); - } - }; - return StorageFutureStub.newStub(factory, channel); - } - - /** - * - * - *
-   * ## API Overview and Naming Syntax
-   * The Cloud Storage gRPC API allows applications to read and write data through
-   * the abstractions of buckets and objects. For a description of these
-   * abstractions please see https://cloud.google.com/storage/docs.
-   * Resources are named as follows:
-   *   - Projects are referred to as they are defined by the Resource Manager API,
-   *     using strings like `projects/123456` or `projects/my-string-id`.
-   *   - Buckets are named using string names of the form:
-   *     `projects/{project}/buckets/{bucket}`
-   *     For globally unique buckets, `_` may be substituted for the project.
-   *   - Objects are uniquely identified by their name along with the name of the
-   *     bucket they belong to, as separate strings in this API. For example:
-   *       ReadObjectRequest {
-   *         bucket: 'projects/_/buckets/my-bucket'
-   *         object: 'my-object'
-   *       }
-   *     Note that object names can contain `/` characters, which are treated as
-   *     any other character (no special directory semantics).
-   * 
- */ - public abstract static class StorageImplBase implements io.grpc.BindableService { - - /** - * - * - *
-     * Permanently deletes an empty bucket.
-     * 
- */ - public void deleteBucket( - com.google.storage.v2.DeleteBucketRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getDeleteBucketMethod(), responseObserver); - } - - /** - * - * - *
-     * Returns metadata for the specified bucket.
-     * 
- */ - public void getBucket( - com.google.storage.v2.GetBucketRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetBucketMethod(), responseObserver); - } - - /** - * - * - *
-     * Creates a new bucket.
-     * 
- */ - public void createBucket( - com.google.storage.v2.CreateBucketRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getCreateBucketMethod(), responseObserver); - } - - /** - * - * - *
-     * Retrieves a list of buckets for a given project.
-     * 
- */ - public void listBuckets( - com.google.storage.v2.ListBucketsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getListBucketsMethod(), responseObserver); - } - - /** - * - * - *
-     * Locks retention policy on a bucket.
-     * 
- */ - public void lockBucketRetentionPolicy( - com.google.storage.v2.LockBucketRetentionPolicyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getLockBucketRetentionPolicyMethod(), responseObserver); - } - - /** - * - * - *
-     * Gets the IAM policy for a specified bucket.
-     * 
- */ - public void getIamPolicy( - com.google.iam.v1.GetIamPolicyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getGetIamPolicyMethod(), responseObserver); - } - - /** - * - * - *
-     * Updates an IAM policy for the specified bucket.
-     * 
- */ - public void setIamPolicy( - com.google.iam.v1.SetIamPolicyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getSetIamPolicyMethod(), responseObserver); - } - - /** - * - * - *
-     * Tests a set of permissions on the given bucket to see which, if
-     * any, are held by the caller.
-     * 
- */ - public void testIamPermissions( - com.google.iam.v1.TestIamPermissionsRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getTestIamPermissionsMethod(), responseObserver); - } - - /** - * - * - *
-     * Updates a bucket. Equivalent to JSON API's storage.buckets.patch method.
-     * 
- */ - public void updateBucket( - com.google.storage.v2.UpdateBucketRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getUpdateBucketMethod(), responseObserver); - } - - /** - * - * - *
-     * Permanently deletes a notification subscription.
-     * 
- */ - public void deleteNotification( - com.google.storage.v2.DeleteNotificationRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getDeleteNotificationMethod(), responseObserver); - } - - /** - * - * - *
-     * View a notification config.
-     * 
- */ - public void getNotification( - com.google.storage.v2.GetNotificationRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getGetNotificationMethod(), responseObserver); - } - - /** - * - * - *
-     * Creates a notification subscription for a given bucket.
-     * These notifications, when triggered, publish messages to the specified
-     * Pub/Sub topics.
-     * See https://cloud.google.com/storage/docs/pubsub-notifications.
-     * 
- */ - public void createNotification( - com.google.storage.v2.CreateNotificationRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getCreateNotificationMethod(), responseObserver); - } - - /** - * - * - *
-     * Retrieves a list of notification subscriptions for a given bucket.
-     * 
- */ - public void listNotifications( - com.google.storage.v2.ListNotificationsRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getListNotificationsMethod(), responseObserver); - } - - /** - * - * - *
-     * Concatenates a list of existing objects into a new object in the same
-     * bucket.
-     * 
- */ - public void composeObject( - com.google.storage.v2.ComposeObjectRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getComposeObjectMethod(), responseObserver); - } - - /** - * - * - *
-     * Deletes an object and its metadata. Deletions are permanent if versioning
-     * is not enabled for the bucket, or if the `generation` parameter
-     * is used.
-     * 
- */ - public void deleteObject( - com.google.storage.v2.DeleteObjectRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getDeleteObjectMethod(), responseObserver); - } - - /** - * - * - *
-     * Retrieves an object's metadata.
-     * 
- */ - public void getObject( - com.google.storage.v2.GetObjectRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetObjectMethod(), responseObserver); - } - - /** - * - * - *
-     * Reads an object's data.
-     * 
- */ - public void readObject( - com.google.storage.v2.ReadObjectRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getReadObjectMethod(), responseObserver); - } - - /** - * - * - *
-     * Updates an object's metadata.
-     * Equivalent to JSON API's storage.objects.patch.
-     * 
- */ - public void updateObject( - com.google.storage.v2.UpdateObjectRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getUpdateObjectMethod(), responseObserver); - } - - /** - * - * - *
-     * Stores a new object and metadata.
-     * An object can be written either in a single message stream or in a
-     * resumable sequence of message streams. To write using a single stream,
-     * the client should include in the first message of the stream an
-     * `WriteObjectSpec` describing the destination bucket, object, and any
-     * preconditions. Additionally, the final message must set 'finish_write' to
-     * true, or else it is an error.
-     * For a resumable write, the client should instead call
-     * `StartResumableWrite()` and provide that method an `WriteObjectSpec.`
-     * They should then attach the returned `upload_id` to the first message of
-     * each following call to `Create`. If there is an error or the connection is
-     * broken during the resumable `Create()`, the client should check the status
-     * of the `Create()` by calling `QueryWriteStatus()` and continue writing from
-     * the returned `persisted_size`. This may be less than the amount of data the
-     * client previously sent.
-     * The service will not view the object as complete until the client has
-     * sent a `WriteObjectRequest` with `finish_write` set to `true`. Sending any
-     * requests on a stream after sending a request with `finish_write` set to
-     * `true` will cause an error. The client **should** check the response it
-     * receives to determine how much data the service was able to commit and
-     * whether the service views the object as complete.
-     * 
- */ - public io.grpc.stub.StreamObserver writeObject( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( - getWriteObjectMethod(), responseObserver); - } - - /** - * - * - *
-     * Retrieves a list of objects matching the criteria.
-     * 
- */ - public void listObjects( - com.google.storage.v2.ListObjectsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getListObjectsMethod(), responseObserver); - } - - /** - * - * - *
-     * Rewrites a source object to a destination object. Optionally overrides
-     * metadata.
-     * 
- */ - public void rewriteObject( - com.google.storage.v2.RewriteObjectRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getRewriteObjectMethod(), responseObserver); - } - - /** - * - * - *
-     * Starts a resumable write. How long the write operation remains valid, and
-     * what happens when the write operation becomes invalid, are
-     * service-dependent.
-     * 
- */ - public void startResumableWrite( - com.google.storage.v2.StartResumableWriteRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getStartResumableWriteMethod(), responseObserver); - } - - /** - * - * - *
-     * Determines the `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.
-     * 
- */ - public void queryWriteStatus( - com.google.storage.v2.QueryWriteStatusRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getQueryWriteStatusMethod(), responseObserver); - } - - /** - * - * - *
-     * Retrieves the name of a project's Google Cloud Storage service account.
-     * 
- */ - public void getServiceAccount( - com.google.storage.v2.GetServiceAccountRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getGetServiceAccountMethod(), responseObserver); - } - - /** - * - * - *
-     * Creates a new HMAC key for the given service account.
-     * 
- */ - public void createHmacKey( - com.google.storage.v2.CreateHmacKeyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getCreateHmacKeyMethod(), responseObserver); - } - - /** - * - * - *
-     * Deletes a given HMAC key.  Key must be in an INACTIVE state.
-     * 
- */ - public void deleteHmacKey( - com.google.storage.v2.DeleteHmacKeyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getDeleteHmacKeyMethod(), responseObserver); - } - - /** - * - * - *
-     * Gets an existing HMAC key metadata for the given id.
-     * 
- */ - public void getHmacKey( - com.google.storage.v2.GetHmacKeyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetHmacKeyMethod(), responseObserver); - } - - /** - * - * - *
-     * Lists HMAC keys under a given project with the additional filters provided.
-     * 
- */ - public void listHmacKeys( - com.google.storage.v2.ListHmacKeysRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getListHmacKeysMethod(), responseObserver); - } - - /** - * - * - *
-     * Updates a given HMAC key state between ACTIVE and INACTIVE.
-     * 
- */ - public void updateHmacKey( - com.google.storage.v2.UpdateHmacKeyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getUpdateHmacKeyMethod(), responseObserver); - } - - @java.lang.Override - public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getDeleteBucketMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.DeleteBucketRequest, com.google.protobuf.Empty>( - this, METHODID_DELETE_BUCKET))) - .addMethod( - getGetBucketMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.GetBucketRequest, com.google.storage.v2.Bucket>( - this, METHODID_GET_BUCKET))) - .addMethod( - getCreateBucketMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.CreateBucketRequest, com.google.storage.v2.Bucket>( - this, METHODID_CREATE_BUCKET))) - .addMethod( - getListBucketsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.ListBucketsRequest, - com.google.storage.v2.ListBucketsResponse>(this, METHODID_LIST_BUCKETS))) - .addMethod( - getLockBucketRetentionPolicyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.LockBucketRetentionPolicyRequest, - com.google.storage.v2.Bucket>(this, METHODID_LOCK_BUCKET_RETENTION_POLICY))) - .addMethod( - getGetIamPolicyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy>( - this, METHODID_GET_IAM_POLICY))) - .addMethod( - getSetIamPolicyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy>( - this, METHODID_SET_IAM_POLICY))) - .addMethod( - getTestIamPermissionsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.iam.v1.TestIamPermissionsRequest, - com.google.iam.v1.TestIamPermissionsResponse>( - this, METHODID_TEST_IAM_PERMISSIONS))) - .addMethod( - getUpdateBucketMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.UpdateBucketRequest, com.google.storage.v2.Bucket>( - this, METHODID_UPDATE_BUCKET))) - .addMethod( - getDeleteNotificationMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.DeleteNotificationRequest, com.google.protobuf.Empty>( - this, METHODID_DELETE_NOTIFICATION))) - .addMethod( - getGetNotificationMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.GetNotificationRequest, - com.google.storage.v2.Notification>(this, METHODID_GET_NOTIFICATION))) - .addMethod( - getCreateNotificationMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.CreateNotificationRequest, - com.google.storage.v2.Notification>(this, METHODID_CREATE_NOTIFICATION))) - .addMethod( - getListNotificationsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.ListNotificationsRequest, - com.google.storage.v2.ListNotificationsResponse>( - this, METHODID_LIST_NOTIFICATIONS))) - .addMethod( - getComposeObjectMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.ComposeObjectRequest, com.google.storage.v2.Object>( - this, METHODID_COMPOSE_OBJECT))) - .addMethod( - getDeleteObjectMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.DeleteObjectRequest, com.google.protobuf.Empty>( - this, METHODID_DELETE_OBJECT))) - .addMethod( - getGetObjectMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.GetObjectRequest, com.google.storage.v2.Object>( - this, METHODID_GET_OBJECT))) - .addMethod( - getReadObjectMethod(), - io.grpc.stub.ServerCalls.asyncServerStreamingCall( - new MethodHandlers< - com.google.storage.v2.ReadObjectRequest, - com.google.storage.v2.ReadObjectResponse>(this, METHODID_READ_OBJECT))) - .addMethod( - getUpdateObjectMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.UpdateObjectRequest, com.google.storage.v2.Object>( - this, METHODID_UPDATE_OBJECT))) - .addMethod( - getWriteObjectMethod(), - io.grpc.stub.ServerCalls.asyncClientStreamingCall( - new MethodHandlers< - com.google.storage.v2.WriteObjectRequest, - com.google.storage.v2.WriteObjectResponse>(this, METHODID_WRITE_OBJECT))) - .addMethod( - getListObjectsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.ListObjectsRequest, - com.google.storage.v2.ListObjectsResponse>(this, METHODID_LIST_OBJECTS))) - .addMethod( - getRewriteObjectMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.RewriteObjectRequest, - com.google.storage.v2.RewriteResponse>(this, METHODID_REWRITE_OBJECT))) - .addMethod( - getStartResumableWriteMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.StartResumableWriteRequest, - com.google.storage.v2.StartResumableWriteResponse>( - this, METHODID_START_RESUMABLE_WRITE))) - .addMethod( - getQueryWriteStatusMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.QueryWriteStatusRequest, - com.google.storage.v2.QueryWriteStatusResponse>( - this, METHODID_QUERY_WRITE_STATUS))) - .addMethod( - getGetServiceAccountMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.GetServiceAccountRequest, - com.google.storage.v2.ServiceAccount>(this, METHODID_GET_SERVICE_ACCOUNT))) - .addMethod( - getCreateHmacKeyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.CreateHmacKeyRequest, - com.google.storage.v2.CreateHmacKeyResponse>(this, METHODID_CREATE_HMAC_KEY))) - .addMethod( - getDeleteHmacKeyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.DeleteHmacKeyRequest, com.google.protobuf.Empty>( - this, METHODID_DELETE_HMAC_KEY))) - .addMethod( - getGetHmacKeyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.GetHmacKeyRequest, - com.google.storage.v2.HmacKeyMetadata>(this, METHODID_GET_HMAC_KEY))) - .addMethod( - getListHmacKeysMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.ListHmacKeysRequest, - com.google.storage.v2.ListHmacKeysResponse>(this, METHODID_LIST_HMAC_KEYS))) - .addMethod( - getUpdateHmacKeyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.storage.v2.UpdateHmacKeyRequest, - com.google.storage.v2.HmacKeyMetadata>(this, METHODID_UPDATE_HMAC_KEY))) - .build(); - } - } - - /** - * - * - *
-   * ## API Overview and Naming Syntax
-   * The Cloud Storage gRPC API allows applications to read and write data through
-   * the abstractions of buckets and objects. For a description of these
-   * abstractions please see https://cloud.google.com/storage/docs.
-   * Resources are named as follows:
-   *   - Projects are referred to as they are defined by the Resource Manager API,
-   *     using strings like `projects/123456` or `projects/my-string-id`.
-   *   - Buckets are named using string names of the form:
-   *     `projects/{project}/buckets/{bucket}`
-   *     For globally unique buckets, `_` may be substituted for the project.
-   *   - Objects are uniquely identified by their name along with the name of the
-   *     bucket they belong to, as separate strings in this API. For example:
-   *       ReadObjectRequest {
-   *         bucket: 'projects/_/buckets/my-bucket'
-   *         object: 'my-object'
-   *       }
-   *     Note that object names can contain `/` characters, which are treated as
-   *     any other character (no special directory semantics).
-   * 
- */ - public static final class StorageStub extends io.grpc.stub.AbstractAsyncStub { - private StorageStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected StorageStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new StorageStub(channel, callOptions); - } - - /** - * - * - *
-     * Permanently deletes an empty bucket.
-     * 
- */ - public void deleteBucket( - com.google.storage.v2.DeleteBucketRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeleteBucketMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Returns metadata for the specified bucket.
-     * 
- */ - public void getBucket( - com.google.storage.v2.GetBucketRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetBucketMethod(), getCallOptions()), request, responseObserver); - } - - /** - * - * - *
-     * Creates a new bucket.
-     * 
- */ - public void createBucket( - com.google.storage.v2.CreateBucketRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreateBucketMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Retrieves a list of buckets for a given project.
-     * 
- */ - public void listBuckets( - com.google.storage.v2.ListBucketsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListBucketsMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Locks retention policy on a bucket.
-     * 
- */ - public void lockBucketRetentionPolicy( - com.google.storage.v2.LockBucketRetentionPolicyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getLockBucketRetentionPolicyMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Gets the IAM policy for a specified bucket.
-     * 
- */ - public void getIamPolicy( - com.google.iam.v1.GetIamPolicyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Updates an IAM policy for the specified bucket.
-     * 
- */ - public void setIamPolicy( - com.google.iam.v1.SetIamPolicyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Tests a set of permissions on the given bucket to see which, if
-     * any, are held by the caller.
-     * 
- */ - public void testIamPermissions( - com.google.iam.v1.TestIamPermissionsRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Updates a bucket. Equivalent to JSON API's storage.buckets.patch method.
-     * 
- */ - public void updateBucket( - com.google.storage.v2.UpdateBucketRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getUpdateBucketMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Permanently deletes a notification subscription.
-     * 
- */ - public void deleteNotification( - com.google.storage.v2.DeleteNotificationRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeleteNotificationMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * View a notification config.
-     * 
- */ - public void getNotification( - com.google.storage.v2.GetNotificationRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetNotificationMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Creates a notification subscription for a given bucket.
-     * These notifications, when triggered, publish messages to the specified
-     * Pub/Sub topics.
-     * See https://cloud.google.com/storage/docs/pubsub-notifications.
-     * 
- */ - public void createNotification( - com.google.storage.v2.CreateNotificationRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreateNotificationMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Retrieves a list of notification subscriptions for a given bucket.
-     * 
- */ - public void listNotifications( - com.google.storage.v2.ListNotificationsRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListNotificationsMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Concatenates a list of existing objects into a new object in the same
-     * bucket.
-     * 
- */ - public void composeObject( - com.google.storage.v2.ComposeObjectRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getComposeObjectMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Deletes an object and its metadata. Deletions are permanent if versioning
-     * is not enabled for the bucket, or if the `generation` parameter
-     * is used.
-     * 
- */ - public void deleteObject( - com.google.storage.v2.DeleteObjectRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeleteObjectMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Retrieves an object's metadata.
-     * 
- */ - public void getObject( - com.google.storage.v2.GetObjectRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetObjectMethod(), getCallOptions()), request, responseObserver); - } - - /** - * - * - *
-     * Reads an object's data.
-     * 
- */ - public void readObject( - com.google.storage.v2.ReadObjectRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncServerStreamingCall( - getChannel().newCall(getReadObjectMethod(), getCallOptions()), request, responseObserver); - } - - /** - * - * - *
-     * Updates an object's metadata.
-     * Equivalent to JSON API's storage.objects.patch.
-     * 
- */ - public void updateObject( - com.google.storage.v2.UpdateObjectRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getUpdateObjectMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Stores a new object and metadata.
-     * An object can be written either in a single message stream or in a
-     * resumable sequence of message streams. To write using a single stream,
-     * the client should include in the first message of the stream an
-     * `WriteObjectSpec` describing the destination bucket, object, and any
-     * preconditions. Additionally, the final message must set 'finish_write' to
-     * true, or else it is an error.
-     * For a resumable write, the client should instead call
-     * `StartResumableWrite()` and provide that method an `WriteObjectSpec.`
-     * They should then attach the returned `upload_id` to the first message of
-     * each following call to `Create`. If there is an error or the connection is
-     * broken during the resumable `Create()`, the client should check the status
-     * of the `Create()` by calling `QueryWriteStatus()` and continue writing from
-     * the returned `persisted_size`. This may be less than the amount of data the
-     * client previously sent.
-     * The service will not view the object as complete until the client has
-     * sent a `WriteObjectRequest` with `finish_write` set to `true`. Sending any
-     * requests on a stream after sending a request with `finish_write` set to
-     * `true` will cause an error. The client **should** check the response it
-     * receives to determine how much data the service was able to commit and
-     * whether the service views the object as complete.
-     * 
- */ - public io.grpc.stub.StreamObserver writeObject( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ClientCalls.asyncClientStreamingCall( - getChannel().newCall(getWriteObjectMethod(), getCallOptions()), responseObserver); - } - - /** - * - * - *
-     * Retrieves a list of objects matching the criteria.
-     * 
- */ - public void listObjects( - com.google.storage.v2.ListObjectsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListObjectsMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Rewrites a source object to a destination object. Optionally overrides
-     * metadata.
-     * 
- */ - public void rewriteObject( - com.google.storage.v2.RewriteObjectRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getRewriteObjectMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Starts a resumable write. How long the write operation remains valid, and
-     * what happens when the write operation becomes invalid, are
-     * service-dependent.
-     * 
- */ - public void startResumableWrite( - com.google.storage.v2.StartResumableWriteRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getStartResumableWriteMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Determines the `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.
-     * 
- */ - public void queryWriteStatus( - com.google.storage.v2.QueryWriteStatusRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getQueryWriteStatusMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Retrieves the name of a project's Google Cloud Storage service account.
-     * 
- */ - public void getServiceAccount( - com.google.storage.v2.GetServiceAccountRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetServiceAccountMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Creates a new HMAC key for the given service account.
-     * 
- */ - public void createHmacKey( - com.google.storage.v2.CreateHmacKeyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreateHmacKeyMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Deletes a given HMAC key.  Key must be in an INACTIVE state.
-     * 
- */ - public void deleteHmacKey( - com.google.storage.v2.DeleteHmacKeyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeleteHmacKeyMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Gets an existing HMAC key metadata for the given id.
-     * 
- */ - public void getHmacKey( - com.google.storage.v2.GetHmacKeyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetHmacKeyMethod(), getCallOptions()), request, responseObserver); - } - - /** - * - * - *
-     * Lists HMAC keys under a given project with the additional filters provided.
-     * 
- */ - public void listHmacKeys( - com.google.storage.v2.ListHmacKeysRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListHmacKeysMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Updates a given HMAC key state between ACTIVE and INACTIVE.
-     * 
- */ - public void updateHmacKey( - com.google.storage.v2.UpdateHmacKeyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getUpdateHmacKeyMethod(), getCallOptions()), - request, - responseObserver); - } - } - - /** - * - * - *
-   * ## API Overview and Naming Syntax
-   * The Cloud Storage gRPC API allows applications to read and write data through
-   * the abstractions of buckets and objects. For a description of these
-   * abstractions please see https://cloud.google.com/storage/docs.
-   * Resources are named as follows:
-   *   - Projects are referred to as they are defined by the Resource Manager API,
-   *     using strings like `projects/123456` or `projects/my-string-id`.
-   *   - Buckets are named using string names of the form:
-   *     `projects/{project}/buckets/{bucket}`
-   *     For globally unique buckets, `_` may be substituted for the project.
-   *   - Objects are uniquely identified by their name along with the name of the
-   *     bucket they belong to, as separate strings in this API. For example:
-   *       ReadObjectRequest {
-   *         bucket: 'projects/_/buckets/my-bucket'
-   *         object: 'my-object'
-   *       }
-   *     Note that object names can contain `/` characters, which are treated as
-   *     any other character (no special directory semantics).
-   * 
- */ - public static final class StorageBlockingStub - extends io.grpc.stub.AbstractBlockingStub { - private StorageBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected StorageBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new StorageBlockingStub(channel, callOptions); - } - - /** - * - * - *
-     * Permanently deletes an empty bucket.
-     * 
- */ - public com.google.protobuf.Empty deleteBucket( - com.google.storage.v2.DeleteBucketRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeleteBucketMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Returns metadata for the specified bucket.
-     * 
- */ - public com.google.storage.v2.Bucket getBucket(com.google.storage.v2.GetBucketRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetBucketMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Creates a new bucket.
-     * 
- */ - public com.google.storage.v2.Bucket createBucket( - com.google.storage.v2.CreateBucketRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCreateBucketMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Retrieves a list of buckets for a given project.
-     * 
- */ - public com.google.storage.v2.ListBucketsResponse listBuckets( - com.google.storage.v2.ListBucketsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListBucketsMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Locks retention policy on a bucket.
-     * 
- */ - public com.google.storage.v2.Bucket lockBucketRetentionPolicy( - com.google.storage.v2.LockBucketRetentionPolicyRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getLockBucketRetentionPolicyMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Gets the IAM policy for a specified bucket.
-     * 
- */ - public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetIamPolicyMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Updates an IAM policy for the specified bucket.
-     * 
- */ - public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getSetIamPolicyMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Tests a set of permissions on the given bucket to see which, if
-     * any, are held by the caller.
-     * 
- */ - public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( - com.google.iam.v1.TestIamPermissionsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getTestIamPermissionsMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Updates a bucket. Equivalent to JSON API's storage.buckets.patch method.
-     * 
- */ - public com.google.storage.v2.Bucket updateBucket( - com.google.storage.v2.UpdateBucketRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getUpdateBucketMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Permanently deletes a notification subscription.
-     * 
- */ - public com.google.protobuf.Empty deleteNotification( - com.google.storage.v2.DeleteNotificationRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeleteNotificationMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * View a notification config.
-     * 
- */ - public com.google.storage.v2.Notification getNotification( - com.google.storage.v2.GetNotificationRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetNotificationMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Creates a notification subscription for a given bucket.
-     * These notifications, when triggered, publish messages to the specified
-     * Pub/Sub topics.
-     * See https://cloud.google.com/storage/docs/pubsub-notifications.
-     * 
- */ - public com.google.storage.v2.Notification createNotification( - com.google.storage.v2.CreateNotificationRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCreateNotificationMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Retrieves a list of notification subscriptions for a given bucket.
-     * 
- */ - public com.google.storage.v2.ListNotificationsResponse listNotifications( - com.google.storage.v2.ListNotificationsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListNotificationsMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Concatenates a list of existing objects into a new object in the same
-     * bucket.
-     * 
- */ - public com.google.storage.v2.Object composeObject( - com.google.storage.v2.ComposeObjectRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getComposeObjectMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Deletes an object and its metadata. Deletions are permanent if versioning
-     * is not enabled for the bucket, or if the `generation` parameter
-     * is used.
-     * 
- */ - public com.google.protobuf.Empty deleteObject( - com.google.storage.v2.DeleteObjectRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeleteObjectMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Retrieves an object's metadata.
-     * 
- */ - public com.google.storage.v2.Object getObject(com.google.storage.v2.GetObjectRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetObjectMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Reads an object's data.
-     * 
- */ - public java.util.Iterator readObject( - com.google.storage.v2.ReadObjectRequest request) { - return io.grpc.stub.ClientCalls.blockingServerStreamingCall( - getChannel(), getReadObjectMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Updates an object's metadata.
-     * Equivalent to JSON API's storage.objects.patch.
-     * 
- */ - public com.google.storage.v2.Object updateObject( - com.google.storage.v2.UpdateObjectRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getUpdateObjectMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Retrieves a list of objects matching the criteria.
-     * 
- */ - public com.google.storage.v2.ListObjectsResponse listObjects( - com.google.storage.v2.ListObjectsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListObjectsMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Rewrites a source object to a destination object. Optionally overrides
-     * metadata.
-     * 
- */ - public com.google.storage.v2.RewriteResponse rewriteObject( - com.google.storage.v2.RewriteObjectRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getRewriteObjectMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Starts a resumable write. How long the write operation remains valid, and
-     * what happens when the write operation becomes invalid, are
-     * service-dependent.
-     * 
- */ - public com.google.storage.v2.StartResumableWriteResponse startResumableWrite( - com.google.storage.v2.StartResumableWriteRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getStartResumableWriteMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Determines the `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.
-     * 
- */ - public com.google.storage.v2.QueryWriteStatusResponse queryWriteStatus( - com.google.storage.v2.QueryWriteStatusRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getQueryWriteStatusMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Retrieves the name of a project's Google Cloud Storage service account.
-     * 
- */ - public com.google.storage.v2.ServiceAccount getServiceAccount( - com.google.storage.v2.GetServiceAccountRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetServiceAccountMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Creates a new HMAC key for the given service account.
-     * 
- */ - public com.google.storage.v2.CreateHmacKeyResponse createHmacKey( - com.google.storage.v2.CreateHmacKeyRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCreateHmacKeyMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Deletes a given HMAC key.  Key must be in an INACTIVE state.
-     * 
- */ - public com.google.protobuf.Empty deleteHmacKey( - com.google.storage.v2.DeleteHmacKeyRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeleteHmacKeyMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Gets an existing HMAC key metadata for the given id.
-     * 
- */ - public com.google.storage.v2.HmacKeyMetadata getHmacKey( - com.google.storage.v2.GetHmacKeyRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetHmacKeyMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Lists HMAC keys under a given project with the additional filters provided.
-     * 
- */ - public com.google.storage.v2.ListHmacKeysResponse listHmacKeys( - com.google.storage.v2.ListHmacKeysRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListHmacKeysMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Updates a given HMAC key state between ACTIVE and INACTIVE.
-     * 
- */ - public com.google.storage.v2.HmacKeyMetadata updateHmacKey( - com.google.storage.v2.UpdateHmacKeyRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getUpdateHmacKeyMethod(), getCallOptions(), request); - } - } - - /** - * - * - *
-   * ## API Overview and Naming Syntax
-   * The Cloud Storage gRPC API allows applications to read and write data through
-   * the abstractions of buckets and objects. For a description of these
-   * abstractions please see https://cloud.google.com/storage/docs.
-   * Resources are named as follows:
-   *   - Projects are referred to as they are defined by the Resource Manager API,
-   *     using strings like `projects/123456` or `projects/my-string-id`.
-   *   - Buckets are named using string names of the form:
-   *     `projects/{project}/buckets/{bucket}`
-   *     For globally unique buckets, `_` may be substituted for the project.
-   *   - Objects are uniquely identified by their name along with the name of the
-   *     bucket they belong to, as separate strings in this API. For example:
-   *       ReadObjectRequest {
-   *         bucket: 'projects/_/buckets/my-bucket'
-   *         object: 'my-object'
-   *       }
-   *     Note that object names can contain `/` characters, which are treated as
-   *     any other character (no special directory semantics).
-   * 
- */ - public static final class StorageFutureStub - extends io.grpc.stub.AbstractFutureStub { - private StorageFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected StorageFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new StorageFutureStub(channel, callOptions); - } - - /** - * - * - *
-     * Permanently deletes an empty bucket.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - deleteBucket(com.google.storage.v2.DeleteBucketRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDeleteBucketMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Returns metadata for the specified bucket.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - getBucket(com.google.storage.v2.GetBucketRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetBucketMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Creates a new bucket.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - createBucket(com.google.storage.v2.CreateBucketRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCreateBucketMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Retrieves a list of buckets for a given project.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.storage.v2.ListBucketsResponse> - listBuckets(com.google.storage.v2.ListBucketsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListBucketsMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Locks retention policy on a bucket.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - lockBucketRetentionPolicy(com.google.storage.v2.LockBucketRetentionPolicyRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getLockBucketRetentionPolicyMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Gets the IAM policy for a specified bucket.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Updates an IAM policy for the specified bucket.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Tests a set of permissions on the given bucket to see which, if
-     * any, are held by the caller.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.iam.v1.TestIamPermissionsResponse> - testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Updates a bucket. Equivalent to JSON API's storage.buckets.patch method.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - updateBucket(com.google.storage.v2.UpdateBucketRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getUpdateBucketMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Permanently deletes a notification subscription.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - deleteNotification(com.google.storage.v2.DeleteNotificationRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDeleteNotificationMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * View a notification config.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - getNotification(com.google.storage.v2.GetNotificationRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetNotificationMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Creates a notification subscription for a given bucket.
-     * These notifications, when triggered, publish messages to the specified
-     * Pub/Sub topics.
-     * See https://cloud.google.com/storage/docs/pubsub-notifications.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - createNotification(com.google.storage.v2.CreateNotificationRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCreateNotificationMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Retrieves a list of notification subscriptions for a given bucket.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.storage.v2.ListNotificationsResponse> - listNotifications(com.google.storage.v2.ListNotificationsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListNotificationsMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Concatenates a list of existing objects into a new object in the same
-     * bucket.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - composeObject(com.google.storage.v2.ComposeObjectRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getComposeObjectMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Deletes an object and its metadata. Deletions are permanent if versioning
-     * is not enabled for the bucket, or if the `generation` parameter
-     * is used.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - deleteObject(com.google.storage.v2.DeleteObjectRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDeleteObjectMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Retrieves an object's metadata.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - getObject(com.google.storage.v2.GetObjectRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetObjectMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Updates an object's metadata.
-     * Equivalent to JSON API's storage.objects.patch.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - updateObject(com.google.storage.v2.UpdateObjectRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getUpdateObjectMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Retrieves a list of objects matching the criteria.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.storage.v2.ListObjectsResponse> - listObjects(com.google.storage.v2.ListObjectsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListObjectsMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Rewrites a source object to a destination object. Optionally overrides
-     * metadata.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - rewriteObject(com.google.storage.v2.RewriteObjectRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getRewriteObjectMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Starts a resumable write. How long the write operation remains valid, and
-     * what happens when the write operation becomes invalid, are
-     * service-dependent.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.storage.v2.StartResumableWriteResponse> - startResumableWrite(com.google.storage.v2.StartResumableWriteRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getStartResumableWriteMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Determines the `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.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.storage.v2.QueryWriteStatusResponse> - queryWriteStatus(com.google.storage.v2.QueryWriteStatusRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getQueryWriteStatusMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Retrieves the name of a project's Google Cloud Storage service account.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - getServiceAccount(com.google.storage.v2.GetServiceAccountRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetServiceAccountMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Creates a new HMAC key for the given service account.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.storage.v2.CreateHmacKeyResponse> - createHmacKey(com.google.storage.v2.CreateHmacKeyRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCreateHmacKeyMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Deletes a given HMAC key.  Key must be in an INACTIVE state.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - deleteHmacKey(com.google.storage.v2.DeleteHmacKeyRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDeleteHmacKeyMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Gets an existing HMAC key metadata for the given id.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - getHmacKey(com.google.storage.v2.GetHmacKeyRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetHmacKeyMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Lists HMAC keys under a given project with the additional filters provided.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.storage.v2.ListHmacKeysResponse> - listHmacKeys(com.google.storage.v2.ListHmacKeysRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListHmacKeysMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Updates a given HMAC key state between ACTIVE and INACTIVE.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - updateHmacKey(com.google.storage.v2.UpdateHmacKeyRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getUpdateHmacKeyMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_DELETE_BUCKET = 0; - private static final int METHODID_GET_BUCKET = 1; - private static final int METHODID_CREATE_BUCKET = 2; - private static final int METHODID_LIST_BUCKETS = 3; - private static final int METHODID_LOCK_BUCKET_RETENTION_POLICY = 4; - private static final int METHODID_GET_IAM_POLICY = 5; - private static final int METHODID_SET_IAM_POLICY = 6; - private static final int METHODID_TEST_IAM_PERMISSIONS = 7; - private static final int METHODID_UPDATE_BUCKET = 8; - private static final int METHODID_DELETE_NOTIFICATION = 9; - private static final int METHODID_GET_NOTIFICATION = 10; - private static final int METHODID_CREATE_NOTIFICATION = 11; - private static final int METHODID_LIST_NOTIFICATIONS = 12; - private static final int METHODID_COMPOSE_OBJECT = 13; - private static final int METHODID_DELETE_OBJECT = 14; - private static final int METHODID_GET_OBJECT = 15; - private static final int METHODID_READ_OBJECT = 16; - private static final int METHODID_UPDATE_OBJECT = 17; - private static final int METHODID_LIST_OBJECTS = 18; - private static final int METHODID_REWRITE_OBJECT = 19; - private static final int METHODID_START_RESUMABLE_WRITE = 20; - private static final int METHODID_QUERY_WRITE_STATUS = 21; - private static final int METHODID_GET_SERVICE_ACCOUNT = 22; - private static final int METHODID_CREATE_HMAC_KEY = 23; - private static final int METHODID_DELETE_HMAC_KEY = 24; - private static final int METHODID_GET_HMAC_KEY = 25; - private static final int METHODID_LIST_HMAC_KEYS = 26; - private static final int METHODID_UPDATE_HMAC_KEY = 27; - private static final int METHODID_WRITE_OBJECT = 28; - - private static final class MethodHandlers - implements io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final StorageImplBase serviceImpl; - private final int methodId; - - MethodHandlers(StorageImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_DELETE_BUCKET: - serviceImpl.deleteBucket( - (com.google.storage.v2.DeleteBucketRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_BUCKET: - serviceImpl.getBucket( - (com.google.storage.v2.GetBucketRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_CREATE_BUCKET: - serviceImpl.createBucket( - (com.google.storage.v2.CreateBucketRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_LIST_BUCKETS: - serviceImpl.listBuckets( - (com.google.storage.v2.ListBucketsRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_LOCK_BUCKET_RETENTION_POLICY: - serviceImpl.lockBucketRetentionPolicy( - (com.google.storage.v2.LockBucketRetentionPolicyRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_IAM_POLICY: - serviceImpl.getIamPolicy( - (com.google.iam.v1.GetIamPolicyRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_SET_IAM_POLICY: - serviceImpl.setIamPolicy( - (com.google.iam.v1.SetIamPolicyRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_TEST_IAM_PERMISSIONS: - serviceImpl.testIamPermissions( - (com.google.iam.v1.TestIamPermissionsRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_UPDATE_BUCKET: - serviceImpl.updateBucket( - (com.google.storage.v2.UpdateBucketRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DELETE_NOTIFICATION: - serviceImpl.deleteNotification( - (com.google.storage.v2.DeleteNotificationRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_NOTIFICATION: - serviceImpl.getNotification( - (com.google.storage.v2.GetNotificationRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_CREATE_NOTIFICATION: - serviceImpl.createNotification( - (com.google.storage.v2.CreateNotificationRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_LIST_NOTIFICATIONS: - serviceImpl.listNotifications( - (com.google.storage.v2.ListNotificationsRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_COMPOSE_OBJECT: - serviceImpl.composeObject( - (com.google.storage.v2.ComposeObjectRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DELETE_OBJECT: - serviceImpl.deleteObject( - (com.google.storage.v2.DeleteObjectRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_OBJECT: - serviceImpl.getObject( - (com.google.storage.v2.GetObjectRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_READ_OBJECT: - serviceImpl.readObject( - (com.google.storage.v2.ReadObjectRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_UPDATE_OBJECT: - serviceImpl.updateObject( - (com.google.storage.v2.UpdateObjectRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_LIST_OBJECTS: - serviceImpl.listObjects( - (com.google.storage.v2.ListObjectsRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_REWRITE_OBJECT: - serviceImpl.rewriteObject( - (com.google.storage.v2.RewriteObjectRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_START_RESUMABLE_WRITE: - serviceImpl.startResumableWrite( - (com.google.storage.v2.StartResumableWriteRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_QUERY_WRITE_STATUS: - serviceImpl.queryWriteStatus( - (com.google.storage.v2.QueryWriteStatusRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_GET_SERVICE_ACCOUNT: - serviceImpl.getServiceAccount( - (com.google.storage.v2.GetServiceAccountRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_CREATE_HMAC_KEY: - serviceImpl.createHmacKey( - (com.google.storage.v2.CreateHmacKeyRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_DELETE_HMAC_KEY: - serviceImpl.deleteHmacKey( - (com.google.storage.v2.DeleteHmacKeyRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_HMAC_KEY: - serviceImpl.getHmacKey( - (com.google.storage.v2.GetHmacKeyRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_LIST_HMAC_KEYS: - serviceImpl.listHmacKeys( - (com.google.storage.v2.ListHmacKeysRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_UPDATE_HMAC_KEY: - serviceImpl.updateHmacKey( - (com.google.storage.v2.UpdateHmacKeyRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_WRITE_OBJECT: - return (io.grpc.stub.StreamObserver) - serviceImpl.writeObject( - (io.grpc.stub.StreamObserver) - responseObserver); - default: - throw new AssertionError(); - } - } - } - - private abstract static class StorageBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, - io.grpc.protobuf.ProtoServiceDescriptorSupplier { - StorageBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return com.google.storage.v2.StorageProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("Storage"); - } - } - - private static final class StorageFileDescriptorSupplier extends StorageBaseDescriptorSupplier { - StorageFileDescriptorSupplier() {} - } - - private static final class StorageMethodDescriptorSupplier extends StorageBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - StorageMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (StorageGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = - result = - io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new StorageFileDescriptorSupplier()) - .addMethod(getDeleteBucketMethod()) - .addMethod(getGetBucketMethod()) - .addMethod(getCreateBucketMethod()) - .addMethod(getListBucketsMethod()) - .addMethod(getLockBucketRetentionPolicyMethod()) - .addMethod(getGetIamPolicyMethod()) - .addMethod(getSetIamPolicyMethod()) - .addMethod(getTestIamPermissionsMethod()) - .addMethod(getUpdateBucketMethod()) - .addMethod(getDeleteNotificationMethod()) - .addMethod(getGetNotificationMethod()) - .addMethod(getCreateNotificationMethod()) - .addMethod(getListNotificationsMethod()) - .addMethod(getComposeObjectMethod()) - .addMethod(getDeleteObjectMethod()) - .addMethod(getGetObjectMethod()) - .addMethod(getReadObjectMethod()) - .addMethod(getUpdateObjectMethod()) - .addMethod(getWriteObjectMethod()) - .addMethod(getListObjectsMethod()) - .addMethod(getRewriteObjectMethod()) - .addMethod(getStartResumableWriteMethod()) - .addMethod(getQueryWriteStatusMethod()) - .addMethod(getGetServiceAccountMethod()) - .addMethod(getCreateHmacKeyMethod()) - .addMethod(getDeleteHmacKeyMethod()) - .addMethod(getGetHmacKeyMethod()) - .addMethod(getListHmacKeysMethod()) - .addMethod(getUpdateHmacKeyMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/java.header b/java.header index d0970ba7d3..3a9b503aa2 100644 --- a/java.header +++ b/java.header @@ -1,5 +1,5 @@ ^/\*$ -^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)$ +^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)( All [rR]ights [rR]eserved\.)?$ ^ \*$ ^ \* Licensed under the Apache License, Version 2\.0 \(the "License"\);$ ^ \* you may not use this file except in compliance with the License\.$ diff --git a/pom.xml b/pom.xml index 4fad76dfbd..783139535f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-storage-parent pom - 2.4.6-SNAPSHOT + 1.113.5-SNAPSHOT Storage Parent https://github.com/googleapis/java-storage @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.3.0 + 0.9.4 @@ -41,7 +41,16 @@ https://github.com/googleapis/java-storage/issues GitHub Issues - + + + sonatype-nexus-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + sonatype-nexus-staging + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + Apache-2.0 @@ -54,7 +63,7 @@ UTF-8 github google-cloud-storage-parent - 2.8.0 + 0.15.0 @@ -67,15 +76,10 @@ import - - com.google.cloud - google-cloud-storage - 2.4.6-SNAPSHOT - com.google.apis google-api-services-storage - v1-rev20220210-1.32.1 + v1-rev20201112-1.30.10 com.google.cloud @@ -86,54 +90,26 @@ org.easymock easymock - 4.3 + 3.6 test org.mockito mockito-core - 4.4.0 + 2.28.2 test - - - - org.objenesis - objenesis - - org.objenesis objenesis - 3.2 + 2.6 test - - com.google.api.grpc - proto-google-cloud-storage-v2 - 2.4.6-alpha-SNAPSHOT - - - com.google.api.grpc - grpc-google-cloud-storage-v2 - 2.4.6-alpha-SNAPSHOT - - - com.google.api.grpc - gapic-google-cloud-storage-v2 - 2.4.6-alpha-SNAPSHOT - com.google.cloud google-cloud-conformance-tests - 0.2.8 + 0.0.11 test - - - org.checkerframework - checker-qual - - org.apache.httpcomponents @@ -150,7 +126,7 @@ org.apache.httpcomponents httpcore - 4.4.15 + 4.4.13 test @@ -158,20 +134,14 @@ junit junit - 4.13.2 + 4.13.1 test com.google.truth truth - 1.1.3 + 1.0.1 test - - - org.checkerframework - checker-qual - - @@ -189,11 +159,78 @@ google-cloud-storage - grpc-google-cloud-storage-v2 - proto-google-cloud-storage-v2 - gapic-google-cloud-storage-v2 + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.1.1 + + + + index + dependency-info + team + ci-management + issue-management + licenses + scm + dependency-management + distribution-management + summary + modules + + + + + true + ${site.installationModule} + jar + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + html + + aggregate + javadoc + + + + + none + protected + true + ${project.build.directory}/javadoc + + + Test helpers packages + com.google.cloud.testing + + + SPI packages + com.google.cloud.spi* + + + + + https://grpc.io/grpc-java/javadoc/ + https://developers.google.com/protocol-buffers/docs/reference/java/ + https://googleapis.dev/java/google-auth-library/latest/ + https://googleapis.dev/java/gax/latest/ + https://googleapis.github.io/api-common-java/${google.api-common.version}/apidocs/ + + + + + + include-samples diff --git a/proto-google-cloud-storage-v2/clirr-ignored-differences.xml b/proto-google-cloud-storage-v2/clirr-ignored-differences.xml deleted file mode 100644 index 8d323bb12c..0000000000 --- a/proto-google-cloud-storage-v2/clirr-ignored-differences.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - 7012 - com/google/storage/v2/*OrBuilder - * get*(*) - - - 7012 - com/google/storage/v2/*OrBuilder - boolean contains*(*) - - - 7012 - com/google/storage/v2/*OrBuilder - boolean has*(*) - - - - - 6011 - com/google/storage/v2/* - ZONE_AFFINITY_FIELD_NUMBER - - - 7002 - com/google/storage/v2/* - * *ZoneAffinity*(*) - - - - - - - 7005 - com/google/storage/v2/Object* - * *CustomerEncryption*(*) - * - - - - 7006 - com/google/storage/v2/Object* - * *CustomerEncryption*(*) - * - - - - 8001 - com/google/storage/v2/Object$CustomerEncryption* - - - - diff --git a/proto-google-cloud-storage-v2/pom.xml b/proto-google-cloud-storage-v2/pom.xml deleted file mode 100644 index cc4144c019..0000000000 --- a/proto-google-cloud-storage-v2/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - 4.0.0 - com.google.api.grpc - proto-google-cloud-storage-v2 - 2.4.6-alpha-SNAPSHOT - proto-google-cloud-storage-v2 - PROTO library for proto-google-cloud-storage-v2 - - com.google.cloud - google-cloud-storage-parent - 2.4.6-SNAPSHOT - - - - com.google.protobuf - protobuf-java - - - com.google.api.grpc - proto-google-common-protos - - - com.google.api.grpc - proto-google-iam-v1 - - - com.google.api - api-common - - - com.google.guava - guava - - - diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Bucket.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Bucket.java deleted file mode 100644 index c3364402a2..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Bucket.java +++ /dev/null @@ -1,22391 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * A bucket.
- * 
- * - * Protobuf type {@code google.storage.v2.Bucket} - */ -public final class Bucket extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket) - BucketOrBuilder { - private static final long serialVersionUID = 0L; - // Use Bucket.newBuilder() to construct. - private Bucket(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Bucket() { - name_ = ""; - bucketId_ = ""; - project_ = ""; - location_ = ""; - locationType_ = ""; - storageClass_ = ""; - rpo_ = ""; - acl_ = java.util.Collections.emptyList(); - defaultObjectAcl_ = java.util.Collections.emptyList(); - cors_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Bucket(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Bucket( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - bucketId_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - project_ = s; - break; - } - case 32: - { - metageneration_ = input.readInt64(); - break; - } - case 42: - { - java.lang.String s = input.readStringRequireUtf8(); - - location_ = s; - break; - } - case 50: - { - java.lang.String s = input.readStringRequireUtf8(); - - locationType_ = s; - break; - } - case 58: - { - java.lang.String s = input.readStringRequireUtf8(); - - storageClass_ = s; - break; - } - case 66: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - acl_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - acl_.add( - input.readMessage( - com.google.storage.v2.BucketAccessControl.parser(), extensionRegistry)); - break; - } - case 74: - { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - defaultObjectAcl_ = - new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - defaultObjectAcl_.add( - input.readMessage( - com.google.storage.v2.ObjectAccessControl.parser(), extensionRegistry)); - break; - } - case 82: - { - com.google.storage.v2.Bucket.Lifecycle.Builder subBuilder = null; - if (lifecycle_ != null) { - subBuilder = lifecycle_.toBuilder(); - } - lifecycle_ = - input.readMessage( - com.google.storage.v2.Bucket.Lifecycle.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(lifecycle_); - lifecycle_ = subBuilder.buildPartial(); - } - - break; - } - case 90: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (createTime_ != null) { - subBuilder = createTime_.toBuilder(); - } - createTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(createTime_); - createTime_ = subBuilder.buildPartial(); - } - - break; - } - case 98: - { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - cors_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - cors_.add( - input.readMessage(com.google.storage.v2.Bucket.Cors.parser(), extensionRegistry)); - break; - } - case 106: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (updateTime_ != null) { - subBuilder = updateTime_.toBuilder(); - } - updateTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateTime_); - updateTime_ = subBuilder.buildPartial(); - } - - break; - } - case 112: - { - defaultEventBasedHold_ = input.readBool(); - break; - } - case 122: - { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - labels_ = - com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000008; - } - com.google.protobuf.MapEntry labels__ = - input.readMessage( - LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); - break; - } - case 130: - { - com.google.storage.v2.Bucket.Website.Builder subBuilder = null; - if (website_ != null) { - subBuilder = website_.toBuilder(); - } - website_ = - input.readMessage( - com.google.storage.v2.Bucket.Website.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(website_); - website_ = subBuilder.buildPartial(); - } - - break; - } - case 138: - { - com.google.storage.v2.Bucket.Versioning.Builder subBuilder = null; - if (versioning_ != null) { - subBuilder = versioning_.toBuilder(); - } - versioning_ = - input.readMessage( - com.google.storage.v2.Bucket.Versioning.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(versioning_); - versioning_ = subBuilder.buildPartial(); - } - - break; - } - case 146: - { - com.google.storage.v2.Bucket.Logging.Builder subBuilder = null; - if (logging_ != null) { - subBuilder = logging_.toBuilder(); - } - logging_ = - input.readMessage( - com.google.storage.v2.Bucket.Logging.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(logging_); - logging_ = subBuilder.buildPartial(); - } - - break; - } - case 154: - { - com.google.storage.v2.Owner.Builder subBuilder = null; - if (owner_ != null) { - subBuilder = owner_.toBuilder(); - } - owner_ = input.readMessage(com.google.storage.v2.Owner.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(owner_); - owner_ = subBuilder.buildPartial(); - } - - break; - } - case 162: - { - com.google.storage.v2.Bucket.Encryption.Builder subBuilder = null; - if (encryption_ != null) { - subBuilder = encryption_.toBuilder(); - } - encryption_ = - input.readMessage( - com.google.storage.v2.Bucket.Encryption.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(encryption_); - encryption_ = subBuilder.buildPartial(); - } - - break; - } - case 170: - { - com.google.storage.v2.Bucket.Billing.Builder subBuilder = null; - if (billing_ != null) { - subBuilder = billing_.toBuilder(); - } - billing_ = - input.readMessage( - com.google.storage.v2.Bucket.Billing.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(billing_); - billing_ = subBuilder.buildPartial(); - } - - break; - } - case 178: - { - com.google.storage.v2.Bucket.RetentionPolicy.Builder subBuilder = null; - if (retentionPolicy_ != null) { - subBuilder = retentionPolicy_.toBuilder(); - } - retentionPolicy_ = - input.readMessage( - com.google.storage.v2.Bucket.RetentionPolicy.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(retentionPolicy_); - retentionPolicy_ = subBuilder.buildPartial(); - } - - break; - } - case 186: - { - com.google.storage.v2.Bucket.IamConfig.Builder subBuilder = null; - if (iamConfig_ != null) { - subBuilder = iamConfig_.toBuilder(); - } - iamConfig_ = - input.readMessage( - com.google.storage.v2.Bucket.IamConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(iamConfig_); - iamConfig_ = subBuilder.buildPartial(); - } - - break; - } - case 200: - { - satisfiesPzs_ = input.readBool(); - break; - } - case 210: - { - com.google.storage.v2.Bucket.CustomPlacementConfig.Builder subBuilder = null; - if (customPlacementConfig_ != null) { - subBuilder = customPlacementConfig_.toBuilder(); - } - customPlacementConfig_ = - input.readMessage( - com.google.storage.v2.Bucket.CustomPlacementConfig.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(customPlacementConfig_); - customPlacementConfig_ = subBuilder.buildPartial(); - } - - break; - } - case 218: - { - java.lang.String s = input.readStringRequireUtf8(); - - rpo_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - acl_ = java.util.Collections.unmodifiableList(acl_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - defaultObjectAcl_ = java.util.Collections.unmodifiableList(defaultObjectAcl_); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - cors_ = java.util.Collections.unmodifiableList(cors_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto.internal_static_google_storage_v2_Bucket_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 15: - return internalGetLabels(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.class, com.google.storage.v2.Bucket.Builder.class); - } - - public interface BillingOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.Billing) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * When set to true, Requester Pays is enabled for this bucket.
-     * 
- * - * bool requester_pays = 1; - * - * @return The requesterPays. - */ - boolean getRequesterPays(); - } - /** - * - * - *
-   * Billing properties of a bucket.
-   * 
- * - * Protobuf type {@code google.storage.v2.Bucket.Billing} - */ - public static final class Billing extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.Billing) - BillingOrBuilder { - private static final long serialVersionUID = 0L; - // Use Billing.newBuilder() to construct. - private Billing(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Billing() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Billing(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Billing( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - requesterPays_ = input.readBool(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Billing_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Billing_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.Billing.class, - com.google.storage.v2.Bucket.Billing.Builder.class); - } - - public static final int REQUESTER_PAYS_FIELD_NUMBER = 1; - private boolean requesterPays_; - /** - * - * - *
-     * When set to true, Requester Pays is enabled for this bucket.
-     * 
- * - * bool requester_pays = 1; - * - * @return The requesterPays. - */ - @java.lang.Override - public boolean getRequesterPays() { - return requesterPays_; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (requesterPays_ != false) { - output.writeBool(1, requesterPays_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (requesterPays_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, requesterPays_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.Bucket.Billing)) { - return super.equals(obj); - } - com.google.storage.v2.Bucket.Billing other = (com.google.storage.v2.Bucket.Billing) obj; - - if (getRequesterPays() != other.getRequesterPays()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + REQUESTER_PAYS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequesterPays()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.Bucket.Billing parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Billing parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Billing parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Billing parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Billing parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Billing parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Billing parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Billing parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Billing parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Billing parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Billing parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Billing parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.Bucket.Billing prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * Billing properties of a bucket.
-     * 
- * - * Protobuf type {@code google.storage.v2.Bucket.Billing} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.Billing) - com.google.storage.v2.Bucket.BillingOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Billing_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Billing_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.Billing.class, - com.google.storage.v2.Bucket.Billing.Builder.class); - } - - // Construct using com.google.storage.v2.Bucket.Billing.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - requesterPays_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Billing_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Billing getDefaultInstanceForType() { - return com.google.storage.v2.Bucket.Billing.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Billing build() { - com.google.storage.v2.Bucket.Billing result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Billing buildPartial() { - com.google.storage.v2.Bucket.Billing result = - new com.google.storage.v2.Bucket.Billing(this); - result.requesterPays_ = requesterPays_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.Bucket.Billing) { - return mergeFrom((com.google.storage.v2.Bucket.Billing) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.Bucket.Billing other) { - if (other == com.google.storage.v2.Bucket.Billing.getDefaultInstance()) return this; - if (other.getRequesterPays() != false) { - setRequesterPays(other.getRequesterPays()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.Bucket.Billing parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.Bucket.Billing) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private boolean requesterPays_; - /** - * - * - *
-       * When set to true, Requester Pays is enabled for this bucket.
-       * 
- * - * bool requester_pays = 1; - * - * @return The requesterPays. - */ - @java.lang.Override - public boolean getRequesterPays() { - return requesterPays_; - } - /** - * - * - *
-       * When set to true, Requester Pays is enabled for this bucket.
-       * 
- * - * bool requester_pays = 1; - * - * @param value The requesterPays to set. - * @return This builder for chaining. - */ - public Builder setRequesterPays(boolean value) { - - requesterPays_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * When set to true, Requester Pays is enabled for this bucket.
-       * 
- * - * bool requester_pays = 1; - * - * @return This builder for chaining. - */ - public Builder clearRequesterPays() { - - requesterPays_ = false; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.Bucket.Billing) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.Billing) - private static final com.google.storage.v2.Bucket.Billing DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.Billing(); - } - - public static com.google.storage.v2.Bucket.Billing getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Billing parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Billing(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Billing getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface CorsOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.Cors) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * The list of Origins eligible to receive CORS response headers. See
-     * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
-     * Note: "*" is permitted in the list of origins, and means "any Origin".
-     * 
- * - * repeated string origin = 1; - * - * @return A list containing the origin. - */ - java.util.List getOriginList(); - /** - * - * - *
-     * The list of Origins eligible to receive CORS response headers. See
-     * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
-     * Note: "*" is permitted in the list of origins, and means "any Origin".
-     * 
- * - * repeated string origin = 1; - * - * @return The count of origin. - */ - int getOriginCount(); - /** - * - * - *
-     * The list of Origins eligible to receive CORS response headers. See
-     * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
-     * Note: "*" is permitted in the list of origins, and means "any Origin".
-     * 
- * - * repeated string origin = 1; - * - * @param index The index of the element to return. - * @return The origin at the given index. - */ - java.lang.String getOrigin(int index); - /** - * - * - *
-     * The list of Origins eligible to receive CORS response headers. See
-     * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
-     * Note: "*" is permitted in the list of origins, and means "any Origin".
-     * 
- * - * repeated string origin = 1; - * - * @param index The index of the value to return. - * @return The bytes of the origin at the given index. - */ - com.google.protobuf.ByteString getOriginBytes(int index); - - /** - * - * - *
-     * The list of HTTP methods on which to include CORS response headers,
-     * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
-     * methods, and means "any method".
-     * 
- * - * repeated string method = 2; - * - * @return A list containing the method. - */ - java.util.List getMethodList(); - /** - * - * - *
-     * The list of HTTP methods on which to include CORS response headers,
-     * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
-     * methods, and means "any method".
-     * 
- * - * repeated string method = 2; - * - * @return The count of method. - */ - int getMethodCount(); - /** - * - * - *
-     * The list of HTTP methods on which to include CORS response headers,
-     * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
-     * methods, and means "any method".
-     * 
- * - * repeated string method = 2; - * - * @param index The index of the element to return. - * @return The method at the given index. - */ - java.lang.String getMethod(int index); - /** - * - * - *
-     * The list of HTTP methods on which to include CORS response headers,
-     * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
-     * methods, and means "any method".
-     * 
- * - * repeated string method = 2; - * - * @param index The index of the value to return. - * @return The bytes of the method at the given index. - */ - com.google.protobuf.ByteString getMethodBytes(int index); - - /** - * - * - *
-     * The list of HTTP headers other than the
-     * [https://www.w3.org/TR/cors/#simple-response-header][simple response
-     * headers] to give permission for the user-agent to share across domains.
-     * 
- * - * repeated string response_header = 3; - * - * @return A list containing the responseHeader. - */ - java.util.List getResponseHeaderList(); - /** - * - * - *
-     * The list of HTTP headers other than the
-     * [https://www.w3.org/TR/cors/#simple-response-header][simple response
-     * headers] to give permission for the user-agent to share across domains.
-     * 
- * - * repeated string response_header = 3; - * - * @return The count of responseHeader. - */ - int getResponseHeaderCount(); - /** - * - * - *
-     * The list of HTTP headers other than the
-     * [https://www.w3.org/TR/cors/#simple-response-header][simple response
-     * headers] to give permission for the user-agent to share across domains.
-     * 
- * - * repeated string response_header = 3; - * - * @param index The index of the element to return. - * @return The responseHeader at the given index. - */ - java.lang.String getResponseHeader(int index); - /** - * - * - *
-     * The list of HTTP headers other than the
-     * [https://www.w3.org/TR/cors/#simple-response-header][simple response
-     * headers] to give permission for the user-agent to share across domains.
-     * 
- * - * repeated string response_header = 3; - * - * @param index The index of the value to return. - * @return The bytes of the responseHeader at the given index. - */ - com.google.protobuf.ByteString getResponseHeaderBytes(int index); - - /** - * - * - *
-     * The value, in seconds, to return in the
-     * [https://www.w3.org/TR/cors/#access-control-max-age-response-header][Access-Control-Max-Age
-     * header] used in preflight responses.
-     * 
- * - * int32 max_age_seconds = 4; - * - * @return The maxAgeSeconds. - */ - int getMaxAgeSeconds(); - } - /** - * - * - *
-   * Cross-Origin Response sharing (CORS) properties for a bucket.
-   * For more on Cloud Storage and CORS, see
-   * https://cloud.google.com/storage/docs/cross-origin.
-   * For more on CORS in general, see https://tools.ietf.org/html/rfc6454.
-   * 
- * - * Protobuf type {@code google.storage.v2.Bucket.Cors} - */ - public static final class Cors extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.Cors) - CorsOrBuilder { - private static final long serialVersionUID = 0L; - // Use Cors.newBuilder() to construct. - private Cors(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Cors() { - origin_ = com.google.protobuf.LazyStringArrayList.EMPTY; - method_ = com.google.protobuf.LazyStringArrayList.EMPTY; - responseHeader_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Cors(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Cors( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - origin_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - origin_.add(s); - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - method_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; - } - method_.add(s); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - responseHeader_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000004; - } - responseHeader_.add(s); - break; - } - case 32: - { - maxAgeSeconds_ = input.readInt32(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - origin_ = origin_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - method_ = method_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - responseHeader_ = responseHeader_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Cors_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Cors_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.Cors.class, - com.google.storage.v2.Bucket.Cors.Builder.class); - } - - public static final int ORIGIN_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList origin_; - /** - * - * - *
-     * The list of Origins eligible to receive CORS response headers. See
-     * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
-     * Note: "*" is permitted in the list of origins, and means "any Origin".
-     * 
- * - * repeated string origin = 1; - * - * @return A list containing the origin. - */ - public com.google.protobuf.ProtocolStringList getOriginList() { - return origin_; - } - /** - * - * - *
-     * The list of Origins eligible to receive CORS response headers. See
-     * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
-     * Note: "*" is permitted in the list of origins, and means "any Origin".
-     * 
- * - * repeated string origin = 1; - * - * @return The count of origin. - */ - public int getOriginCount() { - return origin_.size(); - } - /** - * - * - *
-     * The list of Origins eligible to receive CORS response headers. See
-     * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
-     * Note: "*" is permitted in the list of origins, and means "any Origin".
-     * 
- * - * repeated string origin = 1; - * - * @param index The index of the element to return. - * @return The origin at the given index. - */ - public java.lang.String getOrigin(int index) { - return origin_.get(index); - } - /** - * - * - *
-     * The list of Origins eligible to receive CORS response headers. See
-     * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
-     * Note: "*" is permitted in the list of origins, and means "any Origin".
-     * 
- * - * repeated string origin = 1; - * - * @param index The index of the value to return. - * @return The bytes of the origin at the given index. - */ - public com.google.protobuf.ByteString getOriginBytes(int index) { - return origin_.getByteString(index); - } - - public static final int METHOD_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList method_; - /** - * - * - *
-     * The list of HTTP methods on which to include CORS response headers,
-     * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
-     * methods, and means "any method".
-     * 
- * - * repeated string method = 2; - * - * @return A list containing the method. - */ - public com.google.protobuf.ProtocolStringList getMethodList() { - return method_; - } - /** - * - * - *
-     * The list of HTTP methods on which to include CORS response headers,
-     * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
-     * methods, and means "any method".
-     * 
- * - * repeated string method = 2; - * - * @return The count of method. - */ - public int getMethodCount() { - return method_.size(); - } - /** - * - * - *
-     * The list of HTTP methods on which to include CORS response headers,
-     * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
-     * methods, and means "any method".
-     * 
- * - * repeated string method = 2; - * - * @param index The index of the element to return. - * @return The method at the given index. - */ - public java.lang.String getMethod(int index) { - return method_.get(index); - } - /** - * - * - *
-     * The list of HTTP methods on which to include CORS response headers,
-     * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
-     * methods, and means "any method".
-     * 
- * - * repeated string method = 2; - * - * @param index The index of the value to return. - * @return The bytes of the method at the given index. - */ - public com.google.protobuf.ByteString getMethodBytes(int index) { - return method_.getByteString(index); - } - - public static final int RESPONSE_HEADER_FIELD_NUMBER = 3; - private com.google.protobuf.LazyStringList responseHeader_; - /** - * - * - *
-     * The list of HTTP headers other than the
-     * [https://www.w3.org/TR/cors/#simple-response-header][simple response
-     * headers] to give permission for the user-agent to share across domains.
-     * 
- * - * repeated string response_header = 3; - * - * @return A list containing the responseHeader. - */ - public com.google.protobuf.ProtocolStringList getResponseHeaderList() { - return responseHeader_; - } - /** - * - * - *
-     * The list of HTTP headers other than the
-     * [https://www.w3.org/TR/cors/#simple-response-header][simple response
-     * headers] to give permission for the user-agent to share across domains.
-     * 
- * - * repeated string response_header = 3; - * - * @return The count of responseHeader. - */ - public int getResponseHeaderCount() { - return responseHeader_.size(); - } - /** - * - * - *
-     * The list of HTTP headers other than the
-     * [https://www.w3.org/TR/cors/#simple-response-header][simple response
-     * headers] to give permission for the user-agent to share across domains.
-     * 
- * - * repeated string response_header = 3; - * - * @param index The index of the element to return. - * @return The responseHeader at the given index. - */ - public java.lang.String getResponseHeader(int index) { - return responseHeader_.get(index); - } - /** - * - * - *
-     * The list of HTTP headers other than the
-     * [https://www.w3.org/TR/cors/#simple-response-header][simple response
-     * headers] to give permission for the user-agent to share across domains.
-     * 
- * - * repeated string response_header = 3; - * - * @param index The index of the value to return. - * @return The bytes of the responseHeader at the given index. - */ - public com.google.protobuf.ByteString getResponseHeaderBytes(int index) { - return responseHeader_.getByteString(index); - } - - public static final int MAX_AGE_SECONDS_FIELD_NUMBER = 4; - private int maxAgeSeconds_; - /** - * - * - *
-     * The value, in seconds, to return in the
-     * [https://www.w3.org/TR/cors/#access-control-max-age-response-header][Access-Control-Max-Age
-     * header] used in preflight responses.
-     * 
- * - * int32 max_age_seconds = 4; - * - * @return The maxAgeSeconds. - */ - @java.lang.Override - public int getMaxAgeSeconds() { - return maxAgeSeconds_; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < origin_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, origin_.getRaw(i)); - } - for (int i = 0; i < method_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, method_.getRaw(i)); - } - for (int i = 0; i < responseHeader_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, responseHeader_.getRaw(i)); - } - if (maxAgeSeconds_ != 0) { - output.writeInt32(4, maxAgeSeconds_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < origin_.size(); i++) { - dataSize += computeStringSizeNoTag(origin_.getRaw(i)); - } - size += dataSize; - size += 1 * getOriginList().size(); - } - { - int dataSize = 0; - for (int i = 0; i < method_.size(); i++) { - dataSize += computeStringSizeNoTag(method_.getRaw(i)); - } - size += dataSize; - size += 1 * getMethodList().size(); - } - { - int dataSize = 0; - for (int i = 0; i < responseHeader_.size(); i++) { - dataSize += computeStringSizeNoTag(responseHeader_.getRaw(i)); - } - size += dataSize; - size += 1 * getResponseHeaderList().size(); - } - if (maxAgeSeconds_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, maxAgeSeconds_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.Bucket.Cors)) { - return super.equals(obj); - } - com.google.storage.v2.Bucket.Cors other = (com.google.storage.v2.Bucket.Cors) obj; - - if (!getOriginList().equals(other.getOriginList())) return false; - if (!getMethodList().equals(other.getMethodList())) return false; - if (!getResponseHeaderList().equals(other.getResponseHeaderList())) return false; - if (getMaxAgeSeconds() != other.getMaxAgeSeconds()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getOriginCount() > 0) { - hash = (37 * hash) + ORIGIN_FIELD_NUMBER; - hash = (53 * hash) + getOriginList().hashCode(); - } - if (getMethodCount() > 0) { - hash = (37 * hash) + METHOD_FIELD_NUMBER; - hash = (53 * hash) + getMethodList().hashCode(); - } - if (getResponseHeaderCount() > 0) { - hash = (37 * hash) + RESPONSE_HEADER_FIELD_NUMBER; - hash = (53 * hash) + getResponseHeaderList().hashCode(); - } - hash = (37 * hash) + MAX_AGE_SECONDS_FIELD_NUMBER; - hash = (53 * hash) + getMaxAgeSeconds(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.Bucket.Cors parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Cors parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Cors parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Cors parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Cors parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Cors parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Cors parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Cors parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Cors parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Cors parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Cors parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Cors parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.Bucket.Cors prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * Cross-Origin Response sharing (CORS) properties for a bucket.
-     * For more on Cloud Storage and CORS, see
-     * https://cloud.google.com/storage/docs/cross-origin.
-     * For more on CORS in general, see https://tools.ietf.org/html/rfc6454.
-     * 
- * - * Protobuf type {@code google.storage.v2.Bucket.Cors} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.Cors) - com.google.storage.v2.Bucket.CorsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Cors_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Cors_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.Cors.class, - com.google.storage.v2.Bucket.Cors.Builder.class); - } - - // Construct using com.google.storage.v2.Bucket.Cors.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - origin_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - method_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - responseHeader_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - maxAgeSeconds_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Cors_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Cors getDefaultInstanceForType() { - return com.google.storage.v2.Bucket.Cors.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Cors build() { - com.google.storage.v2.Bucket.Cors result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Cors buildPartial() { - com.google.storage.v2.Bucket.Cors result = new com.google.storage.v2.Bucket.Cors(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - origin_ = origin_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.origin_ = origin_; - if (((bitField0_ & 0x00000002) != 0)) { - method_ = method_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.method_ = method_; - if (((bitField0_ & 0x00000004) != 0)) { - responseHeader_ = responseHeader_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.responseHeader_ = responseHeader_; - result.maxAgeSeconds_ = maxAgeSeconds_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.Bucket.Cors) { - return mergeFrom((com.google.storage.v2.Bucket.Cors) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.Bucket.Cors other) { - if (other == com.google.storage.v2.Bucket.Cors.getDefaultInstance()) return this; - if (!other.origin_.isEmpty()) { - if (origin_.isEmpty()) { - origin_ = other.origin_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureOriginIsMutable(); - origin_.addAll(other.origin_); - } - onChanged(); - } - if (!other.method_.isEmpty()) { - if (method_.isEmpty()) { - method_ = other.method_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureMethodIsMutable(); - method_.addAll(other.method_); - } - onChanged(); - } - if (!other.responseHeader_.isEmpty()) { - if (responseHeader_.isEmpty()) { - responseHeader_ = other.responseHeader_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureResponseHeaderIsMutable(); - responseHeader_.addAll(other.responseHeader_); - } - onChanged(); - } - if (other.getMaxAgeSeconds() != 0) { - setMaxAgeSeconds(other.getMaxAgeSeconds()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.Bucket.Cors parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.Bucket.Cors) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private com.google.protobuf.LazyStringList origin_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensureOriginIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - origin_ = new com.google.protobuf.LazyStringArrayList(origin_); - bitField0_ |= 0x00000001; - } - } - /** - * - * - *
-       * The list of Origins eligible to receive CORS response headers. See
-       * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
-       * Note: "*" is permitted in the list of origins, and means "any Origin".
-       * 
- * - * repeated string origin = 1; - * - * @return A list containing the origin. - */ - public com.google.protobuf.ProtocolStringList getOriginList() { - return origin_.getUnmodifiableView(); - } - /** - * - * - *
-       * The list of Origins eligible to receive CORS response headers. See
-       * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
-       * Note: "*" is permitted in the list of origins, and means "any Origin".
-       * 
- * - * repeated string origin = 1; - * - * @return The count of origin. - */ - public int getOriginCount() { - return origin_.size(); - } - /** - * - * - *
-       * The list of Origins eligible to receive CORS response headers. See
-       * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
-       * Note: "*" is permitted in the list of origins, and means "any Origin".
-       * 
- * - * repeated string origin = 1; - * - * @param index The index of the element to return. - * @return The origin at the given index. - */ - public java.lang.String getOrigin(int index) { - return origin_.get(index); - } - /** - * - * - *
-       * The list of Origins eligible to receive CORS response headers. See
-       * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
-       * Note: "*" is permitted in the list of origins, and means "any Origin".
-       * 
- * - * repeated string origin = 1; - * - * @param index The index of the value to return. - * @return The bytes of the origin at the given index. - */ - public com.google.protobuf.ByteString getOriginBytes(int index) { - return origin_.getByteString(index); - } - /** - * - * - *
-       * The list of Origins eligible to receive CORS response headers. See
-       * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
-       * Note: "*" is permitted in the list of origins, and means "any Origin".
-       * 
- * - * repeated string origin = 1; - * - * @param index The index to set the value at. - * @param value The origin to set. - * @return This builder for chaining. - */ - public Builder setOrigin(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureOriginIsMutable(); - origin_.set(index, value); - onChanged(); - return this; - } - /** - * - * - *
-       * The list of Origins eligible to receive CORS response headers. See
-       * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
-       * Note: "*" is permitted in the list of origins, and means "any Origin".
-       * 
- * - * repeated string origin = 1; - * - * @param value The origin to add. - * @return This builder for chaining. - */ - public Builder addOrigin(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureOriginIsMutable(); - origin_.add(value); - onChanged(); - return this; - } - /** - * - * - *
-       * The list of Origins eligible to receive CORS response headers. See
-       * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
-       * Note: "*" is permitted in the list of origins, and means "any Origin".
-       * 
- * - * repeated string origin = 1; - * - * @param values The origin to add. - * @return This builder for chaining. - */ - public Builder addAllOrigin(java.lang.Iterable values) { - ensureOriginIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, origin_); - onChanged(); - return this; - } - /** - * - * - *
-       * The list of Origins eligible to receive CORS response headers. See
-       * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
-       * Note: "*" is permitted in the list of origins, and means "any Origin".
-       * 
- * - * repeated string origin = 1; - * - * @return This builder for chaining. - */ - public Builder clearOrigin() { - origin_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-       * The list of Origins eligible to receive CORS response headers. See
-       * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
-       * Note: "*" is permitted in the list of origins, and means "any Origin".
-       * 
- * - * repeated string origin = 1; - * - * @param value The bytes of the origin to add. - * @return This builder for chaining. - */ - public Builder addOriginBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureOriginIsMutable(); - origin_.add(value); - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList method_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensureMethodIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - method_ = new com.google.protobuf.LazyStringArrayList(method_); - bitField0_ |= 0x00000002; - } - } - /** - * - * - *
-       * The list of HTTP methods on which to include CORS response headers,
-       * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
-       * methods, and means "any method".
-       * 
- * - * repeated string method = 2; - * - * @return A list containing the method. - */ - public com.google.protobuf.ProtocolStringList getMethodList() { - return method_.getUnmodifiableView(); - } - /** - * - * - *
-       * The list of HTTP methods on which to include CORS response headers,
-       * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
-       * methods, and means "any method".
-       * 
- * - * repeated string method = 2; - * - * @return The count of method. - */ - public int getMethodCount() { - return method_.size(); - } - /** - * - * - *
-       * The list of HTTP methods on which to include CORS response headers,
-       * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
-       * methods, and means "any method".
-       * 
- * - * repeated string method = 2; - * - * @param index The index of the element to return. - * @return The method at the given index. - */ - public java.lang.String getMethod(int index) { - return method_.get(index); - } - /** - * - * - *
-       * The list of HTTP methods on which to include CORS response headers,
-       * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
-       * methods, and means "any method".
-       * 
- * - * repeated string method = 2; - * - * @param index The index of the value to return. - * @return The bytes of the method at the given index. - */ - public com.google.protobuf.ByteString getMethodBytes(int index) { - return method_.getByteString(index); - } - /** - * - * - *
-       * The list of HTTP methods on which to include CORS response headers,
-       * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
-       * methods, and means "any method".
-       * 
- * - * repeated string method = 2; - * - * @param index The index to set the value at. - * @param value The method to set. - * @return This builder for chaining. - */ - public Builder setMethod(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureMethodIsMutable(); - method_.set(index, value); - onChanged(); - return this; - } - /** - * - * - *
-       * The list of HTTP methods on which to include CORS response headers,
-       * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
-       * methods, and means "any method".
-       * 
- * - * repeated string method = 2; - * - * @param value The method to add. - * @return This builder for chaining. - */ - public Builder addMethod(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureMethodIsMutable(); - method_.add(value); - onChanged(); - return this; - } - /** - * - * - *
-       * The list of HTTP methods on which to include CORS response headers,
-       * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
-       * methods, and means "any method".
-       * 
- * - * repeated string method = 2; - * - * @param values The method to add. - * @return This builder for chaining. - */ - public Builder addAllMethod(java.lang.Iterable values) { - ensureMethodIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, method_); - onChanged(); - return this; - } - /** - * - * - *
-       * The list of HTTP methods on which to include CORS response headers,
-       * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
-       * methods, and means "any method".
-       * 
- * - * repeated string method = 2; - * - * @return This builder for chaining. - */ - public Builder clearMethod() { - method_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * - * - *
-       * The list of HTTP methods on which to include CORS response headers,
-       * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
-       * methods, and means "any method".
-       * 
- * - * repeated string method = 2; - * - * @param value The bytes of the method to add. - * @return This builder for chaining. - */ - public Builder addMethodBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureMethodIsMutable(); - method_.add(value); - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList responseHeader_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensureResponseHeaderIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - responseHeader_ = new com.google.protobuf.LazyStringArrayList(responseHeader_); - bitField0_ |= 0x00000004; - } - } - /** - * - * - *
-       * The list of HTTP headers other than the
-       * [https://www.w3.org/TR/cors/#simple-response-header][simple response
-       * headers] to give permission for the user-agent to share across domains.
-       * 
- * - * repeated string response_header = 3; - * - * @return A list containing the responseHeader. - */ - public com.google.protobuf.ProtocolStringList getResponseHeaderList() { - return responseHeader_.getUnmodifiableView(); - } - /** - * - * - *
-       * The list of HTTP headers other than the
-       * [https://www.w3.org/TR/cors/#simple-response-header][simple response
-       * headers] to give permission for the user-agent to share across domains.
-       * 
- * - * repeated string response_header = 3; - * - * @return The count of responseHeader. - */ - public int getResponseHeaderCount() { - return responseHeader_.size(); - } - /** - * - * - *
-       * The list of HTTP headers other than the
-       * [https://www.w3.org/TR/cors/#simple-response-header][simple response
-       * headers] to give permission for the user-agent to share across domains.
-       * 
- * - * repeated string response_header = 3; - * - * @param index The index of the element to return. - * @return The responseHeader at the given index. - */ - public java.lang.String getResponseHeader(int index) { - return responseHeader_.get(index); - } - /** - * - * - *
-       * The list of HTTP headers other than the
-       * [https://www.w3.org/TR/cors/#simple-response-header][simple response
-       * headers] to give permission for the user-agent to share across domains.
-       * 
- * - * repeated string response_header = 3; - * - * @param index The index of the value to return. - * @return The bytes of the responseHeader at the given index. - */ - public com.google.protobuf.ByteString getResponseHeaderBytes(int index) { - return responseHeader_.getByteString(index); - } - /** - * - * - *
-       * The list of HTTP headers other than the
-       * [https://www.w3.org/TR/cors/#simple-response-header][simple response
-       * headers] to give permission for the user-agent to share across domains.
-       * 
- * - * repeated string response_header = 3; - * - * @param index The index to set the value at. - * @param value The responseHeader to set. - * @return This builder for chaining. - */ - public Builder setResponseHeader(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureResponseHeaderIsMutable(); - responseHeader_.set(index, value); - onChanged(); - return this; - } - /** - * - * - *
-       * The list of HTTP headers other than the
-       * [https://www.w3.org/TR/cors/#simple-response-header][simple response
-       * headers] to give permission for the user-agent to share across domains.
-       * 
- * - * repeated string response_header = 3; - * - * @param value The responseHeader to add. - * @return This builder for chaining. - */ - public Builder addResponseHeader(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureResponseHeaderIsMutable(); - responseHeader_.add(value); - onChanged(); - return this; - } - /** - * - * - *
-       * The list of HTTP headers other than the
-       * [https://www.w3.org/TR/cors/#simple-response-header][simple response
-       * headers] to give permission for the user-agent to share across domains.
-       * 
- * - * repeated string response_header = 3; - * - * @param values The responseHeader to add. - * @return This builder for chaining. - */ - public Builder addAllResponseHeader(java.lang.Iterable values) { - ensureResponseHeaderIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, responseHeader_); - onChanged(); - return this; - } - /** - * - * - *
-       * The list of HTTP headers other than the
-       * [https://www.w3.org/TR/cors/#simple-response-header][simple response
-       * headers] to give permission for the user-agent to share across domains.
-       * 
- * - * repeated string response_header = 3; - * - * @return This builder for chaining. - */ - public Builder clearResponseHeader() { - responseHeader_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - /** - * - * - *
-       * The list of HTTP headers other than the
-       * [https://www.w3.org/TR/cors/#simple-response-header][simple response
-       * headers] to give permission for the user-agent to share across domains.
-       * 
- * - * repeated string response_header = 3; - * - * @param value The bytes of the responseHeader to add. - * @return This builder for chaining. - */ - public Builder addResponseHeaderBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureResponseHeaderIsMutable(); - responseHeader_.add(value); - onChanged(); - return this; - } - - private int maxAgeSeconds_; - /** - * - * - *
-       * The value, in seconds, to return in the
-       * [https://www.w3.org/TR/cors/#access-control-max-age-response-header][Access-Control-Max-Age
-       * header] used in preflight responses.
-       * 
- * - * int32 max_age_seconds = 4; - * - * @return The maxAgeSeconds. - */ - @java.lang.Override - public int getMaxAgeSeconds() { - return maxAgeSeconds_; - } - /** - * - * - *
-       * The value, in seconds, to return in the
-       * [https://www.w3.org/TR/cors/#access-control-max-age-response-header][Access-Control-Max-Age
-       * header] used in preflight responses.
-       * 
- * - * int32 max_age_seconds = 4; - * - * @param value The maxAgeSeconds to set. - * @return This builder for chaining. - */ - public Builder setMaxAgeSeconds(int value) { - - maxAgeSeconds_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * The value, in seconds, to return in the
-       * [https://www.w3.org/TR/cors/#access-control-max-age-response-header][Access-Control-Max-Age
-       * header] used in preflight responses.
-       * 
- * - * int32 max_age_seconds = 4; - * - * @return This builder for chaining. - */ - public Builder clearMaxAgeSeconds() { - - maxAgeSeconds_ = 0; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.Bucket.Cors) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.Cors) - private static final com.google.storage.v2.Bucket.Cors DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.Cors(); - } - - public static com.google.storage.v2.Bucket.Cors getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Cors parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Cors(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Cors getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface EncryptionOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.Encryption) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * The name of the Cloud KMS key that will be used to encrypt objects
-     * inserted into this bucket, if no encryption method is specified.
-     * 
- * - * string default_kms_key = 1 [(.google.api.resource_reference) = { ... } - * - * @return The defaultKmsKey. - */ - java.lang.String getDefaultKmsKey(); - /** - * - * - *
-     * The name of the Cloud KMS key that will be used to encrypt objects
-     * inserted into this bucket, if no encryption method is specified.
-     * 
- * - * string default_kms_key = 1 [(.google.api.resource_reference) = { ... } - * - * @return The bytes for defaultKmsKey. - */ - com.google.protobuf.ByteString getDefaultKmsKeyBytes(); - } - /** - * - * - *
-   * Encryption properties of a bucket.
-   * 
- * - * Protobuf type {@code google.storage.v2.Bucket.Encryption} - */ - public static final class Encryption extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.Encryption) - EncryptionOrBuilder { - private static final long serialVersionUID = 0L; - // Use Encryption.newBuilder() to construct. - private Encryption(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Encryption() { - defaultKmsKey_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Encryption(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Encryption( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - defaultKmsKey_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Encryption_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Encryption_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.Encryption.class, - com.google.storage.v2.Bucket.Encryption.Builder.class); - } - - public static final int DEFAULT_KMS_KEY_FIELD_NUMBER = 1; - private volatile java.lang.Object defaultKmsKey_; - /** - * - * - *
-     * The name of the Cloud KMS key that will be used to encrypt objects
-     * inserted into this bucket, if no encryption method is specified.
-     * 
- * - * string default_kms_key = 1 [(.google.api.resource_reference) = { ... } - * - * @return The defaultKmsKey. - */ - @java.lang.Override - public java.lang.String getDefaultKmsKey() { - java.lang.Object ref = defaultKmsKey_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - defaultKmsKey_ = s; - return s; - } - } - /** - * - * - *
-     * The name of the Cloud KMS key that will be used to encrypt objects
-     * inserted into this bucket, if no encryption method is specified.
-     * 
- * - * string default_kms_key = 1 [(.google.api.resource_reference) = { ... } - * - * @return The bytes for defaultKmsKey. - */ - @java.lang.Override - public com.google.protobuf.ByteString getDefaultKmsKeyBytes() { - java.lang.Object ref = defaultKmsKey_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - defaultKmsKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(defaultKmsKey_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, defaultKmsKey_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(defaultKmsKey_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, defaultKmsKey_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.Bucket.Encryption)) { - return super.equals(obj); - } - com.google.storage.v2.Bucket.Encryption other = (com.google.storage.v2.Bucket.Encryption) obj; - - if (!getDefaultKmsKey().equals(other.getDefaultKmsKey())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + DEFAULT_KMS_KEY_FIELD_NUMBER; - hash = (53 * hash) + getDefaultKmsKey().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.Bucket.Encryption parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Encryption parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Encryption parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Encryption parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Encryption parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Encryption parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Encryption parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Encryption parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Encryption parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Encryption parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Encryption parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Encryption parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.Bucket.Encryption prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * Encryption properties of a bucket.
-     * 
- * - * Protobuf type {@code google.storage.v2.Bucket.Encryption} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.Encryption) - com.google.storage.v2.Bucket.EncryptionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Encryption_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Encryption_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.Encryption.class, - com.google.storage.v2.Bucket.Encryption.Builder.class); - } - - // Construct using com.google.storage.v2.Bucket.Encryption.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - defaultKmsKey_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Encryption_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Encryption getDefaultInstanceForType() { - return com.google.storage.v2.Bucket.Encryption.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Encryption build() { - com.google.storage.v2.Bucket.Encryption result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Encryption buildPartial() { - com.google.storage.v2.Bucket.Encryption result = - new com.google.storage.v2.Bucket.Encryption(this); - result.defaultKmsKey_ = defaultKmsKey_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.Bucket.Encryption) { - return mergeFrom((com.google.storage.v2.Bucket.Encryption) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.Bucket.Encryption other) { - if (other == com.google.storage.v2.Bucket.Encryption.getDefaultInstance()) return this; - if (!other.getDefaultKmsKey().isEmpty()) { - defaultKmsKey_ = other.defaultKmsKey_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.Bucket.Encryption parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.Bucket.Encryption) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object defaultKmsKey_ = ""; - /** - * - * - *
-       * The name of the Cloud KMS key that will be used to encrypt objects
-       * inserted into this bucket, if no encryption method is specified.
-       * 
- * - * string default_kms_key = 1 [(.google.api.resource_reference) = { ... } - * - * @return The defaultKmsKey. - */ - public java.lang.String getDefaultKmsKey() { - java.lang.Object ref = defaultKmsKey_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - defaultKmsKey_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * The name of the Cloud KMS key that will be used to encrypt objects
-       * inserted into this bucket, if no encryption method is specified.
-       * 
- * - * string default_kms_key = 1 [(.google.api.resource_reference) = { ... } - * - * @return The bytes for defaultKmsKey. - */ - public com.google.protobuf.ByteString getDefaultKmsKeyBytes() { - java.lang.Object ref = defaultKmsKey_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - defaultKmsKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * The name of the Cloud KMS key that will be used to encrypt objects
-       * inserted into this bucket, if no encryption method is specified.
-       * 
- * - * string default_kms_key = 1 [(.google.api.resource_reference) = { ... } - * - * @param value The defaultKmsKey to set. - * @return This builder for chaining. - */ - public Builder setDefaultKmsKey(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - defaultKmsKey_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * The name of the Cloud KMS key that will be used to encrypt objects
-       * inserted into this bucket, if no encryption method is specified.
-       * 
- * - * string default_kms_key = 1 [(.google.api.resource_reference) = { ... } - * - * @return This builder for chaining. - */ - public Builder clearDefaultKmsKey() { - - defaultKmsKey_ = getDefaultInstance().getDefaultKmsKey(); - onChanged(); - return this; - } - /** - * - * - *
-       * The name of the Cloud KMS key that will be used to encrypt objects
-       * inserted into this bucket, if no encryption method is specified.
-       * 
- * - * string default_kms_key = 1 [(.google.api.resource_reference) = { ... } - * - * @param value The bytes for defaultKmsKey to set. - * @return This builder for chaining. - */ - public Builder setDefaultKmsKeyBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - defaultKmsKey_ = value; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.Bucket.Encryption) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.Encryption) - private static final com.google.storage.v2.Bucket.Encryption DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.Encryption(); - } - - public static com.google.storage.v2.Bucket.Encryption getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Encryption parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Encryption(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Encryption getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface IamConfigOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.IamConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Bucket restriction options currently enforced on the bucket.
-     * 
- * - * - * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1; - * - * - * @return Whether the uniformBucketLevelAccess field is set. - */ - boolean hasUniformBucketLevelAccess(); - /** - * - * - *
-     * Bucket restriction options currently enforced on the bucket.
-     * 
- * - * - * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1; - * - * - * @return The uniformBucketLevelAccess. - */ - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess getUniformBucketLevelAccess(); - /** - * - * - *
-     * Bucket restriction options currently enforced on the bucket.
-     * 
- * - * - * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1; - * - */ - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccessOrBuilder - getUniformBucketLevelAccessOrBuilder(); - - /** - * - * - *
-     * Whether IAM will enforce public access prevention.
-     * 
- * - * - * .google.storage.v2.Bucket.IamConfig.PublicAccessPrevention public_access_prevention = 2; - * - * - * @return The enum numeric value on the wire for publicAccessPrevention. - */ - int getPublicAccessPreventionValue(); - /** - * - * - *
-     * Whether IAM will enforce public access prevention.
-     * 
- * - * - * .google.storage.v2.Bucket.IamConfig.PublicAccessPrevention public_access_prevention = 2; - * - * - * @return The publicAccessPrevention. - */ - com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention getPublicAccessPrevention(); - } - /** - * - * - *
-   * Bucket restriction options.
-   * 
- * - * Protobuf type {@code google.storage.v2.Bucket.IamConfig} - */ - public static final class IamConfig extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.IamConfig) - IamConfigOrBuilder { - private static final long serialVersionUID = 0L; - // Use IamConfig.newBuilder() to construct. - private IamConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private IamConfig() { - publicAccessPrevention_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new IamConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private IamConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.Builder subBuilder = - null; - if (uniformBucketLevelAccess_ != null) { - subBuilder = uniformBucketLevelAccess_.toBuilder(); - } - uniformBucketLevelAccess_ = - input.readMessage( - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(uniformBucketLevelAccess_); - uniformBucketLevelAccess_ = subBuilder.buildPartial(); - } - - break; - } - case 16: - { - int rawValue = input.readEnum(); - - publicAccessPrevention_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_IamConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_IamConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.IamConfig.class, - com.google.storage.v2.Bucket.IamConfig.Builder.class); - } - - /** - * - * - *
-     * Public Access Prevention config values.
-     * 
- * - * Protobuf enum {@code google.storage.v2.Bucket.IamConfig.PublicAccessPrevention} - */ - public enum PublicAccessPrevention implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-       * No specified PublicAccessPrevention.
-       * 
- * - * PUBLIC_ACCESS_PREVENTION_UNSPECIFIED = 0; - */ - PUBLIC_ACCESS_PREVENTION_UNSPECIFIED(0), - /** - * - * - *
-       * Prevents access from being granted to public members 'allUsers' and
-       * 'allAuthenticatedUsers'. Prevents attempts to grant new access to
-       * public members.
-       * 
- * - * ENFORCED = 1; - */ - ENFORCED(1), - /** - * - * - *
-       * This setting is inherited from Org Policy. Does not prevent access from
-       * being granted to public members 'allUsers' or 'allAuthenticatedUsers'.
-       * 
- * - * INHERITED = 2; - */ - INHERITED(2), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-       * No specified PublicAccessPrevention.
-       * 
- * - * PUBLIC_ACCESS_PREVENTION_UNSPECIFIED = 0; - */ - public static final int PUBLIC_ACCESS_PREVENTION_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-       * Prevents access from being granted to public members 'allUsers' and
-       * 'allAuthenticatedUsers'. Prevents attempts to grant new access to
-       * public members.
-       * 
- * - * ENFORCED = 1; - */ - public static final int ENFORCED_VALUE = 1; - /** - * - * - *
-       * This setting is inherited from Org Policy. Does not prevent access from
-       * being granted to public members 'allUsers' or 'allAuthenticatedUsers'.
-       * 
- * - * INHERITED = 2; - */ - public static final int INHERITED_VALUE = 2; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static PublicAccessPrevention valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static PublicAccessPrevention forNumber(int value) { - switch (value) { - case 0: - return PUBLIC_ACCESS_PREVENTION_UNSPECIFIED; - case 1: - return ENFORCED; - case 2: - return INHERITED; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public PublicAccessPrevention findValueByNumber(int number) { - return PublicAccessPrevention.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.storage.v2.Bucket.IamConfig.getDescriptor().getEnumTypes().get(0); - } - - private static final PublicAccessPrevention[] VALUES = values(); - - public static PublicAccessPrevention valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private PublicAccessPrevention(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.storage.v2.Bucket.IamConfig.PublicAccessPrevention) - } - - public interface UniformBucketLevelAccessOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-       * If set, access checks only use bucket-level IAM policies or above.
-       * 
- * - * bool enabled = 1; - * - * @return The enabled. - */ - boolean getEnabled(); - - /** - * - * - *
-       * The deadline time for changing
-       * `iamConfig.uniformBucketLevelAccess.enabled` from
-       * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
-       * Mutable until the specified deadline is reached, but not afterward.
-       * 
- * - * .google.protobuf.Timestamp lock_time = 2; - * - * @return Whether the lockTime field is set. - */ - boolean hasLockTime(); - /** - * - * - *
-       * The deadline time for changing
-       * `iamConfig.uniformBucketLevelAccess.enabled` from
-       * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
-       * Mutable until the specified deadline is reached, but not afterward.
-       * 
- * - * .google.protobuf.Timestamp lock_time = 2; - * - * @return The lockTime. - */ - com.google.protobuf.Timestamp getLockTime(); - /** - * - * - *
-       * The deadline time for changing
-       * `iamConfig.uniformBucketLevelAccess.enabled` from
-       * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
-       * Mutable until the specified deadline is reached, but not afterward.
-       * 
- * - * .google.protobuf.Timestamp lock_time = 2; - */ - com.google.protobuf.TimestampOrBuilder getLockTimeOrBuilder(); - } - /** - * - * - *
-     * Settings for Uniform Bucket level access.
-     * See https://cloud.google.com/storage/docs/uniform-bucket-level-access.
-     * 
- * - * Protobuf type {@code google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess} - */ - public static final class UniformBucketLevelAccess - extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess) - UniformBucketLevelAccessOrBuilder { - private static final long serialVersionUID = 0L; - // Use UniformBucketLevelAccess.newBuilder() to construct. - private UniformBucketLevelAccess(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private UniformBucketLevelAccess() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new UniformBucketLevelAccess(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private UniformBucketLevelAccess( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - enabled_ = input.readBool(); - break; - } - case 18: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (lockTime_ != null) { - subBuilder = lockTime_.toBuilder(); - } - lockTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(lockTime_); - lockTime_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_IamConfig_UniformBucketLevelAccess_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_IamConfig_UniformBucketLevelAccess_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.class, - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.Builder.class); - } - - public static final int ENABLED_FIELD_NUMBER = 1; - private boolean enabled_; - /** - * - * - *
-       * If set, access checks only use bucket-level IAM policies or above.
-       * 
- * - * bool enabled = 1; - * - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - - public static final int LOCK_TIME_FIELD_NUMBER = 2; - private com.google.protobuf.Timestamp lockTime_; - /** - * - * - *
-       * The deadline time for changing
-       * `iamConfig.uniformBucketLevelAccess.enabled` from
-       * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
-       * Mutable until the specified deadline is reached, but not afterward.
-       * 
- * - * .google.protobuf.Timestamp lock_time = 2; - * - * @return Whether the lockTime field is set. - */ - @java.lang.Override - public boolean hasLockTime() { - return lockTime_ != null; - } - /** - * - * - *
-       * The deadline time for changing
-       * `iamConfig.uniformBucketLevelAccess.enabled` from
-       * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
-       * Mutable until the specified deadline is reached, but not afterward.
-       * 
- * - * .google.protobuf.Timestamp lock_time = 2; - * - * @return The lockTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getLockTime() { - return lockTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : lockTime_; - } - /** - * - * - *
-       * The deadline time for changing
-       * `iamConfig.uniformBucketLevelAccess.enabled` from
-       * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
-       * Mutable until the specified deadline is reached, but not afterward.
-       * 
- * - * .google.protobuf.Timestamp lock_time = 2; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getLockTimeOrBuilder() { - return getLockTime(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (enabled_ != false) { - output.writeBool(1, enabled_); - } - if (lockTime_ != null) { - output.writeMessage(2, getLockTime()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (enabled_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, enabled_); - } - if (lockTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getLockTime()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess)) { - return super.equals(obj); - } - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess other = - (com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess) obj; - - if (getEnabled() != other.getEnabled()) return false; - if (hasLockTime() != other.hasLockTime()) return false; - if (hasLockTime()) { - if (!getLockTime().equals(other.getLockTime())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ENABLED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnabled()); - if (hasLockTime()) { - hash = (37 * hash) + LOCK_TIME_FIELD_NUMBER; - hash = (53 * hash) + getLockTime().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess - parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-       * Settings for Uniform Bucket level access.
-       * See https://cloud.google.com/storage/docs/uniform-bucket-level-access.
-       * 
- * - * Protobuf type {@code google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess) - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccessOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_IamConfig_UniformBucketLevelAccess_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_IamConfig_UniformBucketLevelAccess_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.class, - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.Builder.class); - } - - // Construct using - // com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - enabled_ = false; - - if (lockTimeBuilder_ == null) { - lockTime_ = null; - } else { - lockTime_ = null; - lockTimeBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_IamConfig_UniformBucketLevelAccess_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess - getDefaultInstanceForType() { - return com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess build() { - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess buildPartial() { - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess result = - new com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess(this); - result.enabled_ = enabled_; - if (lockTimeBuilder_ == null) { - result.lockTime_ = lockTime_; - } else { - result.lockTime_ = lockTimeBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess) { - return mergeFrom( - (com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess other) { - if (other - == com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess - .getDefaultInstance()) return this; - if (other.getEnabled() != false) { - setEnabled(other.getEnabled()); - } - if (other.hasLockTime()) { - mergeLockTime(other.getLockTime()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private boolean enabled_; - /** - * - * - *
-         * If set, access checks only use bucket-level IAM policies or above.
-         * 
- * - * bool enabled = 1; - * - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - /** - * - * - *
-         * If set, access checks only use bucket-level IAM policies or above.
-         * 
- * - * bool enabled = 1; - * - * @param value The enabled to set. - * @return This builder for chaining. - */ - public Builder setEnabled(boolean value) { - - enabled_ = value; - onChanged(); - return this; - } - /** - * - * - *
-         * If set, access checks only use bucket-level IAM policies or above.
-         * 
- * - * bool enabled = 1; - * - * @return This builder for chaining. - */ - public Builder clearEnabled() { - - enabled_ = false; - onChanged(); - return this; - } - - private com.google.protobuf.Timestamp lockTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - lockTimeBuilder_; - /** - * - * - *
-         * The deadline time for changing
-         * `iamConfig.uniformBucketLevelAccess.enabled` from
-         * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
-         * Mutable until the specified deadline is reached, but not afterward.
-         * 
- * - * .google.protobuf.Timestamp lock_time = 2; - * - * @return Whether the lockTime field is set. - */ - public boolean hasLockTime() { - return lockTimeBuilder_ != null || lockTime_ != null; - } - /** - * - * - *
-         * The deadline time for changing
-         * `iamConfig.uniformBucketLevelAccess.enabled` from
-         * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
-         * Mutable until the specified deadline is reached, but not afterward.
-         * 
- * - * .google.protobuf.Timestamp lock_time = 2; - * - * @return The lockTime. - */ - public com.google.protobuf.Timestamp getLockTime() { - if (lockTimeBuilder_ == null) { - return lockTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : lockTime_; - } else { - return lockTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-         * The deadline time for changing
-         * `iamConfig.uniformBucketLevelAccess.enabled` from
-         * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
-         * Mutable until the specified deadline is reached, but not afterward.
-         * 
- * - * .google.protobuf.Timestamp lock_time = 2; - */ - public Builder setLockTime(com.google.protobuf.Timestamp value) { - if (lockTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - lockTime_ = value; - onChanged(); - } else { - lockTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-         * The deadline time for changing
-         * `iamConfig.uniformBucketLevelAccess.enabled` from
-         * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
-         * Mutable until the specified deadline is reached, but not afterward.
-         * 
- * - * .google.protobuf.Timestamp lock_time = 2; - */ - public Builder setLockTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (lockTimeBuilder_ == null) { - lockTime_ = builderForValue.build(); - onChanged(); - } else { - lockTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-         * The deadline time for changing
-         * `iamConfig.uniformBucketLevelAccess.enabled` from
-         * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
-         * Mutable until the specified deadline is reached, but not afterward.
-         * 
- * - * .google.protobuf.Timestamp lock_time = 2; - */ - public Builder mergeLockTime(com.google.protobuf.Timestamp value) { - if (lockTimeBuilder_ == null) { - if (lockTime_ != null) { - lockTime_ = - com.google.protobuf.Timestamp.newBuilder(lockTime_) - .mergeFrom(value) - .buildPartial(); - } else { - lockTime_ = value; - } - onChanged(); - } else { - lockTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-         * The deadline time for changing
-         * `iamConfig.uniformBucketLevelAccess.enabled` from
-         * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
-         * Mutable until the specified deadline is reached, but not afterward.
-         * 
- * - * .google.protobuf.Timestamp lock_time = 2; - */ - public Builder clearLockTime() { - if (lockTimeBuilder_ == null) { - lockTime_ = null; - onChanged(); - } else { - lockTime_ = null; - lockTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-         * The deadline time for changing
-         * `iamConfig.uniformBucketLevelAccess.enabled` from
-         * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
-         * Mutable until the specified deadline is reached, but not afterward.
-         * 
- * - * .google.protobuf.Timestamp lock_time = 2; - */ - public com.google.protobuf.Timestamp.Builder getLockTimeBuilder() { - - onChanged(); - return getLockTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-         * The deadline time for changing
-         * `iamConfig.uniformBucketLevelAccess.enabled` from
-         * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
-         * Mutable until the specified deadline is reached, but not afterward.
-         * 
- * - * .google.protobuf.Timestamp lock_time = 2; - */ - public com.google.protobuf.TimestampOrBuilder getLockTimeOrBuilder() { - if (lockTimeBuilder_ != null) { - return lockTimeBuilder_.getMessageOrBuilder(); - } else { - return lockTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : lockTime_; - } - } - /** - * - * - *
-         * The deadline time for changing
-         * `iamConfig.uniformBucketLevelAccess.enabled` from
-         * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
-         * Mutable until the specified deadline is reached, but not afterward.
-         * 
- * - * .google.protobuf.Timestamp lock_time = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getLockTimeFieldBuilder() { - if (lockTimeBuilder_ == null) { - lockTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getLockTime(), getParentForChildren(), isClean()); - lockTime_ = null; - } - return lockTimeBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess) - private static final com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess(); - } - - public static com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public UniformBucketLevelAccess parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new UniformBucketLevelAccess(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public static final int UNIFORM_BUCKET_LEVEL_ACCESS_FIELD_NUMBER = 1; - private com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess - uniformBucketLevelAccess_; - /** - * - * - *
-     * Bucket restriction options currently enforced on the bucket.
-     * 
- * - * - * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1; - * - * - * @return Whether the uniformBucketLevelAccess field is set. - */ - @java.lang.Override - public boolean hasUniformBucketLevelAccess() { - return uniformBucketLevelAccess_ != null; - } - /** - * - * - *
-     * Bucket restriction options currently enforced on the bucket.
-     * 
- * - * - * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1; - * - * - * @return The uniformBucketLevelAccess. - */ - @java.lang.Override - public com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess - getUniformBucketLevelAccess() { - return uniformBucketLevelAccess_ == null - ? com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.getDefaultInstance() - : uniformBucketLevelAccess_; - } - /** - * - * - *
-     * Bucket restriction options currently enforced on the bucket.
-     * 
- * - * - * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1; - * - */ - @java.lang.Override - public com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccessOrBuilder - getUniformBucketLevelAccessOrBuilder() { - return getUniformBucketLevelAccess(); - } - - public static final int PUBLIC_ACCESS_PREVENTION_FIELD_NUMBER = 2; - private int publicAccessPrevention_; - /** - * - * - *
-     * Whether IAM will enforce public access prevention.
-     * 
- * - * - * .google.storage.v2.Bucket.IamConfig.PublicAccessPrevention public_access_prevention = 2; - * - * - * @return The enum numeric value on the wire for publicAccessPrevention. - */ - @java.lang.Override - public int getPublicAccessPreventionValue() { - return publicAccessPrevention_; - } - /** - * - * - *
-     * Whether IAM will enforce public access prevention.
-     * 
- * - * - * .google.storage.v2.Bucket.IamConfig.PublicAccessPrevention public_access_prevention = 2; - * - * - * @return The publicAccessPrevention. - */ - @java.lang.Override - public com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention - getPublicAccessPrevention() { - @SuppressWarnings("deprecation") - com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention result = - com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention.valueOf( - publicAccessPrevention_); - return result == null - ? com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention.UNRECOGNIZED - : result; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (uniformBucketLevelAccess_ != null) { - output.writeMessage(1, getUniformBucketLevelAccess()); - } - if (publicAccessPrevention_ - != com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention - .PUBLIC_ACCESS_PREVENTION_UNSPECIFIED - .getNumber()) { - output.writeEnum(2, publicAccessPrevention_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (uniformBucketLevelAccess_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 1, getUniformBucketLevelAccess()); - } - if (publicAccessPrevention_ - != com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention - .PUBLIC_ACCESS_PREVENTION_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, publicAccessPrevention_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.Bucket.IamConfig)) { - return super.equals(obj); - } - com.google.storage.v2.Bucket.IamConfig other = (com.google.storage.v2.Bucket.IamConfig) obj; - - if (hasUniformBucketLevelAccess() != other.hasUniformBucketLevelAccess()) return false; - if (hasUniformBucketLevelAccess()) { - if (!getUniformBucketLevelAccess().equals(other.getUniformBucketLevelAccess())) - return false; - } - if (publicAccessPrevention_ != other.publicAccessPrevention_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasUniformBucketLevelAccess()) { - hash = (37 * hash) + UNIFORM_BUCKET_LEVEL_ACCESS_FIELD_NUMBER; - hash = (53 * hash) + getUniformBucketLevelAccess().hashCode(); - } - hash = (37 * hash) + PUBLIC_ACCESS_PREVENTION_FIELD_NUMBER; - hash = (53 * hash) + publicAccessPrevention_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.Bucket.IamConfig parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.IamConfig parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.IamConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.IamConfig parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.IamConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.IamConfig parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.IamConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.IamConfig parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.IamConfig parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.IamConfig parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.IamConfig parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.IamConfig parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.Bucket.IamConfig prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * Bucket restriction options.
-     * 
- * - * Protobuf type {@code google.storage.v2.Bucket.IamConfig} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.IamConfig) - com.google.storage.v2.Bucket.IamConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_IamConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_IamConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.IamConfig.class, - com.google.storage.v2.Bucket.IamConfig.Builder.class); - } - - // Construct using com.google.storage.v2.Bucket.IamConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (uniformBucketLevelAccessBuilder_ == null) { - uniformBucketLevelAccess_ = null; - } else { - uniformBucketLevelAccess_ = null; - uniformBucketLevelAccessBuilder_ = null; - } - publicAccessPrevention_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_IamConfig_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.IamConfig getDefaultInstanceForType() { - return com.google.storage.v2.Bucket.IamConfig.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.Bucket.IamConfig build() { - com.google.storage.v2.Bucket.IamConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.IamConfig buildPartial() { - com.google.storage.v2.Bucket.IamConfig result = - new com.google.storage.v2.Bucket.IamConfig(this); - if (uniformBucketLevelAccessBuilder_ == null) { - result.uniformBucketLevelAccess_ = uniformBucketLevelAccess_; - } else { - result.uniformBucketLevelAccess_ = uniformBucketLevelAccessBuilder_.build(); - } - result.publicAccessPrevention_ = publicAccessPrevention_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.Bucket.IamConfig) { - return mergeFrom((com.google.storage.v2.Bucket.IamConfig) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.Bucket.IamConfig other) { - if (other == com.google.storage.v2.Bucket.IamConfig.getDefaultInstance()) return this; - if (other.hasUniformBucketLevelAccess()) { - mergeUniformBucketLevelAccess(other.getUniformBucketLevelAccess()); - } - if (other.publicAccessPrevention_ != 0) { - setPublicAccessPreventionValue(other.getPublicAccessPreventionValue()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.Bucket.IamConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.Bucket.IamConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess - uniformBucketLevelAccess_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess, - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.Builder, - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccessOrBuilder> - uniformBucketLevelAccessBuilder_; - /** - * - * - *
-       * Bucket restriction options currently enforced on the bucket.
-       * 
- * - * - * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1; - * - * - * @return Whether the uniformBucketLevelAccess field is set. - */ - public boolean hasUniformBucketLevelAccess() { - return uniformBucketLevelAccessBuilder_ != null || uniformBucketLevelAccess_ != null; - } - /** - * - * - *
-       * Bucket restriction options currently enforced on the bucket.
-       * 
- * - * - * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1; - * - * - * @return The uniformBucketLevelAccess. - */ - public com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess - getUniformBucketLevelAccess() { - if (uniformBucketLevelAccessBuilder_ == null) { - return uniformBucketLevelAccess_ == null - ? com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.getDefaultInstance() - : uniformBucketLevelAccess_; - } else { - return uniformBucketLevelAccessBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Bucket restriction options currently enforced on the bucket.
-       * 
- * - * - * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1; - * - */ - public Builder setUniformBucketLevelAccess( - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess value) { - if (uniformBucketLevelAccessBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - uniformBucketLevelAccess_ = value; - onChanged(); - } else { - uniformBucketLevelAccessBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-       * Bucket restriction options currently enforced on the bucket.
-       * 
- * - * - * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1; - * - */ - public Builder setUniformBucketLevelAccess( - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.Builder builderForValue) { - if (uniformBucketLevelAccessBuilder_ == null) { - uniformBucketLevelAccess_ = builderForValue.build(); - onChanged(); - } else { - uniformBucketLevelAccessBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-       * Bucket restriction options currently enforced on the bucket.
-       * 
- * - * - * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1; - * - */ - public Builder mergeUniformBucketLevelAccess( - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess value) { - if (uniformBucketLevelAccessBuilder_ == null) { - if (uniformBucketLevelAccess_ != null) { - uniformBucketLevelAccess_ = - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.newBuilder( - uniformBucketLevelAccess_) - .mergeFrom(value) - .buildPartial(); - } else { - uniformBucketLevelAccess_ = value; - } - onChanged(); - } else { - uniformBucketLevelAccessBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-       * Bucket restriction options currently enforced on the bucket.
-       * 
- * - * - * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1; - * - */ - public Builder clearUniformBucketLevelAccess() { - if (uniformBucketLevelAccessBuilder_ == null) { - uniformBucketLevelAccess_ = null; - onChanged(); - } else { - uniformBucketLevelAccess_ = null; - uniformBucketLevelAccessBuilder_ = null; - } - - return this; - } - /** - * - * - *
-       * Bucket restriction options currently enforced on the bucket.
-       * 
- * - * - * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1; - * - */ - public com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.Builder - getUniformBucketLevelAccessBuilder() { - - onChanged(); - return getUniformBucketLevelAccessFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Bucket restriction options currently enforced on the bucket.
-       * 
- * - * - * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1; - * - */ - public com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccessOrBuilder - getUniformBucketLevelAccessOrBuilder() { - if (uniformBucketLevelAccessBuilder_ != null) { - return uniformBucketLevelAccessBuilder_.getMessageOrBuilder(); - } else { - return uniformBucketLevelAccess_ == null - ? com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.getDefaultInstance() - : uniformBucketLevelAccess_; - } - } - /** - * - * - *
-       * Bucket restriction options currently enforced on the bucket.
-       * 
- * - * - * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess, - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.Builder, - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccessOrBuilder> - getUniformBucketLevelAccessFieldBuilder() { - if (uniformBucketLevelAccessBuilder_ == null) { - uniformBucketLevelAccessBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess, - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.Builder, - com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccessOrBuilder>( - getUniformBucketLevelAccess(), getParentForChildren(), isClean()); - uniformBucketLevelAccess_ = null; - } - return uniformBucketLevelAccessBuilder_; - } - - private int publicAccessPrevention_ = 0; - /** - * - * - *
-       * Whether IAM will enforce public access prevention.
-       * 
- * - * - * .google.storage.v2.Bucket.IamConfig.PublicAccessPrevention public_access_prevention = 2; - * - * - * @return The enum numeric value on the wire for publicAccessPrevention. - */ - @java.lang.Override - public int getPublicAccessPreventionValue() { - return publicAccessPrevention_; - } - /** - * - * - *
-       * Whether IAM will enforce public access prevention.
-       * 
- * - * - * .google.storage.v2.Bucket.IamConfig.PublicAccessPrevention public_access_prevention = 2; - * - * - * @param value The enum numeric value on the wire for publicAccessPrevention to set. - * @return This builder for chaining. - */ - public Builder setPublicAccessPreventionValue(int value) { - - publicAccessPrevention_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Whether IAM will enforce public access prevention.
-       * 
- * - * - * .google.storage.v2.Bucket.IamConfig.PublicAccessPrevention public_access_prevention = 2; - * - * - * @return The publicAccessPrevention. - */ - @java.lang.Override - public com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention - getPublicAccessPrevention() { - @SuppressWarnings("deprecation") - com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention result = - com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention.valueOf( - publicAccessPrevention_); - return result == null - ? com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention.UNRECOGNIZED - : result; - } - /** - * - * - *
-       * Whether IAM will enforce public access prevention.
-       * 
- * - * - * .google.storage.v2.Bucket.IamConfig.PublicAccessPrevention public_access_prevention = 2; - * - * - * @param value The publicAccessPrevention to set. - * @return This builder for chaining. - */ - public Builder setPublicAccessPrevention( - com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention value) { - if (value == null) { - throw new NullPointerException(); - } - - publicAccessPrevention_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-       * Whether IAM will enforce public access prevention.
-       * 
- * - * - * .google.storage.v2.Bucket.IamConfig.PublicAccessPrevention public_access_prevention = 2; - * - * - * @return This builder for chaining. - */ - public Builder clearPublicAccessPrevention() { - - publicAccessPrevention_ = 0; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.Bucket.IamConfig) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.IamConfig) - private static final com.google.storage.v2.Bucket.IamConfig DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.IamConfig(); - } - - public static com.google.storage.v2.Bucket.IamConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public IamConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new IamConfig(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.IamConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface LifecycleOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.Lifecycle) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * A lifecycle management rule, which is made of an action to take and the
-     * condition(s) under which the action will be taken.
-     * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - java.util.List getRuleList(); - /** - * - * - *
-     * A lifecycle management rule, which is made of an action to take and the
-     * condition(s) under which the action will be taken.
-     * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - com.google.storage.v2.Bucket.Lifecycle.Rule getRule(int index); - /** - * - * - *
-     * A lifecycle management rule, which is made of an action to take and the
-     * condition(s) under which the action will be taken.
-     * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - int getRuleCount(); - /** - * - * - *
-     * A lifecycle management rule, which is made of an action to take and the
-     * condition(s) under which the action will be taken.
-     * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - java.util.List - getRuleOrBuilderList(); - /** - * - * - *
-     * A lifecycle management rule, which is made of an action to take and the
-     * condition(s) under which the action will be taken.
-     * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - com.google.storage.v2.Bucket.Lifecycle.RuleOrBuilder getRuleOrBuilder(int index); - } - /** - * - * - *
-   * Lifecycle properties of a bucket.
-   * For more information, see https://cloud.google.com/storage/docs/lifecycle.
-   * 
- * - * Protobuf type {@code google.storage.v2.Bucket.Lifecycle} - */ - public static final class Lifecycle extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.Lifecycle) - LifecycleOrBuilder { - private static final long serialVersionUID = 0L; - // Use Lifecycle.newBuilder() to construct. - private Lifecycle(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Lifecycle() { - rule_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Lifecycle(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Lifecycle( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - rule_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - rule_.add( - input.readMessage( - com.google.storage.v2.Bucket.Lifecycle.Rule.parser(), extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - rule_ = java.util.Collections.unmodifiableList(rule_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Lifecycle_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Lifecycle_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.Lifecycle.class, - com.google.storage.v2.Bucket.Lifecycle.Builder.class); - } - - public interface RuleOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.Lifecycle.Rule) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-       * The action to take.
-       * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1; - * - * @return Whether the action field is set. - */ - boolean hasAction(); - /** - * - * - *
-       * The action to take.
-       * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1; - * - * @return The action. - */ - com.google.storage.v2.Bucket.Lifecycle.Rule.Action getAction(); - /** - * - * - *
-       * The action to take.
-       * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1; - */ - com.google.storage.v2.Bucket.Lifecycle.Rule.ActionOrBuilder getActionOrBuilder(); - - /** - * - * - *
-       * The condition(s) under which the action will be taken.
-       * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2; - * - * @return Whether the condition field is set. - */ - boolean hasCondition(); - /** - * - * - *
-       * The condition(s) under which the action will be taken.
-       * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2; - * - * @return The condition. - */ - com.google.storage.v2.Bucket.Lifecycle.Rule.Condition getCondition(); - /** - * - * - *
-       * The condition(s) under which the action will be taken.
-       * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2; - */ - com.google.storage.v2.Bucket.Lifecycle.Rule.ConditionOrBuilder getConditionOrBuilder(); - } - /** - * - * - *
-     * A lifecycle Rule, combining an action to take on an object and a
-     * condition which will trigger that action.
-     * 
- * - * Protobuf type {@code google.storage.v2.Bucket.Lifecycle.Rule} - */ - public static final class Rule extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.Lifecycle.Rule) - RuleOrBuilder { - private static final long serialVersionUID = 0L; - // Use Rule.newBuilder() to construct. - private Rule(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Rule() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Rule(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Rule( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.storage.v2.Bucket.Lifecycle.Rule.Action.Builder subBuilder = null; - if (action_ != null) { - subBuilder = action_.toBuilder(); - } - action_ = - input.readMessage( - com.google.storage.v2.Bucket.Lifecycle.Rule.Action.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(action_); - action_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.Builder subBuilder = null; - if (condition_ != null) { - subBuilder = condition_.toBuilder(); - } - condition_ = - input.readMessage( - com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(condition_); - condition_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.Lifecycle.Rule.class, - com.google.storage.v2.Bucket.Lifecycle.Rule.Builder.class); - } - - public interface ActionOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.Lifecycle.Rule.Action) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-         * Type of the action. Currently, only `Delete`, `SetStorageClass`, and
-         * `AbortIncompleteMultipartUpload` are supported.
-         * 
- * - * string type = 1; - * - * @return The type. - */ - java.lang.String getType(); - /** - * - * - *
-         * Type of the action. Currently, only `Delete`, `SetStorageClass`, and
-         * `AbortIncompleteMultipartUpload` are supported.
-         * 
- * - * string type = 1; - * - * @return The bytes for type. - */ - com.google.protobuf.ByteString getTypeBytes(); - - /** - * - * - *
-         * Target storage class. Required iff the type of the action is
-         * SetStorageClass.
-         * 
- * - * string storage_class = 2; - * - * @return The storageClass. - */ - java.lang.String getStorageClass(); - /** - * - * - *
-         * Target storage class. Required iff the type of the action is
-         * SetStorageClass.
-         * 
- * - * string storage_class = 2; - * - * @return The bytes for storageClass. - */ - com.google.protobuf.ByteString getStorageClassBytes(); - } - /** - * - * - *
-       * An action to take on an object.
-       * 
- * - * Protobuf type {@code google.storage.v2.Bucket.Lifecycle.Rule.Action} - */ - public static final class Action extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.Lifecycle.Rule.Action) - ActionOrBuilder { - private static final long serialVersionUID = 0L; - // Use Action.newBuilder() to construct. - private Action(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Action() { - type_ = ""; - storageClass_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Action(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Action( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - type_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - storageClass_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Action_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Action_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.Lifecycle.Rule.Action.class, - com.google.storage.v2.Bucket.Lifecycle.Rule.Action.Builder.class); - } - - public static final int TYPE_FIELD_NUMBER = 1; - private volatile java.lang.Object type_; - /** - * - * - *
-         * Type of the action. Currently, only `Delete`, `SetStorageClass`, and
-         * `AbortIncompleteMultipartUpload` are supported.
-         * 
- * - * string type = 1; - * - * @return The type. - */ - @java.lang.Override - public java.lang.String getType() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } - } - /** - * - * - *
-         * Type of the action. Currently, only `Delete`, `SetStorageClass`, and
-         * `AbortIncompleteMultipartUpload` are supported.
-         * 
- * - * string type = 1; - * - * @return The bytes for type. - */ - @java.lang.Override - public com.google.protobuf.ByteString getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int STORAGE_CLASS_FIELD_NUMBER = 2; - private volatile java.lang.Object storageClass_; - /** - * - * - *
-         * Target storage class. Required iff the type of the action is
-         * SetStorageClass.
-         * 
- * - * string storage_class = 2; - * - * @return The storageClass. - */ - @java.lang.Override - public java.lang.String getStorageClass() { - java.lang.Object ref = storageClass_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - storageClass_ = s; - return s; - } - } - /** - * - * - *
-         * Target storage class. Required iff the type of the action is
-         * SetStorageClass.
-         * 
- * - * string storage_class = 2; - * - * @return The bytes for storageClass. - */ - @java.lang.Override - public com.google.protobuf.ByteString getStorageClassBytes() { - java.lang.Object ref = storageClass_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - storageClass_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(storageClass_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, storageClass_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(storageClass_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, storageClass_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.Bucket.Lifecycle.Rule.Action)) { - return super.equals(obj); - } - com.google.storage.v2.Bucket.Lifecycle.Rule.Action other = - (com.google.storage.v2.Bucket.Lifecycle.Rule.Action) obj; - - if (!getType().equals(other.getType())) return false; - if (!getStorageClass().equals(other.getStorageClass())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + getType().hashCode(); - hash = (37 * hash) + STORAGE_CLASS_FIELD_NUMBER; - hash = (53 * hash) + getStorageClass().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Action parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Action parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Action parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Action parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Action parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Action parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Action parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Action parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Action parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Action parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Action parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Action parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.storage.v2.Bucket.Lifecycle.Rule.Action prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-         * An action to take on an object.
-         * 
- * - * Protobuf type {@code google.storage.v2.Bucket.Lifecycle.Rule.Action} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.Lifecycle.Rule.Action) - com.google.storage.v2.Bucket.Lifecycle.Rule.ActionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Action_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Action_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.Lifecycle.Rule.Action.class, - com.google.storage.v2.Bucket.Lifecycle.Rule.Action.Builder.class); - } - - // Construct using com.google.storage.v2.Bucket.Lifecycle.Rule.Action.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - type_ = ""; - - storageClass_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Action_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Lifecycle.Rule.Action getDefaultInstanceForType() { - return com.google.storage.v2.Bucket.Lifecycle.Rule.Action.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Lifecycle.Rule.Action build() { - com.google.storage.v2.Bucket.Lifecycle.Rule.Action result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Lifecycle.Rule.Action buildPartial() { - com.google.storage.v2.Bucket.Lifecycle.Rule.Action result = - new com.google.storage.v2.Bucket.Lifecycle.Rule.Action(this); - result.type_ = type_; - result.storageClass_ = storageClass_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.Bucket.Lifecycle.Rule.Action) { - return mergeFrom((com.google.storage.v2.Bucket.Lifecycle.Rule.Action) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.Bucket.Lifecycle.Rule.Action other) { - if (other == com.google.storage.v2.Bucket.Lifecycle.Rule.Action.getDefaultInstance()) - return this; - if (!other.getType().isEmpty()) { - type_ = other.type_; - onChanged(); - } - if (!other.getStorageClass().isEmpty()) { - storageClass_ = other.storageClass_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.Bucket.Lifecycle.Rule.Action parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.storage.v2.Bucket.Lifecycle.Rule.Action) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object type_ = ""; - /** - * - * - *
-           * Type of the action. Currently, only `Delete`, `SetStorageClass`, and
-           * `AbortIncompleteMultipartUpload` are supported.
-           * 
- * - * string type = 1; - * - * @return The type. - */ - public java.lang.String getType() { - java.lang.Object ref = type_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-           * Type of the action. Currently, only `Delete`, `SetStorageClass`, and
-           * `AbortIncompleteMultipartUpload` are supported.
-           * 
- * - * string type = 1; - * - * @return The bytes for type. - */ - public com.google.protobuf.ByteString getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-           * Type of the action. Currently, only `Delete`, `SetStorageClass`, and
-           * `AbortIncompleteMultipartUpload` are supported.
-           * 
- * - * string type = 1; - * - * @param value The type to set. - * @return This builder for chaining. - */ - public Builder setType(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - type_ = value; - onChanged(); - return this; - } - /** - * - * - *
-           * Type of the action. Currently, only `Delete`, `SetStorageClass`, and
-           * `AbortIncompleteMultipartUpload` are supported.
-           * 
- * - * string type = 1; - * - * @return This builder for chaining. - */ - public Builder clearType() { - - type_ = getDefaultInstance().getType(); - onChanged(); - return this; - } - /** - * - * - *
-           * Type of the action. Currently, only `Delete`, `SetStorageClass`, and
-           * `AbortIncompleteMultipartUpload` are supported.
-           * 
- * - * string type = 1; - * - * @param value The bytes for type to set. - * @return This builder for chaining. - */ - public Builder setTypeBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - type_ = value; - onChanged(); - return this; - } - - private java.lang.Object storageClass_ = ""; - /** - * - * - *
-           * Target storage class. Required iff the type of the action is
-           * SetStorageClass.
-           * 
- * - * string storage_class = 2; - * - * @return The storageClass. - */ - public java.lang.String getStorageClass() { - java.lang.Object ref = storageClass_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - storageClass_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-           * Target storage class. Required iff the type of the action is
-           * SetStorageClass.
-           * 
- * - * string storage_class = 2; - * - * @return The bytes for storageClass. - */ - public com.google.protobuf.ByteString getStorageClassBytes() { - java.lang.Object ref = storageClass_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - storageClass_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-           * Target storage class. Required iff the type of the action is
-           * SetStorageClass.
-           * 
- * - * string storage_class = 2; - * - * @param value The storageClass to set. - * @return This builder for chaining. - */ - public Builder setStorageClass(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - storageClass_ = value; - onChanged(); - return this; - } - /** - * - * - *
-           * Target storage class. Required iff the type of the action is
-           * SetStorageClass.
-           * 
- * - * string storage_class = 2; - * - * @return This builder for chaining. - */ - public Builder clearStorageClass() { - - storageClass_ = getDefaultInstance().getStorageClass(); - onChanged(); - return this; - } - /** - * - * - *
-           * Target storage class. Required iff the type of the action is
-           * SetStorageClass.
-           * 
- * - * string storage_class = 2; - * - * @param value The bytes for storageClass to set. - * @return This builder for chaining. - */ - public Builder setStorageClassBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - storageClass_ = value; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.Bucket.Lifecycle.Rule.Action) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.Lifecycle.Rule.Action) - private static final com.google.storage.v2.Bucket.Lifecycle.Rule.Action DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.Lifecycle.Rule.Action(); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Action getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Action parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Action(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Lifecycle.Rule.Action getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface ConditionOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.Lifecycle.Rule.Condition) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-         * Age of an object (in days). This condition is satisfied when an
-         * object reaches the specified age.
-         * A value of 0 indicates that all objects immediately match this
-         * condition.
-         * 
- * - * optional int32 age_days = 1; - * - * @return Whether the ageDays field is set. - */ - boolean hasAgeDays(); - /** - * - * - *
-         * Age of an object (in days). This condition is satisfied when an
-         * object reaches the specified age.
-         * A value of 0 indicates that all objects immediately match this
-         * condition.
-         * 
- * - * optional int32 age_days = 1; - * - * @return The ageDays. - */ - int getAgeDays(); - - /** - * - * - *
-         * This condition is satisfied when an object is created before midnight
-         * of the specified date in UTC.
-         * 
- * - * .google.type.Date created_before = 2; - * - * @return Whether the createdBefore field is set. - */ - boolean hasCreatedBefore(); - /** - * - * - *
-         * This condition is satisfied when an object is created before midnight
-         * of the specified date in UTC.
-         * 
- * - * .google.type.Date created_before = 2; - * - * @return The createdBefore. - */ - com.google.type.Date getCreatedBefore(); - /** - * - * - *
-         * This condition is satisfied when an object is created before midnight
-         * of the specified date in UTC.
-         * 
- * - * .google.type.Date created_before = 2; - */ - com.google.type.DateOrBuilder getCreatedBeforeOrBuilder(); - - /** - * - * - *
-         * Relevant only for versioned objects. If the value is
-         * `true`, this condition matches live objects; if the value
-         * is `false`, it matches archived objects.
-         * 
- * - * optional bool is_live = 3; - * - * @return Whether the isLive field is set. - */ - boolean hasIsLive(); - /** - * - * - *
-         * Relevant only for versioned objects. If the value is
-         * `true`, this condition matches live objects; if the value
-         * is `false`, it matches archived objects.
-         * 
- * - * optional bool is_live = 3; - * - * @return The isLive. - */ - boolean getIsLive(); - - /** - * - * - *
-         * Relevant only for versioned objects. If the value is N, this
-         * condition is satisfied when there are at least N versions (including
-         * the live version) newer than this version of the object.
-         * 
- * - * optional int32 num_newer_versions = 4; - * - * @return Whether the numNewerVersions field is set. - */ - boolean hasNumNewerVersions(); - /** - * - * - *
-         * Relevant only for versioned objects. If the value is N, this
-         * condition is satisfied when there are at least N versions (including
-         * the live version) newer than this version of the object.
-         * 
- * - * optional int32 num_newer_versions = 4; - * - * @return The numNewerVersions. - */ - int getNumNewerVersions(); - - /** - * - * - *
-         * Objects having any of the storage classes specified by this condition
-         * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
-         * `NEARLINE`, `COLDLINE`, `STANDARD`, and
-         * `DURABLE_REDUCED_AVAILABILITY`.
-         * 
- * - * repeated string matches_storage_class = 5; - * - * @return A list containing the matchesStorageClass. - */ - java.util.List getMatchesStorageClassList(); - /** - * - * - *
-         * Objects having any of the storage classes specified by this condition
-         * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
-         * `NEARLINE`, `COLDLINE`, `STANDARD`, and
-         * `DURABLE_REDUCED_AVAILABILITY`.
-         * 
- * - * repeated string matches_storage_class = 5; - * - * @return The count of matchesStorageClass. - */ - int getMatchesStorageClassCount(); - /** - * - * - *
-         * Objects having any of the storage classes specified by this condition
-         * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
-         * `NEARLINE`, `COLDLINE`, `STANDARD`, and
-         * `DURABLE_REDUCED_AVAILABILITY`.
-         * 
- * - * repeated string matches_storage_class = 5; - * - * @param index The index of the element to return. - * @return The matchesStorageClass at the given index. - */ - java.lang.String getMatchesStorageClass(int index); - /** - * - * - *
-         * Objects having any of the storage classes specified by this condition
-         * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
-         * `NEARLINE`, `COLDLINE`, `STANDARD`, and
-         * `DURABLE_REDUCED_AVAILABILITY`.
-         * 
- * - * repeated string matches_storage_class = 5; - * - * @param index The index of the value to return. - * @return The bytes of the matchesStorageClass at the given index. - */ - com.google.protobuf.ByteString getMatchesStorageClassBytes(int index); - - /** - * - * - *
-         * Number of days that have elapsed since the custom timestamp set on an
-         * object.
-         * The value of the field must be a nonnegative integer.
-         * 
- * - * optional int32 days_since_custom_time = 7; - * - * @return Whether the daysSinceCustomTime field is set. - */ - boolean hasDaysSinceCustomTime(); - /** - * - * - *
-         * Number of days that have elapsed since the custom timestamp set on an
-         * object.
-         * The value of the field must be a nonnegative integer.
-         * 
- * - * optional int32 days_since_custom_time = 7; - * - * @return The daysSinceCustomTime. - */ - int getDaysSinceCustomTime(); - - /** - * - * - *
-         * An object matches this condition if the custom timestamp set on the
-         * object is before the specified date in UTC.
-         * 
- * - * .google.type.Date custom_time_before = 8; - * - * @return Whether the customTimeBefore field is set. - */ - boolean hasCustomTimeBefore(); - /** - * - * - *
-         * An object matches this condition if the custom timestamp set on the
-         * object is before the specified date in UTC.
-         * 
- * - * .google.type.Date custom_time_before = 8; - * - * @return The customTimeBefore. - */ - com.google.type.Date getCustomTimeBefore(); - /** - * - * - *
-         * An object matches this condition if the custom timestamp set on the
-         * object is before the specified date in UTC.
-         * 
- * - * .google.type.Date custom_time_before = 8; - */ - com.google.type.DateOrBuilder getCustomTimeBeforeOrBuilder(); - - /** - * - * - *
-         * This condition is relevant only for versioned objects. An object
-         * version satisfies this condition only if these many days have been
-         * passed since it became noncurrent. The value of the field must be a
-         * nonnegative integer. If it's zero, the object version will become
-         * eligible for Lifecycle action as soon as it becomes noncurrent.
-         * 
- * - * optional int32 days_since_noncurrent_time = 9; - * - * @return Whether the daysSinceNoncurrentTime field is set. - */ - boolean hasDaysSinceNoncurrentTime(); - /** - * - * - *
-         * This condition is relevant only for versioned objects. An object
-         * version satisfies this condition only if these many days have been
-         * passed since it became noncurrent. The value of the field must be a
-         * nonnegative integer. If it's zero, the object version will become
-         * eligible for Lifecycle action as soon as it becomes noncurrent.
-         * 
- * - * optional int32 days_since_noncurrent_time = 9; - * - * @return The daysSinceNoncurrentTime. - */ - int getDaysSinceNoncurrentTime(); - - /** - * - * - *
-         * This condition is relevant only for versioned objects. An object
-         * version satisfies this condition only if it became noncurrent before
-         * the specified date in UTC.
-         * 
- * - * .google.type.Date noncurrent_time_before = 10; - * - * @return Whether the noncurrentTimeBefore field is set. - */ - boolean hasNoncurrentTimeBefore(); - /** - * - * - *
-         * This condition is relevant only for versioned objects. An object
-         * version satisfies this condition only if it became noncurrent before
-         * the specified date in UTC.
-         * 
- * - * .google.type.Date noncurrent_time_before = 10; - * - * @return The noncurrentTimeBefore. - */ - com.google.type.Date getNoncurrentTimeBefore(); - /** - * - * - *
-         * This condition is relevant only for versioned objects. An object
-         * version satisfies this condition only if it became noncurrent before
-         * the specified date in UTC.
-         * 
- * - * .google.type.Date noncurrent_time_before = 10; - */ - com.google.type.DateOrBuilder getNoncurrentTimeBeforeOrBuilder(); - } - /** - * - * - *
-       * A condition of an object which triggers some action.
-       * 
- * - * Protobuf type {@code google.storage.v2.Bucket.Lifecycle.Rule.Condition} - */ - public static final class Condition extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.Lifecycle.Rule.Condition) - ConditionOrBuilder { - private static final long serialVersionUID = 0L; - // Use Condition.newBuilder() to construct. - private Condition(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Condition() { - matchesStorageClass_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Condition(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Condition( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - bitField0_ |= 0x00000001; - ageDays_ = input.readInt32(); - break; - } - case 18: - { - com.google.type.Date.Builder subBuilder = null; - if (createdBefore_ != null) { - subBuilder = createdBefore_.toBuilder(); - } - createdBefore_ = - input.readMessage(com.google.type.Date.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(createdBefore_); - createdBefore_ = subBuilder.buildPartial(); - } - - break; - } - case 24: - { - bitField0_ |= 0x00000002; - isLive_ = input.readBool(); - break; - } - case 32: - { - bitField0_ |= 0x00000004; - numNewerVersions_ = input.readInt32(); - break; - } - case 42: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - matchesStorageClass_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000008; - } - matchesStorageClass_.add(s); - break; - } - case 56: - { - bitField0_ |= 0x00000008; - daysSinceCustomTime_ = input.readInt32(); - break; - } - case 66: - { - com.google.type.Date.Builder subBuilder = null; - if (customTimeBefore_ != null) { - subBuilder = customTimeBefore_.toBuilder(); - } - customTimeBefore_ = - input.readMessage(com.google.type.Date.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(customTimeBefore_); - customTimeBefore_ = subBuilder.buildPartial(); - } - - break; - } - case 72: - { - bitField0_ |= 0x00000010; - daysSinceNoncurrentTime_ = input.readInt32(); - break; - } - case 82: - { - com.google.type.Date.Builder subBuilder = null; - if (noncurrentTimeBefore_ != null) { - subBuilder = noncurrentTimeBefore_.toBuilder(); - } - noncurrentTimeBefore_ = - input.readMessage(com.google.type.Date.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(noncurrentTimeBefore_); - noncurrentTimeBefore_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000008) != 0)) { - matchesStorageClass_ = matchesStorageClass_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Condition_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Condition_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.class, - com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.Builder.class); - } - - private int bitField0_; - public static final int AGE_DAYS_FIELD_NUMBER = 1; - private int ageDays_; - /** - * - * - *
-         * Age of an object (in days). This condition is satisfied when an
-         * object reaches the specified age.
-         * A value of 0 indicates that all objects immediately match this
-         * condition.
-         * 
- * - * optional int32 age_days = 1; - * - * @return Whether the ageDays field is set. - */ - @java.lang.Override - public boolean hasAgeDays() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-         * Age of an object (in days). This condition is satisfied when an
-         * object reaches the specified age.
-         * A value of 0 indicates that all objects immediately match this
-         * condition.
-         * 
- * - * optional int32 age_days = 1; - * - * @return The ageDays. - */ - @java.lang.Override - public int getAgeDays() { - return ageDays_; - } - - public static final int CREATED_BEFORE_FIELD_NUMBER = 2; - private com.google.type.Date createdBefore_; - /** - * - * - *
-         * This condition is satisfied when an object is created before midnight
-         * of the specified date in UTC.
-         * 
- * - * .google.type.Date created_before = 2; - * - * @return Whether the createdBefore field is set. - */ - @java.lang.Override - public boolean hasCreatedBefore() { - return createdBefore_ != null; - } - /** - * - * - *
-         * This condition is satisfied when an object is created before midnight
-         * of the specified date in UTC.
-         * 
- * - * .google.type.Date created_before = 2; - * - * @return The createdBefore. - */ - @java.lang.Override - public com.google.type.Date getCreatedBefore() { - return createdBefore_ == null - ? com.google.type.Date.getDefaultInstance() - : createdBefore_; - } - /** - * - * - *
-         * This condition is satisfied when an object is created before midnight
-         * of the specified date in UTC.
-         * 
- * - * .google.type.Date created_before = 2; - */ - @java.lang.Override - public com.google.type.DateOrBuilder getCreatedBeforeOrBuilder() { - return getCreatedBefore(); - } - - public static final int IS_LIVE_FIELD_NUMBER = 3; - private boolean isLive_; - /** - * - * - *
-         * Relevant only for versioned objects. If the value is
-         * `true`, this condition matches live objects; if the value
-         * is `false`, it matches archived objects.
-         * 
- * - * optional bool is_live = 3; - * - * @return Whether the isLive field is set. - */ - @java.lang.Override - public boolean hasIsLive() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-         * Relevant only for versioned objects. If the value is
-         * `true`, this condition matches live objects; if the value
-         * is `false`, it matches archived objects.
-         * 
- * - * optional bool is_live = 3; - * - * @return The isLive. - */ - @java.lang.Override - public boolean getIsLive() { - return isLive_; - } - - public static final int NUM_NEWER_VERSIONS_FIELD_NUMBER = 4; - private int numNewerVersions_; - /** - * - * - *
-         * Relevant only for versioned objects. If the value is N, this
-         * condition is satisfied when there are at least N versions (including
-         * the live version) newer than this version of the object.
-         * 
- * - * optional int32 num_newer_versions = 4; - * - * @return Whether the numNewerVersions field is set. - */ - @java.lang.Override - public boolean hasNumNewerVersions() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * - * - *
-         * Relevant only for versioned objects. If the value is N, this
-         * condition is satisfied when there are at least N versions (including
-         * the live version) newer than this version of the object.
-         * 
- * - * optional int32 num_newer_versions = 4; - * - * @return The numNewerVersions. - */ - @java.lang.Override - public int getNumNewerVersions() { - return numNewerVersions_; - } - - public static final int MATCHES_STORAGE_CLASS_FIELD_NUMBER = 5; - private com.google.protobuf.LazyStringList matchesStorageClass_; - /** - * - * - *
-         * Objects having any of the storage classes specified by this condition
-         * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
-         * `NEARLINE`, `COLDLINE`, `STANDARD`, and
-         * `DURABLE_REDUCED_AVAILABILITY`.
-         * 
- * - * repeated string matches_storage_class = 5; - * - * @return A list containing the matchesStorageClass. - */ - public com.google.protobuf.ProtocolStringList getMatchesStorageClassList() { - return matchesStorageClass_; - } - /** - * - * - *
-         * Objects having any of the storage classes specified by this condition
-         * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
-         * `NEARLINE`, `COLDLINE`, `STANDARD`, and
-         * `DURABLE_REDUCED_AVAILABILITY`.
-         * 
- * - * repeated string matches_storage_class = 5; - * - * @return The count of matchesStorageClass. - */ - public int getMatchesStorageClassCount() { - return matchesStorageClass_.size(); - } - /** - * - * - *
-         * Objects having any of the storage classes specified by this condition
-         * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
-         * `NEARLINE`, `COLDLINE`, `STANDARD`, and
-         * `DURABLE_REDUCED_AVAILABILITY`.
-         * 
- * - * repeated string matches_storage_class = 5; - * - * @param index The index of the element to return. - * @return The matchesStorageClass at the given index. - */ - public java.lang.String getMatchesStorageClass(int index) { - return matchesStorageClass_.get(index); - } - /** - * - * - *
-         * Objects having any of the storage classes specified by this condition
-         * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
-         * `NEARLINE`, `COLDLINE`, `STANDARD`, and
-         * `DURABLE_REDUCED_AVAILABILITY`.
-         * 
- * - * repeated string matches_storage_class = 5; - * - * @param index The index of the value to return. - * @return The bytes of the matchesStorageClass at the given index. - */ - public com.google.protobuf.ByteString getMatchesStorageClassBytes(int index) { - return matchesStorageClass_.getByteString(index); - } - - public static final int DAYS_SINCE_CUSTOM_TIME_FIELD_NUMBER = 7; - private int daysSinceCustomTime_; - /** - * - * - *
-         * Number of days that have elapsed since the custom timestamp set on an
-         * object.
-         * The value of the field must be a nonnegative integer.
-         * 
- * - * optional int32 days_since_custom_time = 7; - * - * @return Whether the daysSinceCustomTime field is set. - */ - @java.lang.Override - public boolean hasDaysSinceCustomTime() { - return ((bitField0_ & 0x00000008) != 0); - } - /** - * - * - *
-         * Number of days that have elapsed since the custom timestamp set on an
-         * object.
-         * The value of the field must be a nonnegative integer.
-         * 
- * - * optional int32 days_since_custom_time = 7; - * - * @return The daysSinceCustomTime. - */ - @java.lang.Override - public int getDaysSinceCustomTime() { - return daysSinceCustomTime_; - } - - public static final int CUSTOM_TIME_BEFORE_FIELD_NUMBER = 8; - private com.google.type.Date customTimeBefore_; - /** - * - * - *
-         * An object matches this condition if the custom timestamp set on the
-         * object is before the specified date in UTC.
-         * 
- * - * .google.type.Date custom_time_before = 8; - * - * @return Whether the customTimeBefore field is set. - */ - @java.lang.Override - public boolean hasCustomTimeBefore() { - return customTimeBefore_ != null; - } - /** - * - * - *
-         * An object matches this condition if the custom timestamp set on the
-         * object is before the specified date in UTC.
-         * 
- * - * .google.type.Date custom_time_before = 8; - * - * @return The customTimeBefore. - */ - @java.lang.Override - public com.google.type.Date getCustomTimeBefore() { - return customTimeBefore_ == null - ? com.google.type.Date.getDefaultInstance() - : customTimeBefore_; - } - /** - * - * - *
-         * An object matches this condition if the custom timestamp set on the
-         * object is before the specified date in UTC.
-         * 
- * - * .google.type.Date custom_time_before = 8; - */ - @java.lang.Override - public com.google.type.DateOrBuilder getCustomTimeBeforeOrBuilder() { - return getCustomTimeBefore(); - } - - public static final int DAYS_SINCE_NONCURRENT_TIME_FIELD_NUMBER = 9; - private int daysSinceNoncurrentTime_; - /** - * - * - *
-         * This condition is relevant only for versioned objects. An object
-         * version satisfies this condition only if these many days have been
-         * passed since it became noncurrent. The value of the field must be a
-         * nonnegative integer. If it's zero, the object version will become
-         * eligible for Lifecycle action as soon as it becomes noncurrent.
-         * 
- * - * optional int32 days_since_noncurrent_time = 9; - * - * @return Whether the daysSinceNoncurrentTime field is set. - */ - @java.lang.Override - public boolean hasDaysSinceNoncurrentTime() { - return ((bitField0_ & 0x00000010) != 0); - } - /** - * - * - *
-         * This condition is relevant only for versioned objects. An object
-         * version satisfies this condition only if these many days have been
-         * passed since it became noncurrent. The value of the field must be a
-         * nonnegative integer. If it's zero, the object version will become
-         * eligible for Lifecycle action as soon as it becomes noncurrent.
-         * 
- * - * optional int32 days_since_noncurrent_time = 9; - * - * @return The daysSinceNoncurrentTime. - */ - @java.lang.Override - public int getDaysSinceNoncurrentTime() { - return daysSinceNoncurrentTime_; - } - - public static final int NONCURRENT_TIME_BEFORE_FIELD_NUMBER = 10; - private com.google.type.Date noncurrentTimeBefore_; - /** - * - * - *
-         * This condition is relevant only for versioned objects. An object
-         * version satisfies this condition only if it became noncurrent before
-         * the specified date in UTC.
-         * 
- * - * .google.type.Date noncurrent_time_before = 10; - * - * @return Whether the noncurrentTimeBefore field is set. - */ - @java.lang.Override - public boolean hasNoncurrentTimeBefore() { - return noncurrentTimeBefore_ != null; - } - /** - * - * - *
-         * This condition is relevant only for versioned objects. An object
-         * version satisfies this condition only if it became noncurrent before
-         * the specified date in UTC.
-         * 
- * - * .google.type.Date noncurrent_time_before = 10; - * - * @return The noncurrentTimeBefore. - */ - @java.lang.Override - public com.google.type.Date getNoncurrentTimeBefore() { - return noncurrentTimeBefore_ == null - ? com.google.type.Date.getDefaultInstance() - : noncurrentTimeBefore_; - } - /** - * - * - *
-         * This condition is relevant only for versioned objects. An object
-         * version satisfies this condition only if it became noncurrent before
-         * the specified date in UTC.
-         * 
- * - * .google.type.Date noncurrent_time_before = 10; - */ - @java.lang.Override - public com.google.type.DateOrBuilder getNoncurrentTimeBeforeOrBuilder() { - return getNoncurrentTimeBefore(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (((bitField0_ & 0x00000001) != 0)) { - output.writeInt32(1, ageDays_); - } - if (createdBefore_ != null) { - output.writeMessage(2, getCreatedBefore()); - } - if (((bitField0_ & 0x00000002) != 0)) { - output.writeBool(3, isLive_); - } - if (((bitField0_ & 0x00000004) != 0)) { - output.writeInt32(4, numNewerVersions_); - } - for (int i = 0; i < matchesStorageClass_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString( - output, 5, matchesStorageClass_.getRaw(i)); - } - if (((bitField0_ & 0x00000008) != 0)) { - output.writeInt32(7, daysSinceCustomTime_); - } - if (customTimeBefore_ != null) { - output.writeMessage(8, getCustomTimeBefore()); - } - if (((bitField0_ & 0x00000010) != 0)) { - output.writeInt32(9, daysSinceNoncurrentTime_); - } - if (noncurrentTimeBefore_ != null) { - output.writeMessage(10, getNoncurrentTimeBefore()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, ageDays_); - } - if (createdBefore_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreatedBefore()); - } - if (((bitField0_ & 0x00000002) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, isLive_); - } - if (((bitField0_ & 0x00000004) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, numNewerVersions_); - } - { - int dataSize = 0; - for (int i = 0; i < matchesStorageClass_.size(); i++) { - dataSize += computeStringSizeNoTag(matchesStorageClass_.getRaw(i)); - } - size += dataSize; - size += 1 * getMatchesStorageClassList().size(); - } - if (((bitField0_ & 0x00000008) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, daysSinceCustomTime_); - } - if (customTimeBefore_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize(8, getCustomTimeBefore()); - } - if (((bitField0_ & 0x00000010) != 0)) { - size += - com.google.protobuf.CodedOutputStream.computeInt32Size(9, daysSinceNoncurrentTime_); - } - if (noncurrentTimeBefore_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 10, getNoncurrentTimeBefore()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.Bucket.Lifecycle.Rule.Condition)) { - return super.equals(obj); - } - com.google.storage.v2.Bucket.Lifecycle.Rule.Condition other = - (com.google.storage.v2.Bucket.Lifecycle.Rule.Condition) obj; - - if (hasAgeDays() != other.hasAgeDays()) return false; - if (hasAgeDays()) { - if (getAgeDays() != other.getAgeDays()) return false; - } - if (hasCreatedBefore() != other.hasCreatedBefore()) return false; - if (hasCreatedBefore()) { - if (!getCreatedBefore().equals(other.getCreatedBefore())) return false; - } - if (hasIsLive() != other.hasIsLive()) return false; - if (hasIsLive()) { - if (getIsLive() != other.getIsLive()) return false; - } - if (hasNumNewerVersions() != other.hasNumNewerVersions()) return false; - if (hasNumNewerVersions()) { - if (getNumNewerVersions() != other.getNumNewerVersions()) return false; - } - if (!getMatchesStorageClassList().equals(other.getMatchesStorageClassList())) - return false; - if (hasDaysSinceCustomTime() != other.hasDaysSinceCustomTime()) return false; - if (hasDaysSinceCustomTime()) { - if (getDaysSinceCustomTime() != other.getDaysSinceCustomTime()) return false; - } - if (hasCustomTimeBefore() != other.hasCustomTimeBefore()) return false; - if (hasCustomTimeBefore()) { - if (!getCustomTimeBefore().equals(other.getCustomTimeBefore())) return false; - } - if (hasDaysSinceNoncurrentTime() != other.hasDaysSinceNoncurrentTime()) return false; - if (hasDaysSinceNoncurrentTime()) { - if (getDaysSinceNoncurrentTime() != other.getDaysSinceNoncurrentTime()) return false; - } - if (hasNoncurrentTimeBefore() != other.hasNoncurrentTimeBefore()) return false; - if (hasNoncurrentTimeBefore()) { - if (!getNoncurrentTimeBefore().equals(other.getNoncurrentTimeBefore())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasAgeDays()) { - hash = (37 * hash) + AGE_DAYS_FIELD_NUMBER; - hash = (53 * hash) + getAgeDays(); - } - if (hasCreatedBefore()) { - hash = (37 * hash) + CREATED_BEFORE_FIELD_NUMBER; - hash = (53 * hash) + getCreatedBefore().hashCode(); - } - if (hasIsLive()) { - hash = (37 * hash) + IS_LIVE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsLive()); - } - if (hasNumNewerVersions()) { - hash = (37 * hash) + NUM_NEWER_VERSIONS_FIELD_NUMBER; - hash = (53 * hash) + getNumNewerVersions(); - } - if (getMatchesStorageClassCount() > 0) { - hash = (37 * hash) + MATCHES_STORAGE_CLASS_FIELD_NUMBER; - hash = (53 * hash) + getMatchesStorageClassList().hashCode(); - } - if (hasDaysSinceCustomTime()) { - hash = (37 * hash) + DAYS_SINCE_CUSTOM_TIME_FIELD_NUMBER; - hash = (53 * hash) + getDaysSinceCustomTime(); - } - if (hasCustomTimeBefore()) { - hash = (37 * hash) + CUSTOM_TIME_BEFORE_FIELD_NUMBER; - hash = (53 * hash) + getCustomTimeBefore().hashCode(); - } - if (hasDaysSinceNoncurrentTime()) { - hash = (37 * hash) + DAYS_SINCE_NONCURRENT_TIME_FIELD_NUMBER; - hash = (53 * hash) + getDaysSinceNoncurrentTime(); - } - if (hasNoncurrentTimeBefore()) { - hash = (37 * hash) + NONCURRENT_TIME_BEFORE_FIELD_NUMBER; - hash = (53 * hash) + getNoncurrentTimeBefore().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Condition parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Condition parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Condition parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Condition parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Condition parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Condition parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Condition parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Condition parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Condition parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Condition parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Condition parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Condition parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.storage.v2.Bucket.Lifecycle.Rule.Condition prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-         * A condition of an object which triggers some action.
-         * 
- * - * Protobuf type {@code google.storage.v2.Bucket.Lifecycle.Rule.Condition} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.Lifecycle.Rule.Condition) - com.google.storage.v2.Bucket.Lifecycle.Rule.ConditionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Condition_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Condition_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.class, - com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.Builder.class); - } - - // Construct using com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - ageDays_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); - if (createdBeforeBuilder_ == null) { - createdBefore_ = null; - } else { - createdBefore_ = null; - createdBeforeBuilder_ = null; - } - isLive_ = false; - bitField0_ = (bitField0_ & ~0x00000002); - numNewerVersions_ = 0; - bitField0_ = (bitField0_ & ~0x00000004); - matchesStorageClass_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000008); - daysSinceCustomTime_ = 0; - bitField0_ = (bitField0_ & ~0x00000010); - if (customTimeBeforeBuilder_ == null) { - customTimeBefore_ = null; - } else { - customTimeBefore_ = null; - customTimeBeforeBuilder_ = null; - } - daysSinceNoncurrentTime_ = 0; - bitField0_ = (bitField0_ & ~0x00000020); - if (noncurrentTimeBeforeBuilder_ == null) { - noncurrentTimeBefore_ = null; - } else { - noncurrentTimeBefore_ = null; - noncurrentTimeBeforeBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Condition_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Lifecycle.Rule.Condition getDefaultInstanceForType() { - return com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Lifecycle.Rule.Condition build() { - com.google.storage.v2.Bucket.Lifecycle.Rule.Condition result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Lifecycle.Rule.Condition buildPartial() { - com.google.storage.v2.Bucket.Lifecycle.Rule.Condition result = - new com.google.storage.v2.Bucket.Lifecycle.Rule.Condition(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.ageDays_ = ageDays_; - to_bitField0_ |= 0x00000001; - } - if (createdBeforeBuilder_ == null) { - result.createdBefore_ = createdBefore_; - } else { - result.createdBefore_ = createdBeforeBuilder_.build(); - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.isLive_ = isLive_; - to_bitField0_ |= 0x00000002; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.numNewerVersions_ = numNewerVersions_; - to_bitField0_ |= 0x00000004; - } - if (((bitField0_ & 0x00000008) != 0)) { - matchesStorageClass_ = matchesStorageClass_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.matchesStorageClass_ = matchesStorageClass_; - if (((from_bitField0_ & 0x00000010) != 0)) { - result.daysSinceCustomTime_ = daysSinceCustomTime_; - to_bitField0_ |= 0x00000008; - } - if (customTimeBeforeBuilder_ == null) { - result.customTimeBefore_ = customTimeBefore_; - } else { - result.customTimeBefore_ = customTimeBeforeBuilder_.build(); - } - if (((from_bitField0_ & 0x00000020) != 0)) { - result.daysSinceNoncurrentTime_ = daysSinceNoncurrentTime_; - to_bitField0_ |= 0x00000010; - } - if (noncurrentTimeBeforeBuilder_ == null) { - result.noncurrentTimeBefore_ = noncurrentTimeBefore_; - } else { - result.noncurrentTimeBefore_ = noncurrentTimeBeforeBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.Bucket.Lifecycle.Rule.Condition) { - return mergeFrom((com.google.storage.v2.Bucket.Lifecycle.Rule.Condition) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.Bucket.Lifecycle.Rule.Condition other) { - if (other == com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.getDefaultInstance()) - return this; - if (other.hasAgeDays()) { - setAgeDays(other.getAgeDays()); - } - if (other.hasCreatedBefore()) { - mergeCreatedBefore(other.getCreatedBefore()); - } - if (other.hasIsLive()) { - setIsLive(other.getIsLive()); - } - if (other.hasNumNewerVersions()) { - setNumNewerVersions(other.getNumNewerVersions()); - } - if (!other.matchesStorageClass_.isEmpty()) { - if (matchesStorageClass_.isEmpty()) { - matchesStorageClass_ = other.matchesStorageClass_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureMatchesStorageClassIsMutable(); - matchesStorageClass_.addAll(other.matchesStorageClass_); - } - onChanged(); - } - if (other.hasDaysSinceCustomTime()) { - setDaysSinceCustomTime(other.getDaysSinceCustomTime()); - } - if (other.hasCustomTimeBefore()) { - mergeCustomTimeBefore(other.getCustomTimeBefore()); - } - if (other.hasDaysSinceNoncurrentTime()) { - setDaysSinceNoncurrentTime(other.getDaysSinceNoncurrentTime()); - } - if (other.hasNoncurrentTimeBefore()) { - mergeNoncurrentTimeBefore(other.getNoncurrentTimeBefore()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.Bucket.Lifecycle.Rule.Condition parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.storage.v2.Bucket.Lifecycle.Rule.Condition) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private int ageDays_; - /** - * - * - *
-           * Age of an object (in days). This condition is satisfied when an
-           * object reaches the specified age.
-           * A value of 0 indicates that all objects immediately match this
-           * condition.
-           * 
- * - * optional int32 age_days = 1; - * - * @return Whether the ageDays field is set. - */ - @java.lang.Override - public boolean hasAgeDays() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-           * Age of an object (in days). This condition is satisfied when an
-           * object reaches the specified age.
-           * A value of 0 indicates that all objects immediately match this
-           * condition.
-           * 
- * - * optional int32 age_days = 1; - * - * @return The ageDays. - */ - @java.lang.Override - public int getAgeDays() { - return ageDays_; - } - /** - * - * - *
-           * Age of an object (in days). This condition is satisfied when an
-           * object reaches the specified age.
-           * A value of 0 indicates that all objects immediately match this
-           * condition.
-           * 
- * - * optional int32 age_days = 1; - * - * @param value The ageDays to set. - * @return This builder for chaining. - */ - public Builder setAgeDays(int value) { - bitField0_ |= 0x00000001; - ageDays_ = value; - onChanged(); - return this; - } - /** - * - * - *
-           * Age of an object (in days). This condition is satisfied when an
-           * object reaches the specified age.
-           * A value of 0 indicates that all objects immediately match this
-           * condition.
-           * 
- * - * optional int32 age_days = 1; - * - * @return This builder for chaining. - */ - public Builder clearAgeDays() { - bitField0_ = (bitField0_ & ~0x00000001); - ageDays_ = 0; - onChanged(); - return this; - } - - private com.google.type.Date createdBefore_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> - createdBeforeBuilder_; - /** - * - * - *
-           * This condition is satisfied when an object is created before midnight
-           * of the specified date in UTC.
-           * 
- * - * .google.type.Date created_before = 2; - * - * @return Whether the createdBefore field is set. - */ - public boolean hasCreatedBefore() { - return createdBeforeBuilder_ != null || createdBefore_ != null; - } - /** - * - * - *
-           * This condition is satisfied when an object is created before midnight
-           * of the specified date in UTC.
-           * 
- * - * .google.type.Date created_before = 2; - * - * @return The createdBefore. - */ - public com.google.type.Date getCreatedBefore() { - if (createdBeforeBuilder_ == null) { - return createdBefore_ == null - ? com.google.type.Date.getDefaultInstance() - : createdBefore_; - } else { - return createdBeforeBuilder_.getMessage(); - } - } - /** - * - * - *
-           * This condition is satisfied when an object is created before midnight
-           * of the specified date in UTC.
-           * 
- * - * .google.type.Date created_before = 2; - */ - public Builder setCreatedBefore(com.google.type.Date value) { - if (createdBeforeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - createdBefore_ = value; - onChanged(); - } else { - createdBeforeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-           * This condition is satisfied when an object is created before midnight
-           * of the specified date in UTC.
-           * 
- * - * .google.type.Date created_before = 2; - */ - public Builder setCreatedBefore(com.google.type.Date.Builder builderForValue) { - if (createdBeforeBuilder_ == null) { - createdBefore_ = builderForValue.build(); - onChanged(); - } else { - createdBeforeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-           * This condition is satisfied when an object is created before midnight
-           * of the specified date in UTC.
-           * 
- * - * .google.type.Date created_before = 2; - */ - public Builder mergeCreatedBefore(com.google.type.Date value) { - if (createdBeforeBuilder_ == null) { - if (createdBefore_ != null) { - createdBefore_ = - com.google.type.Date.newBuilder(createdBefore_).mergeFrom(value).buildPartial(); - } else { - createdBefore_ = value; - } - onChanged(); - } else { - createdBeforeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-           * This condition is satisfied when an object is created before midnight
-           * of the specified date in UTC.
-           * 
- * - * .google.type.Date created_before = 2; - */ - public Builder clearCreatedBefore() { - if (createdBeforeBuilder_ == null) { - createdBefore_ = null; - onChanged(); - } else { - createdBefore_ = null; - createdBeforeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-           * This condition is satisfied when an object is created before midnight
-           * of the specified date in UTC.
-           * 
- * - * .google.type.Date created_before = 2; - */ - public com.google.type.Date.Builder getCreatedBeforeBuilder() { - - onChanged(); - return getCreatedBeforeFieldBuilder().getBuilder(); - } - /** - * - * - *
-           * This condition is satisfied when an object is created before midnight
-           * of the specified date in UTC.
-           * 
- * - * .google.type.Date created_before = 2; - */ - public com.google.type.DateOrBuilder getCreatedBeforeOrBuilder() { - if (createdBeforeBuilder_ != null) { - return createdBeforeBuilder_.getMessageOrBuilder(); - } else { - return createdBefore_ == null - ? com.google.type.Date.getDefaultInstance() - : createdBefore_; - } - } - /** - * - * - *
-           * This condition is satisfied when an object is created before midnight
-           * of the specified date in UTC.
-           * 
- * - * .google.type.Date created_before = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> - getCreatedBeforeFieldBuilder() { - if (createdBeforeBuilder_ == null) { - createdBeforeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.type.Date, - com.google.type.Date.Builder, - com.google.type.DateOrBuilder>( - getCreatedBefore(), getParentForChildren(), isClean()); - createdBefore_ = null; - } - return createdBeforeBuilder_; - } - - private boolean isLive_; - /** - * - * - *
-           * Relevant only for versioned objects. If the value is
-           * `true`, this condition matches live objects; if the value
-           * is `false`, it matches archived objects.
-           * 
- * - * optional bool is_live = 3; - * - * @return Whether the isLive field is set. - */ - @java.lang.Override - public boolean hasIsLive() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-           * Relevant only for versioned objects. If the value is
-           * `true`, this condition matches live objects; if the value
-           * is `false`, it matches archived objects.
-           * 
- * - * optional bool is_live = 3; - * - * @return The isLive. - */ - @java.lang.Override - public boolean getIsLive() { - return isLive_; - } - /** - * - * - *
-           * Relevant only for versioned objects. If the value is
-           * `true`, this condition matches live objects; if the value
-           * is `false`, it matches archived objects.
-           * 
- * - * optional bool is_live = 3; - * - * @param value The isLive to set. - * @return This builder for chaining. - */ - public Builder setIsLive(boolean value) { - bitField0_ |= 0x00000002; - isLive_ = value; - onChanged(); - return this; - } - /** - * - * - *
-           * Relevant only for versioned objects. If the value is
-           * `true`, this condition matches live objects; if the value
-           * is `false`, it matches archived objects.
-           * 
- * - * optional bool is_live = 3; - * - * @return This builder for chaining. - */ - public Builder clearIsLive() { - bitField0_ = (bitField0_ & ~0x00000002); - isLive_ = false; - onChanged(); - return this; - } - - private int numNewerVersions_; - /** - * - * - *
-           * Relevant only for versioned objects. If the value is N, this
-           * condition is satisfied when there are at least N versions (including
-           * the live version) newer than this version of the object.
-           * 
- * - * optional int32 num_newer_versions = 4; - * - * @return Whether the numNewerVersions field is set. - */ - @java.lang.Override - public boolean hasNumNewerVersions() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * - * - *
-           * Relevant only for versioned objects. If the value is N, this
-           * condition is satisfied when there are at least N versions (including
-           * the live version) newer than this version of the object.
-           * 
- * - * optional int32 num_newer_versions = 4; - * - * @return The numNewerVersions. - */ - @java.lang.Override - public int getNumNewerVersions() { - return numNewerVersions_; - } - /** - * - * - *
-           * Relevant only for versioned objects. If the value is N, this
-           * condition is satisfied when there are at least N versions (including
-           * the live version) newer than this version of the object.
-           * 
- * - * optional int32 num_newer_versions = 4; - * - * @param value The numNewerVersions to set. - * @return This builder for chaining. - */ - public Builder setNumNewerVersions(int value) { - bitField0_ |= 0x00000004; - numNewerVersions_ = value; - onChanged(); - return this; - } - /** - * - * - *
-           * Relevant only for versioned objects. If the value is N, this
-           * condition is satisfied when there are at least N versions (including
-           * the live version) newer than this version of the object.
-           * 
- * - * optional int32 num_newer_versions = 4; - * - * @return This builder for chaining. - */ - public Builder clearNumNewerVersions() { - bitField0_ = (bitField0_ & ~0x00000004); - numNewerVersions_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList matchesStorageClass_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensureMatchesStorageClassIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - matchesStorageClass_ = - new com.google.protobuf.LazyStringArrayList(matchesStorageClass_); - bitField0_ |= 0x00000008; - } - } - /** - * - * - *
-           * Objects having any of the storage classes specified by this condition
-           * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
-           * `NEARLINE`, `COLDLINE`, `STANDARD`, and
-           * `DURABLE_REDUCED_AVAILABILITY`.
-           * 
- * - * repeated string matches_storage_class = 5; - * - * @return A list containing the matchesStorageClass. - */ - public com.google.protobuf.ProtocolStringList getMatchesStorageClassList() { - return matchesStorageClass_.getUnmodifiableView(); - } - /** - * - * - *
-           * Objects having any of the storage classes specified by this condition
-           * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
-           * `NEARLINE`, `COLDLINE`, `STANDARD`, and
-           * `DURABLE_REDUCED_AVAILABILITY`.
-           * 
- * - * repeated string matches_storage_class = 5; - * - * @return The count of matchesStorageClass. - */ - public int getMatchesStorageClassCount() { - return matchesStorageClass_.size(); - } - /** - * - * - *
-           * Objects having any of the storage classes specified by this condition
-           * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
-           * `NEARLINE`, `COLDLINE`, `STANDARD`, and
-           * `DURABLE_REDUCED_AVAILABILITY`.
-           * 
- * - * repeated string matches_storage_class = 5; - * - * @param index The index of the element to return. - * @return The matchesStorageClass at the given index. - */ - public java.lang.String getMatchesStorageClass(int index) { - return matchesStorageClass_.get(index); - } - /** - * - * - *
-           * Objects having any of the storage classes specified by this condition
-           * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
-           * `NEARLINE`, `COLDLINE`, `STANDARD`, and
-           * `DURABLE_REDUCED_AVAILABILITY`.
-           * 
- * - * repeated string matches_storage_class = 5; - * - * @param index The index of the value to return. - * @return The bytes of the matchesStorageClass at the given index. - */ - public com.google.protobuf.ByteString getMatchesStorageClassBytes(int index) { - return matchesStorageClass_.getByteString(index); - } - /** - * - * - *
-           * Objects having any of the storage classes specified by this condition
-           * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
-           * `NEARLINE`, `COLDLINE`, `STANDARD`, and
-           * `DURABLE_REDUCED_AVAILABILITY`.
-           * 
- * - * repeated string matches_storage_class = 5; - * - * @param index The index to set the value at. - * @param value The matchesStorageClass to set. - * @return This builder for chaining. - */ - public Builder setMatchesStorageClass(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureMatchesStorageClassIsMutable(); - matchesStorageClass_.set(index, value); - onChanged(); - return this; - } - /** - * - * - *
-           * Objects having any of the storage classes specified by this condition
-           * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
-           * `NEARLINE`, `COLDLINE`, `STANDARD`, and
-           * `DURABLE_REDUCED_AVAILABILITY`.
-           * 
- * - * repeated string matches_storage_class = 5; - * - * @param value The matchesStorageClass to add. - * @return This builder for chaining. - */ - public Builder addMatchesStorageClass(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureMatchesStorageClassIsMutable(); - matchesStorageClass_.add(value); - onChanged(); - return this; - } - /** - * - * - *
-           * Objects having any of the storage classes specified by this condition
-           * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
-           * `NEARLINE`, `COLDLINE`, `STANDARD`, and
-           * `DURABLE_REDUCED_AVAILABILITY`.
-           * 
- * - * repeated string matches_storage_class = 5; - * - * @param values The matchesStorageClass to add. - * @return This builder for chaining. - */ - public Builder addAllMatchesStorageClass(java.lang.Iterable values) { - ensureMatchesStorageClassIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, matchesStorageClass_); - onChanged(); - return this; - } - /** - * - * - *
-           * Objects having any of the storage classes specified by this condition
-           * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
-           * `NEARLINE`, `COLDLINE`, `STANDARD`, and
-           * `DURABLE_REDUCED_AVAILABILITY`.
-           * 
- * - * repeated string matches_storage_class = 5; - * - * @return This builder for chaining. - */ - public Builder clearMatchesStorageClass() { - matchesStorageClass_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - return this; - } - /** - * - * - *
-           * Objects having any of the storage classes specified by this condition
-           * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
-           * `NEARLINE`, `COLDLINE`, `STANDARD`, and
-           * `DURABLE_REDUCED_AVAILABILITY`.
-           * 
- * - * repeated string matches_storage_class = 5; - * - * @param value The bytes of the matchesStorageClass to add. - * @return This builder for chaining. - */ - public Builder addMatchesStorageClassBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureMatchesStorageClassIsMutable(); - matchesStorageClass_.add(value); - onChanged(); - return this; - } - - private int daysSinceCustomTime_; - /** - * - * - *
-           * Number of days that have elapsed since the custom timestamp set on an
-           * object.
-           * The value of the field must be a nonnegative integer.
-           * 
- * - * optional int32 days_since_custom_time = 7; - * - * @return Whether the daysSinceCustomTime field is set. - */ - @java.lang.Override - public boolean hasDaysSinceCustomTime() { - return ((bitField0_ & 0x00000010) != 0); - } - /** - * - * - *
-           * Number of days that have elapsed since the custom timestamp set on an
-           * object.
-           * The value of the field must be a nonnegative integer.
-           * 
- * - * optional int32 days_since_custom_time = 7; - * - * @return The daysSinceCustomTime. - */ - @java.lang.Override - public int getDaysSinceCustomTime() { - return daysSinceCustomTime_; - } - /** - * - * - *
-           * Number of days that have elapsed since the custom timestamp set on an
-           * object.
-           * The value of the field must be a nonnegative integer.
-           * 
- * - * optional int32 days_since_custom_time = 7; - * - * @param value The daysSinceCustomTime to set. - * @return This builder for chaining. - */ - public Builder setDaysSinceCustomTime(int value) { - bitField0_ |= 0x00000010; - daysSinceCustomTime_ = value; - onChanged(); - return this; - } - /** - * - * - *
-           * Number of days that have elapsed since the custom timestamp set on an
-           * object.
-           * The value of the field must be a nonnegative integer.
-           * 
- * - * optional int32 days_since_custom_time = 7; - * - * @return This builder for chaining. - */ - public Builder clearDaysSinceCustomTime() { - bitField0_ = (bitField0_ & ~0x00000010); - daysSinceCustomTime_ = 0; - onChanged(); - return this; - } - - private com.google.type.Date customTimeBefore_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> - customTimeBeforeBuilder_; - /** - * - * - *
-           * An object matches this condition if the custom timestamp set on the
-           * object is before the specified date in UTC.
-           * 
- * - * .google.type.Date custom_time_before = 8; - * - * @return Whether the customTimeBefore field is set. - */ - public boolean hasCustomTimeBefore() { - return customTimeBeforeBuilder_ != null || customTimeBefore_ != null; - } - /** - * - * - *
-           * An object matches this condition if the custom timestamp set on the
-           * object is before the specified date in UTC.
-           * 
- * - * .google.type.Date custom_time_before = 8; - * - * @return The customTimeBefore. - */ - public com.google.type.Date getCustomTimeBefore() { - if (customTimeBeforeBuilder_ == null) { - return customTimeBefore_ == null - ? com.google.type.Date.getDefaultInstance() - : customTimeBefore_; - } else { - return customTimeBeforeBuilder_.getMessage(); - } - } - /** - * - * - *
-           * An object matches this condition if the custom timestamp set on the
-           * object is before the specified date in UTC.
-           * 
- * - * .google.type.Date custom_time_before = 8; - */ - public Builder setCustomTimeBefore(com.google.type.Date value) { - if (customTimeBeforeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - customTimeBefore_ = value; - onChanged(); - } else { - customTimeBeforeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-           * An object matches this condition if the custom timestamp set on the
-           * object is before the specified date in UTC.
-           * 
- * - * .google.type.Date custom_time_before = 8; - */ - public Builder setCustomTimeBefore(com.google.type.Date.Builder builderForValue) { - if (customTimeBeforeBuilder_ == null) { - customTimeBefore_ = builderForValue.build(); - onChanged(); - } else { - customTimeBeforeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-           * An object matches this condition if the custom timestamp set on the
-           * object is before the specified date in UTC.
-           * 
- * - * .google.type.Date custom_time_before = 8; - */ - public Builder mergeCustomTimeBefore(com.google.type.Date value) { - if (customTimeBeforeBuilder_ == null) { - if (customTimeBefore_ != null) { - customTimeBefore_ = - com.google.type.Date.newBuilder(customTimeBefore_) - .mergeFrom(value) - .buildPartial(); - } else { - customTimeBefore_ = value; - } - onChanged(); - } else { - customTimeBeforeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-           * An object matches this condition if the custom timestamp set on the
-           * object is before the specified date in UTC.
-           * 
- * - * .google.type.Date custom_time_before = 8; - */ - public Builder clearCustomTimeBefore() { - if (customTimeBeforeBuilder_ == null) { - customTimeBefore_ = null; - onChanged(); - } else { - customTimeBefore_ = null; - customTimeBeforeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-           * An object matches this condition if the custom timestamp set on the
-           * object is before the specified date in UTC.
-           * 
- * - * .google.type.Date custom_time_before = 8; - */ - public com.google.type.Date.Builder getCustomTimeBeforeBuilder() { - - onChanged(); - return getCustomTimeBeforeFieldBuilder().getBuilder(); - } - /** - * - * - *
-           * An object matches this condition if the custom timestamp set on the
-           * object is before the specified date in UTC.
-           * 
- * - * .google.type.Date custom_time_before = 8; - */ - public com.google.type.DateOrBuilder getCustomTimeBeforeOrBuilder() { - if (customTimeBeforeBuilder_ != null) { - return customTimeBeforeBuilder_.getMessageOrBuilder(); - } else { - return customTimeBefore_ == null - ? com.google.type.Date.getDefaultInstance() - : customTimeBefore_; - } - } - /** - * - * - *
-           * An object matches this condition if the custom timestamp set on the
-           * object is before the specified date in UTC.
-           * 
- * - * .google.type.Date custom_time_before = 8; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> - getCustomTimeBeforeFieldBuilder() { - if (customTimeBeforeBuilder_ == null) { - customTimeBeforeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.type.Date, - com.google.type.Date.Builder, - com.google.type.DateOrBuilder>( - getCustomTimeBefore(), getParentForChildren(), isClean()); - customTimeBefore_ = null; - } - return customTimeBeforeBuilder_; - } - - private int daysSinceNoncurrentTime_; - /** - * - * - *
-           * This condition is relevant only for versioned objects. An object
-           * version satisfies this condition only if these many days have been
-           * passed since it became noncurrent. The value of the field must be a
-           * nonnegative integer. If it's zero, the object version will become
-           * eligible for Lifecycle action as soon as it becomes noncurrent.
-           * 
- * - * optional int32 days_since_noncurrent_time = 9; - * - * @return Whether the daysSinceNoncurrentTime field is set. - */ - @java.lang.Override - public boolean hasDaysSinceNoncurrentTime() { - return ((bitField0_ & 0x00000020) != 0); - } - /** - * - * - *
-           * This condition is relevant only for versioned objects. An object
-           * version satisfies this condition only if these many days have been
-           * passed since it became noncurrent. The value of the field must be a
-           * nonnegative integer. If it's zero, the object version will become
-           * eligible for Lifecycle action as soon as it becomes noncurrent.
-           * 
- * - * optional int32 days_since_noncurrent_time = 9; - * - * @return The daysSinceNoncurrentTime. - */ - @java.lang.Override - public int getDaysSinceNoncurrentTime() { - return daysSinceNoncurrentTime_; - } - /** - * - * - *
-           * This condition is relevant only for versioned objects. An object
-           * version satisfies this condition only if these many days have been
-           * passed since it became noncurrent. The value of the field must be a
-           * nonnegative integer. If it's zero, the object version will become
-           * eligible for Lifecycle action as soon as it becomes noncurrent.
-           * 
- * - * optional int32 days_since_noncurrent_time = 9; - * - * @param value The daysSinceNoncurrentTime to set. - * @return This builder for chaining. - */ - public Builder setDaysSinceNoncurrentTime(int value) { - bitField0_ |= 0x00000020; - daysSinceNoncurrentTime_ = value; - onChanged(); - return this; - } - /** - * - * - *
-           * This condition is relevant only for versioned objects. An object
-           * version satisfies this condition only if these many days have been
-           * passed since it became noncurrent. The value of the field must be a
-           * nonnegative integer. If it's zero, the object version will become
-           * eligible for Lifecycle action as soon as it becomes noncurrent.
-           * 
- * - * optional int32 days_since_noncurrent_time = 9; - * - * @return This builder for chaining. - */ - public Builder clearDaysSinceNoncurrentTime() { - bitField0_ = (bitField0_ & ~0x00000020); - daysSinceNoncurrentTime_ = 0; - onChanged(); - return this; - } - - private com.google.type.Date noncurrentTimeBefore_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> - noncurrentTimeBeforeBuilder_; - /** - * - * - *
-           * This condition is relevant only for versioned objects. An object
-           * version satisfies this condition only if it became noncurrent before
-           * the specified date in UTC.
-           * 
- * - * .google.type.Date noncurrent_time_before = 10; - * - * @return Whether the noncurrentTimeBefore field is set. - */ - public boolean hasNoncurrentTimeBefore() { - return noncurrentTimeBeforeBuilder_ != null || noncurrentTimeBefore_ != null; - } - /** - * - * - *
-           * This condition is relevant only for versioned objects. An object
-           * version satisfies this condition only if it became noncurrent before
-           * the specified date in UTC.
-           * 
- * - * .google.type.Date noncurrent_time_before = 10; - * - * @return The noncurrentTimeBefore. - */ - public com.google.type.Date getNoncurrentTimeBefore() { - if (noncurrentTimeBeforeBuilder_ == null) { - return noncurrentTimeBefore_ == null - ? com.google.type.Date.getDefaultInstance() - : noncurrentTimeBefore_; - } else { - return noncurrentTimeBeforeBuilder_.getMessage(); - } - } - /** - * - * - *
-           * This condition is relevant only for versioned objects. An object
-           * version satisfies this condition only if it became noncurrent before
-           * the specified date in UTC.
-           * 
- * - * .google.type.Date noncurrent_time_before = 10; - */ - public Builder setNoncurrentTimeBefore(com.google.type.Date value) { - if (noncurrentTimeBeforeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - noncurrentTimeBefore_ = value; - onChanged(); - } else { - noncurrentTimeBeforeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-           * This condition is relevant only for versioned objects. An object
-           * version satisfies this condition only if it became noncurrent before
-           * the specified date in UTC.
-           * 
- * - * .google.type.Date noncurrent_time_before = 10; - */ - public Builder setNoncurrentTimeBefore(com.google.type.Date.Builder builderForValue) { - if (noncurrentTimeBeforeBuilder_ == null) { - noncurrentTimeBefore_ = builderForValue.build(); - onChanged(); - } else { - noncurrentTimeBeforeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-           * This condition is relevant only for versioned objects. An object
-           * version satisfies this condition only if it became noncurrent before
-           * the specified date in UTC.
-           * 
- * - * .google.type.Date noncurrent_time_before = 10; - */ - public Builder mergeNoncurrentTimeBefore(com.google.type.Date value) { - if (noncurrentTimeBeforeBuilder_ == null) { - if (noncurrentTimeBefore_ != null) { - noncurrentTimeBefore_ = - com.google.type.Date.newBuilder(noncurrentTimeBefore_) - .mergeFrom(value) - .buildPartial(); - } else { - noncurrentTimeBefore_ = value; - } - onChanged(); - } else { - noncurrentTimeBeforeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-           * This condition is relevant only for versioned objects. An object
-           * version satisfies this condition only if it became noncurrent before
-           * the specified date in UTC.
-           * 
- * - * .google.type.Date noncurrent_time_before = 10; - */ - public Builder clearNoncurrentTimeBefore() { - if (noncurrentTimeBeforeBuilder_ == null) { - noncurrentTimeBefore_ = null; - onChanged(); - } else { - noncurrentTimeBefore_ = null; - noncurrentTimeBeforeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-           * This condition is relevant only for versioned objects. An object
-           * version satisfies this condition only if it became noncurrent before
-           * the specified date in UTC.
-           * 
- * - * .google.type.Date noncurrent_time_before = 10; - */ - public com.google.type.Date.Builder getNoncurrentTimeBeforeBuilder() { - - onChanged(); - return getNoncurrentTimeBeforeFieldBuilder().getBuilder(); - } - /** - * - * - *
-           * This condition is relevant only for versioned objects. An object
-           * version satisfies this condition only if it became noncurrent before
-           * the specified date in UTC.
-           * 
- * - * .google.type.Date noncurrent_time_before = 10; - */ - public com.google.type.DateOrBuilder getNoncurrentTimeBeforeOrBuilder() { - if (noncurrentTimeBeforeBuilder_ != null) { - return noncurrentTimeBeforeBuilder_.getMessageOrBuilder(); - } else { - return noncurrentTimeBefore_ == null - ? com.google.type.Date.getDefaultInstance() - : noncurrentTimeBefore_; - } - } - /** - * - * - *
-           * This condition is relevant only for versioned objects. An object
-           * version satisfies this condition only if it became noncurrent before
-           * the specified date in UTC.
-           * 
- * - * .google.type.Date noncurrent_time_before = 10; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> - getNoncurrentTimeBeforeFieldBuilder() { - if (noncurrentTimeBeforeBuilder_ == null) { - noncurrentTimeBeforeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.type.Date, - com.google.type.Date.Builder, - com.google.type.DateOrBuilder>( - getNoncurrentTimeBefore(), getParentForChildren(), isClean()); - noncurrentTimeBefore_ = null; - } - return noncurrentTimeBeforeBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.Bucket.Lifecycle.Rule.Condition) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.Lifecycle.Rule.Condition) - private static final com.google.storage.v2.Bucket.Lifecycle.Rule.Condition DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.Lifecycle.Rule.Condition(); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule.Condition getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Condition parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Condition(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Lifecycle.Rule.Condition getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public static final int ACTION_FIELD_NUMBER = 1; - private com.google.storage.v2.Bucket.Lifecycle.Rule.Action action_; - /** - * - * - *
-       * The action to take.
-       * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1; - * - * @return Whether the action field is set. - */ - @java.lang.Override - public boolean hasAction() { - return action_ != null; - } - /** - * - * - *
-       * The action to take.
-       * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1; - * - * @return The action. - */ - @java.lang.Override - public com.google.storage.v2.Bucket.Lifecycle.Rule.Action getAction() { - return action_ == null - ? com.google.storage.v2.Bucket.Lifecycle.Rule.Action.getDefaultInstance() - : action_; - } - /** - * - * - *
-       * The action to take.
-       * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1; - */ - @java.lang.Override - public com.google.storage.v2.Bucket.Lifecycle.Rule.ActionOrBuilder getActionOrBuilder() { - return getAction(); - } - - public static final int CONDITION_FIELD_NUMBER = 2; - private com.google.storage.v2.Bucket.Lifecycle.Rule.Condition condition_; - /** - * - * - *
-       * The condition(s) under which the action will be taken.
-       * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2; - * - * @return Whether the condition field is set. - */ - @java.lang.Override - public boolean hasCondition() { - return condition_ != null; - } - /** - * - * - *
-       * The condition(s) under which the action will be taken.
-       * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2; - * - * @return The condition. - */ - @java.lang.Override - public com.google.storage.v2.Bucket.Lifecycle.Rule.Condition getCondition() { - return condition_ == null - ? com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.getDefaultInstance() - : condition_; - } - /** - * - * - *
-       * The condition(s) under which the action will be taken.
-       * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2; - */ - @java.lang.Override - public com.google.storage.v2.Bucket.Lifecycle.Rule.ConditionOrBuilder - getConditionOrBuilder() { - return getCondition(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (action_ != null) { - output.writeMessage(1, getAction()); - } - if (condition_ != null) { - output.writeMessage(2, getCondition()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (action_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getAction()); - } - if (condition_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCondition()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.Bucket.Lifecycle.Rule)) { - return super.equals(obj); - } - com.google.storage.v2.Bucket.Lifecycle.Rule other = - (com.google.storage.v2.Bucket.Lifecycle.Rule) obj; - - if (hasAction() != other.hasAction()) return false; - if (hasAction()) { - if (!getAction().equals(other.getAction())) return false; - } - if (hasCondition() != other.hasCondition()) return false; - if (hasCondition()) { - if (!getCondition().equals(other.getCondition())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasAction()) { - hash = (37 * hash) + ACTION_FIELD_NUMBER; - hash = (53 * hash) + getAction().hashCode(); - } - if (hasCondition()) { - hash = (37 * hash) + CONDITION_FIELD_NUMBER; - hash = (53 * hash) + getCondition().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.Bucket.Lifecycle.Rule prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-       * A lifecycle Rule, combining an action to take on an object and a
-       * condition which will trigger that action.
-       * 
- * - * Protobuf type {@code google.storage.v2.Bucket.Lifecycle.Rule} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.Lifecycle.Rule) - com.google.storage.v2.Bucket.Lifecycle.RuleOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.Lifecycle.Rule.class, - com.google.storage.v2.Bucket.Lifecycle.Rule.Builder.class); - } - - // Construct using com.google.storage.v2.Bucket.Lifecycle.Rule.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (actionBuilder_ == null) { - action_ = null; - } else { - action_ = null; - actionBuilder_ = null; - } - if (conditionBuilder_ == null) { - condition_ = null; - } else { - condition_ = null; - conditionBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Lifecycle.Rule getDefaultInstanceForType() { - return com.google.storage.v2.Bucket.Lifecycle.Rule.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Lifecycle.Rule build() { - com.google.storage.v2.Bucket.Lifecycle.Rule result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Lifecycle.Rule buildPartial() { - com.google.storage.v2.Bucket.Lifecycle.Rule result = - new com.google.storage.v2.Bucket.Lifecycle.Rule(this); - if (actionBuilder_ == null) { - result.action_ = action_; - } else { - result.action_ = actionBuilder_.build(); - } - if (conditionBuilder_ == null) { - result.condition_ = condition_; - } else { - result.condition_ = conditionBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.Bucket.Lifecycle.Rule) { - return mergeFrom((com.google.storage.v2.Bucket.Lifecycle.Rule) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.Bucket.Lifecycle.Rule other) { - if (other == com.google.storage.v2.Bucket.Lifecycle.Rule.getDefaultInstance()) - return this; - if (other.hasAction()) { - mergeAction(other.getAction()); - } - if (other.hasCondition()) { - mergeCondition(other.getCondition()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.Bucket.Lifecycle.Rule parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.Bucket.Lifecycle.Rule) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.storage.v2.Bucket.Lifecycle.Rule.Action action_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Lifecycle.Rule.Action, - com.google.storage.v2.Bucket.Lifecycle.Rule.Action.Builder, - com.google.storage.v2.Bucket.Lifecycle.Rule.ActionOrBuilder> - actionBuilder_; - /** - * - * - *
-         * The action to take.
-         * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1; - * - * @return Whether the action field is set. - */ - public boolean hasAction() { - return actionBuilder_ != null || action_ != null; - } - /** - * - * - *
-         * The action to take.
-         * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1; - * - * @return The action. - */ - public com.google.storage.v2.Bucket.Lifecycle.Rule.Action getAction() { - if (actionBuilder_ == null) { - return action_ == null - ? com.google.storage.v2.Bucket.Lifecycle.Rule.Action.getDefaultInstance() - : action_; - } else { - return actionBuilder_.getMessage(); - } - } - /** - * - * - *
-         * The action to take.
-         * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1; - */ - public Builder setAction(com.google.storage.v2.Bucket.Lifecycle.Rule.Action value) { - if (actionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - action_ = value; - onChanged(); - } else { - actionBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-         * The action to take.
-         * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1; - */ - public Builder setAction( - com.google.storage.v2.Bucket.Lifecycle.Rule.Action.Builder builderForValue) { - if (actionBuilder_ == null) { - action_ = builderForValue.build(); - onChanged(); - } else { - actionBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-         * The action to take.
-         * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1; - */ - public Builder mergeAction(com.google.storage.v2.Bucket.Lifecycle.Rule.Action value) { - if (actionBuilder_ == null) { - if (action_ != null) { - action_ = - com.google.storage.v2.Bucket.Lifecycle.Rule.Action.newBuilder(action_) - .mergeFrom(value) - .buildPartial(); - } else { - action_ = value; - } - onChanged(); - } else { - actionBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-         * The action to take.
-         * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1; - */ - public Builder clearAction() { - if (actionBuilder_ == null) { - action_ = null; - onChanged(); - } else { - action_ = null; - actionBuilder_ = null; - } - - return this; - } - /** - * - * - *
-         * The action to take.
-         * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1; - */ - public com.google.storage.v2.Bucket.Lifecycle.Rule.Action.Builder getActionBuilder() { - - onChanged(); - return getActionFieldBuilder().getBuilder(); - } - /** - * - * - *
-         * The action to take.
-         * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1; - */ - public com.google.storage.v2.Bucket.Lifecycle.Rule.ActionOrBuilder getActionOrBuilder() { - if (actionBuilder_ != null) { - return actionBuilder_.getMessageOrBuilder(); - } else { - return action_ == null - ? com.google.storage.v2.Bucket.Lifecycle.Rule.Action.getDefaultInstance() - : action_; - } - } - /** - * - * - *
-         * The action to take.
-         * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Lifecycle.Rule.Action, - com.google.storage.v2.Bucket.Lifecycle.Rule.Action.Builder, - com.google.storage.v2.Bucket.Lifecycle.Rule.ActionOrBuilder> - getActionFieldBuilder() { - if (actionBuilder_ == null) { - actionBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Lifecycle.Rule.Action, - com.google.storage.v2.Bucket.Lifecycle.Rule.Action.Builder, - com.google.storage.v2.Bucket.Lifecycle.Rule.ActionOrBuilder>( - getAction(), getParentForChildren(), isClean()); - action_ = null; - } - return actionBuilder_; - } - - private com.google.storage.v2.Bucket.Lifecycle.Rule.Condition condition_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Lifecycle.Rule.Condition, - com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.Builder, - com.google.storage.v2.Bucket.Lifecycle.Rule.ConditionOrBuilder> - conditionBuilder_; - /** - * - * - *
-         * The condition(s) under which the action will be taken.
-         * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2; - * - * @return Whether the condition field is set. - */ - public boolean hasCondition() { - return conditionBuilder_ != null || condition_ != null; - } - /** - * - * - *
-         * The condition(s) under which the action will be taken.
-         * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2; - * - * @return The condition. - */ - public com.google.storage.v2.Bucket.Lifecycle.Rule.Condition getCondition() { - if (conditionBuilder_ == null) { - return condition_ == null - ? com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.getDefaultInstance() - : condition_; - } else { - return conditionBuilder_.getMessage(); - } - } - /** - * - * - *
-         * The condition(s) under which the action will be taken.
-         * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2; - */ - public Builder setCondition(com.google.storage.v2.Bucket.Lifecycle.Rule.Condition value) { - if (conditionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - condition_ = value; - onChanged(); - } else { - conditionBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-         * The condition(s) under which the action will be taken.
-         * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2; - */ - public Builder setCondition( - com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.Builder builderForValue) { - if (conditionBuilder_ == null) { - condition_ = builderForValue.build(); - onChanged(); - } else { - conditionBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-         * The condition(s) under which the action will be taken.
-         * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2; - */ - public Builder mergeCondition(com.google.storage.v2.Bucket.Lifecycle.Rule.Condition value) { - if (conditionBuilder_ == null) { - if (condition_ != null) { - condition_ = - com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.newBuilder(condition_) - .mergeFrom(value) - .buildPartial(); - } else { - condition_ = value; - } - onChanged(); - } else { - conditionBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-         * The condition(s) under which the action will be taken.
-         * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2; - */ - public Builder clearCondition() { - if (conditionBuilder_ == null) { - condition_ = null; - onChanged(); - } else { - condition_ = null; - conditionBuilder_ = null; - } - - return this; - } - /** - * - * - *
-         * The condition(s) under which the action will be taken.
-         * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2; - */ - public com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.Builder getConditionBuilder() { - - onChanged(); - return getConditionFieldBuilder().getBuilder(); - } - /** - * - * - *
-         * The condition(s) under which the action will be taken.
-         * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2; - */ - public com.google.storage.v2.Bucket.Lifecycle.Rule.ConditionOrBuilder - getConditionOrBuilder() { - if (conditionBuilder_ != null) { - return conditionBuilder_.getMessageOrBuilder(); - } else { - return condition_ == null - ? com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.getDefaultInstance() - : condition_; - } - } - /** - * - * - *
-         * The condition(s) under which the action will be taken.
-         * 
- * - * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Lifecycle.Rule.Condition, - com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.Builder, - com.google.storage.v2.Bucket.Lifecycle.Rule.ConditionOrBuilder> - getConditionFieldBuilder() { - if (conditionBuilder_ == null) { - conditionBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Lifecycle.Rule.Condition, - com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.Builder, - com.google.storage.v2.Bucket.Lifecycle.Rule.ConditionOrBuilder>( - getCondition(), getParentForChildren(), isClean()); - condition_ = null; - } - return conditionBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.Bucket.Lifecycle.Rule) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.Lifecycle.Rule) - private static final com.google.storage.v2.Bucket.Lifecycle.Rule DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.Lifecycle.Rule(); - } - - public static com.google.storage.v2.Bucket.Lifecycle.Rule getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Rule parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Rule(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Lifecycle.Rule getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public static final int RULE_FIELD_NUMBER = 1; - private java.util.List rule_; - /** - * - * - *
-     * A lifecycle management rule, which is made of an action to take and the
-     * condition(s) under which the action will be taken.
-     * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - @java.lang.Override - public java.util.List getRuleList() { - return rule_; - } - /** - * - * - *
-     * A lifecycle management rule, which is made of an action to take and the
-     * condition(s) under which the action will be taken.
-     * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - @java.lang.Override - public java.util.List - getRuleOrBuilderList() { - return rule_; - } - /** - * - * - *
-     * A lifecycle management rule, which is made of an action to take and the
-     * condition(s) under which the action will be taken.
-     * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - @java.lang.Override - public int getRuleCount() { - return rule_.size(); - } - /** - * - * - *
-     * A lifecycle management rule, which is made of an action to take and the
-     * condition(s) under which the action will be taken.
-     * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - @java.lang.Override - public com.google.storage.v2.Bucket.Lifecycle.Rule getRule(int index) { - return rule_.get(index); - } - /** - * - * - *
-     * A lifecycle management rule, which is made of an action to take and the
-     * condition(s) under which the action will be taken.
-     * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - @java.lang.Override - public com.google.storage.v2.Bucket.Lifecycle.RuleOrBuilder getRuleOrBuilder(int index) { - return rule_.get(index); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < rule_.size(); i++) { - output.writeMessage(1, rule_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < rule_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, rule_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.Bucket.Lifecycle)) { - return super.equals(obj); - } - com.google.storage.v2.Bucket.Lifecycle other = (com.google.storage.v2.Bucket.Lifecycle) obj; - - if (!getRuleList().equals(other.getRuleList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getRuleCount() > 0) { - hash = (37 * hash) + RULE_FIELD_NUMBER; - hash = (53 * hash) + getRuleList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.Bucket.Lifecycle parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Lifecycle parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Lifecycle parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Lifecycle parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Lifecycle parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Lifecycle parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Lifecycle parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Lifecycle parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Lifecycle parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Lifecycle parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Lifecycle parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Lifecycle parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.Bucket.Lifecycle prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * Lifecycle properties of a bucket.
-     * For more information, see https://cloud.google.com/storage/docs/lifecycle.
-     * 
- * - * Protobuf type {@code google.storage.v2.Bucket.Lifecycle} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.Lifecycle) - com.google.storage.v2.Bucket.LifecycleOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Lifecycle_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Lifecycle_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.Lifecycle.class, - com.google.storage.v2.Bucket.Lifecycle.Builder.class); - } - - // Construct using com.google.storage.v2.Bucket.Lifecycle.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getRuleFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (ruleBuilder_ == null) { - rule_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ruleBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Lifecycle_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Lifecycle getDefaultInstanceForType() { - return com.google.storage.v2.Bucket.Lifecycle.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Lifecycle build() { - com.google.storage.v2.Bucket.Lifecycle result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Lifecycle buildPartial() { - com.google.storage.v2.Bucket.Lifecycle result = - new com.google.storage.v2.Bucket.Lifecycle(this); - int from_bitField0_ = bitField0_; - if (ruleBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - rule_ = java.util.Collections.unmodifiableList(rule_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.rule_ = rule_; - } else { - result.rule_ = ruleBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.Bucket.Lifecycle) { - return mergeFrom((com.google.storage.v2.Bucket.Lifecycle) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.Bucket.Lifecycle other) { - if (other == com.google.storage.v2.Bucket.Lifecycle.getDefaultInstance()) return this; - if (ruleBuilder_ == null) { - if (!other.rule_.isEmpty()) { - if (rule_.isEmpty()) { - rule_ = other.rule_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureRuleIsMutable(); - rule_.addAll(other.rule_); - } - onChanged(); - } - } else { - if (!other.rule_.isEmpty()) { - if (ruleBuilder_.isEmpty()) { - ruleBuilder_.dispose(); - ruleBuilder_ = null; - rule_ = other.rule_; - bitField0_ = (bitField0_ & ~0x00000001); - ruleBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getRuleFieldBuilder() - : null; - } else { - ruleBuilder_.addAllMessages(other.rule_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.Bucket.Lifecycle parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.Bucket.Lifecycle) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.util.List rule_ = - java.util.Collections.emptyList(); - - private void ensureRuleIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - rule_ = new java.util.ArrayList(rule_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.Bucket.Lifecycle.Rule, - com.google.storage.v2.Bucket.Lifecycle.Rule.Builder, - com.google.storage.v2.Bucket.Lifecycle.RuleOrBuilder> - ruleBuilder_; - - /** - * - * - *
-       * A lifecycle management rule, which is made of an action to take and the
-       * condition(s) under which the action will be taken.
-       * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - public java.util.List getRuleList() { - if (ruleBuilder_ == null) { - return java.util.Collections.unmodifiableList(rule_); - } else { - return ruleBuilder_.getMessageList(); - } - } - /** - * - * - *
-       * A lifecycle management rule, which is made of an action to take and the
-       * condition(s) under which the action will be taken.
-       * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - public int getRuleCount() { - if (ruleBuilder_ == null) { - return rule_.size(); - } else { - return ruleBuilder_.getCount(); - } - } - /** - * - * - *
-       * A lifecycle management rule, which is made of an action to take and the
-       * condition(s) under which the action will be taken.
-       * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - public com.google.storage.v2.Bucket.Lifecycle.Rule getRule(int index) { - if (ruleBuilder_ == null) { - return rule_.get(index); - } else { - return ruleBuilder_.getMessage(index); - } - } - /** - * - * - *
-       * A lifecycle management rule, which is made of an action to take and the
-       * condition(s) under which the action will be taken.
-       * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - public Builder setRule(int index, com.google.storage.v2.Bucket.Lifecycle.Rule value) { - if (ruleBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRuleIsMutable(); - rule_.set(index, value); - onChanged(); - } else { - ruleBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-       * A lifecycle management rule, which is made of an action to take and the
-       * condition(s) under which the action will be taken.
-       * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - public Builder setRule( - int index, com.google.storage.v2.Bucket.Lifecycle.Rule.Builder builderForValue) { - if (ruleBuilder_ == null) { - ensureRuleIsMutable(); - rule_.set(index, builderForValue.build()); - onChanged(); - } else { - ruleBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * A lifecycle management rule, which is made of an action to take and the
-       * condition(s) under which the action will be taken.
-       * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - public Builder addRule(com.google.storage.v2.Bucket.Lifecycle.Rule value) { - if (ruleBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRuleIsMutable(); - rule_.add(value); - onChanged(); - } else { - ruleBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-       * A lifecycle management rule, which is made of an action to take and the
-       * condition(s) under which the action will be taken.
-       * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - public Builder addRule(int index, com.google.storage.v2.Bucket.Lifecycle.Rule value) { - if (ruleBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRuleIsMutable(); - rule_.add(index, value); - onChanged(); - } else { - ruleBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-       * A lifecycle management rule, which is made of an action to take and the
-       * condition(s) under which the action will be taken.
-       * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - public Builder addRule(com.google.storage.v2.Bucket.Lifecycle.Rule.Builder builderForValue) { - if (ruleBuilder_ == null) { - ensureRuleIsMutable(); - rule_.add(builderForValue.build()); - onChanged(); - } else { - ruleBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * A lifecycle management rule, which is made of an action to take and the
-       * condition(s) under which the action will be taken.
-       * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - public Builder addRule( - int index, com.google.storage.v2.Bucket.Lifecycle.Rule.Builder builderForValue) { - if (ruleBuilder_ == null) { - ensureRuleIsMutable(); - rule_.add(index, builderForValue.build()); - onChanged(); - } else { - ruleBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * A lifecycle management rule, which is made of an action to take and the
-       * condition(s) under which the action will be taken.
-       * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - public Builder addAllRule( - java.lang.Iterable values) { - if (ruleBuilder_ == null) { - ensureRuleIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rule_); - onChanged(); - } else { - ruleBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-       * A lifecycle management rule, which is made of an action to take and the
-       * condition(s) under which the action will be taken.
-       * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - public Builder clearRule() { - if (ruleBuilder_ == null) { - rule_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - ruleBuilder_.clear(); - } - return this; - } - /** - * - * - *
-       * A lifecycle management rule, which is made of an action to take and the
-       * condition(s) under which the action will be taken.
-       * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - public Builder removeRule(int index) { - if (ruleBuilder_ == null) { - ensureRuleIsMutable(); - rule_.remove(index); - onChanged(); - } else { - ruleBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-       * A lifecycle management rule, which is made of an action to take and the
-       * condition(s) under which the action will be taken.
-       * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - public com.google.storage.v2.Bucket.Lifecycle.Rule.Builder getRuleBuilder(int index) { - return getRuleFieldBuilder().getBuilder(index); - } - /** - * - * - *
-       * A lifecycle management rule, which is made of an action to take and the
-       * condition(s) under which the action will be taken.
-       * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - public com.google.storage.v2.Bucket.Lifecycle.RuleOrBuilder getRuleOrBuilder(int index) { - if (ruleBuilder_ == null) { - return rule_.get(index); - } else { - return ruleBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-       * A lifecycle management rule, which is made of an action to take and the
-       * condition(s) under which the action will be taken.
-       * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - public java.util.List - getRuleOrBuilderList() { - if (ruleBuilder_ != null) { - return ruleBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(rule_); - } - } - /** - * - * - *
-       * A lifecycle management rule, which is made of an action to take and the
-       * condition(s) under which the action will be taken.
-       * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - public com.google.storage.v2.Bucket.Lifecycle.Rule.Builder addRuleBuilder() { - return getRuleFieldBuilder() - .addBuilder(com.google.storage.v2.Bucket.Lifecycle.Rule.getDefaultInstance()); - } - /** - * - * - *
-       * A lifecycle management rule, which is made of an action to take and the
-       * condition(s) under which the action will be taken.
-       * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - public com.google.storage.v2.Bucket.Lifecycle.Rule.Builder addRuleBuilder(int index) { - return getRuleFieldBuilder() - .addBuilder(index, com.google.storage.v2.Bucket.Lifecycle.Rule.getDefaultInstance()); - } - /** - * - * - *
-       * A lifecycle management rule, which is made of an action to take and the
-       * condition(s) under which the action will be taken.
-       * 
- * - * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1; - */ - public java.util.List - getRuleBuilderList() { - return getRuleFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.Bucket.Lifecycle.Rule, - com.google.storage.v2.Bucket.Lifecycle.Rule.Builder, - com.google.storage.v2.Bucket.Lifecycle.RuleOrBuilder> - getRuleFieldBuilder() { - if (ruleBuilder_ == null) { - ruleBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.Bucket.Lifecycle.Rule, - com.google.storage.v2.Bucket.Lifecycle.Rule.Builder, - com.google.storage.v2.Bucket.Lifecycle.RuleOrBuilder>( - rule_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - rule_ = null; - } - return ruleBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.Bucket.Lifecycle) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.Lifecycle) - private static final com.google.storage.v2.Bucket.Lifecycle DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.Lifecycle(); - } - - public static com.google.storage.v2.Bucket.Lifecycle getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Lifecycle parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Lifecycle(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Lifecycle getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface LoggingOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.Logging) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * The destination bucket where the current bucket's logs should be placed.
-     * 
- * - * string log_bucket = 1; - * - * @return The logBucket. - */ - java.lang.String getLogBucket(); - /** - * - * - *
-     * The destination bucket where the current bucket's logs should be placed.
-     * 
- * - * string log_bucket = 1; - * - * @return The bytes for logBucket. - */ - com.google.protobuf.ByteString getLogBucketBytes(); - - /** - * - * - *
-     * A prefix for log object names.
-     * 
- * - * string log_object_prefix = 2; - * - * @return The logObjectPrefix. - */ - java.lang.String getLogObjectPrefix(); - /** - * - * - *
-     * A prefix for log object names.
-     * 
- * - * string log_object_prefix = 2; - * - * @return The bytes for logObjectPrefix. - */ - com.google.protobuf.ByteString getLogObjectPrefixBytes(); - } - /** - * - * - *
-   * Logging-related properties of a bucket.
-   * 
- * - * Protobuf type {@code google.storage.v2.Bucket.Logging} - */ - public static final class Logging extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.Logging) - LoggingOrBuilder { - private static final long serialVersionUID = 0L; - // Use Logging.newBuilder() to construct. - private Logging(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Logging() { - logBucket_ = ""; - logObjectPrefix_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Logging(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Logging( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - logBucket_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - logObjectPrefix_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Logging_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Logging_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.Logging.class, - com.google.storage.v2.Bucket.Logging.Builder.class); - } - - public static final int LOG_BUCKET_FIELD_NUMBER = 1; - private volatile java.lang.Object logBucket_; - /** - * - * - *
-     * The destination bucket where the current bucket's logs should be placed.
-     * 
- * - * string log_bucket = 1; - * - * @return The logBucket. - */ - @java.lang.Override - public java.lang.String getLogBucket() { - java.lang.Object ref = logBucket_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - logBucket_ = s; - return s; - } - } - /** - * - * - *
-     * The destination bucket where the current bucket's logs should be placed.
-     * 
- * - * string log_bucket = 1; - * - * @return The bytes for logBucket. - */ - @java.lang.Override - public com.google.protobuf.ByteString getLogBucketBytes() { - java.lang.Object ref = logBucket_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - logBucket_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int LOG_OBJECT_PREFIX_FIELD_NUMBER = 2; - private volatile java.lang.Object logObjectPrefix_; - /** - * - * - *
-     * A prefix for log object names.
-     * 
- * - * string log_object_prefix = 2; - * - * @return The logObjectPrefix. - */ - @java.lang.Override - public java.lang.String getLogObjectPrefix() { - java.lang.Object ref = logObjectPrefix_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - logObjectPrefix_ = s; - return s; - } - } - /** - * - * - *
-     * A prefix for log object names.
-     * 
- * - * string log_object_prefix = 2; - * - * @return The bytes for logObjectPrefix. - */ - @java.lang.Override - public com.google.protobuf.ByteString getLogObjectPrefixBytes() { - java.lang.Object ref = logObjectPrefix_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - logObjectPrefix_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(logBucket_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, logBucket_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(logObjectPrefix_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, logObjectPrefix_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(logBucket_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, logBucket_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(logObjectPrefix_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, logObjectPrefix_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.Bucket.Logging)) { - return super.equals(obj); - } - com.google.storage.v2.Bucket.Logging other = (com.google.storage.v2.Bucket.Logging) obj; - - if (!getLogBucket().equals(other.getLogBucket())) return false; - if (!getLogObjectPrefix().equals(other.getLogObjectPrefix())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + LOG_BUCKET_FIELD_NUMBER; - hash = (53 * hash) + getLogBucket().hashCode(); - hash = (37 * hash) + LOG_OBJECT_PREFIX_FIELD_NUMBER; - hash = (53 * hash) + getLogObjectPrefix().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.Bucket.Logging parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Logging parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Logging parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Logging parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Logging parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Logging parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Logging parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Logging parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Logging parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Logging parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Logging parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Logging parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.Bucket.Logging prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * Logging-related properties of a bucket.
-     * 
- * - * Protobuf type {@code google.storage.v2.Bucket.Logging} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.Logging) - com.google.storage.v2.Bucket.LoggingOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Logging_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Logging_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.Logging.class, - com.google.storage.v2.Bucket.Logging.Builder.class); - } - - // Construct using com.google.storage.v2.Bucket.Logging.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - logBucket_ = ""; - - logObjectPrefix_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Logging_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Logging getDefaultInstanceForType() { - return com.google.storage.v2.Bucket.Logging.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Logging build() { - com.google.storage.v2.Bucket.Logging result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Logging buildPartial() { - com.google.storage.v2.Bucket.Logging result = - new com.google.storage.v2.Bucket.Logging(this); - result.logBucket_ = logBucket_; - result.logObjectPrefix_ = logObjectPrefix_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.Bucket.Logging) { - return mergeFrom((com.google.storage.v2.Bucket.Logging) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.Bucket.Logging other) { - if (other == com.google.storage.v2.Bucket.Logging.getDefaultInstance()) return this; - if (!other.getLogBucket().isEmpty()) { - logBucket_ = other.logBucket_; - onChanged(); - } - if (!other.getLogObjectPrefix().isEmpty()) { - logObjectPrefix_ = other.logObjectPrefix_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.Bucket.Logging parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.Bucket.Logging) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object logBucket_ = ""; - /** - * - * - *
-       * The destination bucket where the current bucket's logs should be placed.
-       * 
- * - * string log_bucket = 1; - * - * @return The logBucket. - */ - public java.lang.String getLogBucket() { - java.lang.Object ref = logBucket_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - logBucket_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * The destination bucket where the current bucket's logs should be placed.
-       * 
- * - * string log_bucket = 1; - * - * @return The bytes for logBucket. - */ - public com.google.protobuf.ByteString getLogBucketBytes() { - java.lang.Object ref = logBucket_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - logBucket_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * The destination bucket where the current bucket's logs should be placed.
-       * 
- * - * string log_bucket = 1; - * - * @param value The logBucket to set. - * @return This builder for chaining. - */ - public Builder setLogBucket(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - logBucket_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * The destination bucket where the current bucket's logs should be placed.
-       * 
- * - * string log_bucket = 1; - * - * @return This builder for chaining. - */ - public Builder clearLogBucket() { - - logBucket_ = getDefaultInstance().getLogBucket(); - onChanged(); - return this; - } - /** - * - * - *
-       * The destination bucket where the current bucket's logs should be placed.
-       * 
- * - * string log_bucket = 1; - * - * @param value The bytes for logBucket to set. - * @return This builder for chaining. - */ - public Builder setLogBucketBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - logBucket_ = value; - onChanged(); - return this; - } - - private java.lang.Object logObjectPrefix_ = ""; - /** - * - * - *
-       * A prefix for log object names.
-       * 
- * - * string log_object_prefix = 2; - * - * @return The logObjectPrefix. - */ - public java.lang.String getLogObjectPrefix() { - java.lang.Object ref = logObjectPrefix_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - logObjectPrefix_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * A prefix for log object names.
-       * 
- * - * string log_object_prefix = 2; - * - * @return The bytes for logObjectPrefix. - */ - public com.google.protobuf.ByteString getLogObjectPrefixBytes() { - java.lang.Object ref = logObjectPrefix_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - logObjectPrefix_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * A prefix for log object names.
-       * 
- * - * string log_object_prefix = 2; - * - * @param value The logObjectPrefix to set. - * @return This builder for chaining. - */ - public Builder setLogObjectPrefix(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - logObjectPrefix_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * A prefix for log object names.
-       * 
- * - * string log_object_prefix = 2; - * - * @return This builder for chaining. - */ - public Builder clearLogObjectPrefix() { - - logObjectPrefix_ = getDefaultInstance().getLogObjectPrefix(); - onChanged(); - return this; - } - /** - * - * - *
-       * A prefix for log object names.
-       * 
- * - * string log_object_prefix = 2; - * - * @param value The bytes for logObjectPrefix to set. - * @return This builder for chaining. - */ - public Builder setLogObjectPrefixBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - logObjectPrefix_ = value; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.Bucket.Logging) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.Logging) - private static final com.google.storage.v2.Bucket.Logging DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.Logging(); - } - - public static com.google.storage.v2.Bucket.Logging getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Logging parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Logging(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Logging getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface RetentionPolicyOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.RetentionPolicy) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Server-determined value that indicates the time from which policy was
-     * enforced and effective. This value is in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * 
- * - * .google.protobuf.Timestamp effective_time = 1; - * - * @return Whether the effectiveTime field is set. - */ - boolean hasEffectiveTime(); - /** - * - * - *
-     * Server-determined value that indicates the time from which policy was
-     * enforced and effective. This value is in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * 
- * - * .google.protobuf.Timestamp effective_time = 1; - * - * @return The effectiveTime. - */ - com.google.protobuf.Timestamp getEffectiveTime(); - /** - * - * - *
-     * Server-determined value that indicates the time from which policy was
-     * enforced and effective. This value is in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * 
- * - * .google.protobuf.Timestamp effective_time = 1; - */ - com.google.protobuf.TimestampOrBuilder getEffectiveTimeOrBuilder(); - - /** - * - * - *
-     * Once locked, an object retention policy cannot be modified.
-     * 
- * - * bool is_locked = 2; - * - * @return The isLocked. - */ - boolean getIsLocked(); - - /** - * - * - *
-     * The duration in seconds that objects need to be retained. Retention
-     * duration must be greater than zero and less than 100 years. Note that
-     * enforcement of retention periods less than a day is not guaranteed. Such
-     * periods should only be used for testing purposes.
-     * 
- * - * int64 retention_period = 3; - * - * @return The retentionPeriod. - */ - long getRetentionPeriod(); - } - /** - * - * - *
-   * Retention policy properties of a bucket.
-   * 
- * - * Protobuf type {@code google.storage.v2.Bucket.RetentionPolicy} - */ - public static final class RetentionPolicy extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.RetentionPolicy) - RetentionPolicyOrBuilder { - private static final long serialVersionUID = 0L; - // Use RetentionPolicy.newBuilder() to construct. - private RetentionPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private RetentionPolicy() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RetentionPolicy(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private RetentionPolicy( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (effectiveTime_ != null) { - subBuilder = effectiveTime_.toBuilder(); - } - effectiveTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(effectiveTime_); - effectiveTime_ = subBuilder.buildPartial(); - } - - break; - } - case 16: - { - isLocked_ = input.readBool(); - break; - } - case 24: - { - retentionPeriod_ = input.readInt64(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_RetentionPolicy_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_RetentionPolicy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.RetentionPolicy.class, - com.google.storage.v2.Bucket.RetentionPolicy.Builder.class); - } - - public static final int EFFECTIVE_TIME_FIELD_NUMBER = 1; - private com.google.protobuf.Timestamp effectiveTime_; - /** - * - * - *
-     * Server-determined value that indicates the time from which policy was
-     * enforced and effective. This value is in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * 
- * - * .google.protobuf.Timestamp effective_time = 1; - * - * @return Whether the effectiveTime field is set. - */ - @java.lang.Override - public boolean hasEffectiveTime() { - return effectiveTime_ != null; - } - /** - * - * - *
-     * Server-determined value that indicates the time from which policy was
-     * enforced and effective. This value is in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * 
- * - * .google.protobuf.Timestamp effective_time = 1; - * - * @return The effectiveTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getEffectiveTime() { - return effectiveTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : effectiveTime_; - } - /** - * - * - *
-     * Server-determined value that indicates the time from which policy was
-     * enforced and effective. This value is in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * 
- * - * .google.protobuf.Timestamp effective_time = 1; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getEffectiveTimeOrBuilder() { - return getEffectiveTime(); - } - - public static final int IS_LOCKED_FIELD_NUMBER = 2; - private boolean isLocked_; - /** - * - * - *
-     * Once locked, an object retention policy cannot be modified.
-     * 
- * - * bool is_locked = 2; - * - * @return The isLocked. - */ - @java.lang.Override - public boolean getIsLocked() { - return isLocked_; - } - - public static final int RETENTION_PERIOD_FIELD_NUMBER = 3; - private long retentionPeriod_; - /** - * - * - *
-     * The duration in seconds that objects need to be retained. Retention
-     * duration must be greater than zero and less than 100 years. Note that
-     * enforcement of retention periods less than a day is not guaranteed. Such
-     * periods should only be used for testing purposes.
-     * 
- * - * int64 retention_period = 3; - * - * @return The retentionPeriod. - */ - @java.lang.Override - public long getRetentionPeriod() { - return retentionPeriod_; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (effectiveTime_ != null) { - output.writeMessage(1, getEffectiveTime()); - } - if (isLocked_ != false) { - output.writeBool(2, isLocked_); - } - if (retentionPeriod_ != 0L) { - output.writeInt64(3, retentionPeriod_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (effectiveTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getEffectiveTime()); - } - if (isLocked_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, isLocked_); - } - if (retentionPeriod_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, retentionPeriod_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.Bucket.RetentionPolicy)) { - return super.equals(obj); - } - com.google.storage.v2.Bucket.RetentionPolicy other = - (com.google.storage.v2.Bucket.RetentionPolicy) obj; - - if (hasEffectiveTime() != other.hasEffectiveTime()) return false; - if (hasEffectiveTime()) { - if (!getEffectiveTime().equals(other.getEffectiveTime())) return false; - } - if (getIsLocked() != other.getIsLocked()) return false; - if (getRetentionPeriod() != other.getRetentionPeriod()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasEffectiveTime()) { - hash = (37 * hash) + EFFECTIVE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getEffectiveTime().hashCode(); - } - hash = (37 * hash) + IS_LOCKED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsLocked()); - hash = (37 * hash) + RETENTION_PERIOD_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRetentionPeriod()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.Bucket.RetentionPolicy parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.RetentionPolicy parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.RetentionPolicy parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.RetentionPolicy parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.RetentionPolicy parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.RetentionPolicy parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.RetentionPolicy parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.RetentionPolicy parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.RetentionPolicy parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.RetentionPolicy parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.RetentionPolicy parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.RetentionPolicy parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.Bucket.RetentionPolicy prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * Retention policy properties of a bucket.
-     * 
- * - * Protobuf type {@code google.storage.v2.Bucket.RetentionPolicy} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.RetentionPolicy) - com.google.storage.v2.Bucket.RetentionPolicyOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_RetentionPolicy_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_RetentionPolicy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.RetentionPolicy.class, - com.google.storage.v2.Bucket.RetentionPolicy.Builder.class); - } - - // Construct using com.google.storage.v2.Bucket.RetentionPolicy.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (effectiveTimeBuilder_ == null) { - effectiveTime_ = null; - } else { - effectiveTime_ = null; - effectiveTimeBuilder_ = null; - } - isLocked_ = false; - - retentionPeriod_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_RetentionPolicy_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.RetentionPolicy getDefaultInstanceForType() { - return com.google.storage.v2.Bucket.RetentionPolicy.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.Bucket.RetentionPolicy build() { - com.google.storage.v2.Bucket.RetentionPolicy result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.RetentionPolicy buildPartial() { - com.google.storage.v2.Bucket.RetentionPolicy result = - new com.google.storage.v2.Bucket.RetentionPolicy(this); - if (effectiveTimeBuilder_ == null) { - result.effectiveTime_ = effectiveTime_; - } else { - result.effectiveTime_ = effectiveTimeBuilder_.build(); - } - result.isLocked_ = isLocked_; - result.retentionPeriod_ = retentionPeriod_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.Bucket.RetentionPolicy) { - return mergeFrom((com.google.storage.v2.Bucket.RetentionPolicy) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.Bucket.RetentionPolicy other) { - if (other == com.google.storage.v2.Bucket.RetentionPolicy.getDefaultInstance()) return this; - if (other.hasEffectiveTime()) { - mergeEffectiveTime(other.getEffectiveTime()); - } - if (other.getIsLocked() != false) { - setIsLocked(other.getIsLocked()); - } - if (other.getRetentionPeriod() != 0L) { - setRetentionPeriod(other.getRetentionPeriod()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.Bucket.RetentionPolicy parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.Bucket.RetentionPolicy) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.protobuf.Timestamp effectiveTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - effectiveTimeBuilder_; - /** - * - * - *
-       * Server-determined value that indicates the time from which policy was
-       * enforced and effective. This value is in
-       * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-       * 
- * - * .google.protobuf.Timestamp effective_time = 1; - * - * @return Whether the effectiveTime field is set. - */ - public boolean hasEffectiveTime() { - return effectiveTimeBuilder_ != null || effectiveTime_ != null; - } - /** - * - * - *
-       * Server-determined value that indicates the time from which policy was
-       * enforced and effective. This value is in
-       * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-       * 
- * - * .google.protobuf.Timestamp effective_time = 1; - * - * @return The effectiveTime. - */ - public com.google.protobuf.Timestamp getEffectiveTime() { - if (effectiveTimeBuilder_ == null) { - return effectiveTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : effectiveTime_; - } else { - return effectiveTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Server-determined value that indicates the time from which policy was
-       * enforced and effective. This value is in
-       * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-       * 
- * - * .google.protobuf.Timestamp effective_time = 1; - */ - public Builder setEffectiveTime(com.google.protobuf.Timestamp value) { - if (effectiveTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - effectiveTime_ = value; - onChanged(); - } else { - effectiveTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-       * Server-determined value that indicates the time from which policy was
-       * enforced and effective. This value is in
-       * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-       * 
- * - * .google.protobuf.Timestamp effective_time = 1; - */ - public Builder setEffectiveTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (effectiveTimeBuilder_ == null) { - effectiveTime_ = builderForValue.build(); - onChanged(); - } else { - effectiveTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-       * Server-determined value that indicates the time from which policy was
-       * enforced and effective. This value is in
-       * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-       * 
- * - * .google.protobuf.Timestamp effective_time = 1; - */ - public Builder mergeEffectiveTime(com.google.protobuf.Timestamp value) { - if (effectiveTimeBuilder_ == null) { - if (effectiveTime_ != null) { - effectiveTime_ = - com.google.protobuf.Timestamp.newBuilder(effectiveTime_) - .mergeFrom(value) - .buildPartial(); - } else { - effectiveTime_ = value; - } - onChanged(); - } else { - effectiveTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-       * Server-determined value that indicates the time from which policy was
-       * enforced and effective. This value is in
-       * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-       * 
- * - * .google.protobuf.Timestamp effective_time = 1; - */ - public Builder clearEffectiveTime() { - if (effectiveTimeBuilder_ == null) { - effectiveTime_ = null; - onChanged(); - } else { - effectiveTime_ = null; - effectiveTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-       * Server-determined value that indicates the time from which policy was
-       * enforced and effective. This value is in
-       * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-       * 
- * - * .google.protobuf.Timestamp effective_time = 1; - */ - public com.google.protobuf.Timestamp.Builder getEffectiveTimeBuilder() { - - onChanged(); - return getEffectiveTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Server-determined value that indicates the time from which policy was
-       * enforced and effective. This value is in
-       * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-       * 
- * - * .google.protobuf.Timestamp effective_time = 1; - */ - public com.google.protobuf.TimestampOrBuilder getEffectiveTimeOrBuilder() { - if (effectiveTimeBuilder_ != null) { - return effectiveTimeBuilder_.getMessageOrBuilder(); - } else { - return effectiveTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : effectiveTime_; - } - } - /** - * - * - *
-       * Server-determined value that indicates the time from which policy was
-       * enforced and effective. This value is in
-       * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-       * 
- * - * .google.protobuf.Timestamp effective_time = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getEffectiveTimeFieldBuilder() { - if (effectiveTimeBuilder_ == null) { - effectiveTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getEffectiveTime(), getParentForChildren(), isClean()); - effectiveTime_ = null; - } - return effectiveTimeBuilder_; - } - - private boolean isLocked_; - /** - * - * - *
-       * Once locked, an object retention policy cannot be modified.
-       * 
- * - * bool is_locked = 2; - * - * @return The isLocked. - */ - @java.lang.Override - public boolean getIsLocked() { - return isLocked_; - } - /** - * - * - *
-       * Once locked, an object retention policy cannot be modified.
-       * 
- * - * bool is_locked = 2; - * - * @param value The isLocked to set. - * @return This builder for chaining. - */ - public Builder setIsLocked(boolean value) { - - isLocked_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Once locked, an object retention policy cannot be modified.
-       * 
- * - * bool is_locked = 2; - * - * @return This builder for chaining. - */ - public Builder clearIsLocked() { - - isLocked_ = false; - onChanged(); - return this; - } - - private long retentionPeriod_; - /** - * - * - *
-       * The duration in seconds that objects need to be retained. Retention
-       * duration must be greater than zero and less than 100 years. Note that
-       * enforcement of retention periods less than a day is not guaranteed. Such
-       * periods should only be used for testing purposes.
-       * 
- * - * int64 retention_period = 3; - * - * @return The retentionPeriod. - */ - @java.lang.Override - public long getRetentionPeriod() { - return retentionPeriod_; - } - /** - * - * - *
-       * The duration in seconds that objects need to be retained. Retention
-       * duration must be greater than zero and less than 100 years. Note that
-       * enforcement of retention periods less than a day is not guaranteed. Such
-       * periods should only be used for testing purposes.
-       * 
- * - * int64 retention_period = 3; - * - * @param value The retentionPeriod to set. - * @return This builder for chaining. - */ - public Builder setRetentionPeriod(long value) { - - retentionPeriod_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * The duration in seconds that objects need to be retained. Retention
-       * duration must be greater than zero and less than 100 years. Note that
-       * enforcement of retention periods less than a day is not guaranteed. Such
-       * periods should only be used for testing purposes.
-       * 
- * - * int64 retention_period = 3; - * - * @return This builder for chaining. - */ - public Builder clearRetentionPeriod() { - - retentionPeriod_ = 0L; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.Bucket.RetentionPolicy) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.RetentionPolicy) - private static final com.google.storage.v2.Bucket.RetentionPolicy DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.RetentionPolicy(); - } - - public static com.google.storage.v2.Bucket.RetentionPolicy getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RetentionPolicy parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RetentionPolicy(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.RetentionPolicy getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface VersioningOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.Versioning) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * While set to true, versioning is fully enabled for this bucket.
-     * 
- * - * bool enabled = 1; - * - * @return The enabled. - */ - boolean getEnabled(); - } - /** - * - * - *
-   * Properties of a bucket related to versioning.
-   * For more on Cloud Storage versioning, see
-   * https://cloud.google.com/storage/docs/object-versioning.
-   * 
- * - * Protobuf type {@code google.storage.v2.Bucket.Versioning} - */ - public static final class Versioning extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.Versioning) - VersioningOrBuilder { - private static final long serialVersionUID = 0L; - // Use Versioning.newBuilder() to construct. - private Versioning(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Versioning() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Versioning(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Versioning( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - enabled_ = input.readBool(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Versioning_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Versioning_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.Versioning.class, - com.google.storage.v2.Bucket.Versioning.Builder.class); - } - - public static final int ENABLED_FIELD_NUMBER = 1; - private boolean enabled_; - /** - * - * - *
-     * While set to true, versioning is fully enabled for this bucket.
-     * 
- * - * bool enabled = 1; - * - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (enabled_ != false) { - output.writeBool(1, enabled_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (enabled_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, enabled_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.Bucket.Versioning)) { - return super.equals(obj); - } - com.google.storage.v2.Bucket.Versioning other = (com.google.storage.v2.Bucket.Versioning) obj; - - if (getEnabled() != other.getEnabled()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ENABLED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnabled()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.Bucket.Versioning parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Versioning parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Versioning parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Versioning parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Versioning parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Versioning parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Versioning parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Versioning parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Versioning parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Versioning parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Versioning parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Versioning parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.Bucket.Versioning prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * Properties of a bucket related to versioning.
-     * For more on Cloud Storage versioning, see
-     * https://cloud.google.com/storage/docs/object-versioning.
-     * 
- * - * Protobuf type {@code google.storage.v2.Bucket.Versioning} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.Versioning) - com.google.storage.v2.Bucket.VersioningOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Versioning_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Versioning_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.Versioning.class, - com.google.storage.v2.Bucket.Versioning.Builder.class); - } - - // Construct using com.google.storage.v2.Bucket.Versioning.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - enabled_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Versioning_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Versioning getDefaultInstanceForType() { - return com.google.storage.v2.Bucket.Versioning.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Versioning build() { - com.google.storage.v2.Bucket.Versioning result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Versioning buildPartial() { - com.google.storage.v2.Bucket.Versioning result = - new com.google.storage.v2.Bucket.Versioning(this); - result.enabled_ = enabled_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.Bucket.Versioning) { - return mergeFrom((com.google.storage.v2.Bucket.Versioning) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.Bucket.Versioning other) { - if (other == com.google.storage.v2.Bucket.Versioning.getDefaultInstance()) return this; - if (other.getEnabled() != false) { - setEnabled(other.getEnabled()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.Bucket.Versioning parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.Bucket.Versioning) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private boolean enabled_; - /** - * - * - *
-       * While set to true, versioning is fully enabled for this bucket.
-       * 
- * - * bool enabled = 1; - * - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - /** - * - * - *
-       * While set to true, versioning is fully enabled for this bucket.
-       * 
- * - * bool enabled = 1; - * - * @param value The enabled to set. - * @return This builder for chaining. - */ - public Builder setEnabled(boolean value) { - - enabled_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * While set to true, versioning is fully enabled for this bucket.
-       * 
- * - * bool enabled = 1; - * - * @return This builder for chaining. - */ - public Builder clearEnabled() { - - enabled_ = false; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.Bucket.Versioning) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.Versioning) - private static final com.google.storage.v2.Bucket.Versioning DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.Versioning(); - } - - public static com.google.storage.v2.Bucket.Versioning getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Versioning parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Versioning(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Versioning getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface WebsiteOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.Website) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * If the requested object path is missing, the service will ensure the path
-     * has a trailing '/', append this suffix, and attempt to retrieve the
-     * resulting object. This allows the creation of `index.html`
-     * objects to represent directory pages.
-     * 
- * - * string main_page_suffix = 1; - * - * @return The mainPageSuffix. - */ - java.lang.String getMainPageSuffix(); - /** - * - * - *
-     * If the requested object path is missing, the service will ensure the path
-     * has a trailing '/', append this suffix, and attempt to retrieve the
-     * resulting object. This allows the creation of `index.html`
-     * objects to represent directory pages.
-     * 
- * - * string main_page_suffix = 1; - * - * @return The bytes for mainPageSuffix. - */ - com.google.protobuf.ByteString getMainPageSuffixBytes(); - - /** - * - * - *
-     * If the requested object path is missing, and any
-     * `mainPageSuffix` object is missing, if applicable, the service
-     * will return the named object from this bucket as the content for a
-     * [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found]
-     * result.
-     * 
- * - * string not_found_page = 2; - * - * @return The notFoundPage. - */ - java.lang.String getNotFoundPage(); - /** - * - * - *
-     * If the requested object path is missing, and any
-     * `mainPageSuffix` object is missing, if applicable, the service
-     * will return the named object from this bucket as the content for a
-     * [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found]
-     * result.
-     * 
- * - * string not_found_page = 2; - * - * @return The bytes for notFoundPage. - */ - com.google.protobuf.ByteString getNotFoundPageBytes(); - } - /** - * - * - *
-   * Properties of a bucket related to accessing the contents as a static
-   * website. For more on hosting a static website via Cloud Storage, see
-   * https://cloud.google.com/storage/docs/hosting-static-website.
-   * 
- * - * Protobuf type {@code google.storage.v2.Bucket.Website} - */ - public static final class Website extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.Website) - WebsiteOrBuilder { - private static final long serialVersionUID = 0L; - // Use Website.newBuilder() to construct. - private Website(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Website() { - mainPageSuffix_ = ""; - notFoundPage_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Website(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Website( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - mainPageSuffix_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - notFoundPage_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Website_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Website_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.Website.class, - com.google.storage.v2.Bucket.Website.Builder.class); - } - - public static final int MAIN_PAGE_SUFFIX_FIELD_NUMBER = 1; - private volatile java.lang.Object mainPageSuffix_; - /** - * - * - *
-     * If the requested object path is missing, the service will ensure the path
-     * has a trailing '/', append this suffix, and attempt to retrieve the
-     * resulting object. This allows the creation of `index.html`
-     * objects to represent directory pages.
-     * 
- * - * string main_page_suffix = 1; - * - * @return The mainPageSuffix. - */ - @java.lang.Override - public java.lang.String getMainPageSuffix() { - java.lang.Object ref = mainPageSuffix_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - mainPageSuffix_ = s; - return s; - } - } - /** - * - * - *
-     * If the requested object path is missing, the service will ensure the path
-     * has a trailing '/', append this suffix, and attempt to retrieve the
-     * resulting object. This allows the creation of `index.html`
-     * objects to represent directory pages.
-     * 
- * - * string main_page_suffix = 1; - * - * @return The bytes for mainPageSuffix. - */ - @java.lang.Override - public com.google.protobuf.ByteString getMainPageSuffixBytes() { - java.lang.Object ref = mainPageSuffix_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - mainPageSuffix_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int NOT_FOUND_PAGE_FIELD_NUMBER = 2; - private volatile java.lang.Object notFoundPage_; - /** - * - * - *
-     * If the requested object path is missing, and any
-     * `mainPageSuffix` object is missing, if applicable, the service
-     * will return the named object from this bucket as the content for a
-     * [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found]
-     * result.
-     * 
- * - * string not_found_page = 2; - * - * @return The notFoundPage. - */ - @java.lang.Override - public java.lang.String getNotFoundPage() { - java.lang.Object ref = notFoundPage_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - notFoundPage_ = s; - return s; - } - } - /** - * - * - *
-     * If the requested object path is missing, and any
-     * `mainPageSuffix` object is missing, if applicable, the service
-     * will return the named object from this bucket as the content for a
-     * [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found]
-     * result.
-     * 
- * - * string not_found_page = 2; - * - * @return The bytes for notFoundPage. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNotFoundPageBytes() { - java.lang.Object ref = notFoundPage_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - notFoundPage_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mainPageSuffix_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mainPageSuffix_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(notFoundPage_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, notFoundPage_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mainPageSuffix_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mainPageSuffix_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(notFoundPage_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, notFoundPage_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.Bucket.Website)) { - return super.equals(obj); - } - com.google.storage.v2.Bucket.Website other = (com.google.storage.v2.Bucket.Website) obj; - - if (!getMainPageSuffix().equals(other.getMainPageSuffix())) return false; - if (!getNotFoundPage().equals(other.getNotFoundPage())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + MAIN_PAGE_SUFFIX_FIELD_NUMBER; - hash = (53 * hash) + getMainPageSuffix().hashCode(); - hash = (37 * hash) + NOT_FOUND_PAGE_FIELD_NUMBER; - hash = (53 * hash) + getNotFoundPage().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.Bucket.Website parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Website parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Website parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Website parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Website parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.Website parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Website parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Website parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Website parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Website parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.Website parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.Website parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.Bucket.Website prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * Properties of a bucket related to accessing the contents as a static
-     * website. For more on hosting a static website via Cloud Storage, see
-     * https://cloud.google.com/storage/docs/hosting-static-website.
-     * 
- * - * Protobuf type {@code google.storage.v2.Bucket.Website} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.Website) - com.google.storage.v2.Bucket.WebsiteOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Website_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Website_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.Website.class, - com.google.storage.v2.Bucket.Website.Builder.class); - } - - // Construct using com.google.storage.v2.Bucket.Website.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - mainPageSuffix_ = ""; - - notFoundPage_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_Website_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Website getDefaultInstanceForType() { - return com.google.storage.v2.Bucket.Website.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Website build() { - com.google.storage.v2.Bucket.Website result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Website buildPartial() { - com.google.storage.v2.Bucket.Website result = - new com.google.storage.v2.Bucket.Website(this); - result.mainPageSuffix_ = mainPageSuffix_; - result.notFoundPage_ = notFoundPage_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.Bucket.Website) { - return mergeFrom((com.google.storage.v2.Bucket.Website) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.Bucket.Website other) { - if (other == com.google.storage.v2.Bucket.Website.getDefaultInstance()) return this; - if (!other.getMainPageSuffix().isEmpty()) { - mainPageSuffix_ = other.mainPageSuffix_; - onChanged(); - } - if (!other.getNotFoundPage().isEmpty()) { - notFoundPage_ = other.notFoundPage_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.Bucket.Website parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.Bucket.Website) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object mainPageSuffix_ = ""; - /** - * - * - *
-       * If the requested object path is missing, the service will ensure the path
-       * has a trailing '/', append this suffix, and attempt to retrieve the
-       * resulting object. This allows the creation of `index.html`
-       * objects to represent directory pages.
-       * 
- * - * string main_page_suffix = 1; - * - * @return The mainPageSuffix. - */ - public java.lang.String getMainPageSuffix() { - java.lang.Object ref = mainPageSuffix_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - mainPageSuffix_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * If the requested object path is missing, the service will ensure the path
-       * has a trailing '/', append this suffix, and attempt to retrieve the
-       * resulting object. This allows the creation of `index.html`
-       * objects to represent directory pages.
-       * 
- * - * string main_page_suffix = 1; - * - * @return The bytes for mainPageSuffix. - */ - public com.google.protobuf.ByteString getMainPageSuffixBytes() { - java.lang.Object ref = mainPageSuffix_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - mainPageSuffix_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * If the requested object path is missing, the service will ensure the path
-       * has a trailing '/', append this suffix, and attempt to retrieve the
-       * resulting object. This allows the creation of `index.html`
-       * objects to represent directory pages.
-       * 
- * - * string main_page_suffix = 1; - * - * @param value The mainPageSuffix to set. - * @return This builder for chaining. - */ - public Builder setMainPageSuffix(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - mainPageSuffix_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * If the requested object path is missing, the service will ensure the path
-       * has a trailing '/', append this suffix, and attempt to retrieve the
-       * resulting object. This allows the creation of `index.html`
-       * objects to represent directory pages.
-       * 
- * - * string main_page_suffix = 1; - * - * @return This builder for chaining. - */ - public Builder clearMainPageSuffix() { - - mainPageSuffix_ = getDefaultInstance().getMainPageSuffix(); - onChanged(); - return this; - } - /** - * - * - *
-       * If the requested object path is missing, the service will ensure the path
-       * has a trailing '/', append this suffix, and attempt to retrieve the
-       * resulting object. This allows the creation of `index.html`
-       * objects to represent directory pages.
-       * 
- * - * string main_page_suffix = 1; - * - * @param value The bytes for mainPageSuffix to set. - * @return This builder for chaining. - */ - public Builder setMainPageSuffixBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - mainPageSuffix_ = value; - onChanged(); - return this; - } - - private java.lang.Object notFoundPage_ = ""; - /** - * - * - *
-       * If the requested object path is missing, and any
-       * `mainPageSuffix` object is missing, if applicable, the service
-       * will return the named object from this bucket as the content for a
-       * [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found]
-       * result.
-       * 
- * - * string not_found_page = 2; - * - * @return The notFoundPage. - */ - public java.lang.String getNotFoundPage() { - java.lang.Object ref = notFoundPage_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - notFoundPage_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * If the requested object path is missing, and any
-       * `mainPageSuffix` object is missing, if applicable, the service
-       * will return the named object from this bucket as the content for a
-       * [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found]
-       * result.
-       * 
- * - * string not_found_page = 2; - * - * @return The bytes for notFoundPage. - */ - public com.google.protobuf.ByteString getNotFoundPageBytes() { - java.lang.Object ref = notFoundPage_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - notFoundPage_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * If the requested object path is missing, and any
-       * `mainPageSuffix` object is missing, if applicable, the service
-       * will return the named object from this bucket as the content for a
-       * [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found]
-       * result.
-       * 
- * - * string not_found_page = 2; - * - * @param value The notFoundPage to set. - * @return This builder for chaining. - */ - public Builder setNotFoundPage(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - notFoundPage_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * If the requested object path is missing, and any
-       * `mainPageSuffix` object is missing, if applicable, the service
-       * will return the named object from this bucket as the content for a
-       * [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found]
-       * result.
-       * 
- * - * string not_found_page = 2; - * - * @return This builder for chaining. - */ - public Builder clearNotFoundPage() { - - notFoundPage_ = getDefaultInstance().getNotFoundPage(); - onChanged(); - return this; - } - /** - * - * - *
-       * If the requested object path is missing, and any
-       * `mainPageSuffix` object is missing, if applicable, the service
-       * will return the named object from this bucket as the content for a
-       * [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found]
-       * result.
-       * 
- * - * string not_found_page = 2; - * - * @param value The bytes for notFoundPage to set. - * @return This builder for chaining. - */ - public Builder setNotFoundPageBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - notFoundPage_ = value; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.Bucket.Website) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.Website) - private static final com.google.storage.v2.Bucket.Website DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.Website(); - } - - public static com.google.storage.v2.Bucket.Website getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Website parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Website(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.Website getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface CustomPlacementConfigOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.CustomPlacementConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * List of locations to use for data placement.
-     * 
- * - * repeated string data_locations = 1; - * - * @return A list containing the dataLocations. - */ - java.util.List getDataLocationsList(); - /** - * - * - *
-     * List of locations to use for data placement.
-     * 
- * - * repeated string data_locations = 1; - * - * @return The count of dataLocations. - */ - int getDataLocationsCount(); - /** - * - * - *
-     * List of locations to use for data placement.
-     * 
- * - * repeated string data_locations = 1; - * - * @param index The index of the element to return. - * @return The dataLocations at the given index. - */ - java.lang.String getDataLocations(int index); - /** - * - * - *
-     * List of locations to use for data placement.
-     * 
- * - * repeated string data_locations = 1; - * - * @param index The index of the value to return. - * @return The bytes of the dataLocations at the given index. - */ - com.google.protobuf.ByteString getDataLocationsBytes(int index); - } - /** - * - * - *
-   * Configuration for Custom Dual Regions.  It should specify precisely two
-   * eligible regions within the same Multiregion.
-   * 
- * - * Protobuf type {@code google.storage.v2.Bucket.CustomPlacementConfig} - */ - public static final class CustomPlacementConfig extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.CustomPlacementConfig) - CustomPlacementConfigOrBuilder { - private static final long serialVersionUID = 0L; - // Use CustomPlacementConfig.newBuilder() to construct. - private CustomPlacementConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CustomPlacementConfig() { - dataLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CustomPlacementConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CustomPlacementConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - dataLocations_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - dataLocations_.add(s); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - dataLocations_ = dataLocations_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_CustomPlacementConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_CustomPlacementConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.CustomPlacementConfig.class, - com.google.storage.v2.Bucket.CustomPlacementConfig.Builder.class); - } - - public static final int DATA_LOCATIONS_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList dataLocations_; - /** - * - * - *
-     * List of locations to use for data placement.
-     * 
- * - * repeated string data_locations = 1; - * - * @return A list containing the dataLocations. - */ - public com.google.protobuf.ProtocolStringList getDataLocationsList() { - return dataLocations_; - } - /** - * - * - *
-     * List of locations to use for data placement.
-     * 
- * - * repeated string data_locations = 1; - * - * @return The count of dataLocations. - */ - public int getDataLocationsCount() { - return dataLocations_.size(); - } - /** - * - * - *
-     * List of locations to use for data placement.
-     * 
- * - * repeated string data_locations = 1; - * - * @param index The index of the element to return. - * @return The dataLocations at the given index. - */ - public java.lang.String getDataLocations(int index) { - return dataLocations_.get(index); - } - /** - * - * - *
-     * List of locations to use for data placement.
-     * 
- * - * repeated string data_locations = 1; - * - * @param index The index of the value to return. - * @return The bytes of the dataLocations at the given index. - */ - public com.google.protobuf.ByteString getDataLocationsBytes(int index) { - return dataLocations_.getByteString(index); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < dataLocations_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, dataLocations_.getRaw(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < dataLocations_.size(); i++) { - dataSize += computeStringSizeNoTag(dataLocations_.getRaw(i)); - } - size += dataSize; - size += 1 * getDataLocationsList().size(); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.Bucket.CustomPlacementConfig)) { - return super.equals(obj); - } - com.google.storage.v2.Bucket.CustomPlacementConfig other = - (com.google.storage.v2.Bucket.CustomPlacementConfig) obj; - - if (!getDataLocationsList().equals(other.getDataLocationsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getDataLocationsCount() > 0) { - hash = (37 * hash) + DATA_LOCATIONS_FIELD_NUMBER; - hash = (53 * hash) + getDataLocationsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.Bucket.CustomPlacementConfig parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.CustomPlacementConfig parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.CustomPlacementConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.CustomPlacementConfig parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.CustomPlacementConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket.CustomPlacementConfig parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.CustomPlacementConfig parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.CustomPlacementConfig parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.CustomPlacementConfig parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.CustomPlacementConfig parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket.CustomPlacementConfig parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket.CustomPlacementConfig parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.Bucket.CustomPlacementConfig prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * Configuration for Custom Dual Regions.  It should specify precisely two
-     * eligible regions within the same Multiregion.
-     * 
- * - * Protobuf type {@code google.storage.v2.Bucket.CustomPlacementConfig} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.CustomPlacementConfig) - com.google.storage.v2.Bucket.CustomPlacementConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_CustomPlacementConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_CustomPlacementConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.CustomPlacementConfig.class, - com.google.storage.v2.Bucket.CustomPlacementConfig.Builder.class); - } - - // Construct using com.google.storage.v2.Bucket.CustomPlacementConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - dataLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; - 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_Bucket_CustomPlacementConfig_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.CustomPlacementConfig getDefaultInstanceForType() { - return com.google.storage.v2.Bucket.CustomPlacementConfig.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.Bucket.CustomPlacementConfig build() { - com.google.storage.v2.Bucket.CustomPlacementConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.CustomPlacementConfig buildPartial() { - com.google.storage.v2.Bucket.CustomPlacementConfig result = - new com.google.storage.v2.Bucket.CustomPlacementConfig(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - dataLocations_ = dataLocations_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.dataLocations_ = dataLocations_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.Bucket.CustomPlacementConfig) { - return mergeFrom((com.google.storage.v2.Bucket.CustomPlacementConfig) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.Bucket.CustomPlacementConfig other) { - if (other == com.google.storage.v2.Bucket.CustomPlacementConfig.getDefaultInstance()) - return this; - if (!other.dataLocations_.isEmpty()) { - if (dataLocations_.isEmpty()) { - dataLocations_ = other.dataLocations_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDataLocationsIsMutable(); - dataLocations_.addAll(other.dataLocations_); - } - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.Bucket.CustomPlacementConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.storage.v2.Bucket.CustomPlacementConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private com.google.protobuf.LazyStringList dataLocations_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensureDataLocationsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - dataLocations_ = new com.google.protobuf.LazyStringArrayList(dataLocations_); - bitField0_ |= 0x00000001; - } - } - /** - * - * - *
-       * List of locations to use for data placement.
-       * 
- * - * repeated string data_locations = 1; - * - * @return A list containing the dataLocations. - */ - public com.google.protobuf.ProtocolStringList getDataLocationsList() { - return dataLocations_.getUnmodifiableView(); - } - /** - * - * - *
-       * List of locations to use for data placement.
-       * 
- * - * repeated string data_locations = 1; - * - * @return The count of dataLocations. - */ - public int getDataLocationsCount() { - return dataLocations_.size(); - } - /** - * - * - *
-       * List of locations to use for data placement.
-       * 
- * - * repeated string data_locations = 1; - * - * @param index The index of the element to return. - * @return The dataLocations at the given index. - */ - public java.lang.String getDataLocations(int index) { - return dataLocations_.get(index); - } - /** - * - * - *
-       * List of locations to use for data placement.
-       * 
- * - * repeated string data_locations = 1; - * - * @param index The index of the value to return. - * @return The bytes of the dataLocations at the given index. - */ - public com.google.protobuf.ByteString getDataLocationsBytes(int index) { - return dataLocations_.getByteString(index); - } - /** - * - * - *
-       * List of locations to use for data placement.
-       * 
- * - * repeated string data_locations = 1; - * - * @param index The index to set the value at. - * @param value The dataLocations to set. - * @return This builder for chaining. - */ - public Builder setDataLocations(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureDataLocationsIsMutable(); - dataLocations_.set(index, value); - onChanged(); - return this; - } - /** - * - * - *
-       * List of locations to use for data placement.
-       * 
- * - * repeated string data_locations = 1; - * - * @param value The dataLocations to add. - * @return This builder for chaining. - */ - public Builder addDataLocations(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureDataLocationsIsMutable(); - dataLocations_.add(value); - onChanged(); - return this; - } - /** - * - * - *
-       * List of locations to use for data placement.
-       * 
- * - * repeated string data_locations = 1; - * - * @param values The dataLocations to add. - * @return This builder for chaining. - */ - public Builder addAllDataLocations(java.lang.Iterable values) { - ensureDataLocationsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dataLocations_); - onChanged(); - return this; - } - /** - * - * - *
-       * List of locations to use for data placement.
-       * 
- * - * repeated string data_locations = 1; - * - * @return This builder for chaining. - */ - public Builder clearDataLocations() { - dataLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-       * List of locations to use for data placement.
-       * 
- * - * repeated string data_locations = 1; - * - * @param value The bytes of the dataLocations to add. - * @return This builder for chaining. - */ - public Builder addDataLocationsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureDataLocationsIsMutable(); - dataLocations_.add(value); - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.Bucket.CustomPlacementConfig) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.CustomPlacementConfig) - private static final com.google.storage.v2.Bucket.CustomPlacementConfig DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.CustomPlacementConfig(); - } - - public static com.google.storage.v2.Bucket.CustomPlacementConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CustomPlacementConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CustomPlacementConfig(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.Bucket.CustomPlacementConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * - * - *
-   * Immutable. The name of the bucket.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * - * - *
-   * Immutable. The name of the bucket.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int BUCKET_ID_FIELD_NUMBER = 2; - private volatile java.lang.Object bucketId_; - /** - * - * - *
-   * Output only. The user-chosen part of the bucket name. The `{bucket}` portion of the
-   * `name` field. For globally unique buckets, this is equal to the "bucket
-   * name" of other Cloud Storage APIs. Example: "pub".
-   * 
- * - * string bucket_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bucketId. - */ - @java.lang.Override - public java.lang.String getBucketId() { - java.lang.Object ref = bucketId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - bucketId_ = s; - return s; - } - } - /** - * - * - *
-   * Output only. The user-chosen part of the bucket name. The `{bucket}` portion of the
-   * `name` field. For globally unique buckets, this is equal to the "bucket
-   * name" of other Cloud Storage APIs. Example: "pub".
-   * 
- * - * string bucket_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for bucketId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getBucketIdBytes() { - java.lang.Object ref = bucketId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - bucketId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PROJECT_FIELD_NUMBER = 3; - private volatile java.lang.Object project_; - /** - * - * - *
-   * Immutable. The project which owns this bucket.
-   * 
- * - * - * string project = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - @java.lang.Override - public java.lang.String getProject() { - java.lang.Object ref = project_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - project_ = s; - return s; - } - } - /** - * - * - *
-   * Immutable. The project which owns this bucket.
-   * 
- * - * - * string project = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - @java.lang.Override - public com.google.protobuf.ByteString getProjectBytes() { - java.lang.Object ref = project_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - project_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int METAGENERATION_FIELD_NUMBER = 4; - private long metageneration_; - /** - * - * - *
-   * Output only. The metadata generation of this bucket.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * int64 metageneration = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The metageneration. - */ - @java.lang.Override - public long getMetageneration() { - return metageneration_; - } - - public static final int LOCATION_FIELD_NUMBER = 5; - private volatile java.lang.Object location_; - /** - * - * - *
-   * Immutable. The location of the bucket. Object data for objects in the bucket resides
-   * in physical storage within this region.  Defaults to `US`. See the
-   * [https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations"][developer's
-   * guide] for the authoritative list. Attempting to update this field after
-   * the bucket is created will result in an error.
-   * 
- * - * string location = 5 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The location. - */ - @java.lang.Override - public java.lang.String getLocation() { - java.lang.Object ref = location_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - location_ = s; - return s; - } - } - /** - * - * - *
-   * Immutable. The location of the bucket. Object data for objects in the bucket resides
-   * in physical storage within this region.  Defaults to `US`. See the
-   * [https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations"][developer's
-   * guide] for the authoritative list. Attempting to update this field after
-   * the bucket is created will result in an error.
-   * 
- * - * string location = 5 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The bytes for location. - */ - @java.lang.Override - public com.google.protobuf.ByteString getLocationBytes() { - java.lang.Object ref = location_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - location_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int LOCATION_TYPE_FIELD_NUMBER = 6; - private volatile java.lang.Object locationType_; - /** - * - * - *
-   * Output only. The location type of the bucket (region, dual-region, multi-region, etc).
-   * 
- * - * string location_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The locationType. - */ - @java.lang.Override - public java.lang.String getLocationType() { - java.lang.Object ref = locationType_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - locationType_ = s; - return s; - } - } - /** - * - * - *
-   * Output only. The location type of the bucket (region, dual-region, multi-region, etc).
-   * 
- * - * string location_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for locationType. - */ - @java.lang.Override - public com.google.protobuf.ByteString getLocationTypeBytes() { - java.lang.Object ref = locationType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - locationType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int STORAGE_CLASS_FIELD_NUMBER = 7; - private volatile java.lang.Object storageClass_; - /** - * - * - *
-   * The bucket's default storage class, used whenever no storageClass is
-   * specified for a newly-created object. This defines how objects in the
-   * bucket are stored and determines the SLA and the cost of storage.
-   * If this value is not specified when the bucket is created, it will default
-   * to `STANDARD`. For more information, see
-   * https://developers.google.com/storage/docs/storage-classes.
-   * 
- * - * string storage_class = 7; - * - * @return The storageClass. - */ - @java.lang.Override - public java.lang.String getStorageClass() { - java.lang.Object ref = storageClass_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - storageClass_ = s; - return s; - } - } - /** - * - * - *
-   * The bucket's default storage class, used whenever no storageClass is
-   * specified for a newly-created object. This defines how objects in the
-   * bucket are stored and determines the SLA and the cost of storage.
-   * If this value is not specified when the bucket is created, it will default
-   * to `STANDARD`. For more information, see
-   * https://developers.google.com/storage/docs/storage-classes.
-   * 
- * - * string storage_class = 7; - * - * @return The bytes for storageClass. - */ - @java.lang.Override - public com.google.protobuf.ByteString getStorageClassBytes() { - java.lang.Object ref = storageClass_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - storageClass_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RPO_FIELD_NUMBER = 27; - private volatile java.lang.Object rpo_; - /** - * - * - *
-   * The recovery point objective for cross-region replication of the bucket.
-   * Applicable only for dual- and multi-region buckets. "DEFAULT" uses default
-   * replication. "ASYNC_TURBO" enables turbo replication, valid for dual-region
-   * buckets only. If rpo is not specified when the bucket is created, it
-   * defaults to "DEFAULT". For more information, see
-   * https://cloud.google.com/storage/docs/turbo-replication.
-   * 
- * - * string rpo = 27; - * - * @return The rpo. - */ - @java.lang.Override - public java.lang.String getRpo() { - java.lang.Object ref = rpo_; - 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(); - rpo_ = s; - return s; - } - } - /** - * - * - *
-   * The recovery point objective for cross-region replication of the bucket.
-   * Applicable only for dual- and multi-region buckets. "DEFAULT" uses default
-   * replication. "ASYNC_TURBO" enables turbo replication, valid for dual-region
-   * buckets only. If rpo is not specified when the bucket is created, it
-   * defaults to "DEFAULT". For more information, see
-   * https://cloud.google.com/storage/docs/turbo-replication.
-   * 
- * - * string rpo = 27; - * - * @return The bytes for rpo. - */ - @java.lang.Override - public com.google.protobuf.ByteString getRpoBytes() { - java.lang.Object ref = rpo_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - rpo_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ACL_FIELD_NUMBER = 8; - private java.util.List acl_; - /** - * - * - *
-   * Access controls on the bucket.
-   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-   * requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - @java.lang.Override - public java.util.List getAclList() { - return acl_; - } - /** - * - * - *
-   * Access controls on the bucket.
-   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-   * requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - @java.lang.Override - public java.util.List - getAclOrBuilderList() { - return acl_; - } - /** - * - * - *
-   * Access controls on the bucket.
-   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-   * requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - @java.lang.Override - public int getAclCount() { - return acl_.size(); - } - /** - * - * - *
-   * Access controls on the bucket.
-   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-   * requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - @java.lang.Override - public com.google.storage.v2.BucketAccessControl getAcl(int index) { - return acl_.get(index); - } - /** - * - * - *
-   * Access controls on the bucket.
-   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-   * requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - @java.lang.Override - public com.google.storage.v2.BucketAccessControlOrBuilder getAclOrBuilder(int index) { - return acl_.get(index); - } - - public static final int DEFAULT_OBJECT_ACL_FIELD_NUMBER = 9; - private java.util.List defaultObjectAcl_; - /** - * - * - *
-   * Default access controls to apply to new objects when no ACL is provided.
-   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-   * requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - @java.lang.Override - public java.util.List getDefaultObjectAclList() { - return defaultObjectAcl_; - } - /** - * - * - *
-   * Default access controls to apply to new objects when no ACL is provided.
-   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-   * requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - @java.lang.Override - public java.util.List - getDefaultObjectAclOrBuilderList() { - return defaultObjectAcl_; - } - /** - * - * - *
-   * Default access controls to apply to new objects when no ACL is provided.
-   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-   * requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - @java.lang.Override - public int getDefaultObjectAclCount() { - return defaultObjectAcl_.size(); - } - /** - * - * - *
-   * Default access controls to apply to new objects when no ACL is provided.
-   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-   * requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - @java.lang.Override - public com.google.storage.v2.ObjectAccessControl getDefaultObjectAcl(int index) { - return defaultObjectAcl_.get(index); - } - /** - * - * - *
-   * Default access controls to apply to new objects when no ACL is provided.
-   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-   * requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - @java.lang.Override - public com.google.storage.v2.ObjectAccessControlOrBuilder getDefaultObjectAclOrBuilder( - int index) { - return defaultObjectAcl_.get(index); - } - - public static final int LIFECYCLE_FIELD_NUMBER = 10; - private com.google.storage.v2.Bucket.Lifecycle lifecycle_; - /** - * - * - *
-   * The bucket's lifecycle config. See
-   * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
-   * for more information.
-   * 
- * - * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; - * - * @return Whether the lifecycle field is set. - */ - @java.lang.Override - public boolean hasLifecycle() { - return lifecycle_ != null; - } - /** - * - * - *
-   * The bucket's lifecycle config. See
-   * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
-   * for more information.
-   * 
- * - * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; - * - * @return The lifecycle. - */ - @java.lang.Override - public com.google.storage.v2.Bucket.Lifecycle getLifecycle() { - return lifecycle_ == null - ? com.google.storage.v2.Bucket.Lifecycle.getDefaultInstance() - : lifecycle_; - } - /** - * - * - *
-   * The bucket's lifecycle config. See
-   * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
-   * for more information.
-   * 
- * - * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; - */ - @java.lang.Override - public com.google.storage.v2.Bucket.LifecycleOrBuilder getLifecycleOrBuilder() { - return getLifecycle(); - } - - public static final int CREATE_TIME_FIELD_NUMBER = 11; - private com.google.protobuf.Timestamp createTime_; - /** - * - * - *
-   * Output only. The creation time of the bucket in
-   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the createTime field is set. - */ - @java.lang.Override - public boolean hasCreateTime() { - return createTime_ != null; - } - /** - * - * - *
-   * Output only. The creation time of the bucket in
-   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The createTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getCreateTime() { - return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; - } - /** - * - * - *
-   * Output only. The creation time of the bucket in
-   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { - return getCreateTime(); - } - - public static final int CORS_FIELD_NUMBER = 12; - private java.util.List cors_; - /** - * - * - *
-   * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-   * (CORS) config.
-   * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - @java.lang.Override - public java.util.List getCorsList() { - return cors_; - } - /** - * - * - *
-   * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-   * (CORS) config.
-   * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - @java.lang.Override - public java.util.List - getCorsOrBuilderList() { - return cors_; - } - /** - * - * - *
-   * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-   * (CORS) config.
-   * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - @java.lang.Override - public int getCorsCount() { - return cors_.size(); - } - /** - * - * - *
-   * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-   * (CORS) config.
-   * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - @java.lang.Override - public com.google.storage.v2.Bucket.Cors getCors(int index) { - return cors_.get(index); - } - /** - * - * - *
-   * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-   * (CORS) config.
-   * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - @java.lang.Override - public com.google.storage.v2.Bucket.CorsOrBuilder getCorsOrBuilder(int index) { - return cors_.get(index); - } - - public static final int UPDATE_TIME_FIELD_NUMBER = 13; - private com.google.protobuf.Timestamp updateTime_; - /** - * - * - *
-   * Output only. The modification time of the bucket.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the updateTime field is set. - */ - @java.lang.Override - public boolean hasUpdateTime() { - return updateTime_ != null; - } - /** - * - * - *
-   * Output only. The modification time of the bucket.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The updateTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getUpdateTime() { - return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; - } - /** - * - * - *
-   * Output only. The modification time of the bucket.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { - return getUpdateTime(); - } - - public static final int DEFAULT_EVENT_BASED_HOLD_FIELD_NUMBER = 14; - private boolean defaultEventBasedHold_; - /** - * - * - *
-   * The default value for event-based hold on newly created objects in this
-   * bucket.  Event-based hold is a way to retain objects indefinitely until an
-   * event occurs, signified by the
-   * hold's release. After being released, such objects will be subject to
-   * bucket-level retention (if any).  One sample use case of this flag is for
-   * banks to hold loan documents for at least 3 years after loan is paid in
-   * full. Here, bucket-level retention is 3 years and the event is loan being
-   * paid in full. In this example, these objects will be held intact for any
-   * number of years until the event has occurred (event-based hold on the
-   * object is released) and then 3 more years after that. That means retention
-   * duration of the objects begins from the moment event-based hold
-   * transitioned from true to false.  Objects under event-based hold cannot be
-   * deleted, overwritten or archived until the hold is removed.
-   * 
- * - * bool default_event_based_hold = 14; - * - * @return The defaultEventBasedHold. - */ - @java.lang.Override - public boolean getDefaultEventBasedHold() { - return defaultEventBasedHold_; - } - - public static final int LABELS_FIELD_NUMBER = 15; - - private static final class LabelsDefaultEntryHolder { - static final com.google.protobuf.MapEntry defaultEntry = - com.google.protobuf.MapEntry.newDefaultInstance( - com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_LabelsEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - - private com.google.protobuf.MapField labels_; - - private com.google.protobuf.MapField internalGetLabels() { - if (labels_ == null) { - return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); - } - return labels_; - } - - public int getLabelsCount() { - return internalGetLabels().getMap().size(); - } - /** - * - * - *
-   * User-provided labels, in key/value pairs.
-   * 
- * - * map<string, string> labels = 15; - */ - @java.lang.Override - public boolean containsLabels(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - return internalGetLabels().getMap().containsKey(key); - } - /** Use {@link #getLabelsMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getLabels() { - return getLabelsMap(); - } - /** - * - * - *
-   * User-provided labels, in key/value pairs.
-   * 
- * - * map<string, string> labels = 15; - */ - @java.lang.Override - public java.util.Map getLabelsMap() { - return internalGetLabels().getMap(); - } - /** - * - * - *
-   * User-provided labels, in key/value pairs.
-   * 
- * - * map<string, string> labels = 15; - */ - @java.lang.Override - public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - java.util.Map map = internalGetLabels().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-   * User-provided labels, in key/value pairs.
-   * 
- * - * map<string, string> labels = 15; - */ - @java.lang.Override - public java.lang.String getLabelsOrThrow(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - java.util.Map map = internalGetLabels().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int WEBSITE_FIELD_NUMBER = 16; - private com.google.storage.v2.Bucket.Website website_; - /** - * - * - *
-   * The bucket's website config, controlling how the service behaves
-   * when accessing bucket contents as a web site. See the
-   * [https://cloud.google.com/storage/docs/static-website][Static Website
-   * Examples] for more information.
-   * 
- * - * .google.storage.v2.Bucket.Website website = 16; - * - * @return Whether the website field is set. - */ - @java.lang.Override - public boolean hasWebsite() { - return website_ != null; - } - /** - * - * - *
-   * The bucket's website config, controlling how the service behaves
-   * when accessing bucket contents as a web site. See the
-   * [https://cloud.google.com/storage/docs/static-website][Static Website
-   * Examples] for more information.
-   * 
- * - * .google.storage.v2.Bucket.Website website = 16; - * - * @return The website. - */ - @java.lang.Override - public com.google.storage.v2.Bucket.Website getWebsite() { - return website_ == null ? com.google.storage.v2.Bucket.Website.getDefaultInstance() : website_; - } - /** - * - * - *
-   * The bucket's website config, controlling how the service behaves
-   * when accessing bucket contents as a web site. See the
-   * [https://cloud.google.com/storage/docs/static-website][Static Website
-   * Examples] for more information.
-   * 
- * - * .google.storage.v2.Bucket.Website website = 16; - */ - @java.lang.Override - public com.google.storage.v2.Bucket.WebsiteOrBuilder getWebsiteOrBuilder() { - return getWebsite(); - } - - public static final int VERSIONING_FIELD_NUMBER = 17; - private com.google.storage.v2.Bucket.Versioning versioning_; - /** - * - * - *
-   * The bucket's versioning config.
-   * 
- * - * .google.storage.v2.Bucket.Versioning versioning = 17; - * - * @return Whether the versioning field is set. - */ - @java.lang.Override - public boolean hasVersioning() { - return versioning_ != null; - } - /** - * - * - *
-   * The bucket's versioning config.
-   * 
- * - * .google.storage.v2.Bucket.Versioning versioning = 17; - * - * @return The versioning. - */ - @java.lang.Override - public com.google.storage.v2.Bucket.Versioning getVersioning() { - return versioning_ == null - ? com.google.storage.v2.Bucket.Versioning.getDefaultInstance() - : versioning_; - } - /** - * - * - *
-   * The bucket's versioning config.
-   * 
- * - * .google.storage.v2.Bucket.Versioning versioning = 17; - */ - @java.lang.Override - public com.google.storage.v2.Bucket.VersioningOrBuilder getVersioningOrBuilder() { - return getVersioning(); - } - - public static final int LOGGING_FIELD_NUMBER = 18; - private com.google.storage.v2.Bucket.Logging logging_; - /** - * - * - *
-   * The bucket's logging config, which defines the destination bucket
-   * and name prefix (if any) for the current bucket's logs.
-   * 
- * - * .google.storage.v2.Bucket.Logging logging = 18; - * - * @return Whether the logging field is set. - */ - @java.lang.Override - public boolean hasLogging() { - return logging_ != null; - } - /** - * - * - *
-   * The bucket's logging config, which defines the destination bucket
-   * and name prefix (if any) for the current bucket's logs.
-   * 
- * - * .google.storage.v2.Bucket.Logging logging = 18; - * - * @return The logging. - */ - @java.lang.Override - public com.google.storage.v2.Bucket.Logging getLogging() { - return logging_ == null ? com.google.storage.v2.Bucket.Logging.getDefaultInstance() : logging_; - } - /** - * - * - *
-   * The bucket's logging config, which defines the destination bucket
-   * and name prefix (if any) for the current bucket's logs.
-   * 
- * - * .google.storage.v2.Bucket.Logging logging = 18; - */ - @java.lang.Override - public com.google.storage.v2.Bucket.LoggingOrBuilder getLoggingOrBuilder() { - return getLogging(); - } - - public static final int OWNER_FIELD_NUMBER = 19; - private com.google.storage.v2.Owner owner_; - /** - * - * - *
-   * Output only. The owner of the bucket. This is always the project team's owner group.
-   * 
- * - * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return Whether the owner field is set. - */ - @java.lang.Override - public boolean hasOwner() { - return owner_ != null; - } - /** - * - * - *
-   * Output only. The owner of the bucket. This is always the project team's owner group.
-   * 
- * - * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The owner. - */ - @java.lang.Override - public com.google.storage.v2.Owner getOwner() { - return owner_ == null ? com.google.storage.v2.Owner.getDefaultInstance() : owner_; - } - /** - * - * - *
-   * Output only. The owner of the bucket. This is always the project team's owner group.
-   * 
- * - * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - @java.lang.Override - public com.google.storage.v2.OwnerOrBuilder getOwnerOrBuilder() { - return getOwner(); - } - - public static final int ENCRYPTION_FIELD_NUMBER = 20; - private com.google.storage.v2.Bucket.Encryption encryption_; - /** - * - * - *
-   * Encryption config for a bucket.
-   * 
- * - * .google.storage.v2.Bucket.Encryption encryption = 20; - * - * @return Whether the encryption field is set. - */ - @java.lang.Override - public boolean hasEncryption() { - return encryption_ != null; - } - /** - * - * - *
-   * Encryption config for a bucket.
-   * 
- * - * .google.storage.v2.Bucket.Encryption encryption = 20; - * - * @return The encryption. - */ - @java.lang.Override - public com.google.storage.v2.Bucket.Encryption getEncryption() { - return encryption_ == null - ? com.google.storage.v2.Bucket.Encryption.getDefaultInstance() - : encryption_; - } - /** - * - * - *
-   * Encryption config for a bucket.
-   * 
- * - * .google.storage.v2.Bucket.Encryption encryption = 20; - */ - @java.lang.Override - public com.google.storage.v2.Bucket.EncryptionOrBuilder getEncryptionOrBuilder() { - return getEncryption(); - } - - public static final int BILLING_FIELD_NUMBER = 21; - private com.google.storage.v2.Bucket.Billing billing_; - /** - * - * - *
-   * The bucket's billing config.
-   * 
- * - * .google.storage.v2.Bucket.Billing billing = 21; - * - * @return Whether the billing field is set. - */ - @java.lang.Override - public boolean hasBilling() { - return billing_ != null; - } - /** - * - * - *
-   * The bucket's billing config.
-   * 
- * - * .google.storage.v2.Bucket.Billing billing = 21; - * - * @return The billing. - */ - @java.lang.Override - public com.google.storage.v2.Bucket.Billing getBilling() { - return billing_ == null ? com.google.storage.v2.Bucket.Billing.getDefaultInstance() : billing_; - } - /** - * - * - *
-   * The bucket's billing config.
-   * 
- * - * .google.storage.v2.Bucket.Billing billing = 21; - */ - @java.lang.Override - public com.google.storage.v2.Bucket.BillingOrBuilder getBillingOrBuilder() { - return getBilling(); - } - - public static final int RETENTION_POLICY_FIELD_NUMBER = 22; - private com.google.storage.v2.Bucket.RetentionPolicy retentionPolicy_; - /** - * - * - *
-   * The bucket's retention policy. The retention policy enforces a minimum
-   * retention time for all objects contained in the bucket, based on their
-   * creation time. Any attempt to overwrite or delete objects younger than the
-   * retention period will result in a PERMISSION_DENIED error.  An unlocked
-   * retention policy can be modified or removed from the bucket via a
-   * storage.buckets.update operation. A locked retention policy cannot be
-   * removed or shortened in duration for the lifetime of the bucket.
-   * Attempting to remove or decrease period of a locked retention policy will
-   * result in a PERMISSION_DENIED error.
-   * 
- * - * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; - * - * @return Whether the retentionPolicy field is set. - */ - @java.lang.Override - public boolean hasRetentionPolicy() { - return retentionPolicy_ != null; - } - /** - * - * - *
-   * The bucket's retention policy. The retention policy enforces a minimum
-   * retention time for all objects contained in the bucket, based on their
-   * creation time. Any attempt to overwrite or delete objects younger than the
-   * retention period will result in a PERMISSION_DENIED error.  An unlocked
-   * retention policy can be modified or removed from the bucket via a
-   * storage.buckets.update operation. A locked retention policy cannot be
-   * removed or shortened in duration for the lifetime of the bucket.
-   * Attempting to remove or decrease period of a locked retention policy will
-   * result in a PERMISSION_DENIED error.
-   * 
- * - * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; - * - * @return The retentionPolicy. - */ - @java.lang.Override - public com.google.storage.v2.Bucket.RetentionPolicy getRetentionPolicy() { - return retentionPolicy_ == null - ? com.google.storage.v2.Bucket.RetentionPolicy.getDefaultInstance() - : retentionPolicy_; - } - /** - * - * - *
-   * The bucket's retention policy. The retention policy enforces a minimum
-   * retention time for all objects contained in the bucket, based on their
-   * creation time. Any attempt to overwrite or delete objects younger than the
-   * retention period will result in a PERMISSION_DENIED error.  An unlocked
-   * retention policy can be modified or removed from the bucket via a
-   * storage.buckets.update operation. A locked retention policy cannot be
-   * removed or shortened in duration for the lifetime of the bucket.
-   * Attempting to remove or decrease period of a locked retention policy will
-   * result in a PERMISSION_DENIED error.
-   * 
- * - * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; - */ - @java.lang.Override - public com.google.storage.v2.Bucket.RetentionPolicyOrBuilder getRetentionPolicyOrBuilder() { - return getRetentionPolicy(); - } - - public static final int IAM_CONFIG_FIELD_NUMBER = 23; - private com.google.storage.v2.Bucket.IamConfig iamConfig_; - /** - * - * - *
-   * The bucket's IAM config.
-   * 
- * - * .google.storage.v2.Bucket.IamConfig iam_config = 23; - * - * @return Whether the iamConfig field is set. - */ - @java.lang.Override - public boolean hasIamConfig() { - return iamConfig_ != null; - } - /** - * - * - *
-   * The bucket's IAM config.
-   * 
- * - * .google.storage.v2.Bucket.IamConfig iam_config = 23; - * - * @return The iamConfig. - */ - @java.lang.Override - public com.google.storage.v2.Bucket.IamConfig getIamConfig() { - return iamConfig_ == null - ? com.google.storage.v2.Bucket.IamConfig.getDefaultInstance() - : iamConfig_; - } - /** - * - * - *
-   * The bucket's IAM config.
-   * 
- * - * .google.storage.v2.Bucket.IamConfig iam_config = 23; - */ - @java.lang.Override - public com.google.storage.v2.Bucket.IamConfigOrBuilder getIamConfigOrBuilder() { - return getIamConfig(); - } - - public static final int SATISFIES_PZS_FIELD_NUMBER = 25; - private boolean satisfiesPzs_; - /** - * - * - *
-   * Reserved for future use.
-   * 
- * - * bool satisfies_pzs = 25; - * - * @return The satisfiesPzs. - */ - @java.lang.Override - public boolean getSatisfiesPzs() { - return satisfiesPzs_; - } - - public static final int CUSTOM_PLACEMENT_CONFIG_FIELD_NUMBER = 26; - private com.google.storage.v2.Bucket.CustomPlacementConfig customPlacementConfig_; - /** - * - * - *
-   * Configuration that, if present, specifies the data placement for a Custom
-   * Dual Region.
-   * 
- * - * .google.storage.v2.Bucket.CustomPlacementConfig custom_placement_config = 26; - * - * @return Whether the customPlacementConfig field is set. - */ - @java.lang.Override - public boolean hasCustomPlacementConfig() { - return customPlacementConfig_ != null; - } - /** - * - * - *
-   * Configuration that, if present, specifies the data placement for a Custom
-   * Dual Region.
-   * 
- * - * .google.storage.v2.Bucket.CustomPlacementConfig custom_placement_config = 26; - * - * @return The customPlacementConfig. - */ - @java.lang.Override - public com.google.storage.v2.Bucket.CustomPlacementConfig getCustomPlacementConfig() { - return customPlacementConfig_ == null - ? com.google.storage.v2.Bucket.CustomPlacementConfig.getDefaultInstance() - : customPlacementConfig_; - } - /** - * - * - *
-   * Configuration that, if present, specifies the data placement for a Custom
-   * Dual Region.
-   * 
- * - * .google.storage.v2.Bucket.CustomPlacementConfig custom_placement_config = 26; - */ - @java.lang.Override - public com.google.storage.v2.Bucket.CustomPlacementConfigOrBuilder - getCustomPlacementConfigOrBuilder() { - return getCustomPlacementConfig(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucketId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, bucketId_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, project_); - } - if (metageneration_ != 0L) { - output.writeInt64(4, metageneration_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, location_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(locationType_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, locationType_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(storageClass_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, storageClass_); - } - for (int i = 0; i < acl_.size(); i++) { - output.writeMessage(8, acl_.get(i)); - } - for (int i = 0; i < defaultObjectAcl_.size(); i++) { - output.writeMessage(9, defaultObjectAcl_.get(i)); - } - if (lifecycle_ != null) { - output.writeMessage(10, getLifecycle()); - } - if (createTime_ != null) { - output.writeMessage(11, getCreateTime()); - } - for (int i = 0; i < cors_.size(); i++) { - output.writeMessage(12, cors_.get(i)); - } - if (updateTime_ != null) { - output.writeMessage(13, getUpdateTime()); - } - if (defaultEventBasedHold_ != false) { - output.writeBool(14, defaultEventBasedHold_); - } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( - output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 15); - if (website_ != null) { - output.writeMessage(16, getWebsite()); - } - if (versioning_ != null) { - output.writeMessage(17, getVersioning()); - } - if (logging_ != null) { - output.writeMessage(18, getLogging()); - } - if (owner_ != null) { - output.writeMessage(19, getOwner()); - } - if (encryption_ != null) { - output.writeMessage(20, getEncryption()); - } - if (billing_ != null) { - output.writeMessage(21, getBilling()); - } - if (retentionPolicy_ != null) { - output.writeMessage(22, getRetentionPolicy()); - } - if (iamConfig_ != null) { - output.writeMessage(23, getIamConfig()); - } - if (satisfiesPzs_ != false) { - output.writeBool(25, satisfiesPzs_); - } - if (customPlacementConfig_ != null) { - output.writeMessage(26, getCustomPlacementConfig()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rpo_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 27, rpo_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucketId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, bucketId_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, project_); - } - if (metageneration_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, metageneration_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, location_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(locationType_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, locationType_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(storageClass_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, storageClass_); - } - for (int i = 0; i < acl_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, acl_.get(i)); - } - for (int i = 0; i < defaultObjectAcl_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, defaultObjectAcl_.get(i)); - } - if (lifecycle_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getLifecycle()); - } - if (createTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getCreateTime()); - } - for (int i = 0; i < cors_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, cors_.get(i)); - } - if (updateTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getUpdateTime()); - } - if (defaultEventBasedHold_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(14, defaultEventBasedHold_); - } - for (java.util.Map.Entry entry : - internalGetLabels().getMap().entrySet()) { - com.google.protobuf.MapEntry labels__ = - LabelsDefaultEntryHolder.defaultEntry - .newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, labels__); - } - if (website_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, getWebsite()); - } - if (versioning_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, getVersioning()); - } - if (logging_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, getLogging()); - } - if (owner_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, getOwner()); - } - if (encryption_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, getEncryption()); - } - if (billing_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, getBilling()); - } - if (retentionPolicy_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(22, getRetentionPolicy()); - } - if (iamConfig_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(23, getIamConfig()); - } - if (satisfiesPzs_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(25, satisfiesPzs_); - } - if (customPlacementConfig_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize(26, getCustomPlacementConfig()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rpo_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(27, rpo_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.Bucket)) { - return super.equals(obj); - } - com.google.storage.v2.Bucket other = (com.google.storage.v2.Bucket) obj; - - if (!getName().equals(other.getName())) return false; - if (!getBucketId().equals(other.getBucketId())) return false; - if (!getProject().equals(other.getProject())) return false; - if (getMetageneration() != other.getMetageneration()) return false; - if (!getLocation().equals(other.getLocation())) return false; - if (!getLocationType().equals(other.getLocationType())) return false; - if (!getStorageClass().equals(other.getStorageClass())) return false; - if (!getRpo().equals(other.getRpo())) return false; - if (!getAclList().equals(other.getAclList())) return false; - if (!getDefaultObjectAclList().equals(other.getDefaultObjectAclList())) return false; - if (hasLifecycle() != other.hasLifecycle()) return false; - if (hasLifecycle()) { - if (!getLifecycle().equals(other.getLifecycle())) return false; - } - if (hasCreateTime() != other.hasCreateTime()) return false; - if (hasCreateTime()) { - if (!getCreateTime().equals(other.getCreateTime())) return false; - } - if (!getCorsList().equals(other.getCorsList())) return false; - if (hasUpdateTime() != other.hasUpdateTime()) return false; - if (hasUpdateTime()) { - if (!getUpdateTime().equals(other.getUpdateTime())) return false; - } - if (getDefaultEventBasedHold() != other.getDefaultEventBasedHold()) return false; - if (!internalGetLabels().equals(other.internalGetLabels())) return false; - if (hasWebsite() != other.hasWebsite()) return false; - if (hasWebsite()) { - if (!getWebsite().equals(other.getWebsite())) return false; - } - if (hasVersioning() != other.hasVersioning()) return false; - if (hasVersioning()) { - if (!getVersioning().equals(other.getVersioning())) return false; - } - if (hasLogging() != other.hasLogging()) return false; - if (hasLogging()) { - if (!getLogging().equals(other.getLogging())) return false; - } - if (hasOwner() != other.hasOwner()) return false; - if (hasOwner()) { - if (!getOwner().equals(other.getOwner())) return false; - } - if (hasEncryption() != other.hasEncryption()) return false; - if (hasEncryption()) { - if (!getEncryption().equals(other.getEncryption())) return false; - } - if (hasBilling() != other.hasBilling()) return false; - if (hasBilling()) { - if (!getBilling().equals(other.getBilling())) return false; - } - if (hasRetentionPolicy() != other.hasRetentionPolicy()) return false; - if (hasRetentionPolicy()) { - if (!getRetentionPolicy().equals(other.getRetentionPolicy())) return false; - } - if (hasIamConfig() != other.hasIamConfig()) return false; - if (hasIamConfig()) { - if (!getIamConfig().equals(other.getIamConfig())) return false; - } - if (getSatisfiesPzs() != other.getSatisfiesPzs()) return false; - if (hasCustomPlacementConfig() != other.hasCustomPlacementConfig()) return false; - if (hasCustomPlacementConfig()) { - if (!getCustomPlacementConfig().equals(other.getCustomPlacementConfig())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + BUCKET_ID_FIELD_NUMBER; - hash = (53 * hash) + getBucketId().hashCode(); - hash = (37 * hash) + PROJECT_FIELD_NUMBER; - hash = (53 * hash) + getProject().hashCode(); - hash = (37 * hash) + METAGENERATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMetageneration()); - hash = (37 * hash) + LOCATION_FIELD_NUMBER; - hash = (53 * hash) + getLocation().hashCode(); - hash = (37 * hash) + LOCATION_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getLocationType().hashCode(); - hash = (37 * hash) + STORAGE_CLASS_FIELD_NUMBER; - hash = (53 * hash) + getStorageClass().hashCode(); - hash = (37 * hash) + RPO_FIELD_NUMBER; - hash = (53 * hash) + getRpo().hashCode(); - if (getAclCount() > 0) { - hash = (37 * hash) + ACL_FIELD_NUMBER; - hash = (53 * hash) + getAclList().hashCode(); - } - if (getDefaultObjectAclCount() > 0) { - hash = (37 * hash) + DEFAULT_OBJECT_ACL_FIELD_NUMBER; - hash = (53 * hash) + getDefaultObjectAclList().hashCode(); - } - if (hasLifecycle()) { - hash = (37 * hash) + LIFECYCLE_FIELD_NUMBER; - hash = (53 * hash) + getLifecycle().hashCode(); - } - if (hasCreateTime()) { - hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getCreateTime().hashCode(); - } - if (getCorsCount() > 0) { - hash = (37 * hash) + CORS_FIELD_NUMBER; - hash = (53 * hash) + getCorsList().hashCode(); - } - if (hasUpdateTime()) { - hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getUpdateTime().hashCode(); - } - hash = (37 * hash) + DEFAULT_EVENT_BASED_HOLD_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDefaultEventBasedHold()); - if (!internalGetLabels().getMap().isEmpty()) { - hash = (37 * hash) + LABELS_FIELD_NUMBER; - hash = (53 * hash) + internalGetLabels().hashCode(); - } - if (hasWebsite()) { - hash = (37 * hash) + WEBSITE_FIELD_NUMBER; - hash = (53 * hash) + getWebsite().hashCode(); - } - if (hasVersioning()) { - hash = (37 * hash) + VERSIONING_FIELD_NUMBER; - hash = (53 * hash) + getVersioning().hashCode(); - } - if (hasLogging()) { - hash = (37 * hash) + LOGGING_FIELD_NUMBER; - hash = (53 * hash) + getLogging().hashCode(); - } - if (hasOwner()) { - hash = (37 * hash) + OWNER_FIELD_NUMBER; - hash = (53 * hash) + getOwner().hashCode(); - } - if (hasEncryption()) { - hash = (37 * hash) + ENCRYPTION_FIELD_NUMBER; - hash = (53 * hash) + getEncryption().hashCode(); - } - if (hasBilling()) { - hash = (37 * hash) + BILLING_FIELD_NUMBER; - hash = (53 * hash) + getBilling().hashCode(); - } - if (hasRetentionPolicy()) { - hash = (37 * hash) + RETENTION_POLICY_FIELD_NUMBER; - hash = (53 * hash) + getRetentionPolicy().hashCode(); - } - if (hasIamConfig()) { - hash = (37 * hash) + IAM_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getIamConfig().hashCode(); - } - hash = (37 * hash) + SATISFIES_PZS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSatisfiesPzs()); - if (hasCustomPlacementConfig()) { - hash = (37 * hash) + CUSTOM_PLACEMENT_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getCustomPlacementConfig().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.Bucket parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Bucket parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Bucket parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Bucket parseFrom(com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Bucket parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.Bucket prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * A bucket.
-   * 
- * - * Protobuf type {@code google.storage.v2.Bucket} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket) - com.google.storage.v2.BucketOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto.internal_static_google_storage_v2_Bucket_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 15: - return internalGetLabels(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { - switch (number) { - case 15: - return internalGetMutableLabels(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Bucket_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Bucket.class, com.google.storage.v2.Bucket.Builder.class); - } - - // Construct using com.google.storage.v2.Bucket.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getAclFieldBuilder(); - getDefaultObjectAclFieldBuilder(); - getCorsFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - bucketId_ = ""; - - project_ = ""; - - metageneration_ = 0L; - - location_ = ""; - - locationType_ = ""; - - storageClass_ = ""; - - rpo_ = ""; - - if (aclBuilder_ == null) { - acl_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - aclBuilder_.clear(); - } - if (defaultObjectAclBuilder_ == null) { - defaultObjectAcl_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - defaultObjectAclBuilder_.clear(); - } - if (lifecycleBuilder_ == null) { - lifecycle_ = null; - } else { - lifecycle_ = null; - lifecycleBuilder_ = null; - } - if (createTimeBuilder_ == null) { - createTime_ = null; - } else { - createTime_ = null; - createTimeBuilder_ = null; - } - if (corsBuilder_ == null) { - cors_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - corsBuilder_.clear(); - } - if (updateTimeBuilder_ == null) { - updateTime_ = null; - } else { - updateTime_ = null; - updateTimeBuilder_ = null; - } - defaultEventBasedHold_ = false; - - internalGetMutableLabels().clear(); - if (websiteBuilder_ == null) { - website_ = null; - } else { - website_ = null; - websiteBuilder_ = null; - } - if (versioningBuilder_ == null) { - versioning_ = null; - } else { - versioning_ = null; - versioningBuilder_ = null; - } - if (loggingBuilder_ == null) { - logging_ = null; - } else { - logging_ = null; - loggingBuilder_ = null; - } - if (ownerBuilder_ == null) { - owner_ = null; - } else { - owner_ = null; - ownerBuilder_ = null; - } - if (encryptionBuilder_ == null) { - encryption_ = null; - } else { - encryption_ = null; - encryptionBuilder_ = null; - } - if (billingBuilder_ == null) { - billing_ = null; - } else { - billing_ = null; - billingBuilder_ = null; - } - if (retentionPolicyBuilder_ == null) { - retentionPolicy_ = null; - } else { - retentionPolicy_ = null; - retentionPolicyBuilder_ = null; - } - if (iamConfigBuilder_ == null) { - iamConfig_ = null; - } else { - iamConfig_ = null; - iamConfigBuilder_ = null; - } - satisfiesPzs_ = false; - - if (customPlacementConfigBuilder_ == null) { - customPlacementConfig_ = null; - } else { - customPlacementConfig_ = null; - customPlacementConfigBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto.internal_static_google_storage_v2_Bucket_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.Bucket getDefaultInstanceForType() { - return com.google.storage.v2.Bucket.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.Bucket build() { - com.google.storage.v2.Bucket result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.Bucket buildPartial() { - com.google.storage.v2.Bucket result = new com.google.storage.v2.Bucket(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.bucketId_ = bucketId_; - result.project_ = project_; - result.metageneration_ = metageneration_; - result.location_ = location_; - result.locationType_ = locationType_; - result.storageClass_ = storageClass_; - result.rpo_ = rpo_; - if (aclBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - acl_ = java.util.Collections.unmodifiableList(acl_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.acl_ = acl_; - } else { - result.acl_ = aclBuilder_.build(); - } - if (defaultObjectAclBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - defaultObjectAcl_ = java.util.Collections.unmodifiableList(defaultObjectAcl_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.defaultObjectAcl_ = defaultObjectAcl_; - } else { - result.defaultObjectAcl_ = defaultObjectAclBuilder_.build(); - } - if (lifecycleBuilder_ == null) { - result.lifecycle_ = lifecycle_; - } else { - result.lifecycle_ = lifecycleBuilder_.build(); - } - if (createTimeBuilder_ == null) { - result.createTime_ = createTime_; - } else { - result.createTime_ = createTimeBuilder_.build(); - } - if (corsBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - cors_ = java.util.Collections.unmodifiableList(cors_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.cors_ = cors_; - } else { - result.cors_ = corsBuilder_.build(); - } - if (updateTimeBuilder_ == null) { - result.updateTime_ = updateTime_; - } else { - result.updateTime_ = updateTimeBuilder_.build(); - } - result.defaultEventBasedHold_ = defaultEventBasedHold_; - result.labels_ = internalGetLabels(); - result.labels_.makeImmutable(); - if (websiteBuilder_ == null) { - result.website_ = website_; - } else { - result.website_ = websiteBuilder_.build(); - } - if (versioningBuilder_ == null) { - result.versioning_ = versioning_; - } else { - result.versioning_ = versioningBuilder_.build(); - } - if (loggingBuilder_ == null) { - result.logging_ = logging_; - } else { - result.logging_ = loggingBuilder_.build(); - } - if (ownerBuilder_ == null) { - result.owner_ = owner_; - } else { - result.owner_ = ownerBuilder_.build(); - } - if (encryptionBuilder_ == null) { - result.encryption_ = encryption_; - } else { - result.encryption_ = encryptionBuilder_.build(); - } - if (billingBuilder_ == null) { - result.billing_ = billing_; - } else { - result.billing_ = billingBuilder_.build(); - } - if (retentionPolicyBuilder_ == null) { - result.retentionPolicy_ = retentionPolicy_; - } else { - result.retentionPolicy_ = retentionPolicyBuilder_.build(); - } - if (iamConfigBuilder_ == null) { - result.iamConfig_ = iamConfig_; - } else { - result.iamConfig_ = iamConfigBuilder_.build(); - } - result.satisfiesPzs_ = satisfiesPzs_; - if (customPlacementConfigBuilder_ == null) { - result.customPlacementConfig_ = customPlacementConfig_; - } else { - result.customPlacementConfig_ = customPlacementConfigBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.Bucket) { - return mergeFrom((com.google.storage.v2.Bucket) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.Bucket other) { - if (other == com.google.storage.v2.Bucket.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getBucketId().isEmpty()) { - bucketId_ = other.bucketId_; - onChanged(); - } - if (!other.getProject().isEmpty()) { - project_ = other.project_; - onChanged(); - } - if (other.getMetageneration() != 0L) { - setMetageneration(other.getMetageneration()); - } - if (!other.getLocation().isEmpty()) { - location_ = other.location_; - onChanged(); - } - if (!other.getLocationType().isEmpty()) { - locationType_ = other.locationType_; - onChanged(); - } - if (!other.getStorageClass().isEmpty()) { - storageClass_ = other.storageClass_; - onChanged(); - } - if (!other.getRpo().isEmpty()) { - rpo_ = other.rpo_; - onChanged(); - } - if (aclBuilder_ == null) { - if (!other.acl_.isEmpty()) { - if (acl_.isEmpty()) { - acl_ = other.acl_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAclIsMutable(); - acl_.addAll(other.acl_); - } - onChanged(); - } - } else { - if (!other.acl_.isEmpty()) { - if (aclBuilder_.isEmpty()) { - aclBuilder_.dispose(); - aclBuilder_ = null; - acl_ = other.acl_; - bitField0_ = (bitField0_ & ~0x00000001); - aclBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getAclFieldBuilder() - : null; - } else { - aclBuilder_.addAllMessages(other.acl_); - } - } - } - if (defaultObjectAclBuilder_ == null) { - if (!other.defaultObjectAcl_.isEmpty()) { - if (defaultObjectAcl_.isEmpty()) { - defaultObjectAcl_ = other.defaultObjectAcl_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureDefaultObjectAclIsMutable(); - defaultObjectAcl_.addAll(other.defaultObjectAcl_); - } - onChanged(); - } - } else { - if (!other.defaultObjectAcl_.isEmpty()) { - if (defaultObjectAclBuilder_.isEmpty()) { - defaultObjectAclBuilder_.dispose(); - defaultObjectAclBuilder_ = null; - defaultObjectAcl_ = other.defaultObjectAcl_; - bitField0_ = (bitField0_ & ~0x00000002); - defaultObjectAclBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getDefaultObjectAclFieldBuilder() - : null; - } else { - defaultObjectAclBuilder_.addAllMessages(other.defaultObjectAcl_); - } - } - } - if (other.hasLifecycle()) { - mergeLifecycle(other.getLifecycle()); - } - if (other.hasCreateTime()) { - mergeCreateTime(other.getCreateTime()); - } - if (corsBuilder_ == null) { - if (!other.cors_.isEmpty()) { - if (cors_.isEmpty()) { - cors_ = other.cors_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureCorsIsMutable(); - cors_.addAll(other.cors_); - } - onChanged(); - } - } else { - if (!other.cors_.isEmpty()) { - if (corsBuilder_.isEmpty()) { - corsBuilder_.dispose(); - corsBuilder_ = null; - cors_ = other.cors_; - bitField0_ = (bitField0_ & ~0x00000004); - corsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getCorsFieldBuilder() - : null; - } else { - corsBuilder_.addAllMessages(other.cors_); - } - } - } - if (other.hasUpdateTime()) { - mergeUpdateTime(other.getUpdateTime()); - } - if (other.getDefaultEventBasedHold() != false) { - setDefaultEventBasedHold(other.getDefaultEventBasedHold()); - } - internalGetMutableLabels().mergeFrom(other.internalGetLabels()); - if (other.hasWebsite()) { - mergeWebsite(other.getWebsite()); - } - if (other.hasVersioning()) { - mergeVersioning(other.getVersioning()); - } - if (other.hasLogging()) { - mergeLogging(other.getLogging()); - } - if (other.hasOwner()) { - mergeOwner(other.getOwner()); - } - if (other.hasEncryption()) { - mergeEncryption(other.getEncryption()); - } - if (other.hasBilling()) { - mergeBilling(other.getBilling()); - } - if (other.hasRetentionPolicy()) { - mergeRetentionPolicy(other.getRetentionPolicy()); - } - if (other.hasIamConfig()) { - mergeIamConfig(other.getIamConfig()); - } - if (other.getSatisfiesPzs() != false) { - setSatisfiesPzs(other.getSatisfiesPzs()); - } - if (other.hasCustomPlacementConfig()) { - mergeCustomPlacementConfig(other.getCustomPlacementConfig()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.Bucket parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.Bucket) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * Immutable. The name of the bucket.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Immutable. The name of the bucket.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Immutable. The name of the bucket.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Immutable. The name of the bucket.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * - * - *
-     * Immutable. The name of the bucket.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object bucketId_ = ""; - /** - * - * - *
-     * Output only. The user-chosen part of the bucket name. The `{bucket}` portion of the
-     * `name` field. For globally unique buckets, this is equal to the "bucket
-     * name" of other Cloud Storage APIs. Example: "pub".
-     * 
- * - * string bucket_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bucketId. - */ - public java.lang.String getBucketId() { - java.lang.Object ref = bucketId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - bucketId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Output only. The user-chosen part of the bucket name. The `{bucket}` portion of the
-     * `name` field. For globally unique buckets, this is equal to the "bucket
-     * name" of other Cloud Storage APIs. Example: "pub".
-     * 
- * - * string bucket_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for bucketId. - */ - public com.google.protobuf.ByteString getBucketIdBytes() { - java.lang.Object ref = bucketId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - bucketId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Output only. The user-chosen part of the bucket name. The `{bucket}` portion of the
-     * `name` field. For globally unique buckets, this is equal to the "bucket
-     * name" of other Cloud Storage APIs. Example: "pub".
-     * 
- * - * string bucket_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The bucketId to set. - * @return This builder for chaining. - */ - public Builder setBucketId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - bucketId_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. The user-chosen part of the bucket name. The `{bucket}` portion of the
-     * `name` field. For globally unique buckets, this is equal to the "bucket
-     * name" of other Cloud Storage APIs. Example: "pub".
-     * 
- * - * string bucket_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return This builder for chaining. - */ - public Builder clearBucketId() { - - bucketId_ = getDefaultInstance().getBucketId(); - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. The user-chosen part of the bucket name. The `{bucket}` portion of the
-     * `name` field. For globally unique buckets, this is equal to the "bucket
-     * name" of other Cloud Storage APIs. Example: "pub".
-     * 
- * - * string bucket_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The bytes for bucketId to set. - * @return This builder for chaining. - */ - public Builder setBucketIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - bucketId_ = value; - onChanged(); - return this; - } - - private java.lang.Object project_ = ""; - /** - * - * - *
-     * Immutable. The project which owns this bucket.
-     * 
- * - * - * string project = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - public java.lang.String getProject() { - java.lang.Object ref = project_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - project_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Immutable. The project which owns this bucket.
-     * 
- * - * - * string project = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - public com.google.protobuf.ByteString getProjectBytes() { - java.lang.Object ref = project_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - project_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Immutable. The project which owns this bucket.
-     * 
- * - * - * string project = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @param value The project to set. - * @return This builder for chaining. - */ - public Builder setProject(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - project_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Immutable. The project which owns this bucket.
-     * 
- * - * - * string project = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearProject() { - - project_ = getDefaultInstance().getProject(); - onChanged(); - return this; - } - /** - * - * - *
-     * Immutable. The project which owns this bucket.
-     * 
- * - * - * string project = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for project to set. - * @return This builder for chaining. - */ - public Builder setProjectBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - project_ = value; - onChanged(); - return this; - } - - private long metageneration_; - /** - * - * - *
-     * Output only. The metadata generation of this bucket.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * int64 metageneration = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The metageneration. - */ - @java.lang.Override - public long getMetageneration() { - return metageneration_; - } - /** - * - * - *
-     * Output only. The metadata generation of this bucket.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * int64 metageneration = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The metageneration to set. - * @return This builder for chaining. - */ - public Builder setMetageneration(long value) { - - metageneration_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. The metadata generation of this bucket.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * int64 metageneration = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return This builder for chaining. - */ - public Builder clearMetageneration() { - - metageneration_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object location_ = ""; - /** - * - * - *
-     * Immutable. The location of the bucket. Object data for objects in the bucket resides
-     * in physical storage within this region.  Defaults to `US`. See the
-     * [https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations"][developer's
-     * guide] for the authoritative list. Attempting to update this field after
-     * the bucket is created will result in an error.
-     * 
- * - * string location = 5 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The location. - */ - public java.lang.String getLocation() { - java.lang.Object ref = location_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - location_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Immutable. The location of the bucket. Object data for objects in the bucket resides
-     * in physical storage within this region.  Defaults to `US`. See the
-     * [https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations"][developer's
-     * guide] for the authoritative list. Attempting to update this field after
-     * the bucket is created will result in an error.
-     * 
- * - * string location = 5 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The bytes for location. - */ - public com.google.protobuf.ByteString getLocationBytes() { - java.lang.Object ref = location_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - location_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Immutable. The location of the bucket. Object data for objects in the bucket resides
-     * in physical storage within this region.  Defaults to `US`. See the
-     * [https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations"][developer's
-     * guide] for the authoritative list. Attempting to update this field after
-     * the bucket is created will result in an error.
-     * 
- * - * string location = 5 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @param value The location to set. - * @return This builder for chaining. - */ - public Builder setLocation(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - location_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Immutable. The location of the bucket. Object data for objects in the bucket resides
-     * in physical storage within this region.  Defaults to `US`. See the
-     * [https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations"][developer's
-     * guide] for the authoritative list. Attempting to update this field after
-     * the bucket is created will result in an error.
-     * 
- * - * string location = 5 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return This builder for chaining. - */ - public Builder clearLocation() { - - location_ = getDefaultInstance().getLocation(); - onChanged(); - return this; - } - /** - * - * - *
-     * Immutable. The location of the bucket. Object data for objects in the bucket resides
-     * in physical storage within this region.  Defaults to `US`. See the
-     * [https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations"][developer's
-     * guide] for the authoritative list. Attempting to update this field after
-     * the bucket is created will result in an error.
-     * 
- * - * string location = 5 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @param value The bytes for location to set. - * @return This builder for chaining. - */ - public Builder setLocationBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - location_ = value; - onChanged(); - return this; - } - - private java.lang.Object locationType_ = ""; - /** - * - * - *
-     * Output only. The location type of the bucket (region, dual-region, multi-region, etc).
-     * 
- * - * string location_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The locationType. - */ - public java.lang.String getLocationType() { - java.lang.Object ref = locationType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - locationType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Output only. The location type of the bucket (region, dual-region, multi-region, etc).
-     * 
- * - * string location_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for locationType. - */ - public com.google.protobuf.ByteString getLocationTypeBytes() { - java.lang.Object ref = locationType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - locationType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Output only. The location type of the bucket (region, dual-region, multi-region, etc).
-     * 
- * - * string location_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The locationType to set. - * @return This builder for chaining. - */ - public Builder setLocationType(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - locationType_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. The location type of the bucket (region, dual-region, multi-region, etc).
-     * 
- * - * string location_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return This builder for chaining. - */ - public Builder clearLocationType() { - - locationType_ = getDefaultInstance().getLocationType(); - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. The location type of the bucket (region, dual-region, multi-region, etc).
-     * 
- * - * string location_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The bytes for locationType to set. - * @return This builder for chaining. - */ - public Builder setLocationTypeBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - locationType_ = value; - onChanged(); - return this; - } - - private java.lang.Object storageClass_ = ""; - /** - * - * - *
-     * The bucket's default storage class, used whenever no storageClass is
-     * specified for a newly-created object. This defines how objects in the
-     * bucket are stored and determines the SLA and the cost of storage.
-     * If this value is not specified when the bucket is created, it will default
-     * to `STANDARD`. For more information, see
-     * https://developers.google.com/storage/docs/storage-classes.
-     * 
- * - * string storage_class = 7; - * - * @return The storageClass. - */ - public java.lang.String getStorageClass() { - java.lang.Object ref = storageClass_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - storageClass_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The bucket's default storage class, used whenever no storageClass is
-     * specified for a newly-created object. This defines how objects in the
-     * bucket are stored and determines the SLA and the cost of storage.
-     * If this value is not specified when the bucket is created, it will default
-     * to `STANDARD`. For more information, see
-     * https://developers.google.com/storage/docs/storage-classes.
-     * 
- * - * string storage_class = 7; - * - * @return The bytes for storageClass. - */ - public com.google.protobuf.ByteString getStorageClassBytes() { - java.lang.Object ref = storageClass_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - storageClass_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The bucket's default storage class, used whenever no storageClass is
-     * specified for a newly-created object. This defines how objects in the
-     * bucket are stored and determines the SLA and the cost of storage.
-     * If this value is not specified when the bucket is created, it will default
-     * to `STANDARD`. For more information, see
-     * https://developers.google.com/storage/docs/storage-classes.
-     * 
- * - * string storage_class = 7; - * - * @param value The storageClass to set. - * @return This builder for chaining. - */ - public Builder setStorageClass(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - storageClass_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The bucket's default storage class, used whenever no storageClass is
-     * specified for a newly-created object. This defines how objects in the
-     * bucket are stored and determines the SLA and the cost of storage.
-     * If this value is not specified when the bucket is created, it will default
-     * to `STANDARD`. For more information, see
-     * https://developers.google.com/storage/docs/storage-classes.
-     * 
- * - * string storage_class = 7; - * - * @return This builder for chaining. - */ - public Builder clearStorageClass() { - - storageClass_ = getDefaultInstance().getStorageClass(); - onChanged(); - return this; - } - /** - * - * - *
-     * The bucket's default storage class, used whenever no storageClass is
-     * specified for a newly-created object. This defines how objects in the
-     * bucket are stored and determines the SLA and the cost of storage.
-     * If this value is not specified when the bucket is created, it will default
-     * to `STANDARD`. For more information, see
-     * https://developers.google.com/storage/docs/storage-classes.
-     * 
- * - * string storage_class = 7; - * - * @param value The bytes for storageClass to set. - * @return This builder for chaining. - */ - public Builder setStorageClassBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - storageClass_ = value; - onChanged(); - return this; - } - - private java.lang.Object rpo_ = ""; - /** - * - * - *
-     * The recovery point objective for cross-region replication of the bucket.
-     * Applicable only for dual- and multi-region buckets. "DEFAULT" uses default
-     * replication. "ASYNC_TURBO" enables turbo replication, valid for dual-region
-     * buckets only. If rpo is not specified when the bucket is created, it
-     * defaults to "DEFAULT". For more information, see
-     * https://cloud.google.com/storage/docs/turbo-replication.
-     * 
- * - * string rpo = 27; - * - * @return The rpo. - */ - public java.lang.String getRpo() { - java.lang.Object ref = rpo_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - rpo_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The recovery point objective for cross-region replication of the bucket.
-     * Applicable only for dual- and multi-region buckets. "DEFAULT" uses default
-     * replication. "ASYNC_TURBO" enables turbo replication, valid for dual-region
-     * buckets only. If rpo is not specified when the bucket is created, it
-     * defaults to "DEFAULT". For more information, see
-     * https://cloud.google.com/storage/docs/turbo-replication.
-     * 
- * - * string rpo = 27; - * - * @return The bytes for rpo. - */ - public com.google.protobuf.ByteString getRpoBytes() { - java.lang.Object ref = rpo_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - rpo_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The recovery point objective for cross-region replication of the bucket.
-     * Applicable only for dual- and multi-region buckets. "DEFAULT" uses default
-     * replication. "ASYNC_TURBO" enables turbo replication, valid for dual-region
-     * buckets only. If rpo is not specified when the bucket is created, it
-     * defaults to "DEFAULT". For more information, see
-     * https://cloud.google.com/storage/docs/turbo-replication.
-     * 
- * - * string rpo = 27; - * - * @param value The rpo to set. - * @return This builder for chaining. - */ - public Builder setRpo(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - rpo_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The recovery point objective for cross-region replication of the bucket.
-     * Applicable only for dual- and multi-region buckets. "DEFAULT" uses default
-     * replication. "ASYNC_TURBO" enables turbo replication, valid for dual-region
-     * buckets only. If rpo is not specified when the bucket is created, it
-     * defaults to "DEFAULT". For more information, see
-     * https://cloud.google.com/storage/docs/turbo-replication.
-     * 
- * - * string rpo = 27; - * - * @return This builder for chaining. - */ - public Builder clearRpo() { - - rpo_ = getDefaultInstance().getRpo(); - onChanged(); - return this; - } - /** - * - * - *
-     * The recovery point objective for cross-region replication of the bucket.
-     * Applicable only for dual- and multi-region buckets. "DEFAULT" uses default
-     * replication. "ASYNC_TURBO" enables turbo replication, valid for dual-region
-     * buckets only. If rpo is not specified when the bucket is created, it
-     * defaults to "DEFAULT". For more information, see
-     * https://cloud.google.com/storage/docs/turbo-replication.
-     * 
- * - * string rpo = 27; - * - * @param value The bytes for rpo to set. - * @return This builder for chaining. - */ - public Builder setRpoBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - rpo_ = value; - onChanged(); - return this; - } - - private java.util.List acl_ = - java.util.Collections.emptyList(); - - private void ensureAclIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - acl_ = new java.util.ArrayList(acl_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.BucketAccessControl, - com.google.storage.v2.BucketAccessControl.Builder, - com.google.storage.v2.BucketAccessControlOrBuilder> - aclBuilder_; - - /** - * - * - *
-     * Access controls on the bucket.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - public java.util.List getAclList() { - if (aclBuilder_ == null) { - return java.util.Collections.unmodifiableList(acl_); - } else { - return aclBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Access controls on the bucket.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - public int getAclCount() { - if (aclBuilder_ == null) { - return acl_.size(); - } else { - return aclBuilder_.getCount(); - } - } - /** - * - * - *
-     * Access controls on the bucket.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - public com.google.storage.v2.BucketAccessControl getAcl(int index) { - if (aclBuilder_ == null) { - return acl_.get(index); - } else { - return aclBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Access controls on the bucket.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - public Builder setAcl(int index, com.google.storage.v2.BucketAccessControl value) { - if (aclBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAclIsMutable(); - acl_.set(index, value); - onChanged(); - } else { - aclBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Access controls on the bucket.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - public Builder setAcl( - int index, com.google.storage.v2.BucketAccessControl.Builder builderForValue) { - if (aclBuilder_ == null) { - ensureAclIsMutable(); - acl_.set(index, builderForValue.build()); - onChanged(); - } else { - aclBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Access controls on the bucket.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - public Builder addAcl(com.google.storage.v2.BucketAccessControl value) { - if (aclBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAclIsMutable(); - acl_.add(value); - onChanged(); - } else { - aclBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Access controls on the bucket.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - public Builder addAcl(int index, com.google.storage.v2.BucketAccessControl value) { - if (aclBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAclIsMutable(); - acl_.add(index, value); - onChanged(); - } else { - aclBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Access controls on the bucket.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - public Builder addAcl(com.google.storage.v2.BucketAccessControl.Builder builderForValue) { - if (aclBuilder_ == null) { - ensureAclIsMutable(); - acl_.add(builderForValue.build()); - onChanged(); - } else { - aclBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Access controls on the bucket.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - public Builder addAcl( - int index, com.google.storage.v2.BucketAccessControl.Builder builderForValue) { - if (aclBuilder_ == null) { - ensureAclIsMutable(); - acl_.add(index, builderForValue.build()); - onChanged(); - } else { - aclBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Access controls on the bucket.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - public Builder addAllAcl( - java.lang.Iterable values) { - if (aclBuilder_ == null) { - ensureAclIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, acl_); - onChanged(); - } else { - aclBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Access controls on the bucket.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - public Builder clearAcl() { - if (aclBuilder_ == null) { - acl_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - aclBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Access controls on the bucket.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - public Builder removeAcl(int index) { - if (aclBuilder_ == null) { - ensureAclIsMutable(); - acl_.remove(index); - onChanged(); - } else { - aclBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Access controls on the bucket.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - public com.google.storage.v2.BucketAccessControl.Builder getAclBuilder(int index) { - return getAclFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Access controls on the bucket.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - public com.google.storage.v2.BucketAccessControlOrBuilder getAclOrBuilder(int index) { - if (aclBuilder_ == null) { - return acl_.get(index); - } else { - return aclBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Access controls on the bucket.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - public java.util.List - getAclOrBuilderList() { - if (aclBuilder_ != null) { - return aclBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(acl_); - } - } - /** - * - * - *
-     * Access controls on the bucket.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - public com.google.storage.v2.BucketAccessControl.Builder addAclBuilder() { - return getAclFieldBuilder() - .addBuilder(com.google.storage.v2.BucketAccessControl.getDefaultInstance()); - } - /** - * - * - *
-     * Access controls on the bucket.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - public com.google.storage.v2.BucketAccessControl.Builder addAclBuilder(int index) { - return getAclFieldBuilder() - .addBuilder(index, com.google.storage.v2.BucketAccessControl.getDefaultInstance()); - } - /** - * - * - *
-     * Access controls on the bucket.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - public java.util.List getAclBuilderList() { - return getAclFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.BucketAccessControl, - com.google.storage.v2.BucketAccessControl.Builder, - com.google.storage.v2.BucketAccessControlOrBuilder> - getAclFieldBuilder() { - if (aclBuilder_ == null) { - aclBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.BucketAccessControl, - com.google.storage.v2.BucketAccessControl.Builder, - com.google.storage.v2.BucketAccessControlOrBuilder>( - acl_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - acl_ = null; - } - return aclBuilder_; - } - - private java.util.List defaultObjectAcl_ = - java.util.Collections.emptyList(); - - private void ensureDefaultObjectAclIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - defaultObjectAcl_ = - new java.util.ArrayList(defaultObjectAcl_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.ObjectAccessControl, - com.google.storage.v2.ObjectAccessControl.Builder, - com.google.storage.v2.ObjectAccessControlOrBuilder> - defaultObjectAclBuilder_; - - /** - * - * - *
-     * Default access controls to apply to new objects when no ACL is provided.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - public java.util.List getDefaultObjectAclList() { - if (defaultObjectAclBuilder_ == null) { - return java.util.Collections.unmodifiableList(defaultObjectAcl_); - } else { - return defaultObjectAclBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Default access controls to apply to new objects when no ACL is provided.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - public int getDefaultObjectAclCount() { - if (defaultObjectAclBuilder_ == null) { - return defaultObjectAcl_.size(); - } else { - return defaultObjectAclBuilder_.getCount(); - } - } - /** - * - * - *
-     * Default access controls to apply to new objects when no ACL is provided.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - public com.google.storage.v2.ObjectAccessControl getDefaultObjectAcl(int index) { - if (defaultObjectAclBuilder_ == null) { - return defaultObjectAcl_.get(index); - } else { - return defaultObjectAclBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Default access controls to apply to new objects when no ACL is provided.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - public Builder setDefaultObjectAcl(int index, com.google.storage.v2.ObjectAccessControl value) { - if (defaultObjectAclBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDefaultObjectAclIsMutable(); - defaultObjectAcl_.set(index, value); - onChanged(); - } else { - defaultObjectAclBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Default access controls to apply to new objects when no ACL is provided.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - public Builder setDefaultObjectAcl( - int index, com.google.storage.v2.ObjectAccessControl.Builder builderForValue) { - if (defaultObjectAclBuilder_ == null) { - ensureDefaultObjectAclIsMutable(); - defaultObjectAcl_.set(index, builderForValue.build()); - onChanged(); - } else { - defaultObjectAclBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Default access controls to apply to new objects when no ACL is provided.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - public Builder addDefaultObjectAcl(com.google.storage.v2.ObjectAccessControl value) { - if (defaultObjectAclBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDefaultObjectAclIsMutable(); - defaultObjectAcl_.add(value); - onChanged(); - } else { - defaultObjectAclBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Default access controls to apply to new objects when no ACL is provided.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - public Builder addDefaultObjectAcl(int index, com.google.storage.v2.ObjectAccessControl value) { - if (defaultObjectAclBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDefaultObjectAclIsMutable(); - defaultObjectAcl_.add(index, value); - onChanged(); - } else { - defaultObjectAclBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Default access controls to apply to new objects when no ACL is provided.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - public Builder addDefaultObjectAcl( - com.google.storage.v2.ObjectAccessControl.Builder builderForValue) { - if (defaultObjectAclBuilder_ == null) { - ensureDefaultObjectAclIsMutable(); - defaultObjectAcl_.add(builderForValue.build()); - onChanged(); - } else { - defaultObjectAclBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Default access controls to apply to new objects when no ACL is provided.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - public Builder addDefaultObjectAcl( - int index, com.google.storage.v2.ObjectAccessControl.Builder builderForValue) { - if (defaultObjectAclBuilder_ == null) { - ensureDefaultObjectAclIsMutable(); - defaultObjectAcl_.add(index, builderForValue.build()); - onChanged(); - } else { - defaultObjectAclBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Default access controls to apply to new objects when no ACL is provided.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - public Builder addAllDefaultObjectAcl( - java.lang.Iterable values) { - if (defaultObjectAclBuilder_ == null) { - ensureDefaultObjectAclIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, defaultObjectAcl_); - onChanged(); - } else { - defaultObjectAclBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Default access controls to apply to new objects when no ACL is provided.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - public Builder clearDefaultObjectAcl() { - if (defaultObjectAclBuilder_ == null) { - defaultObjectAcl_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - defaultObjectAclBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Default access controls to apply to new objects when no ACL is provided.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - public Builder removeDefaultObjectAcl(int index) { - if (defaultObjectAclBuilder_ == null) { - ensureDefaultObjectAclIsMutable(); - defaultObjectAcl_.remove(index); - onChanged(); - } else { - defaultObjectAclBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Default access controls to apply to new objects when no ACL is provided.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - public com.google.storage.v2.ObjectAccessControl.Builder getDefaultObjectAclBuilder(int index) { - return getDefaultObjectAclFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Default access controls to apply to new objects when no ACL is provided.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - public com.google.storage.v2.ObjectAccessControlOrBuilder getDefaultObjectAclOrBuilder( - int index) { - if (defaultObjectAclBuilder_ == null) { - return defaultObjectAcl_.get(index); - } else { - return defaultObjectAclBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Default access controls to apply to new objects when no ACL is provided.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - public java.util.List - getDefaultObjectAclOrBuilderList() { - if (defaultObjectAclBuilder_ != null) { - return defaultObjectAclBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(defaultObjectAcl_); - } - } - /** - * - * - *
-     * Default access controls to apply to new objects when no ACL is provided.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - public com.google.storage.v2.ObjectAccessControl.Builder addDefaultObjectAclBuilder() { - return getDefaultObjectAclFieldBuilder() - .addBuilder(com.google.storage.v2.ObjectAccessControl.getDefaultInstance()); - } - /** - * - * - *
-     * Default access controls to apply to new objects when no ACL is provided.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - public com.google.storage.v2.ObjectAccessControl.Builder addDefaultObjectAclBuilder(int index) { - return getDefaultObjectAclFieldBuilder() - .addBuilder(index, com.google.storage.v2.ObjectAccessControl.getDefaultInstance()); - } - /** - * - * - *
-     * Default access controls to apply to new objects when no ACL is provided.
-     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-     * requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - public java.util.List - getDefaultObjectAclBuilderList() { - return getDefaultObjectAclFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.ObjectAccessControl, - com.google.storage.v2.ObjectAccessControl.Builder, - com.google.storage.v2.ObjectAccessControlOrBuilder> - getDefaultObjectAclFieldBuilder() { - if (defaultObjectAclBuilder_ == null) { - defaultObjectAclBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.ObjectAccessControl, - com.google.storage.v2.ObjectAccessControl.Builder, - com.google.storage.v2.ObjectAccessControlOrBuilder>( - defaultObjectAcl_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - defaultObjectAcl_ = null; - } - return defaultObjectAclBuilder_; - } - - private com.google.storage.v2.Bucket.Lifecycle lifecycle_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Lifecycle, - com.google.storage.v2.Bucket.Lifecycle.Builder, - com.google.storage.v2.Bucket.LifecycleOrBuilder> - lifecycleBuilder_; - /** - * - * - *
-     * The bucket's lifecycle config. See
-     * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
-     * for more information.
-     * 
- * - * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; - * - * @return Whether the lifecycle field is set. - */ - public boolean hasLifecycle() { - return lifecycleBuilder_ != null || lifecycle_ != null; - } - /** - * - * - *
-     * The bucket's lifecycle config. See
-     * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
-     * for more information.
-     * 
- * - * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; - * - * @return The lifecycle. - */ - public com.google.storage.v2.Bucket.Lifecycle getLifecycle() { - if (lifecycleBuilder_ == null) { - return lifecycle_ == null - ? com.google.storage.v2.Bucket.Lifecycle.getDefaultInstance() - : lifecycle_; - } else { - return lifecycleBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The bucket's lifecycle config. See
-     * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
-     * for more information.
-     * 
- * - * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; - */ - public Builder setLifecycle(com.google.storage.v2.Bucket.Lifecycle value) { - if (lifecycleBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - lifecycle_ = value; - onChanged(); - } else { - lifecycleBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * The bucket's lifecycle config. See
-     * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
-     * for more information.
-     * 
- * - * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; - */ - public Builder setLifecycle(com.google.storage.v2.Bucket.Lifecycle.Builder builderForValue) { - if (lifecycleBuilder_ == null) { - lifecycle_ = builderForValue.build(); - onChanged(); - } else { - lifecycleBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * The bucket's lifecycle config. See
-     * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
-     * for more information.
-     * 
- * - * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; - */ - public Builder mergeLifecycle(com.google.storage.v2.Bucket.Lifecycle value) { - if (lifecycleBuilder_ == null) { - if (lifecycle_ != null) { - lifecycle_ = - com.google.storage.v2.Bucket.Lifecycle.newBuilder(lifecycle_) - .mergeFrom(value) - .buildPartial(); - } else { - lifecycle_ = value; - } - onChanged(); - } else { - lifecycleBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * The bucket's lifecycle config. See
-     * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
-     * for more information.
-     * 
- * - * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; - */ - public Builder clearLifecycle() { - if (lifecycleBuilder_ == null) { - lifecycle_ = null; - onChanged(); - } else { - lifecycle_ = null; - lifecycleBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * The bucket's lifecycle config. See
-     * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
-     * for more information.
-     * 
- * - * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; - */ - public com.google.storage.v2.Bucket.Lifecycle.Builder getLifecycleBuilder() { - - onChanged(); - return getLifecycleFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The bucket's lifecycle config. See
-     * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
-     * for more information.
-     * 
- * - * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; - */ - public com.google.storage.v2.Bucket.LifecycleOrBuilder getLifecycleOrBuilder() { - if (lifecycleBuilder_ != null) { - return lifecycleBuilder_.getMessageOrBuilder(); - } else { - return lifecycle_ == null - ? com.google.storage.v2.Bucket.Lifecycle.getDefaultInstance() - : lifecycle_; - } - } - /** - * - * - *
-     * The bucket's lifecycle config. See
-     * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
-     * for more information.
-     * 
- * - * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Lifecycle, - com.google.storage.v2.Bucket.Lifecycle.Builder, - com.google.storage.v2.Bucket.LifecycleOrBuilder> - getLifecycleFieldBuilder() { - if (lifecycleBuilder_ == null) { - lifecycleBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Lifecycle, - com.google.storage.v2.Bucket.Lifecycle.Builder, - com.google.storage.v2.Bucket.LifecycleOrBuilder>( - getLifecycle(), getParentForChildren(), isClean()); - lifecycle_ = null; - } - return lifecycleBuilder_; - } - - private com.google.protobuf.Timestamp createTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - createTimeBuilder_; - /** - * - * - *
-     * Output only. The creation time of the bucket in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the createTime field is set. - */ - public boolean hasCreateTime() { - return createTimeBuilder_ != null || createTime_ != null; - } - /** - * - * - *
-     * Output only. The creation time of the bucket in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The createTime. - */ - public com.google.protobuf.Timestamp getCreateTime() { - if (createTimeBuilder_ == null) { - return createTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : createTime_; - } else { - return createTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Output only. The creation time of the bucket in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setCreateTime(com.google.protobuf.Timestamp value) { - if (createTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - createTime_ = value; - onChanged(); - } else { - createTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Output only. The creation time of the bucket in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (createTimeBuilder_ == null) { - createTime_ = builderForValue.build(); - onChanged(); - } else { - createTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Output only. The creation time of the bucket in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { - if (createTimeBuilder_ == null) { - if (createTime_ != null) { - createTime_ = - com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); - } else { - createTime_ = value; - } - onChanged(); - } else { - createTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Output only. The creation time of the bucket in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder clearCreateTime() { - if (createTimeBuilder_ == null) { - createTime_ = null; - onChanged(); - } else { - createTime_ = null; - createTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Output only. The creation time of the bucket in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { - - onChanged(); - return getCreateTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Output only. The creation time of the bucket in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { - if (createTimeBuilder_ != null) { - return createTimeBuilder_.getMessageOrBuilder(); - } else { - return createTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : createTime_; - } - } - /** - * - * - *
-     * Output only. The creation time of the bucket in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getCreateTimeFieldBuilder() { - if (createTimeBuilder_ == null) { - createTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getCreateTime(), getParentForChildren(), isClean()); - createTime_ = null; - } - return createTimeBuilder_; - } - - private java.util.List cors_ = - java.util.Collections.emptyList(); - - private void ensureCorsIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - cors_ = new java.util.ArrayList(cors_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.Bucket.Cors, - com.google.storage.v2.Bucket.Cors.Builder, - com.google.storage.v2.Bucket.CorsOrBuilder> - corsBuilder_; - - /** - * - * - *
-     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-     * (CORS) config.
-     * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - public java.util.List getCorsList() { - if (corsBuilder_ == null) { - return java.util.Collections.unmodifiableList(cors_); - } else { - return corsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-     * (CORS) config.
-     * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - public int getCorsCount() { - if (corsBuilder_ == null) { - return cors_.size(); - } else { - return corsBuilder_.getCount(); - } - } - /** - * - * - *
-     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-     * (CORS) config.
-     * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - public com.google.storage.v2.Bucket.Cors getCors(int index) { - if (corsBuilder_ == null) { - return cors_.get(index); - } else { - return corsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-     * (CORS) config.
-     * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - public Builder setCors(int index, com.google.storage.v2.Bucket.Cors value) { - if (corsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCorsIsMutable(); - cors_.set(index, value); - onChanged(); - } else { - corsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-     * (CORS) config.
-     * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - public Builder setCors(int index, com.google.storage.v2.Bucket.Cors.Builder builderForValue) { - if (corsBuilder_ == null) { - ensureCorsIsMutable(); - cors_.set(index, builderForValue.build()); - onChanged(); - } else { - corsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-     * (CORS) config.
-     * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - public Builder addCors(com.google.storage.v2.Bucket.Cors value) { - if (corsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCorsIsMutable(); - cors_.add(value); - onChanged(); - } else { - corsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-     * (CORS) config.
-     * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - public Builder addCors(int index, com.google.storage.v2.Bucket.Cors value) { - if (corsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCorsIsMutable(); - cors_.add(index, value); - onChanged(); - } else { - corsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-     * (CORS) config.
-     * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - public Builder addCors(com.google.storage.v2.Bucket.Cors.Builder builderForValue) { - if (corsBuilder_ == null) { - ensureCorsIsMutable(); - cors_.add(builderForValue.build()); - onChanged(); - } else { - corsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-     * (CORS) config.
-     * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - public Builder addCors(int index, com.google.storage.v2.Bucket.Cors.Builder builderForValue) { - if (corsBuilder_ == null) { - ensureCorsIsMutable(); - cors_.add(index, builderForValue.build()); - onChanged(); - } else { - corsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-     * (CORS) config.
-     * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - public Builder addAllCors( - java.lang.Iterable values) { - if (corsBuilder_ == null) { - ensureCorsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, cors_); - onChanged(); - } else { - corsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-     * (CORS) config.
-     * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - public Builder clearCors() { - if (corsBuilder_ == null) { - cors_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - corsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-     * (CORS) config.
-     * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - public Builder removeCors(int index) { - if (corsBuilder_ == null) { - ensureCorsIsMutable(); - cors_.remove(index); - onChanged(); - } else { - corsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-     * (CORS) config.
-     * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - public com.google.storage.v2.Bucket.Cors.Builder getCorsBuilder(int index) { - return getCorsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-     * (CORS) config.
-     * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - public com.google.storage.v2.Bucket.CorsOrBuilder getCorsOrBuilder(int index) { - if (corsBuilder_ == null) { - return cors_.get(index); - } else { - return corsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-     * (CORS) config.
-     * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - public java.util.List - getCorsOrBuilderList() { - if (corsBuilder_ != null) { - return corsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(cors_); - } - } - /** - * - * - *
-     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-     * (CORS) config.
-     * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - public com.google.storage.v2.Bucket.Cors.Builder addCorsBuilder() { - return getCorsFieldBuilder() - .addBuilder(com.google.storage.v2.Bucket.Cors.getDefaultInstance()); - } - /** - * - * - *
-     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-     * (CORS) config.
-     * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - public com.google.storage.v2.Bucket.Cors.Builder addCorsBuilder(int index) { - return getCorsFieldBuilder() - .addBuilder(index, com.google.storage.v2.Bucket.Cors.getDefaultInstance()); - } - /** - * - * - *
-     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-     * (CORS) config.
-     * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - public java.util.List getCorsBuilderList() { - return getCorsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.Bucket.Cors, - com.google.storage.v2.Bucket.Cors.Builder, - com.google.storage.v2.Bucket.CorsOrBuilder> - getCorsFieldBuilder() { - if (corsBuilder_ == null) { - corsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.Bucket.Cors, - com.google.storage.v2.Bucket.Cors.Builder, - com.google.storage.v2.Bucket.CorsOrBuilder>( - cors_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); - cors_ = null; - } - return corsBuilder_; - } - - private com.google.protobuf.Timestamp updateTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - updateTimeBuilder_; - /** - * - * - *
-     * Output only. The modification time of the bucket.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the updateTime field is set. - */ - public boolean hasUpdateTime() { - return updateTimeBuilder_ != null || updateTime_ != null; - } - /** - * - * - *
-     * Output only. The modification time of the bucket.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The updateTime. - */ - public com.google.protobuf.Timestamp getUpdateTime() { - if (updateTimeBuilder_ == null) { - return updateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : updateTime_; - } else { - return updateTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Output only. The modification time of the bucket.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setUpdateTime(com.google.protobuf.Timestamp value) { - if (updateTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - updateTime_ = value; - onChanged(); - } else { - updateTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Output only. The modification time of the bucket.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (updateTimeBuilder_ == null) { - updateTime_ = builderForValue.build(); - onChanged(); - } else { - updateTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Output only. The modification time of the bucket.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { - if (updateTimeBuilder_ == null) { - if (updateTime_ != null) { - updateTime_ = - com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); - } else { - updateTime_ = value; - } - onChanged(); - } else { - updateTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Output only. The modification time of the bucket.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder clearUpdateTime() { - if (updateTimeBuilder_ == null) { - updateTime_ = null; - onChanged(); - } else { - updateTime_ = null; - updateTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Output only. The modification time of the bucket.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { - - onChanged(); - return getUpdateTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Output only. The modification time of the bucket.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { - if (updateTimeBuilder_ != null) { - return updateTimeBuilder_.getMessageOrBuilder(); - } else { - return updateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : updateTime_; - } - } - /** - * - * - *
-     * Output only. The modification time of the bucket.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getUpdateTimeFieldBuilder() { - if (updateTimeBuilder_ == null) { - updateTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getUpdateTime(), getParentForChildren(), isClean()); - updateTime_ = null; - } - return updateTimeBuilder_; - } - - private boolean defaultEventBasedHold_; - /** - * - * - *
-     * The default value for event-based hold on newly created objects in this
-     * bucket.  Event-based hold is a way to retain objects indefinitely until an
-     * event occurs, signified by the
-     * hold's release. After being released, such objects will be subject to
-     * bucket-level retention (if any).  One sample use case of this flag is for
-     * banks to hold loan documents for at least 3 years after loan is paid in
-     * full. Here, bucket-level retention is 3 years and the event is loan being
-     * paid in full. In this example, these objects will be held intact for any
-     * number of years until the event has occurred (event-based hold on the
-     * object is released) and then 3 more years after that. That means retention
-     * duration of the objects begins from the moment event-based hold
-     * transitioned from true to false.  Objects under event-based hold cannot be
-     * deleted, overwritten or archived until the hold is removed.
-     * 
- * - * bool default_event_based_hold = 14; - * - * @return The defaultEventBasedHold. - */ - @java.lang.Override - public boolean getDefaultEventBasedHold() { - return defaultEventBasedHold_; - } - /** - * - * - *
-     * The default value for event-based hold on newly created objects in this
-     * bucket.  Event-based hold is a way to retain objects indefinitely until an
-     * event occurs, signified by the
-     * hold's release. After being released, such objects will be subject to
-     * bucket-level retention (if any).  One sample use case of this flag is for
-     * banks to hold loan documents for at least 3 years after loan is paid in
-     * full. Here, bucket-level retention is 3 years and the event is loan being
-     * paid in full. In this example, these objects will be held intact for any
-     * number of years until the event has occurred (event-based hold on the
-     * object is released) and then 3 more years after that. That means retention
-     * duration of the objects begins from the moment event-based hold
-     * transitioned from true to false.  Objects under event-based hold cannot be
-     * deleted, overwritten or archived until the hold is removed.
-     * 
- * - * bool default_event_based_hold = 14; - * - * @param value The defaultEventBasedHold to set. - * @return This builder for chaining. - */ - public Builder setDefaultEventBasedHold(boolean value) { - - defaultEventBasedHold_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The default value for event-based hold on newly created objects in this
-     * bucket.  Event-based hold is a way to retain objects indefinitely until an
-     * event occurs, signified by the
-     * hold's release. After being released, such objects will be subject to
-     * bucket-level retention (if any).  One sample use case of this flag is for
-     * banks to hold loan documents for at least 3 years after loan is paid in
-     * full. Here, bucket-level retention is 3 years and the event is loan being
-     * paid in full. In this example, these objects will be held intact for any
-     * number of years until the event has occurred (event-based hold on the
-     * object is released) and then 3 more years after that. That means retention
-     * duration of the objects begins from the moment event-based hold
-     * transitioned from true to false.  Objects under event-based hold cannot be
-     * deleted, overwritten or archived until the hold is removed.
-     * 
- * - * bool default_event_based_hold = 14; - * - * @return This builder for chaining. - */ - public Builder clearDefaultEventBasedHold() { - - defaultEventBasedHold_ = false; - onChanged(); - return this; - } - - private com.google.protobuf.MapField labels_; - - private com.google.protobuf.MapField internalGetLabels() { - if (labels_ == null) { - return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); - } - return labels_; - } - - private com.google.protobuf.MapField - internalGetMutableLabels() { - onChanged(); - ; - if (labels_ == null) { - labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); - } - if (!labels_.isMutable()) { - labels_ = labels_.copy(); - } - return labels_; - } - - public int getLabelsCount() { - return internalGetLabels().getMap().size(); - } - /** - * - * - *
-     * User-provided labels, in key/value pairs.
-     * 
- * - * map<string, string> labels = 15; - */ - @java.lang.Override - public boolean containsLabels(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - return internalGetLabels().getMap().containsKey(key); - } - /** Use {@link #getLabelsMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getLabels() { - return getLabelsMap(); - } - /** - * - * - *
-     * User-provided labels, in key/value pairs.
-     * 
- * - * map<string, string> labels = 15; - */ - @java.lang.Override - public java.util.Map getLabelsMap() { - return internalGetLabels().getMap(); - } - /** - * - * - *
-     * User-provided labels, in key/value pairs.
-     * 
- * - * map<string, string> labels = 15; - */ - @java.lang.Override - public java.lang.String getLabelsOrDefault( - java.lang.String key, java.lang.String defaultValue) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - java.util.Map map = internalGetLabels().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-     * User-provided labels, in key/value pairs.
-     * 
- * - * map<string, string> labels = 15; - */ - @java.lang.Override - public java.lang.String getLabelsOrThrow(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - java.util.Map map = internalGetLabels().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearLabels() { - internalGetMutableLabels().getMutableMap().clear(); - return this; - } - /** - * - * - *
-     * User-provided labels, in key/value pairs.
-     * 
- * - * map<string, string> labels = 15; - */ - public Builder removeLabels(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - internalGetMutableLabels().getMutableMap().remove(key); - return this; - } - /** Use alternate mutation accessors instead. */ - @java.lang.Deprecated - public java.util.Map getMutableLabels() { - return internalGetMutableLabels().getMutableMap(); - } - /** - * - * - *
-     * User-provided labels, in key/value pairs.
-     * 
- * - * map<string, string> labels = 15; - */ - public Builder putLabels(java.lang.String key, java.lang.String value) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - if (value == null) { - throw new java.lang.NullPointerException(); - } - internalGetMutableLabels().getMutableMap().put(key, value); - return this; - } - /** - * - * - *
-     * User-provided labels, in key/value pairs.
-     * 
- * - * map<string, string> labels = 15; - */ - public Builder putAllLabels(java.util.Map values) { - internalGetMutableLabels().getMutableMap().putAll(values); - return this; - } - - private com.google.storage.v2.Bucket.Website website_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Website, - com.google.storage.v2.Bucket.Website.Builder, - com.google.storage.v2.Bucket.WebsiteOrBuilder> - websiteBuilder_; - /** - * - * - *
-     * The bucket's website config, controlling how the service behaves
-     * when accessing bucket contents as a web site. See the
-     * [https://cloud.google.com/storage/docs/static-website][Static Website
-     * Examples] for more information.
-     * 
- * - * .google.storage.v2.Bucket.Website website = 16; - * - * @return Whether the website field is set. - */ - public boolean hasWebsite() { - return websiteBuilder_ != null || website_ != null; - } - /** - * - * - *
-     * The bucket's website config, controlling how the service behaves
-     * when accessing bucket contents as a web site. See the
-     * [https://cloud.google.com/storage/docs/static-website][Static Website
-     * Examples] for more information.
-     * 
- * - * .google.storage.v2.Bucket.Website website = 16; - * - * @return The website. - */ - public com.google.storage.v2.Bucket.Website getWebsite() { - if (websiteBuilder_ == null) { - return website_ == null - ? com.google.storage.v2.Bucket.Website.getDefaultInstance() - : website_; - } else { - return websiteBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The bucket's website config, controlling how the service behaves
-     * when accessing bucket contents as a web site. See the
-     * [https://cloud.google.com/storage/docs/static-website][Static Website
-     * Examples] for more information.
-     * 
- * - * .google.storage.v2.Bucket.Website website = 16; - */ - public Builder setWebsite(com.google.storage.v2.Bucket.Website value) { - if (websiteBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - website_ = value; - onChanged(); - } else { - websiteBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * The bucket's website config, controlling how the service behaves
-     * when accessing bucket contents as a web site. See the
-     * [https://cloud.google.com/storage/docs/static-website][Static Website
-     * Examples] for more information.
-     * 
- * - * .google.storage.v2.Bucket.Website website = 16; - */ - public Builder setWebsite(com.google.storage.v2.Bucket.Website.Builder builderForValue) { - if (websiteBuilder_ == null) { - website_ = builderForValue.build(); - onChanged(); - } else { - websiteBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * The bucket's website config, controlling how the service behaves
-     * when accessing bucket contents as a web site. See the
-     * [https://cloud.google.com/storage/docs/static-website][Static Website
-     * Examples] for more information.
-     * 
- * - * .google.storage.v2.Bucket.Website website = 16; - */ - public Builder mergeWebsite(com.google.storage.v2.Bucket.Website value) { - if (websiteBuilder_ == null) { - if (website_ != null) { - website_ = - com.google.storage.v2.Bucket.Website.newBuilder(website_) - .mergeFrom(value) - .buildPartial(); - } else { - website_ = value; - } - onChanged(); - } else { - websiteBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * The bucket's website config, controlling how the service behaves
-     * when accessing bucket contents as a web site. See the
-     * [https://cloud.google.com/storage/docs/static-website][Static Website
-     * Examples] for more information.
-     * 
- * - * .google.storage.v2.Bucket.Website website = 16; - */ - public Builder clearWebsite() { - if (websiteBuilder_ == null) { - website_ = null; - onChanged(); - } else { - website_ = null; - websiteBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * The bucket's website config, controlling how the service behaves
-     * when accessing bucket contents as a web site. See the
-     * [https://cloud.google.com/storage/docs/static-website][Static Website
-     * Examples] for more information.
-     * 
- * - * .google.storage.v2.Bucket.Website website = 16; - */ - public com.google.storage.v2.Bucket.Website.Builder getWebsiteBuilder() { - - onChanged(); - return getWebsiteFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The bucket's website config, controlling how the service behaves
-     * when accessing bucket contents as a web site. See the
-     * [https://cloud.google.com/storage/docs/static-website][Static Website
-     * Examples] for more information.
-     * 
- * - * .google.storage.v2.Bucket.Website website = 16; - */ - public com.google.storage.v2.Bucket.WebsiteOrBuilder getWebsiteOrBuilder() { - if (websiteBuilder_ != null) { - return websiteBuilder_.getMessageOrBuilder(); - } else { - return website_ == null - ? com.google.storage.v2.Bucket.Website.getDefaultInstance() - : website_; - } - } - /** - * - * - *
-     * The bucket's website config, controlling how the service behaves
-     * when accessing bucket contents as a web site. See the
-     * [https://cloud.google.com/storage/docs/static-website][Static Website
-     * Examples] for more information.
-     * 
- * - * .google.storage.v2.Bucket.Website website = 16; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Website, - com.google.storage.v2.Bucket.Website.Builder, - com.google.storage.v2.Bucket.WebsiteOrBuilder> - getWebsiteFieldBuilder() { - if (websiteBuilder_ == null) { - websiteBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Website, - com.google.storage.v2.Bucket.Website.Builder, - com.google.storage.v2.Bucket.WebsiteOrBuilder>( - getWebsite(), getParentForChildren(), isClean()); - website_ = null; - } - return websiteBuilder_; - } - - private com.google.storage.v2.Bucket.Versioning versioning_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Versioning, - com.google.storage.v2.Bucket.Versioning.Builder, - com.google.storage.v2.Bucket.VersioningOrBuilder> - versioningBuilder_; - /** - * - * - *
-     * The bucket's versioning config.
-     * 
- * - * .google.storage.v2.Bucket.Versioning versioning = 17; - * - * @return Whether the versioning field is set. - */ - public boolean hasVersioning() { - return versioningBuilder_ != null || versioning_ != null; - } - /** - * - * - *
-     * The bucket's versioning config.
-     * 
- * - * .google.storage.v2.Bucket.Versioning versioning = 17; - * - * @return The versioning. - */ - public com.google.storage.v2.Bucket.Versioning getVersioning() { - if (versioningBuilder_ == null) { - return versioning_ == null - ? com.google.storage.v2.Bucket.Versioning.getDefaultInstance() - : versioning_; - } else { - return versioningBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The bucket's versioning config.
-     * 
- * - * .google.storage.v2.Bucket.Versioning versioning = 17; - */ - public Builder setVersioning(com.google.storage.v2.Bucket.Versioning value) { - if (versioningBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - versioning_ = value; - onChanged(); - } else { - versioningBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * The bucket's versioning config.
-     * 
- * - * .google.storage.v2.Bucket.Versioning versioning = 17; - */ - public Builder setVersioning(com.google.storage.v2.Bucket.Versioning.Builder builderForValue) { - if (versioningBuilder_ == null) { - versioning_ = builderForValue.build(); - onChanged(); - } else { - versioningBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * The bucket's versioning config.
-     * 
- * - * .google.storage.v2.Bucket.Versioning versioning = 17; - */ - public Builder mergeVersioning(com.google.storage.v2.Bucket.Versioning value) { - if (versioningBuilder_ == null) { - if (versioning_ != null) { - versioning_ = - com.google.storage.v2.Bucket.Versioning.newBuilder(versioning_) - .mergeFrom(value) - .buildPartial(); - } else { - versioning_ = value; - } - onChanged(); - } else { - versioningBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * The bucket's versioning config.
-     * 
- * - * .google.storage.v2.Bucket.Versioning versioning = 17; - */ - public Builder clearVersioning() { - if (versioningBuilder_ == null) { - versioning_ = null; - onChanged(); - } else { - versioning_ = null; - versioningBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * The bucket's versioning config.
-     * 
- * - * .google.storage.v2.Bucket.Versioning versioning = 17; - */ - public com.google.storage.v2.Bucket.Versioning.Builder getVersioningBuilder() { - - onChanged(); - return getVersioningFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The bucket's versioning config.
-     * 
- * - * .google.storage.v2.Bucket.Versioning versioning = 17; - */ - public com.google.storage.v2.Bucket.VersioningOrBuilder getVersioningOrBuilder() { - if (versioningBuilder_ != null) { - return versioningBuilder_.getMessageOrBuilder(); - } else { - return versioning_ == null - ? com.google.storage.v2.Bucket.Versioning.getDefaultInstance() - : versioning_; - } - } - /** - * - * - *
-     * The bucket's versioning config.
-     * 
- * - * .google.storage.v2.Bucket.Versioning versioning = 17; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Versioning, - com.google.storage.v2.Bucket.Versioning.Builder, - com.google.storage.v2.Bucket.VersioningOrBuilder> - getVersioningFieldBuilder() { - if (versioningBuilder_ == null) { - versioningBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Versioning, - com.google.storage.v2.Bucket.Versioning.Builder, - com.google.storage.v2.Bucket.VersioningOrBuilder>( - getVersioning(), getParentForChildren(), isClean()); - versioning_ = null; - } - return versioningBuilder_; - } - - private com.google.storage.v2.Bucket.Logging logging_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Logging, - com.google.storage.v2.Bucket.Logging.Builder, - com.google.storage.v2.Bucket.LoggingOrBuilder> - loggingBuilder_; - /** - * - * - *
-     * The bucket's logging config, which defines the destination bucket
-     * and name prefix (if any) for the current bucket's logs.
-     * 
- * - * .google.storage.v2.Bucket.Logging logging = 18; - * - * @return Whether the logging field is set. - */ - public boolean hasLogging() { - return loggingBuilder_ != null || logging_ != null; - } - /** - * - * - *
-     * The bucket's logging config, which defines the destination bucket
-     * and name prefix (if any) for the current bucket's logs.
-     * 
- * - * .google.storage.v2.Bucket.Logging logging = 18; - * - * @return The logging. - */ - public com.google.storage.v2.Bucket.Logging getLogging() { - if (loggingBuilder_ == null) { - return logging_ == null - ? com.google.storage.v2.Bucket.Logging.getDefaultInstance() - : logging_; - } else { - return loggingBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The bucket's logging config, which defines the destination bucket
-     * and name prefix (if any) for the current bucket's logs.
-     * 
- * - * .google.storage.v2.Bucket.Logging logging = 18; - */ - public Builder setLogging(com.google.storage.v2.Bucket.Logging value) { - if (loggingBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - logging_ = value; - onChanged(); - } else { - loggingBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * The bucket's logging config, which defines the destination bucket
-     * and name prefix (if any) for the current bucket's logs.
-     * 
- * - * .google.storage.v2.Bucket.Logging logging = 18; - */ - public Builder setLogging(com.google.storage.v2.Bucket.Logging.Builder builderForValue) { - if (loggingBuilder_ == null) { - logging_ = builderForValue.build(); - onChanged(); - } else { - loggingBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * The bucket's logging config, which defines the destination bucket
-     * and name prefix (if any) for the current bucket's logs.
-     * 
- * - * .google.storage.v2.Bucket.Logging logging = 18; - */ - public Builder mergeLogging(com.google.storage.v2.Bucket.Logging value) { - if (loggingBuilder_ == null) { - if (logging_ != null) { - logging_ = - com.google.storage.v2.Bucket.Logging.newBuilder(logging_) - .mergeFrom(value) - .buildPartial(); - } else { - logging_ = value; - } - onChanged(); - } else { - loggingBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * The bucket's logging config, which defines the destination bucket
-     * and name prefix (if any) for the current bucket's logs.
-     * 
- * - * .google.storage.v2.Bucket.Logging logging = 18; - */ - public Builder clearLogging() { - if (loggingBuilder_ == null) { - logging_ = null; - onChanged(); - } else { - logging_ = null; - loggingBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * The bucket's logging config, which defines the destination bucket
-     * and name prefix (if any) for the current bucket's logs.
-     * 
- * - * .google.storage.v2.Bucket.Logging logging = 18; - */ - public com.google.storage.v2.Bucket.Logging.Builder getLoggingBuilder() { - - onChanged(); - return getLoggingFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The bucket's logging config, which defines the destination bucket
-     * and name prefix (if any) for the current bucket's logs.
-     * 
- * - * .google.storage.v2.Bucket.Logging logging = 18; - */ - public com.google.storage.v2.Bucket.LoggingOrBuilder getLoggingOrBuilder() { - if (loggingBuilder_ != null) { - return loggingBuilder_.getMessageOrBuilder(); - } else { - return logging_ == null - ? com.google.storage.v2.Bucket.Logging.getDefaultInstance() - : logging_; - } - } - /** - * - * - *
-     * The bucket's logging config, which defines the destination bucket
-     * and name prefix (if any) for the current bucket's logs.
-     * 
- * - * .google.storage.v2.Bucket.Logging logging = 18; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Logging, - com.google.storage.v2.Bucket.Logging.Builder, - com.google.storage.v2.Bucket.LoggingOrBuilder> - getLoggingFieldBuilder() { - if (loggingBuilder_ == null) { - loggingBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Logging, - com.google.storage.v2.Bucket.Logging.Builder, - com.google.storage.v2.Bucket.LoggingOrBuilder>( - getLogging(), getParentForChildren(), isClean()); - logging_ = null; - } - return loggingBuilder_; - } - - private com.google.storage.v2.Owner owner_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Owner, - com.google.storage.v2.Owner.Builder, - com.google.storage.v2.OwnerOrBuilder> - ownerBuilder_; - /** - * - * - *
-     * Output only. The owner of the bucket. This is always the project team's owner group.
-     * 
- * - * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the owner field is set. - */ - public boolean hasOwner() { - return ownerBuilder_ != null || owner_ != null; - } - /** - * - * - *
-     * Output only. The owner of the bucket. This is always the project team's owner group.
-     * 
- * - * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The owner. - */ - public com.google.storage.v2.Owner getOwner() { - if (ownerBuilder_ == null) { - return owner_ == null ? com.google.storage.v2.Owner.getDefaultInstance() : owner_; - } else { - return ownerBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Output only. The owner of the bucket. This is always the project team's owner group.
-     * 
- * - * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setOwner(com.google.storage.v2.Owner value) { - if (ownerBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - owner_ = value; - onChanged(); - } else { - ownerBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Output only. The owner of the bucket. This is always the project team's owner group.
-     * 
- * - * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setOwner(com.google.storage.v2.Owner.Builder builderForValue) { - if (ownerBuilder_ == null) { - owner_ = builderForValue.build(); - onChanged(); - } else { - ownerBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Output only. The owner of the bucket. This is always the project team's owner group.
-     * 
- * - * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder mergeOwner(com.google.storage.v2.Owner value) { - if (ownerBuilder_ == null) { - if (owner_ != null) { - owner_ = com.google.storage.v2.Owner.newBuilder(owner_).mergeFrom(value).buildPartial(); - } else { - owner_ = value; - } - onChanged(); - } else { - ownerBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Output only. The owner of the bucket. This is always the project team's owner group.
-     * 
- * - * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder clearOwner() { - if (ownerBuilder_ == null) { - owner_ = null; - onChanged(); - } else { - owner_ = null; - ownerBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Output only. The owner of the bucket. This is always the project team's owner group.
-     * 
- * - * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.storage.v2.Owner.Builder getOwnerBuilder() { - - onChanged(); - return getOwnerFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Output only. The owner of the bucket. This is always the project team's owner group.
-     * 
- * - * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.storage.v2.OwnerOrBuilder getOwnerOrBuilder() { - if (ownerBuilder_ != null) { - return ownerBuilder_.getMessageOrBuilder(); - } else { - return owner_ == null ? com.google.storage.v2.Owner.getDefaultInstance() : owner_; - } - } - /** - * - * - *
-     * Output only. The owner of the bucket. This is always the project team's owner group.
-     * 
- * - * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Owner, - com.google.storage.v2.Owner.Builder, - com.google.storage.v2.OwnerOrBuilder> - getOwnerFieldBuilder() { - if (ownerBuilder_ == null) { - ownerBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Owner, - com.google.storage.v2.Owner.Builder, - com.google.storage.v2.OwnerOrBuilder>( - getOwner(), getParentForChildren(), isClean()); - owner_ = null; - } - return ownerBuilder_; - } - - private com.google.storage.v2.Bucket.Encryption encryption_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Encryption, - com.google.storage.v2.Bucket.Encryption.Builder, - com.google.storage.v2.Bucket.EncryptionOrBuilder> - encryptionBuilder_; - /** - * - * - *
-     * Encryption config for a bucket.
-     * 
- * - * .google.storage.v2.Bucket.Encryption encryption = 20; - * - * @return Whether the encryption field is set. - */ - public boolean hasEncryption() { - return encryptionBuilder_ != null || encryption_ != null; - } - /** - * - * - *
-     * Encryption config for a bucket.
-     * 
- * - * .google.storage.v2.Bucket.Encryption encryption = 20; - * - * @return The encryption. - */ - public com.google.storage.v2.Bucket.Encryption getEncryption() { - if (encryptionBuilder_ == null) { - return encryption_ == null - ? com.google.storage.v2.Bucket.Encryption.getDefaultInstance() - : encryption_; - } else { - return encryptionBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Encryption config for a bucket.
-     * 
- * - * .google.storage.v2.Bucket.Encryption encryption = 20; - */ - public Builder setEncryption(com.google.storage.v2.Bucket.Encryption value) { - if (encryptionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - encryption_ = value; - onChanged(); - } else { - encryptionBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Encryption config for a bucket.
-     * 
- * - * .google.storage.v2.Bucket.Encryption encryption = 20; - */ - public Builder setEncryption(com.google.storage.v2.Bucket.Encryption.Builder builderForValue) { - if (encryptionBuilder_ == null) { - encryption_ = builderForValue.build(); - onChanged(); - } else { - encryptionBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Encryption config for a bucket.
-     * 
- * - * .google.storage.v2.Bucket.Encryption encryption = 20; - */ - public Builder mergeEncryption(com.google.storage.v2.Bucket.Encryption value) { - if (encryptionBuilder_ == null) { - if (encryption_ != null) { - encryption_ = - com.google.storage.v2.Bucket.Encryption.newBuilder(encryption_) - .mergeFrom(value) - .buildPartial(); - } else { - encryption_ = value; - } - onChanged(); - } else { - encryptionBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Encryption config for a bucket.
-     * 
- * - * .google.storage.v2.Bucket.Encryption encryption = 20; - */ - public Builder clearEncryption() { - if (encryptionBuilder_ == null) { - encryption_ = null; - onChanged(); - } else { - encryption_ = null; - encryptionBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Encryption config for a bucket.
-     * 
- * - * .google.storage.v2.Bucket.Encryption encryption = 20; - */ - public com.google.storage.v2.Bucket.Encryption.Builder getEncryptionBuilder() { - - onChanged(); - return getEncryptionFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Encryption config for a bucket.
-     * 
- * - * .google.storage.v2.Bucket.Encryption encryption = 20; - */ - public com.google.storage.v2.Bucket.EncryptionOrBuilder getEncryptionOrBuilder() { - if (encryptionBuilder_ != null) { - return encryptionBuilder_.getMessageOrBuilder(); - } else { - return encryption_ == null - ? com.google.storage.v2.Bucket.Encryption.getDefaultInstance() - : encryption_; - } - } - /** - * - * - *
-     * Encryption config for a bucket.
-     * 
- * - * .google.storage.v2.Bucket.Encryption encryption = 20; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Encryption, - com.google.storage.v2.Bucket.Encryption.Builder, - com.google.storage.v2.Bucket.EncryptionOrBuilder> - getEncryptionFieldBuilder() { - if (encryptionBuilder_ == null) { - encryptionBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Encryption, - com.google.storage.v2.Bucket.Encryption.Builder, - com.google.storage.v2.Bucket.EncryptionOrBuilder>( - getEncryption(), getParentForChildren(), isClean()); - encryption_ = null; - } - return encryptionBuilder_; - } - - private com.google.storage.v2.Bucket.Billing billing_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Billing, - com.google.storage.v2.Bucket.Billing.Builder, - com.google.storage.v2.Bucket.BillingOrBuilder> - billingBuilder_; - /** - * - * - *
-     * The bucket's billing config.
-     * 
- * - * .google.storage.v2.Bucket.Billing billing = 21; - * - * @return Whether the billing field is set. - */ - public boolean hasBilling() { - return billingBuilder_ != null || billing_ != null; - } - /** - * - * - *
-     * The bucket's billing config.
-     * 
- * - * .google.storage.v2.Bucket.Billing billing = 21; - * - * @return The billing. - */ - public com.google.storage.v2.Bucket.Billing getBilling() { - if (billingBuilder_ == null) { - return billing_ == null - ? com.google.storage.v2.Bucket.Billing.getDefaultInstance() - : billing_; - } else { - return billingBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The bucket's billing config.
-     * 
- * - * .google.storage.v2.Bucket.Billing billing = 21; - */ - public Builder setBilling(com.google.storage.v2.Bucket.Billing value) { - if (billingBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - billing_ = value; - onChanged(); - } else { - billingBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * The bucket's billing config.
-     * 
- * - * .google.storage.v2.Bucket.Billing billing = 21; - */ - public Builder setBilling(com.google.storage.v2.Bucket.Billing.Builder builderForValue) { - if (billingBuilder_ == null) { - billing_ = builderForValue.build(); - onChanged(); - } else { - billingBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * The bucket's billing config.
-     * 
- * - * .google.storage.v2.Bucket.Billing billing = 21; - */ - public Builder mergeBilling(com.google.storage.v2.Bucket.Billing value) { - if (billingBuilder_ == null) { - if (billing_ != null) { - billing_ = - com.google.storage.v2.Bucket.Billing.newBuilder(billing_) - .mergeFrom(value) - .buildPartial(); - } else { - billing_ = value; - } - onChanged(); - } else { - billingBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * The bucket's billing config.
-     * 
- * - * .google.storage.v2.Bucket.Billing billing = 21; - */ - public Builder clearBilling() { - if (billingBuilder_ == null) { - billing_ = null; - onChanged(); - } else { - billing_ = null; - billingBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * The bucket's billing config.
-     * 
- * - * .google.storage.v2.Bucket.Billing billing = 21; - */ - public com.google.storage.v2.Bucket.Billing.Builder getBillingBuilder() { - - onChanged(); - return getBillingFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The bucket's billing config.
-     * 
- * - * .google.storage.v2.Bucket.Billing billing = 21; - */ - public com.google.storage.v2.Bucket.BillingOrBuilder getBillingOrBuilder() { - if (billingBuilder_ != null) { - return billingBuilder_.getMessageOrBuilder(); - } else { - return billing_ == null - ? com.google.storage.v2.Bucket.Billing.getDefaultInstance() - : billing_; - } - } - /** - * - * - *
-     * The bucket's billing config.
-     * 
- * - * .google.storage.v2.Bucket.Billing billing = 21; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Billing, - com.google.storage.v2.Bucket.Billing.Builder, - com.google.storage.v2.Bucket.BillingOrBuilder> - getBillingFieldBuilder() { - if (billingBuilder_ == null) { - billingBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.Billing, - com.google.storage.v2.Bucket.Billing.Builder, - com.google.storage.v2.Bucket.BillingOrBuilder>( - getBilling(), getParentForChildren(), isClean()); - billing_ = null; - } - return billingBuilder_; - } - - private com.google.storage.v2.Bucket.RetentionPolicy retentionPolicy_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.RetentionPolicy, - com.google.storage.v2.Bucket.RetentionPolicy.Builder, - com.google.storage.v2.Bucket.RetentionPolicyOrBuilder> - retentionPolicyBuilder_; - /** - * - * - *
-     * The bucket's retention policy. The retention policy enforces a minimum
-     * retention time for all objects contained in the bucket, based on their
-     * creation time. Any attempt to overwrite or delete objects younger than the
-     * retention period will result in a PERMISSION_DENIED error.  An unlocked
-     * retention policy can be modified or removed from the bucket via a
-     * storage.buckets.update operation. A locked retention policy cannot be
-     * removed or shortened in duration for the lifetime of the bucket.
-     * Attempting to remove or decrease period of a locked retention policy will
-     * result in a PERMISSION_DENIED error.
-     * 
- * - * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; - * - * @return Whether the retentionPolicy field is set. - */ - public boolean hasRetentionPolicy() { - return retentionPolicyBuilder_ != null || retentionPolicy_ != null; - } - /** - * - * - *
-     * The bucket's retention policy. The retention policy enforces a minimum
-     * retention time for all objects contained in the bucket, based on their
-     * creation time. Any attempt to overwrite or delete objects younger than the
-     * retention period will result in a PERMISSION_DENIED error.  An unlocked
-     * retention policy can be modified or removed from the bucket via a
-     * storage.buckets.update operation. A locked retention policy cannot be
-     * removed or shortened in duration for the lifetime of the bucket.
-     * Attempting to remove or decrease period of a locked retention policy will
-     * result in a PERMISSION_DENIED error.
-     * 
- * - * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; - * - * @return The retentionPolicy. - */ - public com.google.storage.v2.Bucket.RetentionPolicy getRetentionPolicy() { - if (retentionPolicyBuilder_ == null) { - return retentionPolicy_ == null - ? com.google.storage.v2.Bucket.RetentionPolicy.getDefaultInstance() - : retentionPolicy_; - } else { - return retentionPolicyBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The bucket's retention policy. The retention policy enforces a minimum
-     * retention time for all objects contained in the bucket, based on their
-     * creation time. Any attempt to overwrite or delete objects younger than the
-     * retention period will result in a PERMISSION_DENIED error.  An unlocked
-     * retention policy can be modified or removed from the bucket via a
-     * storage.buckets.update operation. A locked retention policy cannot be
-     * removed or shortened in duration for the lifetime of the bucket.
-     * Attempting to remove or decrease period of a locked retention policy will
-     * result in a PERMISSION_DENIED error.
-     * 
- * - * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; - */ - public Builder setRetentionPolicy(com.google.storage.v2.Bucket.RetentionPolicy value) { - if (retentionPolicyBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - retentionPolicy_ = value; - onChanged(); - } else { - retentionPolicyBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * The bucket's retention policy. The retention policy enforces a minimum
-     * retention time for all objects contained in the bucket, based on their
-     * creation time. Any attempt to overwrite or delete objects younger than the
-     * retention period will result in a PERMISSION_DENIED error.  An unlocked
-     * retention policy can be modified or removed from the bucket via a
-     * storage.buckets.update operation. A locked retention policy cannot be
-     * removed or shortened in duration for the lifetime of the bucket.
-     * Attempting to remove or decrease period of a locked retention policy will
-     * result in a PERMISSION_DENIED error.
-     * 
- * - * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; - */ - public Builder setRetentionPolicy( - com.google.storage.v2.Bucket.RetentionPolicy.Builder builderForValue) { - if (retentionPolicyBuilder_ == null) { - retentionPolicy_ = builderForValue.build(); - onChanged(); - } else { - retentionPolicyBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * The bucket's retention policy. The retention policy enforces a minimum
-     * retention time for all objects contained in the bucket, based on their
-     * creation time. Any attempt to overwrite or delete objects younger than the
-     * retention period will result in a PERMISSION_DENIED error.  An unlocked
-     * retention policy can be modified or removed from the bucket via a
-     * storage.buckets.update operation. A locked retention policy cannot be
-     * removed or shortened in duration for the lifetime of the bucket.
-     * Attempting to remove or decrease period of a locked retention policy will
-     * result in a PERMISSION_DENIED error.
-     * 
- * - * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; - */ - public Builder mergeRetentionPolicy(com.google.storage.v2.Bucket.RetentionPolicy value) { - if (retentionPolicyBuilder_ == null) { - if (retentionPolicy_ != null) { - retentionPolicy_ = - com.google.storage.v2.Bucket.RetentionPolicy.newBuilder(retentionPolicy_) - .mergeFrom(value) - .buildPartial(); - } else { - retentionPolicy_ = value; - } - onChanged(); - } else { - retentionPolicyBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * The bucket's retention policy. The retention policy enforces a minimum
-     * retention time for all objects contained in the bucket, based on their
-     * creation time. Any attempt to overwrite or delete objects younger than the
-     * retention period will result in a PERMISSION_DENIED error.  An unlocked
-     * retention policy can be modified or removed from the bucket via a
-     * storage.buckets.update operation. A locked retention policy cannot be
-     * removed or shortened in duration for the lifetime of the bucket.
-     * Attempting to remove or decrease period of a locked retention policy will
-     * result in a PERMISSION_DENIED error.
-     * 
- * - * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; - */ - public Builder clearRetentionPolicy() { - if (retentionPolicyBuilder_ == null) { - retentionPolicy_ = null; - onChanged(); - } else { - retentionPolicy_ = null; - retentionPolicyBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * The bucket's retention policy. The retention policy enforces a minimum
-     * retention time for all objects contained in the bucket, based on their
-     * creation time. Any attempt to overwrite or delete objects younger than the
-     * retention period will result in a PERMISSION_DENIED error.  An unlocked
-     * retention policy can be modified or removed from the bucket via a
-     * storage.buckets.update operation. A locked retention policy cannot be
-     * removed or shortened in duration for the lifetime of the bucket.
-     * Attempting to remove or decrease period of a locked retention policy will
-     * result in a PERMISSION_DENIED error.
-     * 
- * - * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; - */ - public com.google.storage.v2.Bucket.RetentionPolicy.Builder getRetentionPolicyBuilder() { - - onChanged(); - return getRetentionPolicyFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The bucket's retention policy. The retention policy enforces a minimum
-     * retention time for all objects contained in the bucket, based on their
-     * creation time. Any attempt to overwrite or delete objects younger than the
-     * retention period will result in a PERMISSION_DENIED error.  An unlocked
-     * retention policy can be modified or removed from the bucket via a
-     * storage.buckets.update operation. A locked retention policy cannot be
-     * removed or shortened in duration for the lifetime of the bucket.
-     * Attempting to remove or decrease period of a locked retention policy will
-     * result in a PERMISSION_DENIED error.
-     * 
- * - * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; - */ - public com.google.storage.v2.Bucket.RetentionPolicyOrBuilder getRetentionPolicyOrBuilder() { - if (retentionPolicyBuilder_ != null) { - return retentionPolicyBuilder_.getMessageOrBuilder(); - } else { - return retentionPolicy_ == null - ? com.google.storage.v2.Bucket.RetentionPolicy.getDefaultInstance() - : retentionPolicy_; - } - } - /** - * - * - *
-     * The bucket's retention policy. The retention policy enforces a minimum
-     * retention time for all objects contained in the bucket, based on their
-     * creation time. Any attempt to overwrite or delete objects younger than the
-     * retention period will result in a PERMISSION_DENIED error.  An unlocked
-     * retention policy can be modified or removed from the bucket via a
-     * storage.buckets.update operation. A locked retention policy cannot be
-     * removed or shortened in duration for the lifetime of the bucket.
-     * Attempting to remove or decrease period of a locked retention policy will
-     * result in a PERMISSION_DENIED error.
-     * 
- * - * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.RetentionPolicy, - com.google.storage.v2.Bucket.RetentionPolicy.Builder, - com.google.storage.v2.Bucket.RetentionPolicyOrBuilder> - getRetentionPolicyFieldBuilder() { - if (retentionPolicyBuilder_ == null) { - retentionPolicyBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.RetentionPolicy, - com.google.storage.v2.Bucket.RetentionPolicy.Builder, - com.google.storage.v2.Bucket.RetentionPolicyOrBuilder>( - getRetentionPolicy(), getParentForChildren(), isClean()); - retentionPolicy_ = null; - } - return retentionPolicyBuilder_; - } - - private com.google.storage.v2.Bucket.IamConfig iamConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.IamConfig, - com.google.storage.v2.Bucket.IamConfig.Builder, - com.google.storage.v2.Bucket.IamConfigOrBuilder> - iamConfigBuilder_; - /** - * - * - *
-     * The bucket's IAM config.
-     * 
- * - * .google.storage.v2.Bucket.IamConfig iam_config = 23; - * - * @return Whether the iamConfig field is set. - */ - public boolean hasIamConfig() { - return iamConfigBuilder_ != null || iamConfig_ != null; - } - /** - * - * - *
-     * The bucket's IAM config.
-     * 
- * - * .google.storage.v2.Bucket.IamConfig iam_config = 23; - * - * @return The iamConfig. - */ - public com.google.storage.v2.Bucket.IamConfig getIamConfig() { - if (iamConfigBuilder_ == null) { - return iamConfig_ == null - ? com.google.storage.v2.Bucket.IamConfig.getDefaultInstance() - : iamConfig_; - } else { - return iamConfigBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The bucket's IAM config.
-     * 
- * - * .google.storage.v2.Bucket.IamConfig iam_config = 23; - */ - public Builder setIamConfig(com.google.storage.v2.Bucket.IamConfig value) { - if (iamConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - iamConfig_ = value; - onChanged(); - } else { - iamConfigBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * The bucket's IAM config.
-     * 
- * - * .google.storage.v2.Bucket.IamConfig iam_config = 23; - */ - public Builder setIamConfig(com.google.storage.v2.Bucket.IamConfig.Builder builderForValue) { - if (iamConfigBuilder_ == null) { - iamConfig_ = builderForValue.build(); - onChanged(); - } else { - iamConfigBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * The bucket's IAM config.
-     * 
- * - * .google.storage.v2.Bucket.IamConfig iam_config = 23; - */ - public Builder mergeIamConfig(com.google.storage.v2.Bucket.IamConfig value) { - if (iamConfigBuilder_ == null) { - if (iamConfig_ != null) { - iamConfig_ = - com.google.storage.v2.Bucket.IamConfig.newBuilder(iamConfig_) - .mergeFrom(value) - .buildPartial(); - } else { - iamConfig_ = value; - } - onChanged(); - } else { - iamConfigBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * The bucket's IAM config.
-     * 
- * - * .google.storage.v2.Bucket.IamConfig iam_config = 23; - */ - public Builder clearIamConfig() { - if (iamConfigBuilder_ == null) { - iamConfig_ = null; - onChanged(); - } else { - iamConfig_ = null; - iamConfigBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * The bucket's IAM config.
-     * 
- * - * .google.storage.v2.Bucket.IamConfig iam_config = 23; - */ - public com.google.storage.v2.Bucket.IamConfig.Builder getIamConfigBuilder() { - - onChanged(); - return getIamConfigFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The bucket's IAM config.
-     * 
- * - * .google.storage.v2.Bucket.IamConfig iam_config = 23; - */ - public com.google.storage.v2.Bucket.IamConfigOrBuilder getIamConfigOrBuilder() { - if (iamConfigBuilder_ != null) { - return iamConfigBuilder_.getMessageOrBuilder(); - } else { - return iamConfig_ == null - ? com.google.storage.v2.Bucket.IamConfig.getDefaultInstance() - : iamConfig_; - } - } - /** - * - * - *
-     * The bucket's IAM config.
-     * 
- * - * .google.storage.v2.Bucket.IamConfig iam_config = 23; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.IamConfig, - com.google.storage.v2.Bucket.IamConfig.Builder, - com.google.storage.v2.Bucket.IamConfigOrBuilder> - getIamConfigFieldBuilder() { - if (iamConfigBuilder_ == null) { - iamConfigBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.IamConfig, - com.google.storage.v2.Bucket.IamConfig.Builder, - com.google.storage.v2.Bucket.IamConfigOrBuilder>( - getIamConfig(), getParentForChildren(), isClean()); - iamConfig_ = null; - } - return iamConfigBuilder_; - } - - private boolean satisfiesPzs_; - /** - * - * - *
-     * Reserved for future use.
-     * 
- * - * bool satisfies_pzs = 25; - * - * @return The satisfiesPzs. - */ - @java.lang.Override - public boolean getSatisfiesPzs() { - return satisfiesPzs_; - } - /** - * - * - *
-     * Reserved for future use.
-     * 
- * - * bool satisfies_pzs = 25; - * - * @param value The satisfiesPzs to set. - * @return This builder for chaining. - */ - public Builder setSatisfiesPzs(boolean value) { - - satisfiesPzs_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Reserved for future use.
-     * 
- * - * bool satisfies_pzs = 25; - * - * @return This builder for chaining. - */ - public Builder clearSatisfiesPzs() { - - satisfiesPzs_ = false; - onChanged(); - return this; - } - - private com.google.storage.v2.Bucket.CustomPlacementConfig customPlacementConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.CustomPlacementConfig, - com.google.storage.v2.Bucket.CustomPlacementConfig.Builder, - com.google.storage.v2.Bucket.CustomPlacementConfigOrBuilder> - customPlacementConfigBuilder_; - /** - * - * - *
-     * Configuration that, if present, specifies the data placement for a Custom
-     * Dual Region.
-     * 
- * - * .google.storage.v2.Bucket.CustomPlacementConfig custom_placement_config = 26; - * - * @return Whether the customPlacementConfig field is set. - */ - public boolean hasCustomPlacementConfig() { - return customPlacementConfigBuilder_ != null || customPlacementConfig_ != null; - } - /** - * - * - *
-     * Configuration that, if present, specifies the data placement for a Custom
-     * Dual Region.
-     * 
- * - * .google.storage.v2.Bucket.CustomPlacementConfig custom_placement_config = 26; - * - * @return The customPlacementConfig. - */ - public com.google.storage.v2.Bucket.CustomPlacementConfig getCustomPlacementConfig() { - if (customPlacementConfigBuilder_ == null) { - return customPlacementConfig_ == null - ? com.google.storage.v2.Bucket.CustomPlacementConfig.getDefaultInstance() - : customPlacementConfig_; - } else { - return customPlacementConfigBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Configuration that, if present, specifies the data placement for a Custom
-     * Dual Region.
-     * 
- * - * .google.storage.v2.Bucket.CustomPlacementConfig custom_placement_config = 26; - */ - public Builder setCustomPlacementConfig( - com.google.storage.v2.Bucket.CustomPlacementConfig value) { - if (customPlacementConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - customPlacementConfig_ = value; - onChanged(); - } else { - customPlacementConfigBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Configuration that, if present, specifies the data placement for a Custom
-     * Dual Region.
-     * 
- * - * .google.storage.v2.Bucket.CustomPlacementConfig custom_placement_config = 26; - */ - public Builder setCustomPlacementConfig( - com.google.storage.v2.Bucket.CustomPlacementConfig.Builder builderForValue) { - if (customPlacementConfigBuilder_ == null) { - customPlacementConfig_ = builderForValue.build(); - onChanged(); - } else { - customPlacementConfigBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Configuration that, if present, specifies the data placement for a Custom
-     * Dual Region.
-     * 
- * - * .google.storage.v2.Bucket.CustomPlacementConfig custom_placement_config = 26; - */ - public Builder mergeCustomPlacementConfig( - com.google.storage.v2.Bucket.CustomPlacementConfig value) { - if (customPlacementConfigBuilder_ == null) { - if (customPlacementConfig_ != null) { - customPlacementConfig_ = - com.google.storage.v2.Bucket.CustomPlacementConfig.newBuilder(customPlacementConfig_) - .mergeFrom(value) - .buildPartial(); - } else { - customPlacementConfig_ = value; - } - onChanged(); - } else { - customPlacementConfigBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Configuration that, if present, specifies the data placement for a Custom
-     * Dual Region.
-     * 
- * - * .google.storage.v2.Bucket.CustomPlacementConfig custom_placement_config = 26; - */ - public Builder clearCustomPlacementConfig() { - if (customPlacementConfigBuilder_ == null) { - customPlacementConfig_ = null; - onChanged(); - } else { - customPlacementConfig_ = null; - customPlacementConfigBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Configuration that, if present, specifies the data placement for a Custom
-     * Dual Region.
-     * 
- * - * .google.storage.v2.Bucket.CustomPlacementConfig custom_placement_config = 26; - */ - public com.google.storage.v2.Bucket.CustomPlacementConfig.Builder - getCustomPlacementConfigBuilder() { - - onChanged(); - return getCustomPlacementConfigFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Configuration that, if present, specifies the data placement for a Custom
-     * Dual Region.
-     * 
- * - * .google.storage.v2.Bucket.CustomPlacementConfig custom_placement_config = 26; - */ - public com.google.storage.v2.Bucket.CustomPlacementConfigOrBuilder - getCustomPlacementConfigOrBuilder() { - if (customPlacementConfigBuilder_ != null) { - return customPlacementConfigBuilder_.getMessageOrBuilder(); - } else { - return customPlacementConfig_ == null - ? com.google.storage.v2.Bucket.CustomPlacementConfig.getDefaultInstance() - : customPlacementConfig_; - } - } - /** - * - * - *
-     * Configuration that, if present, specifies the data placement for a Custom
-     * Dual Region.
-     * 
- * - * .google.storage.v2.Bucket.CustomPlacementConfig custom_placement_config = 26; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.CustomPlacementConfig, - com.google.storage.v2.Bucket.CustomPlacementConfig.Builder, - com.google.storage.v2.Bucket.CustomPlacementConfigOrBuilder> - getCustomPlacementConfigFieldBuilder() { - if (customPlacementConfigBuilder_ == null) { - customPlacementConfigBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket.CustomPlacementConfig, - com.google.storage.v2.Bucket.CustomPlacementConfig.Builder, - com.google.storage.v2.Bucket.CustomPlacementConfigOrBuilder>( - getCustomPlacementConfig(), getParentForChildren(), isClean()); - customPlacementConfig_ = null; - } - return customPlacementConfigBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.Bucket) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket) - private static final com.google.storage.v2.Bucket DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.Bucket(); - } - - public static com.google.storage.v2.Bucket getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Bucket parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Bucket(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.Bucket getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketAccessControl.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketAccessControl.java deleted file mode 100644 index 3c6c4a544d..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketAccessControl.java +++ /dev/null @@ -1,1903 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * An access-control entry.
- * 
- * - * Protobuf type {@code google.storage.v2.BucketAccessControl} - */ -public final class BucketAccessControl extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.BucketAccessControl) - BucketAccessControlOrBuilder { - private static final long serialVersionUID = 0L; - // Use BucketAccessControl.newBuilder() to construct. - private BucketAccessControl(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private BucketAccessControl() { - role_ = ""; - id_ = ""; - entity_ = ""; - entityId_ = ""; - email_ = ""; - domain_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new BucketAccessControl(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private BucketAccessControl( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - role_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - id_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - entity_ = s; - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - - entityId_ = s; - break; - } - case 42: - { - java.lang.String s = input.readStringRequireUtf8(); - - email_ = s; - break; - } - case 50: - { - java.lang.String s = input.readStringRequireUtf8(); - - domain_ = s; - break; - } - case 58: - { - com.google.storage.v2.ProjectTeam.Builder subBuilder = null; - if (projectTeam_ != null) { - subBuilder = projectTeam_.toBuilder(); - } - projectTeam_ = - input.readMessage(com.google.storage.v2.ProjectTeam.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(projectTeam_); - projectTeam_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_BucketAccessControl_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_BucketAccessControl_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.BucketAccessControl.class, - com.google.storage.v2.BucketAccessControl.Builder.class); - } - - public static final int ROLE_FIELD_NUMBER = 1; - private volatile java.lang.Object role_; - /** - * - * - *
-   * The access permission for the entity.
-   * 
- * - * string role = 1; - * - * @return The role. - */ - @java.lang.Override - public java.lang.String getRole() { - java.lang.Object ref = role_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - role_ = s; - return s; - } - } - /** - * - * - *
-   * The access permission for the entity.
-   * 
- * - * string role = 1; - * - * @return The bytes for role. - */ - @java.lang.Override - public com.google.protobuf.ByteString getRoleBytes() { - java.lang.Object ref = role_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - role_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ID_FIELD_NUMBER = 2; - private volatile java.lang.Object id_; - /** - * - * - *
-   * The ID of the access-control entry.
-   * 
- * - * string id = 2; - * - * @return The id. - */ - @java.lang.Override - public java.lang.String getId() { - java.lang.Object ref = id_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - id_ = s; - return s; - } - } - /** - * - * - *
-   * The ID of the access-control entry.
-   * 
- * - * string id = 2; - * - * @return The bytes for id. - */ - @java.lang.Override - public com.google.protobuf.ByteString getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - id_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ENTITY_FIELD_NUMBER = 3; - private volatile java.lang.Object entity_; - /** - * - * - *
-   * The entity holding the permission, in one of the following forms:
-   * * `user-{userid}`
-   * * `user-{email}`
-   * * `group-{groupid}`
-   * * `group-{email}`
-   * * `domain-{domain}`
-   * * `project-{team-projectid}`
-   * * `allUsers`
-   * * `allAuthenticatedUsers`
-   * Examples:
-   * * The user `liz@example.com` would be `user-liz@example.com`.
-   * * The group `example@googlegroups.com` would be
-   * `group-example@googlegroups.com`
-   * * All members of the Google Apps for Business domain `example.com` would be
-   * `domain-example.com`
-   * 
- * - * string entity = 3; - * - * @return The entity. - */ - @java.lang.Override - public java.lang.String getEntity() { - java.lang.Object ref = entity_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - entity_ = s; - return s; - } - } - /** - * - * - *
-   * The entity holding the permission, in one of the following forms:
-   * * `user-{userid}`
-   * * `user-{email}`
-   * * `group-{groupid}`
-   * * `group-{email}`
-   * * `domain-{domain}`
-   * * `project-{team-projectid}`
-   * * `allUsers`
-   * * `allAuthenticatedUsers`
-   * Examples:
-   * * The user `liz@example.com` would be `user-liz@example.com`.
-   * * The group `example@googlegroups.com` would be
-   * `group-example@googlegroups.com`
-   * * All members of the Google Apps for Business domain `example.com` would be
-   * `domain-example.com`
-   * 
- * - * string entity = 3; - * - * @return The bytes for entity. - */ - @java.lang.Override - public com.google.protobuf.ByteString getEntityBytes() { - java.lang.Object ref = entity_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - entity_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ENTITY_ID_FIELD_NUMBER = 4; - private volatile java.lang.Object entityId_; - /** - * - * - *
-   * The ID for the entity, if any.
-   * 
- * - * string entity_id = 4; - * - * @return The entityId. - */ - @java.lang.Override - public java.lang.String getEntityId() { - java.lang.Object ref = entityId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - entityId_ = s; - return s; - } - } - /** - * - * - *
-   * The ID for the entity, if any.
-   * 
- * - * string entity_id = 4; - * - * @return The bytes for entityId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getEntityIdBytes() { - java.lang.Object ref = entityId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - entityId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int EMAIL_FIELD_NUMBER = 5; - private volatile java.lang.Object email_; - /** - * - * - *
-   * The email address associated with the entity, if any.
-   * 
- * - * string email = 5; - * - * @return The email. - */ - @java.lang.Override - public java.lang.String getEmail() { - java.lang.Object ref = email_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - email_ = s; - return s; - } - } - /** - * - * - *
-   * The email address associated with the entity, if any.
-   * 
- * - * string email = 5; - * - * @return The bytes for email. - */ - @java.lang.Override - public com.google.protobuf.ByteString getEmailBytes() { - java.lang.Object ref = email_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - email_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DOMAIN_FIELD_NUMBER = 6; - private volatile java.lang.Object domain_; - /** - * - * - *
-   * The domain associated with the entity, if any.
-   * 
- * - * string domain = 6; - * - * @return The domain. - */ - @java.lang.Override - public java.lang.String getDomain() { - java.lang.Object ref = domain_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - domain_ = s; - return s; - } - } - /** - * - * - *
-   * The domain associated with the entity, if any.
-   * 
- * - * string domain = 6; - * - * @return The bytes for domain. - */ - @java.lang.Override - public com.google.protobuf.ByteString getDomainBytes() { - java.lang.Object ref = domain_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - domain_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PROJECT_TEAM_FIELD_NUMBER = 7; - private com.google.storage.v2.ProjectTeam projectTeam_; - /** - * - * - *
-   * The project team associated with the entity, if any.
-   * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - * - * @return Whether the projectTeam field is set. - */ - @java.lang.Override - public boolean hasProjectTeam() { - return projectTeam_ != null; - } - /** - * - * - *
-   * The project team associated with the entity, if any.
-   * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - * - * @return The projectTeam. - */ - @java.lang.Override - public com.google.storage.v2.ProjectTeam getProjectTeam() { - return projectTeam_ == null - ? com.google.storage.v2.ProjectTeam.getDefaultInstance() - : projectTeam_; - } - /** - * - * - *
-   * The project team associated with the entity, if any.
-   * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - */ - @java.lang.Override - public com.google.storage.v2.ProjectTeamOrBuilder getProjectTeamOrBuilder() { - return getProjectTeam(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(role_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, role_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, id_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entity_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, entity_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entityId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, entityId_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(email_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, email_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(domain_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, domain_); - } - if (projectTeam_ != null) { - output.writeMessage(7, getProjectTeam()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(role_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, role_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, id_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entity_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, entity_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entityId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, entityId_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(email_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, email_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(domain_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, domain_); - } - if (projectTeam_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getProjectTeam()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.BucketAccessControl)) { - return super.equals(obj); - } - com.google.storage.v2.BucketAccessControl other = - (com.google.storage.v2.BucketAccessControl) obj; - - if (!getRole().equals(other.getRole())) return false; - if (!getId().equals(other.getId())) return false; - if (!getEntity().equals(other.getEntity())) return false; - if (!getEntityId().equals(other.getEntityId())) return false; - if (!getEmail().equals(other.getEmail())) return false; - if (!getDomain().equals(other.getDomain())) return false; - if (hasProjectTeam() != other.hasProjectTeam()) return false; - if (hasProjectTeam()) { - if (!getProjectTeam().equals(other.getProjectTeam())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ROLE_FIELD_NUMBER; - hash = (53 * hash) + getRole().hashCode(); - hash = (37 * hash) + ID_FIELD_NUMBER; - hash = (53 * hash) + getId().hashCode(); - hash = (37 * hash) + ENTITY_FIELD_NUMBER; - hash = (53 * hash) + getEntity().hashCode(); - hash = (37 * hash) + ENTITY_ID_FIELD_NUMBER; - hash = (53 * hash) + getEntityId().hashCode(); - hash = (37 * hash) + EMAIL_FIELD_NUMBER; - hash = (53 * hash) + getEmail().hashCode(); - hash = (37 * hash) + DOMAIN_FIELD_NUMBER; - hash = (53 * hash) + getDomain().hashCode(); - if (hasProjectTeam()) { - hash = (37 * hash) + PROJECT_TEAM_FIELD_NUMBER; - hash = (53 * hash) + getProjectTeam().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.BucketAccessControl parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.BucketAccessControl parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.BucketAccessControl parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.BucketAccessControl parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.BucketAccessControl parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.BucketAccessControl parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.BucketAccessControl parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.BucketAccessControl parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.BucketAccessControl parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.BucketAccessControl parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.BucketAccessControl parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.BucketAccessControl parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.BucketAccessControl prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * An access-control entry.
-   * 
- * - * Protobuf type {@code google.storage.v2.BucketAccessControl} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.BucketAccessControl) - com.google.storage.v2.BucketAccessControlOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_BucketAccessControl_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_BucketAccessControl_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.BucketAccessControl.class, - com.google.storage.v2.BucketAccessControl.Builder.class); - } - - // Construct using com.google.storage.v2.BucketAccessControl.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - role_ = ""; - - id_ = ""; - - entity_ = ""; - - entityId_ = ""; - - email_ = ""; - - domain_ = ""; - - if (projectTeamBuilder_ == null) { - projectTeam_ = null; - } else { - projectTeam_ = null; - projectTeamBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_BucketAccessControl_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.BucketAccessControl getDefaultInstanceForType() { - return com.google.storage.v2.BucketAccessControl.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.BucketAccessControl build() { - com.google.storage.v2.BucketAccessControl result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.BucketAccessControl buildPartial() { - com.google.storage.v2.BucketAccessControl result = - new com.google.storage.v2.BucketAccessControl(this); - result.role_ = role_; - result.id_ = id_; - result.entity_ = entity_; - result.entityId_ = entityId_; - result.email_ = email_; - result.domain_ = domain_; - if (projectTeamBuilder_ == null) { - result.projectTeam_ = projectTeam_; - } else { - result.projectTeam_ = projectTeamBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.BucketAccessControl) { - return mergeFrom((com.google.storage.v2.BucketAccessControl) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.BucketAccessControl other) { - if (other == com.google.storage.v2.BucketAccessControl.getDefaultInstance()) return this; - if (!other.getRole().isEmpty()) { - role_ = other.role_; - onChanged(); - } - if (!other.getId().isEmpty()) { - id_ = other.id_; - onChanged(); - } - if (!other.getEntity().isEmpty()) { - entity_ = other.entity_; - onChanged(); - } - if (!other.getEntityId().isEmpty()) { - entityId_ = other.entityId_; - onChanged(); - } - if (!other.getEmail().isEmpty()) { - email_ = other.email_; - onChanged(); - } - if (!other.getDomain().isEmpty()) { - domain_ = other.domain_; - onChanged(); - } - if (other.hasProjectTeam()) { - mergeProjectTeam(other.getProjectTeam()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.BucketAccessControl parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.BucketAccessControl) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object role_ = ""; - /** - * - * - *
-     * The access permission for the entity.
-     * 
- * - * string role = 1; - * - * @return The role. - */ - public java.lang.String getRole() { - java.lang.Object ref = role_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - role_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The access permission for the entity.
-     * 
- * - * string role = 1; - * - * @return The bytes for role. - */ - public com.google.protobuf.ByteString getRoleBytes() { - java.lang.Object ref = role_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - role_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The access permission for the entity.
-     * 
- * - * string role = 1; - * - * @param value The role to set. - * @return This builder for chaining. - */ - public Builder setRole(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - role_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The access permission for the entity.
-     * 
- * - * string role = 1; - * - * @return This builder for chaining. - */ - public Builder clearRole() { - - role_ = getDefaultInstance().getRole(); - onChanged(); - return this; - } - /** - * - * - *
-     * The access permission for the entity.
-     * 
- * - * string role = 1; - * - * @param value The bytes for role to set. - * @return This builder for chaining. - */ - public Builder setRoleBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - role_ = value; - onChanged(); - return this; - } - - private java.lang.Object id_ = ""; - /** - * - * - *
-     * The ID of the access-control entry.
-     * 
- * - * string id = 2; - * - * @return The id. - */ - public java.lang.String getId() { - java.lang.Object ref = id_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - id_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The ID of the access-control entry.
-     * 
- * - * string id = 2; - * - * @return The bytes for id. - */ - public com.google.protobuf.ByteString getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - id_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The ID of the access-control entry.
-     * 
- * - * string id = 2; - * - * @param value The id to set. - * @return This builder for chaining. - */ - public Builder setId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - id_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The ID of the access-control entry.
-     * 
- * - * string id = 2; - * - * @return This builder for chaining. - */ - public Builder clearId() { - - id_ = getDefaultInstance().getId(); - onChanged(); - return this; - } - /** - * - * - *
-     * The ID of the access-control entry.
-     * 
- * - * string id = 2; - * - * @param value The bytes for id to set. - * @return This builder for chaining. - */ - public Builder setIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - id_ = value; - onChanged(); - return this; - } - - private java.lang.Object entity_ = ""; - /** - * - * - *
-     * The entity holding the permission, in one of the following forms:
-     * * `user-{userid}`
-     * * `user-{email}`
-     * * `group-{groupid}`
-     * * `group-{email}`
-     * * `domain-{domain}`
-     * * `project-{team-projectid}`
-     * * `allUsers`
-     * * `allAuthenticatedUsers`
-     * Examples:
-     * * The user `liz@example.com` would be `user-liz@example.com`.
-     * * The group `example@googlegroups.com` would be
-     * `group-example@googlegroups.com`
-     * * All members of the Google Apps for Business domain `example.com` would be
-     * `domain-example.com`
-     * 
- * - * string entity = 3; - * - * @return The entity. - */ - public java.lang.String getEntity() { - java.lang.Object ref = entity_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - entity_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The entity holding the permission, in one of the following forms:
-     * * `user-{userid}`
-     * * `user-{email}`
-     * * `group-{groupid}`
-     * * `group-{email}`
-     * * `domain-{domain}`
-     * * `project-{team-projectid}`
-     * * `allUsers`
-     * * `allAuthenticatedUsers`
-     * Examples:
-     * * The user `liz@example.com` would be `user-liz@example.com`.
-     * * The group `example@googlegroups.com` would be
-     * `group-example@googlegroups.com`
-     * * All members of the Google Apps for Business domain `example.com` would be
-     * `domain-example.com`
-     * 
- * - * string entity = 3; - * - * @return The bytes for entity. - */ - public com.google.protobuf.ByteString getEntityBytes() { - java.lang.Object ref = entity_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - entity_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The entity holding the permission, in one of the following forms:
-     * * `user-{userid}`
-     * * `user-{email}`
-     * * `group-{groupid}`
-     * * `group-{email}`
-     * * `domain-{domain}`
-     * * `project-{team-projectid}`
-     * * `allUsers`
-     * * `allAuthenticatedUsers`
-     * Examples:
-     * * The user `liz@example.com` would be `user-liz@example.com`.
-     * * The group `example@googlegroups.com` would be
-     * `group-example@googlegroups.com`
-     * * All members of the Google Apps for Business domain `example.com` would be
-     * `domain-example.com`
-     * 
- * - * string entity = 3; - * - * @param value The entity to set. - * @return This builder for chaining. - */ - public Builder setEntity(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - entity_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The entity holding the permission, in one of the following forms:
-     * * `user-{userid}`
-     * * `user-{email}`
-     * * `group-{groupid}`
-     * * `group-{email}`
-     * * `domain-{domain}`
-     * * `project-{team-projectid}`
-     * * `allUsers`
-     * * `allAuthenticatedUsers`
-     * Examples:
-     * * The user `liz@example.com` would be `user-liz@example.com`.
-     * * The group `example@googlegroups.com` would be
-     * `group-example@googlegroups.com`
-     * * All members of the Google Apps for Business domain `example.com` would be
-     * `domain-example.com`
-     * 
- * - * string entity = 3; - * - * @return This builder for chaining. - */ - public Builder clearEntity() { - - entity_ = getDefaultInstance().getEntity(); - onChanged(); - return this; - } - /** - * - * - *
-     * The entity holding the permission, in one of the following forms:
-     * * `user-{userid}`
-     * * `user-{email}`
-     * * `group-{groupid}`
-     * * `group-{email}`
-     * * `domain-{domain}`
-     * * `project-{team-projectid}`
-     * * `allUsers`
-     * * `allAuthenticatedUsers`
-     * Examples:
-     * * The user `liz@example.com` would be `user-liz@example.com`.
-     * * The group `example@googlegroups.com` would be
-     * `group-example@googlegroups.com`
-     * * All members of the Google Apps for Business domain `example.com` would be
-     * `domain-example.com`
-     * 
- * - * string entity = 3; - * - * @param value The bytes for entity to set. - * @return This builder for chaining. - */ - public Builder setEntityBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - entity_ = value; - onChanged(); - return this; - } - - private java.lang.Object entityId_ = ""; - /** - * - * - *
-     * The ID for the entity, if any.
-     * 
- * - * string entity_id = 4; - * - * @return The entityId. - */ - public java.lang.String getEntityId() { - java.lang.Object ref = entityId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - entityId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The ID for the entity, if any.
-     * 
- * - * string entity_id = 4; - * - * @return The bytes for entityId. - */ - public com.google.protobuf.ByteString getEntityIdBytes() { - java.lang.Object ref = entityId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - entityId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The ID for the entity, if any.
-     * 
- * - * string entity_id = 4; - * - * @param value The entityId to set. - * @return This builder for chaining. - */ - public Builder setEntityId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - entityId_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The ID for the entity, if any.
-     * 
- * - * string entity_id = 4; - * - * @return This builder for chaining. - */ - public Builder clearEntityId() { - - entityId_ = getDefaultInstance().getEntityId(); - onChanged(); - return this; - } - /** - * - * - *
-     * The ID for the entity, if any.
-     * 
- * - * string entity_id = 4; - * - * @param value The bytes for entityId to set. - * @return This builder for chaining. - */ - public Builder setEntityIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - entityId_ = value; - onChanged(); - return this; - } - - private java.lang.Object email_ = ""; - /** - * - * - *
-     * The email address associated with the entity, if any.
-     * 
- * - * string email = 5; - * - * @return The email. - */ - public java.lang.String getEmail() { - java.lang.Object ref = email_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - email_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The email address associated with the entity, if any.
-     * 
- * - * string email = 5; - * - * @return The bytes for email. - */ - public com.google.protobuf.ByteString getEmailBytes() { - java.lang.Object ref = email_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - email_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The email address associated with the entity, if any.
-     * 
- * - * string email = 5; - * - * @param value The email to set. - * @return This builder for chaining. - */ - public Builder setEmail(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - email_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The email address associated with the entity, if any.
-     * 
- * - * string email = 5; - * - * @return This builder for chaining. - */ - public Builder clearEmail() { - - email_ = getDefaultInstance().getEmail(); - onChanged(); - return this; - } - /** - * - * - *
-     * The email address associated with the entity, if any.
-     * 
- * - * string email = 5; - * - * @param value The bytes for email to set. - * @return This builder for chaining. - */ - public Builder setEmailBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - email_ = value; - onChanged(); - return this; - } - - private java.lang.Object domain_ = ""; - /** - * - * - *
-     * The domain associated with the entity, if any.
-     * 
- * - * string domain = 6; - * - * @return The domain. - */ - public java.lang.String getDomain() { - java.lang.Object ref = domain_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - domain_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The domain associated with the entity, if any.
-     * 
- * - * string domain = 6; - * - * @return The bytes for domain. - */ - public com.google.protobuf.ByteString getDomainBytes() { - java.lang.Object ref = domain_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - domain_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The domain associated with the entity, if any.
-     * 
- * - * string domain = 6; - * - * @param value The domain to set. - * @return This builder for chaining. - */ - public Builder setDomain(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - domain_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The domain associated with the entity, if any.
-     * 
- * - * string domain = 6; - * - * @return This builder for chaining. - */ - public Builder clearDomain() { - - domain_ = getDefaultInstance().getDomain(); - onChanged(); - return this; - } - /** - * - * - *
-     * The domain associated with the entity, if any.
-     * 
- * - * string domain = 6; - * - * @param value The bytes for domain to set. - * @return This builder for chaining. - */ - public Builder setDomainBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - domain_ = value; - onChanged(); - return this; - } - - private com.google.storage.v2.ProjectTeam projectTeam_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ProjectTeam, - com.google.storage.v2.ProjectTeam.Builder, - com.google.storage.v2.ProjectTeamOrBuilder> - projectTeamBuilder_; - /** - * - * - *
-     * The project team associated with the entity, if any.
-     * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - * - * @return Whether the projectTeam field is set. - */ - public boolean hasProjectTeam() { - return projectTeamBuilder_ != null || projectTeam_ != null; - } - /** - * - * - *
-     * The project team associated with the entity, if any.
-     * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - * - * @return The projectTeam. - */ - public com.google.storage.v2.ProjectTeam getProjectTeam() { - if (projectTeamBuilder_ == null) { - return projectTeam_ == null - ? com.google.storage.v2.ProjectTeam.getDefaultInstance() - : projectTeam_; - } else { - return projectTeamBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The project team associated with the entity, if any.
-     * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - */ - public Builder setProjectTeam(com.google.storage.v2.ProjectTeam value) { - if (projectTeamBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - projectTeam_ = value; - onChanged(); - } else { - projectTeamBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * The project team associated with the entity, if any.
-     * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - */ - public Builder setProjectTeam(com.google.storage.v2.ProjectTeam.Builder builderForValue) { - if (projectTeamBuilder_ == null) { - projectTeam_ = builderForValue.build(); - onChanged(); - } else { - projectTeamBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * The project team associated with the entity, if any.
-     * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - */ - public Builder mergeProjectTeam(com.google.storage.v2.ProjectTeam value) { - if (projectTeamBuilder_ == null) { - if (projectTeam_ != null) { - projectTeam_ = - com.google.storage.v2.ProjectTeam.newBuilder(projectTeam_) - .mergeFrom(value) - .buildPartial(); - } else { - projectTeam_ = value; - } - onChanged(); - } else { - projectTeamBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * The project team associated with the entity, if any.
-     * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - */ - public Builder clearProjectTeam() { - if (projectTeamBuilder_ == null) { - projectTeam_ = null; - onChanged(); - } else { - projectTeam_ = null; - projectTeamBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * The project team associated with the entity, if any.
-     * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - */ - public com.google.storage.v2.ProjectTeam.Builder getProjectTeamBuilder() { - - onChanged(); - return getProjectTeamFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The project team associated with the entity, if any.
-     * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - */ - public com.google.storage.v2.ProjectTeamOrBuilder getProjectTeamOrBuilder() { - if (projectTeamBuilder_ != null) { - return projectTeamBuilder_.getMessageOrBuilder(); - } else { - return projectTeam_ == null - ? com.google.storage.v2.ProjectTeam.getDefaultInstance() - : projectTeam_; - } - } - /** - * - * - *
-     * The project team associated with the entity, if any.
-     * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ProjectTeam, - com.google.storage.v2.ProjectTeam.Builder, - com.google.storage.v2.ProjectTeamOrBuilder> - getProjectTeamFieldBuilder() { - if (projectTeamBuilder_ == null) { - projectTeamBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ProjectTeam, - com.google.storage.v2.ProjectTeam.Builder, - com.google.storage.v2.ProjectTeamOrBuilder>( - getProjectTeam(), getParentForChildren(), isClean()); - projectTeam_ = null; - } - return projectTeamBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.BucketAccessControl) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.BucketAccessControl) - private static final com.google.storage.v2.BucketAccessControl DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.BucketAccessControl(); - } - - public static com.google.storage.v2.BucketAccessControl getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public BucketAccessControl parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new BucketAccessControl(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.BucketAccessControl getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketAccessControlOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketAccessControlOrBuilder.java deleted file mode 100644 index 073daa3bef..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketAccessControlOrBuilder.java +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface BucketAccessControlOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.BucketAccessControl) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The access permission for the entity.
-   * 
- * - * string role = 1; - * - * @return The role. - */ - java.lang.String getRole(); - /** - * - * - *
-   * The access permission for the entity.
-   * 
- * - * string role = 1; - * - * @return The bytes for role. - */ - com.google.protobuf.ByteString getRoleBytes(); - - /** - * - * - *
-   * The ID of the access-control entry.
-   * 
- * - * string id = 2; - * - * @return The id. - */ - java.lang.String getId(); - /** - * - * - *
-   * The ID of the access-control entry.
-   * 
- * - * string id = 2; - * - * @return The bytes for id. - */ - com.google.protobuf.ByteString getIdBytes(); - - /** - * - * - *
-   * The entity holding the permission, in one of the following forms:
-   * * `user-{userid}`
-   * * `user-{email}`
-   * * `group-{groupid}`
-   * * `group-{email}`
-   * * `domain-{domain}`
-   * * `project-{team-projectid}`
-   * * `allUsers`
-   * * `allAuthenticatedUsers`
-   * Examples:
-   * * The user `liz@example.com` would be `user-liz@example.com`.
-   * * The group `example@googlegroups.com` would be
-   * `group-example@googlegroups.com`
-   * * All members of the Google Apps for Business domain `example.com` would be
-   * `domain-example.com`
-   * 
- * - * string entity = 3; - * - * @return The entity. - */ - java.lang.String getEntity(); - /** - * - * - *
-   * The entity holding the permission, in one of the following forms:
-   * * `user-{userid}`
-   * * `user-{email}`
-   * * `group-{groupid}`
-   * * `group-{email}`
-   * * `domain-{domain}`
-   * * `project-{team-projectid}`
-   * * `allUsers`
-   * * `allAuthenticatedUsers`
-   * Examples:
-   * * The user `liz@example.com` would be `user-liz@example.com`.
-   * * The group `example@googlegroups.com` would be
-   * `group-example@googlegroups.com`
-   * * All members of the Google Apps for Business domain `example.com` would be
-   * `domain-example.com`
-   * 
- * - * string entity = 3; - * - * @return The bytes for entity. - */ - com.google.protobuf.ByteString getEntityBytes(); - - /** - * - * - *
-   * The ID for the entity, if any.
-   * 
- * - * string entity_id = 4; - * - * @return The entityId. - */ - java.lang.String getEntityId(); - /** - * - * - *
-   * The ID for the entity, if any.
-   * 
- * - * string entity_id = 4; - * - * @return The bytes for entityId. - */ - com.google.protobuf.ByteString getEntityIdBytes(); - - /** - * - * - *
-   * The email address associated with the entity, if any.
-   * 
- * - * string email = 5; - * - * @return The email. - */ - java.lang.String getEmail(); - /** - * - * - *
-   * The email address associated with the entity, if any.
-   * 
- * - * string email = 5; - * - * @return The bytes for email. - */ - com.google.protobuf.ByteString getEmailBytes(); - - /** - * - * - *
-   * The domain associated with the entity, if any.
-   * 
- * - * string domain = 6; - * - * @return The domain. - */ - java.lang.String getDomain(); - /** - * - * - *
-   * The domain associated with the entity, if any.
-   * 
- * - * string domain = 6; - * - * @return The bytes for domain. - */ - com.google.protobuf.ByteString getDomainBytes(); - - /** - * - * - *
-   * The project team associated with the entity, if any.
-   * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - * - * @return Whether the projectTeam field is set. - */ - boolean hasProjectTeam(); - /** - * - * - *
-   * The project team associated with the entity, if any.
-   * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - * - * @return The projectTeam. - */ - com.google.storage.v2.ProjectTeam getProjectTeam(); - /** - * - * - *
-   * The project team associated with the entity, if any.
-   * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - */ - com.google.storage.v2.ProjectTeamOrBuilder getProjectTeamOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketName.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketName.java deleted file mode 100644 index b7844cb7c8..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketName.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.storage.v2; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class BucketName implements ResourceName { - private static final PathTemplate PROJECT_BUCKET = - PathTemplate.createWithoutUrlEncoding("projects/{project}/buckets/{bucket}"); - private volatile Map fieldValuesMap; - private final String project; - private final String bucket; - - @Deprecated - protected BucketName() { - project = null; - bucket = null; - } - - private BucketName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - bucket = Preconditions.checkNotNull(builder.getBucket()); - } - - public String getProject() { - return project; - } - - public String getBucket() { - return bucket; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static BucketName of(String project, String bucket) { - return newBuilder().setProject(project).setBucket(bucket).build(); - } - - public static String format(String project, String bucket) { - return newBuilder().setProject(project).setBucket(bucket).build().toString(); - } - - public static BucketName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PROJECT_BUCKET.validatedMatch( - formattedString, "BucketName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("bucket")); - } - - public static List parseList(List formattedStrings) { - List list = new ArrayList<>(formattedStrings.size()); - for (String formattedString : formattedStrings) { - list.add(parse(formattedString)); - } - return list; - } - - public static List toStringList(List values) { - List list = new ArrayList<>(values.size()); - for (BucketName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PROJECT_BUCKET.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { - fieldMapBuilder.put("project", project); - } - if (bucket != null) { - fieldMapBuilder.put("bucket", bucket); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PROJECT_BUCKET.instantiate("project", project, "bucket", bucket); - } - - @Override - public boolean equals(java.lang.Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - BucketName that = ((BucketName) o); - return Objects.equals(this.project, that.project) && Objects.equals(this.bucket, that.bucket); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(bucket); - return h; - } - - /** Builder for projects/{project}/buckets/{bucket}. */ - public static class Builder { - private String project; - private String bucket; - - protected Builder() {} - - public String getProject() { - return project; - } - - public String getBucket() { - return bucket; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setBucket(String bucket) { - this.bucket = bucket; - return this; - } - - private Builder(BucketName bucketName) { - this.project = bucketName.project; - this.bucket = bucketName.bucket; - } - - public BucketName build() { - return new BucketName(this); - } - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketOrBuilder.java deleted file mode 100644 index cd0232296b..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketOrBuilder.java +++ /dev/null @@ -1,1009 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface BucketOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Immutable. The name of the bucket.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-   * Immutable. The name of the bucket.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-   * Output only. The user-chosen part of the bucket name. The `{bucket}` portion of the
-   * `name` field. For globally unique buckets, this is equal to the "bucket
-   * name" of other Cloud Storage APIs. Example: "pub".
-   * 
- * - * string bucket_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bucketId. - */ - java.lang.String getBucketId(); - /** - * - * - *
-   * Output only. The user-chosen part of the bucket name. The `{bucket}` portion of the
-   * `name` field. For globally unique buckets, this is equal to the "bucket
-   * name" of other Cloud Storage APIs. Example: "pub".
-   * 
- * - * string bucket_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for bucketId. - */ - com.google.protobuf.ByteString getBucketIdBytes(); - - /** - * - * - *
-   * Immutable. The project which owns this bucket.
-   * 
- * - * - * string project = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - java.lang.String getProject(); - /** - * - * - *
-   * Immutable. The project which owns this bucket.
-   * 
- * - * - * string project = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - com.google.protobuf.ByteString getProjectBytes(); - - /** - * - * - *
-   * Output only. The metadata generation of this bucket.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * int64 metageneration = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The metageneration. - */ - long getMetageneration(); - - /** - * - * - *
-   * Immutable. The location of the bucket. Object data for objects in the bucket resides
-   * in physical storage within this region.  Defaults to `US`. See the
-   * [https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations"][developer's
-   * guide] for the authoritative list. Attempting to update this field after
-   * the bucket is created will result in an error.
-   * 
- * - * string location = 5 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The location. - */ - java.lang.String getLocation(); - /** - * - * - *
-   * Immutable. The location of the bucket. Object data for objects in the bucket resides
-   * in physical storage within this region.  Defaults to `US`. See the
-   * [https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations"][developer's
-   * guide] for the authoritative list. Attempting to update this field after
-   * the bucket is created will result in an error.
-   * 
- * - * string location = 5 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The bytes for location. - */ - com.google.protobuf.ByteString getLocationBytes(); - - /** - * - * - *
-   * Output only. The location type of the bucket (region, dual-region, multi-region, etc).
-   * 
- * - * string location_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The locationType. - */ - java.lang.String getLocationType(); - /** - * - * - *
-   * Output only. The location type of the bucket (region, dual-region, multi-region, etc).
-   * 
- * - * string location_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for locationType. - */ - com.google.protobuf.ByteString getLocationTypeBytes(); - - /** - * - * - *
-   * The bucket's default storage class, used whenever no storageClass is
-   * specified for a newly-created object. This defines how objects in the
-   * bucket are stored and determines the SLA and the cost of storage.
-   * If this value is not specified when the bucket is created, it will default
-   * to `STANDARD`. For more information, see
-   * https://developers.google.com/storage/docs/storage-classes.
-   * 
- * - * string storage_class = 7; - * - * @return The storageClass. - */ - java.lang.String getStorageClass(); - /** - * - * - *
-   * The bucket's default storage class, used whenever no storageClass is
-   * specified for a newly-created object. This defines how objects in the
-   * bucket are stored and determines the SLA and the cost of storage.
-   * If this value is not specified when the bucket is created, it will default
-   * to `STANDARD`. For more information, see
-   * https://developers.google.com/storage/docs/storage-classes.
-   * 
- * - * string storage_class = 7; - * - * @return The bytes for storageClass. - */ - com.google.protobuf.ByteString getStorageClassBytes(); - - /** - * - * - *
-   * The recovery point objective for cross-region replication of the bucket.
-   * Applicable only for dual- and multi-region buckets. "DEFAULT" uses default
-   * replication. "ASYNC_TURBO" enables turbo replication, valid for dual-region
-   * buckets only. If rpo is not specified when the bucket is created, it
-   * defaults to "DEFAULT". For more information, see
-   * https://cloud.google.com/storage/docs/turbo-replication.
-   * 
- * - * string rpo = 27; - * - * @return The rpo. - */ - java.lang.String getRpo(); - /** - * - * - *
-   * The recovery point objective for cross-region replication of the bucket.
-   * Applicable only for dual- and multi-region buckets. "DEFAULT" uses default
-   * replication. "ASYNC_TURBO" enables turbo replication, valid for dual-region
-   * buckets only. If rpo is not specified when the bucket is created, it
-   * defaults to "DEFAULT". For more information, see
-   * https://cloud.google.com/storage/docs/turbo-replication.
-   * 
- * - * string rpo = 27; - * - * @return The bytes for rpo. - */ - com.google.protobuf.ByteString getRpoBytes(); - - /** - * - * - *
-   * Access controls on the bucket.
-   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-   * requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - java.util.List getAclList(); - /** - * - * - *
-   * Access controls on the bucket.
-   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-   * requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - com.google.storage.v2.BucketAccessControl getAcl(int index); - /** - * - * - *
-   * Access controls on the bucket.
-   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-   * requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - int getAclCount(); - /** - * - * - *
-   * Access controls on the bucket.
-   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-   * requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - java.util.List - getAclOrBuilderList(); - /** - * - * - *
-   * Access controls on the bucket.
-   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-   * requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.BucketAccessControl acl = 8; - */ - com.google.storage.v2.BucketAccessControlOrBuilder getAclOrBuilder(int index); - - /** - * - * - *
-   * Default access controls to apply to new objects when no ACL is provided.
-   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-   * requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - java.util.List getDefaultObjectAclList(); - /** - * - * - *
-   * Default access controls to apply to new objects when no ACL is provided.
-   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-   * requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - com.google.storage.v2.ObjectAccessControl getDefaultObjectAcl(int index); - /** - * - * - *
-   * Default access controls to apply to new objects when no ACL is provided.
-   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-   * requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - int getDefaultObjectAclCount(); - /** - * - * - *
-   * Default access controls to apply to new objects when no ACL is provided.
-   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-   * requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - java.util.List - getDefaultObjectAclOrBuilderList(); - /** - * - * - *
-   * Default access controls to apply to new objects when no ACL is provided.
-   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
-   * requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; - */ - com.google.storage.v2.ObjectAccessControlOrBuilder getDefaultObjectAclOrBuilder(int index); - - /** - * - * - *
-   * The bucket's lifecycle config. See
-   * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
-   * for more information.
-   * 
- * - * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; - * - * @return Whether the lifecycle field is set. - */ - boolean hasLifecycle(); - /** - * - * - *
-   * The bucket's lifecycle config. See
-   * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
-   * for more information.
-   * 
- * - * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; - * - * @return The lifecycle. - */ - com.google.storage.v2.Bucket.Lifecycle getLifecycle(); - /** - * - * - *
-   * The bucket's lifecycle config. See
-   * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
-   * for more information.
-   * 
- * - * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; - */ - com.google.storage.v2.Bucket.LifecycleOrBuilder getLifecycleOrBuilder(); - - /** - * - * - *
-   * Output only. The creation time of the bucket in
-   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the createTime field is set. - */ - boolean hasCreateTime(); - /** - * - * - *
-   * Output only. The creation time of the bucket in
-   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The createTime. - */ - com.google.protobuf.Timestamp getCreateTime(); - /** - * - * - *
-   * Output only. The creation time of the bucket in
-   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); - - /** - * - * - *
-   * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-   * (CORS) config.
-   * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - java.util.List getCorsList(); - /** - * - * - *
-   * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-   * (CORS) config.
-   * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - com.google.storage.v2.Bucket.Cors getCors(int index); - /** - * - * - *
-   * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-   * (CORS) config.
-   * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - int getCorsCount(); - /** - * - * - *
-   * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-   * (CORS) config.
-   * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - java.util.List getCorsOrBuilderList(); - /** - * - * - *
-   * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
-   * (CORS) config.
-   * 
- * - * repeated .google.storage.v2.Bucket.Cors cors = 12; - */ - com.google.storage.v2.Bucket.CorsOrBuilder getCorsOrBuilder(int index); - - /** - * - * - *
-   * Output only. The modification time of the bucket.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the updateTime field is set. - */ - boolean hasUpdateTime(); - /** - * - * - *
-   * Output only. The modification time of the bucket.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The updateTime. - */ - com.google.protobuf.Timestamp getUpdateTime(); - /** - * - * - *
-   * Output only. The modification time of the bucket.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); - - /** - * - * - *
-   * The default value for event-based hold on newly created objects in this
-   * bucket.  Event-based hold is a way to retain objects indefinitely until an
-   * event occurs, signified by the
-   * hold's release. After being released, such objects will be subject to
-   * bucket-level retention (if any).  One sample use case of this flag is for
-   * banks to hold loan documents for at least 3 years after loan is paid in
-   * full. Here, bucket-level retention is 3 years and the event is loan being
-   * paid in full. In this example, these objects will be held intact for any
-   * number of years until the event has occurred (event-based hold on the
-   * object is released) and then 3 more years after that. That means retention
-   * duration of the objects begins from the moment event-based hold
-   * transitioned from true to false.  Objects under event-based hold cannot be
-   * deleted, overwritten or archived until the hold is removed.
-   * 
- * - * bool default_event_based_hold = 14; - * - * @return The defaultEventBasedHold. - */ - boolean getDefaultEventBasedHold(); - - /** - * - * - *
-   * User-provided labels, in key/value pairs.
-   * 
- * - * map<string, string> labels = 15; - */ - int getLabelsCount(); - /** - * - * - *
-   * User-provided labels, in key/value pairs.
-   * 
- * - * map<string, string> labels = 15; - */ - boolean containsLabels(java.lang.String key); - /** Use {@link #getLabelsMap()} instead. */ - @java.lang.Deprecated - java.util.Map getLabels(); - /** - * - * - *
-   * User-provided labels, in key/value pairs.
-   * 
- * - * map<string, string> labels = 15; - */ - java.util.Map getLabelsMap(); - /** - * - * - *
-   * User-provided labels, in key/value pairs.
-   * 
- * - * map<string, string> labels = 15; - */ - java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); - /** - * - * - *
-   * User-provided labels, in key/value pairs.
-   * 
- * - * map<string, string> labels = 15; - */ - java.lang.String getLabelsOrThrow(java.lang.String key); - - /** - * - * - *
-   * The bucket's website config, controlling how the service behaves
-   * when accessing bucket contents as a web site. See the
-   * [https://cloud.google.com/storage/docs/static-website][Static Website
-   * Examples] for more information.
-   * 
- * - * .google.storage.v2.Bucket.Website website = 16; - * - * @return Whether the website field is set. - */ - boolean hasWebsite(); - /** - * - * - *
-   * The bucket's website config, controlling how the service behaves
-   * when accessing bucket contents as a web site. See the
-   * [https://cloud.google.com/storage/docs/static-website][Static Website
-   * Examples] for more information.
-   * 
- * - * .google.storage.v2.Bucket.Website website = 16; - * - * @return The website. - */ - com.google.storage.v2.Bucket.Website getWebsite(); - /** - * - * - *
-   * The bucket's website config, controlling how the service behaves
-   * when accessing bucket contents as a web site. See the
-   * [https://cloud.google.com/storage/docs/static-website][Static Website
-   * Examples] for more information.
-   * 
- * - * .google.storage.v2.Bucket.Website website = 16; - */ - com.google.storage.v2.Bucket.WebsiteOrBuilder getWebsiteOrBuilder(); - - /** - * - * - *
-   * The bucket's versioning config.
-   * 
- * - * .google.storage.v2.Bucket.Versioning versioning = 17; - * - * @return Whether the versioning field is set. - */ - boolean hasVersioning(); - /** - * - * - *
-   * The bucket's versioning config.
-   * 
- * - * .google.storage.v2.Bucket.Versioning versioning = 17; - * - * @return The versioning. - */ - com.google.storage.v2.Bucket.Versioning getVersioning(); - /** - * - * - *
-   * The bucket's versioning config.
-   * 
- * - * .google.storage.v2.Bucket.Versioning versioning = 17; - */ - com.google.storage.v2.Bucket.VersioningOrBuilder getVersioningOrBuilder(); - - /** - * - * - *
-   * The bucket's logging config, which defines the destination bucket
-   * and name prefix (if any) for the current bucket's logs.
-   * 
- * - * .google.storage.v2.Bucket.Logging logging = 18; - * - * @return Whether the logging field is set. - */ - boolean hasLogging(); - /** - * - * - *
-   * The bucket's logging config, which defines the destination bucket
-   * and name prefix (if any) for the current bucket's logs.
-   * 
- * - * .google.storage.v2.Bucket.Logging logging = 18; - * - * @return The logging. - */ - com.google.storage.v2.Bucket.Logging getLogging(); - /** - * - * - *
-   * The bucket's logging config, which defines the destination bucket
-   * and name prefix (if any) for the current bucket's logs.
-   * 
- * - * .google.storage.v2.Bucket.Logging logging = 18; - */ - com.google.storage.v2.Bucket.LoggingOrBuilder getLoggingOrBuilder(); - - /** - * - * - *
-   * Output only. The owner of the bucket. This is always the project team's owner group.
-   * 
- * - * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return Whether the owner field is set. - */ - boolean hasOwner(); - /** - * - * - *
-   * Output only. The owner of the bucket. This is always the project team's owner group.
-   * 
- * - * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The owner. - */ - com.google.storage.v2.Owner getOwner(); - /** - * - * - *
-   * Output only. The owner of the bucket. This is always the project team's owner group.
-   * 
- * - * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - com.google.storage.v2.OwnerOrBuilder getOwnerOrBuilder(); - - /** - * - * - *
-   * Encryption config for a bucket.
-   * 
- * - * .google.storage.v2.Bucket.Encryption encryption = 20; - * - * @return Whether the encryption field is set. - */ - boolean hasEncryption(); - /** - * - * - *
-   * Encryption config for a bucket.
-   * 
- * - * .google.storage.v2.Bucket.Encryption encryption = 20; - * - * @return The encryption. - */ - com.google.storage.v2.Bucket.Encryption getEncryption(); - /** - * - * - *
-   * Encryption config for a bucket.
-   * 
- * - * .google.storage.v2.Bucket.Encryption encryption = 20; - */ - com.google.storage.v2.Bucket.EncryptionOrBuilder getEncryptionOrBuilder(); - - /** - * - * - *
-   * The bucket's billing config.
-   * 
- * - * .google.storage.v2.Bucket.Billing billing = 21; - * - * @return Whether the billing field is set. - */ - boolean hasBilling(); - /** - * - * - *
-   * The bucket's billing config.
-   * 
- * - * .google.storage.v2.Bucket.Billing billing = 21; - * - * @return The billing. - */ - com.google.storage.v2.Bucket.Billing getBilling(); - /** - * - * - *
-   * The bucket's billing config.
-   * 
- * - * .google.storage.v2.Bucket.Billing billing = 21; - */ - com.google.storage.v2.Bucket.BillingOrBuilder getBillingOrBuilder(); - - /** - * - * - *
-   * The bucket's retention policy. The retention policy enforces a minimum
-   * retention time for all objects contained in the bucket, based on their
-   * creation time. Any attempt to overwrite or delete objects younger than the
-   * retention period will result in a PERMISSION_DENIED error.  An unlocked
-   * retention policy can be modified or removed from the bucket via a
-   * storage.buckets.update operation. A locked retention policy cannot be
-   * removed or shortened in duration for the lifetime of the bucket.
-   * Attempting to remove or decrease period of a locked retention policy will
-   * result in a PERMISSION_DENIED error.
-   * 
- * - * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; - * - * @return Whether the retentionPolicy field is set. - */ - boolean hasRetentionPolicy(); - /** - * - * - *
-   * The bucket's retention policy. The retention policy enforces a minimum
-   * retention time for all objects contained in the bucket, based on their
-   * creation time. Any attempt to overwrite or delete objects younger than the
-   * retention period will result in a PERMISSION_DENIED error.  An unlocked
-   * retention policy can be modified or removed from the bucket via a
-   * storage.buckets.update operation. A locked retention policy cannot be
-   * removed or shortened in duration for the lifetime of the bucket.
-   * Attempting to remove or decrease period of a locked retention policy will
-   * result in a PERMISSION_DENIED error.
-   * 
- * - * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; - * - * @return The retentionPolicy. - */ - com.google.storage.v2.Bucket.RetentionPolicy getRetentionPolicy(); - /** - * - * - *
-   * The bucket's retention policy. The retention policy enforces a minimum
-   * retention time for all objects contained in the bucket, based on their
-   * creation time. Any attempt to overwrite or delete objects younger than the
-   * retention period will result in a PERMISSION_DENIED error.  An unlocked
-   * retention policy can be modified or removed from the bucket via a
-   * storage.buckets.update operation. A locked retention policy cannot be
-   * removed or shortened in duration for the lifetime of the bucket.
-   * Attempting to remove or decrease period of a locked retention policy will
-   * result in a PERMISSION_DENIED error.
-   * 
- * - * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; - */ - com.google.storage.v2.Bucket.RetentionPolicyOrBuilder getRetentionPolicyOrBuilder(); - - /** - * - * - *
-   * The bucket's IAM config.
-   * 
- * - * .google.storage.v2.Bucket.IamConfig iam_config = 23; - * - * @return Whether the iamConfig field is set. - */ - boolean hasIamConfig(); - /** - * - * - *
-   * The bucket's IAM config.
-   * 
- * - * .google.storage.v2.Bucket.IamConfig iam_config = 23; - * - * @return The iamConfig. - */ - com.google.storage.v2.Bucket.IamConfig getIamConfig(); - /** - * - * - *
-   * The bucket's IAM config.
-   * 
- * - * .google.storage.v2.Bucket.IamConfig iam_config = 23; - */ - com.google.storage.v2.Bucket.IamConfigOrBuilder getIamConfigOrBuilder(); - - /** - * - * - *
-   * Reserved for future use.
-   * 
- * - * bool satisfies_pzs = 25; - * - * @return The satisfiesPzs. - */ - boolean getSatisfiesPzs(); - - /** - * - * - *
-   * Configuration that, if present, specifies the data placement for a Custom
-   * Dual Region.
-   * 
- * - * .google.storage.v2.Bucket.CustomPlacementConfig custom_placement_config = 26; - * - * @return Whether the customPlacementConfig field is set. - */ - boolean hasCustomPlacementConfig(); - /** - * - * - *
-   * Configuration that, if present, specifies the data placement for a Custom
-   * Dual Region.
-   * 
- * - * .google.storage.v2.Bucket.CustomPlacementConfig custom_placement_config = 26; - * - * @return The customPlacementConfig. - */ - com.google.storage.v2.Bucket.CustomPlacementConfig getCustomPlacementConfig(); - /** - * - * - *
-   * Configuration that, if present, specifies the data placement for a Custom
-   * Dual Region.
-   * 
- * - * .google.storage.v2.Bucket.CustomPlacementConfig custom_placement_config = 26; - */ - com.google.storage.v2.Bucket.CustomPlacementConfigOrBuilder getCustomPlacementConfigOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ChecksummedData.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ChecksummedData.java deleted file mode 100644 index f84e379ef8..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ChecksummedData.java +++ /dev/null @@ -1,685 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Message used to convey content being read or written, along with an optional
- * checksum.
- * 
- * - * Protobuf type {@code google.storage.v2.ChecksummedData} - */ -public final class ChecksummedData extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.ChecksummedData) - ChecksummedDataOrBuilder { - private static final long serialVersionUID = 0L; - // Use ChecksummedData.newBuilder() to construct. - private ChecksummedData(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ChecksummedData() { - content_ = com.google.protobuf.ByteString.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ChecksummedData(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ChecksummedData( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - content_ = input.readBytes(); - break; - } - case 21: - { - bitField0_ |= 0x00000001; - crc32C_ = input.readFixed32(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ChecksummedData_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ChecksummedData_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ChecksummedData.class, - com.google.storage.v2.ChecksummedData.Builder.class); - } - - private int bitField0_; - public static final int CONTENT_FIELD_NUMBER = 1; - private com.google.protobuf.ByteString content_; - /** - * - * - *
-   * The data.
-   * 
- * - * bytes content = 1; - * - * @return The content. - */ - @java.lang.Override - public com.google.protobuf.ByteString getContent() { - return content_; - } - - public static final int CRC32C_FIELD_NUMBER = 2; - private int crc32C_; - /** - * - * - *
-   * If set, the CRC32C digest of the content field.
-   * 
- * - * optional fixed32 crc32c = 2; - * - * @return Whether the crc32c field is set. - */ - @java.lang.Override - public boolean hasCrc32C() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-   * If set, the CRC32C digest of the content field.
-   * 
- * - * optional fixed32 crc32c = 2; - * - * @return The crc32c. - */ - @java.lang.Override - public int getCrc32C() { - return crc32C_; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!content_.isEmpty()) { - output.writeBytes(1, content_); - } - if (((bitField0_ & 0x00000001) != 0)) { - output.writeFixed32(2, crc32C_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!content_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, content_); - } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeFixed32Size(2, crc32C_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.ChecksummedData)) { - return super.equals(obj); - } - com.google.storage.v2.ChecksummedData other = (com.google.storage.v2.ChecksummedData) obj; - - if (!getContent().equals(other.getContent())) return false; - if (hasCrc32C() != other.hasCrc32C()) return false; - if (hasCrc32C()) { - if (getCrc32C() != other.getCrc32C()) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getContent().hashCode(); - if (hasCrc32C()) { - hash = (37 * hash) + CRC32C_FIELD_NUMBER; - hash = (53 * hash) + getCrc32C(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.ChecksummedData parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ChecksummedData parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ChecksummedData parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ChecksummedData parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ChecksummedData parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ChecksummedData parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ChecksummedData parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ChecksummedData parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.ChecksummedData parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ChecksummedData parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.ChecksummedData parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ChecksummedData parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.ChecksummedData prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Message used to convey content being read or written, along with an optional
-   * checksum.
-   * 
- * - * Protobuf type {@code google.storage.v2.ChecksummedData} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.ChecksummedData) - com.google.storage.v2.ChecksummedDataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ChecksummedData_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ChecksummedData_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ChecksummedData.class, - com.google.storage.v2.ChecksummedData.Builder.class); - } - - // Construct using com.google.storage.v2.ChecksummedData.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - content_ = com.google.protobuf.ByteString.EMPTY; - - crc32C_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ChecksummedData_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.ChecksummedData getDefaultInstanceForType() { - return com.google.storage.v2.ChecksummedData.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.ChecksummedData build() { - com.google.storage.v2.ChecksummedData result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.ChecksummedData buildPartial() { - com.google.storage.v2.ChecksummedData result = - new com.google.storage.v2.ChecksummedData(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - result.content_ = content_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.crc32C_ = crc32C_; - to_bitField0_ |= 0x00000001; - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.ChecksummedData) { - return mergeFrom((com.google.storage.v2.ChecksummedData) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.ChecksummedData other) { - if (other == com.google.storage.v2.ChecksummedData.getDefaultInstance()) return this; - if (other.getContent() != com.google.protobuf.ByteString.EMPTY) { - setContent(other.getContent()); - } - if (other.hasCrc32C()) { - setCrc32C(other.getCrc32C()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.ChecksummedData parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.ChecksummedData) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private com.google.protobuf.ByteString content_ = com.google.protobuf.ByteString.EMPTY; - /** - * - * - *
-     * The data.
-     * 
- * - * bytes content = 1; - * - * @return The content. - */ - @java.lang.Override - public com.google.protobuf.ByteString getContent() { - return content_; - } - /** - * - * - *
-     * The data.
-     * 
- * - * bytes content = 1; - * - * @param value The content to set. - * @return This builder for chaining. - */ - public Builder setContent(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - content_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The data.
-     * 
- * - * bytes content = 1; - * - * @return This builder for chaining. - */ - public Builder clearContent() { - - content_ = getDefaultInstance().getContent(); - onChanged(); - return this; - } - - private int crc32C_; - /** - * - * - *
-     * If set, the CRC32C digest of the content field.
-     * 
- * - * optional fixed32 crc32c = 2; - * - * @return Whether the crc32c field is set. - */ - @java.lang.Override - public boolean hasCrc32C() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-     * If set, the CRC32C digest of the content field.
-     * 
- * - * optional fixed32 crc32c = 2; - * - * @return The crc32c. - */ - @java.lang.Override - public int getCrc32C() { - return crc32C_; - } - /** - * - * - *
-     * If set, the CRC32C digest of the content field.
-     * 
- * - * optional fixed32 crc32c = 2; - * - * @param value The crc32c to set. - * @return This builder for chaining. - */ - public Builder setCrc32C(int value) { - bitField0_ |= 0x00000001; - crc32C_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If set, the CRC32C digest of the content field.
-     * 
- * - * optional fixed32 crc32c = 2; - * - * @return This builder for chaining. - */ - public Builder clearCrc32C() { - bitField0_ = (bitField0_ & ~0x00000001); - crc32C_ = 0; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.ChecksummedData) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.ChecksummedData) - private static final com.google.storage.v2.ChecksummedData DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.ChecksummedData(); - } - - public static com.google.storage.v2.ChecksummedData getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ChecksummedData parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ChecksummedData(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.ChecksummedData getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ChecksummedDataOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ChecksummedDataOrBuilder.java deleted file mode 100644 index 9fe732c82c..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ChecksummedDataOrBuilder.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface ChecksummedDataOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.ChecksummedData) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The data.
-   * 
- * - * bytes content = 1; - * - * @return The content. - */ - com.google.protobuf.ByteString getContent(); - - /** - * - * - *
-   * If set, the CRC32C digest of the content field.
-   * 
- * - * optional fixed32 crc32c = 2; - * - * @return Whether the crc32c field is set. - */ - boolean hasCrc32C(); - /** - * - * - *
-   * If set, the CRC32C digest of the content field.
-   * 
- * - * optional fixed32 crc32c = 2; - * - * @return The crc32c. - */ - int getCrc32C(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonObjectRequestParams.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonObjectRequestParams.java deleted file mode 100644 index 29aa268b8d..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonObjectRequestParams.java +++ /dev/null @@ -1,840 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Parameters that can be passed to any object request.
- * 
- * - * Protobuf type {@code google.storage.v2.CommonObjectRequestParams} - */ -public final class CommonObjectRequestParams extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.CommonObjectRequestParams) - CommonObjectRequestParamsOrBuilder { - private static final long serialVersionUID = 0L; - // Use CommonObjectRequestParams.newBuilder() to construct. - private CommonObjectRequestParams(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CommonObjectRequestParams() { - encryptionAlgorithm_ = ""; - encryptionKeyBytes_ = com.google.protobuf.ByteString.EMPTY; - encryptionKeySha256Bytes_ = com.google.protobuf.ByteString.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CommonObjectRequestParams(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CommonObjectRequestParams( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - encryptionAlgorithm_ = s; - break; - } - case 34: - { - encryptionKeyBytes_ = input.readBytes(); - break; - } - case 42: - { - encryptionKeySha256Bytes_ = input.readBytes(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CommonObjectRequestParams_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CommonObjectRequestParams_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.CommonObjectRequestParams.class, - com.google.storage.v2.CommonObjectRequestParams.Builder.class); - } - - public static final int ENCRYPTION_ALGORITHM_FIELD_NUMBER = 1; - private volatile java.lang.Object encryptionAlgorithm_; - /** - * - * - *
-   * Encryption algorithm used with the Customer-Supplied Encryption Keys
-   * feature.
-   * 
- * - * string encryption_algorithm = 1; - * - * @return The encryptionAlgorithm. - */ - @java.lang.Override - public java.lang.String getEncryptionAlgorithm() { - java.lang.Object ref = encryptionAlgorithm_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - encryptionAlgorithm_ = s; - return s; - } - } - /** - * - * - *
-   * Encryption algorithm used with the Customer-Supplied Encryption Keys
-   * feature.
-   * 
- * - * string encryption_algorithm = 1; - * - * @return The bytes for encryptionAlgorithm. - */ - @java.lang.Override - public com.google.protobuf.ByteString getEncryptionAlgorithmBytes() { - java.lang.Object ref = encryptionAlgorithm_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - encryptionAlgorithm_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ENCRYPTION_KEY_BYTES_FIELD_NUMBER = 4; - private com.google.protobuf.ByteString encryptionKeyBytes_; - /** - * - * - *
-   * Encryption key used with the Customer-Supplied Encryption Keys feature.
-   * In raw bytes format (not base64-encoded).
-   * 
- * - * bytes encryption_key_bytes = 4; - * - * @return The encryptionKeyBytes. - */ - @java.lang.Override - public com.google.protobuf.ByteString getEncryptionKeyBytes() { - return encryptionKeyBytes_; - } - - public static final int ENCRYPTION_KEY_SHA256_BYTES_FIELD_NUMBER = 5; - private com.google.protobuf.ByteString encryptionKeySha256Bytes_; - /** - * - * - *
-   * SHA256 hash of encryption key used with the Customer-Supplied Encryption
-   * Keys feature.
-   * 
- * - * bytes encryption_key_sha256_bytes = 5; - * - * @return The encryptionKeySha256Bytes. - */ - @java.lang.Override - public com.google.protobuf.ByteString getEncryptionKeySha256Bytes() { - return encryptionKeySha256Bytes_; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(encryptionAlgorithm_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, encryptionAlgorithm_); - } - if (!encryptionKeyBytes_.isEmpty()) { - output.writeBytes(4, encryptionKeyBytes_); - } - if (!encryptionKeySha256Bytes_.isEmpty()) { - output.writeBytes(5, encryptionKeySha256Bytes_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(encryptionAlgorithm_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, encryptionAlgorithm_); - } - if (!encryptionKeyBytes_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(4, encryptionKeyBytes_); - } - if (!encryptionKeySha256Bytes_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(5, encryptionKeySha256Bytes_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.CommonObjectRequestParams)) { - return super.equals(obj); - } - com.google.storage.v2.CommonObjectRequestParams other = - (com.google.storage.v2.CommonObjectRequestParams) obj; - - if (!getEncryptionAlgorithm().equals(other.getEncryptionAlgorithm())) return false; - if (!getEncryptionKeyBytes().equals(other.getEncryptionKeyBytes())) return false; - if (!getEncryptionKeySha256Bytes().equals(other.getEncryptionKeySha256Bytes())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ENCRYPTION_ALGORITHM_FIELD_NUMBER; - hash = (53 * hash) + getEncryptionAlgorithm().hashCode(); - hash = (37 * hash) + ENCRYPTION_KEY_BYTES_FIELD_NUMBER; - hash = (53 * hash) + getEncryptionKeyBytes().hashCode(); - hash = (37 * hash) + ENCRYPTION_KEY_SHA256_BYTES_FIELD_NUMBER; - hash = (53 * hash) + getEncryptionKeySha256Bytes().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.CommonObjectRequestParams parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.CommonObjectRequestParams parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.CommonObjectRequestParams parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.CommonObjectRequestParams parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.CommonObjectRequestParams parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.CommonObjectRequestParams parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.CommonObjectRequestParams parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.CommonObjectRequestParams parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.CommonObjectRequestParams parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.CommonObjectRequestParams parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.CommonObjectRequestParams parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.CommonObjectRequestParams parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.CommonObjectRequestParams prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Parameters that can be passed to any object request.
-   * 
- * - * Protobuf type {@code google.storage.v2.CommonObjectRequestParams} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.CommonObjectRequestParams) - com.google.storage.v2.CommonObjectRequestParamsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CommonObjectRequestParams_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CommonObjectRequestParams_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.CommonObjectRequestParams.class, - com.google.storage.v2.CommonObjectRequestParams.Builder.class); - } - - // Construct using com.google.storage.v2.CommonObjectRequestParams.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - encryptionAlgorithm_ = ""; - - encryptionKeyBytes_ = com.google.protobuf.ByteString.EMPTY; - - encryptionKeySha256Bytes_ = com.google.protobuf.ByteString.EMPTY; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CommonObjectRequestParams_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.CommonObjectRequestParams getDefaultInstanceForType() { - return com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.CommonObjectRequestParams build() { - com.google.storage.v2.CommonObjectRequestParams result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.CommonObjectRequestParams buildPartial() { - com.google.storage.v2.CommonObjectRequestParams result = - new com.google.storage.v2.CommonObjectRequestParams(this); - result.encryptionAlgorithm_ = encryptionAlgorithm_; - result.encryptionKeyBytes_ = encryptionKeyBytes_; - result.encryptionKeySha256Bytes_ = encryptionKeySha256Bytes_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.CommonObjectRequestParams) { - return mergeFrom((com.google.storage.v2.CommonObjectRequestParams) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.CommonObjectRequestParams other) { - if (other == com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance()) - return this; - if (!other.getEncryptionAlgorithm().isEmpty()) { - encryptionAlgorithm_ = other.encryptionAlgorithm_; - onChanged(); - } - if (other.getEncryptionKeyBytes() != com.google.protobuf.ByteString.EMPTY) { - setEncryptionKeyBytes(other.getEncryptionKeyBytes()); - } - if (other.getEncryptionKeySha256Bytes() != com.google.protobuf.ByteString.EMPTY) { - setEncryptionKeySha256Bytes(other.getEncryptionKeySha256Bytes()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.CommonObjectRequestParams parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.CommonObjectRequestParams) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object encryptionAlgorithm_ = ""; - /** - * - * - *
-     * Encryption algorithm used with the Customer-Supplied Encryption Keys
-     * feature.
-     * 
- * - * string encryption_algorithm = 1; - * - * @return The encryptionAlgorithm. - */ - public java.lang.String getEncryptionAlgorithm() { - java.lang.Object ref = encryptionAlgorithm_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - encryptionAlgorithm_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Encryption algorithm used with the Customer-Supplied Encryption Keys
-     * feature.
-     * 
- * - * string encryption_algorithm = 1; - * - * @return The bytes for encryptionAlgorithm. - */ - public com.google.protobuf.ByteString getEncryptionAlgorithmBytes() { - java.lang.Object ref = encryptionAlgorithm_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - encryptionAlgorithm_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Encryption algorithm used with the Customer-Supplied Encryption Keys
-     * feature.
-     * 
- * - * string encryption_algorithm = 1; - * - * @param value The encryptionAlgorithm to set. - * @return This builder for chaining. - */ - public Builder setEncryptionAlgorithm(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - encryptionAlgorithm_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Encryption algorithm used with the Customer-Supplied Encryption Keys
-     * feature.
-     * 
- * - * string encryption_algorithm = 1; - * - * @return This builder for chaining. - */ - public Builder clearEncryptionAlgorithm() { - - encryptionAlgorithm_ = getDefaultInstance().getEncryptionAlgorithm(); - onChanged(); - return this; - } - /** - * - * - *
-     * Encryption algorithm used with the Customer-Supplied Encryption Keys
-     * feature.
-     * 
- * - * string encryption_algorithm = 1; - * - * @param value The bytes for encryptionAlgorithm to set. - * @return This builder for chaining. - */ - public Builder setEncryptionAlgorithmBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - encryptionAlgorithm_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString encryptionKeyBytes_ = - com.google.protobuf.ByteString.EMPTY; - /** - * - * - *
-     * Encryption key used with the Customer-Supplied Encryption Keys feature.
-     * In raw bytes format (not base64-encoded).
-     * 
- * - * bytes encryption_key_bytes = 4; - * - * @return The encryptionKeyBytes. - */ - @java.lang.Override - public com.google.protobuf.ByteString getEncryptionKeyBytes() { - return encryptionKeyBytes_; - } - /** - * - * - *
-     * Encryption key used with the Customer-Supplied Encryption Keys feature.
-     * In raw bytes format (not base64-encoded).
-     * 
- * - * bytes encryption_key_bytes = 4; - * - * @param value The encryptionKeyBytes to set. - * @return This builder for chaining. - */ - public Builder setEncryptionKeyBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - encryptionKeyBytes_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Encryption key used with the Customer-Supplied Encryption Keys feature.
-     * In raw bytes format (not base64-encoded).
-     * 
- * - * bytes encryption_key_bytes = 4; - * - * @return This builder for chaining. - */ - public Builder clearEncryptionKeyBytes() { - - encryptionKeyBytes_ = getDefaultInstance().getEncryptionKeyBytes(); - onChanged(); - return this; - } - - private com.google.protobuf.ByteString encryptionKeySha256Bytes_ = - com.google.protobuf.ByteString.EMPTY; - /** - * - * - *
-     * SHA256 hash of encryption key used with the Customer-Supplied Encryption
-     * Keys feature.
-     * 
- * - * bytes encryption_key_sha256_bytes = 5; - * - * @return The encryptionKeySha256Bytes. - */ - @java.lang.Override - public com.google.protobuf.ByteString getEncryptionKeySha256Bytes() { - return encryptionKeySha256Bytes_; - } - /** - * - * - *
-     * SHA256 hash of encryption key used with the Customer-Supplied Encryption
-     * Keys feature.
-     * 
- * - * bytes encryption_key_sha256_bytes = 5; - * - * @param value The encryptionKeySha256Bytes to set. - * @return This builder for chaining. - */ - public Builder setEncryptionKeySha256Bytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - encryptionKeySha256Bytes_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * SHA256 hash of encryption key used with the Customer-Supplied Encryption
-     * Keys feature.
-     * 
- * - * bytes encryption_key_sha256_bytes = 5; - * - * @return This builder for chaining. - */ - public Builder clearEncryptionKeySha256Bytes() { - - encryptionKeySha256Bytes_ = getDefaultInstance().getEncryptionKeySha256Bytes(); - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.CommonObjectRequestParams) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.CommonObjectRequestParams) - private static final com.google.storage.v2.CommonObjectRequestParams DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.CommonObjectRequestParams(); - } - - public static com.google.storage.v2.CommonObjectRequestParams getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CommonObjectRequestParams parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CommonObjectRequestParams(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.CommonObjectRequestParams getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonObjectRequestParamsOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonObjectRequestParamsOrBuilder.java deleted file mode 100644 index 327ae41411..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonObjectRequestParamsOrBuilder.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface CommonObjectRequestParamsOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.CommonObjectRequestParams) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Encryption algorithm used with the Customer-Supplied Encryption Keys
-   * feature.
-   * 
- * - * string encryption_algorithm = 1; - * - * @return The encryptionAlgorithm. - */ - java.lang.String getEncryptionAlgorithm(); - /** - * - * - *
-   * Encryption algorithm used with the Customer-Supplied Encryption Keys
-   * feature.
-   * 
- * - * string encryption_algorithm = 1; - * - * @return The bytes for encryptionAlgorithm. - */ - com.google.protobuf.ByteString getEncryptionAlgorithmBytes(); - - /** - * - * - *
-   * Encryption key used with the Customer-Supplied Encryption Keys feature.
-   * In raw bytes format (not base64-encoded).
-   * 
- * - * bytes encryption_key_bytes = 4; - * - * @return The encryptionKeyBytes. - */ - com.google.protobuf.ByteString getEncryptionKeyBytes(); - - /** - * - * - *
-   * SHA256 hash of encryption key used with the Customer-Supplied Encryption
-   * Keys feature.
-   * 
- * - * bytes encryption_key_sha256_bytes = 5; - * - * @return The encryptionKeySha256Bytes. - */ - com.google.protobuf.ByteString getEncryptionKeySha256Bytes(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonRequestParams.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonRequestParams.java deleted file mode 100644 index 831d2c657e..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonRequestParams.java +++ /dev/null @@ -1,648 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Parameters that can be passed to any request.
- * 
- * - * Protobuf type {@code google.storage.v2.CommonRequestParams} - */ -public final class CommonRequestParams extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.CommonRequestParams) - CommonRequestParamsOrBuilder { - private static final long serialVersionUID = 0L; - // Use CommonRequestParams.newBuilder() to construct. - private CommonRequestParams(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CommonRequestParams() { - userProject_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CommonRequestParams(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CommonRequestParams( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - userProject_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CommonRequestParams_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CommonRequestParams_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.CommonRequestParams.class, - com.google.storage.v2.CommonRequestParams.Builder.class); - } - - public static final int USER_PROJECT_FIELD_NUMBER = 1; - private volatile java.lang.Object userProject_; - /** - * - * - *
-   * Required. Required when using buckets with Requestor Pays feature enabled.
-   * 
- * - * - * string user_project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The userProject. - */ - @java.lang.Override - public java.lang.String getUserProject() { - java.lang.Object ref = userProject_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - userProject_ = s; - return s; - } - } - /** - * - * - *
-   * Required. Required when using buckets with Requestor Pays feature enabled.
-   * 
- * - * - * string user_project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for userProject. - */ - @java.lang.Override - public com.google.protobuf.ByteString getUserProjectBytes() { - java.lang.Object ref = userProject_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - userProject_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userProject_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, userProject_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userProject_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, userProject_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.CommonRequestParams)) { - return super.equals(obj); - } - com.google.storage.v2.CommonRequestParams other = - (com.google.storage.v2.CommonRequestParams) obj; - - if (!getUserProject().equals(other.getUserProject())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + USER_PROJECT_FIELD_NUMBER; - hash = (53 * hash) + getUserProject().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.CommonRequestParams parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.CommonRequestParams parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.CommonRequestParams parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.CommonRequestParams parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.CommonRequestParams parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.CommonRequestParams parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.CommonRequestParams parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.CommonRequestParams parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.CommonRequestParams parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.CommonRequestParams parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.CommonRequestParams parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.CommonRequestParams parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.CommonRequestParams prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Parameters that can be passed to any request.
-   * 
- * - * Protobuf type {@code google.storage.v2.CommonRequestParams} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.CommonRequestParams) - com.google.storage.v2.CommonRequestParamsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CommonRequestParams_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CommonRequestParams_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.CommonRequestParams.class, - com.google.storage.v2.CommonRequestParams.Builder.class); - } - - // Construct using com.google.storage.v2.CommonRequestParams.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - userProject_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CommonRequestParams_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.CommonRequestParams getDefaultInstanceForType() { - return com.google.storage.v2.CommonRequestParams.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.CommonRequestParams build() { - com.google.storage.v2.CommonRequestParams result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.CommonRequestParams buildPartial() { - com.google.storage.v2.CommonRequestParams result = - new com.google.storage.v2.CommonRequestParams(this); - result.userProject_ = userProject_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.CommonRequestParams) { - return mergeFrom((com.google.storage.v2.CommonRequestParams) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.CommonRequestParams other) { - if (other == com.google.storage.v2.CommonRequestParams.getDefaultInstance()) return this; - if (!other.getUserProject().isEmpty()) { - userProject_ = other.userProject_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.CommonRequestParams parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.CommonRequestParams) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object userProject_ = ""; - /** - * - * - *
-     * Required. Required when using buckets with Requestor Pays feature enabled.
-     * 
- * - * - * string user_project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The userProject. - */ - public java.lang.String getUserProject() { - java.lang.Object ref = userProject_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - userProject_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. Required when using buckets with Requestor Pays feature enabled.
-     * 
- * - * - * string user_project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for userProject. - */ - public com.google.protobuf.ByteString getUserProjectBytes() { - java.lang.Object ref = userProject_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - userProject_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. Required when using buckets with Requestor Pays feature enabled.
-     * 
- * - * - * string user_project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The userProject to set. - * @return This builder for chaining. - */ - public Builder setUserProject(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - userProject_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Required when using buckets with Requestor Pays feature enabled.
-     * 
- * - * - * string user_project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearUserProject() { - - userProject_ = getDefaultInstance().getUserProject(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Required when using buckets with Requestor Pays feature enabled.
-     * 
- * - * - * string user_project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for userProject to set. - * @return This builder for chaining. - */ - public Builder setUserProjectBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - userProject_ = value; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.CommonRequestParams) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.CommonRequestParams) - private static final com.google.storage.v2.CommonRequestParams DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.CommonRequestParams(); - } - - public static com.google.storage.v2.CommonRequestParams getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CommonRequestParams parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CommonRequestParams(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.CommonRequestParams getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonRequestParamsOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonRequestParamsOrBuilder.java deleted file mode 100644 index 050241c84e..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonRequestParamsOrBuilder.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface CommonRequestParamsOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.CommonRequestParams) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Required when using buckets with Requestor Pays feature enabled.
-   * 
- * - * - * string user_project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The userProject. - */ - java.lang.String getUserProject(); - /** - * - * - *
-   * Required. Required when using buckets with Requestor Pays feature enabled.
-   * 
- * - * - * string user_project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for userProject. - */ - com.google.protobuf.ByteString getUserProjectBytes(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ComposeObjectRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ComposeObjectRequest.java deleted file mode 100644 index 9caf59fa4f..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ComposeObjectRequest.java +++ /dev/null @@ -1,4256 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request message for ComposeObject.
- * 
- * - * Protobuf type {@code google.storage.v2.ComposeObjectRequest} - */ -public final class ComposeObjectRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.ComposeObjectRequest) - ComposeObjectRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use ComposeObjectRequest.newBuilder() to construct. - private ComposeObjectRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ComposeObjectRequest() { - sourceObjects_ = java.util.Collections.emptyList(); - destinationPredefinedAcl_ = 0; - kmsKey_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ComposeObjectRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ComposeObjectRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.storage.v2.Object.Builder subBuilder = null; - if (destination_ != null) { - subBuilder = destination_.toBuilder(); - } - destination_ = - input.readMessage(com.google.storage.v2.Object.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(destination_); - destination_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - sourceObjects_ = - new java.util.ArrayList< - com.google.storage.v2.ComposeObjectRequest.SourceObject>(); - mutable_bitField0_ |= 0x00000001; - } - sourceObjects_.add( - input.readMessage( - com.google.storage.v2.ComposeObjectRequest.SourceObject.parser(), - extensionRegistry)); - break; - } - case 24: - { - int rawValue = input.readEnum(); - - destinationPredefinedAcl_ = rawValue; - break; - } - case 32: - { - bitField0_ |= 0x00000001; - ifGenerationMatch_ = input.readInt64(); - break; - } - case 40: - { - bitField0_ |= 0x00000002; - ifMetagenerationMatch_ = input.readInt64(); - break; - } - case 50: - { - java.lang.String s = input.readStringRequireUtf8(); - - kmsKey_ = s; - break; - } - case 58: - { - com.google.storage.v2.CommonObjectRequestParams.Builder subBuilder = null; - if (commonObjectRequestParams_ != null) { - subBuilder = commonObjectRequestParams_.toBuilder(); - } - commonObjectRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonObjectRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonObjectRequestParams_); - commonObjectRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - case 66: - { - com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; - if (commonRequestParams_ != null) { - subBuilder = commonRequestParams_.toBuilder(); - } - commonRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonRequestParams_); - commonRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - sourceObjects_ = java.util.Collections.unmodifiableList(sourceObjects_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ComposeObjectRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ComposeObjectRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ComposeObjectRequest.class, - com.google.storage.v2.ComposeObjectRequest.Builder.class); - } - - public interface SourceObjectOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.ComposeObjectRequest.SourceObject) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Required. The source object's name. All source objects must reside in the same
-     * bucket.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-     * Required. The source object's name. All source objects must reside in the same
-     * bucket.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-     * The generation of this object to use as the source.
-     * 
- * - * int64 generation = 2; - * - * @return The generation. - */ - long getGeneration(); - - /** - * - * - *
-     * Conditions that must be met for this operation to execute.
-     * 
- * - * - * .google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions object_preconditions = 3; - * - * - * @return Whether the objectPreconditions field is set. - */ - boolean hasObjectPreconditions(); - /** - * - * - *
-     * Conditions that must be met for this operation to execute.
-     * 
- * - * - * .google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions object_preconditions = 3; - * - * - * @return The objectPreconditions. - */ - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - getObjectPreconditions(); - /** - * - * - *
-     * Conditions that must be met for this operation to execute.
-     * 
- * - * - * .google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions object_preconditions = 3; - * - */ - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditionsOrBuilder - getObjectPreconditionsOrBuilder(); - } - /** - * - * - *
-   * Description of a source object for a composition request.
-   * 
- * - * Protobuf type {@code google.storage.v2.ComposeObjectRequest.SourceObject} - */ - public static final class SourceObject extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.ComposeObjectRequest.SourceObject) - SourceObjectOrBuilder { - private static final long serialVersionUID = 0L; - // Use SourceObject.newBuilder() to construct. - private SourceObject(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private SourceObject() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SourceObject(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private SourceObject( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 16: - { - generation_ = input.readInt64(); - break; - } - case 26: - { - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions.Builder - subBuilder = null; - if (objectPreconditions_ != null) { - subBuilder = objectPreconditions_.toBuilder(); - } - objectPreconditions_ = - input.readMessage( - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - .parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(objectPreconditions_); - objectPreconditions_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ComposeObjectRequest_SourceObject_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ComposeObjectRequest_SourceObject_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ComposeObjectRequest.SourceObject.class, - com.google.storage.v2.ComposeObjectRequest.SourceObject.Builder.class); - } - - public interface ObjectPreconditionsOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-       * Only perform the composition if the generation of the source object
-       * that would be used matches this value.  If this value and a generation
-       * are both specified, they must be the same value or the call will fail.
-       * 
- * - * optional int64 if_generation_match = 1; - * - * @return Whether the ifGenerationMatch field is set. - */ - boolean hasIfGenerationMatch(); - /** - * - * - *
-       * Only perform the composition if the generation of the source object
-       * that would be used matches this value.  If this value and a generation
-       * are both specified, they must be the same value or the call will fail.
-       * 
- * - * optional int64 if_generation_match = 1; - * - * @return The ifGenerationMatch. - */ - long getIfGenerationMatch(); - } - /** - * - * - *
-     * Preconditions for a source object of a composition request.
-     * 
- * - * Protobuf type {@code google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions} - */ - public static final class ObjectPreconditions extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions) - ObjectPreconditionsOrBuilder { - private static final long serialVersionUID = 0L; - // Use ObjectPreconditions.newBuilder() to construct. - private ObjectPreconditions(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ObjectPreconditions() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ObjectPreconditions(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ObjectPreconditions( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - bitField0_ |= 0x00000001; - ifGenerationMatch_ = input.readInt64(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ComposeObjectRequest_SourceObject_ObjectPreconditions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ComposeObjectRequest_SourceObject_ObjectPreconditions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions.class, - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions.Builder - .class); - } - - private int bitField0_; - public static final int IF_GENERATION_MATCH_FIELD_NUMBER = 1; - private long ifGenerationMatch_; - /** - * - * - *
-       * Only perform the composition if the generation of the source object
-       * that would be used matches this value.  If this value and a generation
-       * are both specified, they must be the same value or the call will fail.
-       * 
- * - * optional int64 if_generation_match = 1; - * - * @return Whether the ifGenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfGenerationMatch() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-       * Only perform the composition if the generation of the source object
-       * that would be used matches this value.  If this value and a generation
-       * are both specified, they must be the same value or the call will fail.
-       * 
- * - * optional int64 if_generation_match = 1; - * - * @return The ifGenerationMatch. - */ - @java.lang.Override - public long getIfGenerationMatch() { - return ifGenerationMatch_; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) != 0)) { - output.writeInt64(1, ifGenerationMatch_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, ifGenerationMatch_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions)) { - return super.equals(obj); - } - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions other = - (com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions) obj; - - if (hasIfGenerationMatch() != other.hasIfGenerationMatch()) return false; - if (hasIfGenerationMatch()) { - if (getIfGenerationMatch() != other.getIfGenerationMatch()) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasIfGenerationMatch()) { - hash = (37 * hash) + IF_GENERATION_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfGenerationMatch()); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - 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.ComposeObjectRequest.SourceObject.ObjectPreconditions - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - 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.ComposeObjectRequest.SourceObject.ObjectPreconditions - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - 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.ComposeObjectRequest.SourceObject.ObjectPreconditions - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - 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.ComposeObjectRequest.SourceObject.ObjectPreconditions - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - 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.ComposeObjectRequest.SourceObject.ObjectPreconditions 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; - } - /** - * - * - *
-       * Preconditions for a source object of a composition request.
-       * 
- * - * Protobuf type {@code - * google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions) - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditionsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ComposeObjectRequest_SourceObject_ObjectPreconditions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ComposeObjectRequest_SourceObject_ObjectPreconditions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions.class, - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - .Builder.class); - } - - // Construct using - // com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - ifGenerationMatch_ = 0L; - 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_ComposeObjectRequest_SourceObject_ObjectPreconditions_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - getDefaultInstanceForType() { - return com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions build() { - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - buildPartial() { - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions result = - new com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.ifGenerationMatch_ = ifGenerationMatch_; - to_bitField0_ |= 0x00000001; - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions) { - return mergeFrom( - (com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions) - other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions other) { - if (other - == com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - .getDefaultInstance()) return this; - if (other.hasIfGenerationMatch()) { - setIfGenerationMatch(other.getIfGenerationMatch()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private long ifGenerationMatch_; - /** - * - * - *
-         * Only perform the composition if the generation of the source object
-         * that would be used matches this value.  If this value and a generation
-         * are both specified, they must be the same value or the call will fail.
-         * 
- * - * optional int64 if_generation_match = 1; - * - * @return Whether the ifGenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfGenerationMatch() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-         * Only perform the composition if the generation of the source object
-         * that would be used matches this value.  If this value and a generation
-         * are both specified, they must be the same value or the call will fail.
-         * 
- * - * optional int64 if_generation_match = 1; - * - * @return The ifGenerationMatch. - */ - @java.lang.Override - public long getIfGenerationMatch() { - return ifGenerationMatch_; - } - /** - * - * - *
-         * Only perform the composition if the generation of the source object
-         * that would be used matches this value.  If this value and a generation
-         * are both specified, they must be the same value or the call will fail.
-         * 
- * - * optional int64 if_generation_match = 1; - * - * @param value The ifGenerationMatch to set. - * @return This builder for chaining. - */ - public Builder setIfGenerationMatch(long value) { - bitField0_ |= 0x00000001; - ifGenerationMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-         * Only perform the composition if the generation of the source object
-         * that would be used matches this value.  If this value and a generation
-         * are both specified, they must be the same value or the call will fail.
-         * 
- * - * optional int64 if_generation_match = 1; - * - * @return This builder for chaining. - */ - public Builder clearIfGenerationMatch() { - bitField0_ = (bitField0_ & ~0x00000001); - ifGenerationMatch_ = 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.ComposeObjectRequest.SourceObject.ObjectPreconditions) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions) - private static final com.google.storage.v2.ComposeObjectRequest.SourceObject - .ObjectPreconditions - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions(); - } - - public static com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ObjectPreconditions parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ObjectPreconditions(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * - * - *
-     * Required. The source object's name. All source objects must reside in the same
-     * bucket.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * - * - *
-     * Required. The source object's name. All source objects must reside in the same
-     * bucket.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int GENERATION_FIELD_NUMBER = 2; - private long generation_; - /** - * - * - *
-     * The generation of this object to use as the source.
-     * 
- * - * int64 generation = 2; - * - * @return The generation. - */ - @java.lang.Override - public long getGeneration() { - return generation_; - } - - public static final int OBJECT_PRECONDITIONS_FIELD_NUMBER = 3; - private com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - objectPreconditions_; - /** - * - * - *
-     * Conditions that must be met for this operation to execute.
-     * 
- * - * - * .google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions object_preconditions = 3; - * - * - * @return Whether the objectPreconditions field is set. - */ - @java.lang.Override - public boolean hasObjectPreconditions() { - return objectPreconditions_ != null; - } - /** - * - * - *
-     * Conditions that must be met for this operation to execute.
-     * 
- * - * - * .google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions object_preconditions = 3; - * - * - * @return The objectPreconditions. - */ - @java.lang.Override - public com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - getObjectPreconditions() { - return objectPreconditions_ == null - ? com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - .getDefaultInstance() - : objectPreconditions_; - } - /** - * - * - *
-     * Conditions that must be met for this operation to execute.
-     * 
- * - * - * .google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions object_preconditions = 3; - * - */ - @java.lang.Override - public com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditionsOrBuilder - getObjectPreconditionsOrBuilder() { - return getObjectPreconditions(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (generation_ != 0L) { - output.writeInt64(2, generation_); - } - if (objectPreconditions_ != null) { - output.writeMessage(3, getObjectPreconditions()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (generation_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, generation_); - } - if (objectPreconditions_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize(3, getObjectPreconditions()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.ComposeObjectRequest.SourceObject)) { - return super.equals(obj); - } - com.google.storage.v2.ComposeObjectRequest.SourceObject other = - (com.google.storage.v2.ComposeObjectRequest.SourceObject) obj; - - if (!getName().equals(other.getName())) return false; - if (getGeneration() != other.getGeneration()) return false; - if (hasObjectPreconditions() != other.hasObjectPreconditions()) return false; - if (hasObjectPreconditions()) { - if (!getObjectPreconditions().equals(other.getObjectPreconditions())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + GENERATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getGeneration()); - if (hasObjectPreconditions()) { - hash = (37 * hash) + OBJECT_PRECONDITIONS_FIELD_NUMBER; - hash = (53 * hash) + getObjectPreconditions().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.ComposeObjectRequest.SourceObject parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ComposeObjectRequest.SourceObject 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.ComposeObjectRequest.SourceObject parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ComposeObjectRequest.SourceObject 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.ComposeObjectRequest.SourceObject parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ComposeObjectRequest.SourceObject parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ComposeObjectRequest.SourceObject parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ComposeObjectRequest.SourceObject 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.ComposeObjectRequest.SourceObject parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ComposeObjectRequest.SourceObject 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.ComposeObjectRequest.SourceObject parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ComposeObjectRequest.SourceObject 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.ComposeObjectRequest.SourceObject 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; - } - /** - * - * - *
-     * Description of a source object for a composition request.
-     * 
- * - * Protobuf type {@code google.storage.v2.ComposeObjectRequest.SourceObject} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.ComposeObjectRequest.SourceObject) - com.google.storage.v2.ComposeObjectRequest.SourceObjectOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ComposeObjectRequest_SourceObject_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ComposeObjectRequest_SourceObject_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ComposeObjectRequest.SourceObject.class, - com.google.storage.v2.ComposeObjectRequest.SourceObject.Builder.class); - } - - // Construct using com.google.storage.v2.ComposeObjectRequest.SourceObject.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - generation_ = 0L; - - if (objectPreconditionsBuilder_ == null) { - objectPreconditions_ = null; - } else { - objectPreconditions_ = null; - objectPreconditionsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ComposeObjectRequest_SourceObject_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.ComposeObjectRequest.SourceObject getDefaultInstanceForType() { - return com.google.storage.v2.ComposeObjectRequest.SourceObject.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.ComposeObjectRequest.SourceObject build() { - com.google.storage.v2.ComposeObjectRequest.SourceObject result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.ComposeObjectRequest.SourceObject buildPartial() { - com.google.storage.v2.ComposeObjectRequest.SourceObject result = - new com.google.storage.v2.ComposeObjectRequest.SourceObject(this); - result.name_ = name_; - result.generation_ = generation_; - if (objectPreconditionsBuilder_ == null) { - result.objectPreconditions_ = objectPreconditions_; - } else { - result.objectPreconditions_ = objectPreconditionsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.ComposeObjectRequest.SourceObject) { - return mergeFrom((com.google.storage.v2.ComposeObjectRequest.SourceObject) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.ComposeObjectRequest.SourceObject other) { - if (other == com.google.storage.v2.ComposeObjectRequest.SourceObject.getDefaultInstance()) - return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.getGeneration() != 0L) { - setGeneration(other.getGeneration()); - } - if (other.hasObjectPreconditions()) { - mergeObjectPreconditions(other.getObjectPreconditions()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.ComposeObjectRequest.SourceObject parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.storage.v2.ComposeObjectRequest.SourceObject) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * - * - *
-       * Required. The source object's name. All source objects must reside in the same
-       * bucket.
-       * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Required. The source object's name. All source objects must reside in the same
-       * bucket.
-       * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Required. The source object's name. All source objects must reside in the same
-       * bucket.
-       * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Required. The source object's name. All source objects must reside in the same
-       * bucket.
-       * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * - * - *
-       * Required. The source object's name. All source objects must reside in the same
-       * bucket.
-       * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private long generation_; - /** - * - * - *
-       * The generation of this object to use as the source.
-       * 
- * - * int64 generation = 2; - * - * @return The generation. - */ - @java.lang.Override - public long getGeneration() { - return generation_; - } - /** - * - * - *
-       * The generation of this object to use as the source.
-       * 
- * - * int64 generation = 2; - * - * @param value The generation to set. - * @return This builder for chaining. - */ - public Builder setGeneration(long value) { - - generation_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * The generation of this object to use as the source.
-       * 
- * - * int64 generation = 2; - * - * @return This builder for chaining. - */ - public Builder clearGeneration() { - - generation_ = 0L; - onChanged(); - return this; - } - - private com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - objectPreconditions_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions, - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions.Builder, - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditionsOrBuilder> - objectPreconditionsBuilder_; - /** - * - * - *
-       * Conditions that must be met for this operation to execute.
-       * 
- * - * - * .google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions object_preconditions = 3; - * - * - * @return Whether the objectPreconditions field is set. - */ - public boolean hasObjectPreconditions() { - return objectPreconditionsBuilder_ != null || objectPreconditions_ != null; - } - /** - * - * - *
-       * Conditions that must be met for this operation to execute.
-       * 
- * - * - * .google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions object_preconditions = 3; - * - * - * @return The objectPreconditions. - */ - public com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - getObjectPreconditions() { - if (objectPreconditionsBuilder_ == null) { - return objectPreconditions_ == null - ? com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - .getDefaultInstance() - : objectPreconditions_; - } else { - return objectPreconditionsBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Conditions that must be met for this operation to execute.
-       * 
- * - * - * .google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions object_preconditions = 3; - * - */ - public Builder setObjectPreconditions( - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions value) { - if (objectPreconditionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - objectPreconditions_ = value; - onChanged(); - } else { - objectPreconditionsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-       * Conditions that must be met for this operation to execute.
-       * 
- * - * - * .google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions object_preconditions = 3; - * - */ - public Builder setObjectPreconditions( - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions.Builder - builderForValue) { - if (objectPreconditionsBuilder_ == null) { - objectPreconditions_ = builderForValue.build(); - onChanged(); - } else { - objectPreconditionsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-       * Conditions that must be met for this operation to execute.
-       * 
- * - * - * .google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions object_preconditions = 3; - * - */ - public Builder mergeObjectPreconditions( - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions value) { - if (objectPreconditionsBuilder_ == null) { - if (objectPreconditions_ != null) { - objectPreconditions_ = - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - .newBuilder(objectPreconditions_) - .mergeFrom(value) - .buildPartial(); - } else { - objectPreconditions_ = value; - } - onChanged(); - } else { - objectPreconditionsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-       * Conditions that must be met for this operation to execute.
-       * 
- * - * - * .google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions object_preconditions = 3; - * - */ - public Builder clearObjectPreconditions() { - if (objectPreconditionsBuilder_ == null) { - objectPreconditions_ = null; - onChanged(); - } else { - objectPreconditions_ = null; - objectPreconditionsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-       * Conditions that must be met for this operation to execute.
-       * 
- * - * - * .google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions object_preconditions = 3; - * - */ - public com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions.Builder - getObjectPreconditionsBuilder() { - - onChanged(); - return getObjectPreconditionsFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Conditions that must be met for this operation to execute.
-       * 
- * - * - * .google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions object_preconditions = 3; - * - */ - public com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditionsOrBuilder - getObjectPreconditionsOrBuilder() { - if (objectPreconditionsBuilder_ != null) { - return objectPreconditionsBuilder_.getMessageOrBuilder(); - } else { - return objectPreconditions_ == null - ? com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - .getDefaultInstance() - : objectPreconditions_; - } - } - /** - * - * - *
-       * Conditions that must be met for this operation to execute.
-       * 
- * - * - * .google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions object_preconditions = 3; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions, - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions.Builder, - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditionsOrBuilder> - getObjectPreconditionsFieldBuilder() { - if (objectPreconditionsBuilder_ == null) { - objectPreconditionsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions, - com.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - .Builder, - com.google.storage.v2.ComposeObjectRequest.SourceObject - .ObjectPreconditionsOrBuilder>( - getObjectPreconditions(), getParentForChildren(), isClean()); - objectPreconditions_ = null; - } - return objectPreconditionsBuilder_; - } - - @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.ComposeObjectRequest.SourceObject) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.ComposeObjectRequest.SourceObject) - private static final com.google.storage.v2.ComposeObjectRequest.SourceObject DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.ComposeObjectRequest.SourceObject(); - } - - public static com.google.storage.v2.ComposeObjectRequest.SourceObject getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SourceObject parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SourceObject(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.ComposeObjectRequest.SourceObject getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - private int bitField0_; - public static final int DESTINATION_FIELD_NUMBER = 1; - private com.google.storage.v2.Object destination_; - /** - * - * - *
-   * Required. Properties of the resulting object.
-   * 
- * - * .google.storage.v2.Object destination = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the destination field is set. - */ - @java.lang.Override - public boolean hasDestination() { - return destination_ != null; - } - /** - * - * - *
-   * Required. Properties of the resulting object.
-   * 
- * - * .google.storage.v2.Object destination = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The destination. - */ - @java.lang.Override - public com.google.storage.v2.Object getDestination() { - return destination_ == null ? com.google.storage.v2.Object.getDefaultInstance() : destination_; - } - /** - * - * - *
-   * Required. Properties of the resulting object.
-   * 
- * - * .google.storage.v2.Object destination = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.storage.v2.ObjectOrBuilder getDestinationOrBuilder() { - return getDestination(); - } - - public static final int SOURCE_OBJECTS_FIELD_NUMBER = 2; - private java.util.List sourceObjects_; - /** - * - * - *
-   * The list of source objects that will be concatenated into a single object.
-   * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - */ - @java.lang.Override - public java.util.List - getSourceObjectsList() { - return sourceObjects_; - } - /** - * - * - *
-   * The list of source objects that will be concatenated into a single object.
-   * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - */ - @java.lang.Override - public java.util.List - getSourceObjectsOrBuilderList() { - return sourceObjects_; - } - /** - * - * - *
-   * The list of source objects that will be concatenated into a single object.
-   * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - */ - @java.lang.Override - public int getSourceObjectsCount() { - return sourceObjects_.size(); - } - /** - * - * - *
-   * The list of source objects that will be concatenated into a single object.
-   * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - */ - @java.lang.Override - public com.google.storage.v2.ComposeObjectRequest.SourceObject getSourceObjects(int index) { - return sourceObjects_.get(index); - } - /** - * - * - *
-   * The list of source objects that will be concatenated into a single object.
-   * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - */ - @java.lang.Override - public com.google.storage.v2.ComposeObjectRequest.SourceObjectOrBuilder getSourceObjectsOrBuilder( - int index) { - return sourceObjects_.get(index); - } - - public static final int DESTINATION_PREDEFINED_ACL_FIELD_NUMBER = 3; - private int destinationPredefinedAcl_; - /** - * - * - *
-   * Apply a predefined set of access controls to the destination object.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl destination_predefined_acl = 3; - * - * @return The enum numeric value on the wire for destinationPredefinedAcl. - */ - @java.lang.Override - public int getDestinationPredefinedAclValue() { - return destinationPredefinedAcl_; - } - /** - * - * - *
-   * Apply a predefined set of access controls to the destination object.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl destination_predefined_acl = 3; - * - * @return The destinationPredefinedAcl. - */ - @java.lang.Override - public com.google.storage.v2.PredefinedObjectAcl getDestinationPredefinedAcl() { - @SuppressWarnings("deprecation") - com.google.storage.v2.PredefinedObjectAcl result = - com.google.storage.v2.PredefinedObjectAcl.valueOf(destinationPredefinedAcl_); - return result == null ? com.google.storage.v2.PredefinedObjectAcl.UNRECOGNIZED : result; - } - - public static final int IF_GENERATION_MATCH_FIELD_NUMBER = 4; - 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_ & 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_METAGENERATION_MATCH_FIELD_NUMBER = 5; - private long ifMetagenerationMatch_; - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * metageneration matches the given value.
-   * 
- * - * optional int64 if_metageneration_match = 5; - * - * @return Whether the ifMetagenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationMatch() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * metageneration matches the given value.
-   * 
- * - * optional int64 if_metageneration_match = 5; - * - * @return The ifMetagenerationMatch. - */ - @java.lang.Override - public long getIfMetagenerationMatch() { - return ifMetagenerationMatch_; - } - - public static final int KMS_KEY_FIELD_NUMBER = 6; - private volatile java.lang.Object kmsKey_; - /** - * - * - *
-   * Resource name of the Cloud KMS key, of the form
-   * `projects/my-project/locations/my-location/keyRings/my-kr/cryptoKeys/my-key`,
-   * that will be used to encrypt the object. Overrides the object
-   * metadata's `kms_key_name` value, if any.
-   * 
- * - * string kms_key = 6 [(.google.api.resource_reference) = { ... } - * - * @return The kmsKey. - */ - @java.lang.Override - public java.lang.String getKmsKey() { - java.lang.Object ref = kmsKey_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - kmsKey_ = s; - return s; - } - } - /** - * - * - *
-   * Resource name of the Cloud KMS key, of the form
-   * `projects/my-project/locations/my-location/keyRings/my-kr/cryptoKeys/my-key`,
-   * that will be used to encrypt the object. Overrides the object
-   * metadata's `kms_key_name` value, if any.
-   * 
- * - * string kms_key = 6 [(.google.api.resource_reference) = { ... } - * - * @return The bytes for kmsKey. - */ - @java.lang.Override - public com.google.protobuf.ByteString getKmsKeyBytes() { - java.lang.Object ref = kmsKey_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - kmsKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER = 7; - 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 = 7; - * - * @return Whether the commonObjectRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonObjectRequestParams() { - return commonObjectRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 7; - * - * @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 = 7; - */ - @java.lang.Override - public com.google.storage.v2.CommonObjectRequestParamsOrBuilder - getCommonObjectRequestParamsOrBuilder() { - return getCommonObjectRequestParams(); - } - - public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 8; - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 8; - * - * @return Whether the commonRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonRequestParams() { - return commonRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 8; - * - * @return The commonRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 8; - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - return getCommonRequestParams(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (destination_ != null) { - output.writeMessage(1, getDestination()); - } - for (int i = 0; i < sourceObjects_.size(); i++) { - output.writeMessage(2, sourceObjects_.get(i)); - } - if (destinationPredefinedAcl_ - != com.google.storage.v2.PredefinedObjectAcl.PREDEFINED_OBJECT_ACL_UNSPECIFIED - .getNumber()) { - output.writeEnum(3, destinationPredefinedAcl_); - } - if (((bitField0_ & 0x00000001) != 0)) { - output.writeInt64(4, ifGenerationMatch_); - } - if (((bitField0_ & 0x00000002) != 0)) { - output.writeInt64(5, ifMetagenerationMatch_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKey_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, kmsKey_); - } - if (commonObjectRequestParams_ != null) { - output.writeMessage(7, getCommonObjectRequestParams()); - } - if (commonRequestParams_ != null) { - output.writeMessage(8, getCommonRequestParams()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (destination_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDestination()); - } - for (int i = 0; i < sourceObjects_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, sourceObjects_.get(i)); - } - if (destinationPredefinedAcl_ - != com.google.storage.v2.PredefinedObjectAcl.PREDEFINED_OBJECT_ACL_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, destinationPredefinedAcl_); - } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, ifGenerationMatch_); - } - if (((bitField0_ & 0x00000002) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, ifMetagenerationMatch_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKey_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, kmsKey_); - } - if (commonObjectRequestParams_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 7, getCommonObjectRequestParams()); - } - if (commonRequestParams_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getCommonRequestParams()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.ComposeObjectRequest)) { - return super.equals(obj); - } - com.google.storage.v2.ComposeObjectRequest other = - (com.google.storage.v2.ComposeObjectRequest) obj; - - if (hasDestination() != other.hasDestination()) return false; - if (hasDestination()) { - if (!getDestination().equals(other.getDestination())) return false; - } - if (!getSourceObjectsList().equals(other.getSourceObjectsList())) return false; - if (destinationPredefinedAcl_ != other.destinationPredefinedAcl_) return false; - if (hasIfGenerationMatch() != other.hasIfGenerationMatch()) return false; - if (hasIfGenerationMatch()) { - if (getIfGenerationMatch() != other.getIfGenerationMatch()) return false; - } - if (hasIfMetagenerationMatch() != other.hasIfMetagenerationMatch()) return false; - if (hasIfMetagenerationMatch()) { - if (getIfMetagenerationMatch() != other.getIfMetagenerationMatch()) return false; - } - if (!getKmsKey().equals(other.getKmsKey())) return false; - if (hasCommonObjectRequestParams() != other.hasCommonObjectRequestParams()) return false; - if (hasCommonObjectRequestParams()) { - if (!getCommonObjectRequestParams().equals(other.getCommonObjectRequestParams())) - return false; - } - if (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; - if (hasCommonRequestParams()) { - if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasDestination()) { - hash = (37 * hash) + DESTINATION_FIELD_NUMBER; - hash = (53 * hash) + getDestination().hashCode(); - } - if (getSourceObjectsCount() > 0) { - hash = (37 * hash) + SOURCE_OBJECTS_FIELD_NUMBER; - hash = (53 * hash) + getSourceObjectsList().hashCode(); - } - hash = (37 * hash) + DESTINATION_PREDEFINED_ACL_FIELD_NUMBER; - hash = (53 * hash) + destinationPredefinedAcl_; - if (hasIfGenerationMatch()) { - hash = (37 * hash) + IF_GENERATION_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfGenerationMatch()); - } - if (hasIfMetagenerationMatch()) { - hash = (37 * hash) + IF_METAGENERATION_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationMatch()); - } - hash = (37 * hash) + KMS_KEY_FIELD_NUMBER; - hash = (53 * hash) + getKmsKey().hashCode(); - if (hasCommonObjectRequestParams()) { - hash = (37 * hash) + COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonObjectRequestParams().hashCode(); - } - if (hasCommonRequestParams()) { - hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonRequestParams().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.ComposeObjectRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ComposeObjectRequest 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.ComposeObjectRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ComposeObjectRequest 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.ComposeObjectRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ComposeObjectRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ComposeObjectRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ComposeObjectRequest 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.ComposeObjectRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ComposeObjectRequest 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.ComposeObjectRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ComposeObjectRequest 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.ComposeObjectRequest 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 ComposeObject.
-   * 
- * - * Protobuf type {@code google.storage.v2.ComposeObjectRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.ComposeObjectRequest) - com.google.storage.v2.ComposeObjectRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ComposeObjectRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ComposeObjectRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ComposeObjectRequest.class, - com.google.storage.v2.ComposeObjectRequest.Builder.class); - } - - // Construct using com.google.storage.v2.ComposeObjectRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getSourceObjectsFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (destinationBuilder_ == null) { - destination_ = null; - } else { - destination_ = null; - destinationBuilder_ = null; - } - if (sourceObjectsBuilder_ == null) { - sourceObjects_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - sourceObjectsBuilder_.clear(); - } - destinationPredefinedAcl_ = 0; - - ifGenerationMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000002); - ifMetagenerationMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000004); - kmsKey_ = ""; - - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = null; - } else { - commonObjectRequestParams_ = null; - commonObjectRequestParamsBuilder_ = null; - } - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ComposeObjectRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.ComposeObjectRequest getDefaultInstanceForType() { - return com.google.storage.v2.ComposeObjectRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.ComposeObjectRequest build() { - com.google.storage.v2.ComposeObjectRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.ComposeObjectRequest buildPartial() { - com.google.storage.v2.ComposeObjectRequest result = - new com.google.storage.v2.ComposeObjectRequest(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (destinationBuilder_ == null) { - result.destination_ = destination_; - } else { - result.destination_ = destinationBuilder_.build(); - } - if (sourceObjectsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - sourceObjects_ = java.util.Collections.unmodifiableList(sourceObjects_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.sourceObjects_ = sourceObjects_; - } else { - result.sourceObjects_ = sourceObjectsBuilder_.build(); - } - result.destinationPredefinedAcl_ = destinationPredefinedAcl_; - if (((from_bitField0_ & 0x00000002) != 0)) { - result.ifGenerationMatch_ = ifGenerationMatch_; - to_bitField0_ |= 0x00000001; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.ifMetagenerationMatch_ = ifMetagenerationMatch_; - to_bitField0_ |= 0x00000002; - } - result.kmsKey_ = kmsKey_; - if (commonObjectRequestParamsBuilder_ == null) { - result.commonObjectRequestParams_ = commonObjectRequestParams_; - } else { - result.commonObjectRequestParams_ = commonObjectRequestParamsBuilder_.build(); - } - if (commonRequestParamsBuilder_ == null) { - result.commonRequestParams_ = commonRequestParams_; - } else { - result.commonRequestParams_ = commonRequestParamsBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.ComposeObjectRequest) { - return mergeFrom((com.google.storage.v2.ComposeObjectRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.ComposeObjectRequest other) { - if (other == com.google.storage.v2.ComposeObjectRequest.getDefaultInstance()) return this; - if (other.hasDestination()) { - mergeDestination(other.getDestination()); - } - if (sourceObjectsBuilder_ == null) { - if (!other.sourceObjects_.isEmpty()) { - if (sourceObjects_.isEmpty()) { - sourceObjects_ = other.sourceObjects_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureSourceObjectsIsMutable(); - sourceObjects_.addAll(other.sourceObjects_); - } - onChanged(); - } - } else { - if (!other.sourceObjects_.isEmpty()) { - if (sourceObjectsBuilder_.isEmpty()) { - sourceObjectsBuilder_.dispose(); - sourceObjectsBuilder_ = null; - sourceObjects_ = other.sourceObjects_; - bitField0_ = (bitField0_ & ~0x00000001); - sourceObjectsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getSourceObjectsFieldBuilder() - : null; - } else { - sourceObjectsBuilder_.addAllMessages(other.sourceObjects_); - } - } - } - if (other.destinationPredefinedAcl_ != 0) { - setDestinationPredefinedAclValue(other.getDestinationPredefinedAclValue()); - } - if (other.hasIfGenerationMatch()) { - setIfGenerationMatch(other.getIfGenerationMatch()); - } - if (other.hasIfMetagenerationMatch()) { - setIfMetagenerationMatch(other.getIfMetagenerationMatch()); - } - if (!other.getKmsKey().isEmpty()) { - kmsKey_ = other.kmsKey_; - onChanged(); - } - if (other.hasCommonObjectRequestParams()) { - mergeCommonObjectRequestParams(other.getCommonObjectRequestParams()); - } - if (other.hasCommonRequestParams()) { - mergeCommonRequestParams(other.getCommonRequestParams()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.ComposeObjectRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.ComposeObjectRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private com.google.storage.v2.Object destination_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder> - destinationBuilder_; - /** - * - * - *
-     * Required. Properties of the resulting object.
-     * 
- * - * .google.storage.v2.Object destination = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the destination field is set. - */ - public boolean hasDestination() { - return destinationBuilder_ != null || destination_ != null; - } - /** - * - * - *
-     * Required. Properties of the resulting object.
-     * 
- * - * .google.storage.v2.Object destination = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The destination. - */ - public com.google.storage.v2.Object getDestination() { - if (destinationBuilder_ == null) { - return destination_ == null - ? com.google.storage.v2.Object.getDefaultInstance() - : destination_; - } else { - return destinationBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. Properties of the resulting object.
-     * 
- * - * .google.storage.v2.Object destination = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setDestination(com.google.storage.v2.Object value) { - if (destinationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - destination_ = value; - onChanged(); - } else { - destinationBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. Properties of the resulting object.
-     * 
- * - * .google.storage.v2.Object destination = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setDestination(com.google.storage.v2.Object.Builder builderForValue) { - if (destinationBuilder_ == null) { - destination_ = builderForValue.build(); - onChanged(); - } else { - destinationBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. Properties of the resulting object.
-     * 
- * - * .google.storage.v2.Object destination = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeDestination(com.google.storage.v2.Object value) { - if (destinationBuilder_ == null) { - if (destination_ != null) { - destination_ = - com.google.storage.v2.Object.newBuilder(destination_).mergeFrom(value).buildPartial(); - } else { - destination_ = value; - } - onChanged(); - } else { - destinationBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. Properties of the resulting object.
-     * 
- * - * .google.storage.v2.Object destination = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearDestination() { - if (destinationBuilder_ == null) { - destination_ = null; - onChanged(); - } else { - destination_ = null; - destinationBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. Properties of the resulting object.
-     * 
- * - * .google.storage.v2.Object destination = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.storage.v2.Object.Builder getDestinationBuilder() { - - onChanged(); - return getDestinationFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. Properties of the resulting object.
-     * 
- * - * .google.storage.v2.Object destination = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.storage.v2.ObjectOrBuilder getDestinationOrBuilder() { - if (destinationBuilder_ != null) { - return destinationBuilder_.getMessageOrBuilder(); - } else { - return destination_ == null - ? com.google.storage.v2.Object.getDefaultInstance() - : destination_; - } - } - /** - * - * - *
-     * Required. Properties of the resulting object.
-     * 
- * - * .google.storage.v2.Object destination = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder> - getDestinationFieldBuilder() { - if (destinationBuilder_ == null) { - destinationBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder>( - getDestination(), getParentForChildren(), isClean()); - destination_ = null; - } - return destinationBuilder_; - } - - private java.util.List sourceObjects_ = - java.util.Collections.emptyList(); - - private void ensureSourceObjectsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - sourceObjects_ = - new java.util.ArrayList( - sourceObjects_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.ComposeObjectRequest.SourceObject, - com.google.storage.v2.ComposeObjectRequest.SourceObject.Builder, - com.google.storage.v2.ComposeObjectRequest.SourceObjectOrBuilder> - sourceObjectsBuilder_; - - /** - * - * - *
-     * The list of source objects that will be concatenated into a single object.
-     * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - * - */ - public java.util.List - getSourceObjectsList() { - if (sourceObjectsBuilder_ == null) { - return java.util.Collections.unmodifiableList(sourceObjects_); - } else { - return sourceObjectsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * The list of source objects that will be concatenated into a single object.
-     * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - * - */ - public int getSourceObjectsCount() { - if (sourceObjectsBuilder_ == null) { - return sourceObjects_.size(); - } else { - return sourceObjectsBuilder_.getCount(); - } - } - /** - * - * - *
-     * The list of source objects that will be concatenated into a single object.
-     * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - * - */ - public com.google.storage.v2.ComposeObjectRequest.SourceObject getSourceObjects(int index) { - if (sourceObjectsBuilder_ == null) { - return sourceObjects_.get(index); - } else { - return sourceObjectsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * The list of source objects that will be concatenated into a single object.
-     * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - * - */ - public Builder setSourceObjects( - int index, com.google.storage.v2.ComposeObjectRequest.SourceObject value) { - if (sourceObjectsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSourceObjectsIsMutable(); - sourceObjects_.set(index, value); - onChanged(); - } else { - sourceObjectsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The list of source objects that will be concatenated into a single object.
-     * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - * - */ - public Builder setSourceObjects( - int index, - com.google.storage.v2.ComposeObjectRequest.SourceObject.Builder builderForValue) { - if (sourceObjectsBuilder_ == null) { - ensureSourceObjectsIsMutable(); - sourceObjects_.set(index, builderForValue.build()); - onChanged(); - } else { - sourceObjectsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The list of source objects that will be concatenated into a single object.
-     * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - * - */ - public Builder addSourceObjects(com.google.storage.v2.ComposeObjectRequest.SourceObject value) { - if (sourceObjectsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSourceObjectsIsMutable(); - sourceObjects_.add(value); - onChanged(); - } else { - sourceObjectsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * The list of source objects that will be concatenated into a single object.
-     * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - * - */ - public Builder addSourceObjects( - int index, com.google.storage.v2.ComposeObjectRequest.SourceObject value) { - if (sourceObjectsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSourceObjectsIsMutable(); - sourceObjects_.add(index, value); - onChanged(); - } else { - sourceObjectsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The list of source objects that will be concatenated into a single object.
-     * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - * - */ - public Builder addSourceObjects( - com.google.storage.v2.ComposeObjectRequest.SourceObject.Builder builderForValue) { - if (sourceObjectsBuilder_ == null) { - ensureSourceObjectsIsMutable(); - sourceObjects_.add(builderForValue.build()); - onChanged(); - } else { - sourceObjectsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The list of source objects that will be concatenated into a single object.
-     * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - * - */ - public Builder addSourceObjects( - int index, - com.google.storage.v2.ComposeObjectRequest.SourceObject.Builder builderForValue) { - if (sourceObjectsBuilder_ == null) { - ensureSourceObjectsIsMutable(); - sourceObjects_.add(index, builderForValue.build()); - onChanged(); - } else { - sourceObjectsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The list of source objects that will be concatenated into a single object.
-     * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - * - */ - public Builder addAllSourceObjects( - java.lang.Iterable - values) { - if (sourceObjectsBuilder_ == null) { - ensureSourceObjectsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, sourceObjects_); - onChanged(); - } else { - sourceObjectsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * The list of source objects that will be concatenated into a single object.
-     * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - * - */ - public Builder clearSourceObjects() { - if (sourceObjectsBuilder_ == null) { - sourceObjects_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - sourceObjectsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * The list of source objects that will be concatenated into a single object.
-     * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - * - */ - public Builder removeSourceObjects(int index) { - if (sourceObjectsBuilder_ == null) { - ensureSourceObjectsIsMutable(); - sourceObjects_.remove(index); - onChanged(); - } else { - sourceObjectsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * The list of source objects that will be concatenated into a single object.
-     * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - * - */ - public com.google.storage.v2.ComposeObjectRequest.SourceObject.Builder getSourceObjectsBuilder( - int index) { - return getSourceObjectsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * The list of source objects that will be concatenated into a single object.
-     * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - * - */ - public com.google.storage.v2.ComposeObjectRequest.SourceObjectOrBuilder - getSourceObjectsOrBuilder(int index) { - if (sourceObjectsBuilder_ == null) { - return sourceObjects_.get(index); - } else { - return sourceObjectsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * The list of source objects that will be concatenated into a single object.
-     * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - * - */ - public java.util.List< - ? extends com.google.storage.v2.ComposeObjectRequest.SourceObjectOrBuilder> - getSourceObjectsOrBuilderList() { - if (sourceObjectsBuilder_ != null) { - return sourceObjectsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(sourceObjects_); - } - } - /** - * - * - *
-     * The list of source objects that will be concatenated into a single object.
-     * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - * - */ - public com.google.storage.v2.ComposeObjectRequest.SourceObject.Builder - addSourceObjectsBuilder() { - return getSourceObjectsFieldBuilder() - .addBuilder(com.google.storage.v2.ComposeObjectRequest.SourceObject.getDefaultInstance()); - } - /** - * - * - *
-     * The list of source objects that will be concatenated into a single object.
-     * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - * - */ - public com.google.storage.v2.ComposeObjectRequest.SourceObject.Builder addSourceObjectsBuilder( - int index) { - return getSourceObjectsFieldBuilder() - .addBuilder( - index, com.google.storage.v2.ComposeObjectRequest.SourceObject.getDefaultInstance()); - } - /** - * - * - *
-     * The list of source objects that will be concatenated into a single object.
-     * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - * - */ - public java.util.List - getSourceObjectsBuilderList() { - return getSourceObjectsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.ComposeObjectRequest.SourceObject, - com.google.storage.v2.ComposeObjectRequest.SourceObject.Builder, - com.google.storage.v2.ComposeObjectRequest.SourceObjectOrBuilder> - getSourceObjectsFieldBuilder() { - if (sourceObjectsBuilder_ == null) { - sourceObjectsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.ComposeObjectRequest.SourceObject, - com.google.storage.v2.ComposeObjectRequest.SourceObject.Builder, - com.google.storage.v2.ComposeObjectRequest.SourceObjectOrBuilder>( - sourceObjects_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - sourceObjects_ = null; - } - return sourceObjectsBuilder_; - } - - private int destinationPredefinedAcl_ = 0; - /** - * - * - *
-     * Apply a predefined set of access controls to the destination object.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl destination_predefined_acl = 3; - * - * @return The enum numeric value on the wire for destinationPredefinedAcl. - */ - @java.lang.Override - public int getDestinationPredefinedAclValue() { - return destinationPredefinedAcl_; - } - /** - * - * - *
-     * Apply a predefined set of access controls to the destination object.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl destination_predefined_acl = 3; - * - * @param value The enum numeric value on the wire for destinationPredefinedAcl to set. - * @return This builder for chaining. - */ - public Builder setDestinationPredefinedAclValue(int value) { - - destinationPredefinedAcl_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Apply a predefined set of access controls to the destination object.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl destination_predefined_acl = 3; - * - * @return The destinationPredefinedAcl. - */ - @java.lang.Override - public com.google.storage.v2.PredefinedObjectAcl getDestinationPredefinedAcl() { - @SuppressWarnings("deprecation") - com.google.storage.v2.PredefinedObjectAcl result = - com.google.storage.v2.PredefinedObjectAcl.valueOf(destinationPredefinedAcl_); - return result == null ? com.google.storage.v2.PredefinedObjectAcl.UNRECOGNIZED : result; - } - /** - * - * - *
-     * Apply a predefined set of access controls to the destination object.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl destination_predefined_acl = 3; - * - * @param value The destinationPredefinedAcl to set. - * @return This builder for chaining. - */ - public Builder setDestinationPredefinedAcl(com.google.storage.v2.PredefinedObjectAcl value) { - if (value == null) { - throw new NullPointerException(); - } - - destinationPredefinedAcl_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * Apply a predefined set of access controls to the destination object.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl destination_predefined_acl = 3; - * - * @return This builder for chaining. - */ - public Builder clearDestinationPredefinedAcl() { - - destinationPredefinedAcl_ = 0; - onChanged(); - return this; - } - - private long ifGenerationMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * matches the given value. Setting to 0 makes the operation succeed only if
-     * there are no live versions of the object.
-     * 
- * - * optional int64 if_generation_match = 4; - * - * @return Whether the ifGenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfGenerationMatch() { - return ((bitField0_ & 0x00000002) != 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) { - bitField0_ |= 0x00000002; - ifGenerationMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * matches the given value. Setting to 0 makes the operation succeed only if
-     * there are no live versions of the object.
-     * 
- * - * optional int64 if_generation_match = 4; - * - * @return This builder for chaining. - */ - public Builder clearIfGenerationMatch() { - bitField0_ = (bitField0_ & ~0x00000002); - ifGenerationMatch_ = 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 = 5; - * - * @return Whether the ifMetagenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationMatch() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration matches the given value.
-     * 
- * - * optional int64 if_metageneration_match = 5; - * - * @return The ifMetagenerationMatch. - */ - @java.lang.Override - public long getIfMetagenerationMatch() { - return ifMetagenerationMatch_; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration matches the given value.
-     * 
- * - * optional int64 if_metageneration_match = 5; - * - * @param value The ifMetagenerationMatch to set. - * @return This builder for chaining. - */ - public Builder setIfMetagenerationMatch(long value) { - bitField0_ |= 0x00000004; - ifMetagenerationMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration matches the given value.
-     * 
- * - * optional int64 if_metageneration_match = 5; - * - * @return This builder for chaining. - */ - public Builder clearIfMetagenerationMatch() { - bitField0_ = (bitField0_ & ~0x00000004); - ifMetagenerationMatch_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object kmsKey_ = ""; - /** - * - * - *
-     * Resource name of the Cloud KMS key, of the form
-     * `projects/my-project/locations/my-location/keyRings/my-kr/cryptoKeys/my-key`,
-     * that will be used to encrypt the object. Overrides the object
-     * metadata's `kms_key_name` value, if any.
-     * 
- * - * string kms_key = 6 [(.google.api.resource_reference) = { ... } - * - * @return The kmsKey. - */ - public java.lang.String getKmsKey() { - java.lang.Object ref = kmsKey_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - kmsKey_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Resource name of the Cloud KMS key, of the form
-     * `projects/my-project/locations/my-location/keyRings/my-kr/cryptoKeys/my-key`,
-     * that will be used to encrypt the object. Overrides the object
-     * metadata's `kms_key_name` value, if any.
-     * 
- * - * string kms_key = 6 [(.google.api.resource_reference) = { ... } - * - * @return The bytes for kmsKey. - */ - public com.google.protobuf.ByteString getKmsKeyBytes() { - java.lang.Object ref = kmsKey_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - kmsKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Resource name of the Cloud KMS key, of the form
-     * `projects/my-project/locations/my-location/keyRings/my-kr/cryptoKeys/my-key`,
-     * that will be used to encrypt the object. Overrides the object
-     * metadata's `kms_key_name` value, if any.
-     * 
- * - * string kms_key = 6 [(.google.api.resource_reference) = { ... } - * - * @param value The kmsKey to set. - * @return This builder for chaining. - */ - public Builder setKmsKey(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - kmsKey_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Resource name of the Cloud KMS key, of the form
-     * `projects/my-project/locations/my-location/keyRings/my-kr/cryptoKeys/my-key`,
-     * that will be used to encrypt the object. Overrides the object
-     * metadata's `kms_key_name` value, if any.
-     * 
- * - * string kms_key = 6 [(.google.api.resource_reference) = { ... } - * - * @return This builder for chaining. - */ - public Builder clearKmsKey() { - - kmsKey_ = getDefaultInstance().getKmsKey(); - onChanged(); - return this; - } - /** - * - * - *
-     * Resource name of the Cloud KMS key, of the form
-     * `projects/my-project/locations/my-location/keyRings/my-kr/cryptoKeys/my-key`,
-     * that will be used to encrypt the object. Overrides the object
-     * metadata's `kms_key_name` value, if any.
-     * 
- * - * string kms_key = 6 [(.google.api.resource_reference) = { ... } - * - * @param value The bytes for kmsKey to set. - * @return This builder for chaining. - */ - public Builder setKmsKeyBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - kmsKey_ = value; - onChanged(); - return this; - } - - private com.google.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 = 7; - * - * @return Whether the commonObjectRequestParams field is set. - */ - public boolean hasCommonObjectRequestParams() { - return commonObjectRequestParamsBuilder_ != null || commonObjectRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 7; - * - * @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 = 7; - */ - public Builder setCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams value) { - if (commonObjectRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonObjectRequestParams_ = value; - onChanged(); - } else { - commonObjectRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 7; - */ - public Builder setCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams.Builder builderForValue) { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonObjectRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 7; - */ - public Builder mergeCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams value) { - if (commonObjectRequestParamsBuilder_ == null) { - if (commonObjectRequestParams_ != null) { - commonObjectRequestParams_ = - com.google.storage.v2.CommonObjectRequestParams.newBuilder(commonObjectRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonObjectRequestParams_ = value; - } - onChanged(); - } else { - commonObjectRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 7; - */ - public Builder clearCommonObjectRequestParams() { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = null; - onChanged(); - } else { - commonObjectRequestParams_ = null; - commonObjectRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 7; - */ - public com.google.storage.v2.CommonObjectRequestParams.Builder - getCommonObjectRequestParamsBuilder() { - - onChanged(); - return getCommonObjectRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 7; - */ - 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 = 7; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder> - getCommonObjectRequestParamsFieldBuilder() { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder>( - getCommonObjectRequestParams(), getParentForChildren(), isClean()); - commonObjectRequestParams_ = null; - } - return commonObjectRequestParamsBuilder_; - } - - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - commonRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 8; - * - * @return Whether the commonRequestParams field is set. - */ - public boolean hasCommonRequestParams() { - return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 8; - * - * @return The commonRequestParams. - */ - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } else { - return commonRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 8; - */ - public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonRequestParams_ = value; - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 8; - */ - public Builder setCommonRequestParams( - com.google.storage.v2.CommonRequestParams.Builder builderForValue) { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 8; - */ - public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (commonRequestParams_ != null) { - commonRequestParams_ = - com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonRequestParams_ = value; - } - onChanged(); - } else { - commonRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 8; - */ - public Builder clearCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - onChanged(); - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 8; - */ - public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { - - onChanged(); - return getCommonRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 8; - */ - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - if (commonRequestParamsBuilder_ != null) { - return commonRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 8; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - getCommonRequestParamsFieldBuilder() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder>( - getCommonRequestParams(), getParentForChildren(), isClean()); - commonRequestParams_ = null; - } - return commonRequestParamsBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.ComposeObjectRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.ComposeObjectRequest) - private static final com.google.storage.v2.ComposeObjectRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.ComposeObjectRequest(); - } - - public static com.google.storage.v2.ComposeObjectRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ComposeObjectRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ComposeObjectRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.ComposeObjectRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ComposeObjectRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ComposeObjectRequestOrBuilder.java deleted file mode 100644 index fd2b99cb8d..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ComposeObjectRequestOrBuilder.java +++ /dev/null @@ -1,298 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface ComposeObjectRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.ComposeObjectRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Properties of the resulting object.
-   * 
- * - * .google.storage.v2.Object destination = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the destination field is set. - */ - boolean hasDestination(); - /** - * - * - *
-   * Required. Properties of the resulting object.
-   * 
- * - * .google.storage.v2.Object destination = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The destination. - */ - com.google.storage.v2.Object getDestination(); - /** - * - * - *
-   * Required. Properties of the resulting object.
-   * 
- * - * .google.storage.v2.Object destination = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.storage.v2.ObjectOrBuilder getDestinationOrBuilder(); - - /** - * - * - *
-   * The list of source objects that will be concatenated into a single object.
-   * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - */ - java.util.List getSourceObjectsList(); - /** - * - * - *
-   * The list of source objects that will be concatenated into a single object.
-   * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - */ - com.google.storage.v2.ComposeObjectRequest.SourceObject getSourceObjects(int index); - /** - * - * - *
-   * The list of source objects that will be concatenated into a single object.
-   * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - */ - int getSourceObjectsCount(); - /** - * - * - *
-   * The list of source objects that will be concatenated into a single object.
-   * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - */ - java.util.List - getSourceObjectsOrBuilderList(); - /** - * - * - *
-   * The list of source objects that will be concatenated into a single object.
-   * 
- * - * repeated .google.storage.v2.ComposeObjectRequest.SourceObject source_objects = 2; - */ - com.google.storage.v2.ComposeObjectRequest.SourceObjectOrBuilder getSourceObjectsOrBuilder( - int index); - - /** - * - * - *
-   * Apply a predefined set of access controls to the destination object.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl destination_predefined_acl = 3; - * - * @return The enum numeric value on the wire for destinationPredefinedAcl. - */ - int getDestinationPredefinedAclValue(); - /** - * - * - *
-   * Apply a predefined set of access controls to the destination object.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl destination_predefined_acl = 3; - * - * @return The destinationPredefinedAcl. - */ - com.google.storage.v2.PredefinedObjectAcl getDestinationPredefinedAcl(); - - /** - * - * - *
-   * 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 current
-   * metageneration matches the given value.
-   * 
- * - * optional int64 if_metageneration_match = 5; - * - * @return Whether the ifMetagenerationMatch field is set. - */ - boolean hasIfMetagenerationMatch(); - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * metageneration matches the given value.
-   * 
- * - * optional int64 if_metageneration_match = 5; - * - * @return The ifMetagenerationMatch. - */ - long getIfMetagenerationMatch(); - - /** - * - * - *
-   * Resource name of the Cloud KMS key, of the form
-   * `projects/my-project/locations/my-location/keyRings/my-kr/cryptoKeys/my-key`,
-   * that will be used to encrypt the object. Overrides the object
-   * metadata's `kms_key_name` value, if any.
-   * 
- * - * string kms_key = 6 [(.google.api.resource_reference) = { ... } - * - * @return The kmsKey. - */ - java.lang.String getKmsKey(); - /** - * - * - *
-   * Resource name of the Cloud KMS key, of the form
-   * `projects/my-project/locations/my-location/keyRings/my-kr/cryptoKeys/my-key`,
-   * that will be used to encrypt the object. Overrides the object
-   * metadata's `kms_key_name` value, if any.
-   * 
- * - * string kms_key = 6 [(.google.api.resource_reference) = { ... } - * - * @return The bytes for kmsKey. - */ - com.google.protobuf.ByteString getKmsKeyBytes(); - - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 7; - * - * @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 = 7; - * - * @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 = 7; - */ - com.google.storage.v2.CommonObjectRequestParamsOrBuilder getCommonObjectRequestParamsOrBuilder(); - - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 8; - * - * @return Whether the commonRequestParams field is set. - */ - boolean hasCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 8; - * - * @return The commonRequestParams. - */ - com.google.storage.v2.CommonRequestParams getCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 8; - */ - com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ContentRange.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ContentRange.java deleted file mode 100644 index 9d50a9dd6a..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ContentRange.java +++ /dev/null @@ -1,721 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Specifies a requested range of bytes to download.
- * 
- * - * Protobuf type {@code google.storage.v2.ContentRange} - */ -public final class ContentRange extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.ContentRange) - ContentRangeOrBuilder { - private static final long serialVersionUID = 0L; - // Use ContentRange.newBuilder() to construct. - private ContentRange(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ContentRange() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ContentRange(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ContentRange( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - start_ = input.readInt64(); - break; - } - case 16: - { - end_ = input.readInt64(); - break; - } - case 24: - { - completeLength_ = input.readInt64(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ContentRange_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ContentRange_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ContentRange.class, - com.google.storage.v2.ContentRange.Builder.class); - } - - public static final int START_FIELD_NUMBER = 1; - private long start_; - /** - * - * - *
-   * The starting offset of the object data.
-   * 
- * - * int64 start = 1; - * - * @return The start. - */ - @java.lang.Override - public long getStart() { - return start_; - } - - public static final int END_FIELD_NUMBER = 2; - private long end_; - /** - * - * - *
-   * The ending offset of the object data.
-   * 
- * - * int64 end = 2; - * - * @return The end. - */ - @java.lang.Override - public long getEnd() { - return end_; - } - - public static final int COMPLETE_LENGTH_FIELD_NUMBER = 3; - private long completeLength_; - /** - * - * - *
-   * The complete length of the object data.
-   * 
- * - * int64 complete_length = 3; - * - * @return The completeLength. - */ - @java.lang.Override - public long getCompleteLength() { - return completeLength_; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (start_ != 0L) { - output.writeInt64(1, start_); - } - if (end_ != 0L) { - output.writeInt64(2, end_); - } - if (completeLength_ != 0L) { - output.writeInt64(3, completeLength_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (start_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, start_); - } - if (end_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, end_); - } - if (completeLength_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, completeLength_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.ContentRange)) { - return super.equals(obj); - } - com.google.storage.v2.ContentRange other = (com.google.storage.v2.ContentRange) obj; - - if (getStart() != other.getStart()) return false; - if (getEnd() != other.getEnd()) return false; - if (getCompleteLength() != other.getCompleteLength()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + START_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getStart()); - hash = (37 * hash) + END_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getEnd()); - hash = (37 * hash) + COMPLETE_LENGTH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCompleteLength()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.ContentRange parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ContentRange parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ContentRange parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ContentRange parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ContentRange parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ContentRange parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ContentRange parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ContentRange parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.ContentRange parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ContentRange parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.ContentRange parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ContentRange parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.ContentRange prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Specifies a requested range of bytes to download.
-   * 
- * - * Protobuf type {@code google.storage.v2.ContentRange} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.ContentRange) - com.google.storage.v2.ContentRangeOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ContentRange_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ContentRange_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ContentRange.class, - com.google.storage.v2.ContentRange.Builder.class); - } - - // Construct using com.google.storage.v2.ContentRange.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - start_ = 0L; - - end_ = 0L; - - completeLength_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ContentRange_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.ContentRange getDefaultInstanceForType() { - return com.google.storage.v2.ContentRange.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.ContentRange build() { - com.google.storage.v2.ContentRange result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.ContentRange buildPartial() { - com.google.storage.v2.ContentRange result = new com.google.storage.v2.ContentRange(this); - result.start_ = start_; - result.end_ = end_; - result.completeLength_ = completeLength_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.ContentRange) { - return mergeFrom((com.google.storage.v2.ContentRange) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.ContentRange other) { - if (other == com.google.storage.v2.ContentRange.getDefaultInstance()) return this; - if (other.getStart() != 0L) { - setStart(other.getStart()); - } - if (other.getEnd() != 0L) { - setEnd(other.getEnd()); - } - if (other.getCompleteLength() != 0L) { - setCompleteLength(other.getCompleteLength()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.ContentRange parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.ContentRange) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long start_; - /** - * - * - *
-     * The starting offset of the object data.
-     * 
- * - * int64 start = 1; - * - * @return The start. - */ - @java.lang.Override - public long getStart() { - return start_; - } - /** - * - * - *
-     * The starting offset of the object data.
-     * 
- * - * int64 start = 1; - * - * @param value The start to set. - * @return This builder for chaining. - */ - public Builder setStart(long value) { - - start_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The starting offset of the object data.
-     * 
- * - * int64 start = 1; - * - * @return This builder for chaining. - */ - public Builder clearStart() { - - start_ = 0L; - onChanged(); - return this; - } - - private long end_; - /** - * - * - *
-     * The ending offset of the object data.
-     * 
- * - * int64 end = 2; - * - * @return The end. - */ - @java.lang.Override - public long getEnd() { - return end_; - } - /** - * - * - *
-     * The ending offset of the object data.
-     * 
- * - * int64 end = 2; - * - * @param value The end to set. - * @return This builder for chaining. - */ - public Builder setEnd(long value) { - - end_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The ending offset of the object data.
-     * 
- * - * int64 end = 2; - * - * @return This builder for chaining. - */ - public Builder clearEnd() { - - end_ = 0L; - onChanged(); - return this; - } - - private long completeLength_; - /** - * - * - *
-     * The complete length of the object data.
-     * 
- * - * int64 complete_length = 3; - * - * @return The completeLength. - */ - @java.lang.Override - public long getCompleteLength() { - return completeLength_; - } - /** - * - * - *
-     * The complete length of the object data.
-     * 
- * - * int64 complete_length = 3; - * - * @param value The completeLength to set. - * @return This builder for chaining. - */ - public Builder setCompleteLength(long value) { - - completeLength_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The complete length of the object data.
-     * 
- * - * int64 complete_length = 3; - * - * @return This builder for chaining. - */ - public Builder clearCompleteLength() { - - completeLength_ = 0L; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.ContentRange) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.ContentRange) - private static final com.google.storage.v2.ContentRange DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.ContentRange(); - } - - public static com.google.storage.v2.ContentRange getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ContentRange parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ContentRange(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.ContentRange getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ContentRangeOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ContentRangeOrBuilder.java deleted file mode 100644 index 969abe6d3b..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ContentRangeOrBuilder.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface ContentRangeOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.ContentRange) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The starting offset of the object data.
-   * 
- * - * int64 start = 1; - * - * @return The start. - */ - long getStart(); - - /** - * - * - *
-   * The ending offset of the object data.
-   * 
- * - * int64 end = 2; - * - * @return The end. - */ - long getEnd(); - - /** - * - * - *
-   * The complete length of the object data.
-   * 
- * - * int64 complete_length = 3; - * - * @return The completeLength. - */ - long getCompleteLength(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateBucketRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateBucketRequest.java deleted file mode 100644 index 86f986b4d8..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateBucketRequest.java +++ /dev/null @@ -1,1440 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request message for CreateBucket.
- * 
- * - * Protobuf type {@code google.storage.v2.CreateBucketRequest} - */ -public final class CreateBucketRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.CreateBucketRequest) - CreateBucketRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use CreateBucketRequest.newBuilder() to construct. - private CreateBucketRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CreateBucketRequest() { - parent_ = ""; - bucketId_ = ""; - predefinedAcl_ = 0; - predefinedDefaultObjectAcl_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CreateBucketRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CreateBucketRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 18: - { - com.google.storage.v2.Bucket.Builder subBuilder = null; - if (bucket_ != null) { - subBuilder = bucket_.toBuilder(); - } - bucket_ = input.readMessage(com.google.storage.v2.Bucket.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(bucket_); - bucket_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - bucketId_ = s; - break; - } - case 32: - { - int rawValue = input.readEnum(); - - predefinedAcl_ = rawValue; - break; - } - case 40: - { - int rawValue = input.readEnum(); - - predefinedDefaultObjectAcl_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateBucketRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateBucketRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.CreateBucketRequest.class, - com.google.storage.v2.CreateBucketRequest.Builder.class); - } - - public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; - /** - * - * - *
-   * Required. The project to which this bucket will belong.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - @java.lang.Override - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The project to which this bucket will belong.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - @java.lang.Override - public com.google.protobuf.ByteString getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int BUCKET_FIELD_NUMBER = 2; - private com.google.storage.v2.Bucket bucket_; - /** - * - * - *
-   * Required. Properties of the new bucket being inserted.
-   * The project and name of the bucket are specified in this request, not in
-   * the bucket resource.
-   * 
- * - * .google.storage.v2.Bucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return Whether the bucket field is set. - */ - @java.lang.Override - public boolean hasBucket() { - return bucket_ != null; - } - /** - * - * - *
-   * Required. Properties of the new bucket being inserted.
-   * The project and name of the bucket are specified in this request, not in
-   * the bucket resource.
-   * 
- * - * .google.storage.v2.Bucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bucket. - */ - @java.lang.Override - public com.google.storage.v2.Bucket getBucket() { - return bucket_ == null ? com.google.storage.v2.Bucket.getDefaultInstance() : bucket_; - } - /** - * - * - *
-   * Required. Properties of the new bucket being inserted.
-   * The project and name of the bucket are specified in this request, not in
-   * the bucket resource.
-   * 
- * - * .google.storage.v2.Bucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - @java.lang.Override - public com.google.storage.v2.BucketOrBuilder getBucketOrBuilder() { - return getBucket(); - } - - public static final int BUCKET_ID_FIELD_NUMBER = 3; - private volatile java.lang.Object bucketId_; - /** - * - * - *
-   * Required. The ID to use for this bucket, which will become the final component of
-   * the bucket's resource name. For example, the value `foo` might result in
-   * a bucket with the name `projects/123456/buckets/foo`.
-   * 
- * - * string bucket_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bucketId. - */ - @java.lang.Override - public java.lang.String getBucketId() { - java.lang.Object ref = bucketId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - bucketId_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The ID to use for this bucket, which will become the final component of
-   * the bucket's resource name. For example, the value `foo` might result in
-   * a bucket with the name `projects/123456/buckets/foo`.
-   * 
- * - * string bucket_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for bucketId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getBucketIdBytes() { - java.lang.Object ref = bucketId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - bucketId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PREDEFINED_ACL_FIELD_NUMBER = 4; - private int predefinedAcl_; - /** - * - * - *
-   * Apply a predefined set of access controls to this bucket.
-   * 
- * - * .google.storage.v2.PredefinedBucketAcl predefined_acl = 4; - * - * @return The enum numeric value on the wire for predefinedAcl. - */ - @java.lang.Override - public int getPredefinedAclValue() { - return predefinedAcl_; - } - /** - * - * - *
-   * Apply a predefined set of access controls to this bucket.
-   * 
- * - * .google.storage.v2.PredefinedBucketAcl predefined_acl = 4; - * - * @return The predefinedAcl. - */ - @java.lang.Override - public com.google.storage.v2.PredefinedBucketAcl getPredefinedAcl() { - @SuppressWarnings("deprecation") - com.google.storage.v2.PredefinedBucketAcl result = - com.google.storage.v2.PredefinedBucketAcl.valueOf(predefinedAcl_); - return result == null ? com.google.storage.v2.PredefinedBucketAcl.UNRECOGNIZED : result; - } - - public static final int PREDEFINED_DEFAULT_OBJECT_ACL_FIELD_NUMBER = 5; - private int predefinedDefaultObjectAcl_; - /** - * - * - *
-   * Apply a predefined set of default object access controls to this bucket.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_default_object_acl = 5; - * - * @return The enum numeric value on the wire for predefinedDefaultObjectAcl. - */ - @java.lang.Override - public int getPredefinedDefaultObjectAclValue() { - return predefinedDefaultObjectAcl_; - } - /** - * - * - *
-   * Apply a predefined set of default object access controls to this bucket.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_default_object_acl = 5; - * - * @return The predefinedDefaultObjectAcl. - */ - @java.lang.Override - public com.google.storage.v2.PredefinedObjectAcl getPredefinedDefaultObjectAcl() { - @SuppressWarnings("deprecation") - com.google.storage.v2.PredefinedObjectAcl result = - com.google.storage.v2.PredefinedObjectAcl.valueOf(predefinedDefaultObjectAcl_); - return result == null ? com.google.storage.v2.PredefinedObjectAcl.UNRECOGNIZED : result; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); - } - if (bucket_ != null) { - output.writeMessage(2, getBucket()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucketId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, bucketId_); - } - if (predefinedAcl_ - != com.google.storage.v2.PredefinedBucketAcl.PREDEFINED_BUCKET_ACL_UNSPECIFIED - .getNumber()) { - output.writeEnum(4, predefinedAcl_); - } - if (predefinedDefaultObjectAcl_ - != com.google.storage.v2.PredefinedObjectAcl.PREDEFINED_OBJECT_ACL_UNSPECIFIED - .getNumber()) { - output.writeEnum(5, predefinedDefaultObjectAcl_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); - } - if (bucket_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getBucket()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucketId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, bucketId_); - } - if (predefinedAcl_ - != com.google.storage.v2.PredefinedBucketAcl.PREDEFINED_BUCKET_ACL_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, predefinedAcl_); - } - if (predefinedDefaultObjectAcl_ - != com.google.storage.v2.PredefinedObjectAcl.PREDEFINED_OBJECT_ACL_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, predefinedDefaultObjectAcl_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.CreateBucketRequest)) { - return super.equals(obj); - } - com.google.storage.v2.CreateBucketRequest other = - (com.google.storage.v2.CreateBucketRequest) obj; - - if (!getParent().equals(other.getParent())) return false; - if (hasBucket() != other.hasBucket()) return false; - if (hasBucket()) { - if (!getBucket().equals(other.getBucket())) return false; - } - if (!getBucketId().equals(other.getBucketId())) return false; - if (predefinedAcl_ != other.predefinedAcl_) return false; - if (predefinedDefaultObjectAcl_ != other.predefinedDefaultObjectAcl_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PARENT_FIELD_NUMBER; - hash = (53 * hash) + getParent().hashCode(); - if (hasBucket()) { - hash = (37 * hash) + BUCKET_FIELD_NUMBER; - hash = (53 * hash) + getBucket().hashCode(); - } - hash = (37 * hash) + BUCKET_ID_FIELD_NUMBER; - hash = (53 * hash) + getBucketId().hashCode(); - hash = (37 * hash) + PREDEFINED_ACL_FIELD_NUMBER; - hash = (53 * hash) + predefinedAcl_; - hash = (37 * hash) + PREDEFINED_DEFAULT_OBJECT_ACL_FIELD_NUMBER; - hash = (53 * hash) + predefinedDefaultObjectAcl_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.CreateBucketRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.CreateBucketRequest 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.CreateBucketRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.CreateBucketRequest 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.CreateBucketRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.CreateBucketRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.CreateBucketRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.CreateBucketRequest 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.CreateBucketRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.CreateBucketRequest 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.CreateBucketRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.CreateBucketRequest 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.CreateBucketRequest 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 CreateBucket.
-   * 
- * - * Protobuf type {@code google.storage.v2.CreateBucketRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.CreateBucketRequest) - com.google.storage.v2.CreateBucketRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateBucketRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateBucketRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.CreateBucketRequest.class, - com.google.storage.v2.CreateBucketRequest.Builder.class); - } - - // Construct using com.google.storage.v2.CreateBucketRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - parent_ = ""; - - if (bucketBuilder_ == null) { - bucket_ = null; - } else { - bucket_ = null; - bucketBuilder_ = null; - } - bucketId_ = ""; - - predefinedAcl_ = 0; - - predefinedDefaultObjectAcl_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateBucketRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.CreateBucketRequest getDefaultInstanceForType() { - return com.google.storage.v2.CreateBucketRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.CreateBucketRequest build() { - com.google.storage.v2.CreateBucketRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.CreateBucketRequest buildPartial() { - com.google.storage.v2.CreateBucketRequest result = - new com.google.storage.v2.CreateBucketRequest(this); - result.parent_ = parent_; - if (bucketBuilder_ == null) { - result.bucket_ = bucket_; - } else { - result.bucket_ = bucketBuilder_.build(); - } - result.bucketId_ = bucketId_; - result.predefinedAcl_ = predefinedAcl_; - result.predefinedDefaultObjectAcl_ = predefinedDefaultObjectAcl_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.CreateBucketRequest) { - return mergeFrom((com.google.storage.v2.CreateBucketRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.CreateBucketRequest other) { - if (other == com.google.storage.v2.CreateBucketRequest.getDefaultInstance()) return this; - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - onChanged(); - } - if (other.hasBucket()) { - mergeBucket(other.getBucket()); - } - if (!other.getBucketId().isEmpty()) { - bucketId_ = other.bucketId_; - onChanged(); - } - if (other.predefinedAcl_ != 0) { - setPredefinedAclValue(other.getPredefinedAclValue()); - } - if (other.predefinedDefaultObjectAcl_ != 0) { - setPredefinedDefaultObjectAclValue(other.getPredefinedDefaultObjectAclValue()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.CreateBucketRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.CreateBucketRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object parent_ = ""; - /** - * - * - *
-     * Required. The project to which this bucket will belong.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The project to which this bucket will belong.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - public com.google.protobuf.ByteString getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The project to which this bucket will belong.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The parent to set. - * @return This builder for chaining. - */ - public Builder setParent(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - parent_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The project to which this bucket will belong.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearParent() { - - parent_ = getDefaultInstance().getParent(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The project to which this bucket will belong.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for parent to set. - * @return This builder for chaining. - */ - public Builder setParentBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - parent_ = value; - onChanged(); - return this; - } - - private com.google.storage.v2.Bucket bucket_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket, - com.google.storage.v2.Bucket.Builder, - com.google.storage.v2.BucketOrBuilder> - bucketBuilder_; - /** - * - * - *
-     * Required. Properties of the new bucket being inserted.
-     * The project and name of the bucket are specified in this request, not in
-     * the bucket resource.
-     * 
- * - * .google.storage.v2.Bucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return Whether the bucket field is set. - */ - public boolean hasBucket() { - return bucketBuilder_ != null || bucket_ != null; - } - /** - * - * - *
-     * Required. Properties of the new bucket being inserted.
-     * The project and name of the bucket are specified in this request, not in
-     * the bucket resource.
-     * 
- * - * .google.storage.v2.Bucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bucket. - */ - public com.google.storage.v2.Bucket getBucket() { - if (bucketBuilder_ == null) { - return bucket_ == null ? com.google.storage.v2.Bucket.getDefaultInstance() : bucket_; - } else { - return bucketBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. Properties of the new bucket being inserted.
-     * The project and name of the bucket are specified in this request, not in
-     * the bucket resource.
-     * 
- * - * .google.storage.v2.Bucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setBucket(com.google.storage.v2.Bucket value) { - if (bucketBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - bucket_ = value; - onChanged(); - } else { - bucketBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. Properties of the new bucket being inserted.
-     * The project and name of the bucket are specified in this request, not in
-     * the bucket resource.
-     * 
- * - * .google.storage.v2.Bucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setBucket(com.google.storage.v2.Bucket.Builder builderForValue) { - if (bucketBuilder_ == null) { - bucket_ = builderForValue.build(); - onChanged(); - } else { - bucketBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. Properties of the new bucket being inserted.
-     * The project and name of the bucket are specified in this request, not in
-     * the bucket resource.
-     * 
- * - * .google.storage.v2.Bucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder mergeBucket(com.google.storage.v2.Bucket value) { - if (bucketBuilder_ == null) { - if (bucket_ != null) { - bucket_ = - com.google.storage.v2.Bucket.newBuilder(bucket_).mergeFrom(value).buildPartial(); - } else { - bucket_ = value; - } - onChanged(); - } else { - bucketBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. Properties of the new bucket being inserted.
-     * The project and name of the bucket are specified in this request, not in
-     * the bucket resource.
-     * 
- * - * .google.storage.v2.Bucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder clearBucket() { - if (bucketBuilder_ == null) { - bucket_ = null; - onChanged(); - } else { - bucket_ = null; - bucketBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. Properties of the new bucket being inserted.
-     * The project and name of the bucket are specified in this request, not in
-     * the bucket resource.
-     * 
- * - * .google.storage.v2.Bucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.storage.v2.Bucket.Builder getBucketBuilder() { - - onChanged(); - return getBucketFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. Properties of the new bucket being inserted.
-     * The project and name of the bucket are specified in this request, not in
-     * the bucket resource.
-     * 
- * - * .google.storage.v2.Bucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.storage.v2.BucketOrBuilder getBucketOrBuilder() { - if (bucketBuilder_ != null) { - return bucketBuilder_.getMessageOrBuilder(); - } else { - return bucket_ == null ? com.google.storage.v2.Bucket.getDefaultInstance() : bucket_; - } - } - /** - * - * - *
-     * Required. Properties of the new bucket being inserted.
-     * The project and name of the bucket are specified in this request, not in
-     * the bucket resource.
-     * 
- * - * .google.storage.v2.Bucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket, - com.google.storage.v2.Bucket.Builder, - com.google.storage.v2.BucketOrBuilder> - getBucketFieldBuilder() { - if (bucketBuilder_ == null) { - bucketBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket, - com.google.storage.v2.Bucket.Builder, - com.google.storage.v2.BucketOrBuilder>( - getBucket(), getParentForChildren(), isClean()); - bucket_ = null; - } - return bucketBuilder_; - } - - private java.lang.Object bucketId_ = ""; - /** - * - * - *
-     * Required. The ID to use for this bucket, which will become the final component of
-     * the bucket's resource name. For example, the value `foo` might result in
-     * a bucket with the name `projects/123456/buckets/foo`.
-     * 
- * - * string bucket_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bucketId. - */ - public java.lang.String getBucketId() { - java.lang.Object ref = bucketId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - bucketId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The ID to use for this bucket, which will become the final component of
-     * the bucket's resource name. For example, the value `foo` might result in
-     * a bucket with the name `projects/123456/buckets/foo`.
-     * 
- * - * string bucket_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for bucketId. - */ - public com.google.protobuf.ByteString getBucketIdBytes() { - java.lang.Object ref = bucketId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - bucketId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The ID to use for this bucket, which will become the final component of
-     * the bucket's resource name. For example, the value `foo` might result in
-     * a bucket with the name `projects/123456/buckets/foo`.
-     * 
- * - * string bucket_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bucketId to set. - * @return This builder for chaining. - */ - public Builder setBucketId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - bucketId_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The ID to use for this bucket, which will become the final component of
-     * the bucket's resource name. For example, the value `foo` might result in
-     * a bucket with the name `projects/123456/buckets/foo`.
-     * 
- * - * string bucket_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearBucketId() { - - bucketId_ = getDefaultInstance().getBucketId(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The ID to use for this bucket, which will become the final component of
-     * the bucket's resource name. For example, the value `foo` might result in
-     * a bucket with the name `projects/123456/buckets/foo`.
-     * 
- * - * string bucket_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for bucketId to set. - * @return This builder for chaining. - */ - public Builder setBucketIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - bucketId_ = value; - onChanged(); - return this; - } - - private int predefinedAcl_ = 0; - /** - * - * - *
-     * Apply a predefined set of access controls to this bucket.
-     * 
- * - * .google.storage.v2.PredefinedBucketAcl predefined_acl = 4; - * - * @return The enum numeric value on the wire for predefinedAcl. - */ - @java.lang.Override - public int getPredefinedAclValue() { - return predefinedAcl_; - } - /** - * - * - *
-     * Apply a predefined set of access controls to this bucket.
-     * 
- * - * .google.storage.v2.PredefinedBucketAcl predefined_acl = 4; - * - * @param value The enum numeric value on the wire for predefinedAcl to set. - * @return This builder for chaining. - */ - public Builder setPredefinedAclValue(int value) { - - predefinedAcl_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Apply a predefined set of access controls to this bucket.
-     * 
- * - * .google.storage.v2.PredefinedBucketAcl predefined_acl = 4; - * - * @return The predefinedAcl. - */ - @java.lang.Override - public com.google.storage.v2.PredefinedBucketAcl getPredefinedAcl() { - @SuppressWarnings("deprecation") - com.google.storage.v2.PredefinedBucketAcl result = - com.google.storage.v2.PredefinedBucketAcl.valueOf(predefinedAcl_); - return result == null ? com.google.storage.v2.PredefinedBucketAcl.UNRECOGNIZED : result; - } - /** - * - * - *
-     * Apply a predefined set of access controls to this bucket.
-     * 
- * - * .google.storage.v2.PredefinedBucketAcl predefined_acl = 4; - * - * @param value The predefinedAcl to set. - * @return This builder for chaining. - */ - public Builder setPredefinedAcl(com.google.storage.v2.PredefinedBucketAcl value) { - if (value == null) { - throw new NullPointerException(); - } - - predefinedAcl_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * Apply a predefined set of access controls to this bucket.
-     * 
- * - * .google.storage.v2.PredefinedBucketAcl predefined_acl = 4; - * - * @return This builder for chaining. - */ - public Builder clearPredefinedAcl() { - - predefinedAcl_ = 0; - onChanged(); - return this; - } - - private int predefinedDefaultObjectAcl_ = 0; - /** - * - * - *
-     * Apply a predefined set of default object access controls to this bucket.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_default_object_acl = 5; - * - * @return The enum numeric value on the wire for predefinedDefaultObjectAcl. - */ - @java.lang.Override - public int getPredefinedDefaultObjectAclValue() { - return predefinedDefaultObjectAcl_; - } - /** - * - * - *
-     * Apply a predefined set of default object access controls to this bucket.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_default_object_acl = 5; - * - * @param value The enum numeric value on the wire for predefinedDefaultObjectAcl to set. - * @return This builder for chaining. - */ - public Builder setPredefinedDefaultObjectAclValue(int value) { - - predefinedDefaultObjectAcl_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Apply a predefined set of default object access controls to this bucket.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_default_object_acl = 5; - * - * @return The predefinedDefaultObjectAcl. - */ - @java.lang.Override - public com.google.storage.v2.PredefinedObjectAcl getPredefinedDefaultObjectAcl() { - @SuppressWarnings("deprecation") - com.google.storage.v2.PredefinedObjectAcl result = - com.google.storage.v2.PredefinedObjectAcl.valueOf(predefinedDefaultObjectAcl_); - return result == null ? com.google.storage.v2.PredefinedObjectAcl.UNRECOGNIZED : result; - } - /** - * - * - *
-     * Apply a predefined set of default object access controls to this bucket.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_default_object_acl = 5; - * - * @param value The predefinedDefaultObjectAcl to set. - * @return This builder for chaining. - */ - public Builder setPredefinedDefaultObjectAcl(com.google.storage.v2.PredefinedObjectAcl value) { - if (value == null) { - throw new NullPointerException(); - } - - predefinedDefaultObjectAcl_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * Apply a predefined set of default object access controls to this bucket.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_default_object_acl = 5; - * - * @return This builder for chaining. - */ - public Builder clearPredefinedDefaultObjectAcl() { - - predefinedDefaultObjectAcl_ = 0; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.CreateBucketRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.CreateBucketRequest) - private static final com.google.storage.v2.CreateBucketRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.CreateBucketRequest(); - } - - public static com.google.storage.v2.CreateBucketRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CreateBucketRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateBucketRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.CreateBucketRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateBucketRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateBucketRequestOrBuilder.java deleted file mode 100644 index 6dadebd081..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateBucketRequestOrBuilder.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface CreateBucketRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.CreateBucketRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The project to which this bucket will belong.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - java.lang.String getParent(); - /** - * - * - *
-   * Required. The project to which this bucket will belong.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - com.google.protobuf.ByteString getParentBytes(); - - /** - * - * - *
-   * Required. Properties of the new bucket being inserted.
-   * The project and name of the bucket are specified in this request, not in
-   * the bucket resource.
-   * 
- * - * .google.storage.v2.Bucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return Whether the bucket field is set. - */ - boolean hasBucket(); - /** - * - * - *
-   * Required. Properties of the new bucket being inserted.
-   * The project and name of the bucket are specified in this request, not in
-   * the bucket resource.
-   * 
- * - * .google.storage.v2.Bucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bucket. - */ - com.google.storage.v2.Bucket getBucket(); - /** - * - * - *
-   * Required. Properties of the new bucket being inserted.
-   * The project and name of the bucket are specified in this request, not in
-   * the bucket resource.
-   * 
- * - * .google.storage.v2.Bucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - com.google.storage.v2.BucketOrBuilder getBucketOrBuilder(); - - /** - * - * - *
-   * Required. The ID to use for this bucket, which will become the final component of
-   * the bucket's resource name. For example, the value `foo` might result in
-   * a bucket with the name `projects/123456/buckets/foo`.
-   * 
- * - * string bucket_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bucketId. - */ - java.lang.String getBucketId(); - /** - * - * - *
-   * Required. The ID to use for this bucket, which will become the final component of
-   * the bucket's resource name. For example, the value `foo` might result in
-   * a bucket with the name `projects/123456/buckets/foo`.
-   * 
- * - * string bucket_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for bucketId. - */ - com.google.protobuf.ByteString getBucketIdBytes(); - - /** - * - * - *
-   * Apply a predefined set of access controls to this bucket.
-   * 
- * - * .google.storage.v2.PredefinedBucketAcl predefined_acl = 4; - * - * @return The enum numeric value on the wire for predefinedAcl. - */ - int getPredefinedAclValue(); - /** - * - * - *
-   * Apply a predefined set of access controls to this bucket.
-   * 
- * - * .google.storage.v2.PredefinedBucketAcl predefined_acl = 4; - * - * @return The predefinedAcl. - */ - com.google.storage.v2.PredefinedBucketAcl getPredefinedAcl(); - - /** - * - * - *
-   * Apply a predefined set of default object access controls to this bucket.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_default_object_acl = 5; - * - * @return The enum numeric value on the wire for predefinedDefaultObjectAcl. - */ - int getPredefinedDefaultObjectAclValue(); - /** - * - * - *
-   * Apply a predefined set of default object access controls to this bucket.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_default_object_acl = 5; - * - * @return The predefinedDefaultObjectAcl. - */ - com.google.storage.v2.PredefinedObjectAcl getPredefinedDefaultObjectAcl(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateHmacKeyRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateHmacKeyRequest.java deleted file mode 100644 index d377a829e7..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateHmacKeyRequest.java +++ /dev/null @@ -1,1105 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request message for CreateHmacKey.
- * 
- * - * Protobuf type {@code google.storage.v2.CreateHmacKeyRequest} - */ -public final class CreateHmacKeyRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.CreateHmacKeyRequest) - CreateHmacKeyRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use CreateHmacKeyRequest.newBuilder() to construct. - private CreateHmacKeyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CreateHmacKeyRequest() { - project_ = ""; - serviceAccountEmail_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CreateHmacKeyRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CreateHmacKeyRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - project_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - serviceAccountEmail_ = s; - break; - } - case 26: - { - com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; - if (commonRequestParams_ != null) { - subBuilder = commonRequestParams_.toBuilder(); - } - commonRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonRequestParams_); - commonRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateHmacKeyRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateHmacKeyRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.CreateHmacKeyRequest.class, - com.google.storage.v2.CreateHmacKeyRequest.Builder.class); - } - - public static final int PROJECT_FIELD_NUMBER = 1; - private volatile java.lang.Object project_; - /** - * - * - *
-   * Required. The project that the HMAC-owning service account lives in.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - @java.lang.Override - public java.lang.String getProject() { - java.lang.Object ref = project_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - project_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The project that the HMAC-owning service account lives in.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - @java.lang.Override - public com.google.protobuf.ByteString getProjectBytes() { - java.lang.Object ref = project_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - project_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER = 2; - private volatile java.lang.Object serviceAccountEmail_; - /** - * - * - *
-   * Required. The service account to create the HMAC for.
-   * 
- * - * string service_account_email = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The serviceAccountEmail. - */ - @java.lang.Override - public java.lang.String getServiceAccountEmail() { - java.lang.Object ref = serviceAccountEmail_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serviceAccountEmail_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The service account to create the HMAC for.
-   * 
- * - * string service_account_email = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for serviceAccountEmail. - */ - @java.lang.Override - public com.google.protobuf.ByteString getServiceAccountEmailBytes() { - java.lang.Object ref = serviceAccountEmail_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - serviceAccountEmail_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 3; - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return Whether the commonRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonRequestParams() { - return commonRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return The commonRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - return getCommonRequestParams(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, project_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, serviceAccountEmail_); - } - if (commonRequestParams_ != null) { - output.writeMessage(3, getCommonRequestParams()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, project_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, serviceAccountEmail_); - } - if (commonRequestParams_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCommonRequestParams()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.CreateHmacKeyRequest)) { - return super.equals(obj); - } - com.google.storage.v2.CreateHmacKeyRequest other = - (com.google.storage.v2.CreateHmacKeyRequest) obj; - - if (!getProject().equals(other.getProject())) return false; - if (!getServiceAccountEmail().equals(other.getServiceAccountEmail())) return false; - if (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; - if (hasCommonRequestParams()) { - if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PROJECT_FIELD_NUMBER; - hash = (53 * hash) + getProject().hashCode(); - hash = (37 * hash) + SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER; - hash = (53 * hash) + getServiceAccountEmail().hashCode(); - if (hasCommonRequestParams()) { - hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonRequestParams().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.CreateHmacKeyRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.CreateHmacKeyRequest 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.CreateHmacKeyRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.CreateHmacKeyRequest 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.CreateHmacKeyRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.CreateHmacKeyRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.CreateHmacKeyRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.CreateHmacKeyRequest 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.CreateHmacKeyRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.CreateHmacKeyRequest 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.CreateHmacKeyRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.CreateHmacKeyRequest 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.CreateHmacKeyRequest 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 CreateHmacKey.
-   * 
- * - * Protobuf type {@code google.storage.v2.CreateHmacKeyRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.CreateHmacKeyRequest) - com.google.storage.v2.CreateHmacKeyRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateHmacKeyRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateHmacKeyRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.CreateHmacKeyRequest.class, - com.google.storage.v2.CreateHmacKeyRequest.Builder.class); - } - - // Construct using com.google.storage.v2.CreateHmacKeyRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - project_ = ""; - - serviceAccountEmail_ = ""; - - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateHmacKeyRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.CreateHmacKeyRequest getDefaultInstanceForType() { - return com.google.storage.v2.CreateHmacKeyRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.CreateHmacKeyRequest build() { - com.google.storage.v2.CreateHmacKeyRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.CreateHmacKeyRequest buildPartial() { - com.google.storage.v2.CreateHmacKeyRequest result = - new com.google.storage.v2.CreateHmacKeyRequest(this); - result.project_ = project_; - result.serviceAccountEmail_ = serviceAccountEmail_; - if (commonRequestParamsBuilder_ == null) { - result.commonRequestParams_ = commonRequestParams_; - } else { - result.commonRequestParams_ = commonRequestParamsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.CreateHmacKeyRequest) { - return mergeFrom((com.google.storage.v2.CreateHmacKeyRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.CreateHmacKeyRequest other) { - if (other == com.google.storage.v2.CreateHmacKeyRequest.getDefaultInstance()) return this; - if (!other.getProject().isEmpty()) { - project_ = other.project_; - onChanged(); - } - if (!other.getServiceAccountEmail().isEmpty()) { - serviceAccountEmail_ = other.serviceAccountEmail_; - onChanged(); - } - if (other.hasCommonRequestParams()) { - mergeCommonRequestParams(other.getCommonRequestParams()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.CreateHmacKeyRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.CreateHmacKeyRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object project_ = ""; - /** - * - * - *
-     * Required. The project that the HMAC-owning service account lives in.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - public java.lang.String getProject() { - java.lang.Object ref = project_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - project_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The project that the HMAC-owning service account lives in.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - public com.google.protobuf.ByteString getProjectBytes() { - java.lang.Object ref = project_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - project_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The project that the HMAC-owning service account lives in.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The project to set. - * @return This builder for chaining. - */ - public Builder setProject(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - project_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The project that the HMAC-owning service account lives in.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearProject() { - - project_ = getDefaultInstance().getProject(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The project that the HMAC-owning service account lives in.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for project to set. - * @return This builder for chaining. - */ - public Builder setProjectBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - project_ = value; - onChanged(); - return this; - } - - private java.lang.Object serviceAccountEmail_ = ""; - /** - * - * - *
-     * Required. The service account to create the HMAC for.
-     * 
- * - * string service_account_email = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The serviceAccountEmail. - */ - public java.lang.String getServiceAccountEmail() { - java.lang.Object ref = serviceAccountEmail_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serviceAccountEmail_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The service account to create the HMAC for.
-     * 
- * - * string service_account_email = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for serviceAccountEmail. - */ - public com.google.protobuf.ByteString getServiceAccountEmailBytes() { - java.lang.Object ref = serviceAccountEmail_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - serviceAccountEmail_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The service account to create the HMAC for.
-     * 
- * - * string service_account_email = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The serviceAccountEmail to set. - * @return This builder for chaining. - */ - public Builder setServiceAccountEmail(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - serviceAccountEmail_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The service account to create the HMAC for.
-     * 
- * - * string service_account_email = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearServiceAccountEmail() { - - serviceAccountEmail_ = getDefaultInstance().getServiceAccountEmail(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The service account to create the HMAC for.
-     * 
- * - * string service_account_email = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for serviceAccountEmail to set. - * @return This builder for chaining. - */ - public Builder setServiceAccountEmailBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - serviceAccountEmail_ = value; - onChanged(); - return this; - } - - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - commonRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return Whether the commonRequestParams field is set. - */ - public boolean hasCommonRequestParams() { - return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return The commonRequestParams. - */ - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } else { - return commonRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonRequestParams_ = value; - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public Builder setCommonRequestParams( - com.google.storage.v2.CommonRequestParams.Builder builderForValue) { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (commonRequestParams_ != null) { - commonRequestParams_ = - com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonRequestParams_ = value; - } - onChanged(); - } else { - commonRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public Builder clearCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - onChanged(); - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { - - onChanged(); - return getCommonRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - if (commonRequestParamsBuilder_ != null) { - return commonRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - getCommonRequestParamsFieldBuilder() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder>( - getCommonRequestParams(), getParentForChildren(), isClean()); - commonRequestParams_ = null; - } - return commonRequestParamsBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.CreateHmacKeyRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.CreateHmacKeyRequest) - private static final com.google.storage.v2.CreateHmacKeyRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.CreateHmacKeyRequest(); - } - - public static com.google.storage.v2.CreateHmacKeyRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CreateHmacKeyRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateHmacKeyRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.CreateHmacKeyRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateHmacKeyRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateHmacKeyRequestOrBuilder.java deleted file mode 100644 index 002b029a51..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateHmacKeyRequestOrBuilder.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface CreateHmacKeyRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.CreateHmacKeyRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The project that the HMAC-owning service account lives in.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - java.lang.String getProject(); - /** - * - * - *
-   * Required. The project that the HMAC-owning service account lives in.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - com.google.protobuf.ByteString getProjectBytes(); - - /** - * - * - *
-   * Required. The service account to create the HMAC for.
-   * 
- * - * string service_account_email = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The serviceAccountEmail. - */ - java.lang.String getServiceAccountEmail(); - /** - * - * - *
-   * Required. The service account to create the HMAC for.
-   * 
- * - * string service_account_email = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for serviceAccountEmail. - */ - com.google.protobuf.ByteString getServiceAccountEmailBytes(); - - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return Whether the commonRequestParams field is set. - */ - boolean hasCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return The commonRequestParams. - */ - com.google.storage.v2.CommonRequestParams getCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateHmacKeyResponse.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateHmacKeyResponse.java deleted file mode 100644 index d9df2947bc..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateHmacKeyResponse.java +++ /dev/null @@ -1,830 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Create hmac response.  The only time the secret for an HMAC will be returned.
- * 
- * - * Protobuf type {@code google.storage.v2.CreateHmacKeyResponse} - */ -public final class CreateHmacKeyResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.CreateHmacKeyResponse) - CreateHmacKeyResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use CreateHmacKeyResponse.newBuilder() to construct. - private CreateHmacKeyResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CreateHmacKeyResponse() { - secretKeyBytes_ = com.google.protobuf.ByteString.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CreateHmacKeyResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CreateHmacKeyResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.storage.v2.HmacKeyMetadata.Builder subBuilder = null; - if (metadata_ != null) { - subBuilder = metadata_.toBuilder(); - } - metadata_ = - input.readMessage( - com.google.storage.v2.HmacKeyMetadata.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(metadata_); - metadata_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - secretKeyBytes_ = input.readBytes(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateHmacKeyResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateHmacKeyResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.CreateHmacKeyResponse.class, - com.google.storage.v2.CreateHmacKeyResponse.Builder.class); - } - - public static final int METADATA_FIELD_NUMBER = 1; - private com.google.storage.v2.HmacKeyMetadata metadata_; - /** - * - * - *
-   * Key metadata.
-   * 
- * - * .google.storage.v2.HmacKeyMetadata metadata = 1; - * - * @return Whether the metadata field is set. - */ - @java.lang.Override - public boolean hasMetadata() { - return metadata_ != null; - } - /** - * - * - *
-   * Key metadata.
-   * 
- * - * .google.storage.v2.HmacKeyMetadata metadata = 1; - * - * @return The metadata. - */ - @java.lang.Override - public com.google.storage.v2.HmacKeyMetadata getMetadata() { - return metadata_ == null - ? com.google.storage.v2.HmacKeyMetadata.getDefaultInstance() - : metadata_; - } - /** - * - * - *
-   * Key metadata.
-   * 
- * - * .google.storage.v2.HmacKeyMetadata metadata = 1; - */ - @java.lang.Override - public com.google.storage.v2.HmacKeyMetadataOrBuilder getMetadataOrBuilder() { - return getMetadata(); - } - - public static final int SECRET_KEY_BYTES_FIELD_NUMBER = 3; - private com.google.protobuf.ByteString secretKeyBytes_; - /** - * - * - *
-   * HMAC key secret material.
-   * In raw bytes format (not base64-encoded).
-   * 
- * - * bytes secret_key_bytes = 3; - * - * @return The secretKeyBytes. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSecretKeyBytes() { - return secretKeyBytes_; - } - - 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 (metadata_ != null) { - output.writeMessage(1, getMetadata()); - } - if (!secretKeyBytes_.isEmpty()) { - output.writeBytes(3, secretKeyBytes_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (metadata_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); - } - if (!secretKeyBytes_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, secretKeyBytes_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.CreateHmacKeyResponse)) { - return super.equals(obj); - } - com.google.storage.v2.CreateHmacKeyResponse other = - (com.google.storage.v2.CreateHmacKeyResponse) obj; - - if (hasMetadata() != other.hasMetadata()) return false; - if (hasMetadata()) { - if (!getMetadata().equals(other.getMetadata())) return false; - } - if (!getSecretKeyBytes().equals(other.getSecretKeyBytes())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasMetadata()) { - hash = (37 * hash) + METADATA_FIELD_NUMBER; - hash = (53 * hash) + getMetadata().hashCode(); - } - hash = (37 * hash) + SECRET_KEY_BYTES_FIELD_NUMBER; - hash = (53 * hash) + getSecretKeyBytes().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.CreateHmacKeyResponse parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.CreateHmacKeyResponse 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.CreateHmacKeyResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.CreateHmacKeyResponse 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.CreateHmacKeyResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.CreateHmacKeyResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.CreateHmacKeyResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.CreateHmacKeyResponse 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.CreateHmacKeyResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.CreateHmacKeyResponse 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.CreateHmacKeyResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.CreateHmacKeyResponse 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.CreateHmacKeyResponse 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; - } - /** - * - * - *
-   * Create hmac response.  The only time the secret for an HMAC will be returned.
-   * 
- * - * Protobuf type {@code google.storage.v2.CreateHmacKeyResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.CreateHmacKeyResponse) - com.google.storage.v2.CreateHmacKeyResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateHmacKeyResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateHmacKeyResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.CreateHmacKeyResponse.class, - com.google.storage.v2.CreateHmacKeyResponse.Builder.class); - } - - // Construct using com.google.storage.v2.CreateHmacKeyResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (metadataBuilder_ == null) { - metadata_ = null; - } else { - metadata_ = null; - metadataBuilder_ = null; - } - secretKeyBytes_ = 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_CreateHmacKeyResponse_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.CreateHmacKeyResponse getDefaultInstanceForType() { - return com.google.storage.v2.CreateHmacKeyResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.CreateHmacKeyResponse build() { - com.google.storage.v2.CreateHmacKeyResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.CreateHmacKeyResponse buildPartial() { - com.google.storage.v2.CreateHmacKeyResponse result = - new com.google.storage.v2.CreateHmacKeyResponse(this); - if (metadataBuilder_ == null) { - result.metadata_ = metadata_; - } else { - result.metadata_ = metadataBuilder_.build(); - } - result.secretKeyBytes_ = secretKeyBytes_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.CreateHmacKeyResponse) { - return mergeFrom((com.google.storage.v2.CreateHmacKeyResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.CreateHmacKeyResponse other) { - if (other == com.google.storage.v2.CreateHmacKeyResponse.getDefaultInstance()) return this; - if (other.hasMetadata()) { - mergeMetadata(other.getMetadata()); - } - if (other.getSecretKeyBytes() != com.google.protobuf.ByteString.EMPTY) { - setSecretKeyBytes(other.getSecretKeyBytes()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.CreateHmacKeyResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.CreateHmacKeyResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.storage.v2.HmacKeyMetadata metadata_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.HmacKeyMetadata, - com.google.storage.v2.HmacKeyMetadata.Builder, - com.google.storage.v2.HmacKeyMetadataOrBuilder> - metadataBuilder_; - /** - * - * - *
-     * Key metadata.
-     * 
- * - * .google.storage.v2.HmacKeyMetadata metadata = 1; - * - * @return Whether the metadata field is set. - */ - public boolean hasMetadata() { - return metadataBuilder_ != null || metadata_ != null; - } - /** - * - * - *
-     * Key metadata.
-     * 
- * - * .google.storage.v2.HmacKeyMetadata metadata = 1; - * - * @return The metadata. - */ - public com.google.storage.v2.HmacKeyMetadata getMetadata() { - if (metadataBuilder_ == null) { - return metadata_ == null - ? com.google.storage.v2.HmacKeyMetadata.getDefaultInstance() - : metadata_; - } else { - return metadataBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Key metadata.
-     * 
- * - * .google.storage.v2.HmacKeyMetadata metadata = 1; - */ - public Builder setMetadata(com.google.storage.v2.HmacKeyMetadata value) { - if (metadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - metadata_ = value; - onChanged(); - } else { - metadataBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Key metadata.
-     * 
- * - * .google.storage.v2.HmacKeyMetadata metadata = 1; - */ - public Builder setMetadata(com.google.storage.v2.HmacKeyMetadata.Builder builderForValue) { - if (metadataBuilder_ == null) { - metadata_ = builderForValue.build(); - onChanged(); - } else { - metadataBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Key metadata.
-     * 
- * - * .google.storage.v2.HmacKeyMetadata metadata = 1; - */ - public Builder mergeMetadata(com.google.storage.v2.HmacKeyMetadata value) { - if (metadataBuilder_ == null) { - if (metadata_ != null) { - metadata_ = - com.google.storage.v2.HmacKeyMetadata.newBuilder(metadata_) - .mergeFrom(value) - .buildPartial(); - } else { - metadata_ = value; - } - onChanged(); - } else { - metadataBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Key metadata.
-     * 
- * - * .google.storage.v2.HmacKeyMetadata metadata = 1; - */ - public Builder clearMetadata() { - if (metadataBuilder_ == null) { - metadata_ = null; - onChanged(); - } else { - metadata_ = null; - metadataBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Key metadata.
-     * 
- * - * .google.storage.v2.HmacKeyMetadata metadata = 1; - */ - public com.google.storage.v2.HmacKeyMetadata.Builder getMetadataBuilder() { - - onChanged(); - return getMetadataFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Key metadata.
-     * 
- * - * .google.storage.v2.HmacKeyMetadata metadata = 1; - */ - public com.google.storage.v2.HmacKeyMetadataOrBuilder getMetadataOrBuilder() { - if (metadataBuilder_ != null) { - return metadataBuilder_.getMessageOrBuilder(); - } else { - return metadata_ == null - ? com.google.storage.v2.HmacKeyMetadata.getDefaultInstance() - : metadata_; - } - } - /** - * - * - *
-     * Key metadata.
-     * 
- * - * .google.storage.v2.HmacKeyMetadata metadata = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.HmacKeyMetadata, - com.google.storage.v2.HmacKeyMetadata.Builder, - com.google.storage.v2.HmacKeyMetadataOrBuilder> - getMetadataFieldBuilder() { - if (metadataBuilder_ == null) { - metadataBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.HmacKeyMetadata, - com.google.storage.v2.HmacKeyMetadata.Builder, - com.google.storage.v2.HmacKeyMetadataOrBuilder>( - getMetadata(), getParentForChildren(), isClean()); - metadata_ = null; - } - return metadataBuilder_; - } - - private com.google.protobuf.ByteString secretKeyBytes_ = com.google.protobuf.ByteString.EMPTY; - /** - * - * - *
-     * HMAC key secret material.
-     * In raw bytes format (not base64-encoded).
-     * 
- * - * bytes secret_key_bytes = 3; - * - * @return The secretKeyBytes. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSecretKeyBytes() { - return secretKeyBytes_; - } - /** - * - * - *
-     * HMAC key secret material.
-     * In raw bytes format (not base64-encoded).
-     * 
- * - * bytes secret_key_bytes = 3; - * - * @param value The secretKeyBytes to set. - * @return This builder for chaining. - */ - public Builder setSecretKeyBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - secretKeyBytes_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * HMAC key secret material.
-     * In raw bytes format (not base64-encoded).
-     * 
- * - * bytes secret_key_bytes = 3; - * - * @return This builder for chaining. - */ - public Builder clearSecretKeyBytes() { - - secretKeyBytes_ = getDefaultInstance().getSecretKeyBytes(); - 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.CreateHmacKeyResponse) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.CreateHmacKeyResponse) - private static final com.google.storage.v2.CreateHmacKeyResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.CreateHmacKeyResponse(); - } - - public static com.google.storage.v2.CreateHmacKeyResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CreateHmacKeyResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateHmacKeyResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.CreateHmacKeyResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateHmacKeyResponseOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateHmacKeyResponseOrBuilder.java deleted file mode 100644 index 0a77982ef8..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateHmacKeyResponseOrBuilder.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface CreateHmacKeyResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.CreateHmacKeyResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Key metadata.
-   * 
- * - * .google.storage.v2.HmacKeyMetadata metadata = 1; - * - * @return Whether the metadata field is set. - */ - boolean hasMetadata(); - /** - * - * - *
-   * Key metadata.
-   * 
- * - * .google.storage.v2.HmacKeyMetadata metadata = 1; - * - * @return The metadata. - */ - com.google.storage.v2.HmacKeyMetadata getMetadata(); - /** - * - * - *
-   * Key metadata.
-   * 
- * - * .google.storage.v2.HmacKeyMetadata metadata = 1; - */ - com.google.storage.v2.HmacKeyMetadataOrBuilder getMetadataOrBuilder(); - - /** - * - * - *
-   * HMAC key secret material.
-   * In raw bytes format (not base64-encoded).
-   * 
- * - * bytes secret_key_bytes = 3; - * - * @return The secretKeyBytes. - */ - com.google.protobuf.ByteString getSecretKeyBytes(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateNotificationRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateNotificationRequest.java deleted file mode 100644 index 91a351b6ad..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateNotificationRequest.java +++ /dev/null @@ -1,949 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request message for CreateNotification.
- * 
- * - * Protobuf type {@code google.storage.v2.CreateNotificationRequest} - */ -public final class CreateNotificationRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.CreateNotificationRequest) - CreateNotificationRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use CreateNotificationRequest.newBuilder() to construct. - private CreateNotificationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CreateNotificationRequest() { - parent_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CreateNotificationRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CreateNotificationRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 18: - { - com.google.storage.v2.Notification.Builder subBuilder = null; - if (notification_ != null) { - subBuilder = notification_.toBuilder(); - } - notification_ = - input.readMessage(com.google.storage.v2.Notification.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(notification_); - notification_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateNotificationRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateNotificationRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.CreateNotificationRequest.class, - com.google.storage.v2.CreateNotificationRequest.Builder.class); - } - - public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; - /** - * - * - *
-   * Required. The bucket to which this notification belongs.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - @java.lang.Override - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The bucket to which this notification belongs.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - @java.lang.Override - public com.google.protobuf.ByteString getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int NOTIFICATION_FIELD_NUMBER = 2; - private com.google.storage.v2.Notification notification_; - /** - * - * - *
-   * Required. Properties of the notification to be inserted.
-   * 
- * - * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the notification field is set. - */ - @java.lang.Override - public boolean hasNotification() { - return notification_ != null; - } - /** - * - * - *
-   * Required. Properties of the notification to be inserted.
-   * 
- * - * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The notification. - */ - @java.lang.Override - public com.google.storage.v2.Notification getNotification() { - return notification_ == null - ? com.google.storage.v2.Notification.getDefaultInstance() - : notification_; - } - /** - * - * - *
-   * Required. Properties of the notification to be inserted.
-   * 
- * - * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.storage.v2.NotificationOrBuilder getNotificationOrBuilder() { - return getNotification(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); - } - if (notification_ != null) { - output.writeMessage(2, getNotification()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); - } - if (notification_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getNotification()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.CreateNotificationRequest)) { - return super.equals(obj); - } - com.google.storage.v2.CreateNotificationRequest other = - (com.google.storage.v2.CreateNotificationRequest) obj; - - if (!getParent().equals(other.getParent())) return false; - if (hasNotification() != other.hasNotification()) return false; - if (hasNotification()) { - if (!getNotification().equals(other.getNotification())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PARENT_FIELD_NUMBER; - hash = (53 * hash) + getParent().hashCode(); - if (hasNotification()) { - hash = (37 * hash) + NOTIFICATION_FIELD_NUMBER; - hash = (53 * hash) + getNotification().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.CreateNotificationRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.CreateNotificationRequest 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.CreateNotificationRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.CreateNotificationRequest 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.CreateNotificationRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.CreateNotificationRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.CreateNotificationRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.CreateNotificationRequest 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.CreateNotificationRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.CreateNotificationRequest 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.CreateNotificationRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.CreateNotificationRequest 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.CreateNotificationRequest 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 CreateNotification.
-   * 
- * - * Protobuf type {@code google.storage.v2.CreateNotificationRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.CreateNotificationRequest) - com.google.storage.v2.CreateNotificationRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateNotificationRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateNotificationRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.CreateNotificationRequest.class, - com.google.storage.v2.CreateNotificationRequest.Builder.class); - } - - // Construct using com.google.storage.v2.CreateNotificationRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - parent_ = ""; - - if (notificationBuilder_ == null) { - notification_ = null; - } else { - notification_ = null; - notificationBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateNotificationRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.CreateNotificationRequest getDefaultInstanceForType() { - return com.google.storage.v2.CreateNotificationRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.CreateNotificationRequest build() { - com.google.storage.v2.CreateNotificationRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.CreateNotificationRequest buildPartial() { - com.google.storage.v2.CreateNotificationRequest result = - new com.google.storage.v2.CreateNotificationRequest(this); - result.parent_ = parent_; - if (notificationBuilder_ == null) { - result.notification_ = notification_; - } else { - result.notification_ = notificationBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.CreateNotificationRequest) { - return mergeFrom((com.google.storage.v2.CreateNotificationRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.CreateNotificationRequest other) { - if (other == com.google.storage.v2.CreateNotificationRequest.getDefaultInstance()) - return this; - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - onChanged(); - } - if (other.hasNotification()) { - mergeNotification(other.getNotification()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.CreateNotificationRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.CreateNotificationRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object parent_ = ""; - /** - * - * - *
-     * Required. The bucket to which this notification belongs.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The bucket to which this notification belongs.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - public com.google.protobuf.ByteString getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The bucket to which this notification belongs.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The parent to set. - * @return This builder for chaining. - */ - public Builder setParent(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - parent_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The bucket to which this notification belongs.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearParent() { - - parent_ = getDefaultInstance().getParent(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The bucket to which this notification belongs.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for parent to set. - * @return This builder for chaining. - */ - public Builder setParentBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - parent_ = value; - onChanged(); - return this; - } - - private com.google.storage.v2.Notification notification_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Notification, - com.google.storage.v2.Notification.Builder, - com.google.storage.v2.NotificationOrBuilder> - notificationBuilder_; - /** - * - * - *
-     * Required. Properties of the notification to be inserted.
-     * 
- * - * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the notification field is set. - */ - public boolean hasNotification() { - return notificationBuilder_ != null || notification_ != null; - } - /** - * - * - *
-     * Required. Properties of the notification to be inserted.
-     * 
- * - * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The notification. - */ - public com.google.storage.v2.Notification getNotification() { - if (notificationBuilder_ == null) { - return notification_ == null - ? com.google.storage.v2.Notification.getDefaultInstance() - : notification_; - } else { - return notificationBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. Properties of the notification to be inserted.
-     * 
- * - * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setNotification(com.google.storage.v2.Notification value) { - if (notificationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - notification_ = value; - onChanged(); - } else { - notificationBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. Properties of the notification to be inserted.
-     * 
- * - * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setNotification(com.google.storage.v2.Notification.Builder builderForValue) { - if (notificationBuilder_ == null) { - notification_ = builderForValue.build(); - onChanged(); - } else { - notificationBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. Properties of the notification to be inserted.
-     * 
- * - * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeNotification(com.google.storage.v2.Notification value) { - if (notificationBuilder_ == null) { - if (notification_ != null) { - notification_ = - com.google.storage.v2.Notification.newBuilder(notification_) - .mergeFrom(value) - .buildPartial(); - } else { - notification_ = value; - } - onChanged(); - } else { - notificationBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. Properties of the notification to be inserted.
-     * 
- * - * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearNotification() { - if (notificationBuilder_ == null) { - notification_ = null; - onChanged(); - } else { - notification_ = null; - notificationBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. Properties of the notification to be inserted.
-     * 
- * - * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.storage.v2.Notification.Builder getNotificationBuilder() { - - onChanged(); - return getNotificationFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. Properties of the notification to be inserted.
-     * 
- * - * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.storage.v2.NotificationOrBuilder getNotificationOrBuilder() { - if (notificationBuilder_ != null) { - return notificationBuilder_.getMessageOrBuilder(); - } else { - return notification_ == null - ? com.google.storage.v2.Notification.getDefaultInstance() - : notification_; - } - } - /** - * - * - *
-     * Required. Properties of the notification to be inserted.
-     * 
- * - * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Notification, - com.google.storage.v2.Notification.Builder, - com.google.storage.v2.NotificationOrBuilder> - getNotificationFieldBuilder() { - if (notificationBuilder_ == null) { - notificationBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Notification, - com.google.storage.v2.Notification.Builder, - com.google.storage.v2.NotificationOrBuilder>( - getNotification(), getParentForChildren(), isClean()); - notification_ = null; - } - return notificationBuilder_; - } - - @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.CreateNotificationRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.CreateNotificationRequest) - private static final com.google.storage.v2.CreateNotificationRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.CreateNotificationRequest(); - } - - public static com.google.storage.v2.CreateNotificationRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CreateNotificationRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateNotificationRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.CreateNotificationRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateNotificationRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateNotificationRequestOrBuilder.java deleted file mode 100644 index 8c11f9d72f..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateNotificationRequestOrBuilder.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface CreateNotificationRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.CreateNotificationRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The bucket to which this notification belongs.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - java.lang.String getParent(); - /** - * - * - *
-   * Required. The bucket to which this notification belongs.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - com.google.protobuf.ByteString getParentBytes(); - - /** - * - * - *
-   * Required. Properties of the notification to be inserted.
-   * 
- * - * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the notification field is set. - */ - boolean hasNotification(); - /** - * - * - *
-   * Required. Properties of the notification to be inserted.
-   * 
- * - * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The notification. - */ - com.google.storage.v2.Notification getNotification(); - /** - * - * - *
-   * Required. Properties of the notification to be inserted.
-   * 
- * - * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.storage.v2.NotificationOrBuilder getNotificationOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CryptoKeyName.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CryptoKeyName.java deleted file mode 100644 index ef9ff23e31..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CryptoKeyName.java +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.storage.v2; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class CryptoKeyName implements ResourceName { - private static final PathTemplate PROJECT_LOCATION_KEY_RING_CRYPTO_KEY = - PathTemplate.createWithoutUrlEncoding( - "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}"); - private volatile Map fieldValuesMap; - private final String project; - private final String location; - private final String keyRing; - private final String cryptoKey; - - @Deprecated - protected CryptoKeyName() { - project = null; - location = null; - keyRing = null; - cryptoKey = null; - } - - private CryptoKeyName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - keyRing = Preconditions.checkNotNull(builder.getKeyRing()); - cryptoKey = Preconditions.checkNotNull(builder.getCryptoKey()); - } - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public String getKeyRing() { - return keyRing; - } - - public String getCryptoKey() { - return cryptoKey; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static CryptoKeyName of( - String project, String location, String keyRing, String cryptoKey) { - return newBuilder() - .setProject(project) - .setLocation(location) - .setKeyRing(keyRing) - .setCryptoKey(cryptoKey) - .build(); - } - - public static String format(String project, String location, String keyRing, String cryptoKey) { - return newBuilder() - .setProject(project) - .setLocation(location) - .setKeyRing(keyRing) - .setCryptoKey(cryptoKey) - .build() - .toString(); - } - - public static CryptoKeyName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PROJECT_LOCATION_KEY_RING_CRYPTO_KEY.validatedMatch( - formattedString, "CryptoKeyName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("location"), - matchMap.get("key_ring"), - matchMap.get("crypto_key")); - } - - public static List parseList(List formattedStrings) { - List list = new ArrayList<>(formattedStrings.size()); - for (String formattedString : formattedStrings) { - list.add(parse(formattedString)); - } - return list; - } - - public static List toStringList(List values) { - List list = new ArrayList<>(values.size()); - for (CryptoKeyName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PROJECT_LOCATION_KEY_RING_CRYPTO_KEY.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { - fieldMapBuilder.put("project", project); - } - if (location != null) { - fieldMapBuilder.put("location", location); - } - if (keyRing != null) { - fieldMapBuilder.put("key_ring", keyRing); - } - if (cryptoKey != null) { - fieldMapBuilder.put("crypto_key", cryptoKey); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PROJECT_LOCATION_KEY_RING_CRYPTO_KEY.instantiate( - "project", project, "location", location, "key_ring", keyRing, "crypto_key", cryptoKey); - } - - @Override - public boolean equals(java.lang.Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - CryptoKeyName that = ((CryptoKeyName) o); - return Objects.equals(this.project, that.project) - && Objects.equals(this.location, that.location) - && Objects.equals(this.keyRing, that.keyRing) - && Objects.equals(this.cryptoKey, that.cryptoKey); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(location); - h *= 1000003; - h ^= Objects.hashCode(keyRing); - h *= 1000003; - h ^= Objects.hashCode(cryptoKey); - return h; - } - - /** - * Builder for - * projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}. - */ - public static class Builder { - private String project; - private String location; - private String keyRing; - private String cryptoKey; - - protected Builder() {} - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public String getKeyRing() { - return keyRing; - } - - public String getCryptoKey() { - return cryptoKey; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setLocation(String location) { - this.location = location; - return this; - } - - public Builder setKeyRing(String keyRing) { - this.keyRing = keyRing; - return this; - } - - public Builder setCryptoKey(String cryptoKey) { - this.cryptoKey = cryptoKey; - return this; - } - - private Builder(CryptoKeyName cryptoKeyName) { - this.project = cryptoKeyName.project; - this.location = cryptoKeyName.location; - this.keyRing = cryptoKeyName.keyRing; - this.cryptoKey = cryptoKeyName.cryptoKey; - } - - public CryptoKeyName build() { - return new CryptoKeyName(this); - } - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CustomerEncryption.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CustomerEncryption.java deleted file mode 100644 index f56fe6f971..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CustomerEncryption.java +++ /dev/null @@ -1,733 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Describes the Customer-Supplied Encryption Key mechanism used to store an
- * Object's data at rest.
- * 
- * - * Protobuf type {@code google.storage.v2.CustomerEncryption} - */ -public final class CustomerEncryption extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.CustomerEncryption) - CustomerEncryptionOrBuilder { - private static final long serialVersionUID = 0L; - // Use CustomerEncryption.newBuilder() to construct. - private CustomerEncryption(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CustomerEncryption() { - encryptionAlgorithm_ = ""; - keySha256Bytes_ = com.google.protobuf.ByteString.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CustomerEncryption(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CustomerEncryption( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - encryptionAlgorithm_ = s; - break; - } - case 26: - { - keySha256Bytes_ = input.readBytes(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CustomerEncryption_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CustomerEncryption_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.CustomerEncryption.class, - com.google.storage.v2.CustomerEncryption.Builder.class); - } - - public static final int ENCRYPTION_ALGORITHM_FIELD_NUMBER = 1; - private volatile java.lang.Object encryptionAlgorithm_; - /** - * - * - *
-   * The encryption algorithm.
-   * 
- * - * string encryption_algorithm = 1; - * - * @return The encryptionAlgorithm. - */ - @java.lang.Override - public java.lang.String getEncryptionAlgorithm() { - java.lang.Object ref = encryptionAlgorithm_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - encryptionAlgorithm_ = s; - return s; - } - } - /** - * - * - *
-   * The encryption algorithm.
-   * 
- * - * string encryption_algorithm = 1; - * - * @return The bytes for encryptionAlgorithm. - */ - @java.lang.Override - public com.google.protobuf.ByteString getEncryptionAlgorithmBytes() { - java.lang.Object ref = encryptionAlgorithm_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - encryptionAlgorithm_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int KEY_SHA256_BYTES_FIELD_NUMBER = 3; - private com.google.protobuf.ByteString keySha256Bytes_; - /** - * - * - *
-   * SHA256 hash value of the encryption key.
-   * In raw bytes format (not base64-encoded).
-   * 
- * - * bytes key_sha256_bytes = 3; - * - * @return The keySha256Bytes. - */ - @java.lang.Override - public com.google.protobuf.ByteString getKeySha256Bytes() { - return keySha256Bytes_; - } - - 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(encryptionAlgorithm_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, encryptionAlgorithm_); - } - if (!keySha256Bytes_.isEmpty()) { - output.writeBytes(3, keySha256Bytes_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(encryptionAlgorithm_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, encryptionAlgorithm_); - } - if (!keySha256Bytes_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, keySha256Bytes_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.CustomerEncryption)) { - return super.equals(obj); - } - com.google.storage.v2.CustomerEncryption other = (com.google.storage.v2.CustomerEncryption) obj; - - if (!getEncryptionAlgorithm().equals(other.getEncryptionAlgorithm())) return false; - if (!getKeySha256Bytes().equals(other.getKeySha256Bytes())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ENCRYPTION_ALGORITHM_FIELD_NUMBER; - hash = (53 * hash) + getEncryptionAlgorithm().hashCode(); - hash = (37 * hash) + KEY_SHA256_BYTES_FIELD_NUMBER; - hash = (53 * hash) + getKeySha256Bytes().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.CustomerEncryption parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.CustomerEncryption parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.CustomerEncryption parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.CustomerEncryption parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.CustomerEncryption parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.CustomerEncryption parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.CustomerEncryption parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.CustomerEncryption parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.CustomerEncryption parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.CustomerEncryption parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.CustomerEncryption parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.CustomerEncryption parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.CustomerEncryption prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Describes the Customer-Supplied Encryption Key mechanism used to store an
-   * Object's data at rest.
-   * 
- * - * Protobuf type {@code google.storage.v2.CustomerEncryption} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.CustomerEncryption) - com.google.storage.v2.CustomerEncryptionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CustomerEncryption_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CustomerEncryption_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.CustomerEncryption.class, - com.google.storage.v2.CustomerEncryption.Builder.class); - } - - // Construct using com.google.storage.v2.CustomerEncryption.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - encryptionAlgorithm_ = ""; - - keySha256Bytes_ = 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_CustomerEncryption_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.CustomerEncryption getDefaultInstanceForType() { - return com.google.storage.v2.CustomerEncryption.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.CustomerEncryption build() { - com.google.storage.v2.CustomerEncryption result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.CustomerEncryption buildPartial() { - com.google.storage.v2.CustomerEncryption result = - new com.google.storage.v2.CustomerEncryption(this); - result.encryptionAlgorithm_ = encryptionAlgorithm_; - result.keySha256Bytes_ = keySha256Bytes_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.CustomerEncryption) { - return mergeFrom((com.google.storage.v2.CustomerEncryption) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.CustomerEncryption other) { - if (other == com.google.storage.v2.CustomerEncryption.getDefaultInstance()) return this; - if (!other.getEncryptionAlgorithm().isEmpty()) { - encryptionAlgorithm_ = other.encryptionAlgorithm_; - onChanged(); - } - if (other.getKeySha256Bytes() != com.google.protobuf.ByteString.EMPTY) { - setKeySha256Bytes(other.getKeySha256Bytes()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.CustomerEncryption parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.CustomerEncryption) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object encryptionAlgorithm_ = ""; - /** - * - * - *
-     * The encryption algorithm.
-     * 
- * - * string encryption_algorithm = 1; - * - * @return The encryptionAlgorithm. - */ - public java.lang.String getEncryptionAlgorithm() { - java.lang.Object ref = encryptionAlgorithm_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - encryptionAlgorithm_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The encryption algorithm.
-     * 
- * - * string encryption_algorithm = 1; - * - * @return The bytes for encryptionAlgorithm. - */ - public com.google.protobuf.ByteString getEncryptionAlgorithmBytes() { - java.lang.Object ref = encryptionAlgorithm_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - encryptionAlgorithm_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The encryption algorithm.
-     * 
- * - * string encryption_algorithm = 1; - * - * @param value The encryptionAlgorithm to set. - * @return This builder for chaining. - */ - public Builder setEncryptionAlgorithm(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - encryptionAlgorithm_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The encryption algorithm.
-     * 
- * - * string encryption_algorithm = 1; - * - * @return This builder for chaining. - */ - public Builder clearEncryptionAlgorithm() { - - encryptionAlgorithm_ = getDefaultInstance().getEncryptionAlgorithm(); - onChanged(); - return this; - } - /** - * - * - *
-     * The encryption algorithm.
-     * 
- * - * string encryption_algorithm = 1; - * - * @param value The bytes for encryptionAlgorithm to set. - * @return This builder for chaining. - */ - public Builder setEncryptionAlgorithmBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - encryptionAlgorithm_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString keySha256Bytes_ = com.google.protobuf.ByteString.EMPTY; - /** - * - * - *
-     * SHA256 hash value of the encryption key.
-     * In raw bytes format (not base64-encoded).
-     * 
- * - * bytes key_sha256_bytes = 3; - * - * @return The keySha256Bytes. - */ - @java.lang.Override - public com.google.protobuf.ByteString getKeySha256Bytes() { - return keySha256Bytes_; - } - /** - * - * - *
-     * SHA256 hash value of the encryption key.
-     * In raw bytes format (not base64-encoded).
-     * 
- * - * bytes key_sha256_bytes = 3; - * - * @param value The keySha256Bytes to set. - * @return This builder for chaining. - */ - public Builder setKeySha256Bytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - keySha256Bytes_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * SHA256 hash value of the encryption key.
-     * In raw bytes format (not base64-encoded).
-     * 
- * - * bytes key_sha256_bytes = 3; - * - * @return This builder for chaining. - */ - public Builder clearKeySha256Bytes() { - - keySha256Bytes_ = getDefaultInstance().getKeySha256Bytes(); - 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.CustomerEncryption) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.CustomerEncryption) - private static final com.google.storage.v2.CustomerEncryption DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.CustomerEncryption(); - } - - public static com.google.storage.v2.CustomerEncryption getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CustomerEncryption parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CustomerEncryption(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.CustomerEncryption getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CustomerEncryptionOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CustomerEncryptionOrBuilder.java deleted file mode 100644 index 42a2b1effc..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CustomerEncryptionOrBuilder.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface CustomerEncryptionOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.CustomerEncryption) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The encryption algorithm.
-   * 
- * - * string encryption_algorithm = 1; - * - * @return The encryptionAlgorithm. - */ - java.lang.String getEncryptionAlgorithm(); - /** - * - * - *
-   * The encryption algorithm.
-   * 
- * - * string encryption_algorithm = 1; - * - * @return The bytes for encryptionAlgorithm. - */ - com.google.protobuf.ByteString getEncryptionAlgorithmBytes(); - - /** - * - * - *
-   * SHA256 hash value of the encryption key.
-   * In raw bytes format (not base64-encoded).
-   * 
- * - * bytes key_sha256_bytes = 3; - * - * @return The keySha256Bytes. - */ - com.google.protobuf.ByteString getKeySha256Bytes(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteBucketRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteBucketRequest.java deleted file mode 100644 index 88b5ee7027..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteBucketRequest.java +++ /dev/null @@ -1,1197 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request message for DeleteBucket.
- * 
- * - * Protobuf type {@code google.storage.v2.DeleteBucketRequest} - */ -public final class DeleteBucketRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.DeleteBucketRequest) - DeleteBucketRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use DeleteBucketRequest.newBuilder() to construct. - private DeleteBucketRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private DeleteBucketRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeleteBucketRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private DeleteBucketRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 16: - { - bitField0_ |= 0x00000001; - ifMetagenerationMatch_ = input.readInt64(); - break; - } - case 24: - { - bitField0_ |= 0x00000002; - ifMetagenerationNotMatch_ = input.readInt64(); - break; - } - case 42: - { - com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; - if (commonRequestParams_ != null) { - subBuilder = commonRequestParams_.toBuilder(); - } - commonRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonRequestParams_); - commonRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteBucketRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteBucketRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.DeleteBucketRequest.class, - com.google.storage.v2.DeleteBucketRequest.Builder.class); - } - - private int bitField0_; - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * - * - *
-   * Required. Name of a bucket to delete.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * - * - *
-   * Required. Name of a bucket to delete.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int IF_METAGENERATION_MATCH_FIELD_NUMBER = 2; - private long ifMetagenerationMatch_; - /** - * - * - *
-   * If set, only deletes the bucket if its metageneration matches this value.
-   * 
- * - * optional int64 if_metageneration_match = 2; - * - * @return Whether the ifMetagenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationMatch() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-   * If set, only deletes the bucket if its metageneration matches this value.
-   * 
- * - * optional int64 if_metageneration_match = 2; - * - * @return The ifMetagenerationMatch. - */ - @java.lang.Override - public long getIfMetagenerationMatch() { - return ifMetagenerationMatch_; - } - - public static final int IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER = 3; - private long ifMetagenerationNotMatch_; - /** - * - * - *
-   * If set, only deletes the bucket if its metageneration does not match this
-   * value.
-   * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @return Whether the ifMetagenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationNotMatch() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-   * If set, only deletes the bucket if its metageneration does not match this
-   * value.
-   * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @return The ifMetagenerationNotMatch. - */ - @java.lang.Override - public long getIfMetagenerationNotMatch() { - return ifMetagenerationNotMatch_; - } - - public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 5; - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 5; - * - * @return Whether the commonRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonRequestParams() { - return commonRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 5; - * - * @return The commonRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 5; - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - return getCommonRequestParams(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (((bitField0_ & 0x00000001) != 0)) { - output.writeInt64(2, ifMetagenerationMatch_); - } - if (((bitField0_ & 0x00000002) != 0)) { - output.writeInt64(3, ifMetagenerationNotMatch_); - } - if (commonRequestParams_ != null) { - output.writeMessage(5, getCommonRequestParams()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, ifMetagenerationMatch_); - } - if (((bitField0_ & 0x00000002) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, ifMetagenerationNotMatch_); - } - if (commonRequestParams_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCommonRequestParams()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.DeleteBucketRequest)) { - return super.equals(obj); - } - com.google.storage.v2.DeleteBucketRequest other = - (com.google.storage.v2.DeleteBucketRequest) obj; - - if (!getName().equals(other.getName())) return false; - if (hasIfMetagenerationMatch() != other.hasIfMetagenerationMatch()) return false; - if (hasIfMetagenerationMatch()) { - if (getIfMetagenerationMatch() != other.getIfMetagenerationMatch()) return false; - } - if (hasIfMetagenerationNotMatch() != other.hasIfMetagenerationNotMatch()) return false; - if (hasIfMetagenerationNotMatch()) { - if (getIfMetagenerationNotMatch() != other.getIfMetagenerationNotMatch()) return false; - } - if (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; - if (hasCommonRequestParams()) { - if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - if (hasIfMetagenerationMatch()) { - hash = (37 * hash) + IF_METAGENERATION_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationMatch()); - } - if (hasIfMetagenerationNotMatch()) { - hash = (37 * hash) + IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationNotMatch()); - } - if (hasCommonRequestParams()) { - hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonRequestParams().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.DeleteBucketRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.DeleteBucketRequest 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.DeleteBucketRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.DeleteBucketRequest 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.DeleteBucketRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.DeleteBucketRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.DeleteBucketRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.DeleteBucketRequest 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.DeleteBucketRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.DeleteBucketRequest 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.DeleteBucketRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.DeleteBucketRequest 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.DeleteBucketRequest 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 DeleteBucket.
-   * 
- * - * Protobuf type {@code google.storage.v2.DeleteBucketRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.DeleteBucketRequest) - com.google.storage.v2.DeleteBucketRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteBucketRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteBucketRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.DeleteBucketRequest.class, - com.google.storage.v2.DeleteBucketRequest.Builder.class); - } - - // Construct using com.google.storage.v2.DeleteBucketRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - ifMetagenerationMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000001); - ifMetagenerationNotMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000002); - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteBucketRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.DeleteBucketRequest getDefaultInstanceForType() { - return com.google.storage.v2.DeleteBucketRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.DeleteBucketRequest build() { - com.google.storage.v2.DeleteBucketRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.DeleteBucketRequest buildPartial() { - com.google.storage.v2.DeleteBucketRequest result = - new com.google.storage.v2.DeleteBucketRequest(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - result.name_ = name_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.ifMetagenerationMatch_ = ifMetagenerationMatch_; - to_bitField0_ |= 0x00000001; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.ifMetagenerationNotMatch_ = ifMetagenerationNotMatch_; - to_bitField0_ |= 0x00000002; - } - if (commonRequestParamsBuilder_ == null) { - result.commonRequestParams_ = commonRequestParams_; - } else { - result.commonRequestParams_ = commonRequestParamsBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.DeleteBucketRequest) { - return mergeFrom((com.google.storage.v2.DeleteBucketRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.DeleteBucketRequest other) { - if (other == com.google.storage.v2.DeleteBucketRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.hasIfMetagenerationMatch()) { - setIfMetagenerationMatch(other.getIfMetagenerationMatch()); - } - if (other.hasIfMetagenerationNotMatch()) { - setIfMetagenerationNotMatch(other.getIfMetagenerationNotMatch()); - } - if (other.hasCommonRequestParams()) { - mergeCommonRequestParams(other.getCommonRequestParams()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.DeleteBucketRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.DeleteBucketRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * Required. Name of a bucket to delete.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. Name of a bucket to delete.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. Name of a bucket to delete.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of a bucket to delete.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of a bucket to delete.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private long ifMetagenerationMatch_; - /** - * - * - *
-     * If set, only deletes the bucket if its metageneration matches this value.
-     * 
- * - * optional int64 if_metageneration_match = 2; - * - * @return Whether the ifMetagenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationMatch() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-     * If set, only deletes the bucket if its metageneration matches this value.
-     * 
- * - * optional int64 if_metageneration_match = 2; - * - * @return The ifMetagenerationMatch. - */ - @java.lang.Override - public long getIfMetagenerationMatch() { - return ifMetagenerationMatch_; - } - /** - * - * - *
-     * If set, only deletes the bucket if its metageneration matches this value.
-     * 
- * - * optional int64 if_metageneration_match = 2; - * - * @param value The ifMetagenerationMatch to set. - * @return This builder for chaining. - */ - public Builder setIfMetagenerationMatch(long value) { - bitField0_ |= 0x00000001; - ifMetagenerationMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If set, only deletes the bucket if its metageneration matches this value.
-     * 
- * - * optional int64 if_metageneration_match = 2; - * - * @return This builder for chaining. - */ - public Builder clearIfMetagenerationMatch() { - bitField0_ = (bitField0_ & ~0x00000001); - ifMetagenerationMatch_ = 0L; - onChanged(); - return this; - } - - private long ifMetagenerationNotMatch_; - /** - * - * - *
-     * If set, only deletes the bucket if its metageneration does not match this
-     * value.
-     * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @return Whether the ifMetagenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationNotMatch() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-     * If set, only deletes the bucket if its metageneration does not match this
-     * value.
-     * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @return The ifMetagenerationNotMatch. - */ - @java.lang.Override - public long getIfMetagenerationNotMatch() { - return ifMetagenerationNotMatch_; - } - /** - * - * - *
-     * If set, only deletes the bucket if its metageneration does not match this
-     * value.
-     * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @param value The ifMetagenerationNotMatch to set. - * @return This builder for chaining. - */ - public Builder setIfMetagenerationNotMatch(long value) { - bitField0_ |= 0x00000002; - ifMetagenerationNotMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If set, only deletes the bucket if its metageneration does not match this
-     * value.
-     * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @return This builder for chaining. - */ - public Builder clearIfMetagenerationNotMatch() { - bitField0_ = (bitField0_ & ~0x00000002); - ifMetagenerationNotMatch_ = 0L; - onChanged(); - return this; - } - - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - commonRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 5; - * - * @return Whether the commonRequestParams field is set. - */ - public boolean hasCommonRequestParams() { - return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 5; - * - * @return The commonRequestParams. - */ - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } else { - return commonRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 5; - */ - public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonRequestParams_ = value; - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 5; - */ - public Builder setCommonRequestParams( - com.google.storage.v2.CommonRequestParams.Builder builderForValue) { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 5; - */ - public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (commonRequestParams_ != null) { - commonRequestParams_ = - com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonRequestParams_ = value; - } - onChanged(); - } else { - commonRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 5; - */ - public Builder clearCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - onChanged(); - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 5; - */ - public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { - - onChanged(); - return getCommonRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 5; - */ - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - if (commonRequestParamsBuilder_ != null) { - return commonRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - getCommonRequestParamsFieldBuilder() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder>( - getCommonRequestParams(), getParentForChildren(), isClean()); - commonRequestParams_ = null; - } - return commonRequestParamsBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.DeleteBucketRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.DeleteBucketRequest) - private static final com.google.storage.v2.DeleteBucketRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.DeleteBucketRequest(); - } - - public static com.google.storage.v2.DeleteBucketRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeleteBucketRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteBucketRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.DeleteBucketRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteBucketRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteBucketRequestOrBuilder.java deleted file mode 100644 index c45325955d..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteBucketRequestOrBuilder.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface DeleteBucketRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.DeleteBucketRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Name of a bucket to delete.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-   * Required. Name of a bucket to delete.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-   * If set, only deletes the bucket if its metageneration matches this value.
-   * 
- * - * optional int64 if_metageneration_match = 2; - * - * @return Whether the ifMetagenerationMatch field is set. - */ - boolean hasIfMetagenerationMatch(); - /** - * - * - *
-   * If set, only deletes the bucket if its metageneration matches this value.
-   * 
- * - * optional int64 if_metageneration_match = 2; - * - * @return The ifMetagenerationMatch. - */ - long getIfMetagenerationMatch(); - - /** - * - * - *
-   * If set, only deletes the bucket if its metageneration does not match this
-   * value.
-   * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @return Whether the ifMetagenerationNotMatch field is set. - */ - boolean hasIfMetagenerationNotMatch(); - /** - * - * - *
-   * If set, only deletes the bucket if its metageneration does not match this
-   * value.
-   * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @return The ifMetagenerationNotMatch. - */ - long getIfMetagenerationNotMatch(); - - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 5; - * - * @return Whether the commonRequestParams field is set. - */ - boolean hasCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 5; - * - * @return The commonRequestParams. - */ - com.google.storage.v2.CommonRequestParams getCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 5; - */ - com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteHmacKeyRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteHmacKeyRequest.java deleted file mode 100644 index e4f37af7a8..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteHmacKeyRequest.java +++ /dev/null @@ -1,1105 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request object to delete a given HMAC key.
- * 
- * - * Protobuf type {@code google.storage.v2.DeleteHmacKeyRequest} - */ -public final class DeleteHmacKeyRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.DeleteHmacKeyRequest) - DeleteHmacKeyRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use DeleteHmacKeyRequest.newBuilder() to construct. - private DeleteHmacKeyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private DeleteHmacKeyRequest() { - accessId_ = ""; - project_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeleteHmacKeyRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private DeleteHmacKeyRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - accessId_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - project_ = s; - break; - } - case 26: - { - com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; - if (commonRequestParams_ != null) { - subBuilder = commonRequestParams_.toBuilder(); - } - commonRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonRequestParams_); - commonRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteHmacKeyRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteHmacKeyRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.DeleteHmacKeyRequest.class, - com.google.storage.v2.DeleteHmacKeyRequest.Builder.class); - } - - public static final int ACCESS_ID_FIELD_NUMBER = 1; - private volatile java.lang.Object accessId_; - /** - * - * - *
-   * Required. The identifying key for the HMAC to delete.
-   * 
- * - * string access_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The accessId. - */ - @java.lang.Override - public java.lang.String getAccessId() { - java.lang.Object ref = accessId_; - 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(); - accessId_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The identifying key for the HMAC to delete.
-   * 
- * - * string access_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for accessId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getAccessIdBytes() { - java.lang.Object ref = accessId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - accessId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PROJECT_FIELD_NUMBER = 2; - private volatile java.lang.Object project_; - /** - * - * - *
-   * Required. The project id the HMAC key lies in.
-   * 
- * - * - * string project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - @java.lang.Override - public java.lang.String getProject() { - java.lang.Object ref = project_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - project_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The project id the HMAC key lies in.
-   * 
- * - * - * string project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - @java.lang.Override - public com.google.protobuf.ByteString getProjectBytes() { - java.lang.Object ref = project_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - project_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 3; - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return Whether the commonRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonRequestParams() { - return commonRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return The commonRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - return getCommonRequestParams(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(accessId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, accessId_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, project_); - } - if (commonRequestParams_ != null) { - output.writeMessage(3, getCommonRequestParams()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(accessId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, accessId_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, project_); - } - if (commonRequestParams_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCommonRequestParams()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.DeleteHmacKeyRequest)) { - return super.equals(obj); - } - com.google.storage.v2.DeleteHmacKeyRequest other = - (com.google.storage.v2.DeleteHmacKeyRequest) obj; - - if (!getAccessId().equals(other.getAccessId())) return false; - if (!getProject().equals(other.getProject())) return false; - if (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; - if (hasCommonRequestParams()) { - if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ACCESS_ID_FIELD_NUMBER; - hash = (53 * hash) + getAccessId().hashCode(); - hash = (37 * hash) + PROJECT_FIELD_NUMBER; - hash = (53 * hash) + getProject().hashCode(); - if (hasCommonRequestParams()) { - hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonRequestParams().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.DeleteHmacKeyRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.DeleteHmacKeyRequest 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.DeleteHmacKeyRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.DeleteHmacKeyRequest 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.DeleteHmacKeyRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.DeleteHmacKeyRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.DeleteHmacKeyRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.DeleteHmacKeyRequest 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.DeleteHmacKeyRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.DeleteHmacKeyRequest 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.DeleteHmacKeyRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.DeleteHmacKeyRequest 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.DeleteHmacKeyRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Request object to delete a given HMAC key.
-   * 
- * - * Protobuf type {@code google.storage.v2.DeleteHmacKeyRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.DeleteHmacKeyRequest) - com.google.storage.v2.DeleteHmacKeyRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteHmacKeyRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteHmacKeyRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.DeleteHmacKeyRequest.class, - com.google.storage.v2.DeleteHmacKeyRequest.Builder.class); - } - - // Construct using com.google.storage.v2.DeleteHmacKeyRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - accessId_ = ""; - - project_ = ""; - - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteHmacKeyRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.DeleteHmacKeyRequest getDefaultInstanceForType() { - return com.google.storage.v2.DeleteHmacKeyRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.DeleteHmacKeyRequest build() { - com.google.storage.v2.DeleteHmacKeyRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.DeleteHmacKeyRequest buildPartial() { - com.google.storage.v2.DeleteHmacKeyRequest result = - new com.google.storage.v2.DeleteHmacKeyRequest(this); - result.accessId_ = accessId_; - result.project_ = project_; - if (commonRequestParamsBuilder_ == null) { - result.commonRequestParams_ = commonRequestParams_; - } else { - result.commonRequestParams_ = commonRequestParamsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.DeleteHmacKeyRequest) { - return mergeFrom((com.google.storage.v2.DeleteHmacKeyRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.DeleteHmacKeyRequest other) { - if (other == com.google.storage.v2.DeleteHmacKeyRequest.getDefaultInstance()) return this; - if (!other.getAccessId().isEmpty()) { - accessId_ = other.accessId_; - onChanged(); - } - if (!other.getProject().isEmpty()) { - project_ = other.project_; - onChanged(); - } - if (other.hasCommonRequestParams()) { - mergeCommonRequestParams(other.getCommonRequestParams()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.DeleteHmacKeyRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.DeleteHmacKeyRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object accessId_ = ""; - /** - * - * - *
-     * Required. The identifying key for the HMAC to delete.
-     * 
- * - * string access_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The accessId. - */ - public java.lang.String getAccessId() { - java.lang.Object ref = accessId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - accessId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The identifying key for the HMAC to delete.
-     * 
- * - * string access_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for accessId. - */ - public com.google.protobuf.ByteString getAccessIdBytes() { - java.lang.Object ref = accessId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - accessId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The identifying key for the HMAC to delete.
-     * 
- * - * string access_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The accessId to set. - * @return This builder for chaining. - */ - public Builder setAccessId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - accessId_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The identifying key for the HMAC to delete.
-     * 
- * - * string access_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearAccessId() { - - accessId_ = getDefaultInstance().getAccessId(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The identifying key for the HMAC to delete.
-     * 
- * - * string access_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for accessId to set. - * @return This builder for chaining. - */ - public Builder setAccessIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - accessId_ = value; - onChanged(); - return this; - } - - private java.lang.Object project_ = ""; - /** - * - * - *
-     * Required. The project id the HMAC key lies in.
-     * 
- * - * - * string project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - public java.lang.String getProject() { - java.lang.Object ref = project_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - project_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The project id the HMAC key lies in.
-     * 
- * - * - * string project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - public com.google.protobuf.ByteString getProjectBytes() { - java.lang.Object ref = project_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - project_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The project id the HMAC key lies in.
-     * 
- * - * - * string project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The project to set. - * @return This builder for chaining. - */ - public Builder setProject(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - project_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The project id the HMAC key lies in.
-     * 
- * - * - * string project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearProject() { - - project_ = getDefaultInstance().getProject(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The project id the HMAC key lies in.
-     * 
- * - * - * string project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for project to set. - * @return This builder for chaining. - */ - public Builder setProjectBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - project_ = value; - onChanged(); - return this; - } - - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - commonRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return Whether the commonRequestParams field is set. - */ - public boolean hasCommonRequestParams() { - return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return The commonRequestParams. - */ - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } else { - return commonRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonRequestParams_ = value; - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public Builder setCommonRequestParams( - com.google.storage.v2.CommonRequestParams.Builder builderForValue) { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (commonRequestParams_ != null) { - commonRequestParams_ = - com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonRequestParams_ = value; - } - onChanged(); - } else { - commonRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public Builder clearCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - onChanged(); - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { - - onChanged(); - return getCommonRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - if (commonRequestParamsBuilder_ != null) { - return commonRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - getCommonRequestParamsFieldBuilder() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder>( - getCommonRequestParams(), getParentForChildren(), isClean()); - commonRequestParams_ = null; - } - return commonRequestParamsBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.DeleteHmacKeyRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.DeleteHmacKeyRequest) - private static final com.google.storage.v2.DeleteHmacKeyRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.DeleteHmacKeyRequest(); - } - - public static com.google.storage.v2.DeleteHmacKeyRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeleteHmacKeyRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteHmacKeyRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.DeleteHmacKeyRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteHmacKeyRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteHmacKeyRequestOrBuilder.java deleted file mode 100644 index 4673269529..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteHmacKeyRequestOrBuilder.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface DeleteHmacKeyRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.DeleteHmacKeyRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The identifying key for the HMAC to delete.
-   * 
- * - * string access_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The accessId. - */ - java.lang.String getAccessId(); - /** - * - * - *
-   * Required. The identifying key for the HMAC to delete.
-   * 
- * - * string access_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for accessId. - */ - com.google.protobuf.ByteString getAccessIdBytes(); - - /** - * - * - *
-   * Required. The project id the HMAC key lies in.
-   * 
- * - * - * string project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - java.lang.String getProject(); - /** - * - * - *
-   * Required. The project id the HMAC key lies in.
-   * 
- * - * - * string project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - com.google.protobuf.ByteString getProjectBytes(); - - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return Whether the commonRequestParams field is set. - */ - boolean hasCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return The commonRequestParams. - */ - com.google.storage.v2.CommonRequestParams getCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteNotificationRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteNotificationRequest.java deleted file mode 100644 index bc160206d1..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteNotificationRequest.java +++ /dev/null @@ -1,649 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request message for DeleteNotification.
- * 
- * - * Protobuf type {@code google.storage.v2.DeleteNotificationRequest} - */ -public final class DeleteNotificationRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.DeleteNotificationRequest) - DeleteNotificationRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use DeleteNotificationRequest.newBuilder() to construct. - private DeleteNotificationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private DeleteNotificationRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeleteNotificationRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private DeleteNotificationRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteNotificationRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteNotificationRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.DeleteNotificationRequest.class, - com.google.storage.v2.DeleteNotificationRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * - * - *
-   * Required. The parent bucket of the notification.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The parent bucket of the notification.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.DeleteNotificationRequest)) { - return super.equals(obj); - } - com.google.storage.v2.DeleteNotificationRequest other = - (com.google.storage.v2.DeleteNotificationRequest) obj; - - if (!getName().equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.DeleteNotificationRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.DeleteNotificationRequest 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.DeleteNotificationRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.DeleteNotificationRequest 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.DeleteNotificationRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.DeleteNotificationRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.DeleteNotificationRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.DeleteNotificationRequest 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.DeleteNotificationRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.DeleteNotificationRequest 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.DeleteNotificationRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.DeleteNotificationRequest 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.DeleteNotificationRequest 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 DeleteNotification.
-   * 
- * - * Protobuf type {@code google.storage.v2.DeleteNotificationRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.DeleteNotificationRequest) - com.google.storage.v2.DeleteNotificationRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteNotificationRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteNotificationRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.DeleteNotificationRequest.class, - com.google.storage.v2.DeleteNotificationRequest.Builder.class); - } - - // Construct using com.google.storage.v2.DeleteNotificationRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteNotificationRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.DeleteNotificationRequest getDefaultInstanceForType() { - return com.google.storage.v2.DeleteNotificationRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.DeleteNotificationRequest build() { - com.google.storage.v2.DeleteNotificationRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.DeleteNotificationRequest buildPartial() { - com.google.storage.v2.DeleteNotificationRequest result = - new com.google.storage.v2.DeleteNotificationRequest(this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.DeleteNotificationRequest) { - return mergeFrom((com.google.storage.v2.DeleteNotificationRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.DeleteNotificationRequest other) { - if (other == com.google.storage.v2.DeleteNotificationRequest.getDefaultInstance()) - return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.DeleteNotificationRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.DeleteNotificationRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * Required. The parent bucket of the notification.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The parent bucket of the notification.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The parent bucket of the notification.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The parent bucket of the notification.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The parent bucket of the notification.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.DeleteNotificationRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.DeleteNotificationRequest) - private static final com.google.storage.v2.DeleteNotificationRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.DeleteNotificationRequest(); - } - - public static com.google.storage.v2.DeleteNotificationRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeleteNotificationRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteNotificationRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.DeleteNotificationRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteNotificationRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteNotificationRequestOrBuilder.java deleted file mode 100644 index 3d4ec19d7e..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteNotificationRequestOrBuilder.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface DeleteNotificationRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.DeleteNotificationRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The parent bucket of the notification.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-   * Required. The parent bucket of the notification.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteObjectRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteObjectRequest.java deleted file mode 100644 index 9c38cf03bf..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteObjectRequest.java +++ /dev/null @@ -1,2232 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Message for deleting an object.
- * Either `bucket` and `object` *or* `upload_id` **must** be set (but not both).
- * 
- * - * Protobuf type {@code google.storage.v2.DeleteObjectRequest} - */ -public final class DeleteObjectRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.DeleteObjectRequest) - DeleteObjectRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use DeleteObjectRequest.newBuilder() to construct. - private DeleteObjectRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private DeleteObjectRequest() { - bucket_ = ""; - object_ = ""; - uploadId_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeleteObjectRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private DeleteObjectRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - bucket_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - object_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - uploadId_ = s; - break; - } - case 32: - { - generation_ = input.readInt64(); - break; - } - case 40: - { - bitField0_ |= 0x00000001; - ifGenerationMatch_ = input.readInt64(); - break; - } - case 48: - { - bitField0_ |= 0x00000002; - ifGenerationNotMatch_ = input.readInt64(); - break; - } - case 56: - { - bitField0_ |= 0x00000004; - ifMetagenerationMatch_ = input.readInt64(); - break; - } - case 64: - { - bitField0_ |= 0x00000008; - ifMetagenerationNotMatch_ = input.readInt64(); - break; - } - case 82: - { - com.google.storage.v2.CommonObjectRequestParams.Builder subBuilder = null; - if (commonObjectRequestParams_ != null) { - subBuilder = commonObjectRequestParams_.toBuilder(); - } - commonObjectRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonObjectRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonObjectRequestParams_); - commonObjectRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - case 90: - { - com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; - if (commonRequestParams_ != null) { - subBuilder = commonRequestParams_.toBuilder(); - } - commonRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonRequestParams_); - commonRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteObjectRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteObjectRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.DeleteObjectRequest.class, - com.google.storage.v2.DeleteObjectRequest.Builder.class); - } - - private int bitField0_; - public static final int BUCKET_FIELD_NUMBER = 1; - private volatile java.lang.Object bucket_; - /** - * - * - *
-   * Required. Name of the bucket in which the object resides.
-   * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @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. Name of the bucket in which the object resides.
-   * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for bucket. - */ - @java.lang.Override - public com.google.protobuf.ByteString getBucketBytes() { - java.lang.Object ref = bucket_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - bucket_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int OBJECT_FIELD_NUMBER = 2; - private volatile java.lang.Object object_; - /** - * - * - *
-   * Required. The name of the object to delete (when not using a resumable write).
-   * 
- * - * 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 delete (when not using a resumable write).
-   * 
- * - * 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 UPLOAD_ID_FIELD_NUMBER = 3; - private volatile java.lang.Object uploadId_; - /** - * - * - *
-   * The resumable upload_id of the object to delete (when deleting an
-   * in-progress resumable write). This should be copied from the `upload_id`
-   * field of `StartResumableWriteResponse`.
-   * 
- * - * string upload_id = 3; - * - * @return The uploadId. - */ - @java.lang.Override - public java.lang.String getUploadId() { - java.lang.Object ref = uploadId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uploadId_ = s; - return s; - } - } - /** - * - * - *
-   * The resumable upload_id of the object to delete (when deleting an
-   * in-progress resumable write). This should be copied from the `upload_id`
-   * field of `StartResumableWriteResponse`.
-   * 
- * - * string upload_id = 3; - * - * @return The bytes for uploadId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getUploadIdBytes() { - java.lang.Object ref = uploadId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - uploadId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int GENERATION_FIELD_NUMBER = 4; - private long generation_; - /** - * - * - *
-   * If present, permanently deletes a specific revision of this object (as
-   * opposed to the latest version, the default).
-   * 
- * - * int64 generation = 4; - * - * @return The generation. - */ - @java.lang.Override - public long getGeneration() { - return generation_; - } - - public static final int IF_GENERATION_MATCH_FIELD_NUMBER = 5; - 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 = 5; - * - * @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 = 5; - * - * @return The ifGenerationMatch. - */ - @java.lang.Override - public long getIfGenerationMatch() { - return ifGenerationMatch_; - } - - public static final int IF_GENERATION_NOT_MATCH_FIELD_NUMBER = 6; - private long ifGenerationNotMatch_; - /** - * - * - *
-   * Makes the operation conditional on whether the object's current generation
-   * does not match the given value. If no live object exists, the precondition
-   * fails. Setting to 0 makes the operation succeed only if there is a live
-   * version of the object.
-   * 
- * - * optional int64 if_generation_not_match = 6; - * - * @return Whether the ifGenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfGenerationNotMatch() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-   * Makes the operation conditional on whether the object's current generation
-   * does not match the given value. If no live object exists, the precondition
-   * fails. Setting to 0 makes the operation succeed only if there is a live
-   * version of the object.
-   * 
- * - * optional int64 if_generation_not_match = 6; - * - * @return The ifGenerationNotMatch. - */ - @java.lang.Override - public long getIfGenerationNotMatch() { - return ifGenerationNotMatch_; - } - - public static final int IF_METAGENERATION_MATCH_FIELD_NUMBER = 7; - private long ifMetagenerationMatch_; - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * metageneration matches the given value.
-   * 
- * - * optional int64 if_metageneration_match = 7; - * - * @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 = 7; - * - * @return The ifMetagenerationMatch. - */ - @java.lang.Override - public long getIfMetagenerationMatch() { - return ifMetagenerationMatch_; - } - - public static final int IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER = 8; - 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 = 8; - * - * @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 = 8; - * - * @return The ifMetagenerationNotMatch. - */ - @java.lang.Override - public long getIfMetagenerationNotMatch() { - return ifMetagenerationNotMatch_; - } - - public static final int COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER = 10; - private com.google.storage.v2.CommonObjectRequestParams commonObjectRequestParams_; - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - * - * @return Whether the commonObjectRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonObjectRequestParams() { - return commonObjectRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - * - * @return The commonObjectRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { - return commonObjectRequestParams_ == null - ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() - : commonObjectRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - */ - @java.lang.Override - public com.google.storage.v2.CommonObjectRequestParamsOrBuilder - getCommonObjectRequestParamsOrBuilder() { - return getCommonObjectRequestParams(); - } - - public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 11; - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - * - * @return Whether the commonRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonRequestParams() { - return commonRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - * - * @return The commonRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - return getCommonRequestParams(); - } - - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uploadId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uploadId_); - } - if (generation_ != 0L) { - output.writeInt64(4, generation_); - } - if (((bitField0_ & 0x00000001) != 0)) { - output.writeInt64(5, ifGenerationMatch_); - } - if (((bitField0_ & 0x00000002) != 0)) { - output.writeInt64(6, ifGenerationNotMatch_); - } - if (((bitField0_ & 0x00000004) != 0)) { - output.writeInt64(7, ifMetagenerationMatch_); - } - if (((bitField0_ & 0x00000008) != 0)) { - output.writeInt64(8, ifMetagenerationNotMatch_); - } - if (commonObjectRequestParams_ != null) { - output.writeMessage(10, getCommonObjectRequestParams()); - } - if (commonRequestParams_ != null) { - output.writeMessage(11, getCommonRequestParams()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucket_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, bucket_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(object_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, object_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uploadId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uploadId_); - } - if (generation_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, generation_); - } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, ifGenerationMatch_); - } - if (((bitField0_ & 0x00000002) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(6, ifGenerationNotMatch_); - } - if (((bitField0_ & 0x00000004) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(7, ifMetagenerationMatch_); - } - if (((bitField0_ & 0x00000008) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(8, ifMetagenerationNotMatch_); - } - if (commonObjectRequestParams_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 10, getCommonObjectRequestParams()); - } - if (commonRequestParams_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize(11, getCommonRequestParams()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.DeleteObjectRequest)) { - return super.equals(obj); - } - com.google.storage.v2.DeleteObjectRequest other = - (com.google.storage.v2.DeleteObjectRequest) obj; - - if (!getBucket().equals(other.getBucket())) return false; - if (!getObject().equals(other.getObject())) return false; - if (!getUploadId().equals(other.getUploadId())) 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 (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; - if (hasCommonRequestParams()) { - if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + BUCKET_FIELD_NUMBER; - hash = (53 * hash) + getBucket().hashCode(); - hash = (37 * hash) + OBJECT_FIELD_NUMBER; - hash = (53 * hash) + getObject().hashCode(); - hash = (37 * hash) + UPLOAD_ID_FIELD_NUMBER; - hash = (53 * hash) + getUploadId().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 (hasCommonRequestParams()) { - hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonRequestParams().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.DeleteObjectRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.DeleteObjectRequest 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.DeleteObjectRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.DeleteObjectRequest 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.DeleteObjectRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.DeleteObjectRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.DeleteObjectRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.DeleteObjectRequest 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.DeleteObjectRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.DeleteObjectRequest 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.DeleteObjectRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.DeleteObjectRequest 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.DeleteObjectRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Message for deleting an object.
-   * Either `bucket` and `object` *or* `upload_id` **must** be set (but not both).
-   * 
- * - * Protobuf type {@code google.storage.v2.DeleteObjectRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.DeleteObjectRequest) - com.google.storage.v2.DeleteObjectRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteObjectRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteObjectRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.DeleteObjectRequest.class, - com.google.storage.v2.DeleteObjectRequest.Builder.class); - } - - // Construct using com.google.storage.v2.DeleteObjectRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bucket_ = ""; - - object_ = ""; - - uploadId_ = ""; - - generation_ = 0L; - - ifGenerationMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000001); - ifGenerationNotMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000002); - ifMetagenerationMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000004); - ifMetagenerationNotMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000008); - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = null; - } else { - commonObjectRequestParams_ = null; - commonObjectRequestParamsBuilder_ = null; - } - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteObjectRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.DeleteObjectRequest getDefaultInstanceForType() { - return com.google.storage.v2.DeleteObjectRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.DeleteObjectRequest build() { - com.google.storage.v2.DeleteObjectRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.DeleteObjectRequest buildPartial() { - com.google.storage.v2.DeleteObjectRequest result = - new com.google.storage.v2.DeleteObjectRequest(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - result.bucket_ = bucket_; - result.object_ = object_; - result.uploadId_ = uploadId_; - result.generation_ = generation_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.ifGenerationMatch_ = ifGenerationMatch_; - to_bitField0_ |= 0x00000001; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.ifGenerationNotMatch_ = ifGenerationNotMatch_; - to_bitField0_ |= 0x00000002; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.ifMetagenerationMatch_ = ifMetagenerationMatch_; - to_bitField0_ |= 0x00000004; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.ifMetagenerationNotMatch_ = ifMetagenerationNotMatch_; - to_bitField0_ |= 0x00000008; - } - if (commonObjectRequestParamsBuilder_ == null) { - result.commonObjectRequestParams_ = commonObjectRequestParams_; - } else { - result.commonObjectRequestParams_ = commonObjectRequestParamsBuilder_.build(); - } - if (commonRequestParamsBuilder_ == null) { - result.commonRequestParams_ = commonRequestParams_; - } else { - result.commonRequestParams_ = commonRequestParamsBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.DeleteObjectRequest) { - return mergeFrom((com.google.storage.v2.DeleteObjectRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.DeleteObjectRequest other) { - if (other == com.google.storage.v2.DeleteObjectRequest.getDefaultInstance()) return this; - if (!other.getBucket().isEmpty()) { - bucket_ = other.bucket_; - onChanged(); - } - if (!other.getObject().isEmpty()) { - object_ = other.object_; - onChanged(); - } - if (!other.getUploadId().isEmpty()) { - uploadId_ = other.uploadId_; - 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.hasCommonRequestParams()) { - mergeCommonRequestParams(other.getCommonRequestParams()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.DeleteObjectRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.DeleteObjectRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object bucket_ = ""; - /** - * - * - *
-     * Required. Name of the bucket in which the object resides.
-     * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @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. Name of the bucket in which the object resides.
-     * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @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. Name of the bucket in which the object resides.
-     * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bucket to set. - * @return This builder for chaining. - */ - public Builder setBucket(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - bucket_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of the bucket in which the object resides.
-     * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearBucket() { - - bucket_ = getDefaultInstance().getBucket(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of the bucket in which the object resides.
-     * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for bucket to set. - * @return This builder for chaining. - */ - public Builder setBucketBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - bucket_ = value; - onChanged(); - return this; - } - - private java.lang.Object object_ = ""; - /** - * - * - *
-     * Required. The name of the object to delete (when not using a resumable write).
-     * 
- * - * 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 delete (when not using a resumable write).
-     * 
- * - * 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 delete (when not using a resumable write).
-     * 
- * - * 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; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the object to delete (when not using a resumable write).
-     * 
- * - * string object = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearObject() { - - object_ = getDefaultInstance().getObject(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the object to delete (when not using a resumable write).
-     * 
- * - * 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; - onChanged(); - return this; - } - - private java.lang.Object uploadId_ = ""; - /** - * - * - *
-     * The resumable upload_id of the object to delete (when deleting an
-     * in-progress resumable write). This should be copied from the `upload_id`
-     * field of `StartResumableWriteResponse`.
-     * 
- * - * string upload_id = 3; - * - * @return The uploadId. - */ - public java.lang.String getUploadId() { - java.lang.Object ref = uploadId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uploadId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The resumable upload_id of the object to delete (when deleting an
-     * in-progress resumable write). This should be copied from the `upload_id`
-     * field of `StartResumableWriteResponse`.
-     * 
- * - * string upload_id = 3; - * - * @return The bytes for uploadId. - */ - public com.google.protobuf.ByteString getUploadIdBytes() { - java.lang.Object ref = uploadId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - uploadId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The resumable upload_id of the object to delete (when deleting an
-     * in-progress resumable write). This should be copied from the `upload_id`
-     * field of `StartResumableWriteResponse`.
-     * 
- * - * string upload_id = 3; - * - * @param value The uploadId to set. - * @return This builder for chaining. - */ - public Builder setUploadId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - uploadId_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The resumable upload_id of the object to delete (when deleting an
-     * in-progress resumable write). This should be copied from the `upload_id`
-     * field of `StartResumableWriteResponse`.
-     * 
- * - * string upload_id = 3; - * - * @return This builder for chaining. - */ - public Builder clearUploadId() { - - uploadId_ = getDefaultInstance().getUploadId(); - onChanged(); - return this; - } - /** - * - * - *
-     * The resumable upload_id of the object to delete (when deleting an
-     * in-progress resumable write). This should be copied from the `upload_id`
-     * field of `StartResumableWriteResponse`.
-     * 
- * - * string upload_id = 3; - * - * @param value The bytes for uploadId to set. - * @return This builder for chaining. - */ - public Builder setUploadIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - uploadId_ = value; - onChanged(); - return this; - } - - private long generation_; - /** - * - * - *
-     * If present, permanently deletes a specific revision of this object (as
-     * opposed to the latest version, the default).
-     * 
- * - * int64 generation = 4; - * - * @return The generation. - */ - @java.lang.Override - public long getGeneration() { - return generation_; - } - /** - * - * - *
-     * If present, permanently deletes a specific revision of this object (as
-     * opposed to the latest version, the default).
-     * 
- * - * int64 generation = 4; - * - * @param value The generation to set. - * @return This builder for chaining. - */ - public Builder setGeneration(long value) { - - generation_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If present, permanently deletes a specific revision of this object (as
-     * opposed to the latest version, the default).
-     * 
- * - * int64 generation = 4; - * - * @return This builder for chaining. - */ - public Builder clearGeneration() { - - 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 = 5; - * - * @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 = 5; - * - * @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 = 5; - * - * @param value The ifGenerationMatch to set. - * @return This builder for chaining. - */ - public Builder setIfGenerationMatch(long value) { - bitField0_ |= 0x00000001; - ifGenerationMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * matches the given value. Setting to 0 makes the operation succeed only if
-     * there are no live versions of the object.
-     * 
- * - * optional int64 if_generation_match = 5; - * - * @return This builder for chaining. - */ - public Builder clearIfGenerationMatch() { - bitField0_ = (bitField0_ & ~0x00000001); - ifGenerationMatch_ = 0L; - onChanged(); - return this; - } - - private long ifGenerationNotMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * does not match the given value. If no live object exists, the precondition
-     * fails. Setting to 0 makes the operation succeed only if there is a live
-     * version of the object.
-     * 
- * - * optional int64 if_generation_not_match = 6; - * - * @return Whether the ifGenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfGenerationNotMatch() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * does not match the given value. If no live object exists, the precondition
-     * fails. Setting to 0 makes the operation succeed only if there is a live
-     * version of the object.
-     * 
- * - * optional int64 if_generation_not_match = 6; - * - * @return The ifGenerationNotMatch. - */ - @java.lang.Override - public long getIfGenerationNotMatch() { - return ifGenerationNotMatch_; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * does not match the given value. If no live object exists, the precondition
-     * fails. Setting to 0 makes the operation succeed only if there is a live
-     * version of the object.
-     * 
- * - * optional int64 if_generation_not_match = 6; - * - * @param value The ifGenerationNotMatch to set. - * @return This builder for chaining. - */ - public Builder setIfGenerationNotMatch(long value) { - bitField0_ |= 0x00000002; - ifGenerationNotMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * does not match the given value. If no live object exists, the precondition
-     * fails. Setting to 0 makes the operation succeed only if there is a live
-     * version of the object.
-     * 
- * - * optional int64 if_generation_not_match = 6; - * - * @return This builder for chaining. - */ - public Builder clearIfGenerationNotMatch() { - bitField0_ = (bitField0_ & ~0x00000002); - ifGenerationNotMatch_ = 0L; - onChanged(); - return this; - } - - private long ifMetagenerationMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration matches the given value.
-     * 
- * - * optional int64 if_metageneration_match = 7; - * - * @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 = 7; - * - * @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 = 7; - * - * @param value The ifMetagenerationMatch to set. - * @return This builder for chaining. - */ - public Builder setIfMetagenerationMatch(long value) { - bitField0_ |= 0x00000004; - ifMetagenerationMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration matches the given value.
-     * 
- * - * optional int64 if_metageneration_match = 7; - * - * @return This builder for chaining. - */ - public Builder clearIfMetagenerationMatch() { - bitField0_ = (bitField0_ & ~0x00000004); - ifMetagenerationMatch_ = 0L; - onChanged(); - return this; - } - - private long ifMetagenerationNotMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration does not match the given value.
-     * 
- * - * optional int64 if_metageneration_not_match = 8; - * - * @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 = 8; - * - * @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 = 8; - * - * @param value The ifMetagenerationNotMatch to set. - * @return This builder for chaining. - */ - public Builder setIfMetagenerationNotMatch(long value) { - bitField0_ |= 0x00000008; - ifMetagenerationNotMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration does not match the given value.
-     * 
- * - * optional int64 if_metageneration_not_match = 8; - * - * @return This builder for chaining. - */ - public Builder clearIfMetagenerationNotMatch() { - bitField0_ = (bitField0_ & ~0x00000008); - ifMetagenerationNotMatch_ = 0L; - onChanged(); - return this; - } - - private com.google.storage.v2.CommonObjectRequestParams commonObjectRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder> - commonObjectRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - * - * @return Whether the commonObjectRequestParams field is set. - */ - public boolean hasCommonObjectRequestParams() { - return commonObjectRequestParamsBuilder_ != null || commonObjectRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - * - * @return The commonObjectRequestParams. - */ - public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { - if (commonObjectRequestParamsBuilder_ == null) { - return commonObjectRequestParams_ == null - ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() - : commonObjectRequestParams_; - } else { - return commonObjectRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - */ - public Builder setCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams value) { - if (commonObjectRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonObjectRequestParams_ = value; - onChanged(); - } else { - commonObjectRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - */ - public Builder setCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams.Builder builderForValue) { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonObjectRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - */ - public Builder mergeCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams value) { - if (commonObjectRequestParamsBuilder_ == null) { - if (commonObjectRequestParams_ != null) { - commonObjectRequestParams_ = - com.google.storage.v2.CommonObjectRequestParams.newBuilder(commonObjectRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonObjectRequestParams_ = value; - } - onChanged(); - } else { - commonObjectRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - */ - public Builder clearCommonObjectRequestParams() { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = null; - onChanged(); - } else { - commonObjectRequestParams_ = null; - commonObjectRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - */ - public com.google.storage.v2.CommonObjectRequestParams.Builder - getCommonObjectRequestParamsBuilder() { - - onChanged(); - return getCommonObjectRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - */ - public com.google.storage.v2.CommonObjectRequestParamsOrBuilder - getCommonObjectRequestParamsOrBuilder() { - if (commonObjectRequestParamsBuilder_ != null) { - return commonObjectRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonObjectRequestParams_ == null - ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() - : commonObjectRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder> - getCommonObjectRequestParamsFieldBuilder() { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder>( - getCommonObjectRequestParams(), getParentForChildren(), isClean()); - commonObjectRequestParams_ = null; - } - return commonObjectRequestParamsBuilder_; - } - - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - commonRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - * - * @return Whether the commonRequestParams field is set. - */ - public boolean hasCommonRequestParams() { - return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - * - * @return The commonRequestParams. - */ - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } else { - return commonRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - */ - public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonRequestParams_ = value; - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - */ - public Builder setCommonRequestParams( - com.google.storage.v2.CommonRequestParams.Builder builderForValue) { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - */ - public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (commonRequestParams_ != null) { - commonRequestParams_ = - com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonRequestParams_ = value; - } - onChanged(); - } else { - commonRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - */ - public Builder clearCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - onChanged(); - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - */ - public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { - - onChanged(); - return getCommonRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - */ - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - if (commonRequestParamsBuilder_ != null) { - return commonRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - getCommonRequestParamsFieldBuilder() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder>( - getCommonRequestParams(), getParentForChildren(), isClean()); - commonRequestParams_ = null; - } - return commonRequestParamsBuilder_; - } - - @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.DeleteObjectRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.DeleteObjectRequest) - private static final com.google.storage.v2.DeleteObjectRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.DeleteObjectRequest(); - } - - public static com.google.storage.v2.DeleteObjectRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeleteObjectRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteObjectRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.DeleteObjectRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteObjectRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteObjectRequestOrBuilder.java deleted file mode 100644 index 14e33acd88..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteObjectRequestOrBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface DeleteObjectRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.DeleteObjectRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Name of the bucket in which the object resides.
-   * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bucket. - */ - java.lang.String getBucket(); - /** - * - * - *
-   * Required. Name of the bucket in which the object resides.
-   * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for bucket. - */ - com.google.protobuf.ByteString getBucketBytes(); - - /** - * - * - *
-   * Required. The name of the object to delete (when not using a resumable write).
-   * 
- * - * string object = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The object. - */ - java.lang.String getObject(); - /** - * - * - *
-   * Required. The name of the object to delete (when not using a resumable write).
-   * 
- * - * string object = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for object. - */ - com.google.protobuf.ByteString getObjectBytes(); - - /** - * - * - *
-   * The resumable upload_id of the object to delete (when deleting an
-   * in-progress resumable write). This should be copied from the `upload_id`
-   * field of `StartResumableWriteResponse`.
-   * 
- * - * string upload_id = 3; - * - * @return The uploadId. - */ - java.lang.String getUploadId(); - /** - * - * - *
-   * The resumable upload_id of the object to delete (when deleting an
-   * in-progress resumable write). This should be copied from the `upload_id`
-   * field of `StartResumableWriteResponse`.
-   * 
- * - * string upload_id = 3; - * - * @return The bytes for uploadId. - */ - com.google.protobuf.ByteString getUploadIdBytes(); - - /** - * - * - *
-   * If present, permanently deletes a specific revision of this object (as
-   * opposed to the latest version, the default).
-   * 
- * - * int64 generation = 4; - * - * @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 = 5; - * - * @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 = 5; - * - * @return The ifGenerationMatch. - */ - long getIfGenerationMatch(); - - /** - * - * - *
-   * Makes the operation conditional on whether the object's current generation
-   * does not match the given value. If no live object exists, the precondition
-   * fails. Setting to 0 makes the operation succeed only if there is a live
-   * version of the object.
-   * 
- * - * optional int64 if_generation_not_match = 6; - * - * @return Whether the ifGenerationNotMatch field is set. - */ - boolean hasIfGenerationNotMatch(); - /** - * - * - *
-   * Makes the operation conditional on whether the object's current generation
-   * does not match the given value. If no live object exists, the precondition
-   * fails. Setting to 0 makes the operation succeed only if there is a live
-   * version of the object.
-   * 
- * - * optional int64 if_generation_not_match = 6; - * - * @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 = 7; - * - * @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 = 7; - * - * @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 = 8; - * - * @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 = 8; - * - * @return The ifMetagenerationNotMatch. - */ - long getIfMetagenerationNotMatch(); - - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - * - * @return Whether the commonObjectRequestParams field is set. - */ - boolean hasCommonObjectRequestParams(); - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - * - * @return The commonObjectRequestParams. - */ - com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams(); - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - */ - com.google.storage.v2.CommonObjectRequestParamsOrBuilder getCommonObjectRequestParamsOrBuilder(); - - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - * - * @return Whether the commonRequestParams field is set. - */ - boolean hasCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - * - * @return The commonRequestParams. - */ - com.google.storage.v2.CommonRequestParams getCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - */ - com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetBucketRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetBucketRequest.java deleted file mode 100644 index d3859b6230..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetBucketRequest.java +++ /dev/null @@ -1,1500 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request message for GetBucket.
- * 
- * - * Protobuf type {@code google.storage.v2.GetBucketRequest} - */ -public final class GetBucketRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.GetBucketRequest) - GetBucketRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use GetBucketRequest.newBuilder() to construct. - private GetBucketRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private GetBucketRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new GetBucketRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private GetBucketRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 16: - { - bitField0_ |= 0x00000001; - ifMetagenerationMatch_ = input.readInt64(); - break; - } - case 24: - { - bitField0_ |= 0x00000002; - ifMetagenerationNotMatch_ = input.readInt64(); - break; - } - case 34: - { - com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; - if (commonRequestParams_ != null) { - subBuilder = commonRequestParams_.toBuilder(); - } - commonRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonRequestParams_); - commonRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - case 42: - { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (((bitField0_ & 0x00000004) != 0)) { - subBuilder = readMask_.toBuilder(); - } - readMask_ = - input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(readMask_); - readMask_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000004; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetBucketRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetBucketRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.GetBucketRequest.class, - com.google.storage.v2.GetBucketRequest.Builder.class); - } - - private int bitField0_; - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * - * - *
-   * Required. Name of a bucket.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * - * - *
-   * Required. Name of a bucket.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int IF_METAGENERATION_MATCH_FIELD_NUMBER = 2; - private long ifMetagenerationMatch_; - /** - * - * - *
-   * If set, and if the bucket's current metageneration does not match the
-   * specified value, the request will return an error.
-   * 
- * - * optional int64 if_metageneration_match = 2; - * - * @return Whether the ifMetagenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationMatch() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-   * If set, and if the bucket's current metageneration does not match the
-   * specified value, the request will return an error.
-   * 
- * - * optional int64 if_metageneration_match = 2; - * - * @return The ifMetagenerationMatch. - */ - @java.lang.Override - public long getIfMetagenerationMatch() { - return ifMetagenerationMatch_; - } - - public static final int IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER = 3; - private long ifMetagenerationNotMatch_; - /** - * - * - *
-   * If set, and if the bucket's current metageneration matches the specified
-   * value, the request will return an error.
-   * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @return Whether the ifMetagenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationNotMatch() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-   * If set, and if the bucket's current metageneration matches the specified
-   * value, the request will return an error.
-   * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @return The ifMetagenerationNotMatch. - */ - @java.lang.Override - public long getIfMetagenerationNotMatch() { - return ifMetagenerationNotMatch_; - } - - public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 4; - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - * - * @return Whether the commonRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonRequestParams() { - return commonRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - * - * @return The commonRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - return getCommonRequestParams(); - } - - public static final int READ_MASK_FIELD_NUMBER = 5; - private com.google.protobuf.FieldMask readMask_; - /** - * - * - *
-   * Mask specifying which fields to read.
-   * A "*" field may be used to indicate all fields.
-   * If no mask is specified, will default to all fields.
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - * - * @return Whether the readMask field is set. - */ - @java.lang.Override - public boolean hasReadMask() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * - * - *
-   * Mask specifying which fields to read.
-   * A "*" field may be used to indicate all fields.
-   * If no mask is specified, will default to all fields.
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - * - * @return The readMask. - */ - @java.lang.Override - public com.google.protobuf.FieldMask getReadMask() { - return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; - } - /** - * - * - *
-   * Mask specifying which fields to read.
-   * A "*" field may be used to indicate all fields.
-   * If no mask is specified, will default to all fields.
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - */ - @java.lang.Override - public com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder() { - return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (((bitField0_ & 0x00000001) != 0)) { - output.writeInt64(2, ifMetagenerationMatch_); - } - if (((bitField0_ & 0x00000002) != 0)) { - output.writeInt64(3, ifMetagenerationNotMatch_); - } - if (commonRequestParams_ != null) { - output.writeMessage(4, getCommonRequestParams()); - } - if (((bitField0_ & 0x00000004) != 0)) { - output.writeMessage(5, getReadMask()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, ifMetagenerationMatch_); - } - if (((bitField0_ & 0x00000002) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, ifMetagenerationNotMatch_); - } - if (commonRequestParams_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCommonRequestParams()); - } - if (((bitField0_ & 0x00000004) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getReadMask()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.GetBucketRequest)) { - return super.equals(obj); - } - com.google.storage.v2.GetBucketRequest other = (com.google.storage.v2.GetBucketRequest) obj; - - if (!getName().equals(other.getName())) return false; - if (hasIfMetagenerationMatch() != other.hasIfMetagenerationMatch()) return false; - if (hasIfMetagenerationMatch()) { - if (getIfMetagenerationMatch() != other.getIfMetagenerationMatch()) return false; - } - if (hasIfMetagenerationNotMatch() != other.hasIfMetagenerationNotMatch()) return false; - if (hasIfMetagenerationNotMatch()) { - if (getIfMetagenerationNotMatch() != other.getIfMetagenerationNotMatch()) return false; - } - if (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; - if (hasCommonRequestParams()) { - if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; - } - if (hasReadMask() != other.hasReadMask()) return false; - if (hasReadMask()) { - if (!getReadMask().equals(other.getReadMask())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - if (hasIfMetagenerationMatch()) { - hash = (37 * hash) + IF_METAGENERATION_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationMatch()); - } - if (hasIfMetagenerationNotMatch()) { - hash = (37 * hash) + IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationNotMatch()); - } - if (hasCommonRequestParams()) { - hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonRequestParams().hashCode(); - } - if (hasReadMask()) { - hash = (37 * hash) + READ_MASK_FIELD_NUMBER; - hash = (53 * hash) + getReadMask().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.GetBucketRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.GetBucketRequest 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.GetBucketRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.GetBucketRequest 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.GetBucketRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.GetBucketRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.GetBucketRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.GetBucketRequest 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.GetBucketRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.GetBucketRequest 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.GetBucketRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.GetBucketRequest 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.GetBucketRequest 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 GetBucket.
-   * 
- * - * Protobuf type {@code google.storage.v2.GetBucketRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.GetBucketRequest) - com.google.storage.v2.GetBucketRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetBucketRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetBucketRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.GetBucketRequest.class, - com.google.storage.v2.GetBucketRequest.Builder.class); - } - - // Construct using com.google.storage.v2.GetBucketRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getReadMaskFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - ifMetagenerationMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000001); - ifMetagenerationNotMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000002); - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - if (readMaskBuilder_ == null) { - readMask_ = null; - } else { - readMaskBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetBucketRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.GetBucketRequest getDefaultInstanceForType() { - return com.google.storage.v2.GetBucketRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.GetBucketRequest build() { - com.google.storage.v2.GetBucketRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.GetBucketRequest buildPartial() { - com.google.storage.v2.GetBucketRequest result = - new com.google.storage.v2.GetBucketRequest(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - result.name_ = name_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.ifMetagenerationMatch_ = ifMetagenerationMatch_; - to_bitField0_ |= 0x00000001; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.ifMetagenerationNotMatch_ = ifMetagenerationNotMatch_; - to_bitField0_ |= 0x00000002; - } - if (commonRequestParamsBuilder_ == null) { - result.commonRequestParams_ = commonRequestParams_; - } else { - result.commonRequestParams_ = commonRequestParamsBuilder_.build(); - } - if (((from_bitField0_ & 0x00000004) != 0)) { - if (readMaskBuilder_ == null) { - result.readMask_ = readMask_; - } else { - result.readMask_ = readMaskBuilder_.build(); - } - to_bitField0_ |= 0x00000004; - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.GetBucketRequest) { - return mergeFrom((com.google.storage.v2.GetBucketRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.GetBucketRequest other) { - if (other == com.google.storage.v2.GetBucketRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.hasIfMetagenerationMatch()) { - setIfMetagenerationMatch(other.getIfMetagenerationMatch()); - } - if (other.hasIfMetagenerationNotMatch()) { - setIfMetagenerationNotMatch(other.getIfMetagenerationNotMatch()); - } - if (other.hasCommonRequestParams()) { - mergeCommonRequestParams(other.getCommonRequestParams()); - } - if (other.hasReadMask()) { - mergeReadMask(other.getReadMask()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.GetBucketRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.GetBucketRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * Required. Name of a bucket.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. Name of a bucket.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. Name of a bucket.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of a bucket.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of a bucket.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private long ifMetagenerationMatch_; - /** - * - * - *
-     * If set, and if the bucket's current metageneration does not match the
-     * specified value, the request will return an error.
-     * 
- * - * optional int64 if_metageneration_match = 2; - * - * @return Whether the ifMetagenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationMatch() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-     * If set, and if the bucket's current metageneration does not match the
-     * specified value, the request will return an error.
-     * 
- * - * optional int64 if_metageneration_match = 2; - * - * @return The ifMetagenerationMatch. - */ - @java.lang.Override - public long getIfMetagenerationMatch() { - return ifMetagenerationMatch_; - } - /** - * - * - *
-     * If set, and if the bucket's current metageneration does not match the
-     * specified value, the request will return an error.
-     * 
- * - * optional int64 if_metageneration_match = 2; - * - * @param value The ifMetagenerationMatch to set. - * @return This builder for chaining. - */ - public Builder setIfMetagenerationMatch(long value) { - bitField0_ |= 0x00000001; - ifMetagenerationMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If set, and if the bucket's current metageneration does not match the
-     * specified value, the request will return an error.
-     * 
- * - * optional int64 if_metageneration_match = 2; - * - * @return This builder for chaining. - */ - public Builder clearIfMetagenerationMatch() { - bitField0_ = (bitField0_ & ~0x00000001); - ifMetagenerationMatch_ = 0L; - onChanged(); - return this; - } - - private long ifMetagenerationNotMatch_; - /** - * - * - *
-     * If set, and if the bucket's current metageneration matches the specified
-     * value, the request will return an error.
-     * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @return Whether the ifMetagenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationNotMatch() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-     * If set, and if the bucket's current metageneration matches the specified
-     * value, the request will return an error.
-     * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @return The ifMetagenerationNotMatch. - */ - @java.lang.Override - public long getIfMetagenerationNotMatch() { - return ifMetagenerationNotMatch_; - } - /** - * - * - *
-     * If set, and if the bucket's current metageneration matches the specified
-     * value, the request will return an error.
-     * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @param value The ifMetagenerationNotMatch to set. - * @return This builder for chaining. - */ - public Builder setIfMetagenerationNotMatch(long value) { - bitField0_ |= 0x00000002; - ifMetagenerationNotMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If set, and if the bucket's current metageneration matches the specified
-     * value, the request will return an error.
-     * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @return This builder for chaining. - */ - public Builder clearIfMetagenerationNotMatch() { - bitField0_ = (bitField0_ & ~0x00000002); - ifMetagenerationNotMatch_ = 0L; - onChanged(); - return this; - } - - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - commonRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - * - * @return Whether the commonRequestParams field is set. - */ - public boolean hasCommonRequestParams() { - return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - * - * @return The commonRequestParams. - */ - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } else { - return commonRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - */ - public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonRequestParams_ = value; - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - */ - public Builder setCommonRequestParams( - com.google.storage.v2.CommonRequestParams.Builder builderForValue) { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - */ - public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (commonRequestParams_ != null) { - commonRequestParams_ = - com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonRequestParams_ = value; - } - onChanged(); - } else { - commonRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - */ - public Builder clearCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - onChanged(); - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - */ - public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { - - onChanged(); - return getCommonRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - */ - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - if (commonRequestParamsBuilder_ != null) { - return commonRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - getCommonRequestParamsFieldBuilder() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder>( - getCommonRequestParams(), getParentForChildren(), isClean()); - commonRequestParams_ = null; - } - return commonRequestParamsBuilder_; - } - - 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.
-     * A "*" field may be used to indicate all fields.
-     * If no mask is specified, will default to all fields.
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - * - * @return Whether the readMask field is set. - */ - public boolean hasReadMask() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * - * - *
-     * Mask specifying which fields to read.
-     * A "*" field may be used to indicate all fields.
-     * If no mask is specified, will default to all fields.
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - * - * @return The readMask. - */ - public com.google.protobuf.FieldMask getReadMask() { - if (readMaskBuilder_ == null) { - return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; - } else { - return readMaskBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Mask specifying which fields to read.
-     * A "*" field may be used to indicate all fields.
-     * If no mask is specified, will default to all fields.
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - */ - public Builder setReadMask(com.google.protobuf.FieldMask value) { - if (readMaskBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - readMask_ = value; - onChanged(); - } else { - readMaskBuilder_.setMessage(value); - } - bitField0_ |= 0x00000004; - return this; - } - /** - * - * - *
-     * Mask specifying which fields to read.
-     * A "*" field may be used to indicate all fields.
-     * If no mask is specified, will default to all fields.
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - */ - public Builder setReadMask(com.google.protobuf.FieldMask.Builder builderForValue) { - if (readMaskBuilder_ == null) { - readMask_ = builderForValue.build(); - onChanged(); - } else { - readMaskBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000004; - return this; - } - /** - * - * - *
-     * Mask specifying which fields to read.
-     * A "*" field may be used to indicate all fields.
-     * If no mask is specified, will default to all fields.
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - */ - public Builder mergeReadMask(com.google.protobuf.FieldMask value) { - if (readMaskBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0) - && readMask_ != null - && readMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { - readMask_ = - com.google.protobuf.FieldMask.newBuilder(readMask_).mergeFrom(value).buildPartial(); - } else { - readMask_ = value; - } - onChanged(); - } else { - readMaskBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000004; - return this; - } - /** - * - * - *
-     * Mask specifying which fields to read.
-     * A "*" field may be used to indicate all fields.
-     * If no mask is specified, will default to all fields.
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - */ - public Builder clearReadMask() { - if (readMaskBuilder_ == null) { - readMask_ = null; - onChanged(); - } else { - readMaskBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - /** - * - * - *
-     * Mask specifying which fields to read.
-     * A "*" field may be used to indicate all fields.
-     * If no mask is specified, will default to all fields.
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - */ - public com.google.protobuf.FieldMask.Builder getReadMaskBuilder() { - bitField0_ |= 0x00000004; - onChanged(); - return getReadMaskFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Mask specifying which fields to read.
-     * A "*" field may be used to indicate all fields.
-     * If no mask is specified, will default to all fields.
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - */ - 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.
-     * A "*" field may be used to indicate all fields.
-     * If no mask is specified, will default to all fields.
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder> - getReadMaskFieldBuilder() { - if (readMaskBuilder_ == null) { - readMaskBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder>( - getReadMask(), getParentForChildren(), isClean()); - readMask_ = null; - } - return readMaskBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.GetBucketRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.GetBucketRequest) - private static final com.google.storage.v2.GetBucketRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.GetBucketRequest(); - } - - public static com.google.storage.v2.GetBucketRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GetBucketRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GetBucketRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.GetBucketRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetBucketRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetBucketRequestOrBuilder.java deleted file mode 100644 index 71b333c360..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetBucketRequestOrBuilder.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface GetBucketRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.GetBucketRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Name of a bucket.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-   * Required. Name of a bucket.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-   * If set, and if the bucket's current metageneration does not match the
-   * specified value, the request will return an error.
-   * 
- * - * optional int64 if_metageneration_match = 2; - * - * @return Whether the ifMetagenerationMatch field is set. - */ - boolean hasIfMetagenerationMatch(); - /** - * - * - *
-   * If set, and if the bucket's current metageneration does not match the
-   * specified value, the request will return an error.
-   * 
- * - * optional int64 if_metageneration_match = 2; - * - * @return The ifMetagenerationMatch. - */ - long getIfMetagenerationMatch(); - - /** - * - * - *
-   * If set, and if the bucket's current metageneration matches the specified
-   * value, the request will return an error.
-   * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @return Whether the ifMetagenerationNotMatch field is set. - */ - boolean hasIfMetagenerationNotMatch(); - /** - * - * - *
-   * If set, and if the bucket's current metageneration matches the specified
-   * value, the request will return an error.
-   * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @return The ifMetagenerationNotMatch. - */ - long getIfMetagenerationNotMatch(); - - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - * - * @return Whether the commonRequestParams field is set. - */ - boolean hasCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - * - * @return The commonRequestParams. - */ - com.google.storage.v2.CommonRequestParams getCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - */ - com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); - - /** - * - * - *
-   * Mask specifying which fields to read.
-   * A "*" field may be used to indicate all fields.
-   * If no mask is specified, will default to all fields.
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - * - * @return Whether the readMask field is set. - */ - boolean hasReadMask(); - /** - * - * - *
-   * Mask specifying which fields to read.
-   * A "*" field may be used to indicate all fields.
-   * If no mask is specified, will default to all fields.
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - * - * @return The readMask. - */ - com.google.protobuf.FieldMask getReadMask(); - /** - * - * - *
-   * Mask specifying which fields to read.
-   * A "*" field may be used to indicate all fields.
-   * If no mask is specified, will default to all fields.
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - */ - com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetHmacKeyRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetHmacKeyRequest.java deleted file mode 100644 index f3c6b22889..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetHmacKeyRequest.java +++ /dev/null @@ -1,1104 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request object to get metadata on a given HMAC key.
- * 
- * - * Protobuf type {@code google.storage.v2.GetHmacKeyRequest} - */ -public final class GetHmacKeyRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.GetHmacKeyRequest) - GetHmacKeyRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use GetHmacKeyRequest.newBuilder() to construct. - private GetHmacKeyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private GetHmacKeyRequest() { - accessId_ = ""; - project_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new GetHmacKeyRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private GetHmacKeyRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - accessId_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - project_ = s; - break; - } - case 26: - { - com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; - if (commonRequestParams_ != null) { - subBuilder = commonRequestParams_.toBuilder(); - } - commonRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonRequestParams_); - commonRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetHmacKeyRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetHmacKeyRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.GetHmacKeyRequest.class, - com.google.storage.v2.GetHmacKeyRequest.Builder.class); - } - - public static final int ACCESS_ID_FIELD_NUMBER = 1; - private volatile java.lang.Object accessId_; - /** - * - * - *
-   * Required. The identifying key for the HMAC to delete.
-   * 
- * - * string access_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The accessId. - */ - @java.lang.Override - public java.lang.String getAccessId() { - java.lang.Object ref = accessId_; - 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(); - accessId_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The identifying key for the HMAC to delete.
-   * 
- * - * string access_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for accessId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getAccessIdBytes() { - java.lang.Object ref = accessId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - accessId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PROJECT_FIELD_NUMBER = 2; - private volatile java.lang.Object project_; - /** - * - * - *
-   * Required. The project id the HMAC key lies in.
-   * 
- * - * - * string project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - @java.lang.Override - public java.lang.String getProject() { - java.lang.Object ref = project_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - project_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The project id the HMAC key lies in.
-   * 
- * - * - * string project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - @java.lang.Override - public com.google.protobuf.ByteString getProjectBytes() { - java.lang.Object ref = project_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - project_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 3; - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return Whether the commonRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonRequestParams() { - return commonRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return The commonRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - return getCommonRequestParams(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(accessId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, accessId_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, project_); - } - if (commonRequestParams_ != null) { - output.writeMessage(3, getCommonRequestParams()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(accessId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, accessId_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, project_); - } - if (commonRequestParams_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCommonRequestParams()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.GetHmacKeyRequest)) { - return super.equals(obj); - } - com.google.storage.v2.GetHmacKeyRequest other = (com.google.storage.v2.GetHmacKeyRequest) obj; - - if (!getAccessId().equals(other.getAccessId())) return false; - if (!getProject().equals(other.getProject())) return false; - if (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; - if (hasCommonRequestParams()) { - if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ACCESS_ID_FIELD_NUMBER; - hash = (53 * hash) + getAccessId().hashCode(); - hash = (37 * hash) + PROJECT_FIELD_NUMBER; - hash = (53 * hash) + getProject().hashCode(); - if (hasCommonRequestParams()) { - hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonRequestParams().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.GetHmacKeyRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.GetHmacKeyRequest 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.GetHmacKeyRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.GetHmacKeyRequest 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.GetHmacKeyRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.GetHmacKeyRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.GetHmacKeyRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.GetHmacKeyRequest 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.GetHmacKeyRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.GetHmacKeyRequest 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.GetHmacKeyRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.GetHmacKeyRequest 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.GetHmacKeyRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Request object to get metadata on a given HMAC key.
-   * 
- * - * Protobuf type {@code google.storage.v2.GetHmacKeyRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.GetHmacKeyRequest) - com.google.storage.v2.GetHmacKeyRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetHmacKeyRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetHmacKeyRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.GetHmacKeyRequest.class, - com.google.storage.v2.GetHmacKeyRequest.Builder.class); - } - - // Construct using com.google.storage.v2.GetHmacKeyRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - accessId_ = ""; - - project_ = ""; - - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetHmacKeyRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.GetHmacKeyRequest getDefaultInstanceForType() { - return com.google.storage.v2.GetHmacKeyRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.GetHmacKeyRequest build() { - com.google.storage.v2.GetHmacKeyRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.GetHmacKeyRequest buildPartial() { - com.google.storage.v2.GetHmacKeyRequest result = - new com.google.storage.v2.GetHmacKeyRequest(this); - result.accessId_ = accessId_; - result.project_ = project_; - if (commonRequestParamsBuilder_ == null) { - result.commonRequestParams_ = commonRequestParams_; - } else { - result.commonRequestParams_ = commonRequestParamsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.GetHmacKeyRequest) { - return mergeFrom((com.google.storage.v2.GetHmacKeyRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.GetHmacKeyRequest other) { - if (other == com.google.storage.v2.GetHmacKeyRequest.getDefaultInstance()) return this; - if (!other.getAccessId().isEmpty()) { - accessId_ = other.accessId_; - onChanged(); - } - if (!other.getProject().isEmpty()) { - project_ = other.project_; - onChanged(); - } - if (other.hasCommonRequestParams()) { - mergeCommonRequestParams(other.getCommonRequestParams()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.GetHmacKeyRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.GetHmacKeyRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object accessId_ = ""; - /** - * - * - *
-     * Required. The identifying key for the HMAC to delete.
-     * 
- * - * string access_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The accessId. - */ - public java.lang.String getAccessId() { - java.lang.Object ref = accessId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - accessId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The identifying key for the HMAC to delete.
-     * 
- * - * string access_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for accessId. - */ - public com.google.protobuf.ByteString getAccessIdBytes() { - java.lang.Object ref = accessId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - accessId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The identifying key for the HMAC to delete.
-     * 
- * - * string access_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The accessId to set. - * @return This builder for chaining. - */ - public Builder setAccessId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - accessId_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The identifying key for the HMAC to delete.
-     * 
- * - * string access_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearAccessId() { - - accessId_ = getDefaultInstance().getAccessId(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The identifying key for the HMAC to delete.
-     * 
- * - * string access_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for accessId to set. - * @return This builder for chaining. - */ - public Builder setAccessIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - accessId_ = value; - onChanged(); - return this; - } - - private java.lang.Object project_ = ""; - /** - * - * - *
-     * Required. The project id the HMAC key lies in.
-     * 
- * - * - * string project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - public java.lang.String getProject() { - java.lang.Object ref = project_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - project_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The project id the HMAC key lies in.
-     * 
- * - * - * string project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - public com.google.protobuf.ByteString getProjectBytes() { - java.lang.Object ref = project_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - project_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The project id the HMAC key lies in.
-     * 
- * - * - * string project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The project to set. - * @return This builder for chaining. - */ - public Builder setProject(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - project_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The project id the HMAC key lies in.
-     * 
- * - * - * string project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearProject() { - - project_ = getDefaultInstance().getProject(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The project id the HMAC key lies in.
-     * 
- * - * - * string project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for project to set. - * @return This builder for chaining. - */ - public Builder setProjectBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - project_ = value; - onChanged(); - return this; - } - - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - commonRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return Whether the commonRequestParams field is set. - */ - public boolean hasCommonRequestParams() { - return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return The commonRequestParams. - */ - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } else { - return commonRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonRequestParams_ = value; - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public Builder setCommonRequestParams( - com.google.storage.v2.CommonRequestParams.Builder builderForValue) { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (commonRequestParams_ != null) { - commonRequestParams_ = - com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonRequestParams_ = value; - } - onChanged(); - } else { - commonRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public Builder clearCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - onChanged(); - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { - - onChanged(); - return getCommonRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - if (commonRequestParamsBuilder_ != null) { - return commonRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - getCommonRequestParamsFieldBuilder() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder>( - getCommonRequestParams(), getParentForChildren(), isClean()); - commonRequestParams_ = null; - } - return commonRequestParamsBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.GetHmacKeyRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.GetHmacKeyRequest) - private static final com.google.storage.v2.GetHmacKeyRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.GetHmacKeyRequest(); - } - - public static com.google.storage.v2.GetHmacKeyRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GetHmacKeyRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GetHmacKeyRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.GetHmacKeyRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetHmacKeyRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetHmacKeyRequestOrBuilder.java deleted file mode 100644 index fa70b5c49a..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetHmacKeyRequestOrBuilder.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface GetHmacKeyRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.GetHmacKeyRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The identifying key for the HMAC to delete.
-   * 
- * - * string access_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The accessId. - */ - java.lang.String getAccessId(); - /** - * - * - *
-   * Required. The identifying key for the HMAC to delete.
-   * 
- * - * string access_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for accessId. - */ - com.google.protobuf.ByteString getAccessIdBytes(); - - /** - * - * - *
-   * Required. The project id the HMAC key lies in.
-   * 
- * - * - * string project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - java.lang.String getProject(); - /** - * - * - *
-   * Required. The project id the HMAC key lies in.
-   * 
- * - * - * string project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - com.google.protobuf.ByteString getProjectBytes(); - - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return Whether the commonRequestParams field is set. - */ - boolean hasCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return The commonRequestParams. - */ - com.google.storage.v2.CommonRequestParams getCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetNotificationRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetNotificationRequest.java deleted file mode 100644 index bc6384546d..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetNotificationRequest.java +++ /dev/null @@ -1,662 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request message for GetNotification.
- * 
- * - * Protobuf type {@code google.storage.v2.GetNotificationRequest} - */ -public final class GetNotificationRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.GetNotificationRequest) - GetNotificationRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use GetNotificationRequest.newBuilder() to construct. - private GetNotificationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private GetNotificationRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new GetNotificationRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private GetNotificationRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetNotificationRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetNotificationRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.GetNotificationRequest.class, - com.google.storage.v2.GetNotificationRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * - * - *
-   * Required. The parent bucket of the notification.
-   * Format:
-   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The parent bucket of the notification.
-   * Format:
-   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.GetNotificationRequest)) { - return super.equals(obj); - } - com.google.storage.v2.GetNotificationRequest other = - (com.google.storage.v2.GetNotificationRequest) obj; - - if (!getName().equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.GetNotificationRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.GetNotificationRequest 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.GetNotificationRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.GetNotificationRequest 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.GetNotificationRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.GetNotificationRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.GetNotificationRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.GetNotificationRequest 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.GetNotificationRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.GetNotificationRequest 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.GetNotificationRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.GetNotificationRequest 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.GetNotificationRequest 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 GetNotification.
-   * 
- * - * Protobuf type {@code google.storage.v2.GetNotificationRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.GetNotificationRequest) - com.google.storage.v2.GetNotificationRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetNotificationRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetNotificationRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.GetNotificationRequest.class, - com.google.storage.v2.GetNotificationRequest.Builder.class); - } - - // Construct using com.google.storage.v2.GetNotificationRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetNotificationRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.GetNotificationRequest getDefaultInstanceForType() { - return com.google.storage.v2.GetNotificationRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.GetNotificationRequest build() { - com.google.storage.v2.GetNotificationRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.GetNotificationRequest buildPartial() { - com.google.storage.v2.GetNotificationRequest result = - new com.google.storage.v2.GetNotificationRequest(this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.GetNotificationRequest) { - return mergeFrom((com.google.storage.v2.GetNotificationRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.GetNotificationRequest other) { - if (other == com.google.storage.v2.GetNotificationRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.GetNotificationRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.GetNotificationRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * Required. The parent bucket of the notification.
-     * Format:
-     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The parent bucket of the notification.
-     * Format:
-     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The parent bucket of the notification.
-     * Format:
-     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The parent bucket of the notification.
-     * Format:
-     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The parent bucket of the notification.
-     * Format:
-     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.GetNotificationRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.GetNotificationRequest) - private static final com.google.storage.v2.GetNotificationRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.GetNotificationRequest(); - } - - public static com.google.storage.v2.GetNotificationRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GetNotificationRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GetNotificationRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.GetNotificationRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetNotificationRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetNotificationRequestOrBuilder.java deleted file mode 100644 index 1eeafdbd59..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetNotificationRequestOrBuilder.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface GetNotificationRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.GetNotificationRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The parent bucket of the notification.
-   * Format:
-   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-   * Required. The parent bucket of the notification.
-   * Format:
-   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetObjectRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetObjectRequest.java deleted file mode 100644 index 12ea3e0b13..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetObjectRequest.java +++ /dev/null @@ -1,2345 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request message for GetObject.
- * 
- * - * Protobuf type {@code google.storage.v2.GetObjectRequest} - */ -public final class GetObjectRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.GetObjectRequest) - GetObjectRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use GetObjectRequest.newBuilder() to construct. - private GetObjectRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private GetObjectRequest() { - bucket_ = ""; - object_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new GetObjectRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private GetObjectRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - bucket_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - object_ = s; - break; - } - case 24: - { - generation_ = input.readInt64(); - break; - } - case 32: - { - bitField0_ |= 0x00000001; - ifGenerationMatch_ = input.readInt64(); - break; - } - case 40: - { - bitField0_ |= 0x00000002; - ifGenerationNotMatch_ = input.readInt64(); - break; - } - case 48: - { - bitField0_ |= 0x00000004; - ifMetagenerationMatch_ = input.readInt64(); - break; - } - case 56: - { - bitField0_ |= 0x00000008; - ifMetagenerationNotMatch_ = input.readInt64(); - break; - } - case 66: - { - com.google.storage.v2.CommonObjectRequestParams.Builder subBuilder = null; - if (commonObjectRequestParams_ != null) { - subBuilder = commonObjectRequestParams_.toBuilder(); - } - commonObjectRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonObjectRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonObjectRequestParams_); - commonObjectRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - case 74: - { - com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; - if (commonRequestParams_ != null) { - subBuilder = commonRequestParams_.toBuilder(); - } - commonRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonRequestParams_); - commonRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - case 82: - { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (((bitField0_ & 0x00000010) != 0)) { - subBuilder = readMask_.toBuilder(); - } - readMask_ = - input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(readMask_); - readMask_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000010; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetObjectRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetObjectRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.GetObjectRequest.class, - com.google.storage.v2.GetObjectRequest.Builder.class); - } - - private int bitField0_; - public static final int BUCKET_FIELD_NUMBER = 1; - private volatile java.lang.Object bucket_; - /** - * - * - *
-   * Required. Name of the bucket in which the object resides.
-   * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @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. Name of the bucket in which the object resides.
-   * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for bucket. - */ - @java.lang.Override - public com.google.protobuf.ByteString getBucketBytes() { - java.lang.Object ref = bucket_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - bucket_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int OBJECT_FIELD_NUMBER = 2; - private volatile java.lang.Object object_; - /** - * - * - *
-   * Required. Name of the object.
-   * 
- * - * 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. Name of the object.
-   * 
- * - * 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_; - /** - * - * - *
-   * 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_; - /** - * - * - *
-   * 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_; - /** - * - * - *
-   * Makes the operation conditional on whether the object's current generation
-   * does not match the given value. If no live object exists, the precondition
-   * fails. Setting to 0 makes the operation succeed only if there is a live
-   * version of the object.
-   * 
- * - * optional int64 if_generation_not_match = 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 current generation
-   * does not match the given value. If no live object exists, the precondition
-   * fails. Setting to 0 makes the operation succeed only if there is a live
-   * version of the object.
-   * 
- * - * optional int64 if_generation_not_match = 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_; - /** - * - * - *
-   * 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_; - /** - * - * - *
-   * 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 commonObjectRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - * - * @return The commonObjectRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { - return commonObjectRequestParams_ == null - ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() - : commonObjectRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - @java.lang.Override - public com.google.storage.v2.CommonObjectRequestParamsOrBuilder - getCommonObjectRequestParamsOrBuilder() { - return getCommonObjectRequestParams(); - } - - public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 9; - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return Whether the commonRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonRequestParams() { - return commonRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return The commonRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - return getCommonRequestParams(); - } - - public static final int READ_MASK_FIELD_NUMBER = 10; - private com.google.protobuf.FieldMask readMask_; - /** - * - * - *
-   * Mask specifying which fields to read.
-   * If no mask is specified, will default to all fields except metadata.acl and
-   * metadata.owner.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 10; - * - * @return Whether the readMask field is set. - */ - @java.lang.Override - public boolean hasReadMask() { - return ((bitField0_ & 0x00000010) != 0); - } - /** - * - * - *
-   * Mask specifying which fields to read.
-   * If no mask is specified, will default to all fields except metadata.acl and
-   * metadata.owner.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 10; - * - * @return The readMask. - */ - @java.lang.Override - public com.google.protobuf.FieldMask getReadMask() { - return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; - } - /** - * - * - *
-   * Mask specifying which fields to read.
-   * If no mask is specified, will default to all fields except metadata.acl and
-   * metadata.owner.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 10; - */ - @java.lang.Override - public com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder() { - return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!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 (commonObjectRequestParams_ != null) { - output.writeMessage(8, getCommonObjectRequestParams()); - } - if (commonRequestParams_ != null) { - output.writeMessage(9, getCommonRequestParams()); - } - if (((bitField0_ & 0x00000010) != 0)) { - output.writeMessage(10, getReadMask()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucket_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, bucket_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(object_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, object_); - } - if (generation_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, generation_); - } - 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 (commonObjectRequestParams_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 8, getCommonObjectRequestParams()); - } - if (commonRequestParams_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getCommonRequestParams()); - } - if (((bitField0_ & 0x00000010) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getReadMask()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.GetObjectRequest)) { - return super.equals(obj); - } - com.google.storage.v2.GetObjectRequest other = (com.google.storage.v2.GetObjectRequest) 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 (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; - if (hasCommonRequestParams()) { - if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; - } - if (hasReadMask() != other.hasReadMask()) return false; - if (hasReadMask()) { - if (!getReadMask().equals(other.getReadMask())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + BUCKET_FIELD_NUMBER; - hash = (53 * hash) + getBucket().hashCode(); - hash = (37 * hash) + OBJECT_FIELD_NUMBER; - hash = (53 * hash) + getObject().hashCode(); - hash = (37 * hash) + GENERATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getGeneration()); - if (hasIfGenerationMatch()) { - hash = (37 * hash) + IF_GENERATION_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfGenerationMatch()); - } - if (hasIfGenerationNotMatch()) { - hash = (37 * hash) + IF_GENERATION_NOT_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfGenerationNotMatch()); - } - if (hasIfMetagenerationMatch()) { - hash = (37 * hash) + IF_METAGENERATION_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationMatch()); - } - if (hasIfMetagenerationNotMatch()) { - hash = (37 * hash) + IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationNotMatch()); - } - if (hasCommonObjectRequestParams()) { - hash = (37 * hash) + COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonObjectRequestParams().hashCode(); - } - if (hasCommonRequestParams()) { - hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonRequestParams().hashCode(); - } - if (hasReadMask()) { - hash = (37 * hash) + READ_MASK_FIELD_NUMBER; - hash = (53 * hash) + getReadMask().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.GetObjectRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.GetObjectRequest 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.GetObjectRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.GetObjectRequest 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.GetObjectRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.GetObjectRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.GetObjectRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.GetObjectRequest 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.GetObjectRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.GetObjectRequest 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.GetObjectRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.GetObjectRequest 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.GetObjectRequest 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 GetObject.
-   * 
- * - * Protobuf type {@code google.storage.v2.GetObjectRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.GetObjectRequest) - com.google.storage.v2.GetObjectRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetObjectRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetObjectRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.GetObjectRequest.class, - com.google.storage.v2.GetObjectRequest.Builder.class); - } - - // Construct using com.google.storage.v2.GetObjectRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getReadMaskFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bucket_ = ""; - - object_ = ""; - - generation_ = 0L; - - ifGenerationMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000001); - ifGenerationNotMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000002); - ifMetagenerationMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000004); - ifMetagenerationNotMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000008); - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = null; - } else { - commonObjectRequestParams_ = null; - commonObjectRequestParamsBuilder_ = null; - } - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - if (readMaskBuilder_ == null) { - readMask_ = null; - } else { - readMaskBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000010); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetObjectRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.GetObjectRequest getDefaultInstanceForType() { - return com.google.storage.v2.GetObjectRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.GetObjectRequest build() { - com.google.storage.v2.GetObjectRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.GetObjectRequest buildPartial() { - com.google.storage.v2.GetObjectRequest result = - new com.google.storage.v2.GetObjectRequest(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - result.bucket_ = bucket_; - result.object_ = object_; - result.generation_ = generation_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.ifGenerationMatch_ = ifGenerationMatch_; - to_bitField0_ |= 0x00000001; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.ifGenerationNotMatch_ = ifGenerationNotMatch_; - to_bitField0_ |= 0x00000002; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.ifMetagenerationMatch_ = ifMetagenerationMatch_; - to_bitField0_ |= 0x00000004; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.ifMetagenerationNotMatch_ = ifMetagenerationNotMatch_; - to_bitField0_ |= 0x00000008; - } - if (commonObjectRequestParamsBuilder_ == null) { - result.commonObjectRequestParams_ = commonObjectRequestParams_; - } else { - result.commonObjectRequestParams_ = commonObjectRequestParamsBuilder_.build(); - } - if (commonRequestParamsBuilder_ == null) { - result.commonRequestParams_ = commonRequestParams_; - } else { - result.commonRequestParams_ = commonRequestParamsBuilder_.build(); - } - if (((from_bitField0_ & 0x00000010) != 0)) { - if (readMaskBuilder_ == null) { - result.readMask_ = readMask_; - } else { - result.readMask_ = readMaskBuilder_.build(); - } - to_bitField0_ |= 0x00000010; - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.GetObjectRequest) { - return mergeFrom((com.google.storage.v2.GetObjectRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.GetObjectRequest other) { - if (other == com.google.storage.v2.GetObjectRequest.getDefaultInstance()) return this; - if (!other.getBucket().isEmpty()) { - bucket_ = other.bucket_; - onChanged(); - } - if (!other.getObject().isEmpty()) { - object_ = other.object_; - onChanged(); - } - if (other.getGeneration() != 0L) { - setGeneration(other.getGeneration()); - } - if (other.hasIfGenerationMatch()) { - setIfGenerationMatch(other.getIfGenerationMatch()); - } - if (other.hasIfGenerationNotMatch()) { - setIfGenerationNotMatch(other.getIfGenerationNotMatch()); - } - if (other.hasIfMetagenerationMatch()) { - setIfMetagenerationMatch(other.getIfMetagenerationMatch()); - } - if (other.hasIfMetagenerationNotMatch()) { - setIfMetagenerationNotMatch(other.getIfMetagenerationNotMatch()); - } - if (other.hasCommonObjectRequestParams()) { - mergeCommonObjectRequestParams(other.getCommonObjectRequestParams()); - } - if (other.hasCommonRequestParams()) { - mergeCommonRequestParams(other.getCommonRequestParams()); - } - if (other.hasReadMask()) { - mergeReadMask(other.getReadMask()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.GetObjectRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.GetObjectRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object bucket_ = ""; - /** - * - * - *
-     * Required. Name of the bucket in which the object resides.
-     * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @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. Name of the bucket in which the object resides.
-     * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @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. Name of the bucket in which the object resides.
-     * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bucket to set. - * @return This builder for chaining. - */ - public Builder setBucket(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - bucket_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of the bucket in which the object resides.
-     * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearBucket() { - - bucket_ = getDefaultInstance().getBucket(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of the bucket in which the object resides.
-     * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for bucket to set. - * @return This builder for chaining. - */ - public Builder setBucketBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - bucket_ = value; - onChanged(); - return this; - } - - private java.lang.Object object_ = ""; - /** - * - * - *
-     * Required. Name of the object.
-     * 
- * - * 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. Name of the object.
-     * 
- * - * 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. Name of the object.
-     * 
- * - * 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; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of the object.
-     * 
- * - * string object = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearObject() { - - object_ = getDefaultInstance().getObject(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of the object.
-     * 
- * - * 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; - onChanged(); - return this; - } - - private long generation_; - /** - * - * - *
-     * If present, selects a specific revision of this object (as opposed to the
-     * latest version, the default).
-     * 
- * - * int64 generation = 3; - * - * @return The generation. - */ - @java.lang.Override - public long getGeneration() { - return generation_; - } - /** - * - * - *
-     * If present, selects a specific revision of this object (as opposed to the
-     * latest version, the default).
-     * 
- * - * int64 generation = 3; - * - * @param value The generation to set. - * @return This builder for chaining. - */ - public Builder setGeneration(long value) { - - generation_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If present, selects a specific revision of this object (as opposed to the
-     * latest version, the default).
-     * 
- * - * int64 generation = 3; - * - * @return This builder for chaining. - */ - public Builder clearGeneration() { - - generation_ = 0L; - onChanged(); - return this; - } - - private long 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_ & 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_; - } - /** - * - * - *
-     * 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) { - bitField0_ |= 0x00000001; - ifGenerationMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * matches the given value. Setting to 0 makes the operation succeed only if
-     * there are no live versions of the object.
-     * 
- * - * optional int64 if_generation_match = 4; - * - * @return This builder for chaining. - */ - public Builder clearIfGenerationMatch() { - bitField0_ = (bitField0_ & ~0x00000001); - ifGenerationMatch_ = 0L; - onChanged(); - return this; - } - - private long ifGenerationNotMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * does not match the given value. If no live object exists, the precondition
-     * fails. Setting to 0 makes the operation succeed only if there is a live
-     * version of the object.
-     * 
- * - * 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 current generation
-     * does not match the given value. If no live object exists, the precondition
-     * fails. Setting to 0 makes the operation succeed only if there is a live
-     * version of the object.
-     * 
- * - * optional int64 if_generation_not_match = 5; - * - * @return The ifGenerationNotMatch. - */ - @java.lang.Override - public long getIfGenerationNotMatch() { - return ifGenerationNotMatch_; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * does not match the given value. If no live object exists, the precondition
-     * fails. Setting to 0 makes the operation succeed only if there is a live
-     * version of the object.
-     * 
- * - * optional int64 if_generation_not_match = 5; - * - * @param value The ifGenerationNotMatch to set. - * @return This builder for chaining. - */ - public Builder setIfGenerationNotMatch(long value) { - bitField0_ |= 0x00000002; - ifGenerationNotMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * does not match the given value. If no live object exists, the precondition
-     * fails. Setting to 0 makes the operation succeed only if there is a live
-     * version of the object.
-     * 
- * - * optional int64 if_generation_not_match = 5; - * - * @return This builder for chaining. - */ - public Builder clearIfGenerationNotMatch() { - bitField0_ = (bitField0_ & ~0x00000002); - ifGenerationNotMatch_ = 0L; - onChanged(); - return this; - } - - private long ifMetagenerationMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration matches the given value.
-     * 
- * - * 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_; - } - /** - * - * - *
-     * 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) { - bitField0_ |= 0x00000004; - ifMetagenerationMatch_ = value; - 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_ & ~0x00000004); - ifMetagenerationMatch_ = 0L; - onChanged(); - return this; - } - - private long ifMetagenerationNotMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration does not match the given value.
-     * 
- * - * 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_; - } - /** - * - * - *
-     * 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) { - bitField0_ |= 0x00000008; - ifMetagenerationNotMatch_ = value; - 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_ & ~0x00000008); - ifMetagenerationNotMatch_ = 0L; - onChanged(); - return this; - } - - private com.google.storage.v2.CommonObjectRequestParams commonObjectRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder> - commonObjectRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - * - * @return Whether the commonObjectRequestParams field is set. - */ - public boolean hasCommonObjectRequestParams() { - return commonObjectRequestParamsBuilder_ != null || commonObjectRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - * - * @return The commonObjectRequestParams. - */ - public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { - if (commonObjectRequestParamsBuilder_ == null) { - return commonObjectRequestParams_ == null - ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() - : commonObjectRequestParams_; - } else { - return commonObjectRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - public Builder setCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams value) { - if (commonObjectRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonObjectRequestParams_ = value; - onChanged(); - } else { - commonObjectRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - public Builder setCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams.Builder builderForValue) { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonObjectRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - public Builder mergeCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams value) { - if (commonObjectRequestParamsBuilder_ == null) { - if (commonObjectRequestParams_ != null) { - commonObjectRequestParams_ = - com.google.storage.v2.CommonObjectRequestParams.newBuilder(commonObjectRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonObjectRequestParams_ = value; - } - onChanged(); - } else { - commonObjectRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - public Builder clearCommonObjectRequestParams() { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = null; - onChanged(); - } else { - commonObjectRequestParams_ = null; - commonObjectRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - public com.google.storage.v2.CommonObjectRequestParams.Builder - getCommonObjectRequestParamsBuilder() { - - onChanged(); - return getCommonObjectRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - public com.google.storage.v2.CommonObjectRequestParamsOrBuilder - getCommonObjectRequestParamsOrBuilder() { - if (commonObjectRequestParamsBuilder_ != null) { - return commonObjectRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonObjectRequestParams_ == null - ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() - : commonObjectRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder> - getCommonObjectRequestParamsFieldBuilder() { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder>( - getCommonObjectRequestParams(), getParentForChildren(), isClean()); - commonObjectRequestParams_ = null; - } - return commonObjectRequestParamsBuilder_; - } - - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - commonRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return Whether the commonRequestParams field is set. - */ - public boolean hasCommonRequestParams() { - return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return The commonRequestParams. - */ - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } else { - return commonRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonRequestParams_ = value; - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public Builder setCommonRequestParams( - com.google.storage.v2.CommonRequestParams.Builder builderForValue) { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (commonRequestParams_ != null) { - commonRequestParams_ = - com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonRequestParams_ = value; - } - onChanged(); - } else { - commonRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public Builder clearCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - onChanged(); - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { - - onChanged(); - return getCommonRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - if (commonRequestParamsBuilder_ != null) { - return commonRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - getCommonRequestParamsFieldBuilder() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder>( - getCommonRequestParams(), getParentForChildren(), isClean()); - commonRequestParams_ = null; - } - return commonRequestParamsBuilder_; - } - - 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.
-     * If no mask is specified, will default to all fields except metadata.acl and
-     * metadata.owner.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 10; - * - * @return Whether the readMask field is set. - */ - public boolean hasReadMask() { - return ((bitField0_ & 0x00000010) != 0); - } - /** - * - * - *
-     * Mask specifying which fields to read.
-     * If no mask is specified, will default to all fields except metadata.acl and
-     * metadata.owner.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 10; - * - * @return The readMask. - */ - public com.google.protobuf.FieldMask getReadMask() { - if (readMaskBuilder_ == null) { - return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; - } else { - return readMaskBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Mask specifying which fields to read.
-     * If no mask is specified, will default to all fields except metadata.acl and
-     * metadata.owner.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 10; - */ - public Builder setReadMask(com.google.protobuf.FieldMask value) { - if (readMaskBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - readMask_ = value; - onChanged(); - } else { - readMaskBuilder_.setMessage(value); - } - bitField0_ |= 0x00000010; - return this; - } - /** - * - * - *
-     * Mask specifying which fields to read.
-     * If no mask is specified, will default to all fields except metadata.acl and
-     * metadata.owner.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 10; - */ - public Builder setReadMask(com.google.protobuf.FieldMask.Builder builderForValue) { - if (readMaskBuilder_ == null) { - readMask_ = builderForValue.build(); - onChanged(); - } else { - readMaskBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000010; - return this; - } - /** - * - * - *
-     * Mask specifying which fields to read.
-     * If no mask is specified, will default to all fields except metadata.acl and
-     * metadata.owner.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 10; - */ - public Builder mergeReadMask(com.google.protobuf.FieldMask value) { - if (readMaskBuilder_ == null) { - if (((bitField0_ & 0x00000010) != 0) - && readMask_ != null - && readMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { - readMask_ = - com.google.protobuf.FieldMask.newBuilder(readMask_).mergeFrom(value).buildPartial(); - } else { - readMask_ = value; - } - onChanged(); - } else { - readMaskBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000010; - return this; - } - /** - * - * - *
-     * Mask specifying which fields to read.
-     * If no mask is specified, will default to all fields except metadata.acl and
-     * metadata.owner.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 10; - */ - public Builder clearReadMask() { - if (readMaskBuilder_ == null) { - readMask_ = null; - onChanged(); - } else { - readMaskBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000010); - return this; - } - /** - * - * - *
-     * Mask specifying which fields to read.
-     * If no mask is specified, will default to all fields except metadata.acl and
-     * metadata.owner.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 10; - */ - public com.google.protobuf.FieldMask.Builder getReadMaskBuilder() { - bitField0_ |= 0x00000010; - onChanged(); - return getReadMaskFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Mask specifying which fields to read.
-     * If no mask is specified, will default to all fields except metadata.acl and
-     * metadata.owner.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 10; - */ - 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.
-     * If no mask is specified, will default to all fields except metadata.acl and
-     * metadata.owner.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 10; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder> - getReadMaskFieldBuilder() { - if (readMaskBuilder_ == null) { - readMaskBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder>( - getReadMask(), getParentForChildren(), isClean()); - readMask_ = null; - } - return readMaskBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.GetObjectRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.GetObjectRequest) - private static final com.google.storage.v2.GetObjectRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.GetObjectRequest(); - } - - public static com.google.storage.v2.GetObjectRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GetObjectRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GetObjectRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.GetObjectRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetObjectRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetObjectRequestOrBuilder.java deleted file mode 100644 index f59e97fde4..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetObjectRequestOrBuilder.java +++ /dev/null @@ -1,317 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface GetObjectRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.GetObjectRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Name of the bucket in which the object resides.
-   * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bucket. - */ - java.lang.String getBucket(); - /** - * - * - *
-   * Required. Name of the bucket in which the object resides.
-   * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for bucket. - */ - com.google.protobuf.ByteString getBucketBytes(); - - /** - * - * - *
-   * Required. Name of the object.
-   * 
- * - * string object = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The object. - */ - java.lang.String getObject(); - /** - * - * - *
-   * Required. Name of the object.
-   * 
- * - * 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 current generation
-   * does not match the given value. If no live object exists, the precondition
-   * fails. Setting to 0 makes the operation succeed only if there is a live
-   * version of the object.
-   * 
- * - * optional int64 if_generation_not_match = 5; - * - * @return Whether the ifGenerationNotMatch field is set. - */ - boolean hasIfGenerationNotMatch(); - /** - * - * - *
-   * Makes the operation conditional on whether the object's current generation
-   * does not match the given value. If no live object exists, the precondition
-   * fails. Setting to 0 makes the operation succeed only if there is a live
-   * version of the object.
-   * 
- * - * 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(); - - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return Whether the commonRequestParams field is set. - */ - boolean hasCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return The commonRequestParams. - */ - com.google.storage.v2.CommonRequestParams getCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); - - /** - * - * - *
-   * Mask specifying which fields to read.
-   * If no mask is specified, will default to all fields except metadata.acl and
-   * metadata.owner.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 10; - * - * @return Whether the readMask field is set. - */ - boolean hasReadMask(); - /** - * - * - *
-   * Mask specifying which fields to read.
-   * If no mask is specified, will default to all fields except metadata.acl and
-   * metadata.owner.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 10; - * - * @return The readMask. - */ - com.google.protobuf.FieldMask getReadMask(); - /** - * - * - *
-   * Mask specifying which fields to read.
-   * If no mask is specified, will default to all fields except metadata.acl and
-   * metadata.owner.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 10; - */ - com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetServiceAccountRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetServiceAccountRequest.java deleted file mode 100644 index 85ef498126..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetServiceAccountRequest.java +++ /dev/null @@ -1,926 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request message for GetServiceAccount.
- * 
- * - * Protobuf type {@code google.storage.v2.GetServiceAccountRequest} - */ -public final class GetServiceAccountRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.GetServiceAccountRequest) - GetServiceAccountRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use GetServiceAccountRequest.newBuilder() to construct. - private GetServiceAccountRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private GetServiceAccountRequest() { - project_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new GetServiceAccountRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private GetServiceAccountRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - project_ = s; - break; - } - case 18: - { - com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; - if (commonRequestParams_ != null) { - subBuilder = commonRequestParams_.toBuilder(); - } - commonRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonRequestParams_); - commonRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetServiceAccountRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetServiceAccountRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.GetServiceAccountRequest.class, - com.google.storage.v2.GetServiceAccountRequest.Builder.class); - } - - public static final int PROJECT_FIELD_NUMBER = 1; - private volatile java.lang.Object project_; - /** - * - * - *
-   * Required. Project ID.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - @java.lang.Override - public java.lang.String getProject() { - java.lang.Object ref = project_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - project_ = s; - return s; - } - } - /** - * - * - *
-   * Required. Project ID.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - @java.lang.Override - public com.google.protobuf.ByteString getProjectBytes() { - java.lang.Object ref = project_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - project_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 2; - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - * - * @return Whether the commonRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonRequestParams() { - return commonRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - * - * @return The commonRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - return getCommonRequestParams(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, project_); - } - if (commonRequestParams_ != null) { - output.writeMessage(2, getCommonRequestParams()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, project_); - } - if (commonRequestParams_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCommonRequestParams()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.GetServiceAccountRequest)) { - return super.equals(obj); - } - com.google.storage.v2.GetServiceAccountRequest other = - (com.google.storage.v2.GetServiceAccountRequest) obj; - - if (!getProject().equals(other.getProject())) return false; - if (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; - if (hasCommonRequestParams()) { - if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PROJECT_FIELD_NUMBER; - hash = (53 * hash) + getProject().hashCode(); - if (hasCommonRequestParams()) { - hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonRequestParams().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.GetServiceAccountRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.GetServiceAccountRequest 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.GetServiceAccountRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.GetServiceAccountRequest 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.GetServiceAccountRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.GetServiceAccountRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.GetServiceAccountRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.GetServiceAccountRequest 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.GetServiceAccountRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.GetServiceAccountRequest 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.GetServiceAccountRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.GetServiceAccountRequest 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.GetServiceAccountRequest 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 GetServiceAccount.
-   * 
- * - * Protobuf type {@code google.storage.v2.GetServiceAccountRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.GetServiceAccountRequest) - com.google.storage.v2.GetServiceAccountRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetServiceAccountRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetServiceAccountRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.GetServiceAccountRequest.class, - com.google.storage.v2.GetServiceAccountRequest.Builder.class); - } - - // Construct using com.google.storage.v2.GetServiceAccountRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - project_ = ""; - - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetServiceAccountRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.GetServiceAccountRequest getDefaultInstanceForType() { - return com.google.storage.v2.GetServiceAccountRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.GetServiceAccountRequest build() { - com.google.storage.v2.GetServiceAccountRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.GetServiceAccountRequest buildPartial() { - com.google.storage.v2.GetServiceAccountRequest result = - new com.google.storage.v2.GetServiceAccountRequest(this); - result.project_ = project_; - if (commonRequestParamsBuilder_ == null) { - result.commonRequestParams_ = commonRequestParams_; - } else { - result.commonRequestParams_ = commonRequestParamsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.GetServiceAccountRequest) { - return mergeFrom((com.google.storage.v2.GetServiceAccountRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.GetServiceAccountRequest other) { - if (other == com.google.storage.v2.GetServiceAccountRequest.getDefaultInstance()) return this; - if (!other.getProject().isEmpty()) { - project_ = other.project_; - onChanged(); - } - if (other.hasCommonRequestParams()) { - mergeCommonRequestParams(other.getCommonRequestParams()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.GetServiceAccountRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.GetServiceAccountRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object project_ = ""; - /** - * - * - *
-     * Required. Project ID.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - public java.lang.String getProject() { - java.lang.Object ref = project_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - project_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. Project ID.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - public com.google.protobuf.ByteString getProjectBytes() { - java.lang.Object ref = project_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - project_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. Project ID.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The project to set. - * @return This builder for chaining. - */ - public Builder setProject(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - project_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Project ID.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearProject() { - - project_ = getDefaultInstance().getProject(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Project ID.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for project to set. - * @return This builder for chaining. - */ - public Builder setProjectBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - project_ = value; - onChanged(); - return this; - } - - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - commonRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - * - * @return Whether the commonRequestParams field is set. - */ - public boolean hasCommonRequestParams() { - return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - * - * @return The commonRequestParams. - */ - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } else { - return commonRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - */ - public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonRequestParams_ = value; - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - */ - public Builder setCommonRequestParams( - com.google.storage.v2.CommonRequestParams.Builder builderForValue) { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - */ - public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (commonRequestParams_ != null) { - commonRequestParams_ = - com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonRequestParams_ = value; - } - onChanged(); - } else { - commonRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - */ - public Builder clearCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - onChanged(); - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - */ - public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { - - onChanged(); - return getCommonRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - */ - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - if (commonRequestParamsBuilder_ != null) { - return commonRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - getCommonRequestParamsFieldBuilder() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder>( - getCommonRequestParams(), getParentForChildren(), isClean()); - commonRequestParams_ = null; - } - return commonRequestParamsBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.GetServiceAccountRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.GetServiceAccountRequest) - private static final com.google.storage.v2.GetServiceAccountRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.GetServiceAccountRequest(); - } - - public static com.google.storage.v2.GetServiceAccountRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GetServiceAccountRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GetServiceAccountRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.GetServiceAccountRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetServiceAccountRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetServiceAccountRequestOrBuilder.java deleted file mode 100644 index 7bbca79c29..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetServiceAccountRequestOrBuilder.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface GetServiceAccountRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.GetServiceAccountRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Project ID.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - java.lang.String getProject(); - /** - * - * - *
-   * Required. Project ID.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - com.google.protobuf.ByteString getProjectBytes(); - - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - * - * @return Whether the commonRequestParams field is set. - */ - boolean hasCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - * - * @return The commonRequestParams. - */ - com.google.storage.v2.CommonRequestParams getCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - */ - com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/HmacKeyMetadata.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/HmacKeyMetadata.java deleted file mode 100644 index b299e9d27b..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/HmacKeyMetadata.java +++ /dev/null @@ -1,1892 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Hmac Key Metadata, which includes all information other than the secret.
- * 
- * - * Protobuf type {@code google.storage.v2.HmacKeyMetadata} - */ -public final class HmacKeyMetadata extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.HmacKeyMetadata) - HmacKeyMetadataOrBuilder { - private static final long serialVersionUID = 0L; - // Use HmacKeyMetadata.newBuilder() to construct. - private HmacKeyMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private HmacKeyMetadata() { - id_ = ""; - accessId_ = ""; - project_ = ""; - serviceAccountEmail_ = ""; - state_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new HmacKeyMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private HmacKeyMetadata( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - id_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - accessId_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - project_ = s; - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - - serviceAccountEmail_ = s; - break; - } - case 42: - { - java.lang.String s = input.readStringRequireUtf8(); - - state_ = s; - break; - } - case 50: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (createTime_ != null) { - subBuilder = createTime_.toBuilder(); - } - createTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(createTime_); - createTime_ = subBuilder.buildPartial(); - } - - break; - } - case 58: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (updateTime_ != null) { - subBuilder = updateTime_.toBuilder(); - } - updateTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateTime_); - updateTime_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_HmacKeyMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_HmacKeyMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.HmacKeyMetadata.class, - com.google.storage.v2.HmacKeyMetadata.Builder.class); - } - - public static final int ID_FIELD_NUMBER = 1; - private volatile java.lang.Object id_; - /** - * - * - *
-   * Resource name ID of the key in the format <projectId>/<accessId>.
-   * 
- * - * string id = 1; - * - * @return The id. - */ - @java.lang.Override - public java.lang.String getId() { - java.lang.Object ref = id_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - id_ = s; - return s; - } - } - /** - * - * - *
-   * Resource name ID of the key in the format <projectId>/<accessId>.
-   * 
- * - * string id = 1; - * - * @return The bytes for id. - */ - @java.lang.Override - public com.google.protobuf.ByteString getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - id_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ACCESS_ID_FIELD_NUMBER = 2; - private volatile java.lang.Object accessId_; - /** - * - * - *
-   * Globally unique id for keys.
-   * 
- * - * string access_id = 2; - * - * @return The accessId. - */ - @java.lang.Override - public java.lang.String getAccessId() { - java.lang.Object ref = accessId_; - 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(); - accessId_ = s; - return s; - } - } - /** - * - * - *
-   * Globally unique id for keys.
-   * 
- * - * string access_id = 2; - * - * @return The bytes for accessId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getAccessIdBytes() { - java.lang.Object ref = accessId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - accessId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PROJECT_FIELD_NUMBER = 3; - private volatile java.lang.Object project_; - /** - * - * - *
-   * The project ID that the hmac key is contained in.
-   * 
- * - * string project = 3 [(.google.api.resource_reference) = { ... } - * - * @return The project. - */ - @java.lang.Override - public java.lang.String getProject() { - java.lang.Object ref = project_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - project_ = s; - return s; - } - } - /** - * - * - *
-   * The project ID that the hmac key is contained in.
-   * 
- * - * string project = 3 [(.google.api.resource_reference) = { ... } - * - * @return The bytes for project. - */ - @java.lang.Override - public com.google.protobuf.ByteString getProjectBytes() { - java.lang.Object ref = project_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - project_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER = 4; - private volatile java.lang.Object serviceAccountEmail_; - /** - * - * - *
-   * Email of the service account the key authenticates as.
-   * 
- * - * string service_account_email = 4; - * - * @return The serviceAccountEmail. - */ - @java.lang.Override - public java.lang.String getServiceAccountEmail() { - java.lang.Object ref = serviceAccountEmail_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serviceAccountEmail_ = s; - return s; - } - } - /** - * - * - *
-   * Email of the service account the key authenticates as.
-   * 
- * - * string service_account_email = 4; - * - * @return The bytes for serviceAccountEmail. - */ - @java.lang.Override - public com.google.protobuf.ByteString getServiceAccountEmailBytes() { - java.lang.Object ref = serviceAccountEmail_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - serviceAccountEmail_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int STATE_FIELD_NUMBER = 5; - private volatile java.lang.Object state_; - /** - * - * - *
-   * State of the key. One of ACTIVE, INACTIVE, or DELETED.
-   * 
- * - * string state = 5; - * - * @return The state. - */ - @java.lang.Override - public java.lang.String getState() { - java.lang.Object ref = state_; - 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(); - state_ = s; - return s; - } - } - /** - * - * - *
-   * State of the key. One of ACTIVE, INACTIVE, or DELETED.
-   * 
- * - * string state = 5; - * - * @return The bytes for state. - */ - @java.lang.Override - public com.google.protobuf.ByteString getStateBytes() { - java.lang.Object ref = state_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - state_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CREATE_TIME_FIELD_NUMBER = 6; - private com.google.protobuf.Timestamp createTime_; - /** - * - * - *
-   * The creation time of the HMAC key in RFC 3339 format.
-   * 
- * - * .google.protobuf.Timestamp create_time = 6; - * - * @return Whether the createTime field is set. - */ - @java.lang.Override - public boolean hasCreateTime() { - return createTime_ != null; - } - /** - * - * - *
-   * The creation time of the HMAC key in RFC 3339 format.
-   * 
- * - * .google.protobuf.Timestamp create_time = 6; - * - * @return The createTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getCreateTime() { - return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; - } - /** - * - * - *
-   * The creation time of the HMAC key in RFC 3339 format.
-   * 
- * - * .google.protobuf.Timestamp create_time = 6; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { - return getCreateTime(); - } - - public static final int UPDATE_TIME_FIELD_NUMBER = 7; - private com.google.protobuf.Timestamp updateTime_; - /** - * - * - *
-   * The last modification time of the HMAC key metadata in RFC 3339 format.
-   * 
- * - * .google.protobuf.Timestamp update_time = 7; - * - * @return Whether the updateTime field is set. - */ - @java.lang.Override - public boolean hasUpdateTime() { - return updateTime_ != null; - } - /** - * - * - *
-   * The last modification time of the HMAC key metadata in RFC 3339 format.
-   * 
- * - * .google.protobuf.Timestamp update_time = 7; - * - * @return The updateTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getUpdateTime() { - return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; - } - /** - * - * - *
-   * The last modification time of the HMAC key metadata in RFC 3339 format.
-   * 
- * - * .google.protobuf.Timestamp update_time = 7; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { - return getUpdateTime(); - } - - 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(id_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(accessId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, accessId_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, project_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, serviceAccountEmail_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(state_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, state_); - } - if (createTime_ != null) { - output.writeMessage(6, getCreateTime()); - } - if (updateTime_ != null) { - output.writeMessage(7, getUpdateTime()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(accessId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, accessId_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, project_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, serviceAccountEmail_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(state_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, state_); - } - if (createTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getCreateTime()); - } - if (updateTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getUpdateTime()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.HmacKeyMetadata)) { - return super.equals(obj); - } - com.google.storage.v2.HmacKeyMetadata other = (com.google.storage.v2.HmacKeyMetadata) obj; - - if (!getId().equals(other.getId())) return false; - if (!getAccessId().equals(other.getAccessId())) return false; - if (!getProject().equals(other.getProject())) return false; - if (!getServiceAccountEmail().equals(other.getServiceAccountEmail())) return false; - if (!getState().equals(other.getState())) return false; - if (hasCreateTime() != other.hasCreateTime()) return false; - if (hasCreateTime()) { - if (!getCreateTime().equals(other.getCreateTime())) return false; - } - if (hasUpdateTime() != other.hasUpdateTime()) return false; - if (hasUpdateTime()) { - if (!getUpdateTime().equals(other.getUpdateTime())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ID_FIELD_NUMBER; - hash = (53 * hash) + getId().hashCode(); - hash = (37 * hash) + ACCESS_ID_FIELD_NUMBER; - hash = (53 * hash) + getAccessId().hashCode(); - hash = (37 * hash) + PROJECT_FIELD_NUMBER; - hash = (53 * hash) + getProject().hashCode(); - hash = (37 * hash) + SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER; - hash = (53 * hash) + getServiceAccountEmail().hashCode(); - hash = (37 * hash) + STATE_FIELD_NUMBER; - hash = (53 * hash) + getState().hashCode(); - if (hasCreateTime()) { - hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getCreateTime().hashCode(); - } - if (hasUpdateTime()) { - hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getUpdateTime().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.HmacKeyMetadata parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.HmacKeyMetadata 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.HmacKeyMetadata parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.HmacKeyMetadata 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.HmacKeyMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.HmacKeyMetadata parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.HmacKeyMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.HmacKeyMetadata 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.HmacKeyMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.HmacKeyMetadata 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.HmacKeyMetadata parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.HmacKeyMetadata 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.HmacKeyMetadata 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; - } - /** - * - * - *
-   * Hmac Key Metadata, which includes all information other than the secret.
-   * 
- * - * Protobuf type {@code google.storage.v2.HmacKeyMetadata} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.HmacKeyMetadata) - com.google.storage.v2.HmacKeyMetadataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_HmacKeyMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_HmacKeyMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.HmacKeyMetadata.class, - com.google.storage.v2.HmacKeyMetadata.Builder.class); - } - - // Construct using com.google.storage.v2.HmacKeyMetadata.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - id_ = ""; - - accessId_ = ""; - - project_ = ""; - - serviceAccountEmail_ = ""; - - state_ = ""; - - if (createTimeBuilder_ == null) { - createTime_ = null; - } else { - createTime_ = null; - createTimeBuilder_ = null; - } - if (updateTimeBuilder_ == null) { - updateTime_ = null; - } else { - updateTime_ = null; - updateTimeBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_HmacKeyMetadata_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.HmacKeyMetadata getDefaultInstanceForType() { - return com.google.storage.v2.HmacKeyMetadata.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.HmacKeyMetadata build() { - com.google.storage.v2.HmacKeyMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.HmacKeyMetadata buildPartial() { - com.google.storage.v2.HmacKeyMetadata result = - new com.google.storage.v2.HmacKeyMetadata(this); - result.id_ = id_; - result.accessId_ = accessId_; - result.project_ = project_; - result.serviceAccountEmail_ = serviceAccountEmail_; - result.state_ = state_; - if (createTimeBuilder_ == null) { - result.createTime_ = createTime_; - } else { - result.createTime_ = createTimeBuilder_.build(); - } - if (updateTimeBuilder_ == null) { - result.updateTime_ = updateTime_; - } else { - result.updateTime_ = updateTimeBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.HmacKeyMetadata) { - return mergeFrom((com.google.storage.v2.HmacKeyMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.HmacKeyMetadata other) { - if (other == com.google.storage.v2.HmacKeyMetadata.getDefaultInstance()) return this; - if (!other.getId().isEmpty()) { - id_ = other.id_; - onChanged(); - } - if (!other.getAccessId().isEmpty()) { - accessId_ = other.accessId_; - onChanged(); - } - if (!other.getProject().isEmpty()) { - project_ = other.project_; - onChanged(); - } - if (!other.getServiceAccountEmail().isEmpty()) { - serviceAccountEmail_ = other.serviceAccountEmail_; - onChanged(); - } - if (!other.getState().isEmpty()) { - state_ = other.state_; - onChanged(); - } - if (other.hasCreateTime()) { - mergeCreateTime(other.getCreateTime()); - } - if (other.hasUpdateTime()) { - mergeUpdateTime(other.getUpdateTime()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.HmacKeyMetadata parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.HmacKeyMetadata) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object id_ = ""; - /** - * - * - *
-     * Resource name ID of the key in the format <projectId>/<accessId>.
-     * 
- * - * string id = 1; - * - * @return The id. - */ - public java.lang.String getId() { - java.lang.Object ref = id_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - id_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Resource name ID of the key in the format <projectId>/<accessId>.
-     * 
- * - * string id = 1; - * - * @return The bytes for id. - */ - public com.google.protobuf.ByteString getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - id_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Resource name ID of the key in the format <projectId>/<accessId>.
-     * 
- * - * string id = 1; - * - * @param value The id to set. - * @return This builder for chaining. - */ - public Builder setId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - id_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Resource name ID of the key in the format <projectId>/<accessId>.
-     * 
- * - * string id = 1; - * - * @return This builder for chaining. - */ - public Builder clearId() { - - id_ = getDefaultInstance().getId(); - onChanged(); - return this; - } - /** - * - * - *
-     * Resource name ID of the key in the format <projectId>/<accessId>.
-     * 
- * - * string id = 1; - * - * @param value The bytes for id to set. - * @return This builder for chaining. - */ - public Builder setIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - id_ = value; - onChanged(); - return this; - } - - private java.lang.Object accessId_ = ""; - /** - * - * - *
-     * Globally unique id for keys.
-     * 
- * - * string access_id = 2; - * - * @return The accessId. - */ - public java.lang.String getAccessId() { - java.lang.Object ref = accessId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - accessId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Globally unique id for keys.
-     * 
- * - * string access_id = 2; - * - * @return The bytes for accessId. - */ - public com.google.protobuf.ByteString getAccessIdBytes() { - java.lang.Object ref = accessId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - accessId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Globally unique id for keys.
-     * 
- * - * string access_id = 2; - * - * @param value The accessId to set. - * @return This builder for chaining. - */ - public Builder setAccessId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - accessId_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Globally unique id for keys.
-     * 
- * - * string access_id = 2; - * - * @return This builder for chaining. - */ - public Builder clearAccessId() { - - accessId_ = getDefaultInstance().getAccessId(); - onChanged(); - return this; - } - /** - * - * - *
-     * Globally unique id for keys.
-     * 
- * - * string access_id = 2; - * - * @param value The bytes for accessId to set. - * @return This builder for chaining. - */ - public Builder setAccessIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - accessId_ = value; - onChanged(); - return this; - } - - private java.lang.Object project_ = ""; - /** - * - * - *
-     * The project ID that the hmac key is contained in.
-     * 
- * - * string project = 3 [(.google.api.resource_reference) = { ... } - * - * @return The project. - */ - public java.lang.String getProject() { - java.lang.Object ref = project_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - project_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The project ID that the hmac key is contained in.
-     * 
- * - * string project = 3 [(.google.api.resource_reference) = { ... } - * - * @return The bytes for project. - */ - public com.google.protobuf.ByteString getProjectBytes() { - java.lang.Object ref = project_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - project_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The project ID that the hmac key is contained in.
-     * 
- * - * string project = 3 [(.google.api.resource_reference) = { ... } - * - * @param value The project to set. - * @return This builder for chaining. - */ - public Builder setProject(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - project_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The project ID that the hmac key is contained in.
-     * 
- * - * string project = 3 [(.google.api.resource_reference) = { ... } - * - * @return This builder for chaining. - */ - public Builder clearProject() { - - project_ = getDefaultInstance().getProject(); - onChanged(); - return this; - } - /** - * - * - *
-     * The project ID that the hmac key is contained in.
-     * 
- * - * string project = 3 [(.google.api.resource_reference) = { ... } - * - * @param value The bytes for project to set. - * @return This builder for chaining. - */ - public Builder setProjectBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - project_ = value; - onChanged(); - return this; - } - - private java.lang.Object serviceAccountEmail_ = ""; - /** - * - * - *
-     * Email of the service account the key authenticates as.
-     * 
- * - * string service_account_email = 4; - * - * @return The serviceAccountEmail. - */ - public java.lang.String getServiceAccountEmail() { - java.lang.Object ref = serviceAccountEmail_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serviceAccountEmail_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Email of the service account the key authenticates as.
-     * 
- * - * string service_account_email = 4; - * - * @return The bytes for serviceAccountEmail. - */ - public com.google.protobuf.ByteString getServiceAccountEmailBytes() { - java.lang.Object ref = serviceAccountEmail_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - serviceAccountEmail_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Email of the service account the key authenticates as.
-     * 
- * - * string service_account_email = 4; - * - * @param value The serviceAccountEmail to set. - * @return This builder for chaining. - */ - public Builder setServiceAccountEmail(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - serviceAccountEmail_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Email of the service account the key authenticates as.
-     * 
- * - * string service_account_email = 4; - * - * @return This builder for chaining. - */ - public Builder clearServiceAccountEmail() { - - serviceAccountEmail_ = getDefaultInstance().getServiceAccountEmail(); - onChanged(); - return this; - } - /** - * - * - *
-     * Email of the service account the key authenticates as.
-     * 
- * - * string service_account_email = 4; - * - * @param value The bytes for serviceAccountEmail to set. - * @return This builder for chaining. - */ - public Builder setServiceAccountEmailBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - serviceAccountEmail_ = value; - onChanged(); - return this; - } - - private java.lang.Object state_ = ""; - /** - * - * - *
-     * State of the key. One of ACTIVE, INACTIVE, or DELETED.
-     * 
- * - * string state = 5; - * - * @return The state. - */ - public java.lang.String getState() { - java.lang.Object ref = state_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - state_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * State of the key. One of ACTIVE, INACTIVE, or DELETED.
-     * 
- * - * string state = 5; - * - * @return The bytes for state. - */ - public com.google.protobuf.ByteString getStateBytes() { - java.lang.Object ref = state_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - state_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * State of the key. One of ACTIVE, INACTIVE, or DELETED.
-     * 
- * - * string state = 5; - * - * @param value The state to set. - * @return This builder for chaining. - */ - public Builder setState(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - state_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * State of the key. One of ACTIVE, INACTIVE, or DELETED.
-     * 
- * - * string state = 5; - * - * @return This builder for chaining. - */ - public Builder clearState() { - - state_ = getDefaultInstance().getState(); - onChanged(); - return this; - } - /** - * - * - *
-     * State of the key. One of ACTIVE, INACTIVE, or DELETED.
-     * 
- * - * string state = 5; - * - * @param value The bytes for state to set. - * @return This builder for chaining. - */ - public Builder setStateBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - state_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.Timestamp createTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - createTimeBuilder_; - /** - * - * - *
-     * The creation time of the HMAC key in RFC 3339 format.
-     * 
- * - * .google.protobuf.Timestamp create_time = 6; - * - * @return Whether the createTime field is set. - */ - public boolean hasCreateTime() { - return createTimeBuilder_ != null || createTime_ != null; - } - /** - * - * - *
-     * The creation time of the HMAC key in RFC 3339 format.
-     * 
- * - * .google.protobuf.Timestamp create_time = 6; - * - * @return The createTime. - */ - public com.google.protobuf.Timestamp getCreateTime() { - if (createTimeBuilder_ == null) { - return createTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : createTime_; - } else { - return createTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The creation time of the HMAC key in RFC 3339 format.
-     * 
- * - * .google.protobuf.Timestamp create_time = 6; - */ - public Builder setCreateTime(com.google.protobuf.Timestamp value) { - if (createTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - createTime_ = value; - onChanged(); - } else { - createTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * The creation time of the HMAC key in RFC 3339 format.
-     * 
- * - * .google.protobuf.Timestamp create_time = 6; - */ - public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (createTimeBuilder_ == null) { - createTime_ = builderForValue.build(); - onChanged(); - } else { - createTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * The creation time of the HMAC key in RFC 3339 format.
-     * 
- * - * .google.protobuf.Timestamp create_time = 6; - */ - public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { - if (createTimeBuilder_ == null) { - if (createTime_ != null) { - createTime_ = - com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); - } else { - createTime_ = value; - } - onChanged(); - } else { - createTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * The creation time of the HMAC key in RFC 3339 format.
-     * 
- * - * .google.protobuf.Timestamp create_time = 6; - */ - public Builder clearCreateTime() { - if (createTimeBuilder_ == null) { - createTime_ = null; - onChanged(); - } else { - createTime_ = null; - createTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * The creation time of the HMAC key in RFC 3339 format.
-     * 
- * - * .google.protobuf.Timestamp create_time = 6; - */ - public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { - - onChanged(); - return getCreateTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The creation time of the HMAC key in RFC 3339 format.
-     * 
- * - * .google.protobuf.Timestamp create_time = 6; - */ - public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { - if (createTimeBuilder_ != null) { - return createTimeBuilder_.getMessageOrBuilder(); - } else { - return createTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : createTime_; - } - } - /** - * - * - *
-     * The creation time of the HMAC key in RFC 3339 format.
-     * 
- * - * .google.protobuf.Timestamp create_time = 6; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getCreateTimeFieldBuilder() { - if (createTimeBuilder_ == null) { - createTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getCreateTime(), getParentForChildren(), isClean()); - createTime_ = null; - } - return createTimeBuilder_; - } - - private com.google.protobuf.Timestamp updateTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - updateTimeBuilder_; - /** - * - * - *
-     * The last modification time of the HMAC key metadata in RFC 3339 format.
-     * 
- * - * .google.protobuf.Timestamp update_time = 7; - * - * @return Whether the updateTime field is set. - */ - public boolean hasUpdateTime() { - return updateTimeBuilder_ != null || updateTime_ != null; - } - /** - * - * - *
-     * The last modification time of the HMAC key metadata in RFC 3339 format.
-     * 
- * - * .google.protobuf.Timestamp update_time = 7; - * - * @return The updateTime. - */ - public com.google.protobuf.Timestamp getUpdateTime() { - if (updateTimeBuilder_ == null) { - return updateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : updateTime_; - } else { - return updateTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The last modification time of the HMAC key metadata in RFC 3339 format.
-     * 
- * - * .google.protobuf.Timestamp update_time = 7; - */ - public Builder setUpdateTime(com.google.protobuf.Timestamp value) { - if (updateTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - updateTime_ = value; - onChanged(); - } else { - updateTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * The last modification time of the HMAC key metadata in RFC 3339 format.
-     * 
- * - * .google.protobuf.Timestamp update_time = 7; - */ - public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (updateTimeBuilder_ == null) { - updateTime_ = builderForValue.build(); - onChanged(); - } else { - updateTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * The last modification time of the HMAC key metadata in RFC 3339 format.
-     * 
- * - * .google.protobuf.Timestamp update_time = 7; - */ - public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { - if (updateTimeBuilder_ == null) { - if (updateTime_ != null) { - updateTime_ = - com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); - } else { - updateTime_ = value; - } - onChanged(); - } else { - updateTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * The last modification time of the HMAC key metadata in RFC 3339 format.
-     * 
- * - * .google.protobuf.Timestamp update_time = 7; - */ - public Builder clearUpdateTime() { - if (updateTimeBuilder_ == null) { - updateTime_ = null; - onChanged(); - } else { - updateTime_ = null; - updateTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * The last modification time of the HMAC key metadata in RFC 3339 format.
-     * 
- * - * .google.protobuf.Timestamp update_time = 7; - */ - public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { - - onChanged(); - return getUpdateTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The last modification time of the HMAC key metadata in RFC 3339 format.
-     * 
- * - * .google.protobuf.Timestamp update_time = 7; - */ - public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { - if (updateTimeBuilder_ != null) { - return updateTimeBuilder_.getMessageOrBuilder(); - } else { - return updateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : updateTime_; - } - } - /** - * - * - *
-     * The last modification time of the HMAC key metadata in RFC 3339 format.
-     * 
- * - * .google.protobuf.Timestamp update_time = 7; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getUpdateTimeFieldBuilder() { - if (updateTimeBuilder_ == null) { - updateTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getUpdateTime(), getParentForChildren(), isClean()); - updateTime_ = null; - } - return updateTimeBuilder_; - } - - @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.HmacKeyMetadata) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.HmacKeyMetadata) - private static final com.google.storage.v2.HmacKeyMetadata DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.HmacKeyMetadata(); - } - - public static com.google.storage.v2.HmacKeyMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public HmacKeyMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new HmacKeyMetadata(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.HmacKeyMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/HmacKeyMetadataOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/HmacKeyMetadataOrBuilder.java deleted file mode 100644 index ef39ff394f..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/HmacKeyMetadataOrBuilder.java +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface HmacKeyMetadataOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.HmacKeyMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Resource name ID of the key in the format <projectId>/<accessId>.
-   * 
- * - * string id = 1; - * - * @return The id. - */ - java.lang.String getId(); - /** - * - * - *
-   * Resource name ID of the key in the format <projectId>/<accessId>.
-   * 
- * - * string id = 1; - * - * @return The bytes for id. - */ - com.google.protobuf.ByteString getIdBytes(); - - /** - * - * - *
-   * Globally unique id for keys.
-   * 
- * - * string access_id = 2; - * - * @return The accessId. - */ - java.lang.String getAccessId(); - /** - * - * - *
-   * Globally unique id for keys.
-   * 
- * - * string access_id = 2; - * - * @return The bytes for accessId. - */ - com.google.protobuf.ByteString getAccessIdBytes(); - - /** - * - * - *
-   * The project ID that the hmac key is contained in.
-   * 
- * - * string project = 3 [(.google.api.resource_reference) = { ... } - * - * @return The project. - */ - java.lang.String getProject(); - /** - * - * - *
-   * The project ID that the hmac key is contained in.
-   * 
- * - * string project = 3 [(.google.api.resource_reference) = { ... } - * - * @return The bytes for project. - */ - com.google.protobuf.ByteString getProjectBytes(); - - /** - * - * - *
-   * Email of the service account the key authenticates as.
-   * 
- * - * string service_account_email = 4; - * - * @return The serviceAccountEmail. - */ - java.lang.String getServiceAccountEmail(); - /** - * - * - *
-   * Email of the service account the key authenticates as.
-   * 
- * - * string service_account_email = 4; - * - * @return The bytes for serviceAccountEmail. - */ - com.google.protobuf.ByteString getServiceAccountEmailBytes(); - - /** - * - * - *
-   * State of the key. One of ACTIVE, INACTIVE, or DELETED.
-   * 
- * - * string state = 5; - * - * @return The state. - */ - java.lang.String getState(); - /** - * - * - *
-   * State of the key. One of ACTIVE, INACTIVE, or DELETED.
-   * 
- * - * string state = 5; - * - * @return The bytes for state. - */ - com.google.protobuf.ByteString getStateBytes(); - - /** - * - * - *
-   * The creation time of the HMAC key in RFC 3339 format.
-   * 
- * - * .google.protobuf.Timestamp create_time = 6; - * - * @return Whether the createTime field is set. - */ - boolean hasCreateTime(); - /** - * - * - *
-   * The creation time of the HMAC key in RFC 3339 format.
-   * 
- * - * .google.protobuf.Timestamp create_time = 6; - * - * @return The createTime. - */ - com.google.protobuf.Timestamp getCreateTime(); - /** - * - * - *
-   * The creation time of the HMAC key in RFC 3339 format.
-   * 
- * - * .google.protobuf.Timestamp create_time = 6; - */ - com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); - - /** - * - * - *
-   * The last modification time of the HMAC key metadata in RFC 3339 format.
-   * 
- * - * .google.protobuf.Timestamp update_time = 7; - * - * @return Whether the updateTime field is set. - */ - boolean hasUpdateTime(); - /** - * - * - *
-   * The last modification time of the HMAC key metadata in RFC 3339 format.
-   * 
- * - * .google.protobuf.Timestamp update_time = 7; - * - * @return The updateTime. - */ - com.google.protobuf.Timestamp getUpdateTime(); - /** - * - * - *
-   * The last modification time of the HMAC key metadata in RFC 3339 format.
-   * 
- * - * .google.protobuf.Timestamp update_time = 7; - */ - com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListBucketsRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListBucketsRequest.java deleted file mode 100644 index f28a6b0355..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListBucketsRequest.java +++ /dev/null @@ -1,1709 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request message for ListBuckets.
- * 
- * - * Protobuf type {@code google.storage.v2.ListBucketsRequest} - */ -public final class ListBucketsRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.ListBucketsRequest) - ListBucketsRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListBucketsRequest.newBuilder() to construct. - private ListBucketsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListBucketsRequest() { - parent_ = ""; - pageToken_ = ""; - prefix_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListBucketsRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ListBucketsRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 16: - { - pageSize_ = input.readInt32(); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - - prefix_ = s; - break; - } - case 42: - { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) != 0)) { - subBuilder = readMask_.toBuilder(); - } - readMask_ = - input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(readMask_); - readMask_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - case 50: - { - com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; - if (commonRequestParams_ != null) { - subBuilder = commonRequestParams_.toBuilder(); - } - commonRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonRequestParams_); - commonRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListBucketsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListBucketsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ListBucketsRequest.class, - com.google.storage.v2.ListBucketsRequest.Builder.class); - } - - private int bitField0_; - public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; - /** - * - * - *
-   * Required. The project whose buckets we are listing.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - @java.lang.Override - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The project whose buckets we are listing.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - @java.lang.Override - public com.google.protobuf.ByteString getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 2; - private int pageSize_; - /** - * - * - *
-   * Maximum number of buckets to return in a single response. The service will
-   * use this parameter or 1,000 items, whichever is smaller. If "acl" is
-   * present in the read_mask, the service will use this parameter of 200 items,
-   * whichever is smaller.
-   * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 3; - private volatile java.lang.Object pageToken_; - /** - * - * - *
-   * A previously-returned page token representing part of the larger set of
-   * results to view.
-   * 
- * - * string page_token = 3; - * - * @return The pageToken. - */ - @java.lang.Override - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } - } - /** - * - * - *
-   * A previously-returned page token representing part of the larger set of
-   * results to view.
-   * 
- * - * string page_token = 3; - * - * @return The bytes for pageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PREFIX_FIELD_NUMBER = 4; - private volatile java.lang.Object prefix_; - /** - * - * - *
-   * Filter results to buckets whose names begin with this prefix.
-   * 
- * - * string prefix = 4; - * - * @return The prefix. - */ - @java.lang.Override - public java.lang.String getPrefix() { - java.lang.Object ref = prefix_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - prefix_ = s; - return s; - } - } - /** - * - * - *
-   * Filter results to buckets whose names begin with this prefix.
-   * 
- * - * string prefix = 4; - * - * @return The bytes for prefix. - */ - @java.lang.Override - public com.google.protobuf.ByteString getPrefixBytes() { - java.lang.Object ref = prefix_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - prefix_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int READ_MASK_FIELD_NUMBER = 5; - private com.google.protobuf.FieldMask readMask_; - /** - * - * - *
-   * Mask specifying which fields to read from each result.
-   * If no mask is specified, will default to all fields except items.owner,
-   * items.acl, and items.default_object_acl.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - * - * @return Whether the readMask field is set. - */ - @java.lang.Override - public boolean hasReadMask() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-   * Mask specifying which fields to read from each result.
-   * If no mask is specified, will default to all fields except items.owner,
-   * items.acl, and items.default_object_acl.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - * - * @return The readMask. - */ - @java.lang.Override - public com.google.protobuf.FieldMask getReadMask() { - return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; - } - /** - * - * - *
-   * Mask specifying which fields to read from each result.
-   * If no mask is specified, will default to all fields except items.owner,
-   * items.acl, and items.default_object_acl.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - */ - @java.lang.Override - public com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder() { - return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; - } - - public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 6; - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 6; - * - * @return Whether the commonRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonRequestParams() { - return commonRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 6; - * - * @return The commonRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 6; - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - return getCommonRequestParams(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); - } - if (pageSize_ != 0) { - output.writeInt32(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(prefix_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, prefix_); - } - if (((bitField0_ & 0x00000001) != 0)) { - output.writeMessage(5, getReadMask()); - } - if (commonRequestParams_ != null) { - output.writeMessage(6, getCommonRequestParams()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); - } - if (pageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(prefix_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, prefix_); - } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getReadMask()); - } - if (commonRequestParams_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getCommonRequestParams()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.ListBucketsRequest)) { - return super.equals(obj); - } - com.google.storage.v2.ListBucketsRequest other = (com.google.storage.v2.ListBucketsRequest) obj; - - if (!getParent().equals(other.getParent())) return false; - if (getPageSize() != other.getPageSize()) return false; - if (!getPageToken().equals(other.getPageToken())) return false; - if (!getPrefix().equals(other.getPrefix())) return false; - if (hasReadMask() != other.hasReadMask()) return false; - if (hasReadMask()) { - if (!getReadMask().equals(other.getReadMask())) return false; - } - if (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; - if (hasCommonRequestParams()) { - if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PARENT_FIELD_NUMBER; - hash = (53 * hash) + getParent().hashCode(); - hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getPageSize(); - hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getPageToken().hashCode(); - hash = (37 * hash) + PREFIX_FIELD_NUMBER; - hash = (53 * hash) + getPrefix().hashCode(); - if (hasReadMask()) { - hash = (37 * hash) + READ_MASK_FIELD_NUMBER; - hash = (53 * hash) + getReadMask().hashCode(); - } - if (hasCommonRequestParams()) { - hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonRequestParams().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.ListBucketsRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListBucketsRequest 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.ListBucketsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListBucketsRequest 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.ListBucketsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListBucketsRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ListBucketsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListBucketsRequest 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.ListBucketsRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListBucketsRequest 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.ListBucketsRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListBucketsRequest 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.ListBucketsRequest 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 ListBuckets.
-   * 
- * - * Protobuf type {@code google.storage.v2.ListBucketsRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.ListBucketsRequest) - com.google.storage.v2.ListBucketsRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListBucketsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListBucketsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ListBucketsRequest.class, - com.google.storage.v2.ListBucketsRequest.Builder.class); - } - - // Construct using com.google.storage.v2.ListBucketsRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getReadMaskFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - parent_ = ""; - - pageSize_ = 0; - - pageToken_ = ""; - - prefix_ = ""; - - if (readMaskBuilder_ == null) { - readMask_ = null; - } else { - readMaskBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListBucketsRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.ListBucketsRequest getDefaultInstanceForType() { - return com.google.storage.v2.ListBucketsRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.ListBucketsRequest build() { - com.google.storage.v2.ListBucketsRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.ListBucketsRequest buildPartial() { - com.google.storage.v2.ListBucketsRequest result = - new com.google.storage.v2.ListBucketsRequest(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - result.parent_ = parent_; - result.pageSize_ = pageSize_; - result.pageToken_ = pageToken_; - result.prefix_ = prefix_; - if (((from_bitField0_ & 0x00000001) != 0)) { - if (readMaskBuilder_ == null) { - result.readMask_ = readMask_; - } else { - result.readMask_ = readMaskBuilder_.build(); - } - to_bitField0_ |= 0x00000001; - } - if (commonRequestParamsBuilder_ == null) { - result.commonRequestParams_ = commonRequestParams_; - } else { - result.commonRequestParams_ = commonRequestParamsBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.ListBucketsRequest) { - return mergeFrom((com.google.storage.v2.ListBucketsRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.ListBucketsRequest other) { - if (other == com.google.storage.v2.ListBucketsRequest.getDefaultInstance()) return this; - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - onChanged(); - } - if (!other.getPrefix().isEmpty()) { - prefix_ = other.prefix_; - onChanged(); - } - if (other.hasReadMask()) { - mergeReadMask(other.getReadMask()); - } - if (other.hasCommonRequestParams()) { - mergeCommonRequestParams(other.getCommonRequestParams()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.ListBucketsRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.ListBucketsRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object parent_ = ""; - /** - * - * - *
-     * Required. The project whose buckets we are listing.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The project whose buckets we are listing.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - public com.google.protobuf.ByteString getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The project whose buckets we are listing.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The parent to set. - * @return This builder for chaining. - */ - public Builder setParent(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - parent_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The project whose buckets we are listing.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearParent() { - - parent_ = getDefaultInstance().getParent(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The project whose buckets we are listing.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for parent to set. - * @return This builder for chaining. - */ - public Builder setParentBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - parent_ = value; - onChanged(); - return this; - } - - private int pageSize_; - /** - * - * - *
-     * Maximum number of buckets to return in a single response. The service will
-     * use this parameter or 1,000 items, whichever is smaller. If "acl" is
-     * present in the read_mask, the service will use this parameter of 200 items,
-     * whichever is smaller.
-     * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - * - * - *
-     * Maximum number of buckets to return in a single response. The service will
-     * use this parameter or 1,000 items, whichever is smaller. If "acl" is
-     * present in the read_mask, the service will use this parameter of 200 items,
-     * whichever is smaller.
-     * 
- * - * int32 page_size = 2; - * - * @param value The pageSize to set. - * @return This builder for chaining. - */ - public Builder setPageSize(int value) { - - pageSize_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Maximum number of buckets to return in a single response. The service will
-     * use this parameter or 1,000 items, whichever is smaller. If "acl" is
-     * present in the read_mask, the service will use this parameter of 200 items,
-     * whichever is smaller.
-     * 
- * - * int32 page_size = 2; - * - * @return This builder for chaining. - */ - public Builder clearPageSize() { - - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - * - * - *
-     * A previously-returned page token representing part of the larger set of
-     * results to view.
-     * 
- * - * string page_token = 3; - * - * @return The pageToken. - */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * A previously-returned page token representing part of the larger set of
-     * results to view.
-     * 
- * - * string page_token = 3; - * - * @return The bytes for pageToken. - */ - public com.google.protobuf.ByteString getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * A previously-returned page token representing part of the larger set of
-     * results to view.
-     * 
- * - * string page_token = 3; - * - * @param value The pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageToken(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pageToken_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * A previously-returned page token representing part of the larger set of
-     * results to view.
-     * 
- * - * string page_token = 3; - * - * @return This builder for chaining. - */ - public Builder clearPageToken() { - - pageToken_ = getDefaultInstance().getPageToken(); - onChanged(); - return this; - } - /** - * - * - *
-     * A previously-returned page token representing part of the larger set of
-     * results to view.
-     * 
- * - * string page_token = 3; - * - * @param value The bytes for pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pageToken_ = value; - onChanged(); - return this; - } - - private java.lang.Object prefix_ = ""; - /** - * - * - *
-     * Filter results to buckets whose names begin with this prefix.
-     * 
- * - * string prefix = 4; - * - * @return The prefix. - */ - public java.lang.String getPrefix() { - java.lang.Object ref = prefix_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - prefix_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Filter results to buckets whose names begin with this prefix.
-     * 
- * - * string prefix = 4; - * - * @return The bytes for prefix. - */ - public com.google.protobuf.ByteString getPrefixBytes() { - java.lang.Object ref = prefix_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - prefix_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Filter results to buckets whose names begin with this prefix.
-     * 
- * - * string prefix = 4; - * - * @param value The prefix to set. - * @return This builder for chaining. - */ - public Builder setPrefix(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - prefix_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Filter results to buckets whose names begin with this prefix.
-     * 
- * - * string prefix = 4; - * - * @return This builder for chaining. - */ - public Builder clearPrefix() { - - prefix_ = getDefaultInstance().getPrefix(); - onChanged(); - return this; - } - /** - * - * - *
-     * Filter results to buckets whose names begin with this prefix.
-     * 
- * - * string prefix = 4; - * - * @param value The bytes for prefix to set. - * @return This builder for chaining. - */ - public Builder setPrefixBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - prefix_ = value; - onChanged(); - return this; - } - - 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 from each result.
-     * If no mask is specified, will default to all fields except items.owner,
-     * items.acl, and items.default_object_acl.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - * - * @return Whether the readMask field is set. - */ - public boolean hasReadMask() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-     * Mask specifying which fields to read from each result.
-     * If no mask is specified, will default to all fields except items.owner,
-     * items.acl, and items.default_object_acl.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - * - * @return The readMask. - */ - public com.google.protobuf.FieldMask getReadMask() { - if (readMaskBuilder_ == null) { - return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; - } else { - return readMaskBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Mask specifying which fields to read from each result.
-     * If no mask is specified, will default to all fields except items.owner,
-     * items.acl, and items.default_object_acl.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - */ - public Builder setReadMask(com.google.protobuf.FieldMask value) { - if (readMaskBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - readMask_ = value; - onChanged(); - } else { - readMaskBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-     * Mask specifying which fields to read from each result.
-     * If no mask is specified, will default to all fields except items.owner,
-     * items.acl, and items.default_object_acl.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - */ - public Builder setReadMask(com.google.protobuf.FieldMask.Builder builderForValue) { - if (readMaskBuilder_ == null) { - readMask_ = builderForValue.build(); - onChanged(); - } else { - readMaskBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-     * Mask specifying which fields to read from each result.
-     * If no mask is specified, will default to all fields except items.owner,
-     * items.acl, and items.default_object_acl.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - */ - public Builder mergeReadMask(com.google.protobuf.FieldMask value) { - if (readMaskBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0) - && readMask_ != null - && readMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { - readMask_ = - com.google.protobuf.FieldMask.newBuilder(readMask_).mergeFrom(value).buildPartial(); - } else { - readMask_ = value; - } - onChanged(); - } else { - readMaskBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-     * Mask specifying which fields to read from each result.
-     * If no mask is specified, will default to all fields except items.owner,
-     * items.acl, and items.default_object_acl.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - */ - public Builder clearReadMask() { - if (readMaskBuilder_ == null) { - readMask_ = null; - onChanged(); - } else { - readMaskBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - /** - * - * - *
-     * Mask specifying which fields to read from each result.
-     * If no mask is specified, will default to all fields except items.owner,
-     * items.acl, and items.default_object_acl.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - */ - public com.google.protobuf.FieldMask.Builder getReadMaskBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getReadMaskFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Mask specifying which fields to read from each result.
-     * If no mask is specified, will default to all fields except items.owner,
-     * items.acl, and items.default_object_acl.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - */ - 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 from each result.
-     * If no mask is specified, will default to all fields except items.owner,
-     * items.acl, and items.default_object_acl.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - */ - 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.CommonRequestParams commonRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - commonRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 6; - * - * @return Whether the commonRequestParams field is set. - */ - public boolean hasCommonRequestParams() { - return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 6; - * - * @return The commonRequestParams. - */ - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } else { - return commonRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 6; - */ - public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonRequestParams_ = value; - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 6; - */ - public Builder setCommonRequestParams( - com.google.storage.v2.CommonRequestParams.Builder builderForValue) { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 6; - */ - public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (commonRequestParams_ != null) { - commonRequestParams_ = - com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonRequestParams_ = value; - } - onChanged(); - } else { - commonRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 6; - */ - public Builder clearCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - onChanged(); - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 6; - */ - public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { - - onChanged(); - return getCommonRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 6; - */ - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - if (commonRequestParamsBuilder_ != null) { - return commonRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 6; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - getCommonRequestParamsFieldBuilder() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder>( - getCommonRequestParams(), getParentForChildren(), isClean()); - commonRequestParams_ = null; - } - return commonRequestParamsBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.ListBucketsRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.ListBucketsRequest) - private static final com.google.storage.v2.ListBucketsRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.ListBucketsRequest(); - } - - public static com.google.storage.v2.ListBucketsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListBucketsRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListBucketsRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.ListBucketsRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListBucketsRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListBucketsRequestOrBuilder.java deleted file mode 100644 index 64f4440b96..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListBucketsRequestOrBuilder.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface ListBucketsRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.ListBucketsRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The project whose buckets we are listing.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - java.lang.String getParent(); - /** - * - * - *
-   * Required. The project whose buckets we are listing.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - com.google.protobuf.ByteString getParentBytes(); - - /** - * - * - *
-   * Maximum number of buckets to return in a single response. The service will
-   * use this parameter or 1,000 items, whichever is smaller. If "acl" is
-   * present in the read_mask, the service will use this parameter of 200 items,
-   * whichever is smaller.
-   * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - int getPageSize(); - - /** - * - * - *
-   * A previously-returned page token representing part of the larger set of
-   * results to view.
-   * 
- * - * string page_token = 3; - * - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - * - * - *
-   * A previously-returned page token representing part of the larger set of
-   * results to view.
-   * 
- * - * string page_token = 3; - * - * @return The bytes for pageToken. - */ - com.google.protobuf.ByteString getPageTokenBytes(); - - /** - * - * - *
-   * Filter results to buckets whose names begin with this prefix.
-   * 
- * - * string prefix = 4; - * - * @return The prefix. - */ - java.lang.String getPrefix(); - /** - * - * - *
-   * Filter results to buckets whose names begin with this prefix.
-   * 
- * - * string prefix = 4; - * - * @return The bytes for prefix. - */ - com.google.protobuf.ByteString getPrefixBytes(); - - /** - * - * - *
-   * Mask specifying which fields to read from each result.
-   * If no mask is specified, will default to all fields except items.owner,
-   * items.acl, and items.default_object_acl.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - * - * @return Whether the readMask field is set. - */ - boolean hasReadMask(); - /** - * - * - *
-   * Mask specifying which fields to read from each result.
-   * If no mask is specified, will default to all fields except items.owner,
-   * items.acl, and items.default_object_acl.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - * - * @return The readMask. - */ - com.google.protobuf.FieldMask getReadMask(); - /** - * - * - *
-   * Mask specifying which fields to read from each result.
-   * If no mask is specified, will default to all fields except items.owner,
-   * items.acl, and items.default_object_acl.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 5; - */ - com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder(); - - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 6; - * - * @return Whether the commonRequestParams field is set. - */ - boolean hasCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 6; - * - * @return The commonRequestParams. - */ - com.google.storage.v2.CommonRequestParams getCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 6; - */ - com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListBucketsResponse.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListBucketsResponse.java deleted file mode 100644 index c66bce34ca..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListBucketsResponse.java +++ /dev/null @@ -1,1127 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * The result of a call to Buckets.ListBuckets
- * 
- * - * Protobuf type {@code google.storage.v2.ListBucketsResponse} - */ -public final class ListBucketsResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.ListBucketsResponse) - ListBucketsResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListBucketsResponse.newBuilder() to construct. - private ListBucketsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListBucketsResponse() { - buckets_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListBucketsResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ListBucketsResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - buckets_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - buckets_.add( - input.readMessage(com.google.storage.v2.Bucket.parser(), extensionRegistry)); - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - buckets_ = java.util.Collections.unmodifiableList(buckets_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListBucketsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListBucketsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ListBucketsResponse.class, - com.google.storage.v2.ListBucketsResponse.Builder.class); - } - - public static final int BUCKETS_FIELD_NUMBER = 1; - private java.util.List buckets_; - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - @java.lang.Override - public java.util.List getBucketsList() { - return buckets_; - } - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - @java.lang.Override - public java.util.List getBucketsOrBuilderList() { - return buckets_; - } - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - @java.lang.Override - public int getBucketsCount() { - return buckets_.size(); - } - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - @java.lang.Override - public com.google.storage.v2.Bucket getBuckets(int index) { - return buckets_.get(index); - } - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - @java.lang.Override - public com.google.storage.v2.BucketOrBuilder getBucketsOrBuilder(int index) { - return buckets_.get(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; - /** - * - * - *
-   * The continuation token, used to page through large result sets. Provide
-   * this value in a subsequent request to return the next page of results.
-   * 
- * - * string next_page_token = 2; - * - * @return The nextPageToken. - */ - @java.lang.Override - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } - } - /** - * - * - *
-   * The continuation token, used to page through large result sets. Provide
-   * this value in a subsequent request to return the next page of results.
-   * 
- * - * string next_page_token = 2; - * - * @return The bytes for nextPageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < buckets_.size(); i++) { - output.writeMessage(1, buckets_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < buckets_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, buckets_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.ListBucketsResponse)) { - return super.equals(obj); - } - com.google.storage.v2.ListBucketsResponse other = - (com.google.storage.v2.ListBucketsResponse) obj; - - if (!getBucketsList().equals(other.getBucketsList())) return false; - if (!getNextPageToken().equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getBucketsCount() > 0) { - hash = (37 * hash) + BUCKETS_FIELD_NUMBER; - hash = (53 * hash) + getBucketsList().hashCode(); - } - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.ListBucketsResponse parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListBucketsResponse 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.ListBucketsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListBucketsResponse 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.ListBucketsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListBucketsResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ListBucketsResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListBucketsResponse 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.ListBucketsResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListBucketsResponse 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.ListBucketsResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListBucketsResponse 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.ListBucketsResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * The result of a call to Buckets.ListBuckets
-   * 
- * - * Protobuf type {@code google.storage.v2.ListBucketsResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.ListBucketsResponse) - com.google.storage.v2.ListBucketsResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListBucketsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListBucketsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ListBucketsResponse.class, - com.google.storage.v2.ListBucketsResponse.Builder.class); - } - - // Construct using com.google.storage.v2.ListBucketsResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getBucketsFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (bucketsBuilder_ == null) { - buckets_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - bucketsBuilder_.clear(); - } - nextPageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListBucketsResponse_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.ListBucketsResponse getDefaultInstanceForType() { - return com.google.storage.v2.ListBucketsResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.ListBucketsResponse build() { - com.google.storage.v2.ListBucketsResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.ListBucketsResponse buildPartial() { - com.google.storage.v2.ListBucketsResponse result = - new com.google.storage.v2.ListBucketsResponse(this); - int from_bitField0_ = bitField0_; - if (bucketsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - buckets_ = java.util.Collections.unmodifiableList(buckets_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.buckets_ = buckets_; - } else { - result.buckets_ = bucketsBuilder_.build(); - } - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.ListBucketsResponse) { - return mergeFrom((com.google.storage.v2.ListBucketsResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.ListBucketsResponse other) { - if (other == com.google.storage.v2.ListBucketsResponse.getDefaultInstance()) return this; - if (bucketsBuilder_ == null) { - if (!other.buckets_.isEmpty()) { - if (buckets_.isEmpty()) { - buckets_ = other.buckets_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureBucketsIsMutable(); - buckets_.addAll(other.buckets_); - } - onChanged(); - } - } else { - if (!other.buckets_.isEmpty()) { - if (bucketsBuilder_.isEmpty()) { - bucketsBuilder_.dispose(); - bucketsBuilder_ = null; - buckets_ = other.buckets_; - bitField0_ = (bitField0_ & ~0x00000001); - bucketsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getBucketsFieldBuilder() - : null; - } else { - bucketsBuilder_.addAllMessages(other.buckets_); - } - } - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.ListBucketsResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.ListBucketsResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.util.List buckets_ = - java.util.Collections.emptyList(); - - private void ensureBucketsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - buckets_ = new java.util.ArrayList(buckets_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.Bucket, - com.google.storage.v2.Bucket.Builder, - com.google.storage.v2.BucketOrBuilder> - bucketsBuilder_; - - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - public java.util.List getBucketsList() { - if (bucketsBuilder_ == null) { - return java.util.Collections.unmodifiableList(buckets_); - } else { - return bucketsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - public int getBucketsCount() { - if (bucketsBuilder_ == null) { - return buckets_.size(); - } else { - return bucketsBuilder_.getCount(); - } - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - public com.google.storage.v2.Bucket getBuckets(int index) { - if (bucketsBuilder_ == null) { - return buckets_.get(index); - } else { - return bucketsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - public Builder setBuckets(int index, com.google.storage.v2.Bucket value) { - if (bucketsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureBucketsIsMutable(); - buckets_.set(index, value); - onChanged(); - } else { - bucketsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - public Builder setBuckets(int index, com.google.storage.v2.Bucket.Builder builderForValue) { - if (bucketsBuilder_ == null) { - ensureBucketsIsMutable(); - buckets_.set(index, builderForValue.build()); - onChanged(); - } else { - bucketsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - public Builder addBuckets(com.google.storage.v2.Bucket value) { - if (bucketsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureBucketsIsMutable(); - buckets_.add(value); - onChanged(); - } else { - bucketsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - public Builder addBuckets(int index, com.google.storage.v2.Bucket value) { - if (bucketsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureBucketsIsMutable(); - buckets_.add(index, value); - onChanged(); - } else { - bucketsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - public Builder addBuckets(com.google.storage.v2.Bucket.Builder builderForValue) { - if (bucketsBuilder_ == null) { - ensureBucketsIsMutable(); - buckets_.add(builderForValue.build()); - onChanged(); - } else { - bucketsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - public Builder addBuckets(int index, com.google.storage.v2.Bucket.Builder builderForValue) { - if (bucketsBuilder_ == null) { - ensureBucketsIsMutable(); - buckets_.add(index, builderForValue.build()); - onChanged(); - } else { - bucketsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - public Builder addAllBuckets( - java.lang.Iterable values) { - if (bucketsBuilder_ == null) { - ensureBucketsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, buckets_); - onChanged(); - } else { - bucketsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - public Builder clearBuckets() { - if (bucketsBuilder_ == null) { - buckets_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - bucketsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - public Builder removeBuckets(int index) { - if (bucketsBuilder_ == null) { - ensureBucketsIsMutable(); - buckets_.remove(index); - onChanged(); - } else { - bucketsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - public com.google.storage.v2.Bucket.Builder getBucketsBuilder(int index) { - return getBucketsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - public com.google.storage.v2.BucketOrBuilder getBucketsOrBuilder(int index) { - if (bucketsBuilder_ == null) { - return buckets_.get(index); - } else { - return bucketsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - public java.util.List - getBucketsOrBuilderList() { - if (bucketsBuilder_ != null) { - return bucketsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(buckets_); - } - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - public com.google.storage.v2.Bucket.Builder addBucketsBuilder() { - return getBucketsFieldBuilder().addBuilder(com.google.storage.v2.Bucket.getDefaultInstance()); - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - public com.google.storage.v2.Bucket.Builder addBucketsBuilder(int index) { - return getBucketsFieldBuilder() - .addBuilder(index, com.google.storage.v2.Bucket.getDefaultInstance()); - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - public java.util.List getBucketsBuilderList() { - return getBucketsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.Bucket, - com.google.storage.v2.Bucket.Builder, - com.google.storage.v2.BucketOrBuilder> - getBucketsFieldBuilder() { - if (bucketsBuilder_ == null) { - bucketsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.Bucket, - com.google.storage.v2.Bucket.Builder, - com.google.storage.v2.BucketOrBuilder>( - buckets_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - buckets_ = null; - } - return bucketsBuilder_; - } - - private java.lang.Object nextPageToken_ = ""; - /** - * - * - *
-     * The continuation token, used to page through large result sets. Provide
-     * this value in a subsequent request to return the next page of results.
-     * 
- * - * string next_page_token = 2; - * - * @return The nextPageToken. - */ - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The continuation token, used to page through large result sets. Provide
-     * this value in a subsequent request to return the next page of results.
-     * 
- * - * string next_page_token = 2; - * - * @return The bytes for nextPageToken. - */ - public com.google.protobuf.ByteString getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The continuation token, used to page through large result sets. Provide
-     * this value in a subsequent request to return the next page of results.
-     * 
- * - * string next_page_token = 2; - * - * @param value The nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageToken(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nextPageToken_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The continuation token, used to page through large result sets. Provide
-     * this value in a subsequent request to return the next page of results.
-     * 
- * - * string next_page_token = 2; - * - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - - nextPageToken_ = getDefaultInstance().getNextPageToken(); - onChanged(); - return this; - } - /** - * - * - *
-     * The continuation token, used to page through large result sets. Provide
-     * this value in a subsequent request to return the next page of results.
-     * 
- * - * string next_page_token = 2; - * - * @param value The bytes for nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nextPageToken_ = value; - 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.ListBucketsResponse) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.ListBucketsResponse) - private static final com.google.storage.v2.ListBucketsResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.ListBucketsResponse(); - } - - public static com.google.storage.v2.ListBucketsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListBucketsResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListBucketsResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.ListBucketsResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListBucketsResponseOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListBucketsResponseOrBuilder.java deleted file mode 100644 index cdc9f1f78e..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListBucketsResponseOrBuilder.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface ListBucketsResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.ListBucketsResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - java.util.List getBucketsList(); - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - com.google.storage.v2.Bucket getBuckets(int index); - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - int getBucketsCount(); - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - java.util.List getBucketsOrBuilderList(); - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Bucket buckets = 1; - */ - com.google.storage.v2.BucketOrBuilder getBucketsOrBuilder(int index); - - /** - * - * - *
-   * The continuation token, used to page through large result sets. Provide
-   * this value in a subsequent request to return the next page of results.
-   * 
- * - * string next_page_token = 2; - * - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - * - * - *
-   * The continuation token, used to page through large result sets. Provide
-   * this value in a subsequent request to return the next page of results.
-   * 
- * - * string next_page_token = 2; - * - * @return The bytes for nextPageToken. - */ - com.google.protobuf.ByteString getNextPageTokenBytes(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListHmacKeysRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListHmacKeysRequest.java deleted file mode 100644 index 6ec7c20e13..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListHmacKeysRequest.java +++ /dev/null @@ -1,1488 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request to fetch a list of HMAC keys under a given project.
- * 
- * - * Protobuf type {@code google.storage.v2.ListHmacKeysRequest} - */ -public final class ListHmacKeysRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.ListHmacKeysRequest) - ListHmacKeysRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListHmacKeysRequest.newBuilder() to construct. - private ListHmacKeysRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListHmacKeysRequest() { - project_ = ""; - pageToken_ = ""; - serviceAccountEmail_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListHmacKeysRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ListHmacKeysRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - project_ = s; - break; - } - case 16: - { - pageSize_ = input.readInt32(); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - - serviceAccountEmail_ = s; - break; - } - case 40: - { - showDeletedKeys_ = input.readBool(); - break; - } - case 50: - { - com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; - if (commonRequestParams_ != null) { - subBuilder = commonRequestParams_.toBuilder(); - } - commonRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonRequestParams_); - commonRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListHmacKeysRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListHmacKeysRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ListHmacKeysRequest.class, - com.google.storage.v2.ListHmacKeysRequest.Builder.class); - } - - public static final int PROJECT_FIELD_NUMBER = 1; - private volatile java.lang.Object project_; - /** - * - * - *
-   * Required. The project id to list HMAC keys for.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - @java.lang.Override - public java.lang.String getProject() { - java.lang.Object ref = project_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - project_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The project id to list HMAC keys for.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - @java.lang.Override - public com.google.protobuf.ByteString getProjectBytes() { - java.lang.Object ref = project_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - project_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 2; - private int pageSize_; - /** - * - * - *
-   * Optional. The maximum number of keys to return.
-   * 
- * - * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 3; - private volatile java.lang.Object pageToken_; - /** - * - * - *
-   * Optional. A previously returned token from ListHmacKeysResponse to get the next page.
-   * 
- * - * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The pageToken. - */ - @java.lang.Override - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } - } - /** - * - * - *
-   * Optional. A previously returned token from ListHmacKeysResponse to get the next page.
-   * 
- * - * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for pageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER = 4; - private volatile java.lang.Object serviceAccountEmail_; - /** - * - * - *
-   * Optional. If set, filters to only return HMAC keys for specified service account.
-   * 
- * - * string service_account_email = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The serviceAccountEmail. - */ - @java.lang.Override - public java.lang.String getServiceAccountEmail() { - java.lang.Object ref = serviceAccountEmail_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serviceAccountEmail_ = s; - return s; - } - } - /** - * - * - *
-   * Optional. If set, filters to only return HMAC keys for specified service account.
-   * 
- * - * string service_account_email = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for serviceAccountEmail. - */ - @java.lang.Override - public com.google.protobuf.ByteString getServiceAccountEmailBytes() { - java.lang.Object ref = serviceAccountEmail_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - serviceAccountEmail_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SHOW_DELETED_KEYS_FIELD_NUMBER = 5; - private boolean showDeletedKeys_; - /** - * - * - *
-   * Optional. If set, return deleted keys that have not yet been wiped out.
-   * 
- * - * bool show_deleted_keys = 5 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The showDeletedKeys. - */ - @java.lang.Override - public boolean getShowDeletedKeys() { - return showDeletedKeys_; - } - - public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 6; - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - /** - * - * - *
-   * Optional. A set of parameters common to all Storage API requests.
-   * 
- * - * - * .google.storage.v2.CommonRequestParams common_request_params = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return Whether the commonRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonRequestParams() { - return commonRequestParams_ != null; - } - /** - * - * - *
-   * Optional. A set of parameters common to all Storage API requests.
-   * 
- * - * - * .google.storage.v2.CommonRequestParams common_request_params = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return The commonRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - /** - * - * - *
-   * Optional. A set of parameters common to all Storage API requests.
-   * 
- * - * - * .google.storage.v2.CommonRequestParams common_request_params = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - return getCommonRequestParams(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, project_); - } - if (pageSize_ != 0) { - output.writeInt32(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, serviceAccountEmail_); - } - if (showDeletedKeys_ != false) { - output.writeBool(5, showDeletedKeys_); - } - if (commonRequestParams_ != null) { - output.writeMessage(6, getCommonRequestParams()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, project_); - } - if (pageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, serviceAccountEmail_); - } - if (showDeletedKeys_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, showDeletedKeys_); - } - if (commonRequestParams_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getCommonRequestParams()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.ListHmacKeysRequest)) { - return super.equals(obj); - } - com.google.storage.v2.ListHmacKeysRequest other = - (com.google.storage.v2.ListHmacKeysRequest) obj; - - if (!getProject().equals(other.getProject())) return false; - if (getPageSize() != other.getPageSize()) return false; - if (!getPageToken().equals(other.getPageToken())) return false; - if (!getServiceAccountEmail().equals(other.getServiceAccountEmail())) return false; - if (getShowDeletedKeys() != other.getShowDeletedKeys()) return false; - if (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; - if (hasCommonRequestParams()) { - if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PROJECT_FIELD_NUMBER; - hash = (53 * hash) + getProject().hashCode(); - hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getPageSize(); - hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getPageToken().hashCode(); - hash = (37 * hash) + SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER; - hash = (53 * hash) + getServiceAccountEmail().hashCode(); - hash = (37 * hash) + SHOW_DELETED_KEYS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getShowDeletedKeys()); - if (hasCommonRequestParams()) { - hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonRequestParams().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.ListHmacKeysRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListHmacKeysRequest 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.ListHmacKeysRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListHmacKeysRequest 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.ListHmacKeysRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListHmacKeysRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ListHmacKeysRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListHmacKeysRequest 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.ListHmacKeysRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListHmacKeysRequest 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.ListHmacKeysRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListHmacKeysRequest 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.ListHmacKeysRequest 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 to fetch a list of HMAC keys under a given project.
-   * 
- * - * Protobuf type {@code google.storage.v2.ListHmacKeysRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.ListHmacKeysRequest) - com.google.storage.v2.ListHmacKeysRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListHmacKeysRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListHmacKeysRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ListHmacKeysRequest.class, - com.google.storage.v2.ListHmacKeysRequest.Builder.class); - } - - // Construct using com.google.storage.v2.ListHmacKeysRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - project_ = ""; - - pageSize_ = 0; - - pageToken_ = ""; - - serviceAccountEmail_ = ""; - - showDeletedKeys_ = false; - - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListHmacKeysRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.ListHmacKeysRequest getDefaultInstanceForType() { - return com.google.storage.v2.ListHmacKeysRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.ListHmacKeysRequest build() { - com.google.storage.v2.ListHmacKeysRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.ListHmacKeysRequest buildPartial() { - com.google.storage.v2.ListHmacKeysRequest result = - new com.google.storage.v2.ListHmacKeysRequest(this); - result.project_ = project_; - result.pageSize_ = pageSize_; - result.pageToken_ = pageToken_; - result.serviceAccountEmail_ = serviceAccountEmail_; - result.showDeletedKeys_ = showDeletedKeys_; - if (commonRequestParamsBuilder_ == null) { - result.commonRequestParams_ = commonRequestParams_; - } else { - result.commonRequestParams_ = commonRequestParamsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.ListHmacKeysRequest) { - return mergeFrom((com.google.storage.v2.ListHmacKeysRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.ListHmacKeysRequest other) { - if (other == com.google.storage.v2.ListHmacKeysRequest.getDefaultInstance()) return this; - if (!other.getProject().isEmpty()) { - project_ = other.project_; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - onChanged(); - } - if (!other.getServiceAccountEmail().isEmpty()) { - serviceAccountEmail_ = other.serviceAccountEmail_; - onChanged(); - } - if (other.getShowDeletedKeys() != false) { - setShowDeletedKeys(other.getShowDeletedKeys()); - } - if (other.hasCommonRequestParams()) { - mergeCommonRequestParams(other.getCommonRequestParams()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.ListHmacKeysRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.ListHmacKeysRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object project_ = ""; - /** - * - * - *
-     * Required. The project id to list HMAC keys for.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - public java.lang.String getProject() { - java.lang.Object ref = project_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - project_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The project id to list HMAC keys for.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - public com.google.protobuf.ByteString getProjectBytes() { - java.lang.Object ref = project_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - project_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The project id to list HMAC keys for.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The project to set. - * @return This builder for chaining. - */ - public Builder setProject(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - project_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The project id to list HMAC keys for.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearProject() { - - project_ = getDefaultInstance().getProject(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The project id to list HMAC keys for.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for project to set. - * @return This builder for chaining. - */ - public Builder setProjectBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - project_ = value; - onChanged(); - return this; - } - - private int pageSize_; - /** - * - * - *
-     * Optional. The maximum number of keys to return.
-     * 
- * - * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - * - * - *
-     * Optional. The maximum number of keys to return.
-     * 
- * - * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The pageSize to set. - * @return This builder for chaining. - */ - public Builder setPageSize(int value) { - - pageSize_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. The maximum number of keys to return.
-     * 
- * - * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearPageSize() { - - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - * - * - *
-     * Optional. A previously returned token from ListHmacKeysResponse to get the next page.
-     * 
- * - * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The pageToken. - */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Optional. A previously returned token from ListHmacKeysResponse to get the next page.
-     * 
- * - * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for pageToken. - */ - public com.google.protobuf.ByteString getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Optional. A previously returned token from ListHmacKeysResponse to get the next page.
-     * 
- * - * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageToken(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pageToken_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. A previously returned token from ListHmacKeysResponse to get the next page.
-     * 
- * - * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearPageToken() { - - pageToken_ = getDefaultInstance().getPageToken(); - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. A previously returned token from ListHmacKeysResponse to get the next page.
-     * 
- * - * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The bytes for pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pageToken_ = value; - onChanged(); - return this; - } - - private java.lang.Object serviceAccountEmail_ = ""; - /** - * - * - *
-     * Optional. If set, filters to only return HMAC keys for specified service account.
-     * 
- * - * string service_account_email = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The serviceAccountEmail. - */ - public java.lang.String getServiceAccountEmail() { - java.lang.Object ref = serviceAccountEmail_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serviceAccountEmail_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Optional. If set, filters to only return HMAC keys for specified service account.
-     * 
- * - * string service_account_email = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for serviceAccountEmail. - */ - public com.google.protobuf.ByteString getServiceAccountEmailBytes() { - java.lang.Object ref = serviceAccountEmail_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - serviceAccountEmail_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Optional. If set, filters to only return HMAC keys for specified service account.
-     * 
- * - * string service_account_email = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The serviceAccountEmail to set. - * @return This builder for chaining. - */ - public Builder setServiceAccountEmail(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - serviceAccountEmail_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. If set, filters to only return HMAC keys for specified service account.
-     * 
- * - * string service_account_email = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearServiceAccountEmail() { - - serviceAccountEmail_ = getDefaultInstance().getServiceAccountEmail(); - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. If set, filters to only return HMAC keys for specified service account.
-     * 
- * - * string service_account_email = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The bytes for serviceAccountEmail to set. - * @return This builder for chaining. - */ - public Builder setServiceAccountEmailBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - serviceAccountEmail_ = value; - onChanged(); - return this; - } - - private boolean showDeletedKeys_; - /** - * - * - *
-     * Optional. If set, return deleted keys that have not yet been wiped out.
-     * 
- * - * bool show_deleted_keys = 5 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The showDeletedKeys. - */ - @java.lang.Override - public boolean getShowDeletedKeys() { - return showDeletedKeys_; - } - /** - * - * - *
-     * Optional. If set, return deleted keys that have not yet been wiped out.
-     * 
- * - * bool show_deleted_keys = 5 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The showDeletedKeys to set. - * @return This builder for chaining. - */ - public Builder setShowDeletedKeys(boolean value) { - - showDeletedKeys_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. If set, return deleted keys that have not yet been wiped out.
-     * 
- * - * bool show_deleted_keys = 5 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearShowDeletedKeys() { - - showDeletedKeys_ = false; - onChanged(); - return this; - } - - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - commonRequestParamsBuilder_; - /** - * - * - *
-     * Optional. A set of parameters common to all Storage API requests.
-     * 
- * - * - * .google.storage.v2.CommonRequestParams common_request_params = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return Whether the commonRequestParams field is set. - */ - public boolean hasCommonRequestParams() { - return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; - } - /** - * - * - *
-     * Optional. A set of parameters common to all Storage API requests.
-     * 
- * - * - * .google.storage.v2.CommonRequestParams common_request_params = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return The commonRequestParams. - */ - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } else { - return commonRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Optional. A set of parameters common to all Storage API requests.
-     * 
- * - * - * .google.storage.v2.CommonRequestParams common_request_params = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonRequestParams_ = value; - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Optional. A set of parameters common to all Storage API requests.
-     * 
- * - * - * .google.storage.v2.CommonRequestParams common_request_params = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder setCommonRequestParams( - com.google.storage.v2.CommonRequestParams.Builder builderForValue) { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Optional. A set of parameters common to all Storage API requests.
-     * 
- * - * - * .google.storage.v2.CommonRequestParams common_request_params = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (commonRequestParams_ != null) { - commonRequestParams_ = - com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonRequestParams_ = value; - } - onChanged(); - } else { - commonRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Optional. A set of parameters common to all Storage API requests.
-     * 
- * - * - * .google.storage.v2.CommonRequestParams common_request_params = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder clearCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - onChanged(); - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Optional. A set of parameters common to all Storage API requests.
-     * 
- * - * - * .google.storage.v2.CommonRequestParams common_request_params = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { - - onChanged(); - return getCommonRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Optional. A set of parameters common to all Storage API requests.
-     * 
- * - * - * .google.storage.v2.CommonRequestParams common_request_params = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - if (commonRequestParamsBuilder_ != null) { - return commonRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - } - /** - * - * - *
-     * Optional. A set of parameters common to all Storage API requests.
-     * 
- * - * - * .google.storage.v2.CommonRequestParams common_request_params = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - getCommonRequestParamsFieldBuilder() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder>( - getCommonRequestParams(), getParentForChildren(), isClean()); - commonRequestParams_ = null; - } - return commonRequestParamsBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.ListHmacKeysRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.ListHmacKeysRequest) - private static final com.google.storage.v2.ListHmacKeysRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.ListHmacKeysRequest(); - } - - public static com.google.storage.v2.ListHmacKeysRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListHmacKeysRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListHmacKeysRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.ListHmacKeysRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListHmacKeysRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListHmacKeysRequestOrBuilder.java deleted file mode 100644 index 1cfd48be9e..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListHmacKeysRequestOrBuilder.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface ListHmacKeysRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.ListHmacKeysRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The project id to list HMAC keys for.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - java.lang.String getProject(); - /** - * - * - *
-   * Required. The project id to list HMAC keys for.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - com.google.protobuf.ByteString getProjectBytes(); - - /** - * - * - *
-   * Optional. The maximum number of keys to return.
-   * 
- * - * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The pageSize. - */ - int getPageSize(); - - /** - * - * - *
-   * Optional. A previously returned token from ListHmacKeysResponse to get the next page.
-   * 
- * - * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - * - * - *
-   * Optional. A previously returned token from ListHmacKeysResponse to get the next page.
-   * 
- * - * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for pageToken. - */ - com.google.protobuf.ByteString getPageTokenBytes(); - - /** - * - * - *
-   * Optional. If set, filters to only return HMAC keys for specified service account.
-   * 
- * - * string service_account_email = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The serviceAccountEmail. - */ - java.lang.String getServiceAccountEmail(); - /** - * - * - *
-   * Optional. If set, filters to only return HMAC keys for specified service account.
-   * 
- * - * string service_account_email = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for serviceAccountEmail. - */ - com.google.protobuf.ByteString getServiceAccountEmailBytes(); - - /** - * - * - *
-   * Optional. If set, return deleted keys that have not yet been wiped out.
-   * 
- * - * bool show_deleted_keys = 5 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The showDeletedKeys. - */ - boolean getShowDeletedKeys(); - - /** - * - * - *
-   * Optional. A set of parameters common to all Storage API requests.
-   * 
- * - * - * .google.storage.v2.CommonRequestParams common_request_params = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return Whether the commonRequestParams field is set. - */ - boolean hasCommonRequestParams(); - /** - * - * - *
-   * Optional. A set of parameters common to all Storage API requests.
-   * 
- * - * - * .google.storage.v2.CommonRequestParams common_request_params = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return The commonRequestParams. - */ - com.google.storage.v2.CommonRequestParams getCommonRequestParams(); - /** - * - * - *
-   * Optional. A set of parameters common to all Storage API requests.
-   * 
- * - * - * .google.storage.v2.CommonRequestParams common_request_params = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListHmacKeysResponse.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListHmacKeysResponse.java deleted file mode 100644 index d71af6d30d..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListHmacKeysResponse.java +++ /dev/null @@ -1,1132 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Hmac key list response with next page information.
- * 
- * - * Protobuf type {@code google.storage.v2.ListHmacKeysResponse} - */ -public final class ListHmacKeysResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.ListHmacKeysResponse) - ListHmacKeysResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListHmacKeysResponse.newBuilder() to construct. - private ListHmacKeysResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListHmacKeysResponse() { - hmacKeys_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListHmacKeysResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ListHmacKeysResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - hmacKeys_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - hmacKeys_.add( - input.readMessage( - com.google.storage.v2.HmacKeyMetadata.parser(), extensionRegistry)); - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - hmacKeys_ = java.util.Collections.unmodifiableList(hmacKeys_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListHmacKeysResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListHmacKeysResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ListHmacKeysResponse.class, - com.google.storage.v2.ListHmacKeysResponse.Builder.class); - } - - public static final int HMAC_KEYS_FIELD_NUMBER = 1; - private java.util.List hmacKeys_; - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - @java.lang.Override - public java.util.List getHmacKeysList() { - return hmacKeys_; - } - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - @java.lang.Override - public java.util.List - getHmacKeysOrBuilderList() { - return hmacKeys_; - } - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - @java.lang.Override - public int getHmacKeysCount() { - return hmacKeys_.size(); - } - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - @java.lang.Override - public com.google.storage.v2.HmacKeyMetadata getHmacKeys(int index) { - return hmacKeys_.get(index); - } - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - @java.lang.Override - public com.google.storage.v2.HmacKeyMetadataOrBuilder getHmacKeysOrBuilder(int index) { - return hmacKeys_.get(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; - /** - * - * - *
-   * The continuation token, used to page through large result sets. Provide
-   * this value in a subsequent request to return the next page of results.
-   * 
- * - * string next_page_token = 2; - * - * @return The nextPageToken. - */ - @java.lang.Override - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } - } - /** - * - * - *
-   * The continuation token, used to page through large result sets. Provide
-   * this value in a subsequent request to return the next page of results.
-   * 
- * - * string next_page_token = 2; - * - * @return The bytes for nextPageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < hmacKeys_.size(); i++) { - output.writeMessage(1, hmacKeys_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < hmacKeys_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, hmacKeys_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.ListHmacKeysResponse)) { - return super.equals(obj); - } - com.google.storage.v2.ListHmacKeysResponse other = - (com.google.storage.v2.ListHmacKeysResponse) obj; - - if (!getHmacKeysList().equals(other.getHmacKeysList())) return false; - if (!getNextPageToken().equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getHmacKeysCount() > 0) { - hash = (37 * hash) + HMAC_KEYS_FIELD_NUMBER; - hash = (53 * hash) + getHmacKeysList().hashCode(); - } - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.ListHmacKeysResponse parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListHmacKeysResponse 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.ListHmacKeysResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListHmacKeysResponse 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.ListHmacKeysResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListHmacKeysResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ListHmacKeysResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListHmacKeysResponse 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.ListHmacKeysResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListHmacKeysResponse 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.ListHmacKeysResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListHmacKeysResponse 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.ListHmacKeysResponse 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; - } - /** - * - * - *
-   * Hmac key list response with next page information.
-   * 
- * - * Protobuf type {@code google.storage.v2.ListHmacKeysResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.ListHmacKeysResponse) - com.google.storage.v2.ListHmacKeysResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListHmacKeysResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListHmacKeysResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ListHmacKeysResponse.class, - com.google.storage.v2.ListHmacKeysResponse.Builder.class); - } - - // Construct using com.google.storage.v2.ListHmacKeysResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getHmacKeysFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (hmacKeysBuilder_ == null) { - hmacKeys_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - hmacKeysBuilder_.clear(); - } - nextPageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListHmacKeysResponse_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.ListHmacKeysResponse getDefaultInstanceForType() { - return com.google.storage.v2.ListHmacKeysResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.ListHmacKeysResponse build() { - com.google.storage.v2.ListHmacKeysResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.ListHmacKeysResponse buildPartial() { - com.google.storage.v2.ListHmacKeysResponse result = - new com.google.storage.v2.ListHmacKeysResponse(this); - int from_bitField0_ = bitField0_; - if (hmacKeysBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - hmacKeys_ = java.util.Collections.unmodifiableList(hmacKeys_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.hmacKeys_ = hmacKeys_; - } else { - result.hmacKeys_ = hmacKeysBuilder_.build(); - } - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.ListHmacKeysResponse) { - return mergeFrom((com.google.storage.v2.ListHmacKeysResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.ListHmacKeysResponse other) { - if (other == com.google.storage.v2.ListHmacKeysResponse.getDefaultInstance()) return this; - if (hmacKeysBuilder_ == null) { - if (!other.hmacKeys_.isEmpty()) { - if (hmacKeys_.isEmpty()) { - hmacKeys_ = other.hmacKeys_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureHmacKeysIsMutable(); - hmacKeys_.addAll(other.hmacKeys_); - } - onChanged(); - } - } else { - if (!other.hmacKeys_.isEmpty()) { - if (hmacKeysBuilder_.isEmpty()) { - hmacKeysBuilder_.dispose(); - hmacKeysBuilder_ = null; - hmacKeys_ = other.hmacKeys_; - bitField0_ = (bitField0_ & ~0x00000001); - hmacKeysBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getHmacKeysFieldBuilder() - : null; - } else { - hmacKeysBuilder_.addAllMessages(other.hmacKeys_); - } - } - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.ListHmacKeysResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.ListHmacKeysResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.util.List hmacKeys_ = - java.util.Collections.emptyList(); - - private void ensureHmacKeysIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - hmacKeys_ = new java.util.ArrayList(hmacKeys_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.HmacKeyMetadata, - com.google.storage.v2.HmacKeyMetadata.Builder, - com.google.storage.v2.HmacKeyMetadataOrBuilder> - hmacKeysBuilder_; - - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - public java.util.List getHmacKeysList() { - if (hmacKeysBuilder_ == null) { - return java.util.Collections.unmodifiableList(hmacKeys_); - } else { - return hmacKeysBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - public int getHmacKeysCount() { - if (hmacKeysBuilder_ == null) { - return hmacKeys_.size(); - } else { - return hmacKeysBuilder_.getCount(); - } - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - public com.google.storage.v2.HmacKeyMetadata getHmacKeys(int index) { - if (hmacKeysBuilder_ == null) { - return hmacKeys_.get(index); - } else { - return hmacKeysBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - public Builder setHmacKeys(int index, com.google.storage.v2.HmacKeyMetadata value) { - if (hmacKeysBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureHmacKeysIsMutable(); - hmacKeys_.set(index, value); - onChanged(); - } else { - hmacKeysBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - public Builder setHmacKeys( - int index, com.google.storage.v2.HmacKeyMetadata.Builder builderForValue) { - if (hmacKeysBuilder_ == null) { - ensureHmacKeysIsMutable(); - hmacKeys_.set(index, builderForValue.build()); - onChanged(); - } else { - hmacKeysBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - public Builder addHmacKeys(com.google.storage.v2.HmacKeyMetadata value) { - if (hmacKeysBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureHmacKeysIsMutable(); - hmacKeys_.add(value); - onChanged(); - } else { - hmacKeysBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - public Builder addHmacKeys(int index, com.google.storage.v2.HmacKeyMetadata value) { - if (hmacKeysBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureHmacKeysIsMutable(); - hmacKeys_.add(index, value); - onChanged(); - } else { - hmacKeysBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - public Builder addHmacKeys(com.google.storage.v2.HmacKeyMetadata.Builder builderForValue) { - if (hmacKeysBuilder_ == null) { - ensureHmacKeysIsMutable(); - hmacKeys_.add(builderForValue.build()); - onChanged(); - } else { - hmacKeysBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - public Builder addHmacKeys( - int index, com.google.storage.v2.HmacKeyMetadata.Builder builderForValue) { - if (hmacKeysBuilder_ == null) { - ensureHmacKeysIsMutable(); - hmacKeys_.add(index, builderForValue.build()); - onChanged(); - } else { - hmacKeysBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - public Builder addAllHmacKeys( - java.lang.Iterable values) { - if (hmacKeysBuilder_ == null) { - ensureHmacKeysIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, hmacKeys_); - onChanged(); - } else { - hmacKeysBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - public Builder clearHmacKeys() { - if (hmacKeysBuilder_ == null) { - hmacKeys_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - hmacKeysBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - public Builder removeHmacKeys(int index) { - if (hmacKeysBuilder_ == null) { - ensureHmacKeysIsMutable(); - hmacKeys_.remove(index); - onChanged(); - } else { - hmacKeysBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - public com.google.storage.v2.HmacKeyMetadata.Builder getHmacKeysBuilder(int index) { - return getHmacKeysFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - public com.google.storage.v2.HmacKeyMetadataOrBuilder getHmacKeysOrBuilder(int index) { - if (hmacKeysBuilder_ == null) { - return hmacKeys_.get(index); - } else { - return hmacKeysBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - public java.util.List - getHmacKeysOrBuilderList() { - if (hmacKeysBuilder_ != null) { - return hmacKeysBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(hmacKeys_); - } - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - public com.google.storage.v2.HmacKeyMetadata.Builder addHmacKeysBuilder() { - return getHmacKeysFieldBuilder() - .addBuilder(com.google.storage.v2.HmacKeyMetadata.getDefaultInstance()); - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - public com.google.storage.v2.HmacKeyMetadata.Builder addHmacKeysBuilder(int index) { - return getHmacKeysFieldBuilder() - .addBuilder(index, com.google.storage.v2.HmacKeyMetadata.getDefaultInstance()); - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - public java.util.List getHmacKeysBuilderList() { - return getHmacKeysFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.HmacKeyMetadata, - com.google.storage.v2.HmacKeyMetadata.Builder, - com.google.storage.v2.HmacKeyMetadataOrBuilder> - getHmacKeysFieldBuilder() { - if (hmacKeysBuilder_ == null) { - hmacKeysBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.HmacKeyMetadata, - com.google.storage.v2.HmacKeyMetadata.Builder, - com.google.storage.v2.HmacKeyMetadataOrBuilder>( - hmacKeys_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - hmacKeys_ = null; - } - return hmacKeysBuilder_; - } - - private java.lang.Object nextPageToken_ = ""; - /** - * - * - *
-     * The continuation token, used to page through large result sets. Provide
-     * this value in a subsequent request to return the next page of results.
-     * 
- * - * string next_page_token = 2; - * - * @return The nextPageToken. - */ - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The continuation token, used to page through large result sets. Provide
-     * this value in a subsequent request to return the next page of results.
-     * 
- * - * string next_page_token = 2; - * - * @return The bytes for nextPageToken. - */ - public com.google.protobuf.ByteString getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The continuation token, used to page through large result sets. Provide
-     * this value in a subsequent request to return the next page of results.
-     * 
- * - * string next_page_token = 2; - * - * @param value The nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageToken(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nextPageToken_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The continuation token, used to page through large result sets. Provide
-     * this value in a subsequent request to return the next page of results.
-     * 
- * - * string next_page_token = 2; - * - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - - nextPageToken_ = getDefaultInstance().getNextPageToken(); - onChanged(); - return this; - } - /** - * - * - *
-     * The continuation token, used to page through large result sets. Provide
-     * this value in a subsequent request to return the next page of results.
-     * 
- * - * string next_page_token = 2; - * - * @param value The bytes for nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nextPageToken_ = value; - 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.ListHmacKeysResponse) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.ListHmacKeysResponse) - private static final com.google.storage.v2.ListHmacKeysResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.ListHmacKeysResponse(); - } - - public static com.google.storage.v2.ListHmacKeysResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListHmacKeysResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListHmacKeysResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.ListHmacKeysResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListHmacKeysResponseOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListHmacKeysResponseOrBuilder.java deleted file mode 100644 index fc777c3430..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListHmacKeysResponseOrBuilder.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface ListHmacKeysResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.ListHmacKeysResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - java.util.List getHmacKeysList(); - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - com.google.storage.v2.HmacKeyMetadata getHmacKeys(int index); - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - int getHmacKeysCount(); - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - java.util.List - getHmacKeysOrBuilderList(); - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.HmacKeyMetadata hmac_keys = 1; - */ - com.google.storage.v2.HmacKeyMetadataOrBuilder getHmacKeysOrBuilder(int index); - - /** - * - * - *
-   * The continuation token, used to page through large result sets. Provide
-   * this value in a subsequent request to return the next page of results.
-   * 
- * - * string next_page_token = 2; - * - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - * - * - *
-   * The continuation token, used to page through large result sets. Provide
-   * this value in a subsequent request to return the next page of results.
-   * 
- * - * string next_page_token = 2; - * - * @return The bytes for nextPageToken. - */ - com.google.protobuf.ByteString getNextPageTokenBytes(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationsRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationsRequest.java deleted file mode 100644 index 5ea2ecce0b..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationsRequest.java +++ /dev/null @@ -1,946 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request message for ListNotifications.
- * 
- * - * Protobuf type {@code google.storage.v2.ListNotificationsRequest} - */ -public final class ListNotificationsRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.ListNotificationsRequest) - ListNotificationsRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListNotificationsRequest.newBuilder() to construct. - private ListNotificationsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListNotificationsRequest() { - parent_ = ""; - pageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListNotificationsRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ListNotificationsRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 16: - { - pageSize_ = input.readInt32(); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListNotificationsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListNotificationsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ListNotificationsRequest.class, - com.google.storage.v2.ListNotificationsRequest.Builder.class); - } - - public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; - /** - * - * - *
-   * Required. Name of a Google Cloud Storage bucket.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - @java.lang.Override - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } - } - /** - * - * - *
-   * Required. Name of a Google Cloud Storage bucket.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - @java.lang.Override - public com.google.protobuf.ByteString getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 2; - private int pageSize_; - /** - * - * - *
-   * The maximum number of notifications to return. The service may return fewer
-   * than this value.
-   * The maximum value is 100; values above 100 will be coerced to 100.
-   * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 3; - private volatile java.lang.Object pageToken_; - /** - * - * - *
-   * A page token, received from a previous `ListNotifications` call.
-   * Provide this to retrieve the subsequent page.
-   * When paginating, all other parameters provided to `ListNotifications` must
-   * match the call that provided the page token.
-   * 
- * - * string page_token = 3; - * - * @return The pageToken. - */ - @java.lang.Override - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } - } - /** - * - * - *
-   * A page token, received from a previous `ListNotifications` call.
-   * Provide this to retrieve the subsequent page.
-   * When paginating, all other parameters provided to `ListNotifications` must
-   * match the call that provided the page token.
-   * 
- * - * string page_token = 3; - * - * @return The bytes for pageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); - } - if (pageSize_ != 0) { - output.writeInt32(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); - } - if (pageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.ListNotificationsRequest)) { - return super.equals(obj); - } - com.google.storage.v2.ListNotificationsRequest other = - (com.google.storage.v2.ListNotificationsRequest) obj; - - if (!getParent().equals(other.getParent())) return false; - if (getPageSize() != other.getPageSize()) return false; - if (!getPageToken().equals(other.getPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PARENT_FIELD_NUMBER; - hash = (53 * hash) + getParent().hashCode(); - hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getPageSize(); - hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.ListNotificationsRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListNotificationsRequest 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.ListNotificationsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListNotificationsRequest 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.ListNotificationsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListNotificationsRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ListNotificationsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListNotificationsRequest 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.ListNotificationsRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListNotificationsRequest 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.ListNotificationsRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListNotificationsRequest 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.ListNotificationsRequest 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 ListNotifications.
-   * 
- * - * Protobuf type {@code google.storage.v2.ListNotificationsRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.ListNotificationsRequest) - com.google.storage.v2.ListNotificationsRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListNotificationsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListNotificationsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ListNotificationsRequest.class, - com.google.storage.v2.ListNotificationsRequest.Builder.class); - } - - // Construct using com.google.storage.v2.ListNotificationsRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - parent_ = ""; - - pageSize_ = 0; - - pageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListNotificationsRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.ListNotificationsRequest getDefaultInstanceForType() { - return com.google.storage.v2.ListNotificationsRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.ListNotificationsRequest build() { - com.google.storage.v2.ListNotificationsRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.ListNotificationsRequest buildPartial() { - com.google.storage.v2.ListNotificationsRequest result = - new com.google.storage.v2.ListNotificationsRequest(this); - result.parent_ = parent_; - result.pageSize_ = pageSize_; - result.pageToken_ = pageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.ListNotificationsRequest) { - return mergeFrom((com.google.storage.v2.ListNotificationsRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.ListNotificationsRequest other) { - if (other == com.google.storage.v2.ListNotificationsRequest.getDefaultInstance()) return this; - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.ListNotificationsRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.ListNotificationsRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object parent_ = ""; - /** - * - * - *
-     * Required. Name of a Google Cloud Storage bucket.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. Name of a Google Cloud Storage bucket.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - public com.google.protobuf.ByteString getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. Name of a Google Cloud Storage bucket.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The parent to set. - * @return This builder for chaining. - */ - public Builder setParent(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - parent_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of a Google Cloud Storage bucket.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearParent() { - - parent_ = getDefaultInstance().getParent(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of a Google Cloud Storage bucket.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for parent to set. - * @return This builder for chaining. - */ - public Builder setParentBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - parent_ = value; - onChanged(); - return this; - } - - private int pageSize_; - /** - * - * - *
-     * The maximum number of notifications to return. The service may return fewer
-     * than this value.
-     * The maximum value is 100; values above 100 will be coerced to 100.
-     * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - * - * - *
-     * The maximum number of notifications to return. The service may return fewer
-     * than this value.
-     * The maximum value is 100; values above 100 will be coerced to 100.
-     * 
- * - * int32 page_size = 2; - * - * @param value The pageSize to set. - * @return This builder for chaining. - */ - public Builder setPageSize(int value) { - - pageSize_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The maximum number of notifications to return. The service may return fewer
-     * than this value.
-     * The maximum value is 100; values above 100 will be coerced to 100.
-     * 
- * - * int32 page_size = 2; - * - * @return This builder for chaining. - */ - public Builder clearPageSize() { - - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - * - * - *
-     * A page token, received from a previous `ListNotifications` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListNotifications` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * - * @return The pageToken. - */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * A page token, received from a previous `ListNotifications` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListNotifications` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * - * @return The bytes for pageToken. - */ - public com.google.protobuf.ByteString getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * A page token, received from a previous `ListNotifications` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListNotifications` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * - * @param value The pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageToken(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pageToken_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * A page token, received from a previous `ListNotifications` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListNotifications` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * - * @return This builder for chaining. - */ - public Builder clearPageToken() { - - pageToken_ = getDefaultInstance().getPageToken(); - onChanged(); - return this; - } - /** - * - * - *
-     * A page token, received from a previous `ListNotifications` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListNotifications` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * - * @param value The bytes for pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pageToken_ = value; - onChanged(); - return this; - } - - @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.ListNotificationsRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.ListNotificationsRequest) - private static final com.google.storage.v2.ListNotificationsRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.ListNotificationsRequest(); - } - - public static com.google.storage.v2.ListNotificationsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListNotificationsRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListNotificationsRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.ListNotificationsRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationsRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationsRequestOrBuilder.java deleted file mode 100644 index a078cac394..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationsRequestOrBuilder.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface ListNotificationsRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.ListNotificationsRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Name of a Google Cloud Storage bucket.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - java.lang.String getParent(); - /** - * - * - *
-   * Required. Name of a Google Cloud Storage bucket.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - com.google.protobuf.ByteString getParentBytes(); - - /** - * - * - *
-   * The maximum number of notifications to return. The service may return fewer
-   * than this value.
-   * The maximum value is 100; values above 100 will be coerced to 100.
-   * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - int getPageSize(); - - /** - * - * - *
-   * A page token, received from a previous `ListNotifications` call.
-   * Provide this to retrieve the subsequent page.
-   * When paginating, all other parameters provided to `ListNotifications` must
-   * match the call that provided the page token.
-   * 
- * - * string page_token = 3; - * - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - * - * - *
-   * A page token, received from a previous `ListNotifications` call.
-   * Provide this to retrieve the subsequent page.
-   * When paginating, all other parameters provided to `ListNotifications` must
-   * match the call that provided the page token.
-   * 
- * - * string page_token = 3; - * - * @return The bytes for pageToken. - */ - com.google.protobuf.ByteString getPageTokenBytes(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationsResponse.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationsResponse.java deleted file mode 100644 index 1652dbe923..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationsResponse.java +++ /dev/null @@ -1,1138 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * The result of a call to Notifications.ListNotifications
- * 
- * - * Protobuf type {@code google.storage.v2.ListNotificationsResponse} - */ -public final class ListNotificationsResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.ListNotificationsResponse) - ListNotificationsResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListNotificationsResponse.newBuilder() to construct. - private ListNotificationsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListNotificationsResponse() { - notifications_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListNotificationsResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ListNotificationsResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - notifications_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - notifications_.add( - input.readMessage( - com.google.storage.v2.Notification.parser(), extensionRegistry)); - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - notifications_ = java.util.Collections.unmodifiableList(notifications_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListNotificationsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListNotificationsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ListNotificationsResponse.class, - com.google.storage.v2.ListNotificationsResponse.Builder.class); - } - - public static final int NOTIFICATIONS_FIELD_NUMBER = 1; - private java.util.List notifications_; - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - @java.lang.Override - public java.util.List getNotificationsList() { - return notifications_; - } - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - @java.lang.Override - public java.util.List - getNotificationsOrBuilderList() { - return notifications_; - } - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - @java.lang.Override - public int getNotificationsCount() { - return notifications_.size(); - } - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - @java.lang.Override - public com.google.storage.v2.Notification getNotifications(int index) { - return notifications_.get(index); - } - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - @java.lang.Override - public com.google.storage.v2.NotificationOrBuilder getNotificationsOrBuilder(int index) { - return notifications_.get(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; - /** - * - * - *
-   * A token, which can be sent as `page_token` to retrieve the next page.
-   * If this field is omitted, there are no subsequent pages.
-   * 
- * - * string next_page_token = 2; - * - * @return The nextPageToken. - */ - @java.lang.Override - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } - } - /** - * - * - *
-   * A token, which can be sent as `page_token` to retrieve the next page.
-   * If this field is omitted, there are no subsequent pages.
-   * 
- * - * string next_page_token = 2; - * - * @return The bytes for nextPageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 < notifications_.size(); i++) { - output.writeMessage(1, notifications_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < notifications_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, notifications_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.ListNotificationsResponse)) { - return super.equals(obj); - } - com.google.storage.v2.ListNotificationsResponse other = - (com.google.storage.v2.ListNotificationsResponse) obj; - - if (!getNotificationsList().equals(other.getNotificationsList())) return false; - if (!getNextPageToken().equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getNotificationsCount() > 0) { - hash = (37 * hash) + NOTIFICATIONS_FIELD_NUMBER; - hash = (53 * hash) + getNotificationsList().hashCode(); - } - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.ListNotificationsResponse parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListNotificationsResponse 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.ListNotificationsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListNotificationsResponse 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.ListNotificationsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListNotificationsResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ListNotificationsResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListNotificationsResponse 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.ListNotificationsResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListNotificationsResponse 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.ListNotificationsResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListNotificationsResponse 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.ListNotificationsResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * The result of a call to Notifications.ListNotifications
-   * 
- * - * Protobuf type {@code google.storage.v2.ListNotificationsResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.ListNotificationsResponse) - com.google.storage.v2.ListNotificationsResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListNotificationsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListNotificationsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ListNotificationsResponse.class, - com.google.storage.v2.ListNotificationsResponse.Builder.class); - } - - // Construct using com.google.storage.v2.ListNotificationsResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getNotificationsFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (notificationsBuilder_ == null) { - notifications_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - notificationsBuilder_.clear(); - } - nextPageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListNotificationsResponse_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.ListNotificationsResponse getDefaultInstanceForType() { - return com.google.storage.v2.ListNotificationsResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.ListNotificationsResponse build() { - com.google.storage.v2.ListNotificationsResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.ListNotificationsResponse buildPartial() { - com.google.storage.v2.ListNotificationsResponse result = - new com.google.storage.v2.ListNotificationsResponse(this); - int from_bitField0_ = bitField0_; - if (notificationsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - notifications_ = java.util.Collections.unmodifiableList(notifications_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.notifications_ = notifications_; - } else { - result.notifications_ = notificationsBuilder_.build(); - } - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.ListNotificationsResponse) { - return mergeFrom((com.google.storage.v2.ListNotificationsResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.ListNotificationsResponse other) { - if (other == com.google.storage.v2.ListNotificationsResponse.getDefaultInstance()) - return this; - if (notificationsBuilder_ == null) { - if (!other.notifications_.isEmpty()) { - if (notifications_.isEmpty()) { - notifications_ = other.notifications_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureNotificationsIsMutable(); - notifications_.addAll(other.notifications_); - } - onChanged(); - } - } else { - if (!other.notifications_.isEmpty()) { - if (notificationsBuilder_.isEmpty()) { - notificationsBuilder_.dispose(); - notificationsBuilder_ = null; - notifications_ = other.notifications_; - bitField0_ = (bitField0_ & ~0x00000001); - notificationsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getNotificationsFieldBuilder() - : null; - } else { - notificationsBuilder_.addAllMessages(other.notifications_); - } - } - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.ListNotificationsResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.ListNotificationsResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.util.List notifications_ = - java.util.Collections.emptyList(); - - private void ensureNotificationsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - notifications_ = - new java.util.ArrayList(notifications_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.Notification, - com.google.storage.v2.Notification.Builder, - com.google.storage.v2.NotificationOrBuilder> - notificationsBuilder_; - - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - public java.util.List getNotificationsList() { - if (notificationsBuilder_ == null) { - return java.util.Collections.unmodifiableList(notifications_); - } else { - return notificationsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - public int getNotificationsCount() { - if (notificationsBuilder_ == null) { - return notifications_.size(); - } else { - return notificationsBuilder_.getCount(); - } - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - public com.google.storage.v2.Notification getNotifications(int index) { - if (notificationsBuilder_ == null) { - return notifications_.get(index); - } else { - return notificationsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - public Builder setNotifications(int index, com.google.storage.v2.Notification value) { - if (notificationsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNotificationsIsMutable(); - notifications_.set(index, value); - onChanged(); - } else { - notificationsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - public Builder setNotifications( - int index, com.google.storage.v2.Notification.Builder builderForValue) { - if (notificationsBuilder_ == null) { - ensureNotificationsIsMutable(); - notifications_.set(index, builderForValue.build()); - onChanged(); - } else { - notificationsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - public Builder addNotifications(com.google.storage.v2.Notification value) { - if (notificationsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNotificationsIsMutable(); - notifications_.add(value); - onChanged(); - } else { - notificationsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - public Builder addNotifications(int index, com.google.storage.v2.Notification value) { - if (notificationsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNotificationsIsMutable(); - notifications_.add(index, value); - onChanged(); - } else { - notificationsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - public Builder addNotifications(com.google.storage.v2.Notification.Builder builderForValue) { - if (notificationsBuilder_ == null) { - ensureNotificationsIsMutable(); - notifications_.add(builderForValue.build()); - onChanged(); - } else { - notificationsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - public Builder addNotifications( - int index, com.google.storage.v2.Notification.Builder builderForValue) { - if (notificationsBuilder_ == null) { - ensureNotificationsIsMutable(); - notifications_.add(index, builderForValue.build()); - onChanged(); - } else { - notificationsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - public Builder addAllNotifications( - java.lang.Iterable values) { - if (notificationsBuilder_ == null) { - ensureNotificationsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, notifications_); - onChanged(); - } else { - notificationsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - public Builder clearNotifications() { - if (notificationsBuilder_ == null) { - notifications_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - notificationsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - public Builder removeNotifications(int index) { - if (notificationsBuilder_ == null) { - ensureNotificationsIsMutable(); - notifications_.remove(index); - onChanged(); - } else { - notificationsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - public com.google.storage.v2.Notification.Builder getNotificationsBuilder(int index) { - return getNotificationsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - public com.google.storage.v2.NotificationOrBuilder getNotificationsOrBuilder(int index) { - if (notificationsBuilder_ == null) { - return notifications_.get(index); - } else { - return notificationsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - public java.util.List - getNotificationsOrBuilderList() { - if (notificationsBuilder_ != null) { - return notificationsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(notifications_); - } - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - public com.google.storage.v2.Notification.Builder addNotificationsBuilder() { - return getNotificationsFieldBuilder() - .addBuilder(com.google.storage.v2.Notification.getDefaultInstance()); - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - public com.google.storage.v2.Notification.Builder addNotificationsBuilder(int index) { - return getNotificationsFieldBuilder() - .addBuilder(index, com.google.storage.v2.Notification.getDefaultInstance()); - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - public java.util.List - getNotificationsBuilderList() { - return getNotificationsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.Notification, - com.google.storage.v2.Notification.Builder, - com.google.storage.v2.NotificationOrBuilder> - getNotificationsFieldBuilder() { - if (notificationsBuilder_ == null) { - notificationsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.Notification, - com.google.storage.v2.Notification.Builder, - com.google.storage.v2.NotificationOrBuilder>( - notifications_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - notifications_ = null; - } - return notificationsBuilder_; - } - - private java.lang.Object nextPageToken_ = ""; - /** - * - * - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * - * @return The nextPageToken. - */ - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * - * @return The bytes for nextPageToken. - */ - public com.google.protobuf.ByteString getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * - * @param value The nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageToken(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nextPageToken_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - - nextPageToken_ = getDefaultInstance().getNextPageToken(); - onChanged(); - return this; - } - /** - * - * - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * - * @param value The bytes for nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nextPageToken_ = value; - onChanged(); - return this; - } - - @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.ListNotificationsResponse) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.ListNotificationsResponse) - private static final com.google.storage.v2.ListNotificationsResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.ListNotificationsResponse(); - } - - public static com.google.storage.v2.ListNotificationsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListNotificationsResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListNotificationsResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.ListNotificationsResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationsResponseOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationsResponseOrBuilder.java deleted file mode 100644 index 3abe122daa..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationsResponseOrBuilder.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface ListNotificationsResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.ListNotificationsResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - java.util.List getNotificationsList(); - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - com.google.storage.v2.Notification getNotifications(int index); - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - int getNotificationsCount(); - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - java.util.List - getNotificationsOrBuilderList(); - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Notification notifications = 1; - */ - com.google.storage.v2.NotificationOrBuilder getNotificationsOrBuilder(int index); - - /** - * - * - *
-   * A token, which can be sent as `page_token` to retrieve the next page.
-   * If this field is omitted, there are no subsequent pages.
-   * 
- * - * string next_page_token = 2; - * - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - * - * - *
-   * A token, which can be sent as `page_token` to retrieve the next page.
-   * If this field is omitted, there are no subsequent pages.
-   * 
- * - * string next_page_token = 2; - * - * @return The bytes for nextPageToken. - */ - com.google.protobuf.ByteString getNextPageTokenBytes(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListObjectsRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListObjectsRequest.java deleted file mode 100644 index a808876ea0..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListObjectsRequest.java +++ /dev/null @@ -1,2523 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request message for ListObjects.
- * 
- * - * Protobuf type {@code google.storage.v2.ListObjectsRequest} - */ -public final class ListObjectsRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.ListObjectsRequest) - ListObjectsRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListObjectsRequest.newBuilder() to construct. - private ListObjectsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListObjectsRequest() { - parent_ = ""; - pageToken_ = ""; - delimiter_ = ""; - prefix_ = ""; - lexicographicStart_ = ""; - lexicographicEnd_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListObjectsRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ListObjectsRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 16: - { - pageSize_ = input.readInt32(); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - - delimiter_ = s; - break; - } - case 40: - { - includeTrailingDelimiter_ = input.readBool(); - break; - } - case 50: - { - java.lang.String s = input.readStringRequireUtf8(); - - prefix_ = s; - break; - } - case 56: - { - versions_ = input.readBool(); - break; - } - case 66: - { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) != 0)) { - subBuilder = readMask_.toBuilder(); - } - readMask_ = - input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(readMask_); - readMask_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - case 74: - { - com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; - if (commonRequestParams_ != null) { - subBuilder = commonRequestParams_.toBuilder(); - } - commonRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonRequestParams_); - commonRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - case 82: - { - java.lang.String s = input.readStringRequireUtf8(); - - lexicographicStart_ = s; - break; - } - case 90: - { - java.lang.String s = input.readStringRequireUtf8(); - - lexicographicEnd_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListObjectsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListObjectsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ListObjectsRequest.class, - com.google.storage.v2.ListObjectsRequest.Builder.class); - } - - private int bitField0_; - public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; - /** - * - * - *
-   * Required. Name of the bucket in which to look for objects.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - @java.lang.Override - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } - } - /** - * - * - *
-   * Required. Name of the bucket in which to look for objects.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - @java.lang.Override - public com.google.protobuf.ByteString getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 2; - private int pageSize_; - /** - * - * - *
-   * Maximum number of `items` plus `prefixes` to return
-   * in a single page of responses. As duplicate `prefixes` are
-   * omitted, fewer total results may be returned than requested. The service
-   * will use this parameter or 1,000 items, whichever is smaller.
-   * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 3; - private volatile java.lang.Object pageToken_; - /** - * - * - *
-   * A previously-returned page token representing part of the larger set of
-   * results to view.
-   * 
- * - * string page_token = 3; - * - * @return The pageToken. - */ - @java.lang.Override - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } - } - /** - * - * - *
-   * A previously-returned page token representing part of the larger set of
-   * results to view.
-   * 
- * - * string page_token = 3; - * - * @return The bytes for pageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DELIMITER_FIELD_NUMBER = 4; - private volatile java.lang.Object delimiter_; - /** - * - * - *
-   * If set, returns results in a directory-like mode. `items` will contain
-   * only objects whose names, aside from the `prefix`, do not
-   * contain `delimiter`. Objects whose names, aside from the
-   * `prefix`, contain `delimiter` will have their name,
-   * truncated after the `delimiter`, returned in
-   * `prefixes`. Duplicate `prefixes` are omitted.
-   * 
- * - * string delimiter = 4; - * - * @return The delimiter. - */ - @java.lang.Override - public java.lang.String getDelimiter() { - java.lang.Object ref = delimiter_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - delimiter_ = s; - return s; - } - } - /** - * - * - *
-   * If set, returns results in a directory-like mode. `items` will contain
-   * only objects whose names, aside from the `prefix`, do not
-   * contain `delimiter`. Objects whose names, aside from the
-   * `prefix`, contain `delimiter` will have their name,
-   * truncated after the `delimiter`, returned in
-   * `prefixes`. Duplicate `prefixes` are omitted.
-   * 
- * - * string delimiter = 4; - * - * @return The bytes for delimiter. - */ - @java.lang.Override - public com.google.protobuf.ByteString getDelimiterBytes() { - java.lang.Object ref = delimiter_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - delimiter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int INCLUDE_TRAILING_DELIMITER_FIELD_NUMBER = 5; - private boolean includeTrailingDelimiter_; - /** - * - * - *
-   * If true, objects that end in exactly one instance of `delimiter`
-   * will have their metadata included in `items` in addition to
-   * `prefixes`.
-   * 
- * - * bool include_trailing_delimiter = 5; - * - * @return The includeTrailingDelimiter. - */ - @java.lang.Override - public boolean getIncludeTrailingDelimiter() { - return includeTrailingDelimiter_; - } - - public static final int PREFIX_FIELD_NUMBER = 6; - private volatile java.lang.Object prefix_; - /** - * - * - *
-   * Filter results to objects whose names begin with this prefix.
-   * 
- * - * string prefix = 6; - * - * @return The prefix. - */ - @java.lang.Override - public java.lang.String getPrefix() { - java.lang.Object ref = prefix_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - prefix_ = s; - return s; - } - } - /** - * - * - *
-   * Filter results to objects whose names begin with this prefix.
-   * 
- * - * string prefix = 6; - * - * @return The bytes for prefix. - */ - @java.lang.Override - public com.google.protobuf.ByteString getPrefixBytes() { - java.lang.Object ref = prefix_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - prefix_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int VERSIONS_FIELD_NUMBER = 7; - private boolean versions_; - /** - * - * - *
-   * If `true`, lists all versions of an object as distinct results.
-   * For more information, see
-   * [Object
-   * Versioning](https://cloud.google.com/storage/docs/object-versioning).
-   * 
- * - * bool versions = 7; - * - * @return The versions. - */ - @java.lang.Override - public boolean getVersions() { - return versions_; - } - - public static final int READ_MASK_FIELD_NUMBER = 8; - private com.google.protobuf.FieldMask readMask_; - /** - * - * - *
-   * Mask specifying which fields to read from each result.
-   * If no mask is specified, will default to all fields except items.acl and
-   * items.owner.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 8; - * - * @return Whether the readMask field is set. - */ - @java.lang.Override - public boolean hasReadMask() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-   * Mask specifying which fields to read from each result.
-   * If no mask is specified, will default to all fields except items.acl and
-   * items.owner.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 8; - * - * @return The readMask. - */ - @java.lang.Override - public com.google.protobuf.FieldMask getReadMask() { - return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; - } - /** - * - * - *
-   * Mask specifying which fields to read from each result.
-   * If no mask is specified, will default to all fields except items.acl and
-   * items.owner.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 8; - */ - @java.lang.Override - public com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder() { - return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; - } - - public static final int LEXICOGRAPHIC_START_FIELD_NUMBER = 10; - private volatile java.lang.Object lexicographicStart_; - /** - * - * - *
-   * Filter results to objects whose names are lexicographically equal to or
-   * after lexicographic_start. If lexicographic_end is also set, the objects
-   * listed have names between lexicographic_start (inclusive) and
-   * lexicographic_end (exclusive).
-   * 
- * - * string lexicographic_start = 10; - * - * @return The lexicographicStart. - */ - @java.lang.Override - public java.lang.String getLexicographicStart() { - java.lang.Object ref = lexicographicStart_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - lexicographicStart_ = s; - return s; - } - } - /** - * - * - *
-   * Filter results to objects whose names are lexicographically equal to or
-   * after lexicographic_start. If lexicographic_end is also set, the objects
-   * listed have names between lexicographic_start (inclusive) and
-   * lexicographic_end (exclusive).
-   * 
- * - * string lexicographic_start = 10; - * - * @return The bytes for lexicographicStart. - */ - @java.lang.Override - public com.google.protobuf.ByteString getLexicographicStartBytes() { - java.lang.Object ref = lexicographicStart_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - lexicographicStart_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int LEXICOGRAPHIC_END_FIELD_NUMBER = 11; - private volatile java.lang.Object lexicographicEnd_; - /** - * - * - *
-   * Filter results to objects whose names are lexicographically before
-   * lexicographic_end. If lexicographic_start is also set, the objects listed
-   * have names between lexicographic_start (inclusive) and lexicographic_end
-   * (exclusive).
-   * 
- * - * string lexicographic_end = 11; - * - * @return The lexicographicEnd. - */ - @java.lang.Override - public java.lang.String getLexicographicEnd() { - java.lang.Object ref = lexicographicEnd_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - lexicographicEnd_ = s; - return s; - } - } - /** - * - * - *
-   * Filter results to objects whose names are lexicographically before
-   * lexicographic_end. If lexicographic_start is also set, the objects listed
-   * have names between lexicographic_start (inclusive) and lexicographic_end
-   * (exclusive).
-   * 
- * - * string lexicographic_end = 11; - * - * @return The bytes for lexicographicEnd. - */ - @java.lang.Override - public com.google.protobuf.ByteString getLexicographicEndBytes() { - java.lang.Object ref = lexicographicEnd_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - lexicographicEnd_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 9; - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return Whether the commonRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonRequestParams() { - return commonRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return The commonRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - return getCommonRequestParams(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); - } - if (pageSize_ != 0) { - output.writeInt32(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(delimiter_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, delimiter_); - } - if (includeTrailingDelimiter_ != false) { - output.writeBool(5, includeTrailingDelimiter_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(prefix_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, prefix_); - } - if (versions_ != false) { - output.writeBool(7, versions_); - } - if (((bitField0_ & 0x00000001) != 0)) { - output.writeMessage(8, getReadMask()); - } - if (commonRequestParams_ != null) { - output.writeMessage(9, getCommonRequestParams()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lexicographicStart_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 10, lexicographicStart_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lexicographicEnd_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 11, lexicographicEnd_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); - } - if (pageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(delimiter_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, delimiter_); - } - if (includeTrailingDelimiter_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, includeTrailingDelimiter_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(prefix_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, prefix_); - } - if (versions_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, versions_); - } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getReadMask()); - } - if (commonRequestParams_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getCommonRequestParams()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lexicographicStart_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, lexicographicStart_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lexicographicEnd_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, lexicographicEnd_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.ListObjectsRequest)) { - return super.equals(obj); - } - com.google.storage.v2.ListObjectsRequest other = (com.google.storage.v2.ListObjectsRequest) obj; - - if (!getParent().equals(other.getParent())) return false; - if (getPageSize() != other.getPageSize()) return false; - if (!getPageToken().equals(other.getPageToken())) return false; - if (!getDelimiter().equals(other.getDelimiter())) return false; - if (getIncludeTrailingDelimiter() != other.getIncludeTrailingDelimiter()) return false; - if (!getPrefix().equals(other.getPrefix())) return false; - if (getVersions() != other.getVersions()) return false; - if (hasReadMask() != other.hasReadMask()) return false; - if (hasReadMask()) { - if (!getReadMask().equals(other.getReadMask())) return false; - } - if (!getLexicographicStart().equals(other.getLexicographicStart())) return false; - if (!getLexicographicEnd().equals(other.getLexicographicEnd())) return false; - if (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; - if (hasCommonRequestParams()) { - if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PARENT_FIELD_NUMBER; - hash = (53 * hash) + getParent().hashCode(); - hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getPageSize(); - hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getPageToken().hashCode(); - hash = (37 * hash) + DELIMITER_FIELD_NUMBER; - hash = (53 * hash) + getDelimiter().hashCode(); - hash = (37 * hash) + INCLUDE_TRAILING_DELIMITER_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIncludeTrailingDelimiter()); - hash = (37 * hash) + PREFIX_FIELD_NUMBER; - hash = (53 * hash) + getPrefix().hashCode(); - hash = (37 * hash) + VERSIONS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getVersions()); - if (hasReadMask()) { - hash = (37 * hash) + READ_MASK_FIELD_NUMBER; - hash = (53 * hash) + getReadMask().hashCode(); - } - hash = (37 * hash) + LEXICOGRAPHIC_START_FIELD_NUMBER; - hash = (53 * hash) + getLexicographicStart().hashCode(); - hash = (37 * hash) + LEXICOGRAPHIC_END_FIELD_NUMBER; - hash = (53 * hash) + getLexicographicEnd().hashCode(); - if (hasCommonRequestParams()) { - hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonRequestParams().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.ListObjectsRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListObjectsRequest 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.ListObjectsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListObjectsRequest 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.ListObjectsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListObjectsRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ListObjectsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListObjectsRequest 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.ListObjectsRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListObjectsRequest 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.ListObjectsRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListObjectsRequest 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.ListObjectsRequest 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 ListObjects.
-   * 
- * - * Protobuf type {@code google.storage.v2.ListObjectsRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.ListObjectsRequest) - com.google.storage.v2.ListObjectsRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListObjectsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListObjectsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ListObjectsRequest.class, - com.google.storage.v2.ListObjectsRequest.Builder.class); - } - - // Construct using com.google.storage.v2.ListObjectsRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getReadMaskFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - parent_ = ""; - - pageSize_ = 0; - - pageToken_ = ""; - - delimiter_ = ""; - - includeTrailingDelimiter_ = false; - - prefix_ = ""; - - versions_ = false; - - if (readMaskBuilder_ == null) { - readMask_ = null; - } else { - readMaskBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - lexicographicStart_ = ""; - - lexicographicEnd_ = ""; - - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListObjectsRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.ListObjectsRequest getDefaultInstanceForType() { - return com.google.storage.v2.ListObjectsRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.ListObjectsRequest build() { - com.google.storage.v2.ListObjectsRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.ListObjectsRequest buildPartial() { - com.google.storage.v2.ListObjectsRequest result = - new com.google.storage.v2.ListObjectsRequest(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - result.parent_ = parent_; - result.pageSize_ = pageSize_; - result.pageToken_ = pageToken_; - result.delimiter_ = delimiter_; - result.includeTrailingDelimiter_ = includeTrailingDelimiter_; - result.prefix_ = prefix_; - result.versions_ = versions_; - if (((from_bitField0_ & 0x00000001) != 0)) { - if (readMaskBuilder_ == null) { - result.readMask_ = readMask_; - } else { - result.readMask_ = readMaskBuilder_.build(); - } - to_bitField0_ |= 0x00000001; - } - result.lexicographicStart_ = lexicographicStart_; - result.lexicographicEnd_ = lexicographicEnd_; - if (commonRequestParamsBuilder_ == null) { - result.commonRequestParams_ = commonRequestParams_; - } else { - result.commonRequestParams_ = commonRequestParamsBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.ListObjectsRequest) { - return mergeFrom((com.google.storage.v2.ListObjectsRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.ListObjectsRequest other) { - if (other == com.google.storage.v2.ListObjectsRequest.getDefaultInstance()) return this; - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - onChanged(); - } - if (!other.getDelimiter().isEmpty()) { - delimiter_ = other.delimiter_; - onChanged(); - } - if (other.getIncludeTrailingDelimiter() != false) { - setIncludeTrailingDelimiter(other.getIncludeTrailingDelimiter()); - } - if (!other.getPrefix().isEmpty()) { - prefix_ = other.prefix_; - onChanged(); - } - if (other.getVersions() != false) { - setVersions(other.getVersions()); - } - if (other.hasReadMask()) { - mergeReadMask(other.getReadMask()); - } - if (!other.getLexicographicStart().isEmpty()) { - lexicographicStart_ = other.lexicographicStart_; - onChanged(); - } - if (!other.getLexicographicEnd().isEmpty()) { - lexicographicEnd_ = other.lexicographicEnd_; - onChanged(); - } - if (other.hasCommonRequestParams()) { - mergeCommonRequestParams(other.getCommonRequestParams()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.ListObjectsRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.ListObjectsRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object parent_ = ""; - /** - * - * - *
-     * Required. Name of the bucket in which to look for objects.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. Name of the bucket in which to look for objects.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - public com.google.protobuf.ByteString getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. Name of the bucket in which to look for objects.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The parent to set. - * @return This builder for chaining. - */ - public Builder setParent(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - parent_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of the bucket in which to look for objects.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearParent() { - - parent_ = getDefaultInstance().getParent(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of the bucket in which to look for objects.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for parent to set. - * @return This builder for chaining. - */ - public Builder setParentBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - parent_ = value; - onChanged(); - return this; - } - - private int pageSize_; - /** - * - * - *
-     * Maximum number of `items` plus `prefixes` to return
-     * in a single page of responses. As duplicate `prefixes` are
-     * omitted, fewer total results may be returned than requested. The service
-     * will use this parameter or 1,000 items, whichever is smaller.
-     * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - * - * - *
-     * Maximum number of `items` plus `prefixes` to return
-     * in a single page of responses. As duplicate `prefixes` are
-     * omitted, fewer total results may be returned than requested. The service
-     * will use this parameter or 1,000 items, whichever is smaller.
-     * 
- * - * int32 page_size = 2; - * - * @param value The pageSize to set. - * @return This builder for chaining. - */ - public Builder setPageSize(int value) { - - pageSize_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Maximum number of `items` plus `prefixes` to return
-     * in a single page of responses. As duplicate `prefixes` are
-     * omitted, fewer total results may be returned than requested. The service
-     * will use this parameter or 1,000 items, whichever is smaller.
-     * 
- * - * int32 page_size = 2; - * - * @return This builder for chaining. - */ - public Builder clearPageSize() { - - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - * - * - *
-     * A previously-returned page token representing part of the larger set of
-     * results to view.
-     * 
- * - * string page_token = 3; - * - * @return The pageToken. - */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * A previously-returned page token representing part of the larger set of
-     * results to view.
-     * 
- * - * string page_token = 3; - * - * @return The bytes for pageToken. - */ - public com.google.protobuf.ByteString getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * A previously-returned page token representing part of the larger set of
-     * results to view.
-     * 
- * - * string page_token = 3; - * - * @param value The pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageToken(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pageToken_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * A previously-returned page token representing part of the larger set of
-     * results to view.
-     * 
- * - * string page_token = 3; - * - * @return This builder for chaining. - */ - public Builder clearPageToken() { - - pageToken_ = getDefaultInstance().getPageToken(); - onChanged(); - return this; - } - /** - * - * - *
-     * A previously-returned page token representing part of the larger set of
-     * results to view.
-     * 
- * - * string page_token = 3; - * - * @param value The bytes for pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pageToken_ = value; - onChanged(); - return this; - } - - private java.lang.Object delimiter_ = ""; - /** - * - * - *
-     * If set, returns results in a directory-like mode. `items` will contain
-     * only objects whose names, aside from the `prefix`, do not
-     * contain `delimiter`. Objects whose names, aside from the
-     * `prefix`, contain `delimiter` will have their name,
-     * truncated after the `delimiter`, returned in
-     * `prefixes`. Duplicate `prefixes` are omitted.
-     * 
- * - * string delimiter = 4; - * - * @return The delimiter. - */ - public java.lang.String getDelimiter() { - java.lang.Object ref = delimiter_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - delimiter_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * If set, returns results in a directory-like mode. `items` will contain
-     * only objects whose names, aside from the `prefix`, do not
-     * contain `delimiter`. Objects whose names, aside from the
-     * `prefix`, contain `delimiter` will have their name,
-     * truncated after the `delimiter`, returned in
-     * `prefixes`. Duplicate `prefixes` are omitted.
-     * 
- * - * string delimiter = 4; - * - * @return The bytes for delimiter. - */ - public com.google.protobuf.ByteString getDelimiterBytes() { - java.lang.Object ref = delimiter_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - delimiter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * If set, returns results in a directory-like mode. `items` will contain
-     * only objects whose names, aside from the `prefix`, do not
-     * contain `delimiter`. Objects whose names, aside from the
-     * `prefix`, contain `delimiter` will have their name,
-     * truncated after the `delimiter`, returned in
-     * `prefixes`. Duplicate `prefixes` are omitted.
-     * 
- * - * string delimiter = 4; - * - * @param value The delimiter to set. - * @return This builder for chaining. - */ - public Builder setDelimiter(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - delimiter_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If set, returns results in a directory-like mode. `items` will contain
-     * only objects whose names, aside from the `prefix`, do not
-     * contain `delimiter`. Objects whose names, aside from the
-     * `prefix`, contain `delimiter` will have their name,
-     * truncated after the `delimiter`, returned in
-     * `prefixes`. Duplicate `prefixes` are omitted.
-     * 
- * - * string delimiter = 4; - * - * @return This builder for chaining. - */ - public Builder clearDelimiter() { - - delimiter_ = getDefaultInstance().getDelimiter(); - onChanged(); - return this; - } - /** - * - * - *
-     * If set, returns results in a directory-like mode. `items` will contain
-     * only objects whose names, aside from the `prefix`, do not
-     * contain `delimiter`. Objects whose names, aside from the
-     * `prefix`, contain `delimiter` will have their name,
-     * truncated after the `delimiter`, returned in
-     * `prefixes`. Duplicate `prefixes` are omitted.
-     * 
- * - * string delimiter = 4; - * - * @param value The bytes for delimiter to set. - * @return This builder for chaining. - */ - public Builder setDelimiterBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - delimiter_ = value; - onChanged(); - return this; - } - - private boolean includeTrailingDelimiter_; - /** - * - * - *
-     * If true, objects that end in exactly one instance of `delimiter`
-     * will have their metadata included in `items` in addition to
-     * `prefixes`.
-     * 
- * - * bool include_trailing_delimiter = 5; - * - * @return The includeTrailingDelimiter. - */ - @java.lang.Override - public boolean getIncludeTrailingDelimiter() { - return includeTrailingDelimiter_; - } - /** - * - * - *
-     * If true, objects that end in exactly one instance of `delimiter`
-     * will have their metadata included in `items` in addition to
-     * `prefixes`.
-     * 
- * - * bool include_trailing_delimiter = 5; - * - * @param value The includeTrailingDelimiter to set. - * @return This builder for chaining. - */ - public Builder setIncludeTrailingDelimiter(boolean value) { - - includeTrailingDelimiter_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If true, objects that end in exactly one instance of `delimiter`
-     * will have their metadata included in `items` in addition to
-     * `prefixes`.
-     * 
- * - * bool include_trailing_delimiter = 5; - * - * @return This builder for chaining. - */ - public Builder clearIncludeTrailingDelimiter() { - - includeTrailingDelimiter_ = false; - onChanged(); - return this; - } - - private java.lang.Object prefix_ = ""; - /** - * - * - *
-     * Filter results to objects whose names begin with this prefix.
-     * 
- * - * string prefix = 6; - * - * @return The prefix. - */ - public java.lang.String getPrefix() { - java.lang.Object ref = prefix_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - prefix_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Filter results to objects whose names begin with this prefix.
-     * 
- * - * string prefix = 6; - * - * @return The bytes for prefix. - */ - public com.google.protobuf.ByteString getPrefixBytes() { - java.lang.Object ref = prefix_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - prefix_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Filter results to objects whose names begin with this prefix.
-     * 
- * - * string prefix = 6; - * - * @param value The prefix to set. - * @return This builder for chaining. - */ - public Builder setPrefix(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - prefix_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Filter results to objects whose names begin with this prefix.
-     * 
- * - * string prefix = 6; - * - * @return This builder for chaining. - */ - public Builder clearPrefix() { - - prefix_ = getDefaultInstance().getPrefix(); - onChanged(); - return this; - } - /** - * - * - *
-     * Filter results to objects whose names begin with this prefix.
-     * 
- * - * string prefix = 6; - * - * @param value The bytes for prefix to set. - * @return This builder for chaining. - */ - public Builder setPrefixBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - prefix_ = value; - onChanged(); - return this; - } - - private boolean versions_; - /** - * - * - *
-     * If `true`, lists all versions of an object as distinct results.
-     * For more information, see
-     * [Object
-     * Versioning](https://cloud.google.com/storage/docs/object-versioning).
-     * 
- * - * bool versions = 7; - * - * @return The versions. - */ - @java.lang.Override - public boolean getVersions() { - return versions_; - } - /** - * - * - *
-     * If `true`, lists all versions of an object as distinct results.
-     * For more information, see
-     * [Object
-     * Versioning](https://cloud.google.com/storage/docs/object-versioning).
-     * 
- * - * bool versions = 7; - * - * @param value The versions to set. - * @return This builder for chaining. - */ - public Builder setVersions(boolean value) { - - versions_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If `true`, lists all versions of an object as distinct results.
-     * For more information, see
-     * [Object
-     * Versioning](https://cloud.google.com/storage/docs/object-versioning).
-     * 
- * - * bool versions = 7; - * - * @return This builder for chaining. - */ - public Builder clearVersions() { - - versions_ = false; - onChanged(); - return this; - } - - 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 from each result.
-     * If no mask is specified, will default to all fields except items.acl and
-     * items.owner.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 8; - * - * @return Whether the readMask field is set. - */ - public boolean hasReadMask() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-     * Mask specifying which fields to read from each result.
-     * If no mask is specified, will default to all fields except items.acl and
-     * items.owner.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 8; - * - * @return The readMask. - */ - public com.google.protobuf.FieldMask getReadMask() { - if (readMaskBuilder_ == null) { - return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; - } else { - return readMaskBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Mask specifying which fields to read from each result.
-     * If no mask is specified, will default to all fields except items.acl and
-     * items.owner.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 8; - */ - public Builder setReadMask(com.google.protobuf.FieldMask value) { - if (readMaskBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - readMask_ = value; - onChanged(); - } else { - readMaskBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-     * Mask specifying which fields to read from each result.
-     * If no mask is specified, will default to all fields except items.acl and
-     * items.owner.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 8; - */ - public Builder setReadMask(com.google.protobuf.FieldMask.Builder builderForValue) { - if (readMaskBuilder_ == null) { - readMask_ = builderForValue.build(); - onChanged(); - } else { - readMaskBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-     * Mask specifying which fields to read from each result.
-     * If no mask is specified, will default to all fields except items.acl and
-     * items.owner.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 8; - */ - public Builder mergeReadMask(com.google.protobuf.FieldMask value) { - if (readMaskBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0) - && readMask_ != null - && readMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { - readMask_ = - com.google.protobuf.FieldMask.newBuilder(readMask_).mergeFrom(value).buildPartial(); - } else { - readMask_ = value; - } - onChanged(); - } else { - readMaskBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-     * Mask specifying which fields to read from each result.
-     * If no mask is specified, will default to all fields except items.acl and
-     * items.owner.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 8; - */ - public Builder clearReadMask() { - if (readMaskBuilder_ == null) { - readMask_ = null; - onChanged(); - } else { - readMaskBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - /** - * - * - *
-     * Mask specifying which fields to read from each result.
-     * If no mask is specified, will default to all fields except items.acl and
-     * items.owner.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 8; - */ - public com.google.protobuf.FieldMask.Builder getReadMaskBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getReadMaskFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Mask specifying which fields to read from each result.
-     * If no mask is specified, will default to all fields except items.acl and
-     * items.owner.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 8; - */ - 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 from each result.
-     * If no mask is specified, will default to all fields except items.acl and
-     * items.owner.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 8; - */ - 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 java.lang.Object lexicographicStart_ = ""; - /** - * - * - *
-     * Filter results to objects whose names are lexicographically equal to or
-     * after lexicographic_start. If lexicographic_end is also set, the objects
-     * listed have names between lexicographic_start (inclusive) and
-     * lexicographic_end (exclusive).
-     * 
- * - * string lexicographic_start = 10; - * - * @return The lexicographicStart. - */ - public java.lang.String getLexicographicStart() { - java.lang.Object ref = lexicographicStart_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - lexicographicStart_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Filter results to objects whose names are lexicographically equal to or
-     * after lexicographic_start. If lexicographic_end is also set, the objects
-     * listed have names between lexicographic_start (inclusive) and
-     * lexicographic_end (exclusive).
-     * 
- * - * string lexicographic_start = 10; - * - * @return The bytes for lexicographicStart. - */ - public com.google.protobuf.ByteString getLexicographicStartBytes() { - java.lang.Object ref = lexicographicStart_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - lexicographicStart_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Filter results to objects whose names are lexicographically equal to or
-     * after lexicographic_start. If lexicographic_end is also set, the objects
-     * listed have names between lexicographic_start (inclusive) and
-     * lexicographic_end (exclusive).
-     * 
- * - * string lexicographic_start = 10; - * - * @param value The lexicographicStart to set. - * @return This builder for chaining. - */ - public Builder setLexicographicStart(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - lexicographicStart_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Filter results to objects whose names are lexicographically equal to or
-     * after lexicographic_start. If lexicographic_end is also set, the objects
-     * listed have names between lexicographic_start (inclusive) and
-     * lexicographic_end (exclusive).
-     * 
- * - * string lexicographic_start = 10; - * - * @return This builder for chaining. - */ - public Builder clearLexicographicStart() { - - lexicographicStart_ = getDefaultInstance().getLexicographicStart(); - onChanged(); - return this; - } - /** - * - * - *
-     * Filter results to objects whose names are lexicographically equal to or
-     * after lexicographic_start. If lexicographic_end is also set, the objects
-     * listed have names between lexicographic_start (inclusive) and
-     * lexicographic_end (exclusive).
-     * 
- * - * string lexicographic_start = 10; - * - * @param value The bytes for lexicographicStart to set. - * @return This builder for chaining. - */ - public Builder setLexicographicStartBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - lexicographicStart_ = value; - onChanged(); - return this; - } - - private java.lang.Object lexicographicEnd_ = ""; - /** - * - * - *
-     * Filter results to objects whose names are lexicographically before
-     * lexicographic_end. If lexicographic_start is also set, the objects listed
-     * have names between lexicographic_start (inclusive) and lexicographic_end
-     * (exclusive).
-     * 
- * - * string lexicographic_end = 11; - * - * @return The lexicographicEnd. - */ - public java.lang.String getLexicographicEnd() { - java.lang.Object ref = lexicographicEnd_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - lexicographicEnd_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Filter results to objects whose names are lexicographically before
-     * lexicographic_end. If lexicographic_start is also set, the objects listed
-     * have names between lexicographic_start (inclusive) and lexicographic_end
-     * (exclusive).
-     * 
- * - * string lexicographic_end = 11; - * - * @return The bytes for lexicographicEnd. - */ - public com.google.protobuf.ByteString getLexicographicEndBytes() { - java.lang.Object ref = lexicographicEnd_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - lexicographicEnd_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Filter results to objects whose names are lexicographically before
-     * lexicographic_end. If lexicographic_start is also set, the objects listed
-     * have names between lexicographic_start (inclusive) and lexicographic_end
-     * (exclusive).
-     * 
- * - * string lexicographic_end = 11; - * - * @param value The lexicographicEnd to set. - * @return This builder for chaining. - */ - public Builder setLexicographicEnd(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - lexicographicEnd_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Filter results to objects whose names are lexicographically before
-     * lexicographic_end. If lexicographic_start is also set, the objects listed
-     * have names between lexicographic_start (inclusive) and lexicographic_end
-     * (exclusive).
-     * 
- * - * string lexicographic_end = 11; - * - * @return This builder for chaining. - */ - public Builder clearLexicographicEnd() { - - lexicographicEnd_ = getDefaultInstance().getLexicographicEnd(); - onChanged(); - return this; - } - /** - * - * - *
-     * Filter results to objects whose names are lexicographically before
-     * lexicographic_end. If lexicographic_start is also set, the objects listed
-     * have names between lexicographic_start (inclusive) and lexicographic_end
-     * (exclusive).
-     * 
- * - * string lexicographic_end = 11; - * - * @param value The bytes for lexicographicEnd to set. - * @return This builder for chaining. - */ - public Builder setLexicographicEndBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - lexicographicEnd_ = value; - onChanged(); - return this; - } - - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - commonRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return Whether the commonRequestParams field is set. - */ - public boolean hasCommonRequestParams() { - return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return The commonRequestParams. - */ - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } else { - return commonRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonRequestParams_ = value; - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public Builder setCommonRequestParams( - com.google.storage.v2.CommonRequestParams.Builder builderForValue) { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (commonRequestParams_ != null) { - commonRequestParams_ = - com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonRequestParams_ = value; - } - onChanged(); - } else { - commonRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public Builder clearCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - onChanged(); - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { - - onChanged(); - return getCommonRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - if (commonRequestParamsBuilder_ != null) { - return commonRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - getCommonRequestParamsFieldBuilder() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder>( - getCommonRequestParams(), getParentForChildren(), isClean()); - commonRequestParams_ = null; - } - return commonRequestParamsBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.ListObjectsRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.ListObjectsRequest) - private static final com.google.storage.v2.ListObjectsRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.ListObjectsRequest(); - } - - public static com.google.storage.v2.ListObjectsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListObjectsRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListObjectsRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.ListObjectsRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListObjectsRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListObjectsRequestOrBuilder.java deleted file mode 100644 index 07ea650ba5..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListObjectsRequestOrBuilder.java +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface ListObjectsRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.ListObjectsRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Name of the bucket in which to look for objects.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - java.lang.String getParent(); - /** - * - * - *
-   * Required. Name of the bucket in which to look for objects.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - com.google.protobuf.ByteString getParentBytes(); - - /** - * - * - *
-   * Maximum number of `items` plus `prefixes` to return
-   * in a single page of responses. As duplicate `prefixes` are
-   * omitted, fewer total results may be returned than requested. The service
-   * will use this parameter or 1,000 items, whichever is smaller.
-   * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - int getPageSize(); - - /** - * - * - *
-   * A previously-returned page token representing part of the larger set of
-   * results to view.
-   * 
- * - * string page_token = 3; - * - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - * - * - *
-   * A previously-returned page token representing part of the larger set of
-   * results to view.
-   * 
- * - * string page_token = 3; - * - * @return The bytes for pageToken. - */ - com.google.protobuf.ByteString getPageTokenBytes(); - - /** - * - * - *
-   * If set, returns results in a directory-like mode. `items` will contain
-   * only objects whose names, aside from the `prefix`, do not
-   * contain `delimiter`. Objects whose names, aside from the
-   * `prefix`, contain `delimiter` will have their name,
-   * truncated after the `delimiter`, returned in
-   * `prefixes`. Duplicate `prefixes` are omitted.
-   * 
- * - * string delimiter = 4; - * - * @return The delimiter. - */ - java.lang.String getDelimiter(); - /** - * - * - *
-   * If set, returns results in a directory-like mode. `items` will contain
-   * only objects whose names, aside from the `prefix`, do not
-   * contain `delimiter`. Objects whose names, aside from the
-   * `prefix`, contain `delimiter` will have their name,
-   * truncated after the `delimiter`, returned in
-   * `prefixes`. Duplicate `prefixes` are omitted.
-   * 
- * - * string delimiter = 4; - * - * @return The bytes for delimiter. - */ - com.google.protobuf.ByteString getDelimiterBytes(); - - /** - * - * - *
-   * If true, objects that end in exactly one instance of `delimiter`
-   * will have their metadata included in `items` in addition to
-   * `prefixes`.
-   * 
- * - * bool include_trailing_delimiter = 5; - * - * @return The includeTrailingDelimiter. - */ - boolean getIncludeTrailingDelimiter(); - - /** - * - * - *
-   * Filter results to objects whose names begin with this prefix.
-   * 
- * - * string prefix = 6; - * - * @return The prefix. - */ - java.lang.String getPrefix(); - /** - * - * - *
-   * Filter results to objects whose names begin with this prefix.
-   * 
- * - * string prefix = 6; - * - * @return The bytes for prefix. - */ - com.google.protobuf.ByteString getPrefixBytes(); - - /** - * - * - *
-   * If `true`, lists all versions of an object as distinct results.
-   * For more information, see
-   * [Object
-   * Versioning](https://cloud.google.com/storage/docs/object-versioning).
-   * 
- * - * bool versions = 7; - * - * @return The versions. - */ - boolean getVersions(); - - /** - * - * - *
-   * Mask specifying which fields to read from each result.
-   * If no mask is specified, will default to all fields except items.acl and
-   * items.owner.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 8; - * - * @return Whether the readMask field is set. - */ - boolean hasReadMask(); - /** - * - * - *
-   * Mask specifying which fields to read from each result.
-   * If no mask is specified, will default to all fields except items.acl and
-   * items.owner.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 8; - * - * @return The readMask. - */ - com.google.protobuf.FieldMask getReadMask(); - /** - * - * - *
-   * Mask specifying which fields to read from each result.
-   * If no mask is specified, will default to all fields except items.acl and
-   * items.owner.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 8; - */ - com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder(); - - /** - * - * - *
-   * Filter results to objects whose names are lexicographically equal to or
-   * after lexicographic_start. If lexicographic_end is also set, the objects
-   * listed have names between lexicographic_start (inclusive) and
-   * lexicographic_end (exclusive).
-   * 
- * - * string lexicographic_start = 10; - * - * @return The lexicographicStart. - */ - java.lang.String getLexicographicStart(); - /** - * - * - *
-   * Filter results to objects whose names are lexicographically equal to or
-   * after lexicographic_start. If lexicographic_end is also set, the objects
-   * listed have names between lexicographic_start (inclusive) and
-   * lexicographic_end (exclusive).
-   * 
- * - * string lexicographic_start = 10; - * - * @return The bytes for lexicographicStart. - */ - com.google.protobuf.ByteString getLexicographicStartBytes(); - - /** - * - * - *
-   * Filter results to objects whose names are lexicographically before
-   * lexicographic_end. If lexicographic_start is also set, the objects listed
-   * have names between lexicographic_start (inclusive) and lexicographic_end
-   * (exclusive).
-   * 
- * - * string lexicographic_end = 11; - * - * @return The lexicographicEnd. - */ - java.lang.String getLexicographicEnd(); - /** - * - * - *
-   * Filter results to objects whose names are lexicographically before
-   * lexicographic_end. If lexicographic_start is also set, the objects listed
-   * have names between lexicographic_start (inclusive) and lexicographic_end
-   * (exclusive).
-   * 
- * - * string lexicographic_end = 11; - * - * @return The bytes for lexicographicEnd. - */ - com.google.protobuf.ByteString getLexicographicEndBytes(); - - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return Whether the commonRequestParams field is set. - */ - boolean hasCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return The commonRequestParams. - */ - com.google.storage.v2.CommonRequestParams getCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListObjectsResponse.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListObjectsResponse.java deleted file mode 100644 index 9c3dcef889..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListObjectsResponse.java +++ /dev/null @@ -1,1416 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * The result of a call to Objects.ListObjects
- * 
- * - * Protobuf type {@code google.storage.v2.ListObjectsResponse} - */ -public final class ListObjectsResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.ListObjectsResponse) - ListObjectsResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListObjectsResponse.newBuilder() to construct. - private ListObjectsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListObjectsResponse() { - objects_ = java.util.Collections.emptyList(); - prefixes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListObjectsResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ListObjectsResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - objects_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - objects_.add( - input.readMessage(com.google.storage.v2.Object.parser(), extensionRegistry)); - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - prefixes_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; - } - prefixes_.add(s); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - objects_ = java.util.Collections.unmodifiableList(objects_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - prefixes_ = prefixes_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListObjectsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListObjectsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ListObjectsResponse.class, - com.google.storage.v2.ListObjectsResponse.Builder.class); - } - - public static final int OBJECTS_FIELD_NUMBER = 1; - private java.util.List objects_; - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - @java.lang.Override - public java.util.List getObjectsList() { - return objects_; - } - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - @java.lang.Override - public java.util.List getObjectsOrBuilderList() { - return objects_; - } - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - @java.lang.Override - public int getObjectsCount() { - return objects_.size(); - } - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - @java.lang.Override - public com.google.storage.v2.Object getObjects(int index) { - return objects_.get(index); - } - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - @java.lang.Override - public com.google.storage.v2.ObjectOrBuilder getObjectsOrBuilder(int index) { - return objects_.get(index); - } - - public static final int PREFIXES_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList prefixes_; - /** - * - * - *
-   * The list of prefixes of objects matching-but-not-listed up to and including
-   * the requested delimiter.
-   * 
- * - * repeated string prefixes = 2; - * - * @return A list containing the prefixes. - */ - public com.google.protobuf.ProtocolStringList getPrefixesList() { - return prefixes_; - } - /** - * - * - *
-   * The list of prefixes of objects matching-but-not-listed up to and including
-   * the requested delimiter.
-   * 
- * - * repeated string prefixes = 2; - * - * @return The count of prefixes. - */ - public int getPrefixesCount() { - return prefixes_.size(); - } - /** - * - * - *
-   * The list of prefixes of objects matching-but-not-listed up to and including
-   * the requested delimiter.
-   * 
- * - * repeated string prefixes = 2; - * - * @param index The index of the element to return. - * @return The prefixes at the given index. - */ - public java.lang.String getPrefixes(int index) { - return prefixes_.get(index); - } - /** - * - * - *
-   * The list of prefixes of objects matching-but-not-listed up to and including
-   * the requested delimiter.
-   * 
- * - * repeated string prefixes = 2; - * - * @param index The index of the value to return. - * @return The bytes of the prefixes at the given index. - */ - public com.google.protobuf.ByteString getPrefixesBytes(int index) { - return prefixes_.getByteString(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; - private volatile java.lang.Object nextPageToken_; - /** - * - * - *
-   * The continuation token, used to page through large result sets. Provide
-   * this value in a subsequent request to return the next page of results.
-   * 
- * - * string next_page_token = 3; - * - * @return The nextPageToken. - */ - @java.lang.Override - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } - } - /** - * - * - *
-   * The continuation token, used to page through large result sets. Provide
-   * this value in a subsequent request to return the next page of results.
-   * 
- * - * string next_page_token = 3; - * - * @return The bytes for nextPageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < objects_.size(); i++) { - output.writeMessage(1, objects_.get(i)); - } - for (int i = 0; i < prefixes_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, prefixes_.getRaw(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nextPageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < objects_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, objects_.get(i)); - } - { - int dataSize = 0; - for (int i = 0; i < prefixes_.size(); i++) { - dataSize += computeStringSizeNoTag(prefixes_.getRaw(i)); - } - size += dataSize; - size += 1 * getPrefixesList().size(); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, nextPageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.ListObjectsResponse)) { - return super.equals(obj); - } - com.google.storage.v2.ListObjectsResponse other = - (com.google.storage.v2.ListObjectsResponse) obj; - - if (!getObjectsList().equals(other.getObjectsList())) return false; - if (!getPrefixesList().equals(other.getPrefixesList())) return false; - if (!getNextPageToken().equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getObjectsCount() > 0) { - hash = (37 * hash) + OBJECTS_FIELD_NUMBER; - hash = (53 * hash) + getObjectsList().hashCode(); - } - if (getPrefixesCount() > 0) { - hash = (37 * hash) + PREFIXES_FIELD_NUMBER; - hash = (53 * hash) + getPrefixesList().hashCode(); - } - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.ListObjectsResponse parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListObjectsResponse 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.ListObjectsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListObjectsResponse 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.ListObjectsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ListObjectsResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ListObjectsResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListObjectsResponse 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.ListObjectsResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListObjectsResponse 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.ListObjectsResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ListObjectsResponse 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.ListObjectsResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * The result of a call to Objects.ListObjects
-   * 
- * - * Protobuf type {@code google.storage.v2.ListObjectsResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.ListObjectsResponse) - com.google.storage.v2.ListObjectsResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListObjectsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListObjectsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ListObjectsResponse.class, - com.google.storage.v2.ListObjectsResponse.Builder.class); - } - - // Construct using com.google.storage.v2.ListObjectsResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getObjectsFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (objectsBuilder_ == null) { - objects_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - objectsBuilder_.clear(); - } - prefixes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - nextPageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListObjectsResponse_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.ListObjectsResponse getDefaultInstanceForType() { - return com.google.storage.v2.ListObjectsResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.ListObjectsResponse build() { - com.google.storage.v2.ListObjectsResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.ListObjectsResponse buildPartial() { - com.google.storage.v2.ListObjectsResponse result = - new com.google.storage.v2.ListObjectsResponse(this); - int from_bitField0_ = bitField0_; - if (objectsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - objects_ = java.util.Collections.unmodifiableList(objects_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.objects_ = objects_; - } else { - result.objects_ = objectsBuilder_.build(); - } - if (((bitField0_ & 0x00000002) != 0)) { - prefixes_ = prefixes_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.prefixes_ = prefixes_; - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.ListObjectsResponse) { - return mergeFrom((com.google.storage.v2.ListObjectsResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.ListObjectsResponse other) { - if (other == com.google.storage.v2.ListObjectsResponse.getDefaultInstance()) return this; - if (objectsBuilder_ == null) { - if (!other.objects_.isEmpty()) { - if (objects_.isEmpty()) { - objects_ = other.objects_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureObjectsIsMutable(); - objects_.addAll(other.objects_); - } - onChanged(); - } - } else { - if (!other.objects_.isEmpty()) { - if (objectsBuilder_.isEmpty()) { - objectsBuilder_.dispose(); - objectsBuilder_ = null; - objects_ = other.objects_; - bitField0_ = (bitField0_ & ~0x00000001); - objectsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getObjectsFieldBuilder() - : null; - } else { - objectsBuilder_.addAllMessages(other.objects_); - } - } - } - if (!other.prefixes_.isEmpty()) { - if (prefixes_.isEmpty()) { - prefixes_ = other.prefixes_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensurePrefixesIsMutable(); - prefixes_.addAll(other.prefixes_); - } - onChanged(); - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.ListObjectsResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.ListObjectsResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.util.List objects_ = - java.util.Collections.emptyList(); - - private void ensureObjectsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - objects_ = new java.util.ArrayList(objects_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder> - objectsBuilder_; - - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - public java.util.List getObjectsList() { - if (objectsBuilder_ == null) { - return java.util.Collections.unmodifiableList(objects_); - } else { - return objectsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - public int getObjectsCount() { - if (objectsBuilder_ == null) { - return objects_.size(); - } else { - return objectsBuilder_.getCount(); - } - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - public com.google.storage.v2.Object getObjects(int index) { - if (objectsBuilder_ == null) { - return objects_.get(index); - } else { - return objectsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - public Builder setObjects(int index, com.google.storage.v2.Object value) { - if (objectsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureObjectsIsMutable(); - objects_.set(index, value); - onChanged(); - } else { - objectsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - public Builder setObjects(int index, com.google.storage.v2.Object.Builder builderForValue) { - if (objectsBuilder_ == null) { - ensureObjectsIsMutable(); - objects_.set(index, builderForValue.build()); - onChanged(); - } else { - objectsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - public Builder addObjects(com.google.storage.v2.Object value) { - if (objectsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureObjectsIsMutable(); - objects_.add(value); - onChanged(); - } else { - objectsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - public Builder addObjects(int index, com.google.storage.v2.Object value) { - if (objectsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureObjectsIsMutable(); - objects_.add(index, value); - onChanged(); - } else { - objectsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - public Builder addObjects(com.google.storage.v2.Object.Builder builderForValue) { - if (objectsBuilder_ == null) { - ensureObjectsIsMutable(); - objects_.add(builderForValue.build()); - onChanged(); - } else { - objectsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - public Builder addObjects(int index, com.google.storage.v2.Object.Builder builderForValue) { - if (objectsBuilder_ == null) { - ensureObjectsIsMutable(); - objects_.add(index, builderForValue.build()); - onChanged(); - } else { - objectsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - public Builder addAllObjects( - java.lang.Iterable values) { - if (objectsBuilder_ == null) { - ensureObjectsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, objects_); - onChanged(); - } else { - objectsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - public Builder clearObjects() { - if (objectsBuilder_ == null) { - objects_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - objectsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - public Builder removeObjects(int index) { - if (objectsBuilder_ == null) { - ensureObjectsIsMutable(); - objects_.remove(index); - onChanged(); - } else { - objectsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - public com.google.storage.v2.Object.Builder getObjectsBuilder(int index) { - return getObjectsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - public com.google.storage.v2.ObjectOrBuilder getObjectsOrBuilder(int index) { - if (objectsBuilder_ == null) { - return objects_.get(index); - } else { - return objectsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - public java.util.List - getObjectsOrBuilderList() { - if (objectsBuilder_ != null) { - return objectsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(objects_); - } - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - public com.google.storage.v2.Object.Builder addObjectsBuilder() { - return getObjectsFieldBuilder().addBuilder(com.google.storage.v2.Object.getDefaultInstance()); - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - public com.google.storage.v2.Object.Builder addObjectsBuilder(int index) { - return getObjectsFieldBuilder() - .addBuilder(index, com.google.storage.v2.Object.getDefaultInstance()); - } - /** - * - * - *
-     * The list of items.
-     * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - public java.util.List getObjectsBuilderList() { - return getObjectsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder> - getObjectsFieldBuilder() { - if (objectsBuilder_ == null) { - objectsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder>( - objects_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - objects_ = null; - } - return objectsBuilder_; - } - - private com.google.protobuf.LazyStringList prefixes_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensurePrefixesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - prefixes_ = new com.google.protobuf.LazyStringArrayList(prefixes_); - bitField0_ |= 0x00000002; - } - } - /** - * - * - *
-     * The list of prefixes of objects matching-but-not-listed up to and including
-     * the requested delimiter.
-     * 
- * - * repeated string prefixes = 2; - * - * @return A list containing the prefixes. - */ - public com.google.protobuf.ProtocolStringList getPrefixesList() { - return prefixes_.getUnmodifiableView(); - } - /** - * - * - *
-     * The list of prefixes of objects matching-but-not-listed up to and including
-     * the requested delimiter.
-     * 
- * - * repeated string prefixes = 2; - * - * @return The count of prefixes. - */ - public int getPrefixesCount() { - return prefixes_.size(); - } - /** - * - * - *
-     * The list of prefixes of objects matching-but-not-listed up to and including
-     * the requested delimiter.
-     * 
- * - * repeated string prefixes = 2; - * - * @param index The index of the element to return. - * @return The prefixes at the given index. - */ - public java.lang.String getPrefixes(int index) { - return prefixes_.get(index); - } - /** - * - * - *
-     * The list of prefixes of objects matching-but-not-listed up to and including
-     * the requested delimiter.
-     * 
- * - * repeated string prefixes = 2; - * - * @param index The index of the value to return. - * @return The bytes of the prefixes at the given index. - */ - public com.google.protobuf.ByteString getPrefixesBytes(int index) { - return prefixes_.getByteString(index); - } - /** - * - * - *
-     * The list of prefixes of objects matching-but-not-listed up to and including
-     * the requested delimiter.
-     * 
- * - * repeated string prefixes = 2; - * - * @param index The index to set the value at. - * @param value The prefixes to set. - * @return This builder for chaining. - */ - public Builder setPrefixes(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePrefixesIsMutable(); - prefixes_.set(index, value); - onChanged(); - return this; - } - /** - * - * - *
-     * The list of prefixes of objects matching-but-not-listed up to and including
-     * the requested delimiter.
-     * 
- * - * repeated string prefixes = 2; - * - * @param value The prefixes to add. - * @return This builder for chaining. - */ - public Builder addPrefixes(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePrefixesIsMutable(); - prefixes_.add(value); - onChanged(); - return this; - } - /** - * - * - *
-     * The list of prefixes of objects matching-but-not-listed up to and including
-     * the requested delimiter.
-     * 
- * - * repeated string prefixes = 2; - * - * @param values The prefixes to add. - * @return This builder for chaining. - */ - public Builder addAllPrefixes(java.lang.Iterable values) { - ensurePrefixesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, prefixes_); - onChanged(); - return this; - } - /** - * - * - *
-     * The list of prefixes of objects matching-but-not-listed up to and including
-     * the requested delimiter.
-     * 
- * - * repeated string prefixes = 2; - * - * @return This builder for chaining. - */ - public Builder clearPrefixes() { - prefixes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * - * - *
-     * The list of prefixes of objects matching-but-not-listed up to and including
-     * the requested delimiter.
-     * 
- * - * repeated string prefixes = 2; - * - * @param value The bytes of the prefixes to add. - * @return This builder for chaining. - */ - public Builder addPrefixesBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensurePrefixesIsMutable(); - prefixes_.add(value); - onChanged(); - return this; - } - - private java.lang.Object nextPageToken_ = ""; - /** - * - * - *
-     * The continuation token, used to page through large result sets. Provide
-     * this value in a subsequent request to return the next page of results.
-     * 
- * - * string next_page_token = 3; - * - * @return The nextPageToken. - */ - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The continuation token, used to page through large result sets. Provide
-     * this value in a subsequent request to return the next page of results.
-     * 
- * - * string next_page_token = 3; - * - * @return The bytes for nextPageToken. - */ - public com.google.protobuf.ByteString getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The continuation token, used to page through large result sets. Provide
-     * this value in a subsequent request to return the next page of results.
-     * 
- * - * string next_page_token = 3; - * - * @param value The nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageToken(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nextPageToken_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The continuation token, used to page through large result sets. Provide
-     * this value in a subsequent request to return the next page of results.
-     * 
- * - * string next_page_token = 3; - * - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - - nextPageToken_ = getDefaultInstance().getNextPageToken(); - onChanged(); - return this; - } - /** - * - * - *
-     * The continuation token, used to page through large result sets. Provide
-     * this value in a subsequent request to return the next page of results.
-     * 
- * - * string next_page_token = 3; - * - * @param value The bytes for nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nextPageToken_ = value; - onChanged(); - return this; - } - - @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.ListObjectsResponse) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.ListObjectsResponse) - private static final com.google.storage.v2.ListObjectsResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.ListObjectsResponse(); - } - - public static com.google.storage.v2.ListObjectsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListObjectsResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListObjectsResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.ListObjectsResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListObjectsResponseOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListObjectsResponseOrBuilder.java deleted file mode 100644 index 6fa2582940..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListObjectsResponseOrBuilder.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface ListObjectsResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.ListObjectsResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - java.util.List getObjectsList(); - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - com.google.storage.v2.Object getObjects(int index); - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - int getObjectsCount(); - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - java.util.List getObjectsOrBuilderList(); - /** - * - * - *
-   * The list of items.
-   * 
- * - * repeated .google.storage.v2.Object objects = 1; - */ - com.google.storage.v2.ObjectOrBuilder getObjectsOrBuilder(int index); - - /** - * - * - *
-   * The list of prefixes of objects matching-but-not-listed up to and including
-   * the requested delimiter.
-   * 
- * - * repeated string prefixes = 2; - * - * @return A list containing the prefixes. - */ - java.util.List getPrefixesList(); - /** - * - * - *
-   * The list of prefixes of objects matching-but-not-listed up to and including
-   * the requested delimiter.
-   * 
- * - * repeated string prefixes = 2; - * - * @return The count of prefixes. - */ - int getPrefixesCount(); - /** - * - * - *
-   * The list of prefixes of objects matching-but-not-listed up to and including
-   * the requested delimiter.
-   * 
- * - * repeated string prefixes = 2; - * - * @param index The index of the element to return. - * @return The prefixes at the given index. - */ - java.lang.String getPrefixes(int index); - /** - * - * - *
-   * The list of prefixes of objects matching-but-not-listed up to and including
-   * the requested delimiter.
-   * 
- * - * repeated string prefixes = 2; - * - * @param index The index of the value to return. - * @return The bytes of the prefixes at the given index. - */ - com.google.protobuf.ByteString getPrefixesBytes(int index); - - /** - * - * - *
-   * The continuation token, used to page through large result sets. Provide
-   * this value in a subsequent request to return the next page of results.
-   * 
- * - * string next_page_token = 3; - * - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - * - * - *
-   * The continuation token, used to page through large result sets. Provide
-   * this value in a subsequent request to return the next page of results.
-   * 
- * - * string next_page_token = 3; - * - * @return The bytes for nextPageToken. - */ - com.google.protobuf.ByteString getNextPageTokenBytes(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/LockBucketRetentionPolicyRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/LockBucketRetentionPolicyRequest.java deleted file mode 100644 index 61b0edb9a0..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/LockBucketRetentionPolicyRequest.java +++ /dev/null @@ -1,1024 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request message for LockBucketRetentionPolicyRequest.
- * 
- * - * Protobuf type {@code google.storage.v2.LockBucketRetentionPolicyRequest} - */ -public final class LockBucketRetentionPolicyRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.LockBucketRetentionPolicyRequest) - LockBucketRetentionPolicyRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use LockBucketRetentionPolicyRequest.newBuilder() to construct. - private LockBucketRetentionPolicyRequest( - com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private LockBucketRetentionPolicyRequest() { - bucket_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new LockBucketRetentionPolicyRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private LockBucketRetentionPolicyRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - bucket_ = s; - break; - } - case 16: - { - ifMetagenerationMatch_ = input.readInt64(); - break; - } - case 26: - { - com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; - if (commonRequestParams_ != null) { - subBuilder = commonRequestParams_.toBuilder(); - } - commonRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonRequestParams_); - commonRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_LockBucketRetentionPolicyRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_LockBucketRetentionPolicyRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.LockBucketRetentionPolicyRequest.class, - com.google.storage.v2.LockBucketRetentionPolicyRequest.Builder.class); - } - - public static final int BUCKET_FIELD_NUMBER = 1; - private volatile java.lang.Object bucket_; - /** - * - * - *
-   * Required. Name of a bucket.
-   * 
- * - * - * 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. Name of a bucket.
-   * 
- * - * - * 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 IF_METAGENERATION_MATCH_FIELD_NUMBER = 2; - private long ifMetagenerationMatch_; - /** - * - * - *
-   * Makes the operation conditional on whether bucket's current metageneration
-   * matches the given value. Must be positive.
-   * 
- * - * int64 if_metageneration_match = 2; - * - * @return The ifMetagenerationMatch. - */ - @java.lang.Override - public long getIfMetagenerationMatch() { - return ifMetagenerationMatch_; - } - - public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 3; - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return Whether the commonRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonRequestParams() { - return commonRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return The commonRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - return getCommonRequestParams(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucket_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, bucket_); - } - if (ifMetagenerationMatch_ != 0L) { - output.writeInt64(2, ifMetagenerationMatch_); - } - if (commonRequestParams_ != null) { - output.writeMessage(3, getCommonRequestParams()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucket_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, bucket_); - } - if (ifMetagenerationMatch_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, ifMetagenerationMatch_); - } - if (commonRequestParams_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCommonRequestParams()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.LockBucketRetentionPolicyRequest)) { - return super.equals(obj); - } - com.google.storage.v2.LockBucketRetentionPolicyRequest other = - (com.google.storage.v2.LockBucketRetentionPolicyRequest) obj; - - if (!getBucket().equals(other.getBucket())) return false; - if (getIfMetagenerationMatch() != other.getIfMetagenerationMatch()) return false; - if (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; - if (hasCommonRequestParams()) { - if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + BUCKET_FIELD_NUMBER; - hash = (53 * hash) + getBucket().hashCode(); - hash = (37 * hash) + IF_METAGENERATION_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationMatch()); - if (hasCommonRequestParams()) { - hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonRequestParams().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.LockBucketRetentionPolicyRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.LockBucketRetentionPolicyRequest 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.LockBucketRetentionPolicyRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.LockBucketRetentionPolicyRequest 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.LockBucketRetentionPolicyRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.LockBucketRetentionPolicyRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.LockBucketRetentionPolicyRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.LockBucketRetentionPolicyRequest 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.LockBucketRetentionPolicyRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.LockBucketRetentionPolicyRequest 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.LockBucketRetentionPolicyRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.LockBucketRetentionPolicyRequest 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.LockBucketRetentionPolicyRequest 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 LockBucketRetentionPolicyRequest.
-   * 
- * - * Protobuf type {@code google.storage.v2.LockBucketRetentionPolicyRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.LockBucketRetentionPolicyRequest) - com.google.storage.v2.LockBucketRetentionPolicyRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_LockBucketRetentionPolicyRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_LockBucketRetentionPolicyRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.LockBucketRetentionPolicyRequest.class, - com.google.storage.v2.LockBucketRetentionPolicyRequest.Builder.class); - } - - // Construct using com.google.storage.v2.LockBucketRetentionPolicyRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bucket_ = ""; - - ifMetagenerationMatch_ = 0L; - - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_LockBucketRetentionPolicyRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.LockBucketRetentionPolicyRequest getDefaultInstanceForType() { - return com.google.storage.v2.LockBucketRetentionPolicyRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.LockBucketRetentionPolicyRequest build() { - com.google.storage.v2.LockBucketRetentionPolicyRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.LockBucketRetentionPolicyRequest buildPartial() { - com.google.storage.v2.LockBucketRetentionPolicyRequest result = - new com.google.storage.v2.LockBucketRetentionPolicyRequest(this); - result.bucket_ = bucket_; - result.ifMetagenerationMatch_ = ifMetagenerationMatch_; - if (commonRequestParamsBuilder_ == null) { - result.commonRequestParams_ = commonRequestParams_; - } else { - result.commonRequestParams_ = commonRequestParamsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.LockBucketRetentionPolicyRequest) { - return mergeFrom((com.google.storage.v2.LockBucketRetentionPolicyRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.LockBucketRetentionPolicyRequest other) { - if (other == com.google.storage.v2.LockBucketRetentionPolicyRequest.getDefaultInstance()) - return this; - if (!other.getBucket().isEmpty()) { - bucket_ = other.bucket_; - onChanged(); - } - if (other.getIfMetagenerationMatch() != 0L) { - setIfMetagenerationMatch(other.getIfMetagenerationMatch()); - } - if (other.hasCommonRequestParams()) { - mergeCommonRequestParams(other.getCommonRequestParams()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.LockBucketRetentionPolicyRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.storage.v2.LockBucketRetentionPolicyRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object bucket_ = ""; - /** - * - * - *
-     * Required. Name of a bucket.
-     * 
- * - * - * 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. Name of a bucket.
-     * 
- * - * - * 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. Name of a bucket.
-     * 
- * - * - * 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; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of a bucket.
-     * 
- * - * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearBucket() { - - bucket_ = getDefaultInstance().getBucket(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of a bucket.
-     * 
- * - * - * 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; - onChanged(); - return this; - } - - private long ifMetagenerationMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether bucket's current metageneration
-     * matches the given value. Must be positive.
-     * 
- * - * int64 if_metageneration_match = 2; - * - * @return The ifMetagenerationMatch. - */ - @java.lang.Override - public long getIfMetagenerationMatch() { - return ifMetagenerationMatch_; - } - /** - * - * - *
-     * Makes the operation conditional on whether bucket's current metageneration
-     * matches the given value. Must be positive.
-     * 
- * - * int64 if_metageneration_match = 2; - * - * @param value The ifMetagenerationMatch to set. - * @return This builder for chaining. - */ - public Builder setIfMetagenerationMatch(long value) { - - ifMetagenerationMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether bucket's current metageneration
-     * matches the given value. Must be positive.
-     * 
- * - * int64 if_metageneration_match = 2; - * - * @return This builder for chaining. - */ - public Builder clearIfMetagenerationMatch() { - - ifMetagenerationMatch_ = 0L; - onChanged(); - return this; - } - - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - commonRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return Whether the commonRequestParams field is set. - */ - public boolean hasCommonRequestParams() { - return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return The commonRequestParams. - */ - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } else { - return commonRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonRequestParams_ = value; - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public Builder setCommonRequestParams( - com.google.storage.v2.CommonRequestParams.Builder builderForValue) { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (commonRequestParams_ != null) { - commonRequestParams_ = - com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonRequestParams_ = value; - } - onChanged(); - } else { - commonRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public Builder clearCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - onChanged(); - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { - - onChanged(); - return getCommonRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - if (commonRequestParamsBuilder_ != null) { - return commonRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - getCommonRequestParamsFieldBuilder() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder>( - getCommonRequestParams(), getParentForChildren(), isClean()); - commonRequestParams_ = null; - } - return commonRequestParamsBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.LockBucketRetentionPolicyRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.LockBucketRetentionPolicyRequest) - private static final com.google.storage.v2.LockBucketRetentionPolicyRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.LockBucketRetentionPolicyRequest(); - } - - public static com.google.storage.v2.LockBucketRetentionPolicyRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public LockBucketRetentionPolicyRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new LockBucketRetentionPolicyRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.LockBucketRetentionPolicyRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/LockBucketRetentionPolicyRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/LockBucketRetentionPolicyRequestOrBuilder.java deleted file mode 100644 index 8f53d96e51..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/LockBucketRetentionPolicyRequestOrBuilder.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface LockBucketRetentionPolicyRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.LockBucketRetentionPolicyRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Name of a bucket.
-   * 
- * - * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bucket. - */ - java.lang.String getBucket(); - /** - * - * - *
-   * Required. Name of a bucket.
-   * 
- * - * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for bucket. - */ - com.google.protobuf.ByteString getBucketBytes(); - - /** - * - * - *
-   * Makes the operation conditional on whether bucket's current metageneration
-   * matches the given value. Must be positive.
-   * 
- * - * int64 if_metageneration_match = 2; - * - * @return The ifMetagenerationMatch. - */ - long getIfMetagenerationMatch(); - - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return Whether the commonRequestParams field is set. - */ - boolean hasCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return The commonRequestParams. - */ - com.google.storage.v2.CommonRequestParams getCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Notification.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Notification.java deleted file mode 100644 index e0c3a9142e..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Notification.java +++ /dev/null @@ -1,1863 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * A directive to publish Pub/Sub notifications upon changes to a bucket.
- * 
- * - * Protobuf type {@code google.storage.v2.Notification} - */ -public final class Notification extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.Notification) - NotificationOrBuilder { - private static final long serialVersionUID = 0L; - // Use Notification.newBuilder() to construct. - private Notification(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Notification() { - name_ = ""; - topic_ = ""; - eventTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - objectNamePrefix_ = ""; - payloadFormat_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Notification(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Notification( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - topic_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - eventTypes_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - eventTypes_.add(s); - break; - } - case 34: - { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - customAttributes_ = - com.google.protobuf.MapField.newMapField( - CustomAttributesDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; - } - com.google.protobuf.MapEntry customAttributes__ = - input.readMessage( - CustomAttributesDefaultEntryHolder.defaultEntry.getParserForType(), - extensionRegistry); - customAttributes_ - .getMutableMap() - .put(customAttributes__.getKey(), customAttributes__.getValue()); - break; - } - case 42: - { - java.lang.String s = input.readStringRequireUtf8(); - - objectNamePrefix_ = s; - break; - } - case 50: - { - java.lang.String s = input.readStringRequireUtf8(); - - payloadFormat_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - eventTypes_ = eventTypes_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Notification_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 4: - return internalGetCustomAttributes(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Notification_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Notification.class, - com.google.storage.v2.Notification.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * - * - *
-   * Required. The resource name of this notification.
-   * Format:
-   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
-   * The `{project}` portion may be `_` for globally unique buckets.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The resource name of this notification.
-   * Format:
-   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
-   * The `{project}` portion may be `_` for globally unique buckets.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TOPIC_FIELD_NUMBER = 2; - private volatile java.lang.Object topic_; - /** - * - * - *
-   * Required. The Pub/Sub topic to which this subscription publishes. Formatted as:
-   * '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'
-   * 
- * - * string topic = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The topic. - */ - @java.lang.Override - public java.lang.String getTopic() { - java.lang.Object ref = topic_; - 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(); - topic_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The Pub/Sub topic to which this subscription publishes. Formatted as:
-   * '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'
-   * 
- * - * string topic = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for topic. - */ - @java.lang.Override - public com.google.protobuf.ByteString getTopicBytes() { - java.lang.Object ref = topic_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - topic_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int EVENT_TYPES_FIELD_NUMBER = 3; - private com.google.protobuf.LazyStringList eventTypes_; - /** - * - * - *
-   * Optional. If present, only send notifications about listed event types. If empty,
-   * sent notifications for all event types.
-   * 
- * - * repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return A list containing the eventTypes. - */ - public com.google.protobuf.ProtocolStringList getEventTypesList() { - return eventTypes_; - } - /** - * - * - *
-   * Optional. If present, only send notifications about listed event types. If empty,
-   * sent notifications for all event types.
-   * 
- * - * repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The count of eventTypes. - */ - public int getEventTypesCount() { - return eventTypes_.size(); - } - /** - * - * - *
-   * Optional. If present, only send notifications about listed event types. If empty,
-   * sent notifications for all event types.
-   * 
- * - * repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param index The index of the element to return. - * @return The eventTypes at the given index. - */ - public java.lang.String getEventTypes(int index) { - return eventTypes_.get(index); - } - /** - * - * - *
-   * Optional. If present, only send notifications about listed event types. If empty,
-   * sent notifications for all event types.
-   * 
- * - * repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param index The index of the value to return. - * @return The bytes of the eventTypes at the given index. - */ - public com.google.protobuf.ByteString getEventTypesBytes(int index) { - return eventTypes_.getByteString(index); - } - - public static final int CUSTOM_ATTRIBUTES_FIELD_NUMBER = 4; - - private static final class CustomAttributesDefaultEntryHolder { - static final com.google.protobuf.MapEntry defaultEntry = - com.google.protobuf.MapEntry.newDefaultInstance( - com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Notification_CustomAttributesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - - private com.google.protobuf.MapField customAttributes_; - - private com.google.protobuf.MapField - internalGetCustomAttributes() { - if (customAttributes_ == null) { - return com.google.protobuf.MapField.emptyMapField( - CustomAttributesDefaultEntryHolder.defaultEntry); - } - return customAttributes_; - } - - public int getCustomAttributesCount() { - return internalGetCustomAttributes().getMap().size(); - } - /** - * - * - *
-   * Optional. An optional list of additional attributes to attach to each Pub/Sub
-   * message published for this notification subscription.
-   * 
- * - * - * map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public boolean containsCustomAttributes(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - return internalGetCustomAttributes().getMap().containsKey(key); - } - /** Use {@link #getCustomAttributesMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getCustomAttributes() { - return getCustomAttributesMap(); - } - /** - * - * - *
-   * Optional. An optional list of additional attributes to attach to each Pub/Sub
-   * message published for this notification subscription.
-   * 
- * - * - * map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public java.util.Map getCustomAttributesMap() { - return internalGetCustomAttributes().getMap(); - } - /** - * - * - *
-   * Optional. An optional list of additional attributes to attach to each Pub/Sub
-   * message published for this notification subscription.
-   * 
- * - * - * map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public java.lang.String getCustomAttributesOrDefault( - java.lang.String key, java.lang.String defaultValue) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - java.util.Map map = internalGetCustomAttributes().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-   * Optional. An optional list of additional attributes to attach to each Pub/Sub
-   * message published for this notification subscription.
-   * 
- * - * - * map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public java.lang.String getCustomAttributesOrThrow(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - java.util.Map map = internalGetCustomAttributes().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int OBJECT_NAME_PREFIX_FIELD_NUMBER = 5; - private volatile java.lang.Object objectNamePrefix_; - /** - * - * - *
-   * Optional. If present, only apply this notification config to object names that
-   * begin with this prefix.
-   * 
- * - * string object_name_prefix = 5 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The objectNamePrefix. - */ - @java.lang.Override - public java.lang.String getObjectNamePrefix() { - java.lang.Object ref = objectNamePrefix_; - 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(); - objectNamePrefix_ = s; - return s; - } - } - /** - * - * - *
-   * Optional. If present, only apply this notification config to object names that
-   * begin with this prefix.
-   * 
- * - * string object_name_prefix = 5 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for objectNamePrefix. - */ - @java.lang.Override - public com.google.protobuf.ByteString getObjectNamePrefixBytes() { - java.lang.Object ref = objectNamePrefix_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - objectNamePrefix_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAYLOAD_FORMAT_FIELD_NUMBER = 6; - private volatile java.lang.Object payloadFormat_; - /** - * - * - *
-   * Required. The desired content of the Payload.
-   * 
- * - * string payload_format = 6 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The payloadFormat. - */ - @java.lang.Override - public java.lang.String getPayloadFormat() { - java.lang.Object ref = payloadFormat_; - 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(); - payloadFormat_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The desired content of the Payload.
-   * 
- * - * string payload_format = 6 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for payloadFormat. - */ - @java.lang.Override - public com.google.protobuf.ByteString getPayloadFormatBytes() { - java.lang.Object ref = payloadFormat_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - payloadFormat_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, topic_); - } - for (int i = 0; i < eventTypes_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, eventTypes_.getRaw(i)); - } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( - output, internalGetCustomAttributes(), CustomAttributesDefaultEntryHolder.defaultEntry, 4); - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(objectNamePrefix_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, objectNamePrefix_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(payloadFormat_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, payloadFormat_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, topic_); - } - { - int dataSize = 0; - for (int i = 0; i < eventTypes_.size(); i++) { - dataSize += computeStringSizeNoTag(eventTypes_.getRaw(i)); - } - size += dataSize; - size += 1 * getEventTypesList().size(); - } - for (java.util.Map.Entry entry : - internalGetCustomAttributes().getMap().entrySet()) { - com.google.protobuf.MapEntry customAttributes__ = - CustomAttributesDefaultEntryHolder.defaultEntry - .newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, customAttributes__); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(objectNamePrefix_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, objectNamePrefix_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(payloadFormat_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, payloadFormat_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.Notification)) { - return super.equals(obj); - } - com.google.storage.v2.Notification other = (com.google.storage.v2.Notification) obj; - - if (!getName().equals(other.getName())) return false; - if (!getTopic().equals(other.getTopic())) return false; - if (!getEventTypesList().equals(other.getEventTypesList())) return false; - if (!internalGetCustomAttributes().equals(other.internalGetCustomAttributes())) return false; - if (!getObjectNamePrefix().equals(other.getObjectNamePrefix())) return false; - if (!getPayloadFormat().equals(other.getPayloadFormat())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + TOPIC_FIELD_NUMBER; - hash = (53 * hash) + getTopic().hashCode(); - if (getEventTypesCount() > 0) { - hash = (37 * hash) + EVENT_TYPES_FIELD_NUMBER; - hash = (53 * hash) + getEventTypesList().hashCode(); - } - if (!internalGetCustomAttributes().getMap().isEmpty()) { - hash = (37 * hash) + CUSTOM_ATTRIBUTES_FIELD_NUMBER; - hash = (53 * hash) + internalGetCustomAttributes().hashCode(); - } - hash = (37 * hash) + OBJECT_NAME_PREFIX_FIELD_NUMBER; - hash = (53 * hash) + getObjectNamePrefix().hashCode(); - hash = (37 * hash) + PAYLOAD_FORMAT_FIELD_NUMBER; - hash = (53 * hash) + getPayloadFormat().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.Notification parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Notification 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.Notification parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Notification 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.Notification parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Notification parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Notification parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Notification 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.Notification parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Notification 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.Notification parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Notification 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.Notification prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * A directive to publish Pub/Sub notifications upon changes to a bucket.
-   * 
- * - * Protobuf type {@code google.storage.v2.Notification} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.Notification) - com.google.storage.v2.NotificationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Notification_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 4: - return internalGetCustomAttributes(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { - switch (number) { - case 4: - return internalGetMutableCustomAttributes(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Notification_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Notification.class, - com.google.storage.v2.Notification.Builder.class); - } - - // Construct using com.google.storage.v2.Notification.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - topic_ = ""; - - eventTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - internalGetMutableCustomAttributes().clear(); - objectNamePrefix_ = ""; - - payloadFormat_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Notification_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.Notification getDefaultInstanceForType() { - return com.google.storage.v2.Notification.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.Notification build() { - com.google.storage.v2.Notification result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.Notification buildPartial() { - com.google.storage.v2.Notification result = new com.google.storage.v2.Notification(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.topic_ = topic_; - if (((bitField0_ & 0x00000001) != 0)) { - eventTypes_ = eventTypes_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.eventTypes_ = eventTypes_; - result.customAttributes_ = internalGetCustomAttributes(); - result.customAttributes_.makeImmutable(); - result.objectNamePrefix_ = objectNamePrefix_; - result.payloadFormat_ = payloadFormat_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.Notification) { - return mergeFrom((com.google.storage.v2.Notification) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.Notification other) { - if (other == com.google.storage.v2.Notification.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getTopic().isEmpty()) { - topic_ = other.topic_; - onChanged(); - } - if (!other.eventTypes_.isEmpty()) { - if (eventTypes_.isEmpty()) { - eventTypes_ = other.eventTypes_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureEventTypesIsMutable(); - eventTypes_.addAll(other.eventTypes_); - } - onChanged(); - } - internalGetMutableCustomAttributes().mergeFrom(other.internalGetCustomAttributes()); - if (!other.getObjectNamePrefix().isEmpty()) { - objectNamePrefix_ = other.objectNamePrefix_; - onChanged(); - } - if (!other.getPayloadFormat().isEmpty()) { - payloadFormat_ = other.payloadFormat_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.Notification parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.Notification) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * Required. The resource name of this notification.
-     * Format:
-     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
-     * The `{project}` portion may be `_` for globally unique buckets.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The resource name of this notification.
-     * Format:
-     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
-     * The `{project}` portion may be `_` for globally unique buckets.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The resource name of this notification.
-     * Format:
-     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
-     * The `{project}` portion may be `_` for globally unique buckets.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The resource name of this notification.
-     * Format:
-     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
-     * The `{project}` portion may be `_` for globally unique buckets.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The resource name of this notification.
-     * Format:
-     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
-     * The `{project}` portion may be `_` for globally unique buckets.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object topic_ = ""; - /** - * - * - *
-     * Required. The Pub/Sub topic to which this subscription publishes. Formatted as:
-     * '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'
-     * 
- * - * string topic = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The topic. - */ - public java.lang.String getTopic() { - java.lang.Object ref = topic_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - topic_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The Pub/Sub topic to which this subscription publishes. Formatted as:
-     * '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'
-     * 
- * - * string topic = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for topic. - */ - public com.google.protobuf.ByteString getTopicBytes() { - java.lang.Object ref = topic_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - topic_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The Pub/Sub topic to which this subscription publishes. Formatted as:
-     * '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'
-     * 
- * - * string topic = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The topic to set. - * @return This builder for chaining. - */ - public Builder setTopic(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - topic_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The Pub/Sub topic to which this subscription publishes. Formatted as:
-     * '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'
-     * 
- * - * string topic = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearTopic() { - - topic_ = getDefaultInstance().getTopic(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The Pub/Sub topic to which this subscription publishes. Formatted as:
-     * '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'
-     * 
- * - * string topic = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for topic to set. - * @return This builder for chaining. - */ - public Builder setTopicBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - topic_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList eventTypes_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensureEventTypesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - eventTypes_ = new com.google.protobuf.LazyStringArrayList(eventTypes_); - bitField0_ |= 0x00000001; - } - } - /** - * - * - *
-     * Optional. If present, only send notifications about listed event types. If empty,
-     * sent notifications for all event types.
-     * 
- * - * repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return A list containing the eventTypes. - */ - public com.google.protobuf.ProtocolStringList getEventTypesList() { - return eventTypes_.getUnmodifiableView(); - } - /** - * - * - *
-     * Optional. If present, only send notifications about listed event types. If empty,
-     * sent notifications for all event types.
-     * 
- * - * repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The count of eventTypes. - */ - public int getEventTypesCount() { - return eventTypes_.size(); - } - /** - * - * - *
-     * Optional. If present, only send notifications about listed event types. If empty,
-     * sent notifications for all event types.
-     * 
- * - * repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param index The index of the element to return. - * @return The eventTypes at the given index. - */ - public java.lang.String getEventTypes(int index) { - return eventTypes_.get(index); - } - /** - * - * - *
-     * Optional. If present, only send notifications about listed event types. If empty,
-     * sent notifications for all event types.
-     * 
- * - * repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param index The index of the value to return. - * @return The bytes of the eventTypes at the given index. - */ - public com.google.protobuf.ByteString getEventTypesBytes(int index) { - return eventTypes_.getByteString(index); - } - /** - * - * - *
-     * Optional. If present, only send notifications about listed event types. If empty,
-     * sent notifications for all event types.
-     * 
- * - * repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param index The index to set the value at. - * @param value The eventTypes to set. - * @return This builder for chaining. - */ - public Builder setEventTypes(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureEventTypesIsMutable(); - eventTypes_.set(index, value); - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. If present, only send notifications about listed event types. If empty,
-     * sent notifications for all event types.
-     * 
- * - * repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The eventTypes to add. - * @return This builder for chaining. - */ - public Builder addEventTypes(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureEventTypesIsMutable(); - eventTypes_.add(value); - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. If present, only send notifications about listed event types. If empty,
-     * sent notifications for all event types.
-     * 
- * - * repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param values The eventTypes to add. - * @return This builder for chaining. - */ - public Builder addAllEventTypes(java.lang.Iterable values) { - ensureEventTypesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, eventTypes_); - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. If present, only send notifications about listed event types. If empty,
-     * sent notifications for all event types.
-     * 
- * - * repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearEventTypes() { - eventTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. If present, only send notifications about listed event types. If empty,
-     * sent notifications for all event types.
-     * 
- * - * repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The bytes of the eventTypes to add. - * @return This builder for chaining. - */ - public Builder addEventTypesBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureEventTypesIsMutable(); - eventTypes_.add(value); - onChanged(); - return this; - } - - private com.google.protobuf.MapField customAttributes_; - - private com.google.protobuf.MapField - internalGetCustomAttributes() { - if (customAttributes_ == null) { - return com.google.protobuf.MapField.emptyMapField( - CustomAttributesDefaultEntryHolder.defaultEntry); - } - return customAttributes_; - } - - private com.google.protobuf.MapField - internalGetMutableCustomAttributes() { - onChanged(); - ; - if (customAttributes_ == null) { - customAttributes_ = - com.google.protobuf.MapField.newMapField( - CustomAttributesDefaultEntryHolder.defaultEntry); - } - if (!customAttributes_.isMutable()) { - customAttributes_ = customAttributes_.copy(); - } - return customAttributes_; - } - - public int getCustomAttributesCount() { - return internalGetCustomAttributes().getMap().size(); - } - /** - * - * - *
-     * Optional. An optional list of additional attributes to attach to each Pub/Sub
-     * message published for this notification subscription.
-     * 
- * - * - * map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public boolean containsCustomAttributes(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - return internalGetCustomAttributes().getMap().containsKey(key); - } - /** Use {@link #getCustomAttributesMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getCustomAttributes() { - return getCustomAttributesMap(); - } - /** - * - * - *
-     * Optional. An optional list of additional attributes to attach to each Pub/Sub
-     * message published for this notification subscription.
-     * 
- * - * - * map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public java.util.Map getCustomAttributesMap() { - return internalGetCustomAttributes().getMap(); - } - /** - * - * - *
-     * Optional. An optional list of additional attributes to attach to each Pub/Sub
-     * message published for this notification subscription.
-     * 
- * - * - * map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public java.lang.String getCustomAttributesOrDefault( - java.lang.String key, java.lang.String defaultValue) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - java.util.Map map = - internalGetCustomAttributes().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-     * Optional. An optional list of additional attributes to attach to each Pub/Sub
-     * message published for this notification subscription.
-     * 
- * - * - * map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public java.lang.String getCustomAttributesOrThrow(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - java.util.Map map = - internalGetCustomAttributes().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearCustomAttributes() { - internalGetMutableCustomAttributes().getMutableMap().clear(); - return this; - } - /** - * - * - *
-     * Optional. An optional list of additional attributes to attach to each Pub/Sub
-     * message published for this notification subscription.
-     * 
- * - * - * map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder removeCustomAttributes(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - internalGetMutableCustomAttributes().getMutableMap().remove(key); - return this; - } - /** Use alternate mutation accessors instead. */ - @java.lang.Deprecated - public java.util.Map getMutableCustomAttributes() { - return internalGetMutableCustomAttributes().getMutableMap(); - } - /** - * - * - *
-     * Optional. An optional list of additional attributes to attach to each Pub/Sub
-     * message published for this notification subscription.
-     * 
- * - * - * map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder putCustomAttributes(java.lang.String key, java.lang.String value) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - if (value == null) { - throw new java.lang.NullPointerException(); - } - internalGetMutableCustomAttributes().getMutableMap().put(key, value); - return this; - } - /** - * - * - *
-     * Optional. An optional list of additional attributes to attach to each Pub/Sub
-     * message published for this notification subscription.
-     * 
- * - * - * map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder putAllCustomAttributes( - java.util.Map values) { - internalGetMutableCustomAttributes().getMutableMap().putAll(values); - return this; - } - - private java.lang.Object objectNamePrefix_ = ""; - /** - * - * - *
-     * Optional. If present, only apply this notification config to object names that
-     * begin with this prefix.
-     * 
- * - * string object_name_prefix = 5 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The objectNamePrefix. - */ - public java.lang.String getObjectNamePrefix() { - java.lang.Object ref = objectNamePrefix_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - objectNamePrefix_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Optional. If present, only apply this notification config to object names that
-     * begin with this prefix.
-     * 
- * - * string object_name_prefix = 5 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for objectNamePrefix. - */ - public com.google.protobuf.ByteString getObjectNamePrefixBytes() { - java.lang.Object ref = objectNamePrefix_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - objectNamePrefix_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Optional. If present, only apply this notification config to object names that
-     * begin with this prefix.
-     * 
- * - * string object_name_prefix = 5 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The objectNamePrefix to set. - * @return This builder for chaining. - */ - public Builder setObjectNamePrefix(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - objectNamePrefix_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. If present, only apply this notification config to object names that
-     * begin with this prefix.
-     * 
- * - * string object_name_prefix = 5 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearObjectNamePrefix() { - - objectNamePrefix_ = getDefaultInstance().getObjectNamePrefix(); - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. If present, only apply this notification config to object names that
-     * begin with this prefix.
-     * 
- * - * string object_name_prefix = 5 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The bytes for objectNamePrefix to set. - * @return This builder for chaining. - */ - public Builder setObjectNamePrefixBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - objectNamePrefix_ = value; - onChanged(); - return this; - } - - private java.lang.Object payloadFormat_ = ""; - /** - * - * - *
-     * Required. The desired content of the Payload.
-     * 
- * - * string payload_format = 6 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The payloadFormat. - */ - public java.lang.String getPayloadFormat() { - java.lang.Object ref = payloadFormat_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - payloadFormat_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The desired content of the Payload.
-     * 
- * - * string payload_format = 6 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for payloadFormat. - */ - public com.google.protobuf.ByteString getPayloadFormatBytes() { - java.lang.Object ref = payloadFormat_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - payloadFormat_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The desired content of the Payload.
-     * 
- * - * string payload_format = 6 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The payloadFormat to set. - * @return This builder for chaining. - */ - public Builder setPayloadFormat(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - payloadFormat_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The desired content of the Payload.
-     * 
- * - * string payload_format = 6 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearPayloadFormat() { - - payloadFormat_ = getDefaultInstance().getPayloadFormat(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The desired content of the Payload.
-     * 
- * - * string payload_format = 6 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for payloadFormat to set. - * @return This builder for chaining. - */ - public Builder setPayloadFormatBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - payloadFormat_ = value; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.Notification) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.Notification) - private static final com.google.storage.v2.Notification DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.Notification(); - } - - public static com.google.storage.v2.Notification getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Notification parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Notification(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.Notification getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/NotificationName.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/NotificationName.java deleted file mode 100644 index 3263f3bd12..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/NotificationName.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.storage.v2; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class NotificationName implements ResourceName { - private static final PathTemplate PROJECT_BUCKET_NOTIFICATION = - PathTemplate.createWithoutUrlEncoding( - "projects/{project}/buckets/{bucket}/notificationConfigs/{notification}"); - private volatile Map fieldValuesMap; - private final String project; - private final String bucket; - private final String notification; - - @Deprecated - protected NotificationName() { - project = null; - bucket = null; - notification = null; - } - - private NotificationName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - bucket = Preconditions.checkNotNull(builder.getBucket()); - notification = Preconditions.checkNotNull(builder.getNotification()); - } - - public String getProject() { - return project; - } - - public String getBucket() { - return bucket; - } - - public String getNotification() { - return notification; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static NotificationName of(String project, String bucket, String notification) { - return newBuilder().setProject(project).setBucket(bucket).setNotification(notification).build(); - } - - public static String format(String project, String bucket, String notification) { - return newBuilder() - .setProject(project) - .setBucket(bucket) - .setNotification(notification) - .build() - .toString(); - } - - public static NotificationName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PROJECT_BUCKET_NOTIFICATION.validatedMatch( - formattedString, "NotificationName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("bucket"), matchMap.get("notification")); - } - - public static List parseList(List formattedStrings) { - List list = new ArrayList<>(formattedStrings.size()); - for (String formattedString : formattedStrings) { - list.add(parse(formattedString)); - } - return list; - } - - public static List toStringList(List values) { - List list = new ArrayList<>(values.size()); - for (NotificationName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PROJECT_BUCKET_NOTIFICATION.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { - fieldMapBuilder.put("project", project); - } - if (bucket != null) { - fieldMapBuilder.put("bucket", bucket); - } - if (notification != null) { - fieldMapBuilder.put("notification", notification); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PROJECT_BUCKET_NOTIFICATION.instantiate( - "project", project, "bucket", bucket, "notification", notification); - } - - @Override - public boolean equals(java.lang.Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - NotificationName that = ((NotificationName) o); - return Objects.equals(this.project, that.project) - && Objects.equals(this.bucket, that.bucket) - && Objects.equals(this.notification, that.notification); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(bucket); - h *= 1000003; - h ^= Objects.hashCode(notification); - return h; - } - - /** Builder for projects/{project}/buckets/{bucket}/notificationConfigs/{notification}. */ - public static class Builder { - private String project; - private String bucket; - private String notification; - - protected Builder() {} - - public String getProject() { - return project; - } - - public String getBucket() { - return bucket; - } - - public String getNotification() { - return notification; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setBucket(String bucket) { - this.bucket = bucket; - return this; - } - - public Builder setNotification(String notification) { - this.notification = notification; - return this; - } - - private Builder(NotificationName notificationName) { - this.project = notificationName.project; - this.bucket = notificationName.bucket; - this.notification = notificationName.notification; - } - - public NotificationName build() { - return new NotificationName(this); - } - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/NotificationOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/NotificationOrBuilder.java deleted file mode 100644 index 2d19e42721..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/NotificationOrBuilder.java +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface NotificationOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.Notification) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The resource name of this notification.
-   * Format:
-   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
-   * The `{project}` portion may be `_` for globally unique buckets.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-   * Required. The resource name of this notification.
-   * Format:
-   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
-   * The `{project}` portion may be `_` for globally unique buckets.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-   * Required. The Pub/Sub topic to which this subscription publishes. Formatted as:
-   * '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'
-   * 
- * - * string topic = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The topic. - */ - java.lang.String getTopic(); - /** - * - * - *
-   * Required. The Pub/Sub topic to which this subscription publishes. Formatted as:
-   * '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'
-   * 
- * - * string topic = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for topic. - */ - com.google.protobuf.ByteString getTopicBytes(); - - /** - * - * - *
-   * Optional. If present, only send notifications about listed event types. If empty,
-   * sent notifications for all event types.
-   * 
- * - * repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return A list containing the eventTypes. - */ - java.util.List getEventTypesList(); - /** - * - * - *
-   * Optional. If present, only send notifications about listed event types. If empty,
-   * sent notifications for all event types.
-   * 
- * - * repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The count of eventTypes. - */ - int getEventTypesCount(); - /** - * - * - *
-   * Optional. If present, only send notifications about listed event types. If empty,
-   * sent notifications for all event types.
-   * 
- * - * repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param index The index of the element to return. - * @return The eventTypes at the given index. - */ - java.lang.String getEventTypes(int index); - /** - * - * - *
-   * Optional. If present, only send notifications about listed event types. If empty,
-   * sent notifications for all event types.
-   * 
- * - * repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param index The index of the value to return. - * @return The bytes of the eventTypes at the given index. - */ - com.google.protobuf.ByteString getEventTypesBytes(int index); - - /** - * - * - *
-   * Optional. An optional list of additional attributes to attach to each Pub/Sub
-   * message published for this notification subscription.
-   * 
- * - * - * map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - int getCustomAttributesCount(); - /** - * - * - *
-   * Optional. An optional list of additional attributes to attach to each Pub/Sub
-   * message published for this notification subscription.
-   * 
- * - * - * map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - boolean containsCustomAttributes(java.lang.String key); - /** Use {@link #getCustomAttributesMap()} instead. */ - @java.lang.Deprecated - java.util.Map getCustomAttributes(); - /** - * - * - *
-   * Optional. An optional list of additional attributes to attach to each Pub/Sub
-   * message published for this notification subscription.
-   * 
- * - * - * map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - java.util.Map getCustomAttributesMap(); - /** - * - * - *
-   * Optional. An optional list of additional attributes to attach to each Pub/Sub
-   * message published for this notification subscription.
-   * 
- * - * - * map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - java.lang.String getCustomAttributesOrDefault( - java.lang.String key, java.lang.String defaultValue); - /** - * - * - *
-   * Optional. An optional list of additional attributes to attach to each Pub/Sub
-   * message published for this notification subscription.
-   * 
- * - * - * map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - java.lang.String getCustomAttributesOrThrow(java.lang.String key); - - /** - * - * - *
-   * Optional. If present, only apply this notification config to object names that
-   * begin with this prefix.
-   * 
- * - * string object_name_prefix = 5 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The objectNamePrefix. - */ - java.lang.String getObjectNamePrefix(); - /** - * - * - *
-   * Optional. If present, only apply this notification config to object names that
-   * begin with this prefix.
-   * 
- * - * string object_name_prefix = 5 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for objectNamePrefix. - */ - com.google.protobuf.ByteString getObjectNamePrefixBytes(); - - /** - * - * - *
-   * Required. The desired content of the Payload.
-   * 
- * - * string payload_format = 6 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The payloadFormat. - */ - java.lang.String getPayloadFormat(); - /** - * - * - *
-   * Required. The desired content of the Payload.
-   * 
- * - * string payload_format = 6 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for payloadFormat. - */ - com.google.protobuf.ByteString getPayloadFormatBytes(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Object.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Object.java deleted file mode 100644 index 6ea1c55128..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Object.java +++ /dev/null @@ -1,6573 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * An object.
- * 
- * - * Protobuf type {@code google.storage.v2.Object} - */ -public final class Object extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.Object) - ObjectOrBuilder { - private static final long serialVersionUID = 0L; - // Use Object.newBuilder() to construct. - private Object(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Object() { - name_ = ""; - bucket_ = ""; - storageClass_ = ""; - contentEncoding_ = ""; - contentDisposition_ = ""; - cacheControl_ = ""; - acl_ = java.util.Collections.emptyList(); - contentLanguage_ = ""; - contentType_ = ""; - kmsKey_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Object(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Object( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - bucket_ = s; - break; - } - case 24: - { - generation_ = input.readInt64(); - break; - } - case 32: - { - metageneration_ = input.readInt64(); - break; - } - case 42: - { - java.lang.String s = input.readStringRequireUtf8(); - - storageClass_ = s; - break; - } - case 48: - { - size_ = input.readInt64(); - break; - } - case 58: - { - java.lang.String s = input.readStringRequireUtf8(); - - contentEncoding_ = s; - break; - } - case 66: - { - java.lang.String s = input.readStringRequireUtf8(); - - contentDisposition_ = s; - break; - } - case 74: - { - java.lang.String s = input.readStringRequireUtf8(); - - cacheControl_ = s; - break; - } - case 82: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - acl_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - acl_.add( - input.readMessage( - com.google.storage.v2.ObjectAccessControl.parser(), extensionRegistry)); - break; - } - case 90: - { - java.lang.String s = input.readStringRequireUtf8(); - - contentLanguage_ = s; - break; - } - case 98: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (deleteTime_ != null) { - subBuilder = deleteTime_.toBuilder(); - } - deleteTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(deleteTime_); - deleteTime_ = subBuilder.buildPartial(); - } - - break; - } - case 106: - { - java.lang.String s = input.readStringRequireUtf8(); - - contentType_ = s; - break; - } - case 114: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (createTime_ != null) { - subBuilder = createTime_.toBuilder(); - } - createTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(createTime_); - createTime_ = subBuilder.buildPartial(); - } - - break; - } - case 120: - { - componentCount_ = input.readInt32(); - break; - } - case 130: - { - com.google.storage.v2.ObjectChecksums.Builder subBuilder = null; - if (checksums_ != null) { - subBuilder = checksums_.toBuilder(); - } - checksums_ = - input.readMessage( - com.google.storage.v2.ObjectChecksums.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(checksums_); - checksums_ = subBuilder.buildPartial(); - } - - break; - } - case 138: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (updateTime_ != null) { - subBuilder = updateTime_.toBuilder(); - } - updateTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateTime_); - updateTime_ = subBuilder.buildPartial(); - } - - break; - } - case 146: - { - java.lang.String s = input.readStringRequireUtf8(); - - kmsKey_ = s; - break; - } - case 154: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (updateStorageClassTime_ != null) { - subBuilder = updateStorageClassTime_.toBuilder(); - } - updateStorageClassTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateStorageClassTime_); - updateStorageClassTime_ = subBuilder.buildPartial(); - } - - break; - } - case 160: - { - temporaryHold_ = input.readBool(); - break; - } - case 170: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (retentionExpireTime_ != null) { - subBuilder = retentionExpireTime_.toBuilder(); - } - retentionExpireTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(retentionExpireTime_); - retentionExpireTime_ = subBuilder.buildPartial(); - } - - break; - } - case 178: - { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - metadata_ = - com.google.protobuf.MapField.newMapField( - MetadataDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; - } - com.google.protobuf.MapEntry metadata__ = - input.readMessage( - MetadataDefaultEntryHolder.defaultEntry.getParserForType(), - extensionRegistry); - metadata_.getMutableMap().put(metadata__.getKey(), metadata__.getValue()); - break; - } - case 184: - { - bitField0_ |= 0x00000001; - eventBasedHold_ = input.readBool(); - break; - } - case 194: - { - com.google.storage.v2.Owner.Builder subBuilder = null; - if (owner_ != null) { - subBuilder = owner_.toBuilder(); - } - owner_ = input.readMessage(com.google.storage.v2.Owner.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(owner_); - owner_ = subBuilder.buildPartial(); - } - - break; - } - case 202: - { - com.google.storage.v2.CustomerEncryption.Builder subBuilder = null; - if (customerEncryption_ != null) { - subBuilder = customerEncryption_.toBuilder(); - } - customerEncryption_ = - input.readMessage( - com.google.storage.v2.CustomerEncryption.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(customerEncryption_); - customerEncryption_ = subBuilder.buildPartial(); - } - - break; - } - case 210: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (customTime_ != null) { - subBuilder = customTime_.toBuilder(); - } - customTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(customTime_); - customTime_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - acl_ = java.util.Collections.unmodifiableList(acl_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto.internal_static_google_storage_v2_Object_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 22: - return internalGetMetadata(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Object_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Object.class, com.google.storage.v2.Object.Builder.class); - } - - private int bitField0_; - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * - * - *
-   * Immutable. The name of this object. Nearly any sequence of unicode characters is
-   * valid. See
-   * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
-   * Example: `test.txt`
-   * The `name` field by itself does not uniquely identify a Cloud Storage
-   * object. A Cloud Storage object is uniquely identified by the tuple of
-   * (bucket, object, generation).
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * - * - *
-   * Immutable. The name of this object. Nearly any sequence of unicode characters is
-   * valid. See
-   * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
-   * Example: `test.txt`
-   * The `name` field by itself does not uniquely identify a Cloud Storage
-   * object. A Cloud Storage object is uniquely identified by the tuple of
-   * (bucket, object, generation).
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int BUCKET_FIELD_NUMBER = 2; - private volatile java.lang.Object bucket_; - /** - * - * - *
-   * Immutable. The name of the bucket containing this object.
-   * 
- * - * - * string bucket = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @return The bucket. - */ - @java.lang.Override - public java.lang.String getBucket() { - java.lang.Object ref = bucket_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - bucket_ = s; - return s; - } - } - /** - * - * - *
-   * Immutable. The name of the bucket containing this object.
-   * 
- * - * - * string bucket = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for bucket. - */ - @java.lang.Override - public com.google.protobuf.ByteString getBucketBytes() { - java.lang.Object ref = bucket_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - bucket_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int GENERATION_FIELD_NUMBER = 3; - private long generation_; - /** - * - * - *
-   * Immutable. The content generation of this object. Used for object versioning.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * int64 generation = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The generation. - */ - @java.lang.Override - public long getGeneration() { - return generation_; - } - - public static final int METAGENERATION_FIELD_NUMBER = 4; - private long metageneration_; - /** - * - * - *
-   * Output only. The version of the metadata for this generation of this object. Used for
-   * preconditions and for detecting changes in metadata. A metageneration
-   * number is only meaningful in the context of a particular generation of a
-   * particular object.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * int64 metageneration = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The metageneration. - */ - @java.lang.Override - public long getMetageneration() { - return metageneration_; - } - - public static final int STORAGE_CLASS_FIELD_NUMBER = 5; - private volatile java.lang.Object storageClass_; - /** - * - * - *
-   * Storage class of the object.
-   * 
- * - * string storage_class = 5; - * - * @return The storageClass. - */ - @java.lang.Override - public java.lang.String getStorageClass() { - java.lang.Object ref = storageClass_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - storageClass_ = s; - return s; - } - } - /** - * - * - *
-   * Storage class of the object.
-   * 
- * - * string storage_class = 5; - * - * @return The bytes for storageClass. - */ - @java.lang.Override - public com.google.protobuf.ByteString getStorageClassBytes() { - java.lang.Object ref = storageClass_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - storageClass_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SIZE_FIELD_NUMBER = 6; - private long size_; - /** - * - * - *
-   * Output only. Content-Length of the object data in bytes, matching
-   * [https://tools.ietf.org/html/rfc7230#section-3.3.2][RFC 7230 §3.3.2].
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * int64 size = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The size. - */ - @java.lang.Override - public long getSize() { - return size_; - } - - public static final int CONTENT_ENCODING_FIELD_NUMBER = 7; - private volatile java.lang.Object contentEncoding_; - /** - * - * - *
-   * Content-Encoding of the object data, matching
-   * [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2]
-   * 
- * - * string content_encoding = 7; - * - * @return The contentEncoding. - */ - @java.lang.Override - public java.lang.String getContentEncoding() { - java.lang.Object ref = contentEncoding_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - contentEncoding_ = s; - return s; - } - } - /** - * - * - *
-   * Content-Encoding of the object data, matching
-   * [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2]
-   * 
- * - * string content_encoding = 7; - * - * @return The bytes for contentEncoding. - */ - @java.lang.Override - public com.google.protobuf.ByteString getContentEncodingBytes() { - java.lang.Object ref = contentEncoding_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - contentEncoding_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONTENT_DISPOSITION_FIELD_NUMBER = 8; - private volatile java.lang.Object contentDisposition_; - /** - * - * - *
-   * Content-Disposition of the object data, matching
-   * [https://tools.ietf.org/html/rfc6266][RFC 6266].
-   * 
- * - * string content_disposition = 8; - * - * @return The contentDisposition. - */ - @java.lang.Override - public java.lang.String getContentDisposition() { - java.lang.Object ref = contentDisposition_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - contentDisposition_ = s; - return s; - } - } - /** - * - * - *
-   * Content-Disposition of the object data, matching
-   * [https://tools.ietf.org/html/rfc6266][RFC 6266].
-   * 
- * - * string content_disposition = 8; - * - * @return The bytes for contentDisposition. - */ - @java.lang.Override - public com.google.protobuf.ByteString getContentDispositionBytes() { - java.lang.Object ref = contentDisposition_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - contentDisposition_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CACHE_CONTROL_FIELD_NUMBER = 9; - private volatile java.lang.Object cacheControl_; - /** - * - * - *
-   * Cache-Control directive for the object data, matching
-   * [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2].
-   * If omitted, and the object is accessible to all anonymous users, the
-   * default will be `public, max-age=3600`.
-   * 
- * - * string cache_control = 9; - * - * @return The cacheControl. - */ - @java.lang.Override - public java.lang.String getCacheControl() { - java.lang.Object ref = cacheControl_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - cacheControl_ = s; - return s; - } - } - /** - * - * - *
-   * Cache-Control directive for the object data, matching
-   * [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2].
-   * If omitted, and the object is accessible to all anonymous users, the
-   * default will be `public, max-age=3600`.
-   * 
- * - * string cache_control = 9; - * - * @return The bytes for cacheControl. - */ - @java.lang.Override - public com.google.protobuf.ByteString getCacheControlBytes() { - java.lang.Object ref = cacheControl_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - cacheControl_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ACL_FIELD_NUMBER = 10; - private java.util.List acl_; - /** - * - * - *
-   * Access controls on the object.
-   * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-   * bucket, requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - @java.lang.Override - public java.util.List getAclList() { - return acl_; - } - /** - * - * - *
-   * Access controls on the object.
-   * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-   * bucket, requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - @java.lang.Override - public java.util.List - getAclOrBuilderList() { - return acl_; - } - /** - * - * - *
-   * Access controls on the object.
-   * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-   * bucket, requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - @java.lang.Override - public int getAclCount() { - return acl_.size(); - } - /** - * - * - *
-   * Access controls on the object.
-   * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-   * bucket, requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - @java.lang.Override - public com.google.storage.v2.ObjectAccessControl getAcl(int index) { - return acl_.get(index); - } - /** - * - * - *
-   * Access controls on the object.
-   * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-   * bucket, requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - @java.lang.Override - public com.google.storage.v2.ObjectAccessControlOrBuilder getAclOrBuilder(int index) { - return acl_.get(index); - } - - public static final int CONTENT_LANGUAGE_FIELD_NUMBER = 11; - private volatile java.lang.Object contentLanguage_; - /** - * - * - *
-   * Content-Language of the object data, matching
-   * [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2].
-   * 
- * - * string content_language = 11; - * - * @return The contentLanguage. - */ - @java.lang.Override - public java.lang.String getContentLanguage() { - java.lang.Object ref = contentLanguage_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - contentLanguage_ = s; - return s; - } - } - /** - * - * - *
-   * Content-Language of the object data, matching
-   * [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2].
-   * 
- * - * string content_language = 11; - * - * @return The bytes for contentLanguage. - */ - @java.lang.Override - public com.google.protobuf.ByteString getContentLanguageBytes() { - java.lang.Object ref = contentLanguage_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - contentLanguage_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DELETE_TIME_FIELD_NUMBER = 12; - private com.google.protobuf.Timestamp deleteTime_; - /** - * - * - *
-   * Output only. The deletion time of the object. Will be returned if and only if this
-   * version of the object has been deleted.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the deleteTime field is set. - */ - @java.lang.Override - public boolean hasDeleteTime() { - return deleteTime_ != null; - } - /** - * - * - *
-   * Output only. The deletion time of the object. Will be returned if and only if this
-   * version of the object has been deleted.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The deleteTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getDeleteTime() { - return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; - } - /** - * - * - *
-   * Output only. The deletion time of the object. Will be returned if and only if this
-   * version of the object has been deleted.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { - return getDeleteTime(); - } - - public static final int CONTENT_TYPE_FIELD_NUMBER = 13; - private volatile java.lang.Object contentType_; - /** - * - * - *
-   * Content-Type of the object data, matching
-   * [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5].
-   * If an object is stored without a Content-Type, it is served as
-   * `application/octet-stream`.
-   * 
- * - * string content_type = 13; - * - * @return The contentType. - */ - @java.lang.Override - public java.lang.String getContentType() { - java.lang.Object ref = contentType_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - contentType_ = s; - return s; - } - } - /** - * - * - *
-   * Content-Type of the object data, matching
-   * [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5].
-   * If an object is stored without a Content-Type, it is served as
-   * `application/octet-stream`.
-   * 
- * - * string content_type = 13; - * - * @return The bytes for contentType. - */ - @java.lang.Override - public com.google.protobuf.ByteString getContentTypeBytes() { - java.lang.Object ref = contentType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - contentType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CREATE_TIME_FIELD_NUMBER = 14; - private com.google.protobuf.Timestamp createTime_; - /** - * - * - *
-   * Output only. The creation time of the object.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the createTime field is set. - */ - @java.lang.Override - public boolean hasCreateTime() { - return createTime_ != null; - } - /** - * - * - *
-   * Output only. The creation time of the object.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The createTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getCreateTime() { - return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; - } - /** - * - * - *
-   * Output only. The creation time of the object.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { - return getCreateTime(); - } - - public static final int COMPONENT_COUNT_FIELD_NUMBER = 15; - private int componentCount_; - /** - * - * - *
-   * Output only. Number of underlying components that make up this object. Components are
-   * accumulated by compose operations.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * int32 component_count = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The componentCount. - */ - @java.lang.Override - public int getComponentCount() { - return componentCount_; - } - - public static final int CHECKSUMS_FIELD_NUMBER = 16; - private com.google.storage.v2.ObjectChecksums checksums_; - /** - * - * - *
-   * Output only. Hashes for the data part of this object.
-   * 
- * - * - * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the checksums field is set. - */ - @java.lang.Override - public boolean hasChecksums() { - return checksums_ != null; - } - /** - * - * - *
-   * Output only. Hashes for the data part of this object.
-   * 
- * - * - * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The checksums. - */ - @java.lang.Override - public com.google.storage.v2.ObjectChecksums getChecksums() { - return checksums_ == null - ? com.google.storage.v2.ObjectChecksums.getDefaultInstance() - : checksums_; - } - /** - * - * - *
-   * Output only. Hashes for the data part of this object.
-   * 
- * - * - * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - @java.lang.Override - public com.google.storage.v2.ObjectChecksumsOrBuilder getChecksumsOrBuilder() { - return getChecksums(); - } - - public static final int UPDATE_TIME_FIELD_NUMBER = 17; - private com.google.protobuf.Timestamp updateTime_; - /** - * - * - *
-   * Output only. The modification time of the object metadata.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the updateTime field is set. - */ - @java.lang.Override - public boolean hasUpdateTime() { - return updateTime_ != null; - } - /** - * - * - *
-   * Output only. The modification time of the object metadata.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The updateTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getUpdateTime() { - return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; - } - /** - * - * - *
-   * Output only. The modification time of the object metadata.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { - return getUpdateTime(); - } - - public static final int KMS_KEY_FIELD_NUMBER = 18; - private volatile java.lang.Object kmsKey_; - /** - * - * - *
-   * Cloud KMS Key used to encrypt this object, if the object is encrypted by
-   * such a key.
-   * 
- * - * string kms_key = 18 [(.google.api.resource_reference) = { ... } - * - * @return The kmsKey. - */ - @java.lang.Override - public java.lang.String getKmsKey() { - java.lang.Object ref = kmsKey_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - kmsKey_ = s; - return s; - } - } - /** - * - * - *
-   * Cloud KMS Key used to encrypt this object, if the object is encrypted by
-   * such a key.
-   * 
- * - * string kms_key = 18 [(.google.api.resource_reference) = { ... } - * - * @return The bytes for kmsKey. - */ - @java.lang.Override - public com.google.protobuf.ByteString getKmsKeyBytes() { - java.lang.Object ref = kmsKey_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - kmsKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int UPDATE_STORAGE_CLASS_TIME_FIELD_NUMBER = 19; - private com.google.protobuf.Timestamp updateStorageClassTime_; - /** - * - * - *
-   * Output only. The time at which the object's storage class was last changed. When the
-   * object is initially created, it will be set to time_created.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * - * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the updateStorageClassTime field is set. - */ - @java.lang.Override - public boolean hasUpdateStorageClassTime() { - return updateStorageClassTime_ != null; - } - /** - * - * - *
-   * Output only. The time at which the object's storage class was last changed. When the
-   * object is initially created, it will be set to time_created.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * - * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The updateStorageClassTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getUpdateStorageClassTime() { - return updateStorageClassTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : updateStorageClassTime_; - } - /** - * - * - *
-   * Output only. The time at which the object's storage class was last changed. When the
-   * object is initially created, it will be set to time_created.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * - * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getUpdateStorageClassTimeOrBuilder() { - return getUpdateStorageClassTime(); - } - - public static final int TEMPORARY_HOLD_FIELD_NUMBER = 20; - private boolean temporaryHold_; - /** - * - * - *
-   * Whether an object is under temporary hold. While this flag is set to true,
-   * the object is protected against deletion and overwrites.  A common use case
-   * of this flag is regulatory investigations where objects need to be retained
-   * while the investigation is ongoing. Note that unlike event-based hold,
-   * temporary hold does not impact retention expiration time of an object.
-   * 
- * - * bool temporary_hold = 20; - * - * @return The temporaryHold. - */ - @java.lang.Override - public boolean getTemporaryHold() { - return temporaryHold_; - } - - public static final int RETENTION_EXPIRE_TIME_FIELD_NUMBER = 21; - private com.google.protobuf.Timestamp retentionExpireTime_; - /** - * - * - *
-   * A server-determined value that specifies the earliest time that the
-   * object's retention period expires. This value is in
-   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-   * Note 1: This field is not provided for objects with an active event-based
-   * hold, since retention expiration is unknown until the hold is removed.
-   * Note 2: This value can be provided even when temporary hold is set (so that
-   * the user can reason about policy without having to first unset the
-   * temporary hold).
-   * 
- * - * .google.protobuf.Timestamp retention_expire_time = 21; - * - * @return Whether the retentionExpireTime field is set. - */ - @java.lang.Override - public boolean hasRetentionExpireTime() { - return retentionExpireTime_ != null; - } - /** - * - * - *
-   * A server-determined value that specifies the earliest time that the
-   * object's retention period expires. This value is in
-   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-   * Note 1: This field is not provided for objects with an active event-based
-   * hold, since retention expiration is unknown until the hold is removed.
-   * Note 2: This value can be provided even when temporary hold is set (so that
-   * the user can reason about policy without having to first unset the
-   * temporary hold).
-   * 
- * - * .google.protobuf.Timestamp retention_expire_time = 21; - * - * @return The retentionExpireTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getRetentionExpireTime() { - return retentionExpireTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : retentionExpireTime_; - } - /** - * - * - *
-   * A server-determined value that specifies the earliest time that the
-   * object's retention period expires. This value is in
-   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-   * Note 1: This field is not provided for objects with an active event-based
-   * hold, since retention expiration is unknown until the hold is removed.
-   * Note 2: This value can be provided even when temporary hold is set (so that
-   * the user can reason about policy without having to first unset the
-   * temporary hold).
-   * 
- * - * .google.protobuf.Timestamp retention_expire_time = 21; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getRetentionExpireTimeOrBuilder() { - return getRetentionExpireTime(); - } - - public static final int METADATA_FIELD_NUMBER = 22; - - private static final class MetadataDefaultEntryHolder { - static final com.google.protobuf.MapEntry defaultEntry = - com.google.protobuf.MapEntry.newDefaultInstance( - com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Object_MetadataEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - - private com.google.protobuf.MapField metadata_; - - private com.google.protobuf.MapField internalGetMetadata() { - if (metadata_ == null) { - return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry); - } - return metadata_; - } - - public int getMetadataCount() { - return internalGetMetadata().getMap().size(); - } - /** - * - * - *
-   * User-provided metadata, in key/value pairs.
-   * 
- * - * map<string, string> metadata = 22; - */ - @java.lang.Override - public boolean containsMetadata(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - return internalGetMetadata().getMap().containsKey(key); - } - /** Use {@link #getMetadataMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getMetadata() { - return getMetadataMap(); - } - /** - * - * - *
-   * User-provided metadata, in key/value pairs.
-   * 
- * - * map<string, string> metadata = 22; - */ - @java.lang.Override - public java.util.Map getMetadataMap() { - return internalGetMetadata().getMap(); - } - /** - * - * - *
-   * User-provided metadata, in key/value pairs.
-   * 
- * - * map<string, string> metadata = 22; - */ - @java.lang.Override - public java.lang.String getMetadataOrDefault( - java.lang.String key, java.lang.String defaultValue) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - java.util.Map map = internalGetMetadata().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-   * User-provided metadata, in key/value pairs.
-   * 
- * - * map<string, string> metadata = 22; - */ - @java.lang.Override - public java.lang.String getMetadataOrThrow(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - java.util.Map map = internalGetMetadata().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int EVENT_BASED_HOLD_FIELD_NUMBER = 23; - private boolean eventBasedHold_; - /** - * - * - *
-   * Whether an object is under event-based hold.
-   * An event-based hold is a way to force the retention of an object until
-   * after some event occurs. Once the hold is released by explicitly setting
-   * this field to false, the object will become subject to any bucket-level
-   * retention policy, except that the retention duration will be calculated
-   * from the time the event based hold was lifted, rather than the time the
-   * object was created.
-   * In a WriteObject request, not setting this field implies that the value
-   * should be taken from the parent bucket's "default_event_based_hold" field.
-   * In a response, this field will always be set to true or false.
-   * 
- * - * optional bool event_based_hold = 23; - * - * @return Whether the eventBasedHold field is set. - */ - @java.lang.Override - public boolean hasEventBasedHold() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-   * Whether an object is under event-based hold.
-   * An event-based hold is a way to force the retention of an object until
-   * after some event occurs. Once the hold is released by explicitly setting
-   * this field to false, the object will become subject to any bucket-level
-   * retention policy, except that the retention duration will be calculated
-   * from the time the event based hold was lifted, rather than the time the
-   * object was created.
-   * In a WriteObject request, not setting this field implies that the value
-   * should be taken from the parent bucket's "default_event_based_hold" field.
-   * In a response, this field will always be set to true or false.
-   * 
- * - * optional bool event_based_hold = 23; - * - * @return The eventBasedHold. - */ - @java.lang.Override - public boolean getEventBasedHold() { - return eventBasedHold_; - } - - public static final int OWNER_FIELD_NUMBER = 24; - private com.google.storage.v2.Owner owner_; - /** - * - * - *
-   * Output only. The owner of the object. This will always be the uploader of the object.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return Whether the owner field is set. - */ - @java.lang.Override - public boolean hasOwner() { - return owner_ != null; - } - /** - * - * - *
-   * Output only. The owner of the object. This will always be the uploader of the object.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The owner. - */ - @java.lang.Override - public com.google.storage.v2.Owner getOwner() { - return owner_ == null ? com.google.storage.v2.Owner.getDefaultInstance() : owner_; - } - /** - * - * - *
-   * Output only. The owner of the object. This will always be the uploader of the object.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - @java.lang.Override - public com.google.storage.v2.OwnerOrBuilder getOwnerOrBuilder() { - return getOwner(); - } - - public static final int CUSTOMER_ENCRYPTION_FIELD_NUMBER = 25; - private com.google.storage.v2.CustomerEncryption customerEncryption_; - /** - * - * - *
-   * Metadata of Customer-Supplied Encryption Key, if the object is encrypted by
-   * such a key.
-   * 
- * - * .google.storage.v2.CustomerEncryption customer_encryption = 25; - * - * @return Whether the customerEncryption field is set. - */ - @java.lang.Override - public boolean hasCustomerEncryption() { - return customerEncryption_ != null; - } - /** - * - * - *
-   * Metadata of Customer-Supplied Encryption Key, if the object is encrypted by
-   * such a key.
-   * 
- * - * .google.storage.v2.CustomerEncryption customer_encryption = 25; - * - * @return The customerEncryption. - */ - @java.lang.Override - public com.google.storage.v2.CustomerEncryption getCustomerEncryption() { - return customerEncryption_ == null - ? com.google.storage.v2.CustomerEncryption.getDefaultInstance() - : customerEncryption_; - } - /** - * - * - *
-   * Metadata of Customer-Supplied Encryption Key, if the object is encrypted by
-   * such a key.
-   * 
- * - * .google.storage.v2.CustomerEncryption customer_encryption = 25; - */ - @java.lang.Override - public com.google.storage.v2.CustomerEncryptionOrBuilder getCustomerEncryptionOrBuilder() { - return getCustomerEncryption(); - } - - public static final int CUSTOM_TIME_FIELD_NUMBER = 26; - private com.google.protobuf.Timestamp customTime_; - /** - * - * - *
-   * A user-specified timestamp set on an object.
-   * 
- * - * .google.protobuf.Timestamp custom_time = 26; - * - * @return Whether the customTime field is set. - */ - @java.lang.Override - public boolean hasCustomTime() { - return customTime_ != null; - } - /** - * - * - *
-   * A user-specified timestamp set on an object.
-   * 
- * - * .google.protobuf.Timestamp custom_time = 26; - * - * @return The customTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getCustomTime() { - return customTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : customTime_; - } - /** - * - * - *
-   * A user-specified timestamp set on an object.
-   * 
- * - * .google.protobuf.Timestamp custom_time = 26; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getCustomTimeOrBuilder() { - return getCustomTime(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucket_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, bucket_); - } - if (generation_ != 0L) { - output.writeInt64(3, generation_); - } - if (metageneration_ != 0L) { - output.writeInt64(4, metageneration_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(storageClass_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, storageClass_); - } - if (size_ != 0L) { - output.writeInt64(6, size_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contentEncoding_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, contentEncoding_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contentDisposition_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, contentDisposition_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cacheControl_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 9, cacheControl_); - } - for (int i = 0; i < acl_.size(); i++) { - output.writeMessage(10, acl_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contentLanguage_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 11, contentLanguage_); - } - if (deleteTime_ != null) { - output.writeMessage(12, getDeleteTime()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contentType_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 13, contentType_); - } - if (createTime_ != null) { - output.writeMessage(14, getCreateTime()); - } - if (componentCount_ != 0) { - output.writeInt32(15, componentCount_); - } - if (checksums_ != null) { - output.writeMessage(16, getChecksums()); - } - if (updateTime_ != null) { - output.writeMessage(17, getUpdateTime()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKey_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 18, kmsKey_); - } - if (updateStorageClassTime_ != null) { - output.writeMessage(19, getUpdateStorageClassTime()); - } - if (temporaryHold_ != false) { - output.writeBool(20, temporaryHold_); - } - if (retentionExpireTime_ != null) { - output.writeMessage(21, getRetentionExpireTime()); - } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( - output, internalGetMetadata(), MetadataDefaultEntryHolder.defaultEntry, 22); - if (((bitField0_ & 0x00000001) != 0)) { - output.writeBool(23, eventBasedHold_); - } - if (owner_ != null) { - output.writeMessage(24, getOwner()); - } - if (customerEncryption_ != null) { - output.writeMessage(25, getCustomerEncryption()); - } - if (customTime_ != null) { - output.writeMessage(26, getCustomTime()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucket_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, bucket_); - } - if (generation_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, generation_); - } - if (metageneration_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, metageneration_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(storageClass_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, storageClass_); - } - if (size_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(6, size_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contentEncoding_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, contentEncoding_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contentDisposition_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, contentDisposition_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cacheControl_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, cacheControl_); - } - for (int i = 0; i < acl_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, acl_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contentLanguage_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, contentLanguage_); - } - if (deleteTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getDeleteTime()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contentType_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, contentType_); - } - if (createTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getCreateTime()); - } - if (componentCount_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(15, componentCount_); - } - if (checksums_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, getChecksums()); - } - if (updateTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, getUpdateTime()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKey_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(18, kmsKey_); - } - if (updateStorageClassTime_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize(19, getUpdateStorageClassTime()); - } - if (temporaryHold_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(20, temporaryHold_); - } - if (retentionExpireTime_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize(21, getRetentionExpireTime()); - } - for (java.util.Map.Entry entry : - internalGetMetadata().getMap().entrySet()) { - com.google.protobuf.MapEntry metadata__ = - MetadataDefaultEntryHolder.defaultEntry - .newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream.computeMessageSize(22, metadata__); - } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(23, eventBasedHold_); - } - if (owner_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(24, getOwner()); - } - if (customerEncryption_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(25, getCustomerEncryption()); - } - if (customTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(26, getCustomTime()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.Object)) { - return super.equals(obj); - } - com.google.storage.v2.Object other = (com.google.storage.v2.Object) obj; - - if (!getName().equals(other.getName())) return false; - if (!getBucket().equals(other.getBucket())) return false; - if (getGeneration() != other.getGeneration()) return false; - if (getMetageneration() != other.getMetageneration()) return false; - if (!getStorageClass().equals(other.getStorageClass())) return false; - if (getSize() != other.getSize()) return false; - if (!getContentEncoding().equals(other.getContentEncoding())) return false; - if (!getContentDisposition().equals(other.getContentDisposition())) return false; - if (!getCacheControl().equals(other.getCacheControl())) return false; - if (!getAclList().equals(other.getAclList())) return false; - if (!getContentLanguage().equals(other.getContentLanguage())) return false; - if (hasDeleteTime() != other.hasDeleteTime()) return false; - if (hasDeleteTime()) { - if (!getDeleteTime().equals(other.getDeleteTime())) return false; - } - if (!getContentType().equals(other.getContentType())) return false; - if (hasCreateTime() != other.hasCreateTime()) return false; - if (hasCreateTime()) { - if (!getCreateTime().equals(other.getCreateTime())) return false; - } - if (getComponentCount() != other.getComponentCount()) return false; - if (hasChecksums() != other.hasChecksums()) return false; - if (hasChecksums()) { - if (!getChecksums().equals(other.getChecksums())) return false; - } - if (hasUpdateTime() != other.hasUpdateTime()) return false; - if (hasUpdateTime()) { - if (!getUpdateTime().equals(other.getUpdateTime())) return false; - } - if (!getKmsKey().equals(other.getKmsKey())) return false; - if (hasUpdateStorageClassTime() != other.hasUpdateStorageClassTime()) return false; - if (hasUpdateStorageClassTime()) { - if (!getUpdateStorageClassTime().equals(other.getUpdateStorageClassTime())) return false; - } - if (getTemporaryHold() != other.getTemporaryHold()) return false; - if (hasRetentionExpireTime() != other.hasRetentionExpireTime()) return false; - if (hasRetentionExpireTime()) { - if (!getRetentionExpireTime().equals(other.getRetentionExpireTime())) return false; - } - if (!internalGetMetadata().equals(other.internalGetMetadata())) return false; - if (hasEventBasedHold() != other.hasEventBasedHold()) return false; - if (hasEventBasedHold()) { - if (getEventBasedHold() != other.getEventBasedHold()) return false; - } - if (hasOwner() != other.hasOwner()) return false; - if (hasOwner()) { - if (!getOwner().equals(other.getOwner())) return false; - } - if (hasCustomerEncryption() != other.hasCustomerEncryption()) return false; - if (hasCustomerEncryption()) { - if (!getCustomerEncryption().equals(other.getCustomerEncryption())) return false; - } - if (hasCustomTime() != other.hasCustomTime()) return false; - if (hasCustomTime()) { - if (!getCustomTime().equals(other.getCustomTime())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + BUCKET_FIELD_NUMBER; - hash = (53 * hash) + getBucket().hashCode(); - hash = (37 * hash) + GENERATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getGeneration()); - hash = (37 * hash) + METAGENERATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMetageneration()); - hash = (37 * hash) + STORAGE_CLASS_FIELD_NUMBER; - hash = (53 * hash) + getStorageClass().hashCode(); - hash = (37 * hash) + SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSize()); - hash = (37 * hash) + CONTENT_ENCODING_FIELD_NUMBER; - hash = (53 * hash) + getContentEncoding().hashCode(); - hash = (37 * hash) + CONTENT_DISPOSITION_FIELD_NUMBER; - hash = (53 * hash) + getContentDisposition().hashCode(); - hash = (37 * hash) + CACHE_CONTROL_FIELD_NUMBER; - hash = (53 * hash) + getCacheControl().hashCode(); - if (getAclCount() > 0) { - hash = (37 * hash) + ACL_FIELD_NUMBER; - hash = (53 * hash) + getAclList().hashCode(); - } - hash = (37 * hash) + CONTENT_LANGUAGE_FIELD_NUMBER; - hash = (53 * hash) + getContentLanguage().hashCode(); - if (hasDeleteTime()) { - hash = (37 * hash) + DELETE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getDeleteTime().hashCode(); - } - hash = (37 * hash) + CONTENT_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getContentType().hashCode(); - if (hasCreateTime()) { - hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getCreateTime().hashCode(); - } - hash = (37 * hash) + COMPONENT_COUNT_FIELD_NUMBER; - hash = (53 * hash) + getComponentCount(); - if (hasChecksums()) { - hash = (37 * hash) + CHECKSUMS_FIELD_NUMBER; - hash = (53 * hash) + getChecksums().hashCode(); - } - if (hasUpdateTime()) { - hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getUpdateTime().hashCode(); - } - hash = (37 * hash) + KMS_KEY_FIELD_NUMBER; - hash = (53 * hash) + getKmsKey().hashCode(); - if (hasUpdateStorageClassTime()) { - hash = (37 * hash) + UPDATE_STORAGE_CLASS_TIME_FIELD_NUMBER; - hash = (53 * hash) + getUpdateStorageClassTime().hashCode(); - } - hash = (37 * hash) + TEMPORARY_HOLD_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getTemporaryHold()); - if (hasRetentionExpireTime()) { - hash = (37 * hash) + RETENTION_EXPIRE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getRetentionExpireTime().hashCode(); - } - if (!internalGetMetadata().getMap().isEmpty()) { - hash = (37 * hash) + METADATA_FIELD_NUMBER; - hash = (53 * hash) + internalGetMetadata().hashCode(); - } - if (hasEventBasedHold()) { - hash = (37 * hash) + EVENT_BASED_HOLD_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEventBasedHold()); - } - if (hasOwner()) { - hash = (37 * hash) + OWNER_FIELD_NUMBER; - hash = (53 * hash) + getOwner().hashCode(); - } - if (hasCustomerEncryption()) { - hash = (37 * hash) + CUSTOMER_ENCRYPTION_FIELD_NUMBER; - hash = (53 * hash) + getCustomerEncryption().hashCode(); - } - if (hasCustomTime()) { - hash = (37 * hash) + CUSTOM_TIME_FIELD_NUMBER; - hash = (53 * hash) + getCustomTime().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.Object parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Object parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Object parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Object parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Object parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Object parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Object parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Object parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Object parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Object parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Object parseFrom(com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Object parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.Object prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * An object.
-   * 
- * - * Protobuf type {@code google.storage.v2.Object} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.Object) - com.google.storage.v2.ObjectOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto.internal_static_google_storage_v2_Object_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 22: - return internalGetMetadata(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { - switch (number) { - case 22: - return internalGetMutableMetadata(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Object_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Object.class, com.google.storage.v2.Object.Builder.class); - } - - // Construct using com.google.storage.v2.Object.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getAclFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - bucket_ = ""; - - generation_ = 0L; - - metageneration_ = 0L; - - storageClass_ = ""; - - size_ = 0L; - - contentEncoding_ = ""; - - contentDisposition_ = ""; - - cacheControl_ = ""; - - if (aclBuilder_ == null) { - acl_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - aclBuilder_.clear(); - } - contentLanguage_ = ""; - - if (deleteTimeBuilder_ == null) { - deleteTime_ = null; - } else { - deleteTime_ = null; - deleteTimeBuilder_ = null; - } - contentType_ = ""; - - if (createTimeBuilder_ == null) { - createTime_ = null; - } else { - createTime_ = null; - createTimeBuilder_ = null; - } - componentCount_ = 0; - - if (checksumsBuilder_ == null) { - checksums_ = null; - } else { - checksums_ = null; - checksumsBuilder_ = null; - } - if (updateTimeBuilder_ == null) { - updateTime_ = null; - } else { - updateTime_ = null; - updateTimeBuilder_ = null; - } - kmsKey_ = ""; - - if (updateStorageClassTimeBuilder_ == null) { - updateStorageClassTime_ = null; - } else { - updateStorageClassTime_ = null; - updateStorageClassTimeBuilder_ = null; - } - temporaryHold_ = false; - - if (retentionExpireTimeBuilder_ == null) { - retentionExpireTime_ = null; - } else { - retentionExpireTime_ = null; - retentionExpireTimeBuilder_ = null; - } - internalGetMutableMetadata().clear(); - eventBasedHold_ = false; - bitField0_ = (bitField0_ & ~0x00000004); - if (ownerBuilder_ == null) { - owner_ = null; - } else { - owner_ = null; - ownerBuilder_ = null; - } - if (customerEncryptionBuilder_ == null) { - customerEncryption_ = null; - } else { - customerEncryption_ = null; - customerEncryptionBuilder_ = null; - } - if (customTimeBuilder_ == null) { - customTime_ = null; - } else { - customTime_ = null; - customTimeBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto.internal_static_google_storage_v2_Object_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.Object getDefaultInstanceForType() { - return com.google.storage.v2.Object.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.Object build() { - com.google.storage.v2.Object result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.Object buildPartial() { - com.google.storage.v2.Object result = new com.google.storage.v2.Object(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - result.name_ = name_; - result.bucket_ = bucket_; - result.generation_ = generation_; - result.metageneration_ = metageneration_; - result.storageClass_ = storageClass_; - result.size_ = size_; - result.contentEncoding_ = contentEncoding_; - result.contentDisposition_ = contentDisposition_; - result.cacheControl_ = cacheControl_; - if (aclBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - acl_ = java.util.Collections.unmodifiableList(acl_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.acl_ = acl_; - } else { - result.acl_ = aclBuilder_.build(); - } - result.contentLanguage_ = contentLanguage_; - if (deleteTimeBuilder_ == null) { - result.deleteTime_ = deleteTime_; - } else { - result.deleteTime_ = deleteTimeBuilder_.build(); - } - result.contentType_ = contentType_; - if (createTimeBuilder_ == null) { - result.createTime_ = createTime_; - } else { - result.createTime_ = createTimeBuilder_.build(); - } - result.componentCount_ = componentCount_; - if (checksumsBuilder_ == null) { - result.checksums_ = checksums_; - } else { - result.checksums_ = checksumsBuilder_.build(); - } - if (updateTimeBuilder_ == null) { - result.updateTime_ = updateTime_; - } else { - result.updateTime_ = updateTimeBuilder_.build(); - } - result.kmsKey_ = kmsKey_; - if (updateStorageClassTimeBuilder_ == null) { - result.updateStorageClassTime_ = updateStorageClassTime_; - } else { - result.updateStorageClassTime_ = updateStorageClassTimeBuilder_.build(); - } - result.temporaryHold_ = temporaryHold_; - if (retentionExpireTimeBuilder_ == null) { - result.retentionExpireTime_ = retentionExpireTime_; - } else { - result.retentionExpireTime_ = retentionExpireTimeBuilder_.build(); - } - result.metadata_ = internalGetMetadata(); - result.metadata_.makeImmutable(); - if (((from_bitField0_ & 0x00000004) != 0)) { - result.eventBasedHold_ = eventBasedHold_; - to_bitField0_ |= 0x00000001; - } - if (ownerBuilder_ == null) { - result.owner_ = owner_; - } else { - result.owner_ = ownerBuilder_.build(); - } - if (customerEncryptionBuilder_ == null) { - result.customerEncryption_ = customerEncryption_; - } else { - result.customerEncryption_ = customerEncryptionBuilder_.build(); - } - if (customTimeBuilder_ == null) { - result.customTime_ = customTime_; - } else { - result.customTime_ = customTimeBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.Object) { - return mergeFrom((com.google.storage.v2.Object) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.Object other) { - if (other == com.google.storage.v2.Object.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getBucket().isEmpty()) { - bucket_ = other.bucket_; - onChanged(); - } - if (other.getGeneration() != 0L) { - setGeneration(other.getGeneration()); - } - if (other.getMetageneration() != 0L) { - setMetageneration(other.getMetageneration()); - } - if (!other.getStorageClass().isEmpty()) { - storageClass_ = other.storageClass_; - onChanged(); - } - if (other.getSize() != 0L) { - setSize(other.getSize()); - } - if (!other.getContentEncoding().isEmpty()) { - contentEncoding_ = other.contentEncoding_; - onChanged(); - } - if (!other.getContentDisposition().isEmpty()) { - contentDisposition_ = other.contentDisposition_; - onChanged(); - } - if (!other.getCacheControl().isEmpty()) { - cacheControl_ = other.cacheControl_; - onChanged(); - } - if (aclBuilder_ == null) { - if (!other.acl_.isEmpty()) { - if (acl_.isEmpty()) { - acl_ = other.acl_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAclIsMutable(); - acl_.addAll(other.acl_); - } - onChanged(); - } - } else { - if (!other.acl_.isEmpty()) { - if (aclBuilder_.isEmpty()) { - aclBuilder_.dispose(); - aclBuilder_ = null; - acl_ = other.acl_; - bitField0_ = (bitField0_ & ~0x00000001); - aclBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getAclFieldBuilder() - : null; - } else { - aclBuilder_.addAllMessages(other.acl_); - } - } - } - if (!other.getContentLanguage().isEmpty()) { - contentLanguage_ = other.contentLanguage_; - onChanged(); - } - if (other.hasDeleteTime()) { - mergeDeleteTime(other.getDeleteTime()); - } - if (!other.getContentType().isEmpty()) { - contentType_ = other.contentType_; - onChanged(); - } - if (other.hasCreateTime()) { - mergeCreateTime(other.getCreateTime()); - } - if (other.getComponentCount() != 0) { - setComponentCount(other.getComponentCount()); - } - if (other.hasChecksums()) { - mergeChecksums(other.getChecksums()); - } - if (other.hasUpdateTime()) { - mergeUpdateTime(other.getUpdateTime()); - } - if (!other.getKmsKey().isEmpty()) { - kmsKey_ = other.kmsKey_; - onChanged(); - } - if (other.hasUpdateStorageClassTime()) { - mergeUpdateStorageClassTime(other.getUpdateStorageClassTime()); - } - if (other.getTemporaryHold() != false) { - setTemporaryHold(other.getTemporaryHold()); - } - if (other.hasRetentionExpireTime()) { - mergeRetentionExpireTime(other.getRetentionExpireTime()); - } - internalGetMutableMetadata().mergeFrom(other.internalGetMetadata()); - if (other.hasEventBasedHold()) { - setEventBasedHold(other.getEventBasedHold()); - } - if (other.hasOwner()) { - mergeOwner(other.getOwner()); - } - if (other.hasCustomerEncryption()) { - mergeCustomerEncryption(other.getCustomerEncryption()); - } - if (other.hasCustomTime()) { - mergeCustomTime(other.getCustomTime()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.Object parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.Object) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * Immutable. The name of this object. Nearly any sequence of unicode characters is
-     * valid. See
-     * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
-     * Example: `test.txt`
-     * The `name` field by itself does not uniquely identify a Cloud Storage
-     * object. A Cloud Storage object is uniquely identified by the tuple of
-     * (bucket, object, generation).
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Immutable. The name of this object. Nearly any sequence of unicode characters is
-     * valid. See
-     * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
-     * Example: `test.txt`
-     * The `name` field by itself does not uniquely identify a Cloud Storage
-     * object. A Cloud Storage object is uniquely identified by the tuple of
-     * (bucket, object, generation).
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Immutable. The name of this object. Nearly any sequence of unicode characters is
-     * valid. See
-     * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
-     * Example: `test.txt`
-     * The `name` field by itself does not uniquely identify a Cloud Storage
-     * object. A Cloud Storage object is uniquely identified by the tuple of
-     * (bucket, object, generation).
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Immutable. The name of this object. Nearly any sequence of unicode characters is
-     * valid. See
-     * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
-     * Example: `test.txt`
-     * The `name` field by itself does not uniquely identify a Cloud Storage
-     * object. A Cloud Storage object is uniquely identified by the tuple of
-     * (bucket, object, generation).
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * - * - *
-     * Immutable. The name of this object. Nearly any sequence of unicode characters is
-     * valid. See
-     * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
-     * Example: `test.txt`
-     * The `name` field by itself does not uniquely identify a Cloud Storage
-     * object. A Cloud Storage object is uniquely identified by the tuple of
-     * (bucket, object, generation).
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object bucket_ = ""; - /** - * - * - *
-     * Immutable. The name of the bucket containing this object.
-     * 
- * - * - * string bucket = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @return The bucket. - */ - public java.lang.String getBucket() { - java.lang.Object ref = bucket_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - bucket_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Immutable. The name of the bucket containing this object.
-     * 
- * - * - * string bucket = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for bucket. - */ - public com.google.protobuf.ByteString getBucketBytes() { - java.lang.Object ref = bucket_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - bucket_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Immutable. The name of the bucket containing this object.
-     * 
- * - * - * string bucket = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @param value The bucket to set. - * @return This builder for chaining. - */ - public Builder setBucket(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - bucket_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Immutable. The name of the bucket containing this object.
-     * 
- * - * - * string bucket = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearBucket() { - - bucket_ = getDefaultInstance().getBucket(); - onChanged(); - return this; - } - /** - * - * - *
-     * Immutable. The name of the bucket containing this object.
-     * 
- * - * - * string bucket = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for bucket to set. - * @return This builder for chaining. - */ - public Builder setBucketBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - bucket_ = value; - onChanged(); - return this; - } - - private long generation_; - /** - * - * - *
-     * Immutable. The content generation of this object. Used for object versioning.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * int64 generation = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The generation. - */ - @java.lang.Override - public long getGeneration() { - return generation_; - } - /** - * - * - *
-     * Immutable. The content generation of this object. Used for object versioning.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * int64 generation = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @param value The generation to set. - * @return This builder for chaining. - */ - public Builder setGeneration(long value) { - - generation_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Immutable. The content generation of this object. Used for object versioning.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * int64 generation = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return This builder for chaining. - */ - public Builder clearGeneration() { - - generation_ = 0L; - onChanged(); - return this; - } - - private long metageneration_; - /** - * - * - *
-     * Output only. The version of the metadata for this generation of this object. Used for
-     * preconditions and for detecting changes in metadata. A metageneration
-     * number is only meaningful in the context of a particular generation of a
-     * particular object.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * int64 metageneration = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The metageneration. - */ - @java.lang.Override - public long getMetageneration() { - return metageneration_; - } - /** - * - * - *
-     * Output only. The version of the metadata for this generation of this object. Used for
-     * preconditions and for detecting changes in metadata. A metageneration
-     * number is only meaningful in the context of a particular generation of a
-     * particular object.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * int64 metageneration = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The metageneration to set. - * @return This builder for chaining. - */ - public Builder setMetageneration(long value) { - - metageneration_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. The version of the metadata for this generation of this object. Used for
-     * preconditions and for detecting changes in metadata. A metageneration
-     * number is only meaningful in the context of a particular generation of a
-     * particular object.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * int64 metageneration = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return This builder for chaining. - */ - public Builder clearMetageneration() { - - metageneration_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object storageClass_ = ""; - /** - * - * - *
-     * Storage class of the object.
-     * 
- * - * string storage_class = 5; - * - * @return The storageClass. - */ - public java.lang.String getStorageClass() { - java.lang.Object ref = storageClass_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - storageClass_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Storage class of the object.
-     * 
- * - * string storage_class = 5; - * - * @return The bytes for storageClass. - */ - public com.google.protobuf.ByteString getStorageClassBytes() { - java.lang.Object ref = storageClass_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - storageClass_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Storage class of the object.
-     * 
- * - * string storage_class = 5; - * - * @param value The storageClass to set. - * @return This builder for chaining. - */ - public Builder setStorageClass(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - storageClass_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Storage class of the object.
-     * 
- * - * string storage_class = 5; - * - * @return This builder for chaining. - */ - public Builder clearStorageClass() { - - storageClass_ = getDefaultInstance().getStorageClass(); - onChanged(); - return this; - } - /** - * - * - *
-     * Storage class of the object.
-     * 
- * - * string storage_class = 5; - * - * @param value The bytes for storageClass to set. - * @return This builder for chaining. - */ - public Builder setStorageClassBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - storageClass_ = value; - onChanged(); - return this; - } - - private long size_; - /** - * - * - *
-     * Output only. Content-Length of the object data in bytes, matching
-     * [https://tools.ietf.org/html/rfc7230#section-3.3.2][RFC 7230 §3.3.2].
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * int64 size = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The size. - */ - @java.lang.Override - public long getSize() { - return size_; - } - /** - * - * - *
-     * Output only. Content-Length of the object data in bytes, matching
-     * [https://tools.ietf.org/html/rfc7230#section-3.3.2][RFC 7230 §3.3.2].
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * int64 size = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The size to set. - * @return This builder for chaining. - */ - public Builder setSize(long value) { - - size_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. Content-Length of the object data in bytes, matching
-     * [https://tools.ietf.org/html/rfc7230#section-3.3.2][RFC 7230 §3.3.2].
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * int64 size = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return This builder for chaining. - */ - public Builder clearSize() { - - size_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object contentEncoding_ = ""; - /** - * - * - *
-     * Content-Encoding of the object data, matching
-     * [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2]
-     * 
- * - * string content_encoding = 7; - * - * @return The contentEncoding. - */ - public java.lang.String getContentEncoding() { - java.lang.Object ref = contentEncoding_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - contentEncoding_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Content-Encoding of the object data, matching
-     * [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2]
-     * 
- * - * string content_encoding = 7; - * - * @return The bytes for contentEncoding. - */ - public com.google.protobuf.ByteString getContentEncodingBytes() { - java.lang.Object ref = contentEncoding_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - contentEncoding_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Content-Encoding of the object data, matching
-     * [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2]
-     * 
- * - * string content_encoding = 7; - * - * @param value The contentEncoding to set. - * @return This builder for chaining. - */ - public Builder setContentEncoding(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - contentEncoding_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Content-Encoding of the object data, matching
-     * [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2]
-     * 
- * - * string content_encoding = 7; - * - * @return This builder for chaining. - */ - public Builder clearContentEncoding() { - - contentEncoding_ = getDefaultInstance().getContentEncoding(); - onChanged(); - return this; - } - /** - * - * - *
-     * Content-Encoding of the object data, matching
-     * [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2]
-     * 
- * - * string content_encoding = 7; - * - * @param value The bytes for contentEncoding to set. - * @return This builder for chaining. - */ - public Builder setContentEncodingBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - contentEncoding_ = value; - onChanged(); - return this; - } - - private java.lang.Object contentDisposition_ = ""; - /** - * - * - *
-     * Content-Disposition of the object data, matching
-     * [https://tools.ietf.org/html/rfc6266][RFC 6266].
-     * 
- * - * string content_disposition = 8; - * - * @return The contentDisposition. - */ - public java.lang.String getContentDisposition() { - java.lang.Object ref = contentDisposition_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - contentDisposition_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Content-Disposition of the object data, matching
-     * [https://tools.ietf.org/html/rfc6266][RFC 6266].
-     * 
- * - * string content_disposition = 8; - * - * @return The bytes for contentDisposition. - */ - public com.google.protobuf.ByteString getContentDispositionBytes() { - java.lang.Object ref = contentDisposition_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - contentDisposition_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Content-Disposition of the object data, matching
-     * [https://tools.ietf.org/html/rfc6266][RFC 6266].
-     * 
- * - * string content_disposition = 8; - * - * @param value The contentDisposition to set. - * @return This builder for chaining. - */ - public Builder setContentDisposition(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - contentDisposition_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Content-Disposition of the object data, matching
-     * [https://tools.ietf.org/html/rfc6266][RFC 6266].
-     * 
- * - * string content_disposition = 8; - * - * @return This builder for chaining. - */ - public Builder clearContentDisposition() { - - contentDisposition_ = getDefaultInstance().getContentDisposition(); - onChanged(); - return this; - } - /** - * - * - *
-     * Content-Disposition of the object data, matching
-     * [https://tools.ietf.org/html/rfc6266][RFC 6266].
-     * 
- * - * string content_disposition = 8; - * - * @param value The bytes for contentDisposition to set. - * @return This builder for chaining. - */ - public Builder setContentDispositionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - contentDisposition_ = value; - onChanged(); - return this; - } - - private java.lang.Object cacheControl_ = ""; - /** - * - * - *
-     * Cache-Control directive for the object data, matching
-     * [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2].
-     * If omitted, and the object is accessible to all anonymous users, the
-     * default will be `public, max-age=3600`.
-     * 
- * - * string cache_control = 9; - * - * @return The cacheControl. - */ - public java.lang.String getCacheControl() { - java.lang.Object ref = cacheControl_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - cacheControl_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Cache-Control directive for the object data, matching
-     * [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2].
-     * If omitted, and the object is accessible to all anonymous users, the
-     * default will be `public, max-age=3600`.
-     * 
- * - * string cache_control = 9; - * - * @return The bytes for cacheControl. - */ - public com.google.protobuf.ByteString getCacheControlBytes() { - java.lang.Object ref = cacheControl_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - cacheControl_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Cache-Control directive for the object data, matching
-     * [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2].
-     * If omitted, and the object is accessible to all anonymous users, the
-     * default will be `public, max-age=3600`.
-     * 
- * - * string cache_control = 9; - * - * @param value The cacheControl to set. - * @return This builder for chaining. - */ - public Builder setCacheControl(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - cacheControl_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Cache-Control directive for the object data, matching
-     * [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2].
-     * If omitted, and the object is accessible to all anonymous users, the
-     * default will be `public, max-age=3600`.
-     * 
- * - * string cache_control = 9; - * - * @return This builder for chaining. - */ - public Builder clearCacheControl() { - - cacheControl_ = getDefaultInstance().getCacheControl(); - onChanged(); - return this; - } - /** - * - * - *
-     * Cache-Control directive for the object data, matching
-     * [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2].
-     * If omitted, and the object is accessible to all anonymous users, the
-     * default will be `public, max-age=3600`.
-     * 
- * - * string cache_control = 9; - * - * @param value The bytes for cacheControl to set. - * @return This builder for chaining. - */ - public Builder setCacheControlBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - cacheControl_ = value; - onChanged(); - return this; - } - - private java.util.List acl_ = - java.util.Collections.emptyList(); - - private void ensureAclIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - acl_ = new java.util.ArrayList(acl_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.ObjectAccessControl, - com.google.storage.v2.ObjectAccessControl.Builder, - com.google.storage.v2.ObjectAccessControlOrBuilder> - aclBuilder_; - - /** - * - * - *
-     * Access controls on the object.
-     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-     * bucket, requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - public java.util.List getAclList() { - if (aclBuilder_ == null) { - return java.util.Collections.unmodifiableList(acl_); - } else { - return aclBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Access controls on the object.
-     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-     * bucket, requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - public int getAclCount() { - if (aclBuilder_ == null) { - return acl_.size(); - } else { - return aclBuilder_.getCount(); - } - } - /** - * - * - *
-     * Access controls on the object.
-     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-     * bucket, requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - public com.google.storage.v2.ObjectAccessControl getAcl(int index) { - if (aclBuilder_ == null) { - return acl_.get(index); - } else { - return aclBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Access controls on the object.
-     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-     * bucket, requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - public Builder setAcl(int index, com.google.storage.v2.ObjectAccessControl value) { - if (aclBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAclIsMutable(); - acl_.set(index, value); - onChanged(); - } else { - aclBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Access controls on the object.
-     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-     * bucket, requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - public Builder setAcl( - int index, com.google.storage.v2.ObjectAccessControl.Builder builderForValue) { - if (aclBuilder_ == null) { - ensureAclIsMutable(); - acl_.set(index, builderForValue.build()); - onChanged(); - } else { - aclBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Access controls on the object.
-     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-     * bucket, requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - public Builder addAcl(com.google.storage.v2.ObjectAccessControl value) { - if (aclBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAclIsMutable(); - acl_.add(value); - onChanged(); - } else { - aclBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Access controls on the object.
-     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-     * bucket, requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - public Builder addAcl(int index, com.google.storage.v2.ObjectAccessControl value) { - if (aclBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAclIsMutable(); - acl_.add(index, value); - onChanged(); - } else { - aclBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Access controls on the object.
-     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-     * bucket, requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - public Builder addAcl(com.google.storage.v2.ObjectAccessControl.Builder builderForValue) { - if (aclBuilder_ == null) { - ensureAclIsMutable(); - acl_.add(builderForValue.build()); - onChanged(); - } else { - aclBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Access controls on the object.
-     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-     * bucket, requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - public Builder addAcl( - int index, com.google.storage.v2.ObjectAccessControl.Builder builderForValue) { - if (aclBuilder_ == null) { - ensureAclIsMutable(); - acl_.add(index, builderForValue.build()); - onChanged(); - } else { - aclBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Access controls on the object.
-     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-     * bucket, requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - public Builder addAllAcl( - java.lang.Iterable values) { - if (aclBuilder_ == null) { - ensureAclIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, acl_); - onChanged(); - } else { - aclBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Access controls on the object.
-     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-     * bucket, requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - public Builder clearAcl() { - if (aclBuilder_ == null) { - acl_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - aclBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Access controls on the object.
-     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-     * bucket, requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - public Builder removeAcl(int index) { - if (aclBuilder_ == null) { - ensureAclIsMutable(); - acl_.remove(index); - onChanged(); - } else { - aclBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Access controls on the object.
-     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-     * bucket, requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - public com.google.storage.v2.ObjectAccessControl.Builder getAclBuilder(int index) { - return getAclFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Access controls on the object.
-     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-     * bucket, requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - public com.google.storage.v2.ObjectAccessControlOrBuilder getAclOrBuilder(int index) { - if (aclBuilder_ == null) { - return acl_.get(index); - } else { - return aclBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Access controls on the object.
-     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-     * bucket, requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - public java.util.List - getAclOrBuilderList() { - if (aclBuilder_ != null) { - return aclBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(acl_); - } - } - /** - * - * - *
-     * Access controls on the object.
-     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-     * bucket, requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - public com.google.storage.v2.ObjectAccessControl.Builder addAclBuilder() { - return getAclFieldBuilder() - .addBuilder(com.google.storage.v2.ObjectAccessControl.getDefaultInstance()); - } - /** - * - * - *
-     * Access controls on the object.
-     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-     * bucket, requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - public com.google.storage.v2.ObjectAccessControl.Builder addAclBuilder(int index) { - return getAclFieldBuilder() - .addBuilder(index, com.google.storage.v2.ObjectAccessControl.getDefaultInstance()); - } - /** - * - * - *
-     * Access controls on the object.
-     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-     * bucket, requests to set, read, or modify acl is an error.
-     * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - public java.util.List getAclBuilderList() { - return getAclFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.ObjectAccessControl, - com.google.storage.v2.ObjectAccessControl.Builder, - com.google.storage.v2.ObjectAccessControlOrBuilder> - getAclFieldBuilder() { - if (aclBuilder_ == null) { - aclBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.ObjectAccessControl, - com.google.storage.v2.ObjectAccessControl.Builder, - com.google.storage.v2.ObjectAccessControlOrBuilder>( - acl_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - acl_ = null; - } - return aclBuilder_; - } - - private java.lang.Object contentLanguage_ = ""; - /** - * - * - *
-     * Content-Language of the object data, matching
-     * [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2].
-     * 
- * - * string content_language = 11; - * - * @return The contentLanguage. - */ - public java.lang.String getContentLanguage() { - java.lang.Object ref = contentLanguage_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - contentLanguage_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Content-Language of the object data, matching
-     * [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2].
-     * 
- * - * string content_language = 11; - * - * @return The bytes for contentLanguage. - */ - public com.google.protobuf.ByteString getContentLanguageBytes() { - java.lang.Object ref = contentLanguage_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - contentLanguage_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Content-Language of the object data, matching
-     * [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2].
-     * 
- * - * string content_language = 11; - * - * @param value The contentLanguage to set. - * @return This builder for chaining. - */ - public Builder setContentLanguage(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - contentLanguage_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Content-Language of the object data, matching
-     * [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2].
-     * 
- * - * string content_language = 11; - * - * @return This builder for chaining. - */ - public Builder clearContentLanguage() { - - contentLanguage_ = getDefaultInstance().getContentLanguage(); - onChanged(); - return this; - } - /** - * - * - *
-     * Content-Language of the object data, matching
-     * [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2].
-     * 
- * - * string content_language = 11; - * - * @param value The bytes for contentLanguage to set. - * @return This builder for chaining. - */ - public Builder setContentLanguageBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - contentLanguage_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.Timestamp deleteTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - deleteTimeBuilder_; - /** - * - * - *
-     * Output only. The deletion time of the object. Will be returned if and only if this
-     * version of the object has been deleted.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the deleteTime field is set. - */ - public boolean hasDeleteTime() { - return deleteTimeBuilder_ != null || deleteTime_ != null; - } - /** - * - * - *
-     * Output only. The deletion time of the object. Will be returned if and only if this
-     * version of the object has been deleted.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The deleteTime. - */ - public com.google.protobuf.Timestamp getDeleteTime() { - if (deleteTimeBuilder_ == null) { - return deleteTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : deleteTime_; - } else { - return deleteTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Output only. The deletion time of the object. Will be returned if and only if this
-     * version of the object has been deleted.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setDeleteTime(com.google.protobuf.Timestamp value) { - if (deleteTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - deleteTime_ = value; - onChanged(); - } else { - deleteTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Output only. The deletion time of the object. Will be returned if and only if this
-     * version of the object has been deleted.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (deleteTimeBuilder_ == null) { - deleteTime_ = builderForValue.build(); - onChanged(); - } else { - deleteTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Output only. The deletion time of the object. Will be returned if and only if this
-     * version of the object has been deleted.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { - if (deleteTimeBuilder_ == null) { - if (deleteTime_ != null) { - deleteTime_ = - com.google.protobuf.Timestamp.newBuilder(deleteTime_).mergeFrom(value).buildPartial(); - } else { - deleteTime_ = value; - } - onChanged(); - } else { - deleteTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Output only. The deletion time of the object. Will be returned if and only if this
-     * version of the object has been deleted.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder clearDeleteTime() { - if (deleteTimeBuilder_ == null) { - deleteTime_ = null; - onChanged(); - } else { - deleteTime_ = null; - deleteTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Output only. The deletion time of the object. Will be returned if and only if this
-     * version of the object has been deleted.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { - - onChanged(); - return getDeleteTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Output only. The deletion time of the object. Will be returned if and only if this
-     * version of the object has been deleted.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { - if (deleteTimeBuilder_ != null) { - return deleteTimeBuilder_.getMessageOrBuilder(); - } else { - return deleteTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : deleteTime_; - } - } - /** - * - * - *
-     * Output only. The deletion time of the object. Will be returned if and only if this
-     * version of the object has been deleted.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getDeleteTimeFieldBuilder() { - if (deleteTimeBuilder_ == null) { - deleteTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getDeleteTime(), getParentForChildren(), isClean()); - deleteTime_ = null; - } - return deleteTimeBuilder_; - } - - private java.lang.Object contentType_ = ""; - /** - * - * - *
-     * Content-Type of the object data, matching
-     * [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5].
-     * If an object is stored without a Content-Type, it is served as
-     * `application/octet-stream`.
-     * 
- * - * string content_type = 13; - * - * @return The contentType. - */ - public java.lang.String getContentType() { - java.lang.Object ref = contentType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - contentType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Content-Type of the object data, matching
-     * [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5].
-     * If an object is stored without a Content-Type, it is served as
-     * `application/octet-stream`.
-     * 
- * - * string content_type = 13; - * - * @return The bytes for contentType. - */ - public com.google.protobuf.ByteString getContentTypeBytes() { - java.lang.Object ref = contentType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - contentType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Content-Type of the object data, matching
-     * [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5].
-     * If an object is stored without a Content-Type, it is served as
-     * `application/octet-stream`.
-     * 
- * - * string content_type = 13; - * - * @param value The contentType to set. - * @return This builder for chaining. - */ - public Builder setContentType(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - contentType_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Content-Type of the object data, matching
-     * [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5].
-     * If an object is stored without a Content-Type, it is served as
-     * `application/octet-stream`.
-     * 
- * - * string content_type = 13; - * - * @return This builder for chaining. - */ - public Builder clearContentType() { - - contentType_ = getDefaultInstance().getContentType(); - onChanged(); - return this; - } - /** - * - * - *
-     * Content-Type of the object data, matching
-     * [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5].
-     * If an object is stored without a Content-Type, it is served as
-     * `application/octet-stream`.
-     * 
- * - * string content_type = 13; - * - * @param value The bytes for contentType to set. - * @return This builder for chaining. - */ - public Builder setContentTypeBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - contentType_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.Timestamp createTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - createTimeBuilder_; - /** - * - * - *
-     * Output only. The creation time of the object.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the createTime field is set. - */ - public boolean hasCreateTime() { - return createTimeBuilder_ != null || createTime_ != null; - } - /** - * - * - *
-     * Output only. The creation time of the object.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The createTime. - */ - public com.google.protobuf.Timestamp getCreateTime() { - if (createTimeBuilder_ == null) { - return createTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : createTime_; - } else { - return createTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Output only. The creation time of the object.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setCreateTime(com.google.protobuf.Timestamp value) { - if (createTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - createTime_ = value; - onChanged(); - } else { - createTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Output only. The creation time of the object.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (createTimeBuilder_ == null) { - createTime_ = builderForValue.build(); - onChanged(); - } else { - createTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Output only. The creation time of the object.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { - if (createTimeBuilder_ == null) { - if (createTime_ != null) { - createTime_ = - com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); - } else { - createTime_ = value; - } - onChanged(); - } else { - createTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Output only. The creation time of the object.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder clearCreateTime() { - if (createTimeBuilder_ == null) { - createTime_ = null; - onChanged(); - } else { - createTime_ = null; - createTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Output only. The creation time of the object.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { - - onChanged(); - return getCreateTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Output only. The creation time of the object.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { - if (createTimeBuilder_ != null) { - return createTimeBuilder_.getMessageOrBuilder(); - } else { - return createTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : createTime_; - } - } - /** - * - * - *
-     * Output only. The creation time of the object.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getCreateTimeFieldBuilder() { - if (createTimeBuilder_ == null) { - createTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getCreateTime(), getParentForChildren(), isClean()); - createTime_ = null; - } - return createTimeBuilder_; - } - - private int componentCount_; - /** - * - * - *
-     * Output only. Number of underlying components that make up this object. Components are
-     * accumulated by compose operations.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * int32 component_count = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The componentCount. - */ - @java.lang.Override - public int getComponentCount() { - return componentCount_; - } - /** - * - * - *
-     * Output only. Number of underlying components that make up this object. Components are
-     * accumulated by compose operations.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * int32 component_count = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The componentCount to set. - * @return This builder for chaining. - */ - public Builder setComponentCount(int value) { - - componentCount_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. Number of underlying components that make up this object. Components are
-     * accumulated by compose operations.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * int32 component_count = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return This builder for chaining. - */ - public Builder clearComponentCount() { - - componentCount_ = 0; - onChanged(); - return this; - } - - private com.google.storage.v2.ObjectChecksums checksums_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ObjectChecksums, - com.google.storage.v2.ObjectChecksums.Builder, - com.google.storage.v2.ObjectChecksumsOrBuilder> - checksumsBuilder_; - /** - * - * - *
-     * Output only. Hashes for the data part of this object.
-     * 
- * - * - * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the checksums field is set. - */ - public boolean hasChecksums() { - return checksumsBuilder_ != null || checksums_ != null; - } - /** - * - * - *
-     * Output only. Hashes for the data part of this object.
-     * 
- * - * - * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The checksums. - */ - public com.google.storage.v2.ObjectChecksums getChecksums() { - if (checksumsBuilder_ == null) { - return checksums_ == null - ? com.google.storage.v2.ObjectChecksums.getDefaultInstance() - : checksums_; - } else { - return checksumsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Output only. Hashes for the data part of this object.
-     * 
- * - * - * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setChecksums(com.google.storage.v2.ObjectChecksums value) { - if (checksumsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - checksums_ = value; - onChanged(); - } else { - checksumsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Output only. Hashes for the data part of this object.
-     * 
- * - * - * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setChecksums(com.google.storage.v2.ObjectChecksums.Builder builderForValue) { - if (checksumsBuilder_ == null) { - checksums_ = builderForValue.build(); - onChanged(); - } else { - checksumsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Output only. Hashes for the data part of this object.
-     * 
- * - * - * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder mergeChecksums(com.google.storage.v2.ObjectChecksums value) { - if (checksumsBuilder_ == null) { - if (checksums_ != null) { - checksums_ = - com.google.storage.v2.ObjectChecksums.newBuilder(checksums_) - .mergeFrom(value) - .buildPartial(); - } else { - checksums_ = value; - } - onChanged(); - } else { - checksumsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Output only. Hashes for the data part of this object.
-     * 
- * - * - * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder clearChecksums() { - if (checksumsBuilder_ == null) { - checksums_ = null; - onChanged(); - } else { - checksums_ = null; - checksumsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Output only. Hashes for the data part of this object.
-     * 
- * - * - * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.storage.v2.ObjectChecksums.Builder getChecksumsBuilder() { - - onChanged(); - return getChecksumsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Output only. Hashes for the data part of this object.
-     * 
- * - * - * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.storage.v2.ObjectChecksumsOrBuilder getChecksumsOrBuilder() { - if (checksumsBuilder_ != null) { - return checksumsBuilder_.getMessageOrBuilder(); - } else { - return checksums_ == null - ? com.google.storage.v2.ObjectChecksums.getDefaultInstance() - : checksums_; - } - } - /** - * - * - *
-     * Output only. Hashes for the data part of this object.
-     * 
- * - * - * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ObjectChecksums, - com.google.storage.v2.ObjectChecksums.Builder, - com.google.storage.v2.ObjectChecksumsOrBuilder> - getChecksumsFieldBuilder() { - if (checksumsBuilder_ == null) { - checksumsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ObjectChecksums, - com.google.storage.v2.ObjectChecksums.Builder, - com.google.storage.v2.ObjectChecksumsOrBuilder>( - getChecksums(), getParentForChildren(), isClean()); - checksums_ = null; - } - return checksumsBuilder_; - } - - private com.google.protobuf.Timestamp updateTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - updateTimeBuilder_; - /** - * - * - *
-     * Output only. The modification time of the object metadata.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the updateTime field is set. - */ - public boolean hasUpdateTime() { - return updateTimeBuilder_ != null || updateTime_ != null; - } - /** - * - * - *
-     * Output only. The modification time of the object metadata.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The updateTime. - */ - public com.google.protobuf.Timestamp getUpdateTime() { - if (updateTimeBuilder_ == null) { - return updateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : updateTime_; - } else { - return updateTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Output only. The modification time of the object metadata.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setUpdateTime(com.google.protobuf.Timestamp value) { - if (updateTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - updateTime_ = value; - onChanged(); - } else { - updateTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Output only. The modification time of the object metadata.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (updateTimeBuilder_ == null) { - updateTime_ = builderForValue.build(); - onChanged(); - } else { - updateTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Output only. The modification time of the object metadata.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { - if (updateTimeBuilder_ == null) { - if (updateTime_ != null) { - updateTime_ = - com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); - } else { - updateTime_ = value; - } - onChanged(); - } else { - updateTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Output only. The modification time of the object metadata.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder clearUpdateTime() { - if (updateTimeBuilder_ == null) { - updateTime_ = null; - onChanged(); - } else { - updateTime_ = null; - updateTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Output only. The modification time of the object metadata.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { - - onChanged(); - return getUpdateTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Output only. The modification time of the object metadata.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { - if (updateTimeBuilder_ != null) { - return updateTimeBuilder_.getMessageOrBuilder(); - } else { - return updateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : updateTime_; - } - } - /** - * - * - *
-     * Output only. The modification time of the object metadata.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getUpdateTimeFieldBuilder() { - if (updateTimeBuilder_ == null) { - updateTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getUpdateTime(), getParentForChildren(), isClean()); - updateTime_ = null; - } - return updateTimeBuilder_; - } - - private java.lang.Object kmsKey_ = ""; - /** - * - * - *
-     * Cloud KMS Key used to encrypt this object, if the object is encrypted by
-     * such a key.
-     * 
- * - * string kms_key = 18 [(.google.api.resource_reference) = { ... } - * - * @return The kmsKey. - */ - public java.lang.String getKmsKey() { - java.lang.Object ref = kmsKey_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - kmsKey_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Cloud KMS Key used to encrypt this object, if the object is encrypted by
-     * such a key.
-     * 
- * - * string kms_key = 18 [(.google.api.resource_reference) = { ... } - * - * @return The bytes for kmsKey. - */ - public com.google.protobuf.ByteString getKmsKeyBytes() { - java.lang.Object ref = kmsKey_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - kmsKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Cloud KMS Key used to encrypt this object, if the object is encrypted by
-     * such a key.
-     * 
- * - * string kms_key = 18 [(.google.api.resource_reference) = { ... } - * - * @param value The kmsKey to set. - * @return This builder for chaining. - */ - public Builder setKmsKey(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - kmsKey_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Cloud KMS Key used to encrypt this object, if the object is encrypted by
-     * such a key.
-     * 
- * - * string kms_key = 18 [(.google.api.resource_reference) = { ... } - * - * @return This builder for chaining. - */ - public Builder clearKmsKey() { - - kmsKey_ = getDefaultInstance().getKmsKey(); - onChanged(); - return this; - } - /** - * - * - *
-     * Cloud KMS Key used to encrypt this object, if the object is encrypted by
-     * such a key.
-     * 
- * - * string kms_key = 18 [(.google.api.resource_reference) = { ... } - * - * @param value The bytes for kmsKey to set. - * @return This builder for chaining. - */ - public Builder setKmsKeyBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - kmsKey_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.Timestamp updateStorageClassTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - updateStorageClassTimeBuilder_; - /** - * - * - *
-     * Output only. The time at which the object's storage class was last changed. When the
-     * object is initially created, it will be set to time_created.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the updateStorageClassTime field is set. - */ - public boolean hasUpdateStorageClassTime() { - return updateStorageClassTimeBuilder_ != null || updateStorageClassTime_ != null; - } - /** - * - * - *
-     * Output only. The time at which the object's storage class was last changed. When the
-     * object is initially created, it will be set to time_created.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The updateStorageClassTime. - */ - public com.google.protobuf.Timestamp getUpdateStorageClassTime() { - if (updateStorageClassTimeBuilder_ == null) { - return updateStorageClassTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : updateStorageClassTime_; - } else { - return updateStorageClassTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Output only. The time at which the object's storage class was last changed. When the
-     * object is initially created, it will be set to time_created.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setUpdateStorageClassTime(com.google.protobuf.Timestamp value) { - if (updateStorageClassTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - updateStorageClassTime_ = value; - onChanged(); - } else { - updateStorageClassTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Output only. The time at which the object's storage class was last changed. When the
-     * object is initially created, it will be set to time_created.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setUpdateStorageClassTime( - com.google.protobuf.Timestamp.Builder builderForValue) { - if (updateStorageClassTimeBuilder_ == null) { - updateStorageClassTime_ = builderForValue.build(); - onChanged(); - } else { - updateStorageClassTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Output only. The time at which the object's storage class was last changed. When the
-     * object is initially created, it will be set to time_created.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder mergeUpdateStorageClassTime(com.google.protobuf.Timestamp value) { - if (updateStorageClassTimeBuilder_ == null) { - if (updateStorageClassTime_ != null) { - updateStorageClassTime_ = - com.google.protobuf.Timestamp.newBuilder(updateStorageClassTime_) - .mergeFrom(value) - .buildPartial(); - } else { - updateStorageClassTime_ = value; - } - onChanged(); - } else { - updateStorageClassTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Output only. The time at which the object's storage class was last changed. When the
-     * object is initially created, it will be set to time_created.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder clearUpdateStorageClassTime() { - if (updateStorageClassTimeBuilder_ == null) { - updateStorageClassTime_ = null; - onChanged(); - } else { - updateStorageClassTime_ = null; - updateStorageClassTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Output only. The time at which the object's storage class was last changed. When the
-     * object is initially created, it will be set to time_created.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.Timestamp.Builder getUpdateStorageClassTimeBuilder() { - - onChanged(); - return getUpdateStorageClassTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Output only. The time at which the object's storage class was last changed. When the
-     * object is initially created, it will be set to time_created.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.TimestampOrBuilder getUpdateStorageClassTimeOrBuilder() { - if (updateStorageClassTimeBuilder_ != null) { - return updateStorageClassTimeBuilder_.getMessageOrBuilder(); - } else { - return updateStorageClassTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : updateStorageClassTime_; - } - } - /** - * - * - *
-     * Output only. The time at which the object's storage class was last changed. When the
-     * object is initially created, it will be set to time_created.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * - * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getUpdateStorageClassTimeFieldBuilder() { - if (updateStorageClassTimeBuilder_ == null) { - updateStorageClassTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getUpdateStorageClassTime(), getParentForChildren(), isClean()); - updateStorageClassTime_ = null; - } - return updateStorageClassTimeBuilder_; - } - - private boolean temporaryHold_; - /** - * - * - *
-     * Whether an object is under temporary hold. While this flag is set to true,
-     * the object is protected against deletion and overwrites.  A common use case
-     * of this flag is regulatory investigations where objects need to be retained
-     * while the investigation is ongoing. Note that unlike event-based hold,
-     * temporary hold does not impact retention expiration time of an object.
-     * 
- * - * bool temporary_hold = 20; - * - * @return The temporaryHold. - */ - @java.lang.Override - public boolean getTemporaryHold() { - return temporaryHold_; - } - /** - * - * - *
-     * Whether an object is under temporary hold. While this flag is set to true,
-     * the object is protected against deletion and overwrites.  A common use case
-     * of this flag is regulatory investigations where objects need to be retained
-     * while the investigation is ongoing. Note that unlike event-based hold,
-     * temporary hold does not impact retention expiration time of an object.
-     * 
- * - * bool temporary_hold = 20; - * - * @param value The temporaryHold to set. - * @return This builder for chaining. - */ - public Builder setTemporaryHold(boolean value) { - - temporaryHold_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Whether an object is under temporary hold. While this flag is set to true,
-     * the object is protected against deletion and overwrites.  A common use case
-     * of this flag is regulatory investigations where objects need to be retained
-     * while the investigation is ongoing. Note that unlike event-based hold,
-     * temporary hold does not impact retention expiration time of an object.
-     * 
- * - * bool temporary_hold = 20; - * - * @return This builder for chaining. - */ - public Builder clearTemporaryHold() { - - temporaryHold_ = false; - onChanged(); - return this; - } - - private com.google.protobuf.Timestamp retentionExpireTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - retentionExpireTimeBuilder_; - /** - * - * - *
-     * A server-determined value that specifies the earliest time that the
-     * object's retention period expires. This value is in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * Note 1: This field is not provided for objects with an active event-based
-     * hold, since retention expiration is unknown until the hold is removed.
-     * Note 2: This value can be provided even when temporary hold is set (so that
-     * the user can reason about policy without having to first unset the
-     * temporary hold).
-     * 
- * - * .google.protobuf.Timestamp retention_expire_time = 21; - * - * @return Whether the retentionExpireTime field is set. - */ - public boolean hasRetentionExpireTime() { - return retentionExpireTimeBuilder_ != null || retentionExpireTime_ != null; - } - /** - * - * - *
-     * A server-determined value that specifies the earliest time that the
-     * object's retention period expires. This value is in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * Note 1: This field is not provided for objects with an active event-based
-     * hold, since retention expiration is unknown until the hold is removed.
-     * Note 2: This value can be provided even when temporary hold is set (so that
-     * the user can reason about policy without having to first unset the
-     * temporary hold).
-     * 
- * - * .google.protobuf.Timestamp retention_expire_time = 21; - * - * @return The retentionExpireTime. - */ - public com.google.protobuf.Timestamp getRetentionExpireTime() { - if (retentionExpireTimeBuilder_ == null) { - return retentionExpireTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : retentionExpireTime_; - } else { - return retentionExpireTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A server-determined value that specifies the earliest time that the
-     * object's retention period expires. This value is in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * Note 1: This field is not provided for objects with an active event-based
-     * hold, since retention expiration is unknown until the hold is removed.
-     * Note 2: This value can be provided even when temporary hold is set (so that
-     * the user can reason about policy without having to first unset the
-     * temporary hold).
-     * 
- * - * .google.protobuf.Timestamp retention_expire_time = 21; - */ - public Builder setRetentionExpireTime(com.google.protobuf.Timestamp value) { - if (retentionExpireTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - retentionExpireTime_ = value; - onChanged(); - } else { - retentionExpireTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A server-determined value that specifies the earliest time that the
-     * object's retention period expires. This value is in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * Note 1: This field is not provided for objects with an active event-based
-     * hold, since retention expiration is unknown until the hold is removed.
-     * Note 2: This value can be provided even when temporary hold is set (so that
-     * the user can reason about policy without having to first unset the
-     * temporary hold).
-     * 
- * - * .google.protobuf.Timestamp retention_expire_time = 21; - */ - public Builder setRetentionExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (retentionExpireTimeBuilder_ == null) { - retentionExpireTime_ = builderForValue.build(); - onChanged(); - } else { - retentionExpireTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A server-determined value that specifies the earliest time that the
-     * object's retention period expires. This value is in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * Note 1: This field is not provided for objects with an active event-based
-     * hold, since retention expiration is unknown until the hold is removed.
-     * Note 2: This value can be provided even when temporary hold is set (so that
-     * the user can reason about policy without having to first unset the
-     * temporary hold).
-     * 
- * - * .google.protobuf.Timestamp retention_expire_time = 21; - */ - public Builder mergeRetentionExpireTime(com.google.protobuf.Timestamp value) { - if (retentionExpireTimeBuilder_ == null) { - if (retentionExpireTime_ != null) { - retentionExpireTime_ = - com.google.protobuf.Timestamp.newBuilder(retentionExpireTime_) - .mergeFrom(value) - .buildPartial(); - } else { - retentionExpireTime_ = value; - } - onChanged(); - } else { - retentionExpireTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A server-determined value that specifies the earliest time that the
-     * object's retention period expires. This value is in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * Note 1: This field is not provided for objects with an active event-based
-     * hold, since retention expiration is unknown until the hold is removed.
-     * Note 2: This value can be provided even when temporary hold is set (so that
-     * the user can reason about policy without having to first unset the
-     * temporary hold).
-     * 
- * - * .google.protobuf.Timestamp retention_expire_time = 21; - */ - public Builder clearRetentionExpireTime() { - if (retentionExpireTimeBuilder_ == null) { - retentionExpireTime_ = null; - onChanged(); - } else { - retentionExpireTime_ = null; - retentionExpireTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A server-determined value that specifies the earliest time that the
-     * object's retention period expires. This value is in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * Note 1: This field is not provided for objects with an active event-based
-     * hold, since retention expiration is unknown until the hold is removed.
-     * Note 2: This value can be provided even when temporary hold is set (so that
-     * the user can reason about policy without having to first unset the
-     * temporary hold).
-     * 
- * - * .google.protobuf.Timestamp retention_expire_time = 21; - */ - public com.google.protobuf.Timestamp.Builder getRetentionExpireTimeBuilder() { - - onChanged(); - return getRetentionExpireTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A server-determined value that specifies the earliest time that the
-     * object's retention period expires. This value is in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * Note 1: This field is not provided for objects with an active event-based
-     * hold, since retention expiration is unknown until the hold is removed.
-     * Note 2: This value can be provided even when temporary hold is set (so that
-     * the user can reason about policy without having to first unset the
-     * temporary hold).
-     * 
- * - * .google.protobuf.Timestamp retention_expire_time = 21; - */ - public com.google.protobuf.TimestampOrBuilder getRetentionExpireTimeOrBuilder() { - if (retentionExpireTimeBuilder_ != null) { - return retentionExpireTimeBuilder_.getMessageOrBuilder(); - } else { - return retentionExpireTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : retentionExpireTime_; - } - } - /** - * - * - *
-     * A server-determined value that specifies the earliest time that the
-     * object's retention period expires. This value is in
-     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-     * Note 1: This field is not provided for objects with an active event-based
-     * hold, since retention expiration is unknown until the hold is removed.
-     * Note 2: This value can be provided even when temporary hold is set (so that
-     * the user can reason about policy without having to first unset the
-     * temporary hold).
-     * 
- * - * .google.protobuf.Timestamp retention_expire_time = 21; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getRetentionExpireTimeFieldBuilder() { - if (retentionExpireTimeBuilder_ == null) { - retentionExpireTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getRetentionExpireTime(), getParentForChildren(), isClean()); - retentionExpireTime_ = null; - } - return retentionExpireTimeBuilder_; - } - - private com.google.protobuf.MapField metadata_; - - private com.google.protobuf.MapField internalGetMetadata() { - if (metadata_ == null) { - return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry); - } - return metadata_; - } - - private com.google.protobuf.MapField - internalGetMutableMetadata() { - onChanged(); - ; - if (metadata_ == null) { - metadata_ = - com.google.protobuf.MapField.newMapField(MetadataDefaultEntryHolder.defaultEntry); - } - if (!metadata_.isMutable()) { - metadata_ = metadata_.copy(); - } - return metadata_; - } - - public int getMetadataCount() { - return internalGetMetadata().getMap().size(); - } - /** - * - * - *
-     * User-provided metadata, in key/value pairs.
-     * 
- * - * map<string, string> metadata = 22; - */ - @java.lang.Override - public boolean containsMetadata(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - return internalGetMetadata().getMap().containsKey(key); - } - /** Use {@link #getMetadataMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getMetadata() { - return getMetadataMap(); - } - /** - * - * - *
-     * User-provided metadata, in key/value pairs.
-     * 
- * - * map<string, string> metadata = 22; - */ - @java.lang.Override - public java.util.Map getMetadataMap() { - return internalGetMetadata().getMap(); - } - /** - * - * - *
-     * User-provided metadata, in key/value pairs.
-     * 
- * - * map<string, string> metadata = 22; - */ - @java.lang.Override - public java.lang.String getMetadataOrDefault( - java.lang.String key, java.lang.String defaultValue) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - java.util.Map map = internalGetMetadata().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-     * User-provided metadata, in key/value pairs.
-     * 
- * - * map<string, string> metadata = 22; - */ - @java.lang.Override - public java.lang.String getMetadataOrThrow(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - java.util.Map map = internalGetMetadata().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearMetadata() { - internalGetMutableMetadata().getMutableMap().clear(); - return this; - } - /** - * - * - *
-     * User-provided metadata, in key/value pairs.
-     * 
- * - * map<string, string> metadata = 22; - */ - public Builder removeMetadata(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - internalGetMutableMetadata().getMutableMap().remove(key); - return this; - } - /** Use alternate mutation accessors instead. */ - @java.lang.Deprecated - public java.util.Map getMutableMetadata() { - return internalGetMutableMetadata().getMutableMap(); - } - /** - * - * - *
-     * User-provided metadata, in key/value pairs.
-     * 
- * - * map<string, string> metadata = 22; - */ - public Builder putMetadata(java.lang.String key, java.lang.String value) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - if (value == null) { - throw new java.lang.NullPointerException(); - } - internalGetMutableMetadata().getMutableMap().put(key, value); - return this; - } - /** - * - * - *
-     * User-provided metadata, in key/value pairs.
-     * 
- * - * map<string, string> metadata = 22; - */ - public Builder putAllMetadata(java.util.Map values) { - internalGetMutableMetadata().getMutableMap().putAll(values); - return this; - } - - private boolean eventBasedHold_; - /** - * - * - *
-     * Whether an object is under event-based hold.
-     * An event-based hold is a way to force the retention of an object until
-     * after some event occurs. Once the hold is released by explicitly setting
-     * this field to false, the object will become subject to any bucket-level
-     * retention policy, except that the retention duration will be calculated
-     * from the time the event based hold was lifted, rather than the time the
-     * object was created.
-     * In a WriteObject request, not setting this field implies that the value
-     * should be taken from the parent bucket's "default_event_based_hold" field.
-     * In a response, this field will always be set to true or false.
-     * 
- * - * optional bool event_based_hold = 23; - * - * @return Whether the eventBasedHold field is set. - */ - @java.lang.Override - public boolean hasEventBasedHold() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * - * - *
-     * Whether an object is under event-based hold.
-     * An event-based hold is a way to force the retention of an object until
-     * after some event occurs. Once the hold is released by explicitly setting
-     * this field to false, the object will become subject to any bucket-level
-     * retention policy, except that the retention duration will be calculated
-     * from the time the event based hold was lifted, rather than the time the
-     * object was created.
-     * In a WriteObject request, not setting this field implies that the value
-     * should be taken from the parent bucket's "default_event_based_hold" field.
-     * In a response, this field will always be set to true or false.
-     * 
- * - * optional bool event_based_hold = 23; - * - * @return The eventBasedHold. - */ - @java.lang.Override - public boolean getEventBasedHold() { - return eventBasedHold_; - } - /** - * - * - *
-     * Whether an object is under event-based hold.
-     * An event-based hold is a way to force the retention of an object until
-     * after some event occurs. Once the hold is released by explicitly setting
-     * this field to false, the object will become subject to any bucket-level
-     * retention policy, except that the retention duration will be calculated
-     * from the time the event based hold was lifted, rather than the time the
-     * object was created.
-     * In a WriteObject request, not setting this field implies that the value
-     * should be taken from the parent bucket's "default_event_based_hold" field.
-     * In a response, this field will always be set to true or false.
-     * 
- * - * optional bool event_based_hold = 23; - * - * @param value The eventBasedHold to set. - * @return This builder for chaining. - */ - public Builder setEventBasedHold(boolean value) { - bitField0_ |= 0x00000004; - eventBasedHold_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Whether an object is under event-based hold.
-     * An event-based hold is a way to force the retention of an object until
-     * after some event occurs. Once the hold is released by explicitly setting
-     * this field to false, the object will become subject to any bucket-level
-     * retention policy, except that the retention duration will be calculated
-     * from the time the event based hold was lifted, rather than the time the
-     * object was created.
-     * In a WriteObject request, not setting this field implies that the value
-     * should be taken from the parent bucket's "default_event_based_hold" field.
-     * In a response, this field will always be set to true or false.
-     * 
- * - * optional bool event_based_hold = 23; - * - * @return This builder for chaining. - */ - public Builder clearEventBasedHold() { - bitField0_ = (bitField0_ & ~0x00000004); - eventBasedHold_ = false; - onChanged(); - return this; - } - - private com.google.storage.v2.Owner owner_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Owner, - com.google.storage.v2.Owner.Builder, - com.google.storage.v2.OwnerOrBuilder> - ownerBuilder_; - /** - * - * - *
-     * Output only. The owner of the object. This will always be the uploader of the object.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the owner field is set. - */ - public boolean hasOwner() { - return ownerBuilder_ != null || owner_ != null; - } - /** - * - * - *
-     * Output only. The owner of the object. This will always be the uploader of the object.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The owner. - */ - public com.google.storage.v2.Owner getOwner() { - if (ownerBuilder_ == null) { - return owner_ == null ? com.google.storage.v2.Owner.getDefaultInstance() : owner_; - } else { - return ownerBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Output only. The owner of the object. This will always be the uploader of the object.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setOwner(com.google.storage.v2.Owner value) { - if (ownerBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - owner_ = value; - onChanged(); - } else { - ownerBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Output only. The owner of the object. This will always be the uploader of the object.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setOwner(com.google.storage.v2.Owner.Builder builderForValue) { - if (ownerBuilder_ == null) { - owner_ = builderForValue.build(); - onChanged(); - } else { - ownerBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Output only. The owner of the object. This will always be the uploader of the object.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder mergeOwner(com.google.storage.v2.Owner value) { - if (ownerBuilder_ == null) { - if (owner_ != null) { - owner_ = com.google.storage.v2.Owner.newBuilder(owner_).mergeFrom(value).buildPartial(); - } else { - owner_ = value; - } - onChanged(); - } else { - ownerBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Output only. The owner of the object. This will always be the uploader of the object.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder clearOwner() { - if (ownerBuilder_ == null) { - owner_ = null; - onChanged(); - } else { - owner_ = null; - ownerBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Output only. The owner of the object. This will always be the uploader of the object.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.storage.v2.Owner.Builder getOwnerBuilder() { - - onChanged(); - return getOwnerFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Output only. The owner of the object. This will always be the uploader of the object.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.storage.v2.OwnerOrBuilder getOwnerOrBuilder() { - if (ownerBuilder_ != null) { - return ownerBuilder_.getMessageOrBuilder(); - } else { - return owner_ == null ? com.google.storage.v2.Owner.getDefaultInstance() : owner_; - } - } - /** - * - * - *
-     * Output only. The owner of the object. This will always be the uploader of the object.
-     * Attempting to set or update this field will result in a
-     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-     * 
- * - * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Owner, - com.google.storage.v2.Owner.Builder, - com.google.storage.v2.OwnerOrBuilder> - getOwnerFieldBuilder() { - if (ownerBuilder_ == null) { - ownerBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Owner, - com.google.storage.v2.Owner.Builder, - com.google.storage.v2.OwnerOrBuilder>( - getOwner(), getParentForChildren(), isClean()); - owner_ = null; - } - return ownerBuilder_; - } - - private com.google.storage.v2.CustomerEncryption customerEncryption_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CustomerEncryption, - com.google.storage.v2.CustomerEncryption.Builder, - com.google.storage.v2.CustomerEncryptionOrBuilder> - customerEncryptionBuilder_; - /** - * - * - *
-     * Metadata of Customer-Supplied Encryption Key, if the object is encrypted by
-     * such a key.
-     * 
- * - * .google.storage.v2.CustomerEncryption customer_encryption = 25; - * - * @return Whether the customerEncryption field is set. - */ - public boolean hasCustomerEncryption() { - return customerEncryptionBuilder_ != null || customerEncryption_ != null; - } - /** - * - * - *
-     * Metadata of Customer-Supplied Encryption Key, if the object is encrypted by
-     * such a key.
-     * 
- * - * .google.storage.v2.CustomerEncryption customer_encryption = 25; - * - * @return The customerEncryption. - */ - public com.google.storage.v2.CustomerEncryption getCustomerEncryption() { - if (customerEncryptionBuilder_ == null) { - return customerEncryption_ == null - ? com.google.storage.v2.CustomerEncryption.getDefaultInstance() - : customerEncryption_; - } else { - return customerEncryptionBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Metadata of Customer-Supplied Encryption Key, if the object is encrypted by
-     * such a key.
-     * 
- * - * .google.storage.v2.CustomerEncryption customer_encryption = 25; - */ - public Builder setCustomerEncryption(com.google.storage.v2.CustomerEncryption value) { - if (customerEncryptionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - customerEncryption_ = value; - onChanged(); - } else { - customerEncryptionBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Metadata of Customer-Supplied Encryption Key, if the object is encrypted by
-     * such a key.
-     * 
- * - * .google.storage.v2.CustomerEncryption customer_encryption = 25; - */ - public Builder setCustomerEncryption( - com.google.storage.v2.CustomerEncryption.Builder builderForValue) { - if (customerEncryptionBuilder_ == null) { - customerEncryption_ = builderForValue.build(); - onChanged(); - } else { - customerEncryptionBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Metadata of Customer-Supplied Encryption Key, if the object is encrypted by
-     * such a key.
-     * 
- * - * .google.storage.v2.CustomerEncryption customer_encryption = 25; - */ - public Builder mergeCustomerEncryption(com.google.storage.v2.CustomerEncryption value) { - if (customerEncryptionBuilder_ == null) { - if (customerEncryption_ != null) { - customerEncryption_ = - com.google.storage.v2.CustomerEncryption.newBuilder(customerEncryption_) - .mergeFrom(value) - .buildPartial(); - } else { - customerEncryption_ = value; - } - onChanged(); - } else { - customerEncryptionBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Metadata of Customer-Supplied Encryption Key, if the object is encrypted by
-     * such a key.
-     * 
- * - * .google.storage.v2.CustomerEncryption customer_encryption = 25; - */ - public Builder clearCustomerEncryption() { - if (customerEncryptionBuilder_ == null) { - customerEncryption_ = null; - onChanged(); - } else { - customerEncryption_ = null; - customerEncryptionBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Metadata of Customer-Supplied Encryption Key, if the object is encrypted by
-     * such a key.
-     * 
- * - * .google.storage.v2.CustomerEncryption customer_encryption = 25; - */ - public com.google.storage.v2.CustomerEncryption.Builder getCustomerEncryptionBuilder() { - - onChanged(); - return getCustomerEncryptionFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Metadata of Customer-Supplied Encryption Key, if the object is encrypted by
-     * such a key.
-     * 
- * - * .google.storage.v2.CustomerEncryption customer_encryption = 25; - */ - public com.google.storage.v2.CustomerEncryptionOrBuilder getCustomerEncryptionOrBuilder() { - if (customerEncryptionBuilder_ != null) { - return customerEncryptionBuilder_.getMessageOrBuilder(); - } else { - return customerEncryption_ == null - ? com.google.storage.v2.CustomerEncryption.getDefaultInstance() - : customerEncryption_; - } - } - /** - * - * - *
-     * Metadata of Customer-Supplied Encryption Key, if the object is encrypted by
-     * such a key.
-     * 
- * - * .google.storage.v2.CustomerEncryption customer_encryption = 25; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CustomerEncryption, - com.google.storage.v2.CustomerEncryption.Builder, - com.google.storage.v2.CustomerEncryptionOrBuilder> - getCustomerEncryptionFieldBuilder() { - if (customerEncryptionBuilder_ == null) { - customerEncryptionBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CustomerEncryption, - com.google.storage.v2.CustomerEncryption.Builder, - com.google.storage.v2.CustomerEncryptionOrBuilder>( - getCustomerEncryption(), getParentForChildren(), isClean()); - customerEncryption_ = null; - } - return customerEncryptionBuilder_; - } - - private com.google.protobuf.Timestamp customTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - customTimeBuilder_; - /** - * - * - *
-     * A user-specified timestamp set on an object.
-     * 
- * - * .google.protobuf.Timestamp custom_time = 26; - * - * @return Whether the customTime field is set. - */ - public boolean hasCustomTime() { - return customTimeBuilder_ != null || customTime_ != null; - } - /** - * - * - *
-     * A user-specified timestamp set on an object.
-     * 
- * - * .google.protobuf.Timestamp custom_time = 26; - * - * @return The customTime. - */ - public com.google.protobuf.Timestamp getCustomTime() { - if (customTimeBuilder_ == null) { - return customTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : customTime_; - } else { - return customTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A user-specified timestamp set on an object.
-     * 
- * - * .google.protobuf.Timestamp custom_time = 26; - */ - public Builder setCustomTime(com.google.protobuf.Timestamp value) { - if (customTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - customTime_ = value; - onChanged(); - } else { - customTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A user-specified timestamp set on an object.
-     * 
- * - * .google.protobuf.Timestamp custom_time = 26; - */ - public Builder setCustomTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (customTimeBuilder_ == null) { - customTime_ = builderForValue.build(); - onChanged(); - } else { - customTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A user-specified timestamp set on an object.
-     * 
- * - * .google.protobuf.Timestamp custom_time = 26; - */ - public Builder mergeCustomTime(com.google.protobuf.Timestamp value) { - if (customTimeBuilder_ == null) { - if (customTime_ != null) { - customTime_ = - com.google.protobuf.Timestamp.newBuilder(customTime_).mergeFrom(value).buildPartial(); - } else { - customTime_ = value; - } - onChanged(); - } else { - customTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A user-specified timestamp set on an object.
-     * 
- * - * .google.protobuf.Timestamp custom_time = 26; - */ - public Builder clearCustomTime() { - if (customTimeBuilder_ == null) { - customTime_ = null; - onChanged(); - } else { - customTime_ = null; - customTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A user-specified timestamp set on an object.
-     * 
- * - * .google.protobuf.Timestamp custom_time = 26; - */ - public com.google.protobuf.Timestamp.Builder getCustomTimeBuilder() { - - onChanged(); - return getCustomTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A user-specified timestamp set on an object.
-     * 
- * - * .google.protobuf.Timestamp custom_time = 26; - */ - public com.google.protobuf.TimestampOrBuilder getCustomTimeOrBuilder() { - if (customTimeBuilder_ != null) { - return customTimeBuilder_.getMessageOrBuilder(); - } else { - return customTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : customTime_; - } - } - /** - * - * - *
-     * A user-specified timestamp set on an object.
-     * 
- * - * .google.protobuf.Timestamp custom_time = 26; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getCustomTimeFieldBuilder() { - if (customTimeBuilder_ == null) { - customTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getCustomTime(), getParentForChildren(), isClean()); - customTime_ = null; - } - return customTimeBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.Object) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.Object) - private static final com.google.storage.v2.Object DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.Object(); - } - - public static com.google.storage.v2.Object getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Object parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Object(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.Object getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectAccessControl.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectAccessControl.java deleted file mode 100644 index e7ce2b1bce..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectAccessControl.java +++ /dev/null @@ -1,1903 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * An access-control entry.
- * 
- * - * Protobuf type {@code google.storage.v2.ObjectAccessControl} - */ -public final class ObjectAccessControl extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.ObjectAccessControl) - ObjectAccessControlOrBuilder { - private static final long serialVersionUID = 0L; - // Use ObjectAccessControl.newBuilder() to construct. - private ObjectAccessControl(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ObjectAccessControl() { - role_ = ""; - id_ = ""; - entity_ = ""; - entityId_ = ""; - email_ = ""; - domain_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ObjectAccessControl(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ObjectAccessControl( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - role_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - id_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - entity_ = s; - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - - entityId_ = s; - break; - } - case 42: - { - java.lang.String s = input.readStringRequireUtf8(); - - email_ = s; - break; - } - case 50: - { - java.lang.String s = input.readStringRequireUtf8(); - - domain_ = s; - break; - } - case 58: - { - com.google.storage.v2.ProjectTeam.Builder subBuilder = null; - if (projectTeam_ != null) { - subBuilder = projectTeam_.toBuilder(); - } - projectTeam_ = - input.readMessage(com.google.storage.v2.ProjectTeam.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(projectTeam_); - projectTeam_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ObjectAccessControl_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ObjectAccessControl_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ObjectAccessControl.class, - com.google.storage.v2.ObjectAccessControl.Builder.class); - } - - public static final int ROLE_FIELD_NUMBER = 1; - private volatile java.lang.Object role_; - /** - * - * - *
-   * The access permission for the entity.
-   * 
- * - * string role = 1; - * - * @return The role. - */ - @java.lang.Override - public java.lang.String getRole() { - java.lang.Object ref = role_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - role_ = s; - return s; - } - } - /** - * - * - *
-   * The access permission for the entity.
-   * 
- * - * string role = 1; - * - * @return The bytes for role. - */ - @java.lang.Override - public com.google.protobuf.ByteString getRoleBytes() { - java.lang.Object ref = role_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - role_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ID_FIELD_NUMBER = 2; - private volatile java.lang.Object id_; - /** - * - * - *
-   * The ID of the access-control entry.
-   * 
- * - * string id = 2; - * - * @return The id. - */ - @java.lang.Override - public java.lang.String getId() { - java.lang.Object ref = id_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - id_ = s; - return s; - } - } - /** - * - * - *
-   * The ID of the access-control entry.
-   * 
- * - * string id = 2; - * - * @return The bytes for id. - */ - @java.lang.Override - public com.google.protobuf.ByteString getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - id_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ENTITY_FIELD_NUMBER = 3; - private volatile java.lang.Object entity_; - /** - * - * - *
-   * The entity holding the permission, in one of the following forms:
-   * * `user-{userid}`
-   * * `user-{email}`
-   * * `group-{groupid}`
-   * * `group-{email}`
-   * * `domain-{domain}`
-   * * `project-{team-projectid}`
-   * * `allUsers`
-   * * `allAuthenticatedUsers`
-   * Examples:
-   * * The user `liz@example.com` would be `user-liz@example.com`.
-   * * The group `example@googlegroups.com` would be
-   * `group-example@googlegroups.com`.
-   * * All members of the Google Apps for Business domain `example.com` would be
-   * `domain-example.com`.
-   * 
- * - * string entity = 3; - * - * @return The entity. - */ - @java.lang.Override - public java.lang.String getEntity() { - java.lang.Object ref = entity_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - entity_ = s; - return s; - } - } - /** - * - * - *
-   * The entity holding the permission, in one of the following forms:
-   * * `user-{userid}`
-   * * `user-{email}`
-   * * `group-{groupid}`
-   * * `group-{email}`
-   * * `domain-{domain}`
-   * * `project-{team-projectid}`
-   * * `allUsers`
-   * * `allAuthenticatedUsers`
-   * Examples:
-   * * The user `liz@example.com` would be `user-liz@example.com`.
-   * * The group `example@googlegroups.com` would be
-   * `group-example@googlegroups.com`.
-   * * All members of the Google Apps for Business domain `example.com` would be
-   * `domain-example.com`.
-   * 
- * - * string entity = 3; - * - * @return The bytes for entity. - */ - @java.lang.Override - public com.google.protobuf.ByteString getEntityBytes() { - java.lang.Object ref = entity_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - entity_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ENTITY_ID_FIELD_NUMBER = 4; - private volatile java.lang.Object entityId_; - /** - * - * - *
-   * The ID for the entity, if any.
-   * 
- * - * string entity_id = 4; - * - * @return The entityId. - */ - @java.lang.Override - public java.lang.String getEntityId() { - java.lang.Object ref = entityId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - entityId_ = s; - return s; - } - } - /** - * - * - *
-   * The ID for the entity, if any.
-   * 
- * - * string entity_id = 4; - * - * @return The bytes for entityId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getEntityIdBytes() { - java.lang.Object ref = entityId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - entityId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int EMAIL_FIELD_NUMBER = 5; - private volatile java.lang.Object email_; - /** - * - * - *
-   * The email address associated with the entity, if any.
-   * 
- * - * string email = 5; - * - * @return The email. - */ - @java.lang.Override - public java.lang.String getEmail() { - java.lang.Object ref = email_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - email_ = s; - return s; - } - } - /** - * - * - *
-   * The email address associated with the entity, if any.
-   * 
- * - * string email = 5; - * - * @return The bytes for email. - */ - @java.lang.Override - public com.google.protobuf.ByteString getEmailBytes() { - java.lang.Object ref = email_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - email_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DOMAIN_FIELD_NUMBER = 6; - private volatile java.lang.Object domain_; - /** - * - * - *
-   * The domain associated with the entity, if any.
-   * 
- * - * string domain = 6; - * - * @return The domain. - */ - @java.lang.Override - public java.lang.String getDomain() { - java.lang.Object ref = domain_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - domain_ = s; - return s; - } - } - /** - * - * - *
-   * The domain associated with the entity, if any.
-   * 
- * - * string domain = 6; - * - * @return The bytes for domain. - */ - @java.lang.Override - public com.google.protobuf.ByteString getDomainBytes() { - java.lang.Object ref = domain_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - domain_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PROJECT_TEAM_FIELD_NUMBER = 7; - private com.google.storage.v2.ProjectTeam projectTeam_; - /** - * - * - *
-   * The project team associated with the entity, if any.
-   * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - * - * @return Whether the projectTeam field is set. - */ - @java.lang.Override - public boolean hasProjectTeam() { - return projectTeam_ != null; - } - /** - * - * - *
-   * The project team associated with the entity, if any.
-   * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - * - * @return The projectTeam. - */ - @java.lang.Override - public com.google.storage.v2.ProjectTeam getProjectTeam() { - return projectTeam_ == null - ? com.google.storage.v2.ProjectTeam.getDefaultInstance() - : projectTeam_; - } - /** - * - * - *
-   * The project team associated with the entity, if any.
-   * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - */ - @java.lang.Override - public com.google.storage.v2.ProjectTeamOrBuilder getProjectTeamOrBuilder() { - return getProjectTeam(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(role_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, role_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, id_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entity_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, entity_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entityId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, entityId_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(email_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, email_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(domain_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, domain_); - } - if (projectTeam_ != null) { - output.writeMessage(7, getProjectTeam()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(role_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, role_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, id_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entity_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, entity_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entityId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, entityId_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(email_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, email_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(domain_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, domain_); - } - if (projectTeam_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getProjectTeam()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.ObjectAccessControl)) { - return super.equals(obj); - } - com.google.storage.v2.ObjectAccessControl other = - (com.google.storage.v2.ObjectAccessControl) obj; - - if (!getRole().equals(other.getRole())) return false; - if (!getId().equals(other.getId())) return false; - if (!getEntity().equals(other.getEntity())) return false; - if (!getEntityId().equals(other.getEntityId())) return false; - if (!getEmail().equals(other.getEmail())) return false; - if (!getDomain().equals(other.getDomain())) return false; - if (hasProjectTeam() != other.hasProjectTeam()) return false; - if (hasProjectTeam()) { - if (!getProjectTeam().equals(other.getProjectTeam())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ROLE_FIELD_NUMBER; - hash = (53 * hash) + getRole().hashCode(); - hash = (37 * hash) + ID_FIELD_NUMBER; - hash = (53 * hash) + getId().hashCode(); - hash = (37 * hash) + ENTITY_FIELD_NUMBER; - hash = (53 * hash) + getEntity().hashCode(); - hash = (37 * hash) + ENTITY_ID_FIELD_NUMBER; - hash = (53 * hash) + getEntityId().hashCode(); - hash = (37 * hash) + EMAIL_FIELD_NUMBER; - hash = (53 * hash) + getEmail().hashCode(); - hash = (37 * hash) + DOMAIN_FIELD_NUMBER; - hash = (53 * hash) + getDomain().hashCode(); - if (hasProjectTeam()) { - hash = (37 * hash) + PROJECT_TEAM_FIELD_NUMBER; - hash = (53 * hash) + getProjectTeam().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.ObjectAccessControl parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ObjectAccessControl parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ObjectAccessControl parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ObjectAccessControl parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ObjectAccessControl parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ObjectAccessControl parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ObjectAccessControl parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ObjectAccessControl parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.ObjectAccessControl parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ObjectAccessControl parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.ObjectAccessControl parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ObjectAccessControl parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.ObjectAccessControl prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * An access-control entry.
-   * 
- * - * Protobuf type {@code google.storage.v2.ObjectAccessControl} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.ObjectAccessControl) - com.google.storage.v2.ObjectAccessControlOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ObjectAccessControl_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ObjectAccessControl_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ObjectAccessControl.class, - com.google.storage.v2.ObjectAccessControl.Builder.class); - } - - // Construct using com.google.storage.v2.ObjectAccessControl.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - role_ = ""; - - id_ = ""; - - entity_ = ""; - - entityId_ = ""; - - email_ = ""; - - domain_ = ""; - - if (projectTeamBuilder_ == null) { - projectTeam_ = null; - } else { - projectTeam_ = null; - projectTeamBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ObjectAccessControl_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.ObjectAccessControl getDefaultInstanceForType() { - return com.google.storage.v2.ObjectAccessControl.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.ObjectAccessControl build() { - com.google.storage.v2.ObjectAccessControl result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.ObjectAccessControl buildPartial() { - com.google.storage.v2.ObjectAccessControl result = - new com.google.storage.v2.ObjectAccessControl(this); - result.role_ = role_; - result.id_ = id_; - result.entity_ = entity_; - result.entityId_ = entityId_; - result.email_ = email_; - result.domain_ = domain_; - if (projectTeamBuilder_ == null) { - result.projectTeam_ = projectTeam_; - } else { - result.projectTeam_ = projectTeamBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.ObjectAccessControl) { - return mergeFrom((com.google.storage.v2.ObjectAccessControl) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.ObjectAccessControl other) { - if (other == com.google.storage.v2.ObjectAccessControl.getDefaultInstance()) return this; - if (!other.getRole().isEmpty()) { - role_ = other.role_; - onChanged(); - } - if (!other.getId().isEmpty()) { - id_ = other.id_; - onChanged(); - } - if (!other.getEntity().isEmpty()) { - entity_ = other.entity_; - onChanged(); - } - if (!other.getEntityId().isEmpty()) { - entityId_ = other.entityId_; - onChanged(); - } - if (!other.getEmail().isEmpty()) { - email_ = other.email_; - onChanged(); - } - if (!other.getDomain().isEmpty()) { - domain_ = other.domain_; - onChanged(); - } - if (other.hasProjectTeam()) { - mergeProjectTeam(other.getProjectTeam()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.ObjectAccessControl parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.ObjectAccessControl) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object role_ = ""; - /** - * - * - *
-     * The access permission for the entity.
-     * 
- * - * string role = 1; - * - * @return The role. - */ - public java.lang.String getRole() { - java.lang.Object ref = role_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - role_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The access permission for the entity.
-     * 
- * - * string role = 1; - * - * @return The bytes for role. - */ - public com.google.protobuf.ByteString getRoleBytes() { - java.lang.Object ref = role_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - role_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The access permission for the entity.
-     * 
- * - * string role = 1; - * - * @param value The role to set. - * @return This builder for chaining. - */ - public Builder setRole(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - role_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The access permission for the entity.
-     * 
- * - * string role = 1; - * - * @return This builder for chaining. - */ - public Builder clearRole() { - - role_ = getDefaultInstance().getRole(); - onChanged(); - return this; - } - /** - * - * - *
-     * The access permission for the entity.
-     * 
- * - * string role = 1; - * - * @param value The bytes for role to set. - * @return This builder for chaining. - */ - public Builder setRoleBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - role_ = value; - onChanged(); - return this; - } - - private java.lang.Object id_ = ""; - /** - * - * - *
-     * The ID of the access-control entry.
-     * 
- * - * string id = 2; - * - * @return The id. - */ - public java.lang.String getId() { - java.lang.Object ref = id_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - id_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The ID of the access-control entry.
-     * 
- * - * string id = 2; - * - * @return The bytes for id. - */ - public com.google.protobuf.ByteString getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - id_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The ID of the access-control entry.
-     * 
- * - * string id = 2; - * - * @param value The id to set. - * @return This builder for chaining. - */ - public Builder setId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - id_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The ID of the access-control entry.
-     * 
- * - * string id = 2; - * - * @return This builder for chaining. - */ - public Builder clearId() { - - id_ = getDefaultInstance().getId(); - onChanged(); - return this; - } - /** - * - * - *
-     * The ID of the access-control entry.
-     * 
- * - * string id = 2; - * - * @param value The bytes for id to set. - * @return This builder for chaining. - */ - public Builder setIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - id_ = value; - onChanged(); - return this; - } - - private java.lang.Object entity_ = ""; - /** - * - * - *
-     * The entity holding the permission, in one of the following forms:
-     * * `user-{userid}`
-     * * `user-{email}`
-     * * `group-{groupid}`
-     * * `group-{email}`
-     * * `domain-{domain}`
-     * * `project-{team-projectid}`
-     * * `allUsers`
-     * * `allAuthenticatedUsers`
-     * Examples:
-     * * The user `liz@example.com` would be `user-liz@example.com`.
-     * * The group `example@googlegroups.com` would be
-     * `group-example@googlegroups.com`.
-     * * All members of the Google Apps for Business domain `example.com` would be
-     * `domain-example.com`.
-     * 
- * - * string entity = 3; - * - * @return The entity. - */ - public java.lang.String getEntity() { - java.lang.Object ref = entity_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - entity_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The entity holding the permission, in one of the following forms:
-     * * `user-{userid}`
-     * * `user-{email}`
-     * * `group-{groupid}`
-     * * `group-{email}`
-     * * `domain-{domain}`
-     * * `project-{team-projectid}`
-     * * `allUsers`
-     * * `allAuthenticatedUsers`
-     * Examples:
-     * * The user `liz@example.com` would be `user-liz@example.com`.
-     * * The group `example@googlegroups.com` would be
-     * `group-example@googlegroups.com`.
-     * * All members of the Google Apps for Business domain `example.com` would be
-     * `domain-example.com`.
-     * 
- * - * string entity = 3; - * - * @return The bytes for entity. - */ - public com.google.protobuf.ByteString getEntityBytes() { - java.lang.Object ref = entity_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - entity_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The entity holding the permission, in one of the following forms:
-     * * `user-{userid}`
-     * * `user-{email}`
-     * * `group-{groupid}`
-     * * `group-{email}`
-     * * `domain-{domain}`
-     * * `project-{team-projectid}`
-     * * `allUsers`
-     * * `allAuthenticatedUsers`
-     * Examples:
-     * * The user `liz@example.com` would be `user-liz@example.com`.
-     * * The group `example@googlegroups.com` would be
-     * `group-example@googlegroups.com`.
-     * * All members of the Google Apps for Business domain `example.com` would be
-     * `domain-example.com`.
-     * 
- * - * string entity = 3; - * - * @param value The entity to set. - * @return This builder for chaining. - */ - public Builder setEntity(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - entity_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The entity holding the permission, in one of the following forms:
-     * * `user-{userid}`
-     * * `user-{email}`
-     * * `group-{groupid}`
-     * * `group-{email}`
-     * * `domain-{domain}`
-     * * `project-{team-projectid}`
-     * * `allUsers`
-     * * `allAuthenticatedUsers`
-     * Examples:
-     * * The user `liz@example.com` would be `user-liz@example.com`.
-     * * The group `example@googlegroups.com` would be
-     * `group-example@googlegroups.com`.
-     * * All members of the Google Apps for Business domain `example.com` would be
-     * `domain-example.com`.
-     * 
- * - * string entity = 3; - * - * @return This builder for chaining. - */ - public Builder clearEntity() { - - entity_ = getDefaultInstance().getEntity(); - onChanged(); - return this; - } - /** - * - * - *
-     * The entity holding the permission, in one of the following forms:
-     * * `user-{userid}`
-     * * `user-{email}`
-     * * `group-{groupid}`
-     * * `group-{email}`
-     * * `domain-{domain}`
-     * * `project-{team-projectid}`
-     * * `allUsers`
-     * * `allAuthenticatedUsers`
-     * Examples:
-     * * The user `liz@example.com` would be `user-liz@example.com`.
-     * * The group `example@googlegroups.com` would be
-     * `group-example@googlegroups.com`.
-     * * All members of the Google Apps for Business domain `example.com` would be
-     * `domain-example.com`.
-     * 
- * - * string entity = 3; - * - * @param value The bytes for entity to set. - * @return This builder for chaining. - */ - public Builder setEntityBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - entity_ = value; - onChanged(); - return this; - } - - private java.lang.Object entityId_ = ""; - /** - * - * - *
-     * The ID for the entity, if any.
-     * 
- * - * string entity_id = 4; - * - * @return The entityId. - */ - public java.lang.String getEntityId() { - java.lang.Object ref = entityId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - entityId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The ID for the entity, if any.
-     * 
- * - * string entity_id = 4; - * - * @return The bytes for entityId. - */ - public com.google.protobuf.ByteString getEntityIdBytes() { - java.lang.Object ref = entityId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - entityId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The ID for the entity, if any.
-     * 
- * - * string entity_id = 4; - * - * @param value The entityId to set. - * @return This builder for chaining. - */ - public Builder setEntityId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - entityId_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The ID for the entity, if any.
-     * 
- * - * string entity_id = 4; - * - * @return This builder for chaining. - */ - public Builder clearEntityId() { - - entityId_ = getDefaultInstance().getEntityId(); - onChanged(); - return this; - } - /** - * - * - *
-     * The ID for the entity, if any.
-     * 
- * - * string entity_id = 4; - * - * @param value The bytes for entityId to set. - * @return This builder for chaining. - */ - public Builder setEntityIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - entityId_ = value; - onChanged(); - return this; - } - - private java.lang.Object email_ = ""; - /** - * - * - *
-     * The email address associated with the entity, if any.
-     * 
- * - * string email = 5; - * - * @return The email. - */ - public java.lang.String getEmail() { - java.lang.Object ref = email_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - email_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The email address associated with the entity, if any.
-     * 
- * - * string email = 5; - * - * @return The bytes for email. - */ - public com.google.protobuf.ByteString getEmailBytes() { - java.lang.Object ref = email_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - email_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The email address associated with the entity, if any.
-     * 
- * - * string email = 5; - * - * @param value The email to set. - * @return This builder for chaining. - */ - public Builder setEmail(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - email_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The email address associated with the entity, if any.
-     * 
- * - * string email = 5; - * - * @return This builder for chaining. - */ - public Builder clearEmail() { - - email_ = getDefaultInstance().getEmail(); - onChanged(); - return this; - } - /** - * - * - *
-     * The email address associated with the entity, if any.
-     * 
- * - * string email = 5; - * - * @param value The bytes for email to set. - * @return This builder for chaining. - */ - public Builder setEmailBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - email_ = value; - onChanged(); - return this; - } - - private java.lang.Object domain_ = ""; - /** - * - * - *
-     * The domain associated with the entity, if any.
-     * 
- * - * string domain = 6; - * - * @return The domain. - */ - public java.lang.String getDomain() { - java.lang.Object ref = domain_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - domain_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The domain associated with the entity, if any.
-     * 
- * - * string domain = 6; - * - * @return The bytes for domain. - */ - public com.google.protobuf.ByteString getDomainBytes() { - java.lang.Object ref = domain_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - domain_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The domain associated with the entity, if any.
-     * 
- * - * string domain = 6; - * - * @param value The domain to set. - * @return This builder for chaining. - */ - public Builder setDomain(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - domain_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The domain associated with the entity, if any.
-     * 
- * - * string domain = 6; - * - * @return This builder for chaining. - */ - public Builder clearDomain() { - - domain_ = getDefaultInstance().getDomain(); - onChanged(); - return this; - } - /** - * - * - *
-     * The domain associated with the entity, if any.
-     * 
- * - * string domain = 6; - * - * @param value The bytes for domain to set. - * @return This builder for chaining. - */ - public Builder setDomainBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - domain_ = value; - onChanged(); - return this; - } - - private com.google.storage.v2.ProjectTeam projectTeam_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ProjectTeam, - com.google.storage.v2.ProjectTeam.Builder, - com.google.storage.v2.ProjectTeamOrBuilder> - projectTeamBuilder_; - /** - * - * - *
-     * The project team associated with the entity, if any.
-     * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - * - * @return Whether the projectTeam field is set. - */ - public boolean hasProjectTeam() { - return projectTeamBuilder_ != null || projectTeam_ != null; - } - /** - * - * - *
-     * The project team associated with the entity, if any.
-     * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - * - * @return The projectTeam. - */ - public com.google.storage.v2.ProjectTeam getProjectTeam() { - if (projectTeamBuilder_ == null) { - return projectTeam_ == null - ? com.google.storage.v2.ProjectTeam.getDefaultInstance() - : projectTeam_; - } else { - return projectTeamBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The project team associated with the entity, if any.
-     * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - */ - public Builder setProjectTeam(com.google.storage.v2.ProjectTeam value) { - if (projectTeamBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - projectTeam_ = value; - onChanged(); - } else { - projectTeamBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * The project team associated with the entity, if any.
-     * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - */ - public Builder setProjectTeam(com.google.storage.v2.ProjectTeam.Builder builderForValue) { - if (projectTeamBuilder_ == null) { - projectTeam_ = builderForValue.build(); - onChanged(); - } else { - projectTeamBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * The project team associated with the entity, if any.
-     * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - */ - public Builder mergeProjectTeam(com.google.storage.v2.ProjectTeam value) { - if (projectTeamBuilder_ == null) { - if (projectTeam_ != null) { - projectTeam_ = - com.google.storage.v2.ProjectTeam.newBuilder(projectTeam_) - .mergeFrom(value) - .buildPartial(); - } else { - projectTeam_ = value; - } - onChanged(); - } else { - projectTeamBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * The project team associated with the entity, if any.
-     * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - */ - public Builder clearProjectTeam() { - if (projectTeamBuilder_ == null) { - projectTeam_ = null; - onChanged(); - } else { - projectTeam_ = null; - projectTeamBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * The project team associated with the entity, if any.
-     * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - */ - public com.google.storage.v2.ProjectTeam.Builder getProjectTeamBuilder() { - - onChanged(); - return getProjectTeamFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The project team associated with the entity, if any.
-     * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - */ - public com.google.storage.v2.ProjectTeamOrBuilder getProjectTeamOrBuilder() { - if (projectTeamBuilder_ != null) { - return projectTeamBuilder_.getMessageOrBuilder(); - } else { - return projectTeam_ == null - ? com.google.storage.v2.ProjectTeam.getDefaultInstance() - : projectTeam_; - } - } - /** - * - * - *
-     * The project team associated with the entity, if any.
-     * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ProjectTeam, - com.google.storage.v2.ProjectTeam.Builder, - com.google.storage.v2.ProjectTeamOrBuilder> - getProjectTeamFieldBuilder() { - if (projectTeamBuilder_ == null) { - projectTeamBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ProjectTeam, - com.google.storage.v2.ProjectTeam.Builder, - com.google.storage.v2.ProjectTeamOrBuilder>( - getProjectTeam(), getParentForChildren(), isClean()); - projectTeam_ = null; - } - return projectTeamBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.ObjectAccessControl) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.ObjectAccessControl) - private static final com.google.storage.v2.ObjectAccessControl DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.ObjectAccessControl(); - } - - public static com.google.storage.v2.ObjectAccessControl getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ObjectAccessControl parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ObjectAccessControl(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.ObjectAccessControl getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectAccessControlOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectAccessControlOrBuilder.java deleted file mode 100644 index a6a45c09cf..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectAccessControlOrBuilder.java +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface ObjectAccessControlOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.ObjectAccessControl) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The access permission for the entity.
-   * 
- * - * string role = 1; - * - * @return The role. - */ - java.lang.String getRole(); - /** - * - * - *
-   * The access permission for the entity.
-   * 
- * - * string role = 1; - * - * @return The bytes for role. - */ - com.google.protobuf.ByteString getRoleBytes(); - - /** - * - * - *
-   * The ID of the access-control entry.
-   * 
- * - * string id = 2; - * - * @return The id. - */ - java.lang.String getId(); - /** - * - * - *
-   * The ID of the access-control entry.
-   * 
- * - * string id = 2; - * - * @return The bytes for id. - */ - com.google.protobuf.ByteString getIdBytes(); - - /** - * - * - *
-   * The entity holding the permission, in one of the following forms:
-   * * `user-{userid}`
-   * * `user-{email}`
-   * * `group-{groupid}`
-   * * `group-{email}`
-   * * `domain-{domain}`
-   * * `project-{team-projectid}`
-   * * `allUsers`
-   * * `allAuthenticatedUsers`
-   * Examples:
-   * * The user `liz@example.com` would be `user-liz@example.com`.
-   * * The group `example@googlegroups.com` would be
-   * `group-example@googlegroups.com`.
-   * * All members of the Google Apps for Business domain `example.com` would be
-   * `domain-example.com`.
-   * 
- * - * string entity = 3; - * - * @return The entity. - */ - java.lang.String getEntity(); - /** - * - * - *
-   * The entity holding the permission, in one of the following forms:
-   * * `user-{userid}`
-   * * `user-{email}`
-   * * `group-{groupid}`
-   * * `group-{email}`
-   * * `domain-{domain}`
-   * * `project-{team-projectid}`
-   * * `allUsers`
-   * * `allAuthenticatedUsers`
-   * Examples:
-   * * The user `liz@example.com` would be `user-liz@example.com`.
-   * * The group `example@googlegroups.com` would be
-   * `group-example@googlegroups.com`.
-   * * All members of the Google Apps for Business domain `example.com` would be
-   * `domain-example.com`.
-   * 
- * - * string entity = 3; - * - * @return The bytes for entity. - */ - com.google.protobuf.ByteString getEntityBytes(); - - /** - * - * - *
-   * The ID for the entity, if any.
-   * 
- * - * string entity_id = 4; - * - * @return The entityId. - */ - java.lang.String getEntityId(); - /** - * - * - *
-   * The ID for the entity, if any.
-   * 
- * - * string entity_id = 4; - * - * @return The bytes for entityId. - */ - com.google.protobuf.ByteString getEntityIdBytes(); - - /** - * - * - *
-   * The email address associated with the entity, if any.
-   * 
- * - * string email = 5; - * - * @return The email. - */ - java.lang.String getEmail(); - /** - * - * - *
-   * The email address associated with the entity, if any.
-   * 
- * - * string email = 5; - * - * @return The bytes for email. - */ - com.google.protobuf.ByteString getEmailBytes(); - - /** - * - * - *
-   * The domain associated with the entity, if any.
-   * 
- * - * string domain = 6; - * - * @return The domain. - */ - java.lang.String getDomain(); - /** - * - * - *
-   * The domain associated with the entity, if any.
-   * 
- * - * string domain = 6; - * - * @return The bytes for domain. - */ - com.google.protobuf.ByteString getDomainBytes(); - - /** - * - * - *
-   * The project team associated with the entity, if any.
-   * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - * - * @return Whether the projectTeam field is set. - */ - boolean hasProjectTeam(); - /** - * - * - *
-   * The project team associated with the entity, if any.
-   * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - * - * @return The projectTeam. - */ - com.google.storage.v2.ProjectTeam getProjectTeam(); - /** - * - * - *
-   * The project team associated with the entity, if any.
-   * 
- * - * .google.storage.v2.ProjectTeam project_team = 7; - */ - com.google.storage.v2.ProjectTeamOrBuilder getProjectTeamOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectChecksums.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectChecksums.java deleted file mode 100644 index b72dd842fe..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectChecksums.java +++ /dev/null @@ -1,725 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Message used for storing full (not subrange) object checksums.
- * 
- * - * Protobuf type {@code google.storage.v2.ObjectChecksums} - */ -public final class ObjectChecksums extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.ObjectChecksums) - ObjectChecksumsOrBuilder { - private static final long serialVersionUID = 0L; - // Use ObjectChecksums.newBuilder() to construct. - private ObjectChecksums(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ObjectChecksums() { - md5Hash_ = com.google.protobuf.ByteString.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ObjectChecksums(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ObjectChecksums( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 13: - { - bitField0_ |= 0x00000001; - crc32C_ = input.readFixed32(); - break; - } - case 18: - { - md5Hash_ = input.readBytes(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ObjectChecksums_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ObjectChecksums_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ObjectChecksums.class, - com.google.storage.v2.ObjectChecksums.Builder.class); - } - - private int bitField0_; - public static final int CRC32C_FIELD_NUMBER = 1; - private int crc32C_; - /** - * - * - *
-   * CRC32C digest of the object data. Computed by the Cloud Storage service for
-   * all written objects.
-   * If set in an WriteObjectRequest, service will validate that the stored
-   * object matches this checksum.
-   * 
- * - * optional fixed32 crc32c = 1; - * - * @return Whether the crc32c field is set. - */ - @java.lang.Override - public boolean hasCrc32C() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-   * CRC32C digest of the object data. Computed by the Cloud Storage service for
-   * all written objects.
-   * If set in an WriteObjectRequest, service will validate that the stored
-   * object matches this checksum.
-   * 
- * - * optional fixed32 crc32c = 1; - * - * @return The crc32c. - */ - @java.lang.Override - public int getCrc32C() { - return crc32C_; - } - - public static final int MD5_HASH_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString md5Hash_; - /** - * - * - *
-   * 128 bit MD5 hash of the object data.
-   * For more information about using the MD5 hash, see
-   * [https://cloud.google.com/storage/docs/hashes-etags#json-api][Hashes and
-   * ETags: Best Practices].
-   * Not all objects will provide an MD5 hash. For example, composite objects
-   * provide only crc32c hashes.
-   * This value is equivalent to running `cat object.txt | openssl md5 -binary`
-   * 
- * - * bytes md5_hash = 2; - * - * @return The md5Hash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getMd5Hash() { - return md5Hash_; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) != 0)) { - output.writeFixed32(1, crc32C_); - } - if (!md5Hash_.isEmpty()) { - output.writeBytes(2, md5Hash_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeFixed32Size(1, crc32C_); - } - if (!md5Hash_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, md5Hash_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.ObjectChecksums)) { - return super.equals(obj); - } - com.google.storage.v2.ObjectChecksums other = (com.google.storage.v2.ObjectChecksums) obj; - - if (hasCrc32C() != other.hasCrc32C()) return false; - if (hasCrc32C()) { - if (getCrc32C() != other.getCrc32C()) return false; - } - if (!getMd5Hash().equals(other.getMd5Hash())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasCrc32C()) { - hash = (37 * hash) + CRC32C_FIELD_NUMBER; - hash = (53 * hash) + getCrc32C(); - } - hash = (37 * hash) + MD5_HASH_FIELD_NUMBER; - hash = (53 * hash) + getMd5Hash().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.ObjectChecksums parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ObjectChecksums parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ObjectChecksums parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ObjectChecksums parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ObjectChecksums parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ObjectChecksums parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ObjectChecksums parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ObjectChecksums parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.ObjectChecksums parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ObjectChecksums parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.ObjectChecksums parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ObjectChecksums parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.ObjectChecksums prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Message used for storing full (not subrange) object checksums.
-   * 
- * - * Protobuf type {@code google.storage.v2.ObjectChecksums} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.ObjectChecksums) - com.google.storage.v2.ObjectChecksumsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ObjectChecksums_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ObjectChecksums_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ObjectChecksums.class, - com.google.storage.v2.ObjectChecksums.Builder.class); - } - - // Construct using com.google.storage.v2.ObjectChecksums.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - crc32C_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); - md5Hash_ = com.google.protobuf.ByteString.EMPTY; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ObjectChecksums_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.ObjectChecksums getDefaultInstanceForType() { - return com.google.storage.v2.ObjectChecksums.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.ObjectChecksums build() { - com.google.storage.v2.ObjectChecksums result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.ObjectChecksums buildPartial() { - com.google.storage.v2.ObjectChecksums result = - new com.google.storage.v2.ObjectChecksums(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.crc32C_ = crc32C_; - to_bitField0_ |= 0x00000001; - } - result.md5Hash_ = md5Hash_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.ObjectChecksums) { - return mergeFrom((com.google.storage.v2.ObjectChecksums) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.ObjectChecksums other) { - if (other == com.google.storage.v2.ObjectChecksums.getDefaultInstance()) return this; - if (other.hasCrc32C()) { - setCrc32C(other.getCrc32C()); - } - if (other.getMd5Hash() != com.google.protobuf.ByteString.EMPTY) { - setMd5Hash(other.getMd5Hash()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.ObjectChecksums parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.ObjectChecksums) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private int crc32C_; - /** - * - * - *
-     * CRC32C digest of the object data. Computed by the Cloud Storage service for
-     * all written objects.
-     * If set in an WriteObjectRequest, service will validate that the stored
-     * object matches this checksum.
-     * 
- * - * optional fixed32 crc32c = 1; - * - * @return Whether the crc32c field is set. - */ - @java.lang.Override - public boolean hasCrc32C() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-     * CRC32C digest of the object data. Computed by the Cloud Storage service for
-     * all written objects.
-     * If set in an WriteObjectRequest, service will validate that the stored
-     * object matches this checksum.
-     * 
- * - * optional fixed32 crc32c = 1; - * - * @return The crc32c. - */ - @java.lang.Override - public int getCrc32C() { - return crc32C_; - } - /** - * - * - *
-     * CRC32C digest of the object data. Computed by the Cloud Storage service for
-     * all written objects.
-     * If set in an WriteObjectRequest, service will validate that the stored
-     * object matches this checksum.
-     * 
- * - * optional fixed32 crc32c = 1; - * - * @param value The crc32c to set. - * @return This builder for chaining. - */ - public Builder setCrc32C(int value) { - bitField0_ |= 0x00000001; - crc32C_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * CRC32C digest of the object data. Computed by the Cloud Storage service for
-     * all written objects.
-     * If set in an WriteObjectRequest, service will validate that the stored
-     * object matches this checksum.
-     * 
- * - * optional fixed32 crc32c = 1; - * - * @return This builder for chaining. - */ - public Builder clearCrc32C() { - bitField0_ = (bitField0_ & ~0x00000001); - crc32C_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString md5Hash_ = com.google.protobuf.ByteString.EMPTY; - /** - * - * - *
-     * 128 bit MD5 hash of the object data.
-     * For more information about using the MD5 hash, see
-     * [https://cloud.google.com/storage/docs/hashes-etags#json-api][Hashes and
-     * ETags: Best Practices].
-     * Not all objects will provide an MD5 hash. For example, composite objects
-     * provide only crc32c hashes.
-     * This value is equivalent to running `cat object.txt | openssl md5 -binary`
-     * 
- * - * bytes md5_hash = 2; - * - * @return The md5Hash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getMd5Hash() { - return md5Hash_; - } - /** - * - * - *
-     * 128 bit MD5 hash of the object data.
-     * For more information about using the MD5 hash, see
-     * [https://cloud.google.com/storage/docs/hashes-etags#json-api][Hashes and
-     * ETags: Best Practices].
-     * Not all objects will provide an MD5 hash. For example, composite objects
-     * provide only crc32c hashes.
-     * This value is equivalent to running `cat object.txt | openssl md5 -binary`
-     * 
- * - * bytes md5_hash = 2; - * - * @param value The md5Hash to set. - * @return This builder for chaining. - */ - public Builder setMd5Hash(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - md5Hash_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * 128 bit MD5 hash of the object data.
-     * For more information about using the MD5 hash, see
-     * [https://cloud.google.com/storage/docs/hashes-etags#json-api][Hashes and
-     * ETags: Best Practices].
-     * Not all objects will provide an MD5 hash. For example, composite objects
-     * provide only crc32c hashes.
-     * This value is equivalent to running `cat object.txt | openssl md5 -binary`
-     * 
- * - * bytes md5_hash = 2; - * - * @return This builder for chaining. - */ - public Builder clearMd5Hash() { - - md5Hash_ = getDefaultInstance().getMd5Hash(); - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.ObjectChecksums) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.ObjectChecksums) - private static final com.google.storage.v2.ObjectChecksums DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.ObjectChecksums(); - } - - public static com.google.storage.v2.ObjectChecksums getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ObjectChecksums parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ObjectChecksums(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.ObjectChecksums getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectChecksumsOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectChecksumsOrBuilder.java deleted file mode 100644 index f094b2b6f9..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectChecksumsOrBuilder.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface ObjectChecksumsOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.ObjectChecksums) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * CRC32C digest of the object data. Computed by the Cloud Storage service for
-   * all written objects.
-   * If set in an WriteObjectRequest, service will validate that the stored
-   * object matches this checksum.
-   * 
- * - * optional fixed32 crc32c = 1; - * - * @return Whether the crc32c field is set. - */ - boolean hasCrc32C(); - /** - * - * - *
-   * CRC32C digest of the object data. Computed by the Cloud Storage service for
-   * all written objects.
-   * If set in an WriteObjectRequest, service will validate that the stored
-   * object matches this checksum.
-   * 
- * - * optional fixed32 crc32c = 1; - * - * @return The crc32c. - */ - int getCrc32C(); - - /** - * - * - *
-   * 128 bit MD5 hash of the object data.
-   * For more information about using the MD5 hash, see
-   * [https://cloud.google.com/storage/docs/hashes-etags#json-api][Hashes and
-   * ETags: Best Practices].
-   * Not all objects will provide an MD5 hash. For example, composite objects
-   * provide only crc32c hashes.
-   * This value is equivalent to running `cat object.txt | openssl md5 -binary`
-   * 
- * - * bytes md5_hash = 2; - * - * @return The md5Hash. - */ - com.google.protobuf.ByteString getMd5Hash(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectOrBuilder.java deleted file mode 100644 index 7f6ab46a6d..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectOrBuilder.java +++ /dev/null @@ -1,923 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface ObjectOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.Object) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Immutable. The name of this object. Nearly any sequence of unicode characters is
-   * valid. See
-   * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
-   * Example: `test.txt`
-   * The `name` field by itself does not uniquely identify a Cloud Storage
-   * object. A Cloud Storage object is uniquely identified by the tuple of
-   * (bucket, object, generation).
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-   * Immutable. The name of this object. Nearly any sequence of unicode characters is
-   * valid. See
-   * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
-   * Example: `test.txt`
-   * The `name` field by itself does not uniquely identify a Cloud Storage
-   * object. A Cloud Storage object is uniquely identified by the tuple of
-   * (bucket, object, generation).
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-   * Immutable. The name of the bucket containing this object.
-   * 
- * - * - * string bucket = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @return The bucket. - */ - java.lang.String getBucket(); - /** - * - * - *
-   * Immutable. The name of the bucket containing this object.
-   * 
- * - * - * string bucket = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for bucket. - */ - com.google.protobuf.ByteString getBucketBytes(); - - /** - * - * - *
-   * Immutable. The content generation of this object. Used for object versioning.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * int64 generation = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The generation. - */ - long getGeneration(); - - /** - * - * - *
-   * Output only. The version of the metadata for this generation of this object. Used for
-   * preconditions and for detecting changes in metadata. A metageneration
-   * number is only meaningful in the context of a particular generation of a
-   * particular object.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * int64 metageneration = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The metageneration. - */ - long getMetageneration(); - - /** - * - * - *
-   * Storage class of the object.
-   * 
- * - * string storage_class = 5; - * - * @return The storageClass. - */ - java.lang.String getStorageClass(); - /** - * - * - *
-   * Storage class of the object.
-   * 
- * - * string storage_class = 5; - * - * @return The bytes for storageClass. - */ - com.google.protobuf.ByteString getStorageClassBytes(); - - /** - * - * - *
-   * Output only. Content-Length of the object data in bytes, matching
-   * [https://tools.ietf.org/html/rfc7230#section-3.3.2][RFC 7230 §3.3.2].
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * int64 size = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The size. - */ - long getSize(); - - /** - * - * - *
-   * Content-Encoding of the object data, matching
-   * [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2]
-   * 
- * - * string content_encoding = 7; - * - * @return The contentEncoding. - */ - java.lang.String getContentEncoding(); - /** - * - * - *
-   * Content-Encoding of the object data, matching
-   * [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2]
-   * 
- * - * string content_encoding = 7; - * - * @return The bytes for contentEncoding. - */ - com.google.protobuf.ByteString getContentEncodingBytes(); - - /** - * - * - *
-   * Content-Disposition of the object data, matching
-   * [https://tools.ietf.org/html/rfc6266][RFC 6266].
-   * 
- * - * string content_disposition = 8; - * - * @return The contentDisposition. - */ - java.lang.String getContentDisposition(); - /** - * - * - *
-   * Content-Disposition of the object data, matching
-   * [https://tools.ietf.org/html/rfc6266][RFC 6266].
-   * 
- * - * string content_disposition = 8; - * - * @return The bytes for contentDisposition. - */ - com.google.protobuf.ByteString getContentDispositionBytes(); - - /** - * - * - *
-   * Cache-Control directive for the object data, matching
-   * [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2].
-   * If omitted, and the object is accessible to all anonymous users, the
-   * default will be `public, max-age=3600`.
-   * 
- * - * string cache_control = 9; - * - * @return The cacheControl. - */ - java.lang.String getCacheControl(); - /** - * - * - *
-   * Cache-Control directive for the object data, matching
-   * [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2].
-   * If omitted, and the object is accessible to all anonymous users, the
-   * default will be `public, max-age=3600`.
-   * 
- * - * string cache_control = 9; - * - * @return The bytes for cacheControl. - */ - com.google.protobuf.ByteString getCacheControlBytes(); - - /** - * - * - *
-   * Access controls on the object.
-   * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-   * bucket, requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - java.util.List getAclList(); - /** - * - * - *
-   * Access controls on the object.
-   * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-   * bucket, requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - com.google.storage.v2.ObjectAccessControl getAcl(int index); - /** - * - * - *
-   * Access controls on the object.
-   * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-   * bucket, requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - int getAclCount(); - /** - * - * - *
-   * Access controls on the object.
-   * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-   * bucket, requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - java.util.List - getAclOrBuilderList(); - /** - * - * - *
-   * Access controls on the object.
-   * If iamConfig.uniformBucketLevelAccess is enabled on the parent
-   * bucket, requests to set, read, or modify acl is an error.
-   * 
- * - * repeated .google.storage.v2.ObjectAccessControl acl = 10; - */ - com.google.storage.v2.ObjectAccessControlOrBuilder getAclOrBuilder(int index); - - /** - * - * - *
-   * Content-Language of the object data, matching
-   * [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2].
-   * 
- * - * string content_language = 11; - * - * @return The contentLanguage. - */ - java.lang.String getContentLanguage(); - /** - * - * - *
-   * Content-Language of the object data, matching
-   * [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2].
-   * 
- * - * string content_language = 11; - * - * @return The bytes for contentLanguage. - */ - com.google.protobuf.ByteString getContentLanguageBytes(); - - /** - * - * - *
-   * Output only. The deletion time of the object. Will be returned if and only if this
-   * version of the object has been deleted.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the deleteTime field is set. - */ - boolean hasDeleteTime(); - /** - * - * - *
-   * Output only. The deletion time of the object. Will be returned if and only if this
-   * version of the object has been deleted.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The deleteTime. - */ - com.google.protobuf.Timestamp getDeleteTime(); - /** - * - * - *
-   * Output only. The deletion time of the object. Will be returned if and only if this
-   * version of the object has been deleted.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder(); - - /** - * - * - *
-   * Content-Type of the object data, matching
-   * [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5].
-   * If an object is stored without a Content-Type, it is served as
-   * `application/octet-stream`.
-   * 
- * - * string content_type = 13; - * - * @return The contentType. - */ - java.lang.String getContentType(); - /** - * - * - *
-   * Content-Type of the object data, matching
-   * [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5].
-   * If an object is stored without a Content-Type, it is served as
-   * `application/octet-stream`.
-   * 
- * - * string content_type = 13; - * - * @return The bytes for contentType. - */ - com.google.protobuf.ByteString getContentTypeBytes(); - - /** - * - * - *
-   * Output only. The creation time of the object.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the createTime field is set. - */ - boolean hasCreateTime(); - /** - * - * - *
-   * Output only. The creation time of the object.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The createTime. - */ - com.google.protobuf.Timestamp getCreateTime(); - /** - * - * - *
-   * Output only. The creation time of the object.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); - - /** - * - * - *
-   * Output only. Number of underlying components that make up this object. Components are
-   * accumulated by compose operations.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * int32 component_count = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The componentCount. - */ - int getComponentCount(); - - /** - * - * - *
-   * Output only. Hashes for the data part of this object.
-   * 
- * - * - * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the checksums field is set. - */ - boolean hasChecksums(); - /** - * - * - *
-   * Output only. Hashes for the data part of this object.
-   * 
- * - * - * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The checksums. - */ - com.google.storage.v2.ObjectChecksums getChecksums(); - /** - * - * - *
-   * Output only. Hashes for the data part of this object.
-   * 
- * - * - * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - com.google.storage.v2.ObjectChecksumsOrBuilder getChecksumsOrBuilder(); - - /** - * - * - *
-   * Output only. The modification time of the object metadata.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the updateTime field is set. - */ - boolean hasUpdateTime(); - /** - * - * - *
-   * Output only. The modification time of the object metadata.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The updateTime. - */ - com.google.protobuf.Timestamp getUpdateTime(); - /** - * - * - *
-   * Output only. The modification time of the object metadata.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); - - /** - * - * - *
-   * Cloud KMS Key used to encrypt this object, if the object is encrypted by
-   * such a key.
-   * 
- * - * string kms_key = 18 [(.google.api.resource_reference) = { ... } - * - * @return The kmsKey. - */ - java.lang.String getKmsKey(); - /** - * - * - *
-   * Cloud KMS Key used to encrypt this object, if the object is encrypted by
-   * such a key.
-   * 
- * - * string kms_key = 18 [(.google.api.resource_reference) = { ... } - * - * @return The bytes for kmsKey. - */ - com.google.protobuf.ByteString getKmsKeyBytes(); - - /** - * - * - *
-   * Output only. The time at which the object's storage class was last changed. When the
-   * object is initially created, it will be set to time_created.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * - * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the updateStorageClassTime field is set. - */ - boolean hasUpdateStorageClassTime(); - /** - * - * - *
-   * Output only. The time at which the object's storage class was last changed. When the
-   * object is initially created, it will be set to time_created.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * - * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The updateStorageClassTime. - */ - com.google.protobuf.Timestamp getUpdateStorageClassTime(); - /** - * - * - *
-   * Output only. The time at which the object's storage class was last changed. When the
-   * object is initially created, it will be set to time_created.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * - * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - com.google.protobuf.TimestampOrBuilder getUpdateStorageClassTimeOrBuilder(); - - /** - * - * - *
-   * Whether an object is under temporary hold. While this flag is set to true,
-   * the object is protected against deletion and overwrites.  A common use case
-   * of this flag is regulatory investigations where objects need to be retained
-   * while the investigation is ongoing. Note that unlike event-based hold,
-   * temporary hold does not impact retention expiration time of an object.
-   * 
- * - * bool temporary_hold = 20; - * - * @return The temporaryHold. - */ - boolean getTemporaryHold(); - - /** - * - * - *
-   * A server-determined value that specifies the earliest time that the
-   * object's retention period expires. This value is in
-   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-   * Note 1: This field is not provided for objects with an active event-based
-   * hold, since retention expiration is unknown until the hold is removed.
-   * Note 2: This value can be provided even when temporary hold is set (so that
-   * the user can reason about policy without having to first unset the
-   * temporary hold).
-   * 
- * - * .google.protobuf.Timestamp retention_expire_time = 21; - * - * @return Whether the retentionExpireTime field is set. - */ - boolean hasRetentionExpireTime(); - /** - * - * - *
-   * A server-determined value that specifies the earliest time that the
-   * object's retention period expires. This value is in
-   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-   * Note 1: This field is not provided for objects with an active event-based
-   * hold, since retention expiration is unknown until the hold is removed.
-   * Note 2: This value can be provided even when temporary hold is set (so that
-   * the user can reason about policy without having to first unset the
-   * temporary hold).
-   * 
- * - * .google.protobuf.Timestamp retention_expire_time = 21; - * - * @return The retentionExpireTime. - */ - com.google.protobuf.Timestamp getRetentionExpireTime(); - /** - * - * - *
-   * A server-determined value that specifies the earliest time that the
-   * object's retention period expires. This value is in
-   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
-   * Note 1: This field is not provided for objects with an active event-based
-   * hold, since retention expiration is unknown until the hold is removed.
-   * Note 2: This value can be provided even when temporary hold is set (so that
-   * the user can reason about policy without having to first unset the
-   * temporary hold).
-   * 
- * - * .google.protobuf.Timestamp retention_expire_time = 21; - */ - com.google.protobuf.TimestampOrBuilder getRetentionExpireTimeOrBuilder(); - - /** - * - * - *
-   * User-provided metadata, in key/value pairs.
-   * 
- * - * map<string, string> metadata = 22; - */ - int getMetadataCount(); - /** - * - * - *
-   * User-provided metadata, in key/value pairs.
-   * 
- * - * map<string, string> metadata = 22; - */ - boolean containsMetadata(java.lang.String key); - /** Use {@link #getMetadataMap()} instead. */ - @java.lang.Deprecated - java.util.Map getMetadata(); - /** - * - * - *
-   * User-provided metadata, in key/value pairs.
-   * 
- * - * map<string, string> metadata = 22; - */ - java.util.Map getMetadataMap(); - /** - * - * - *
-   * User-provided metadata, in key/value pairs.
-   * 
- * - * map<string, string> metadata = 22; - */ - java.lang.String getMetadataOrDefault(java.lang.String key, java.lang.String defaultValue); - /** - * - * - *
-   * User-provided metadata, in key/value pairs.
-   * 
- * - * map<string, string> metadata = 22; - */ - java.lang.String getMetadataOrThrow(java.lang.String key); - - /** - * - * - *
-   * Whether an object is under event-based hold.
-   * An event-based hold is a way to force the retention of an object until
-   * after some event occurs. Once the hold is released by explicitly setting
-   * this field to false, the object will become subject to any bucket-level
-   * retention policy, except that the retention duration will be calculated
-   * from the time the event based hold was lifted, rather than the time the
-   * object was created.
-   * In a WriteObject request, not setting this field implies that the value
-   * should be taken from the parent bucket's "default_event_based_hold" field.
-   * In a response, this field will always be set to true or false.
-   * 
- * - * optional bool event_based_hold = 23; - * - * @return Whether the eventBasedHold field is set. - */ - boolean hasEventBasedHold(); - /** - * - * - *
-   * Whether an object is under event-based hold.
-   * An event-based hold is a way to force the retention of an object until
-   * after some event occurs. Once the hold is released by explicitly setting
-   * this field to false, the object will become subject to any bucket-level
-   * retention policy, except that the retention duration will be calculated
-   * from the time the event based hold was lifted, rather than the time the
-   * object was created.
-   * In a WriteObject request, not setting this field implies that the value
-   * should be taken from the parent bucket's "default_event_based_hold" field.
-   * In a response, this field will always be set to true or false.
-   * 
- * - * optional bool event_based_hold = 23; - * - * @return The eventBasedHold. - */ - boolean getEventBasedHold(); - - /** - * - * - *
-   * Output only. The owner of the object. This will always be the uploader of the object.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return Whether the owner field is set. - */ - boolean hasOwner(); - /** - * - * - *
-   * Output only. The owner of the object. This will always be the uploader of the object.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The owner. - */ - com.google.storage.v2.Owner getOwner(); - /** - * - * - *
-   * Output only. The owner of the object. This will always be the uploader of the object.
-   * Attempting to set or update this field will result in a
-   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
-   * 
- * - * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - com.google.storage.v2.OwnerOrBuilder getOwnerOrBuilder(); - - /** - * - * - *
-   * Metadata of Customer-Supplied Encryption Key, if the object is encrypted by
-   * such a key.
-   * 
- * - * .google.storage.v2.CustomerEncryption customer_encryption = 25; - * - * @return Whether the customerEncryption field is set. - */ - boolean hasCustomerEncryption(); - /** - * - * - *
-   * Metadata of Customer-Supplied Encryption Key, if the object is encrypted by
-   * such a key.
-   * 
- * - * .google.storage.v2.CustomerEncryption customer_encryption = 25; - * - * @return The customerEncryption. - */ - com.google.storage.v2.CustomerEncryption getCustomerEncryption(); - /** - * - * - *
-   * Metadata of Customer-Supplied Encryption Key, if the object is encrypted by
-   * such a key.
-   * 
- * - * .google.storage.v2.CustomerEncryption customer_encryption = 25; - */ - com.google.storage.v2.CustomerEncryptionOrBuilder getCustomerEncryptionOrBuilder(); - - /** - * - * - *
-   * A user-specified timestamp set on an object.
-   * 
- * - * .google.protobuf.Timestamp custom_time = 26; - * - * @return Whether the customTime field is set. - */ - boolean hasCustomTime(); - /** - * - * - *
-   * A user-specified timestamp set on an object.
-   * 
- * - * .google.protobuf.Timestamp custom_time = 26; - * - * @return The customTime. - */ - com.google.protobuf.Timestamp getCustomTime(); - /** - * - * - *
-   * A user-specified timestamp set on an object.
-   * 
- * - * .google.protobuf.Timestamp custom_time = 26; - */ - com.google.protobuf.TimestampOrBuilder getCustomTimeOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Owner.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Owner.java deleted file mode 100644 index c87862b6ed..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Owner.java +++ /dev/null @@ -1,805 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * The owner of a specific resource.
- * 
- * - * Protobuf type {@code google.storage.v2.Owner} - */ -public final class Owner extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.Owner) - OwnerOrBuilder { - private static final long serialVersionUID = 0L; - // Use Owner.newBuilder() to construct. - private Owner(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Owner() { - entity_ = ""; - entityId_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Owner(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Owner( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - entity_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - entityId_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto.internal_static_google_storage_v2_Owner_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Owner_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Owner.class, com.google.storage.v2.Owner.Builder.class); - } - - public static final int ENTITY_FIELD_NUMBER = 1; - private volatile java.lang.Object entity_; - /** - * - * - *
-   * The entity, in the form `user-`*userId*.
-   * 
- * - * string entity = 1; - * - * @return The entity. - */ - @java.lang.Override - public java.lang.String getEntity() { - java.lang.Object ref = entity_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - entity_ = s; - return s; - } - } - /** - * - * - *
-   * The entity, in the form `user-`*userId*.
-   * 
- * - * string entity = 1; - * - * @return The bytes for entity. - */ - @java.lang.Override - public com.google.protobuf.ByteString getEntityBytes() { - java.lang.Object ref = entity_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - entity_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ENTITY_ID_FIELD_NUMBER = 2; - private volatile java.lang.Object entityId_; - /** - * - * - *
-   * The ID for the entity.
-   * 
- * - * string entity_id = 2; - * - * @return The entityId. - */ - @java.lang.Override - public java.lang.String getEntityId() { - java.lang.Object ref = entityId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - entityId_ = s; - return s; - } - } - /** - * - * - *
-   * The ID for the entity.
-   * 
- * - * string entity_id = 2; - * - * @return The bytes for entityId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getEntityIdBytes() { - java.lang.Object ref = entityId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - entityId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entity_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, entity_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entityId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, entityId_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entity_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, entity_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entityId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, entityId_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.Owner)) { - return super.equals(obj); - } - com.google.storage.v2.Owner other = (com.google.storage.v2.Owner) obj; - - if (!getEntity().equals(other.getEntity())) return false; - if (!getEntityId().equals(other.getEntityId())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ENTITY_FIELD_NUMBER; - hash = (53 * hash) + getEntity().hashCode(); - hash = (37 * hash) + ENTITY_ID_FIELD_NUMBER; - hash = (53 * hash) + getEntityId().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.Owner parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Owner parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Owner parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Owner parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Owner parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.Owner parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.Owner parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Owner parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Owner parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Owner parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.Owner parseFrom(com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.Owner parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.Owner prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * The owner of a specific resource.
-   * 
- * - * Protobuf type {@code google.storage.v2.Owner} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.Owner) - com.google.storage.v2.OwnerOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto.internal_static_google_storage_v2_Owner_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Owner_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.Owner.class, com.google.storage.v2.Owner.Builder.class); - } - - // Construct using com.google.storage.v2.Owner.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - entity_ = ""; - - entityId_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto.internal_static_google_storage_v2_Owner_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.Owner getDefaultInstanceForType() { - return com.google.storage.v2.Owner.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.Owner build() { - com.google.storage.v2.Owner result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.Owner buildPartial() { - com.google.storage.v2.Owner result = new com.google.storage.v2.Owner(this); - result.entity_ = entity_; - result.entityId_ = entityId_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.Owner) { - return mergeFrom((com.google.storage.v2.Owner) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.Owner other) { - if (other == com.google.storage.v2.Owner.getDefaultInstance()) return this; - if (!other.getEntity().isEmpty()) { - entity_ = other.entity_; - onChanged(); - } - if (!other.getEntityId().isEmpty()) { - entityId_ = other.entityId_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.Owner parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.Owner) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object entity_ = ""; - /** - * - * - *
-     * The entity, in the form `user-`*userId*.
-     * 
- * - * string entity = 1; - * - * @return The entity. - */ - public java.lang.String getEntity() { - java.lang.Object ref = entity_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - entity_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The entity, in the form `user-`*userId*.
-     * 
- * - * string entity = 1; - * - * @return The bytes for entity. - */ - public com.google.protobuf.ByteString getEntityBytes() { - java.lang.Object ref = entity_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - entity_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The entity, in the form `user-`*userId*.
-     * 
- * - * string entity = 1; - * - * @param value The entity to set. - * @return This builder for chaining. - */ - public Builder setEntity(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - entity_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The entity, in the form `user-`*userId*.
-     * 
- * - * string entity = 1; - * - * @return This builder for chaining. - */ - public Builder clearEntity() { - - entity_ = getDefaultInstance().getEntity(); - onChanged(); - return this; - } - /** - * - * - *
-     * The entity, in the form `user-`*userId*.
-     * 
- * - * string entity = 1; - * - * @param value The bytes for entity to set. - * @return This builder for chaining. - */ - public Builder setEntityBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - entity_ = value; - onChanged(); - return this; - } - - private java.lang.Object entityId_ = ""; - /** - * - * - *
-     * The ID for the entity.
-     * 
- * - * string entity_id = 2; - * - * @return The entityId. - */ - public java.lang.String getEntityId() { - java.lang.Object ref = entityId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - entityId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The ID for the entity.
-     * 
- * - * string entity_id = 2; - * - * @return The bytes for entityId. - */ - public com.google.protobuf.ByteString getEntityIdBytes() { - java.lang.Object ref = entityId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - entityId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The ID for the entity.
-     * 
- * - * string entity_id = 2; - * - * @param value The entityId to set. - * @return This builder for chaining. - */ - public Builder setEntityId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - entityId_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The ID for the entity.
-     * 
- * - * string entity_id = 2; - * - * @return This builder for chaining. - */ - public Builder clearEntityId() { - - entityId_ = getDefaultInstance().getEntityId(); - onChanged(); - return this; - } - /** - * - * - *
-     * The ID for the entity.
-     * 
- * - * string entity_id = 2; - * - * @param value The bytes for entityId to set. - * @return This builder for chaining. - */ - public Builder setEntityIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - entityId_ = value; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.Owner) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.Owner) - private static final com.google.storage.v2.Owner DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.Owner(); - } - - public static com.google.storage.v2.Owner getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Owner parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Owner(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.Owner getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/OwnerOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/OwnerOrBuilder.java deleted file mode 100644 index 4caffe13d6..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/OwnerOrBuilder.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface OwnerOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.Owner) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The entity, in the form `user-`*userId*.
-   * 
- * - * string entity = 1; - * - * @return The entity. - */ - java.lang.String getEntity(); - /** - * - * - *
-   * The entity, in the form `user-`*userId*.
-   * 
- * - * string entity = 1; - * - * @return The bytes for entity. - */ - com.google.protobuf.ByteString getEntityBytes(); - - /** - * - * - *
-   * The ID for the entity.
-   * 
- * - * string entity_id = 2; - * - * @return The entityId. - */ - java.lang.String getEntityId(); - /** - * - * - *
-   * The ID for the entity.
-   * 
- * - * string entity_id = 2; - * - * @return The bytes for entityId. - */ - com.google.protobuf.ByteString getEntityIdBytes(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/PredefinedBucketAcl.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/PredefinedBucketAcl.java deleted file mode 100644 index 91266895f5..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/PredefinedBucketAcl.java +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * A set of predefined, or "canned," ACLs that can be set on a
- * bucket instead of manually specifying a complete ACL.
- * 
- * - * Protobuf enum {@code google.storage.v2.PredefinedBucketAcl} - */ -public enum PredefinedBucketAcl implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-   * No predefined ACL.
-   * 
- * - * PREDEFINED_BUCKET_ACL_UNSPECIFIED = 0; - */ - PREDEFINED_BUCKET_ACL_UNSPECIFIED(0), - /** - * - * - *
-   * Project team owners get `OWNER` access, and
-   * `allAuthenticatedUsers` get `READER` access.
-   * 
- * - * BUCKET_ACL_AUTHENTICATED_READ = 1; - */ - BUCKET_ACL_AUTHENTICATED_READ(1), - /** - * - * - *
-   * Project team owners get `OWNER` access.
-   * 
- * - * BUCKET_ACL_PRIVATE = 2; - */ - BUCKET_ACL_PRIVATE(2), - /** - * - * - *
-   * Project team members get access according to their roles.
-   * 
- * - * BUCKET_ACL_PROJECT_PRIVATE = 3; - */ - BUCKET_ACL_PROJECT_PRIVATE(3), - /** - * - * - *
-   * Project team owners get `OWNER` access, and
-   * `allUsers` get `READER` access.
-   * 
- * - * BUCKET_ACL_PUBLIC_READ = 4; - */ - BUCKET_ACL_PUBLIC_READ(4), - /** - * - * - *
-   * Project team owners get `OWNER` access, and
-   * `allUsers` get `WRITER` access.
-   * 
- * - * BUCKET_ACL_PUBLIC_READ_WRITE = 5; - */ - BUCKET_ACL_PUBLIC_READ_WRITE(5), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-   * No predefined ACL.
-   * 
- * - * PREDEFINED_BUCKET_ACL_UNSPECIFIED = 0; - */ - public static final int PREDEFINED_BUCKET_ACL_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-   * Project team owners get `OWNER` access, and
-   * `allAuthenticatedUsers` get `READER` access.
-   * 
- * - * BUCKET_ACL_AUTHENTICATED_READ = 1; - */ - public static final int BUCKET_ACL_AUTHENTICATED_READ_VALUE = 1; - /** - * - * - *
-   * Project team owners get `OWNER` access.
-   * 
- * - * BUCKET_ACL_PRIVATE = 2; - */ - public static final int BUCKET_ACL_PRIVATE_VALUE = 2; - /** - * - * - *
-   * Project team members get access according to their roles.
-   * 
- * - * BUCKET_ACL_PROJECT_PRIVATE = 3; - */ - public static final int BUCKET_ACL_PROJECT_PRIVATE_VALUE = 3; - /** - * - * - *
-   * Project team owners get `OWNER` access, and
-   * `allUsers` get `READER` access.
-   * 
- * - * BUCKET_ACL_PUBLIC_READ = 4; - */ - public static final int BUCKET_ACL_PUBLIC_READ_VALUE = 4; - /** - * - * - *
-   * Project team owners get `OWNER` access, and
-   * `allUsers` get `WRITER` access.
-   * 
- * - * BUCKET_ACL_PUBLIC_READ_WRITE = 5; - */ - public static final int BUCKET_ACL_PUBLIC_READ_WRITE_VALUE = 5; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static PredefinedBucketAcl valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static PredefinedBucketAcl forNumber(int value) { - switch (value) { - case 0: - return PREDEFINED_BUCKET_ACL_UNSPECIFIED; - case 1: - return BUCKET_ACL_AUTHENTICATED_READ; - case 2: - return BUCKET_ACL_PRIVATE; - case 3: - return BUCKET_ACL_PROJECT_PRIVATE; - case 4: - return BUCKET_ACL_PUBLIC_READ; - case 5: - return BUCKET_ACL_PUBLIC_READ_WRITE; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public PredefinedBucketAcl findValueByNumber(int number) { - return PredefinedBucketAcl.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.storage.v2.StorageProto.getDescriptor().getEnumTypes().get(1); - } - - private static final PredefinedBucketAcl[] VALUES = values(); - - public static PredefinedBucketAcl valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private PredefinedBucketAcl(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.storage.v2.PredefinedBucketAcl) -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/PredefinedObjectAcl.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/PredefinedObjectAcl.java deleted file mode 100644 index a6991274a2..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/PredefinedObjectAcl.java +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Predefined or "canned" aliases for sets of specific object ACL entries.
- * 
- * - * Protobuf enum {@code google.storage.v2.PredefinedObjectAcl} - */ -public enum PredefinedObjectAcl implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-   * No predefined ACL.
-   * 
- * - * PREDEFINED_OBJECT_ACL_UNSPECIFIED = 0; - */ - PREDEFINED_OBJECT_ACL_UNSPECIFIED(0), - /** - * - * - *
-   * Object owner gets `OWNER` access, and
-   * `allAuthenticatedUsers` get `READER` access.
-   * 
- * - * OBJECT_ACL_AUTHENTICATED_READ = 1; - */ - OBJECT_ACL_AUTHENTICATED_READ(1), - /** - * - * - *
-   * Object owner gets `OWNER` access, and project team owners get
-   * `OWNER` access.
-   * 
- * - * OBJECT_ACL_BUCKET_OWNER_FULL_CONTROL = 2; - */ - OBJECT_ACL_BUCKET_OWNER_FULL_CONTROL(2), - /** - * - * - *
-   * Object owner gets `OWNER` access, and project team owners get
-   * `READER` access.
-   * 
- * - * OBJECT_ACL_BUCKET_OWNER_READ = 3; - */ - OBJECT_ACL_BUCKET_OWNER_READ(3), - /** - * - * - *
-   * Object owner gets `OWNER` access.
-   * 
- * - * OBJECT_ACL_PRIVATE = 4; - */ - OBJECT_ACL_PRIVATE(4), - /** - * - * - *
-   * Object owner gets `OWNER` access, and project team members get
-   * access according to their roles.
-   * 
- * - * OBJECT_ACL_PROJECT_PRIVATE = 5; - */ - OBJECT_ACL_PROJECT_PRIVATE(5), - /** - * - * - *
-   * Object owner gets `OWNER` access, and `allUsers`
-   * get `READER` access.
-   * 
- * - * OBJECT_ACL_PUBLIC_READ = 6; - */ - OBJECT_ACL_PUBLIC_READ(6), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-   * No predefined ACL.
-   * 
- * - * PREDEFINED_OBJECT_ACL_UNSPECIFIED = 0; - */ - public static final int PREDEFINED_OBJECT_ACL_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-   * Object owner gets `OWNER` access, and
-   * `allAuthenticatedUsers` get `READER` access.
-   * 
- * - * OBJECT_ACL_AUTHENTICATED_READ = 1; - */ - public static final int OBJECT_ACL_AUTHENTICATED_READ_VALUE = 1; - /** - * - * - *
-   * Object owner gets `OWNER` access, and project team owners get
-   * `OWNER` access.
-   * 
- * - * OBJECT_ACL_BUCKET_OWNER_FULL_CONTROL = 2; - */ - public static final int OBJECT_ACL_BUCKET_OWNER_FULL_CONTROL_VALUE = 2; - /** - * - * - *
-   * Object owner gets `OWNER` access, and project team owners get
-   * `READER` access.
-   * 
- * - * OBJECT_ACL_BUCKET_OWNER_READ = 3; - */ - public static final int OBJECT_ACL_BUCKET_OWNER_READ_VALUE = 3; - /** - * - * - *
-   * Object owner gets `OWNER` access.
-   * 
- * - * OBJECT_ACL_PRIVATE = 4; - */ - public static final int OBJECT_ACL_PRIVATE_VALUE = 4; - /** - * - * - *
-   * Object owner gets `OWNER` access, and project team members get
-   * access according to their roles.
-   * 
- * - * OBJECT_ACL_PROJECT_PRIVATE = 5; - */ - public static final int OBJECT_ACL_PROJECT_PRIVATE_VALUE = 5; - /** - * - * - *
-   * Object owner gets `OWNER` access, and `allUsers`
-   * get `READER` access.
-   * 
- * - * OBJECT_ACL_PUBLIC_READ = 6; - */ - public static final int OBJECT_ACL_PUBLIC_READ_VALUE = 6; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static PredefinedObjectAcl valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static PredefinedObjectAcl forNumber(int value) { - switch (value) { - case 0: - return PREDEFINED_OBJECT_ACL_UNSPECIFIED; - case 1: - return OBJECT_ACL_AUTHENTICATED_READ; - case 2: - return OBJECT_ACL_BUCKET_OWNER_FULL_CONTROL; - case 3: - return OBJECT_ACL_BUCKET_OWNER_READ; - case 4: - return OBJECT_ACL_PRIVATE; - case 5: - return OBJECT_ACL_PROJECT_PRIVATE; - case 6: - return OBJECT_ACL_PUBLIC_READ; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public PredefinedObjectAcl findValueByNumber(int number) { - return PredefinedObjectAcl.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.storage.v2.StorageProto.getDescriptor().getEnumTypes().get(0); - } - - private static final PredefinedObjectAcl[] VALUES = values(); - - public static PredefinedObjectAcl valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private PredefinedObjectAcl(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.storage.v2.PredefinedObjectAcl) -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ProjectName.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ProjectName.java deleted file mode 100644 index 09495c6219..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ProjectName.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.storage.v2; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class ProjectName implements ResourceName { - private static final PathTemplate PROJECT = - PathTemplate.createWithoutUrlEncoding("projects/{project}"); - private volatile Map fieldValuesMap; - private final String project; - - @Deprecated - protected ProjectName() { - project = null; - } - - private ProjectName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - } - - public String getProject() { - return project; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static ProjectName of(String project) { - return newBuilder().setProject(project).build(); - } - - public static String format(String project) { - return newBuilder().setProject(project).build().toString(); - } - - public static ProjectName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PROJECT.validatedMatch( - formattedString, "ProjectName.parse: formattedString not in valid format"); - return of(matchMap.get("project")); - } - - public static List parseList(List formattedStrings) { - List list = new ArrayList<>(formattedStrings.size()); - for (String formattedString : formattedStrings) { - list.add(parse(formattedString)); - } - return list; - } - - public static List toStringList(List values) { - List list = new ArrayList<>(values.size()); - for (ProjectName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PROJECT.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { - fieldMapBuilder.put("project", project); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PROJECT.instantiate("project", project); - } - - @Override - public boolean equals(java.lang.Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - ProjectName that = ((ProjectName) o); - return Objects.equals(this.project, that.project); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - return h; - } - - /** Builder for projects/{project}. */ - public static class Builder { - private String project; - - protected Builder() {} - - public String getProject() { - return project; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - private Builder(ProjectName projectName) { - this.project = projectName.project; - } - - public ProjectName build() { - return new ProjectName(this); - } - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ProjectTeam.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ProjectTeam.java deleted file mode 100644 index 6d9d306516..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ProjectTeam.java +++ /dev/null @@ -1,810 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Represents the Viewers, Editors, or Owners of a given project.
- * 
- * - * Protobuf type {@code google.storage.v2.ProjectTeam} - */ -public final class ProjectTeam extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.ProjectTeam) - ProjectTeamOrBuilder { - private static final long serialVersionUID = 0L; - // Use ProjectTeam.newBuilder() to construct. - private ProjectTeam(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ProjectTeam() { - projectNumber_ = ""; - team_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ProjectTeam(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ProjectTeam( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - projectNumber_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - team_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ProjectTeam_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ProjectTeam_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ProjectTeam.class, - com.google.storage.v2.ProjectTeam.Builder.class); - } - - public static final int PROJECT_NUMBER_FIELD_NUMBER = 1; - private volatile java.lang.Object projectNumber_; - /** - * - * - *
-   * The project number.
-   * 
- * - * string project_number = 1; - * - * @return The projectNumber. - */ - @java.lang.Override - public java.lang.String getProjectNumber() { - java.lang.Object ref = projectNumber_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - projectNumber_ = s; - return s; - } - } - /** - * - * - *
-   * The project number.
-   * 
- * - * string project_number = 1; - * - * @return The bytes for projectNumber. - */ - @java.lang.Override - public com.google.protobuf.ByteString getProjectNumberBytes() { - java.lang.Object ref = projectNumber_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - projectNumber_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TEAM_FIELD_NUMBER = 2; - private volatile java.lang.Object team_; - /** - * - * - *
-   * The team.
-   * 
- * - * string team = 2; - * - * @return The team. - */ - @java.lang.Override - public java.lang.String getTeam() { - java.lang.Object ref = team_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - team_ = s; - return s; - } - } - /** - * - * - *
-   * The team.
-   * 
- * - * string team = 2; - * - * @return The bytes for team. - */ - @java.lang.Override - public com.google.protobuf.ByteString getTeamBytes() { - java.lang.Object ref = team_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - team_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectNumber_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectNumber_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(team_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, team_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectNumber_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, projectNumber_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(team_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, team_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.ProjectTeam)) { - return super.equals(obj); - } - com.google.storage.v2.ProjectTeam other = (com.google.storage.v2.ProjectTeam) obj; - - if (!getProjectNumber().equals(other.getProjectNumber())) return false; - if (!getTeam().equals(other.getTeam())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PROJECT_NUMBER_FIELD_NUMBER; - hash = (53 * hash) + getProjectNumber().hashCode(); - hash = (37 * hash) + TEAM_FIELD_NUMBER; - hash = (53 * hash) + getTeam().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.ProjectTeam parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ProjectTeam parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ProjectTeam parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ProjectTeam parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ProjectTeam parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ProjectTeam parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ProjectTeam parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ProjectTeam parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.ProjectTeam parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ProjectTeam parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.ProjectTeam parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ProjectTeam parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.ProjectTeam prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Represents the Viewers, Editors, or Owners of a given project.
-   * 
- * - * Protobuf type {@code google.storage.v2.ProjectTeam} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.ProjectTeam) - com.google.storage.v2.ProjectTeamOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ProjectTeam_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ProjectTeam_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ProjectTeam.class, - com.google.storage.v2.ProjectTeam.Builder.class); - } - - // Construct using com.google.storage.v2.ProjectTeam.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - projectNumber_ = ""; - - team_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ProjectTeam_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.ProjectTeam getDefaultInstanceForType() { - return com.google.storage.v2.ProjectTeam.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.ProjectTeam build() { - com.google.storage.v2.ProjectTeam result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.ProjectTeam buildPartial() { - com.google.storage.v2.ProjectTeam result = new com.google.storage.v2.ProjectTeam(this); - result.projectNumber_ = projectNumber_; - result.team_ = team_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.ProjectTeam) { - return mergeFrom((com.google.storage.v2.ProjectTeam) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.ProjectTeam other) { - if (other == com.google.storage.v2.ProjectTeam.getDefaultInstance()) return this; - if (!other.getProjectNumber().isEmpty()) { - projectNumber_ = other.projectNumber_; - onChanged(); - } - if (!other.getTeam().isEmpty()) { - team_ = other.team_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.ProjectTeam parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.ProjectTeam) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object projectNumber_ = ""; - /** - * - * - *
-     * The project number.
-     * 
- * - * string project_number = 1; - * - * @return The projectNumber. - */ - public java.lang.String getProjectNumber() { - java.lang.Object ref = projectNumber_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - projectNumber_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The project number.
-     * 
- * - * string project_number = 1; - * - * @return The bytes for projectNumber. - */ - public com.google.protobuf.ByteString getProjectNumberBytes() { - java.lang.Object ref = projectNumber_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - projectNumber_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The project number.
-     * 
- * - * string project_number = 1; - * - * @param value The projectNumber to set. - * @return This builder for chaining. - */ - public Builder setProjectNumber(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - projectNumber_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The project number.
-     * 
- * - * string project_number = 1; - * - * @return This builder for chaining. - */ - public Builder clearProjectNumber() { - - projectNumber_ = getDefaultInstance().getProjectNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * The project number.
-     * 
- * - * string project_number = 1; - * - * @param value The bytes for projectNumber to set. - * @return This builder for chaining. - */ - public Builder setProjectNumberBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - projectNumber_ = value; - onChanged(); - return this; - } - - private java.lang.Object team_ = ""; - /** - * - * - *
-     * The team.
-     * 
- * - * string team = 2; - * - * @return The team. - */ - public java.lang.String getTeam() { - java.lang.Object ref = team_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - team_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The team.
-     * 
- * - * string team = 2; - * - * @return The bytes for team. - */ - public com.google.protobuf.ByteString getTeamBytes() { - java.lang.Object ref = team_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - team_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The team.
-     * 
- * - * string team = 2; - * - * @param value The team to set. - * @return This builder for chaining. - */ - public Builder setTeam(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - team_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The team.
-     * 
- * - * string team = 2; - * - * @return This builder for chaining. - */ - public Builder clearTeam() { - - team_ = getDefaultInstance().getTeam(); - onChanged(); - return this; - } - /** - * - * - *
-     * The team.
-     * 
- * - * string team = 2; - * - * @param value The bytes for team to set. - * @return This builder for chaining. - */ - public Builder setTeamBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - team_ = value; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.ProjectTeam) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.ProjectTeam) - private static final com.google.storage.v2.ProjectTeam DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.ProjectTeam(); - } - - public static com.google.storage.v2.ProjectTeam getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ProjectTeam parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ProjectTeam(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.ProjectTeam getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ProjectTeamOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ProjectTeamOrBuilder.java deleted file mode 100644 index 3af551ee1e..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ProjectTeamOrBuilder.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface ProjectTeamOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.ProjectTeam) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The project number.
-   * 
- * - * string project_number = 1; - * - * @return The projectNumber. - */ - java.lang.String getProjectNumber(); - /** - * - * - *
-   * The project number.
-   * 
- * - * string project_number = 1; - * - * @return The bytes for projectNumber. - */ - com.google.protobuf.ByteString getProjectNumberBytes(); - - /** - * - * - *
-   * The team.
-   * 
- * - * string team = 2; - * - * @return The team. - */ - java.lang.String getTeam(); - /** - * - * - *
-   * The team.
-   * 
- * - * string team = 2; - * - * @return The bytes for team. - */ - com.google.protobuf.ByteString getTeamBytes(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusRequest.java deleted file mode 100644 index 027368ff58..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusRequest.java +++ /dev/null @@ -1,1205 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request object for `QueryWriteStatus`.
- * 
- * - * Protobuf type {@code google.storage.v2.QueryWriteStatusRequest} - */ -public final class QueryWriteStatusRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.QueryWriteStatusRequest) - QueryWriteStatusRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use QueryWriteStatusRequest.newBuilder() to construct. - private QueryWriteStatusRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private QueryWriteStatusRequest() { - uploadId_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new QueryWriteStatusRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private QueryWriteStatusRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - uploadId_ = s; - break; - } - case 18: - { - com.google.storage.v2.CommonObjectRequestParams.Builder subBuilder = null; - if (commonObjectRequestParams_ != null) { - subBuilder = commonObjectRequestParams_.toBuilder(); - } - commonObjectRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonObjectRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonObjectRequestParams_); - commonObjectRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; - if (commonRequestParams_ != null) { - subBuilder = commonRequestParams_.toBuilder(); - } - commonRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonRequestParams_); - commonRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_QueryWriteStatusRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_QueryWriteStatusRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.QueryWriteStatusRequest.class, - com.google.storage.v2.QueryWriteStatusRequest.Builder.class); - } - - public static final int UPLOAD_ID_FIELD_NUMBER = 1; - private volatile java.lang.Object uploadId_; - /** - * - * - *
-   * Required. The name of the resume token for the object whose write status is being
-   * requested.
-   * 
- * - * string upload_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The uploadId. - */ - @java.lang.Override - public java.lang.String getUploadId() { - java.lang.Object ref = uploadId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uploadId_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The name of the resume token for the object whose write status is being
-   * requested.
-   * 
- * - * string upload_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for uploadId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getUploadIdBytes() { - java.lang.Object ref = uploadId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - uploadId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER = 2; - private com.google.storage.v2.CommonObjectRequestParams commonObjectRequestParams_; - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; - * - * @return Whether the commonObjectRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonObjectRequestParams() { - return commonObjectRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; - * - * @return The commonObjectRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { - return commonObjectRequestParams_ == null - ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() - : commonObjectRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; - */ - @java.lang.Override - public com.google.storage.v2.CommonObjectRequestParamsOrBuilder - getCommonObjectRequestParamsOrBuilder() { - return getCommonObjectRequestParams(); - } - - public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 3; - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return Whether the commonRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonRequestParams() { - return commonRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return The commonRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - return getCommonRequestParams(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uploadId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uploadId_); - } - if (commonObjectRequestParams_ != null) { - output.writeMessage(2, getCommonObjectRequestParams()); - } - if (commonRequestParams_ != null) { - output.writeMessage(3, getCommonRequestParams()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uploadId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uploadId_); - } - if (commonObjectRequestParams_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 2, getCommonObjectRequestParams()); - } - if (commonRequestParams_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCommonRequestParams()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.QueryWriteStatusRequest)) { - return super.equals(obj); - } - com.google.storage.v2.QueryWriteStatusRequest other = - (com.google.storage.v2.QueryWriteStatusRequest) obj; - - if (!getUploadId().equals(other.getUploadId())) return false; - if (hasCommonObjectRequestParams() != other.hasCommonObjectRequestParams()) return false; - if (hasCommonObjectRequestParams()) { - if (!getCommonObjectRequestParams().equals(other.getCommonObjectRequestParams())) - return false; - } - if (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; - if (hasCommonRequestParams()) { - if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + UPLOAD_ID_FIELD_NUMBER; - hash = (53 * hash) + getUploadId().hashCode(); - if (hasCommonObjectRequestParams()) { - hash = (37 * hash) + COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonObjectRequestParams().hashCode(); - } - if (hasCommonRequestParams()) { - hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonRequestParams().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.QueryWriteStatusRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.QueryWriteStatusRequest parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.QueryWriteStatusRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.QueryWriteStatusRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.QueryWriteStatusRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.QueryWriteStatusRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.QueryWriteStatusRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.QueryWriteStatusRequest parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.QueryWriteStatusRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.QueryWriteStatusRequest parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.QueryWriteStatusRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.QueryWriteStatusRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.QueryWriteStatusRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Request object for `QueryWriteStatus`.
-   * 
- * - * Protobuf type {@code google.storage.v2.QueryWriteStatusRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.QueryWriteStatusRequest) - com.google.storage.v2.QueryWriteStatusRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_QueryWriteStatusRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_QueryWriteStatusRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.QueryWriteStatusRequest.class, - com.google.storage.v2.QueryWriteStatusRequest.Builder.class); - } - - // Construct using com.google.storage.v2.QueryWriteStatusRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - uploadId_ = ""; - - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = null; - } else { - commonObjectRequestParams_ = null; - commonObjectRequestParamsBuilder_ = null; - } - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_QueryWriteStatusRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.QueryWriteStatusRequest getDefaultInstanceForType() { - return com.google.storage.v2.QueryWriteStatusRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.QueryWriteStatusRequest build() { - com.google.storage.v2.QueryWriteStatusRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.QueryWriteStatusRequest buildPartial() { - com.google.storage.v2.QueryWriteStatusRequest result = - new com.google.storage.v2.QueryWriteStatusRequest(this); - result.uploadId_ = uploadId_; - if (commonObjectRequestParamsBuilder_ == null) { - result.commonObjectRequestParams_ = commonObjectRequestParams_; - } else { - result.commonObjectRequestParams_ = commonObjectRequestParamsBuilder_.build(); - } - if (commonRequestParamsBuilder_ == null) { - result.commonRequestParams_ = commonRequestParams_; - } else { - result.commonRequestParams_ = commonRequestParamsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.QueryWriteStatusRequest) { - return mergeFrom((com.google.storage.v2.QueryWriteStatusRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.QueryWriteStatusRequest other) { - if (other == com.google.storage.v2.QueryWriteStatusRequest.getDefaultInstance()) return this; - if (!other.getUploadId().isEmpty()) { - uploadId_ = other.uploadId_; - onChanged(); - } - if (other.hasCommonObjectRequestParams()) { - mergeCommonObjectRequestParams(other.getCommonObjectRequestParams()); - } - if (other.hasCommonRequestParams()) { - mergeCommonRequestParams(other.getCommonRequestParams()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.QueryWriteStatusRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.QueryWriteStatusRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object uploadId_ = ""; - /** - * - * - *
-     * Required. The name of the resume token for the object whose write status is being
-     * requested.
-     * 
- * - * string upload_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The uploadId. - */ - public java.lang.String getUploadId() { - java.lang.Object ref = uploadId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uploadId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The name of the resume token for the object whose write status is being
-     * requested.
-     * 
- * - * string upload_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for uploadId. - */ - public com.google.protobuf.ByteString getUploadIdBytes() { - java.lang.Object ref = uploadId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - uploadId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The name of the resume token for the object whose write status is being
-     * requested.
-     * 
- * - * string upload_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The uploadId to set. - * @return This builder for chaining. - */ - public Builder setUploadId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - uploadId_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the resume token for the object whose write status is being
-     * requested.
-     * 
- * - * string upload_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearUploadId() { - - uploadId_ = getDefaultInstance().getUploadId(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the resume token for the object whose write status is being
-     * requested.
-     * 
- * - * string upload_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for uploadId to set. - * @return This builder for chaining. - */ - public Builder setUploadIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - uploadId_ = value; - onChanged(); - return this; - } - - private com.google.storage.v2.CommonObjectRequestParams commonObjectRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder> - commonObjectRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; - * - * @return Whether the commonObjectRequestParams field is set. - */ - public boolean hasCommonObjectRequestParams() { - return commonObjectRequestParamsBuilder_ != null || commonObjectRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; - * - * @return The commonObjectRequestParams. - */ - public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { - if (commonObjectRequestParamsBuilder_ == null) { - return commonObjectRequestParams_ == null - ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() - : commonObjectRequestParams_; - } else { - return commonObjectRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; - */ - public Builder setCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams value) { - if (commonObjectRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonObjectRequestParams_ = value; - onChanged(); - } else { - commonObjectRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; - */ - public Builder setCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams.Builder builderForValue) { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonObjectRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; - */ - public Builder mergeCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams value) { - if (commonObjectRequestParamsBuilder_ == null) { - if (commonObjectRequestParams_ != null) { - commonObjectRequestParams_ = - com.google.storage.v2.CommonObjectRequestParams.newBuilder(commonObjectRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonObjectRequestParams_ = value; - } - onChanged(); - } else { - commonObjectRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; - */ - public Builder clearCommonObjectRequestParams() { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = null; - onChanged(); - } else { - commonObjectRequestParams_ = null; - commonObjectRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; - */ - public com.google.storage.v2.CommonObjectRequestParams.Builder - getCommonObjectRequestParamsBuilder() { - - onChanged(); - return getCommonObjectRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; - */ - public com.google.storage.v2.CommonObjectRequestParamsOrBuilder - getCommonObjectRequestParamsOrBuilder() { - if (commonObjectRequestParamsBuilder_ != null) { - return commonObjectRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonObjectRequestParams_ == null - ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() - : commonObjectRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder> - getCommonObjectRequestParamsFieldBuilder() { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder>( - getCommonObjectRequestParams(), getParentForChildren(), isClean()); - commonObjectRequestParams_ = null; - } - return commonObjectRequestParamsBuilder_; - } - - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - commonRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return Whether the commonRequestParams field is set. - */ - public boolean hasCommonRequestParams() { - return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return The commonRequestParams. - */ - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } else { - return commonRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonRequestParams_ = value; - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public Builder setCommonRequestParams( - com.google.storage.v2.CommonRequestParams.Builder builderForValue) { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (commonRequestParams_ != null) { - commonRequestParams_ = - com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonRequestParams_ = value; - } - onChanged(); - } else { - commonRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public Builder clearCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - onChanged(); - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { - - onChanged(); - return getCommonRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - if (commonRequestParamsBuilder_ != null) { - return commonRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - getCommonRequestParamsFieldBuilder() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder>( - getCommonRequestParams(), getParentForChildren(), isClean()); - commonRequestParams_ = null; - } - return commonRequestParamsBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.QueryWriteStatusRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.QueryWriteStatusRequest) - private static final com.google.storage.v2.QueryWriteStatusRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.QueryWriteStatusRequest(); - } - - public static com.google.storage.v2.QueryWriteStatusRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public QueryWriteStatusRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new QueryWriteStatusRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.QueryWriteStatusRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusRequestOrBuilder.java deleted file mode 100644 index e615a6d43b..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusRequestOrBuilder.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface QueryWriteStatusRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.QueryWriteStatusRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The name of the resume token for the object whose write status is being
-   * requested.
-   * 
- * - * string upload_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The uploadId. - */ - java.lang.String getUploadId(); - /** - * - * - *
-   * Required. The name of the resume token for the object whose write status is being
-   * requested.
-   * 
- * - * string upload_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for uploadId. - */ - com.google.protobuf.ByteString getUploadIdBytes(); - - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; - * - * @return Whether the commonObjectRequestParams field is set. - */ - boolean hasCommonObjectRequestParams(); - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; - * - * @return The commonObjectRequestParams. - */ - com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams(); - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; - */ - com.google.storage.v2.CommonObjectRequestParamsOrBuilder getCommonObjectRequestParamsOrBuilder(); - - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return Whether the commonRequestParams field is set. - */ - boolean hasCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - * - * @return The commonRequestParams. - */ - com.google.storage.v2.CommonRequestParams getCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 3; - */ - com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponse.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponse.java deleted file mode 100644 index 73b684dbe6..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponse.java +++ /dev/null @@ -1,994 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Response object for `QueryWriteStatus`.
- * 
- * - * Protobuf type {@code google.storage.v2.QueryWriteStatusResponse} - */ -public final class QueryWriteStatusResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.QueryWriteStatusResponse) - QueryWriteStatusResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use QueryWriteStatusResponse.newBuilder() to construct. - private QueryWriteStatusResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private QueryWriteStatusResponse() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new QueryWriteStatusResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private QueryWriteStatusResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - writeStatusCase_ = 1; - writeStatus_ = input.readInt64(); - break; - } - case 18: - { - com.google.storage.v2.Object.Builder subBuilder = null; - if (writeStatusCase_ == 2) { - subBuilder = ((com.google.storage.v2.Object) writeStatus_).toBuilder(); - } - writeStatus_ = - input.readMessage(com.google.storage.v2.Object.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.storage.v2.Object) writeStatus_); - writeStatus_ = subBuilder.buildPartial(); - } - writeStatusCase_ = 2; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_QueryWriteStatusResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_QueryWriteStatusResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.QueryWriteStatusResponse.class, - com.google.storage.v2.QueryWriteStatusResponse.Builder.class); - } - - private int writeStatusCase_ = 0; - private java.lang.Object writeStatus_; - - public enum WriteStatusCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - PERSISTED_SIZE(1), - RESOURCE(2), - WRITESTATUS_NOT_SET(0); - private final int value; - - private WriteStatusCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static WriteStatusCase valueOf(int value) { - return forNumber(value); - } - - public static WriteStatusCase forNumber(int value) { - switch (value) { - case 1: - return PERSISTED_SIZE; - case 2: - return RESOURCE; - case 0: - return WRITESTATUS_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public WriteStatusCase getWriteStatusCase() { - return WriteStatusCase.forNumber(writeStatusCase_); - } - - public static final int PERSISTED_SIZE_FIELD_NUMBER = 1; - /** - * - * - *
-   * The total number of bytes that have been processed for the given object
-   * from all `WriteObject` calls. This is the correct value for the
-   * 'write_offset' field to use when resuming the `WriteObject` operation.
-   * Only set if the upload has not finalized.
-   * 
- * - * int64 persisted_size = 1; - * - * @return Whether the persistedSize field is set. - */ - @java.lang.Override - public boolean hasPersistedSize() { - return writeStatusCase_ == 1; - } - /** - * - * - *
-   * The total number of bytes that have been processed for the given object
-   * from all `WriteObject` calls. This is the correct value for the
-   * 'write_offset' field to use when resuming the `WriteObject` operation.
-   * Only set if the upload has not finalized.
-   * 
- * - * int64 persisted_size = 1; - * - * @return The persistedSize. - */ - @java.lang.Override - public long getPersistedSize() { - if (writeStatusCase_ == 1) { - return (java.lang.Long) writeStatus_; - } - return 0L; - } - - public static final int RESOURCE_FIELD_NUMBER = 2; - /** - * - * - *
-   * A resource containing the metadata for the uploaded object. Only set if
-   * the upload has finalized.
-   * 
- * - * .google.storage.v2.Object resource = 2; - * - * @return Whether the resource field is set. - */ - @java.lang.Override - public boolean hasResource() { - return writeStatusCase_ == 2; - } - /** - * - * - *
-   * A resource containing the metadata for the uploaded object. Only set if
-   * the upload has finalized.
-   * 
- * - * .google.storage.v2.Object resource = 2; - * - * @return The resource. - */ - @java.lang.Override - public com.google.storage.v2.Object getResource() { - if (writeStatusCase_ == 2) { - return (com.google.storage.v2.Object) writeStatus_; - } - return com.google.storage.v2.Object.getDefaultInstance(); - } - /** - * - * - *
-   * A resource containing the metadata for the uploaded object. Only set if
-   * the upload has finalized.
-   * 
- * - * .google.storage.v2.Object resource = 2; - */ - @java.lang.Override - public com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder() { - if (writeStatusCase_ == 2) { - return (com.google.storage.v2.Object) writeStatus_; - } - return com.google.storage.v2.Object.getDefaultInstance(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (writeStatusCase_ == 1) { - output.writeInt64(1, (long) ((java.lang.Long) writeStatus_)); - } - if (writeStatusCase_ == 2) { - output.writeMessage(2, (com.google.storage.v2.Object) writeStatus_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (writeStatusCase_ == 1) { - size += - com.google.protobuf.CodedOutputStream.computeInt64Size( - 1, (long) ((java.lang.Long) writeStatus_)); - } - if (writeStatusCase_ == 2) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 2, (com.google.storage.v2.Object) writeStatus_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.QueryWriteStatusResponse)) { - return super.equals(obj); - } - com.google.storage.v2.QueryWriteStatusResponse other = - (com.google.storage.v2.QueryWriteStatusResponse) obj; - - if (!getWriteStatusCase().equals(other.getWriteStatusCase())) return false; - switch (writeStatusCase_) { - case 1: - if (getPersistedSize() != other.getPersistedSize()) return false; - break; - case 2: - if (!getResource().equals(other.getResource())) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (writeStatusCase_) { - case 1: - hash = (37 * hash) + PERSISTED_SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPersistedSize()); - break; - case 2: - hash = (37 * hash) + RESOURCE_FIELD_NUMBER; - hash = (53 * hash) + getResource().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.QueryWriteStatusResponse parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.QueryWriteStatusResponse parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.QueryWriteStatusResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.QueryWriteStatusResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.QueryWriteStatusResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.QueryWriteStatusResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.QueryWriteStatusResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.QueryWriteStatusResponse parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.QueryWriteStatusResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.QueryWriteStatusResponse parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.QueryWriteStatusResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.QueryWriteStatusResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.QueryWriteStatusResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Response object for `QueryWriteStatus`.
-   * 
- * - * Protobuf type {@code google.storage.v2.QueryWriteStatusResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.QueryWriteStatusResponse) - com.google.storage.v2.QueryWriteStatusResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_QueryWriteStatusResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_QueryWriteStatusResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.QueryWriteStatusResponse.class, - com.google.storage.v2.QueryWriteStatusResponse.Builder.class); - } - - // Construct using com.google.storage.v2.QueryWriteStatusResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - writeStatusCase_ = 0; - writeStatus_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_QueryWriteStatusResponse_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.QueryWriteStatusResponse getDefaultInstanceForType() { - return com.google.storage.v2.QueryWriteStatusResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.QueryWriteStatusResponse build() { - com.google.storage.v2.QueryWriteStatusResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.QueryWriteStatusResponse buildPartial() { - com.google.storage.v2.QueryWriteStatusResponse result = - new com.google.storage.v2.QueryWriteStatusResponse(this); - if (writeStatusCase_ == 1) { - result.writeStatus_ = writeStatus_; - } - if (writeStatusCase_ == 2) { - if (resourceBuilder_ == null) { - result.writeStatus_ = writeStatus_; - } else { - result.writeStatus_ = resourceBuilder_.build(); - } - } - result.writeStatusCase_ = writeStatusCase_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.QueryWriteStatusResponse) { - return mergeFrom((com.google.storage.v2.QueryWriteStatusResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.QueryWriteStatusResponse other) { - if (other == com.google.storage.v2.QueryWriteStatusResponse.getDefaultInstance()) return this; - switch (other.getWriteStatusCase()) { - case PERSISTED_SIZE: - { - setPersistedSize(other.getPersistedSize()); - break; - } - case RESOURCE: - { - mergeResource(other.getResource()); - break; - } - case WRITESTATUS_NOT_SET: - { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.QueryWriteStatusResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.QueryWriteStatusResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int writeStatusCase_ = 0; - private java.lang.Object writeStatus_; - - public WriteStatusCase getWriteStatusCase() { - return WriteStatusCase.forNumber(writeStatusCase_); - } - - public Builder clearWriteStatus() { - writeStatusCase_ = 0; - writeStatus_ = null; - onChanged(); - return this; - } - - /** - * - * - *
-     * The total number of bytes that have been processed for the given object
-     * from all `WriteObject` calls. This is the correct value for the
-     * 'write_offset' field to use when resuming the `WriteObject` operation.
-     * Only set if the upload has not finalized.
-     * 
- * - * int64 persisted_size = 1; - * - * @return Whether the persistedSize field is set. - */ - public boolean hasPersistedSize() { - return writeStatusCase_ == 1; - } - /** - * - * - *
-     * The total number of bytes that have been processed for the given object
-     * from all `WriteObject` calls. This is the correct value for the
-     * 'write_offset' field to use when resuming the `WriteObject` operation.
-     * Only set if the upload has not finalized.
-     * 
- * - * int64 persisted_size = 1; - * - * @return The persistedSize. - */ - public long getPersistedSize() { - if (writeStatusCase_ == 1) { - return (java.lang.Long) writeStatus_; - } - return 0L; - } - /** - * - * - *
-     * The total number of bytes that have been processed for the given object
-     * from all `WriteObject` calls. This is the correct value for the
-     * 'write_offset' field to use when resuming the `WriteObject` operation.
-     * Only set if the upload has not finalized.
-     * 
- * - * int64 persisted_size = 1; - * - * @param value The persistedSize to set. - * @return This builder for chaining. - */ - public Builder setPersistedSize(long value) { - writeStatusCase_ = 1; - writeStatus_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The total number of bytes that have been processed for the given object
-     * from all `WriteObject` calls. This is the correct value for the
-     * 'write_offset' field to use when resuming the `WriteObject` operation.
-     * Only set if the upload has not finalized.
-     * 
- * - * int64 persisted_size = 1; - * - * @return This builder for chaining. - */ - public Builder clearPersistedSize() { - if (writeStatusCase_ == 1) { - writeStatusCase_ = 0; - writeStatus_ = null; - onChanged(); - } - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder> - resourceBuilder_; - /** - * - * - *
-     * A resource containing the metadata for the uploaded object. Only set if
-     * the upload has finalized.
-     * 
- * - * .google.storage.v2.Object resource = 2; - * - * @return Whether the resource field is set. - */ - @java.lang.Override - public boolean hasResource() { - return writeStatusCase_ == 2; - } - /** - * - * - *
-     * A resource containing the metadata for the uploaded object. Only set if
-     * the upload has finalized.
-     * 
- * - * .google.storage.v2.Object resource = 2; - * - * @return The resource. - */ - @java.lang.Override - public com.google.storage.v2.Object getResource() { - if (resourceBuilder_ == null) { - if (writeStatusCase_ == 2) { - return (com.google.storage.v2.Object) writeStatus_; - } - return com.google.storage.v2.Object.getDefaultInstance(); - } else { - if (writeStatusCase_ == 2) { - return resourceBuilder_.getMessage(); - } - return com.google.storage.v2.Object.getDefaultInstance(); - } - } - /** - * - * - *
-     * A resource containing the metadata for the uploaded object. Only set if
-     * the upload has finalized.
-     * 
- * - * .google.storage.v2.Object resource = 2; - */ - public Builder setResource(com.google.storage.v2.Object value) { - if (resourceBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - writeStatus_ = value; - onChanged(); - } else { - resourceBuilder_.setMessage(value); - } - writeStatusCase_ = 2; - return this; - } - /** - * - * - *
-     * A resource containing the metadata for the uploaded object. Only set if
-     * the upload has finalized.
-     * 
- * - * .google.storage.v2.Object resource = 2; - */ - public Builder setResource(com.google.storage.v2.Object.Builder builderForValue) { - if (resourceBuilder_ == null) { - writeStatus_ = builderForValue.build(); - onChanged(); - } else { - resourceBuilder_.setMessage(builderForValue.build()); - } - writeStatusCase_ = 2; - return this; - } - /** - * - * - *
-     * A resource containing the metadata for the uploaded object. Only set if
-     * the upload has finalized.
-     * 
- * - * .google.storage.v2.Object resource = 2; - */ - public Builder mergeResource(com.google.storage.v2.Object value) { - if (resourceBuilder_ == null) { - if (writeStatusCase_ == 2 - && writeStatus_ != com.google.storage.v2.Object.getDefaultInstance()) { - writeStatus_ = - com.google.storage.v2.Object.newBuilder((com.google.storage.v2.Object) writeStatus_) - .mergeFrom(value) - .buildPartial(); - } else { - writeStatus_ = value; - } - onChanged(); - } else { - if (writeStatusCase_ == 2) { - resourceBuilder_.mergeFrom(value); - } - resourceBuilder_.setMessage(value); - } - writeStatusCase_ = 2; - return this; - } - /** - * - * - *
-     * A resource containing the metadata for the uploaded object. Only set if
-     * the upload has finalized.
-     * 
- * - * .google.storage.v2.Object resource = 2; - */ - public Builder clearResource() { - if (resourceBuilder_ == null) { - if (writeStatusCase_ == 2) { - writeStatusCase_ = 0; - writeStatus_ = null; - onChanged(); - } - } else { - if (writeStatusCase_ == 2) { - writeStatusCase_ = 0; - writeStatus_ = null; - } - resourceBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * A resource containing the metadata for the uploaded object. Only set if
-     * the upload has finalized.
-     * 
- * - * .google.storage.v2.Object resource = 2; - */ - public com.google.storage.v2.Object.Builder getResourceBuilder() { - return getResourceFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A resource containing the metadata for the uploaded object. Only set if
-     * the upload has finalized.
-     * 
- * - * .google.storage.v2.Object resource = 2; - */ - @java.lang.Override - public com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder() { - if ((writeStatusCase_ == 2) && (resourceBuilder_ != null)) { - return resourceBuilder_.getMessageOrBuilder(); - } else { - if (writeStatusCase_ == 2) { - return (com.google.storage.v2.Object) writeStatus_; - } - return com.google.storage.v2.Object.getDefaultInstance(); - } - } - /** - * - * - *
-     * A resource containing the metadata for the uploaded object. Only set if
-     * the upload has finalized.
-     * 
- * - * .google.storage.v2.Object resource = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder> - getResourceFieldBuilder() { - if (resourceBuilder_ == null) { - if (!(writeStatusCase_ == 2)) { - writeStatus_ = com.google.storage.v2.Object.getDefaultInstance(); - } - resourceBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder>( - (com.google.storage.v2.Object) writeStatus_, getParentForChildren(), isClean()); - writeStatus_ = null; - } - writeStatusCase_ = 2; - onChanged(); - ; - return resourceBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.QueryWriteStatusResponse) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.QueryWriteStatusResponse) - private static final com.google.storage.v2.QueryWriteStatusResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.QueryWriteStatusResponse(); - } - - public static com.google.storage.v2.QueryWriteStatusResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public QueryWriteStatusResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new QueryWriteStatusResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.QueryWriteStatusResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponseOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponseOrBuilder.java deleted file mode 100644 index 27f5c79b52..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponseOrBuilder.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface QueryWriteStatusResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.QueryWriteStatusResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The total number of bytes that have been processed for the given object
-   * from all `WriteObject` calls. This is the correct value for the
-   * 'write_offset' field to use when resuming the `WriteObject` operation.
-   * Only set if the upload has not finalized.
-   * 
- * - * int64 persisted_size = 1; - * - * @return Whether the persistedSize field is set. - */ - boolean hasPersistedSize(); - /** - * - * - *
-   * The total number of bytes that have been processed for the given object
-   * from all `WriteObject` calls. This is the correct value for the
-   * 'write_offset' field to use when resuming the `WriteObject` operation.
-   * Only set if the upload has not finalized.
-   * 
- * - * int64 persisted_size = 1; - * - * @return The persistedSize. - */ - long getPersistedSize(); - - /** - * - * - *
-   * A resource containing the metadata for the uploaded object. Only set if
-   * the upload has finalized.
-   * 
- * - * .google.storage.v2.Object resource = 2; - * - * @return Whether the resource field is set. - */ - boolean hasResource(); - /** - * - * - *
-   * A resource containing the metadata for the uploaded object. Only set if
-   * the upload has finalized.
-   * 
- * - * .google.storage.v2.Object resource = 2; - * - * @return The resource. - */ - com.google.storage.v2.Object getResource(); - /** - * - * - *
-   * A resource containing the metadata for the uploaded object. Only set if
-   * the upload has finalized.
-   * 
- * - * .google.storage.v2.Object resource = 2; - */ - com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder(); - - public com.google.storage.v2.QueryWriteStatusResponse.WriteStatusCase getWriteStatusCase(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectRequest.java deleted file mode 100644 index eb93ce9a4d..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectRequest.java +++ /dev/null @@ -1,2586 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request message for ReadObject.
- * 
- * - * Protobuf type {@code google.storage.v2.ReadObjectRequest} - */ -public final class ReadObjectRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.ReadObjectRequest) - ReadObjectRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use ReadObjectRequest.newBuilder() to construct. - private ReadObjectRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ReadObjectRequest() { - bucket_ = ""; - object_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ReadObjectRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ReadObjectRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - bucket_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - object_ = s; - break; - } - case 24: - { - generation_ = input.readInt64(); - break; - } - case 32: - { - readOffset_ = input.readInt64(); - break; - } - case 40: - { - readLimit_ = input.readInt64(); - break; - } - case 48: - { - bitField0_ |= 0x00000001; - ifGenerationMatch_ = input.readInt64(); - break; - } - case 56: - { - bitField0_ |= 0x00000002; - ifGenerationNotMatch_ = input.readInt64(); - break; - } - case 64: - { - bitField0_ |= 0x00000004; - ifMetagenerationMatch_ = input.readInt64(); - break; - } - case 72: - { - bitField0_ |= 0x00000008; - ifMetagenerationNotMatch_ = input.readInt64(); - break; - } - case 82: - { - com.google.storage.v2.CommonObjectRequestParams.Builder subBuilder = null; - if (commonObjectRequestParams_ != null) { - subBuilder = commonObjectRequestParams_.toBuilder(); - } - commonObjectRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonObjectRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonObjectRequestParams_); - commonObjectRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - case 90: - { - com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; - if (commonRequestParams_ != null) { - subBuilder = commonRequestParams_.toBuilder(); - } - commonRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonRequestParams_); - commonRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - case 98: - { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (((bitField0_ & 0x00000010) != 0)) { - subBuilder = readMask_.toBuilder(); - } - readMask_ = - input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(readMask_); - readMask_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000010; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ReadObjectRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ReadObjectRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ReadObjectRequest.class, - com.google.storage.v2.ReadObjectRequest.Builder.class); - } - - private int bitField0_; - public static final int BUCKET_FIELD_NUMBER = 1; - private volatile java.lang.Object bucket_; - /** - * - * - *
-   * The name of the bucket containing the object to read.
-   * 
- * - * string bucket = 1; - * - * @return The bucket. - */ - @java.lang.Override - public java.lang.String getBucket() { - java.lang.Object ref = bucket_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - bucket_ = s; - return s; - } - } - /** - * - * - *
-   * The name of the bucket containing the object to read.
-   * 
- * - * string bucket = 1; - * - * @return The bytes for bucket. - */ - @java.lang.Override - public com.google.protobuf.ByteString getBucketBytes() { - java.lang.Object ref = bucket_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - bucket_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int OBJECT_FIELD_NUMBER = 2; - private volatile java.lang.Object object_; - /** - * - * - *
-   * The name of the object to read.
-   * 
- * - * string object = 2; - * - * @return The object. - */ - @java.lang.Override - public java.lang.String getObject() { - java.lang.Object ref = object_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - object_ = s; - return s; - } - } - /** - * - * - *
-   * The name of the object to read.
-   * 
- * - * string object = 2; - * - * @return The bytes for object. - */ - @java.lang.Override - public com.google.protobuf.ByteString getObjectBytes() { - java.lang.Object ref = object_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - object_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int GENERATION_FIELD_NUMBER = 3; - private long generation_; - /** - * - * - *
-   * If present, selects a specific revision of this object (as opposed
-   * to the latest version, the default).
-   * 
- * - * int64 generation = 3; - * - * @return The generation. - */ - @java.lang.Override - public long getGeneration() { - return generation_; - } - - public static final int READ_OFFSET_FIELD_NUMBER = 4; - private long readOffset_; - /** - * - * - *
-   * The offset for the first byte to return in the read, relative to the start
-   * of the object.
-   * A negative `read_offset` value will be interpreted as the number of bytes
-   * back from the end of the object to be returned. For example, if an object's
-   * length is 15 bytes, a ReadObjectRequest with `read_offset` = -5 and
-   * `read_limit` = 3 would return bytes 10 through 12 of the object. Requesting
-   * a negative offset whose magnitude is larger than the size of the object
-   * will result in an error.
-   * 
- * - * int64 read_offset = 4; - * - * @return The readOffset. - */ - @java.lang.Override - public long getReadOffset() { - return readOffset_; - } - - public static final int READ_LIMIT_FIELD_NUMBER = 5; - private long readLimit_; - /** - * - * - *
-   * The maximum number of `data` bytes the server is allowed to return in the
-   * sum of all `Object` messages. A `read_limit` of zero indicates that there
-   * is no limit, and a negative `read_limit` will cause an error.
-   * If the stream returns fewer bytes than allowed by the `read_limit` and no
-   * error occurred, the stream includes all data from the `read_offset` to the
-   * end of the resource.
-   * 
- * - * int64 read_limit = 5; - * - * @return The readLimit. - */ - @java.lang.Override - public long getReadLimit() { - return readLimit_; - } - - public static final int IF_GENERATION_MATCH_FIELD_NUMBER = 6; - private long ifGenerationMatch_; - /** - * - * - *
-   * Makes the operation conditional on whether the object's current generation
-   * matches the given value. Setting to 0 makes the operation succeed only if
-   * there are no live versions of the object.
-   * 
- * - * optional int64 if_generation_match = 6; - * - * @return Whether the ifGenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfGenerationMatch() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-   * Makes the operation conditional on whether the object's current generation
-   * matches the given value. Setting to 0 makes the operation succeed only if
-   * there are no live versions of the object.
-   * 
- * - * optional int64 if_generation_match = 6; - * - * @return The ifGenerationMatch. - */ - @java.lang.Override - public long getIfGenerationMatch() { - return ifGenerationMatch_; - } - - public static final int IF_GENERATION_NOT_MATCH_FIELD_NUMBER = 7; - private long ifGenerationNotMatch_; - /** - * - * - *
-   * Makes the operation conditional on whether the object's current generation
-   * does not match the given value. If no live object exists, the precondition
-   * fails. Setting to 0 makes the operation succeed only if there is a live
-   * version of the object.
-   * 
- * - * optional int64 if_generation_not_match = 7; - * - * @return Whether the ifGenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfGenerationNotMatch() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-   * Makes the operation conditional on whether the object's current generation
-   * does not match the given value. If no live object exists, the precondition
-   * fails. Setting to 0 makes the operation succeed only if there is a live
-   * version of the object.
-   * 
- * - * optional int64 if_generation_not_match = 7; - * - * @return The ifGenerationNotMatch. - */ - @java.lang.Override - public long getIfGenerationNotMatch() { - return ifGenerationNotMatch_; - } - - public static final int IF_METAGENERATION_MATCH_FIELD_NUMBER = 8; - private long ifMetagenerationMatch_; - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * metageneration matches the given value.
-   * 
- * - * optional int64 if_metageneration_match = 8; - * - * @return Whether the ifMetagenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationMatch() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * metageneration matches the given value.
-   * 
- * - * optional int64 if_metageneration_match = 8; - * - * @return The ifMetagenerationMatch. - */ - @java.lang.Override - public long getIfMetagenerationMatch() { - return ifMetagenerationMatch_; - } - - public static final int IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER = 9; - private long ifMetagenerationNotMatch_; - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * metageneration does not match the given value.
-   * 
- * - * optional int64 if_metageneration_not_match = 9; - * - * @return Whether the ifMetagenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationNotMatch() { - return ((bitField0_ & 0x00000008) != 0); - } - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * metageneration does not match the given value.
-   * 
- * - * optional int64 if_metageneration_not_match = 9; - * - * @return The ifMetagenerationNotMatch. - */ - @java.lang.Override - public long getIfMetagenerationNotMatch() { - return ifMetagenerationNotMatch_; - } - - public static final int COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER = 10; - private com.google.storage.v2.CommonObjectRequestParams commonObjectRequestParams_; - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - * - * @return Whether the commonObjectRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonObjectRequestParams() { - return commonObjectRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - * - * @return The commonObjectRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { - return commonObjectRequestParams_ == null - ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() - : commonObjectRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - */ - @java.lang.Override - public com.google.storage.v2.CommonObjectRequestParamsOrBuilder - getCommonObjectRequestParamsOrBuilder() { - return getCommonObjectRequestParams(); - } - - public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 11; - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - * - * @return Whether the commonRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonRequestParams() { - return commonRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - * - * @return The commonRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - return getCommonRequestParams(); - } - - public static final int READ_MASK_FIELD_NUMBER = 12; - private com.google.protobuf.FieldMask readMask_; - /** - * - * - *
-   * Mask specifying which fields to read.
-   * The checksummed_data field and its children will always be present.
-   * If no mask is specified, will default to all fields except metadata.owner
-   * and metadata.acl.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 12; - * - * @return Whether the readMask field is set. - */ - @java.lang.Override - public boolean hasReadMask() { - return ((bitField0_ & 0x00000010) != 0); - } - /** - * - * - *
-   * Mask specifying which fields to read.
-   * The checksummed_data field and its children will always be present.
-   * If no mask is specified, will default to all fields except metadata.owner
-   * and metadata.acl.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 12; - * - * @return The readMask. - */ - @java.lang.Override - public com.google.protobuf.FieldMask getReadMask() { - return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; - } - /** - * - * - *
-   * Mask specifying which fields to read.
-   * The checksummed_data field and its children will always be present.
-   * If no mask is specified, will default to all fields except metadata.owner
-   * and metadata.acl.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 12; - */ - @java.lang.Override - public com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder() { - return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!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 (readOffset_ != 0L) { - output.writeInt64(4, readOffset_); - } - if (readLimit_ != 0L) { - output.writeInt64(5, readLimit_); - } - if (((bitField0_ & 0x00000001) != 0)) { - output.writeInt64(6, ifGenerationMatch_); - } - if (((bitField0_ & 0x00000002) != 0)) { - output.writeInt64(7, ifGenerationNotMatch_); - } - if (((bitField0_ & 0x00000004) != 0)) { - output.writeInt64(8, ifMetagenerationMatch_); - } - if (((bitField0_ & 0x00000008) != 0)) { - output.writeInt64(9, ifMetagenerationNotMatch_); - } - if (commonObjectRequestParams_ != null) { - output.writeMessage(10, getCommonObjectRequestParams()); - } - if (commonRequestParams_ != null) { - output.writeMessage(11, getCommonRequestParams()); - } - if (((bitField0_ & 0x00000010) != 0)) { - output.writeMessage(12, getReadMask()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!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 (readOffset_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, readOffset_); - } - if (readLimit_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, readLimit_); - } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(6, ifGenerationMatch_); - } - if (((bitField0_ & 0x00000002) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(7, ifGenerationNotMatch_); - } - if (((bitField0_ & 0x00000004) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(8, ifMetagenerationMatch_); - } - if (((bitField0_ & 0x00000008) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(9, ifMetagenerationNotMatch_); - } - if (commonObjectRequestParams_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 10, getCommonObjectRequestParams()); - } - if (commonRequestParams_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize(11, getCommonRequestParams()); - } - if (((bitField0_ & 0x00000010) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getReadMask()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.ReadObjectRequest)) { - return super.equals(obj); - } - com.google.storage.v2.ReadObjectRequest other = (com.google.storage.v2.ReadObjectRequest) obj; - - if (!getBucket().equals(other.getBucket())) return false; - if (!getObject().equals(other.getObject())) return false; - if (getGeneration() != other.getGeneration()) return false; - if (getReadOffset() != other.getReadOffset()) return false; - if (getReadLimit() != other.getReadLimit()) return false; - if (hasIfGenerationMatch() != other.hasIfGenerationMatch()) return false; - if (hasIfGenerationMatch()) { - if (getIfGenerationMatch() != other.getIfGenerationMatch()) return false; - } - if (hasIfGenerationNotMatch() != other.hasIfGenerationNotMatch()) return false; - if (hasIfGenerationNotMatch()) { - if (getIfGenerationNotMatch() != other.getIfGenerationNotMatch()) return false; - } - if (hasIfMetagenerationMatch() != other.hasIfMetagenerationMatch()) return false; - if (hasIfMetagenerationMatch()) { - if (getIfMetagenerationMatch() != other.getIfMetagenerationMatch()) return false; - } - if (hasIfMetagenerationNotMatch() != other.hasIfMetagenerationNotMatch()) return false; - if (hasIfMetagenerationNotMatch()) { - if (getIfMetagenerationNotMatch() != other.getIfMetagenerationNotMatch()) return false; - } - if (hasCommonObjectRequestParams() != other.hasCommonObjectRequestParams()) return false; - if (hasCommonObjectRequestParams()) { - if (!getCommonObjectRequestParams().equals(other.getCommonObjectRequestParams())) - return false; - } - if (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; - if (hasCommonRequestParams()) { - if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; - } - if (hasReadMask() != other.hasReadMask()) return false; - if (hasReadMask()) { - if (!getReadMask().equals(other.getReadMask())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + BUCKET_FIELD_NUMBER; - hash = (53 * hash) + getBucket().hashCode(); - hash = (37 * hash) + OBJECT_FIELD_NUMBER; - hash = (53 * hash) + getObject().hashCode(); - hash = (37 * hash) + GENERATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getGeneration()); - hash = (37 * hash) + READ_OFFSET_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getReadOffset()); - hash = (37 * hash) + READ_LIMIT_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getReadLimit()); - if (hasIfGenerationMatch()) { - hash = (37 * hash) + IF_GENERATION_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfGenerationMatch()); - } - if (hasIfGenerationNotMatch()) { - hash = (37 * hash) + IF_GENERATION_NOT_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfGenerationNotMatch()); - } - if (hasIfMetagenerationMatch()) { - hash = (37 * hash) + IF_METAGENERATION_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationMatch()); - } - if (hasIfMetagenerationNotMatch()) { - hash = (37 * hash) + IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationNotMatch()); - } - if (hasCommonObjectRequestParams()) { - hash = (37 * hash) + COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonObjectRequestParams().hashCode(); - } - if (hasCommonRequestParams()) { - hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonRequestParams().hashCode(); - } - if (hasReadMask()) { - hash = (37 * hash) + READ_MASK_FIELD_NUMBER; - hash = (53 * hash) + getReadMask().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.ReadObjectRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ReadObjectRequest parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ReadObjectRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ReadObjectRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ReadObjectRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ReadObjectRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ReadObjectRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ReadObjectRequest parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.ReadObjectRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ReadObjectRequest parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.ReadObjectRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ReadObjectRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.ReadObjectRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Request message for ReadObject.
-   * 
- * - * Protobuf type {@code google.storage.v2.ReadObjectRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.ReadObjectRequest) - com.google.storage.v2.ReadObjectRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ReadObjectRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ReadObjectRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ReadObjectRequest.class, - com.google.storage.v2.ReadObjectRequest.Builder.class); - } - - // Construct using com.google.storage.v2.ReadObjectRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getReadMaskFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bucket_ = ""; - - object_ = ""; - - generation_ = 0L; - - readOffset_ = 0L; - - readLimit_ = 0L; - - ifGenerationMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000001); - ifGenerationNotMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000002); - ifMetagenerationMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000004); - ifMetagenerationNotMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000008); - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = null; - } else { - commonObjectRequestParams_ = null; - commonObjectRequestParamsBuilder_ = null; - } - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - if (readMaskBuilder_ == null) { - readMask_ = null; - } else { - readMaskBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000010); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ReadObjectRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.ReadObjectRequest getDefaultInstanceForType() { - return com.google.storage.v2.ReadObjectRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.ReadObjectRequest build() { - com.google.storage.v2.ReadObjectRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.ReadObjectRequest buildPartial() { - com.google.storage.v2.ReadObjectRequest result = - new com.google.storage.v2.ReadObjectRequest(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - result.bucket_ = bucket_; - result.object_ = object_; - result.generation_ = generation_; - result.readOffset_ = readOffset_; - result.readLimit_ = readLimit_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.ifGenerationMatch_ = ifGenerationMatch_; - to_bitField0_ |= 0x00000001; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.ifGenerationNotMatch_ = ifGenerationNotMatch_; - to_bitField0_ |= 0x00000002; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.ifMetagenerationMatch_ = ifMetagenerationMatch_; - to_bitField0_ |= 0x00000004; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.ifMetagenerationNotMatch_ = ifMetagenerationNotMatch_; - to_bitField0_ |= 0x00000008; - } - if (commonObjectRequestParamsBuilder_ == null) { - result.commonObjectRequestParams_ = commonObjectRequestParams_; - } else { - result.commonObjectRequestParams_ = commonObjectRequestParamsBuilder_.build(); - } - if (commonRequestParamsBuilder_ == null) { - result.commonRequestParams_ = commonRequestParams_; - } else { - result.commonRequestParams_ = commonRequestParamsBuilder_.build(); - } - if (((from_bitField0_ & 0x00000010) != 0)) { - if (readMaskBuilder_ == null) { - result.readMask_ = readMask_; - } else { - result.readMask_ = readMaskBuilder_.build(); - } - to_bitField0_ |= 0x00000010; - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.ReadObjectRequest) { - return mergeFrom((com.google.storage.v2.ReadObjectRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.ReadObjectRequest other) { - if (other == com.google.storage.v2.ReadObjectRequest.getDefaultInstance()) return this; - if (!other.getBucket().isEmpty()) { - bucket_ = other.bucket_; - onChanged(); - } - if (!other.getObject().isEmpty()) { - object_ = other.object_; - onChanged(); - } - if (other.getGeneration() != 0L) { - setGeneration(other.getGeneration()); - } - if (other.getReadOffset() != 0L) { - setReadOffset(other.getReadOffset()); - } - if (other.getReadLimit() != 0L) { - setReadLimit(other.getReadLimit()); - } - if (other.hasIfGenerationMatch()) { - setIfGenerationMatch(other.getIfGenerationMatch()); - } - if (other.hasIfGenerationNotMatch()) { - setIfGenerationNotMatch(other.getIfGenerationNotMatch()); - } - if (other.hasIfMetagenerationMatch()) { - setIfMetagenerationMatch(other.getIfMetagenerationMatch()); - } - if (other.hasIfMetagenerationNotMatch()) { - setIfMetagenerationNotMatch(other.getIfMetagenerationNotMatch()); - } - if (other.hasCommonObjectRequestParams()) { - mergeCommonObjectRequestParams(other.getCommonObjectRequestParams()); - } - if (other.hasCommonRequestParams()) { - mergeCommonRequestParams(other.getCommonRequestParams()); - } - if (other.hasReadMask()) { - mergeReadMask(other.getReadMask()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.ReadObjectRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.ReadObjectRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object bucket_ = ""; - /** - * - * - *
-     * The name of the bucket containing the object to read.
-     * 
- * - * string bucket = 1; - * - * @return The bucket. - */ - public java.lang.String getBucket() { - java.lang.Object ref = bucket_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - bucket_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The name of the bucket containing the object to read.
-     * 
- * - * string bucket = 1; - * - * @return The bytes for bucket. - */ - public com.google.protobuf.ByteString getBucketBytes() { - java.lang.Object ref = bucket_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - bucket_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The name of the bucket containing the object to read.
-     * 
- * - * string bucket = 1; - * - * @param value The bucket to set. - * @return This builder for chaining. - */ - public Builder setBucket(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - bucket_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The name of the bucket containing the object to read.
-     * 
- * - * string bucket = 1; - * - * @return This builder for chaining. - */ - public Builder clearBucket() { - - bucket_ = getDefaultInstance().getBucket(); - onChanged(); - return this; - } - /** - * - * - *
-     * The name of the bucket containing the object to read.
-     * 
- * - * string bucket = 1; - * - * @param value The bytes for bucket to set. - * @return This builder for chaining. - */ - public Builder setBucketBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - bucket_ = value; - onChanged(); - return this; - } - - private java.lang.Object object_ = ""; - /** - * - * - *
-     * The name of the object to read.
-     * 
- * - * string object = 2; - * - * @return The object. - */ - public java.lang.String getObject() { - java.lang.Object ref = object_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - object_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The name of the object to read.
-     * 
- * - * string object = 2; - * - * @return The bytes for object. - */ - public com.google.protobuf.ByteString getObjectBytes() { - java.lang.Object ref = object_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - object_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The name of the object to read.
-     * 
- * - * string object = 2; - * - * @param value The object to set. - * @return This builder for chaining. - */ - public Builder setObject(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - object_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The name of the object to read.
-     * 
- * - * string object = 2; - * - * @return This builder for chaining. - */ - public Builder clearObject() { - - object_ = getDefaultInstance().getObject(); - onChanged(); - return this; - } - /** - * - * - *
-     * The name of the object to read.
-     * 
- * - * string object = 2; - * - * @param value The bytes for object to set. - * @return This builder for chaining. - */ - public Builder setObjectBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - object_ = value; - onChanged(); - return this; - } - - private long generation_; - /** - * - * - *
-     * If present, selects a specific revision of this object (as opposed
-     * to the latest version, the default).
-     * 
- * - * int64 generation = 3; - * - * @return The generation. - */ - @java.lang.Override - public long getGeneration() { - return generation_; - } - /** - * - * - *
-     * If present, selects a specific revision of this object (as opposed
-     * to the latest version, the default).
-     * 
- * - * int64 generation = 3; - * - * @param value The generation to set. - * @return This builder for chaining. - */ - public Builder setGeneration(long value) { - - generation_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If present, selects a specific revision of this object (as opposed
-     * to the latest version, the default).
-     * 
- * - * int64 generation = 3; - * - * @return This builder for chaining. - */ - public Builder clearGeneration() { - - generation_ = 0L; - onChanged(); - return this; - } - - private long readOffset_; - /** - * - * - *
-     * The offset for the first byte to return in the read, relative to the start
-     * of the object.
-     * A negative `read_offset` value will be interpreted as the number of bytes
-     * back from the end of the object to be returned. For example, if an object's
-     * length is 15 bytes, a ReadObjectRequest with `read_offset` = -5 and
-     * `read_limit` = 3 would return bytes 10 through 12 of the object. Requesting
-     * a negative offset whose magnitude is larger than the size of the object
-     * will result in an error.
-     * 
- * - * int64 read_offset = 4; - * - * @return The readOffset. - */ - @java.lang.Override - public long getReadOffset() { - return readOffset_; - } - /** - * - * - *
-     * The offset for the first byte to return in the read, relative to the start
-     * of the object.
-     * A negative `read_offset` value will be interpreted as the number of bytes
-     * back from the end of the object to be returned. For example, if an object's
-     * length is 15 bytes, a ReadObjectRequest with `read_offset` = -5 and
-     * `read_limit` = 3 would return bytes 10 through 12 of the object. Requesting
-     * a negative offset whose magnitude is larger than the size of the object
-     * will result in an error.
-     * 
- * - * int64 read_offset = 4; - * - * @param value The readOffset to set. - * @return This builder for chaining. - */ - public Builder setReadOffset(long value) { - - readOffset_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The offset for the first byte to return in the read, relative to the start
-     * of the object.
-     * A negative `read_offset` value will be interpreted as the number of bytes
-     * back from the end of the object to be returned. For example, if an object's
-     * length is 15 bytes, a ReadObjectRequest with `read_offset` = -5 and
-     * `read_limit` = 3 would return bytes 10 through 12 of the object. Requesting
-     * a negative offset whose magnitude is larger than the size of the object
-     * will result in an error.
-     * 
- * - * int64 read_offset = 4; - * - * @return This builder for chaining. - */ - public Builder clearReadOffset() { - - readOffset_ = 0L; - onChanged(); - return this; - } - - private long readLimit_; - /** - * - * - *
-     * The maximum number of `data` bytes the server is allowed to return in the
-     * sum of all `Object` messages. A `read_limit` of zero indicates that there
-     * is no limit, and a negative `read_limit` will cause an error.
-     * If the stream returns fewer bytes than allowed by the `read_limit` and no
-     * error occurred, the stream includes all data from the `read_offset` to the
-     * end of the resource.
-     * 
- * - * int64 read_limit = 5; - * - * @return The readLimit. - */ - @java.lang.Override - public long getReadLimit() { - return readLimit_; - } - /** - * - * - *
-     * The maximum number of `data` bytes the server is allowed to return in the
-     * sum of all `Object` messages. A `read_limit` of zero indicates that there
-     * is no limit, and a negative `read_limit` will cause an error.
-     * If the stream returns fewer bytes than allowed by the `read_limit` and no
-     * error occurred, the stream includes all data from the `read_offset` to the
-     * end of the resource.
-     * 
- * - * int64 read_limit = 5; - * - * @param value The readLimit to set. - * @return This builder for chaining. - */ - public Builder setReadLimit(long value) { - - readLimit_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The maximum number of `data` bytes the server is allowed to return in the
-     * sum of all `Object` messages. A `read_limit` of zero indicates that there
-     * is no limit, and a negative `read_limit` will cause an error.
-     * If the stream returns fewer bytes than allowed by the `read_limit` and no
-     * error occurred, the stream includes all data from the `read_offset` to the
-     * end of the resource.
-     * 
- * - * int64 read_limit = 5; - * - * @return This builder for chaining. - */ - public Builder clearReadLimit() { - - readLimit_ = 0L; - onChanged(); - return this; - } - - private long ifGenerationMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * matches the given value. Setting to 0 makes the operation succeed only if
-     * there are no live versions of the object.
-     * 
- * - * optional int64 if_generation_match = 6; - * - * @return Whether the ifGenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfGenerationMatch() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * matches the given value. Setting to 0 makes the operation succeed only if
-     * there are no live versions of the object.
-     * 
- * - * optional int64 if_generation_match = 6; - * - * @return The ifGenerationMatch. - */ - @java.lang.Override - public long getIfGenerationMatch() { - return ifGenerationMatch_; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * matches the given value. Setting to 0 makes the operation succeed only if
-     * there are no live versions of the object.
-     * 
- * - * optional int64 if_generation_match = 6; - * - * @param value The ifGenerationMatch to set. - * @return This builder for chaining. - */ - public Builder setIfGenerationMatch(long value) { - bitField0_ |= 0x00000001; - ifGenerationMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * matches the given value. Setting to 0 makes the operation succeed only if
-     * there are no live versions of the object.
-     * 
- * - * optional int64 if_generation_match = 6; - * - * @return This builder for chaining. - */ - public Builder clearIfGenerationMatch() { - bitField0_ = (bitField0_ & ~0x00000001); - ifGenerationMatch_ = 0L; - onChanged(); - return this; - } - - private long ifGenerationNotMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * does not match the given value. If no live object exists, the precondition
-     * fails. Setting to 0 makes the operation succeed only if there is a live
-     * version of the object.
-     * 
- * - * optional int64 if_generation_not_match = 7; - * - * @return Whether the ifGenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfGenerationNotMatch() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * does not match the given value. If no live object exists, the precondition
-     * fails. Setting to 0 makes the operation succeed only if there is a live
-     * version of the object.
-     * 
- * - * optional int64 if_generation_not_match = 7; - * - * @return The ifGenerationNotMatch. - */ - @java.lang.Override - public long getIfGenerationNotMatch() { - return ifGenerationNotMatch_; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * does not match the given value. If no live object exists, the precondition
-     * fails. Setting to 0 makes the operation succeed only if there is a live
-     * version of the object.
-     * 
- * - * optional int64 if_generation_not_match = 7; - * - * @param value The ifGenerationNotMatch to set. - * @return This builder for chaining. - */ - public Builder setIfGenerationNotMatch(long value) { - bitField0_ |= 0x00000002; - ifGenerationNotMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * does not match the given value. If no live object exists, the precondition
-     * fails. Setting to 0 makes the operation succeed only if there is a live
-     * version of the object.
-     * 
- * - * optional int64 if_generation_not_match = 7; - * - * @return This builder for chaining. - */ - public Builder clearIfGenerationNotMatch() { - bitField0_ = (bitField0_ & ~0x00000002); - ifGenerationNotMatch_ = 0L; - onChanged(); - return this; - } - - private long ifMetagenerationMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration matches the given value.
-     * 
- * - * optional int64 if_metageneration_match = 8; - * - * @return Whether the ifMetagenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationMatch() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration matches the given value.
-     * 
- * - * optional int64 if_metageneration_match = 8; - * - * @return The ifMetagenerationMatch. - */ - @java.lang.Override - public long getIfMetagenerationMatch() { - return ifMetagenerationMatch_; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration matches the given value.
-     * 
- * - * optional int64 if_metageneration_match = 8; - * - * @param value The ifMetagenerationMatch to set. - * @return This builder for chaining. - */ - public Builder setIfMetagenerationMatch(long value) { - bitField0_ |= 0x00000004; - ifMetagenerationMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration matches the given value.
-     * 
- * - * optional int64 if_metageneration_match = 8; - * - * @return This builder for chaining. - */ - public Builder clearIfMetagenerationMatch() { - bitField0_ = (bitField0_ & ~0x00000004); - ifMetagenerationMatch_ = 0L; - onChanged(); - return this; - } - - private long ifMetagenerationNotMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration does not match the given value.
-     * 
- * - * optional int64 if_metageneration_not_match = 9; - * - * @return Whether the ifMetagenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationNotMatch() { - return ((bitField0_ & 0x00000008) != 0); - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration does not match the given value.
-     * 
- * - * optional int64 if_metageneration_not_match = 9; - * - * @return The ifMetagenerationNotMatch. - */ - @java.lang.Override - public long getIfMetagenerationNotMatch() { - return ifMetagenerationNotMatch_; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration does not match the given value.
-     * 
- * - * optional int64 if_metageneration_not_match = 9; - * - * @param value The ifMetagenerationNotMatch to set. - * @return This builder for chaining. - */ - public Builder setIfMetagenerationNotMatch(long value) { - bitField0_ |= 0x00000008; - ifMetagenerationNotMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration does not match the given value.
-     * 
- * - * optional int64 if_metageneration_not_match = 9; - * - * @return This builder for chaining. - */ - public Builder clearIfMetagenerationNotMatch() { - bitField0_ = (bitField0_ & ~0x00000008); - ifMetagenerationNotMatch_ = 0L; - onChanged(); - return this; - } - - private com.google.storage.v2.CommonObjectRequestParams commonObjectRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder> - commonObjectRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - * - * @return Whether the commonObjectRequestParams field is set. - */ - public boolean hasCommonObjectRequestParams() { - return commonObjectRequestParamsBuilder_ != null || commonObjectRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - * - * @return The commonObjectRequestParams. - */ - public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { - if (commonObjectRequestParamsBuilder_ == null) { - return commonObjectRequestParams_ == null - ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() - : commonObjectRequestParams_; - } else { - return commonObjectRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - */ - public Builder setCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams value) { - if (commonObjectRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonObjectRequestParams_ = value; - onChanged(); - } else { - commonObjectRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - */ - public Builder setCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams.Builder builderForValue) { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonObjectRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - */ - public Builder mergeCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams value) { - if (commonObjectRequestParamsBuilder_ == null) { - if (commonObjectRequestParams_ != null) { - commonObjectRequestParams_ = - com.google.storage.v2.CommonObjectRequestParams.newBuilder(commonObjectRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonObjectRequestParams_ = value; - } - onChanged(); - } else { - commonObjectRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - */ - public Builder clearCommonObjectRequestParams() { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = null; - onChanged(); - } else { - commonObjectRequestParams_ = null; - commonObjectRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - */ - public com.google.storage.v2.CommonObjectRequestParams.Builder - getCommonObjectRequestParamsBuilder() { - - onChanged(); - return getCommonObjectRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - */ - public com.google.storage.v2.CommonObjectRequestParamsOrBuilder - getCommonObjectRequestParamsOrBuilder() { - if (commonObjectRequestParamsBuilder_ != null) { - return commonObjectRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonObjectRequestParams_ == null - ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() - : commonObjectRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder> - getCommonObjectRequestParamsFieldBuilder() { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder>( - getCommonObjectRequestParams(), getParentForChildren(), isClean()); - commonObjectRequestParams_ = null; - } - return commonObjectRequestParamsBuilder_; - } - - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - commonRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - * - * @return Whether the commonRequestParams field is set. - */ - public boolean hasCommonRequestParams() { - return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - * - * @return The commonRequestParams. - */ - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } else { - return commonRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - */ - public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonRequestParams_ = value; - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - */ - public Builder setCommonRequestParams( - com.google.storage.v2.CommonRequestParams.Builder builderForValue) { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - */ - public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (commonRequestParams_ != null) { - commonRequestParams_ = - com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonRequestParams_ = value; - } - onChanged(); - } else { - commonRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - */ - public Builder clearCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - onChanged(); - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - */ - public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { - - onChanged(); - return getCommonRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - */ - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - if (commonRequestParamsBuilder_ != null) { - return commonRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - getCommonRequestParamsFieldBuilder() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder>( - getCommonRequestParams(), getParentForChildren(), isClean()); - commonRequestParams_ = null; - } - return commonRequestParamsBuilder_; - } - - private com.google.protobuf.FieldMask readMask_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder> - readMaskBuilder_; - /** - * - * - *
-     * Mask specifying which fields to read.
-     * The checksummed_data field and its children will always be present.
-     * If no mask is specified, will default to all fields except metadata.owner
-     * and metadata.acl.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 12; - * - * @return Whether the readMask field is set. - */ - public boolean hasReadMask() { - return ((bitField0_ & 0x00000010) != 0); - } - /** - * - * - *
-     * Mask specifying which fields to read.
-     * The checksummed_data field and its children will always be present.
-     * If no mask is specified, will default to all fields except metadata.owner
-     * and metadata.acl.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 12; - * - * @return The readMask. - */ - public com.google.protobuf.FieldMask getReadMask() { - if (readMaskBuilder_ == null) { - return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; - } else { - return readMaskBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Mask specifying which fields to read.
-     * The checksummed_data field and its children will always be present.
-     * If no mask is specified, will default to all fields except metadata.owner
-     * and metadata.acl.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 12; - */ - public Builder setReadMask(com.google.protobuf.FieldMask value) { - if (readMaskBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - readMask_ = value; - onChanged(); - } else { - readMaskBuilder_.setMessage(value); - } - bitField0_ |= 0x00000010; - return this; - } - /** - * - * - *
-     * Mask specifying which fields to read.
-     * The checksummed_data field and its children will always be present.
-     * If no mask is specified, will default to all fields except metadata.owner
-     * and metadata.acl.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 12; - */ - public Builder setReadMask(com.google.protobuf.FieldMask.Builder builderForValue) { - if (readMaskBuilder_ == null) { - readMask_ = builderForValue.build(); - onChanged(); - } else { - readMaskBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000010; - return this; - } - /** - * - * - *
-     * Mask specifying which fields to read.
-     * The checksummed_data field and its children will always be present.
-     * If no mask is specified, will default to all fields except metadata.owner
-     * and metadata.acl.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 12; - */ - public Builder mergeReadMask(com.google.protobuf.FieldMask value) { - if (readMaskBuilder_ == null) { - if (((bitField0_ & 0x00000010) != 0) - && readMask_ != null - && readMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { - readMask_ = - com.google.protobuf.FieldMask.newBuilder(readMask_).mergeFrom(value).buildPartial(); - } else { - readMask_ = value; - } - onChanged(); - } else { - readMaskBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000010; - return this; - } - /** - * - * - *
-     * Mask specifying which fields to read.
-     * The checksummed_data field and its children will always be present.
-     * If no mask is specified, will default to all fields except metadata.owner
-     * and metadata.acl.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 12; - */ - public Builder clearReadMask() { - if (readMaskBuilder_ == null) { - readMask_ = null; - onChanged(); - } else { - readMaskBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000010); - return this; - } - /** - * - * - *
-     * Mask specifying which fields to read.
-     * The checksummed_data field and its children will always be present.
-     * If no mask is specified, will default to all fields except metadata.owner
-     * and metadata.acl.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 12; - */ - public com.google.protobuf.FieldMask.Builder getReadMaskBuilder() { - bitField0_ |= 0x00000010; - onChanged(); - return getReadMaskFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Mask specifying which fields to read.
-     * The checksummed_data field and its children will always be present.
-     * If no mask is specified, will default to all fields except metadata.owner
-     * and metadata.acl.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 12; - */ - public com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder() { - if (readMaskBuilder_ != null) { - return readMaskBuilder_.getMessageOrBuilder(); - } else { - return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; - } - } - /** - * - * - *
-     * Mask specifying which fields to read.
-     * The checksummed_data field and its children will always be present.
-     * If no mask is specified, will default to all fields except metadata.owner
-     * and metadata.acl.
-     * * may be used to mean "all fields".
-     * 
- * - * optional .google.protobuf.FieldMask read_mask = 12; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder> - getReadMaskFieldBuilder() { - if (readMaskBuilder_ == null) { - readMaskBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder>( - getReadMask(), getParentForChildren(), isClean()); - readMask_ = null; - } - return readMaskBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.ReadObjectRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.ReadObjectRequest) - private static final com.google.storage.v2.ReadObjectRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.ReadObjectRequest(); - } - - public static com.google.storage.v2.ReadObjectRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ReadObjectRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ReadObjectRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.ReadObjectRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectRequestOrBuilder.java deleted file mode 100644 index 23a835ab7b..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectRequestOrBuilder.java +++ /dev/null @@ -1,358 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface ReadObjectRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.ReadObjectRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The name of the bucket containing the object to read.
-   * 
- * - * string bucket = 1; - * - * @return The bucket. - */ - java.lang.String getBucket(); - /** - * - * - *
-   * The name of the bucket containing the object to read.
-   * 
- * - * string bucket = 1; - * - * @return The bytes for bucket. - */ - com.google.protobuf.ByteString getBucketBytes(); - - /** - * - * - *
-   * The name of the object to read.
-   * 
- * - * string object = 2; - * - * @return The object. - */ - java.lang.String getObject(); - /** - * - * - *
-   * The name of the object to read.
-   * 
- * - * string object = 2; - * - * @return The bytes for object. - */ - com.google.protobuf.ByteString getObjectBytes(); - - /** - * - * - *
-   * If present, selects a specific revision of this object (as opposed
-   * to the latest version, the default).
-   * 
- * - * int64 generation = 3; - * - * @return The generation. - */ - long getGeneration(); - - /** - * - * - *
-   * The offset for the first byte to return in the read, relative to the start
-   * of the object.
-   * A negative `read_offset` value will be interpreted as the number of bytes
-   * back from the end of the object to be returned. For example, if an object's
-   * length is 15 bytes, a ReadObjectRequest with `read_offset` = -5 and
-   * `read_limit` = 3 would return bytes 10 through 12 of the object. Requesting
-   * a negative offset whose magnitude is larger than the size of the object
-   * will result in an error.
-   * 
- * - * int64 read_offset = 4; - * - * @return The readOffset. - */ - long getReadOffset(); - - /** - * - * - *
-   * The maximum number of `data` bytes the server is allowed to return in the
-   * sum of all `Object` messages. A `read_limit` of zero indicates that there
-   * is no limit, and a negative `read_limit` will cause an error.
-   * If the stream returns fewer bytes than allowed by the `read_limit` and no
-   * error occurred, the stream includes all data from the `read_offset` to the
-   * end of the resource.
-   * 
- * - * int64 read_limit = 5; - * - * @return The readLimit. - */ - long getReadLimit(); - - /** - * - * - *
-   * Makes the operation conditional on whether the object's current generation
-   * matches the given value. Setting to 0 makes the operation succeed only if
-   * there are no live versions of the object.
-   * 
- * - * optional int64 if_generation_match = 6; - * - * @return Whether the ifGenerationMatch field is set. - */ - boolean hasIfGenerationMatch(); - /** - * - * - *
-   * Makes the operation conditional on whether the object's current generation
-   * matches the given value. Setting to 0 makes the operation succeed only if
-   * there are no live versions of the object.
-   * 
- * - * optional int64 if_generation_match = 6; - * - * @return The ifGenerationMatch. - */ - long getIfGenerationMatch(); - - /** - * - * - *
-   * Makes the operation conditional on whether the object's current generation
-   * does not match the given value. If no live object exists, the precondition
-   * fails. Setting to 0 makes the operation succeed only if there is a live
-   * version of the object.
-   * 
- * - * optional int64 if_generation_not_match = 7; - * - * @return Whether the ifGenerationNotMatch field is set. - */ - boolean hasIfGenerationNotMatch(); - /** - * - * - *
-   * Makes the operation conditional on whether the object's current generation
-   * does not match the given value. If no live object exists, the precondition
-   * fails. Setting to 0 makes the operation succeed only if there is a live
-   * version of the object.
-   * 
- * - * optional int64 if_generation_not_match = 7; - * - * @return The ifGenerationNotMatch. - */ - long getIfGenerationNotMatch(); - - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * metageneration matches the given value.
-   * 
- * - * optional int64 if_metageneration_match = 8; - * - * @return Whether the ifMetagenerationMatch field is set. - */ - boolean hasIfMetagenerationMatch(); - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * metageneration matches the given value.
-   * 
- * - * optional int64 if_metageneration_match = 8; - * - * @return The ifMetagenerationMatch. - */ - long getIfMetagenerationMatch(); - - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * metageneration does not match the given value.
-   * 
- * - * optional int64 if_metageneration_not_match = 9; - * - * @return Whether the ifMetagenerationNotMatch field is set. - */ - boolean hasIfMetagenerationNotMatch(); - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * metageneration does not match the given value.
-   * 
- * - * optional int64 if_metageneration_not_match = 9; - * - * @return The ifMetagenerationNotMatch. - */ - long getIfMetagenerationNotMatch(); - - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - * - * @return Whether the commonObjectRequestParams field is set. - */ - boolean hasCommonObjectRequestParams(); - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - * - * @return The commonObjectRequestParams. - */ - com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams(); - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; - */ - com.google.storage.v2.CommonObjectRequestParamsOrBuilder getCommonObjectRequestParamsOrBuilder(); - - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - * - * @return Whether the commonRequestParams field is set. - */ - boolean hasCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - * - * @return The commonRequestParams. - */ - com.google.storage.v2.CommonRequestParams getCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 11; - */ - com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); - - /** - * - * - *
-   * Mask specifying which fields to read.
-   * The checksummed_data field and its children will always be present.
-   * If no mask is specified, will default to all fields except metadata.owner
-   * and metadata.acl.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 12; - * - * @return Whether the readMask field is set. - */ - boolean hasReadMask(); - /** - * - * - *
-   * Mask specifying which fields to read.
-   * The checksummed_data field and its children will always be present.
-   * If no mask is specified, will default to all fields except metadata.owner
-   * and metadata.acl.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 12; - * - * @return The readMask. - */ - com.google.protobuf.FieldMask getReadMask(); - /** - * - * - *
-   * Mask specifying which fields to read.
-   * The checksummed_data field and its children will always be present.
-   * If no mask is specified, will default to all fields except metadata.owner
-   * and metadata.acl.
-   * * may be used to mean "all fields".
-   * 
- * - * optional .google.protobuf.FieldMask read_mask = 12; - */ - com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectResponse.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectResponse.java deleted file mode 100644 index 9ba19e2fe1..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectResponse.java +++ /dev/null @@ -1,1649 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Response message for GetObject.
- * 
- * - * Protobuf type {@code google.storage.v2.ReadObjectResponse} - */ -public final class ReadObjectResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.ReadObjectResponse) - ReadObjectResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use ReadObjectResponse.newBuilder() to construct. - private ReadObjectResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ReadObjectResponse() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ReadObjectResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ReadObjectResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.storage.v2.ChecksummedData.Builder subBuilder = null; - if (checksummedData_ != null) { - subBuilder = checksummedData_.toBuilder(); - } - checksummedData_ = - input.readMessage( - com.google.storage.v2.ChecksummedData.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(checksummedData_); - checksummedData_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.storage.v2.ObjectChecksums.Builder subBuilder = null; - if (objectChecksums_ != null) { - subBuilder = objectChecksums_.toBuilder(); - } - objectChecksums_ = - input.readMessage( - com.google.storage.v2.ObjectChecksums.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(objectChecksums_); - objectChecksums_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - com.google.storage.v2.ContentRange.Builder subBuilder = null; - if (contentRange_ != null) { - subBuilder = contentRange_.toBuilder(); - } - contentRange_ = - input.readMessage(com.google.storage.v2.ContentRange.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(contentRange_); - contentRange_ = subBuilder.buildPartial(); - } - - break; - } - case 34: - { - com.google.storage.v2.Object.Builder subBuilder = null; - if (metadata_ != null) { - subBuilder = metadata_.toBuilder(); - } - metadata_ = - input.readMessage(com.google.storage.v2.Object.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(metadata_); - metadata_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ReadObjectResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ReadObjectResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ReadObjectResponse.class, - com.google.storage.v2.ReadObjectResponse.Builder.class); - } - - public static final int CHECKSUMMED_DATA_FIELD_NUMBER = 1; - private com.google.storage.v2.ChecksummedData checksummedData_; - /** - * - * - *
-   * A portion of the data for the object. The service **may** leave `data`
-   * empty for any given `ReadResponse`. This enables the service to inform the
-   * client that the request is still live while it is running an operation to
-   * generate more data.
-   * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 1; - * - * @return Whether the checksummedData field is set. - */ - @java.lang.Override - public boolean hasChecksummedData() { - return checksummedData_ != null; - } - /** - * - * - *
-   * A portion of the data for the object. The service **may** leave `data`
-   * empty for any given `ReadResponse`. This enables the service to inform the
-   * client that the request is still live while it is running an operation to
-   * generate more data.
-   * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 1; - * - * @return The checksummedData. - */ - @java.lang.Override - public com.google.storage.v2.ChecksummedData getChecksummedData() { - return checksummedData_ == null - ? com.google.storage.v2.ChecksummedData.getDefaultInstance() - : checksummedData_; - } - /** - * - * - *
-   * A portion of the data for the object. The service **may** leave `data`
-   * empty for any given `ReadResponse`. This enables the service to inform the
-   * client that the request is still live while it is running an operation to
-   * generate more data.
-   * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 1; - */ - @java.lang.Override - public com.google.storage.v2.ChecksummedDataOrBuilder getChecksummedDataOrBuilder() { - return getChecksummedData(); - } - - public static final int OBJECT_CHECKSUMS_FIELD_NUMBER = 2; - private com.google.storage.v2.ObjectChecksums objectChecksums_; - /** - * - * - *
-   * The checksums of the complete object. The client should compute one of
-   * these checksums over the downloaded object and compare it against the value
-   * provided here.
-   * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 2; - * - * @return Whether the objectChecksums field is set. - */ - @java.lang.Override - public boolean hasObjectChecksums() { - return objectChecksums_ != null; - } - /** - * - * - *
-   * The checksums of the complete object. The client should compute one of
-   * these checksums over the downloaded object and compare it against the value
-   * provided here.
-   * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 2; - * - * @return The objectChecksums. - */ - @java.lang.Override - public com.google.storage.v2.ObjectChecksums getObjectChecksums() { - return objectChecksums_ == null - ? com.google.storage.v2.ObjectChecksums.getDefaultInstance() - : objectChecksums_; - } - /** - * - * - *
-   * The checksums of the complete object. The client should compute one of
-   * these checksums over the downloaded object and compare it against the value
-   * provided here.
-   * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 2; - */ - @java.lang.Override - public com.google.storage.v2.ObjectChecksumsOrBuilder getObjectChecksumsOrBuilder() { - return getObjectChecksums(); - } - - public static final int CONTENT_RANGE_FIELD_NUMBER = 3; - private com.google.storage.v2.ContentRange contentRange_; - /** - * - * - *
-   * If read_offset and or read_limit was specified on the
-   * ReadObjectRequest, ContentRange will be populated on the first
-   * ReadObjectResponse message of the read stream.
-   * 
- * - * .google.storage.v2.ContentRange content_range = 3; - * - * @return Whether the contentRange field is set. - */ - @java.lang.Override - public boolean hasContentRange() { - return contentRange_ != null; - } - /** - * - * - *
-   * If read_offset and or read_limit was specified on the
-   * ReadObjectRequest, ContentRange will be populated on the first
-   * ReadObjectResponse message of the read stream.
-   * 
- * - * .google.storage.v2.ContentRange content_range = 3; - * - * @return The contentRange. - */ - @java.lang.Override - public com.google.storage.v2.ContentRange getContentRange() { - return contentRange_ == null - ? com.google.storage.v2.ContentRange.getDefaultInstance() - : contentRange_; - } - /** - * - * - *
-   * If read_offset and or read_limit was specified on the
-   * ReadObjectRequest, ContentRange will be populated on the first
-   * ReadObjectResponse message of the read stream.
-   * 
- * - * .google.storage.v2.ContentRange content_range = 3; - */ - @java.lang.Override - public com.google.storage.v2.ContentRangeOrBuilder getContentRangeOrBuilder() { - return getContentRange(); - } - - public static final int METADATA_FIELD_NUMBER = 4; - private com.google.storage.v2.Object metadata_; - /** - * - * - *
-   * Metadata of the object whose media is being returned.
-   * Only populated in the first response in the stream.
-   * 
- * - * .google.storage.v2.Object metadata = 4; - * - * @return Whether the metadata field is set. - */ - @java.lang.Override - public boolean hasMetadata() { - return metadata_ != null; - } - /** - * - * - *
-   * Metadata of the object whose media is being returned.
-   * Only populated in the first response in the stream.
-   * 
- * - * .google.storage.v2.Object metadata = 4; - * - * @return The metadata. - */ - @java.lang.Override - public com.google.storage.v2.Object getMetadata() { - return metadata_ == null ? com.google.storage.v2.Object.getDefaultInstance() : metadata_; - } - /** - * - * - *
-   * Metadata of the object whose media is being returned.
-   * Only populated in the first response in the stream.
-   * 
- * - * .google.storage.v2.Object metadata = 4; - */ - @java.lang.Override - public com.google.storage.v2.ObjectOrBuilder getMetadataOrBuilder() { - return getMetadata(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (checksummedData_ != null) { - output.writeMessage(1, getChecksummedData()); - } - if (objectChecksums_ != null) { - output.writeMessage(2, getObjectChecksums()); - } - if (contentRange_ != null) { - output.writeMessage(3, getContentRange()); - } - if (metadata_ != null) { - output.writeMessage(4, getMetadata()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (checksummedData_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getChecksummedData()); - } - if (objectChecksums_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getObjectChecksums()); - } - if (contentRange_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getContentRange()); - } - if (metadata_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getMetadata()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.ReadObjectResponse)) { - return super.equals(obj); - } - com.google.storage.v2.ReadObjectResponse other = (com.google.storage.v2.ReadObjectResponse) obj; - - if (hasChecksummedData() != other.hasChecksummedData()) return false; - if (hasChecksummedData()) { - if (!getChecksummedData().equals(other.getChecksummedData())) return false; - } - if (hasObjectChecksums() != other.hasObjectChecksums()) return false; - if (hasObjectChecksums()) { - if (!getObjectChecksums().equals(other.getObjectChecksums())) return false; - } - if (hasContentRange() != other.hasContentRange()) return false; - if (hasContentRange()) { - if (!getContentRange().equals(other.getContentRange())) return false; - } - if (hasMetadata() != other.hasMetadata()) return false; - if (hasMetadata()) { - if (!getMetadata().equals(other.getMetadata())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasChecksummedData()) { - hash = (37 * hash) + CHECKSUMMED_DATA_FIELD_NUMBER; - hash = (53 * hash) + getChecksummedData().hashCode(); - } - if (hasObjectChecksums()) { - hash = (37 * hash) + OBJECT_CHECKSUMS_FIELD_NUMBER; - hash = (53 * hash) + getObjectChecksums().hashCode(); - } - if (hasContentRange()) { - hash = (37 * hash) + CONTENT_RANGE_FIELD_NUMBER; - hash = (53 * hash) + getContentRange().hashCode(); - } - if (hasMetadata()) { - hash = (37 * hash) + METADATA_FIELD_NUMBER; - hash = (53 * hash) + getMetadata().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.ReadObjectResponse parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ReadObjectResponse parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ReadObjectResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ReadObjectResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ReadObjectResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ReadObjectResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ReadObjectResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ReadObjectResponse parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.ReadObjectResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ReadObjectResponse parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.ReadObjectResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ReadObjectResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.ReadObjectResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Response message for GetObject.
-   * 
- * - * Protobuf type {@code google.storage.v2.ReadObjectResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.ReadObjectResponse) - com.google.storage.v2.ReadObjectResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ReadObjectResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ReadObjectResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ReadObjectResponse.class, - com.google.storage.v2.ReadObjectResponse.Builder.class); - } - - // Construct using com.google.storage.v2.ReadObjectResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (checksummedDataBuilder_ == null) { - checksummedData_ = null; - } else { - checksummedData_ = null; - checksummedDataBuilder_ = null; - } - if (objectChecksumsBuilder_ == null) { - objectChecksums_ = null; - } else { - objectChecksums_ = null; - objectChecksumsBuilder_ = null; - } - if (contentRangeBuilder_ == null) { - contentRange_ = null; - } else { - contentRange_ = null; - contentRangeBuilder_ = null; - } - if (metadataBuilder_ == null) { - metadata_ = null; - } else { - metadata_ = null; - metadataBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ReadObjectResponse_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.ReadObjectResponse getDefaultInstanceForType() { - return com.google.storage.v2.ReadObjectResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.ReadObjectResponse build() { - com.google.storage.v2.ReadObjectResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.ReadObjectResponse buildPartial() { - com.google.storage.v2.ReadObjectResponse result = - new com.google.storage.v2.ReadObjectResponse(this); - if (checksummedDataBuilder_ == null) { - result.checksummedData_ = checksummedData_; - } else { - result.checksummedData_ = checksummedDataBuilder_.build(); - } - if (objectChecksumsBuilder_ == null) { - result.objectChecksums_ = objectChecksums_; - } else { - result.objectChecksums_ = objectChecksumsBuilder_.build(); - } - if (contentRangeBuilder_ == null) { - result.contentRange_ = contentRange_; - } else { - result.contentRange_ = contentRangeBuilder_.build(); - } - if (metadataBuilder_ == null) { - result.metadata_ = metadata_; - } else { - result.metadata_ = metadataBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.ReadObjectResponse) { - return mergeFrom((com.google.storage.v2.ReadObjectResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.ReadObjectResponse other) { - if (other == com.google.storage.v2.ReadObjectResponse.getDefaultInstance()) return this; - if (other.hasChecksummedData()) { - mergeChecksummedData(other.getChecksummedData()); - } - if (other.hasObjectChecksums()) { - mergeObjectChecksums(other.getObjectChecksums()); - } - if (other.hasContentRange()) { - mergeContentRange(other.getContentRange()); - } - if (other.hasMetadata()) { - mergeMetadata(other.getMetadata()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.ReadObjectResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.ReadObjectResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.storage.v2.ChecksummedData checksummedData_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ChecksummedData, - com.google.storage.v2.ChecksummedData.Builder, - com.google.storage.v2.ChecksummedDataOrBuilder> - checksummedDataBuilder_; - /** - * - * - *
-     * A portion of the data for the object. The service **may** leave `data`
-     * empty for any given `ReadResponse`. This enables the service to inform the
-     * client that the request is still live while it is running an operation to
-     * generate more data.
-     * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 1; - * - * @return Whether the checksummedData field is set. - */ - public boolean hasChecksummedData() { - return checksummedDataBuilder_ != null || checksummedData_ != null; - } - /** - * - * - *
-     * A portion of the data for the object. The service **may** leave `data`
-     * empty for any given `ReadResponse`. This enables the service to inform the
-     * client that the request is still live while it is running an operation to
-     * generate more data.
-     * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 1; - * - * @return The checksummedData. - */ - public com.google.storage.v2.ChecksummedData getChecksummedData() { - if (checksummedDataBuilder_ == null) { - return checksummedData_ == null - ? com.google.storage.v2.ChecksummedData.getDefaultInstance() - : checksummedData_; - } else { - return checksummedDataBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A portion of the data for the object. The service **may** leave `data`
-     * empty for any given `ReadResponse`. This enables the service to inform the
-     * client that the request is still live while it is running an operation to
-     * generate more data.
-     * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 1; - */ - public Builder setChecksummedData(com.google.storage.v2.ChecksummedData value) { - if (checksummedDataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - checksummedData_ = value; - onChanged(); - } else { - checksummedDataBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A portion of the data for the object. The service **may** leave `data`
-     * empty for any given `ReadResponse`. This enables the service to inform the
-     * client that the request is still live while it is running an operation to
-     * generate more data.
-     * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 1; - */ - public Builder setChecksummedData( - com.google.storage.v2.ChecksummedData.Builder builderForValue) { - if (checksummedDataBuilder_ == null) { - checksummedData_ = builderForValue.build(); - onChanged(); - } else { - checksummedDataBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A portion of the data for the object. The service **may** leave `data`
-     * empty for any given `ReadResponse`. This enables the service to inform the
-     * client that the request is still live while it is running an operation to
-     * generate more data.
-     * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 1; - */ - public Builder mergeChecksummedData(com.google.storage.v2.ChecksummedData value) { - if (checksummedDataBuilder_ == null) { - if (checksummedData_ != null) { - checksummedData_ = - com.google.storage.v2.ChecksummedData.newBuilder(checksummedData_) - .mergeFrom(value) - .buildPartial(); - } else { - checksummedData_ = value; - } - onChanged(); - } else { - checksummedDataBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A portion of the data for the object. The service **may** leave `data`
-     * empty for any given `ReadResponse`. This enables the service to inform the
-     * client that the request is still live while it is running an operation to
-     * generate more data.
-     * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 1; - */ - public Builder clearChecksummedData() { - if (checksummedDataBuilder_ == null) { - checksummedData_ = null; - onChanged(); - } else { - checksummedData_ = null; - checksummedDataBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A portion of the data for the object. The service **may** leave `data`
-     * empty for any given `ReadResponse`. This enables the service to inform the
-     * client that the request is still live while it is running an operation to
-     * generate more data.
-     * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 1; - */ - public com.google.storage.v2.ChecksummedData.Builder getChecksummedDataBuilder() { - - onChanged(); - return getChecksummedDataFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A portion of the data for the object. The service **may** leave `data`
-     * empty for any given `ReadResponse`. This enables the service to inform the
-     * client that the request is still live while it is running an operation to
-     * generate more data.
-     * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 1; - */ - public com.google.storage.v2.ChecksummedDataOrBuilder getChecksummedDataOrBuilder() { - if (checksummedDataBuilder_ != null) { - return checksummedDataBuilder_.getMessageOrBuilder(); - } else { - return checksummedData_ == null - ? com.google.storage.v2.ChecksummedData.getDefaultInstance() - : checksummedData_; - } - } - /** - * - * - *
-     * A portion of the data for the object. The service **may** leave `data`
-     * empty for any given `ReadResponse`. This enables the service to inform the
-     * client that the request is still live while it is running an operation to
-     * generate more data.
-     * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ChecksummedData, - com.google.storage.v2.ChecksummedData.Builder, - com.google.storage.v2.ChecksummedDataOrBuilder> - getChecksummedDataFieldBuilder() { - if (checksummedDataBuilder_ == null) { - checksummedDataBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ChecksummedData, - com.google.storage.v2.ChecksummedData.Builder, - com.google.storage.v2.ChecksummedDataOrBuilder>( - getChecksummedData(), getParentForChildren(), isClean()); - checksummedData_ = null; - } - return checksummedDataBuilder_; - } - - private com.google.storage.v2.ObjectChecksums objectChecksums_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ObjectChecksums, - com.google.storage.v2.ObjectChecksums.Builder, - com.google.storage.v2.ObjectChecksumsOrBuilder> - objectChecksumsBuilder_; - /** - * - * - *
-     * The checksums of the complete object. The client should compute one of
-     * these checksums over the downloaded object and compare it against the value
-     * provided here.
-     * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 2; - * - * @return Whether the objectChecksums field is set. - */ - public boolean hasObjectChecksums() { - return objectChecksumsBuilder_ != null || objectChecksums_ != null; - } - /** - * - * - *
-     * The checksums of the complete object. The client should compute one of
-     * these checksums over the downloaded object and compare it against the value
-     * provided here.
-     * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 2; - * - * @return The objectChecksums. - */ - public com.google.storage.v2.ObjectChecksums getObjectChecksums() { - if (objectChecksumsBuilder_ == null) { - return objectChecksums_ == null - ? com.google.storage.v2.ObjectChecksums.getDefaultInstance() - : objectChecksums_; - } else { - return objectChecksumsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The checksums of the complete object. The client should compute one of
-     * these checksums over the downloaded object and compare it against the value
-     * provided here.
-     * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 2; - */ - public Builder setObjectChecksums(com.google.storage.v2.ObjectChecksums value) { - if (objectChecksumsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - objectChecksums_ = value; - onChanged(); - } else { - objectChecksumsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * The checksums of the complete object. The client should compute one of
-     * these checksums over the downloaded object and compare it against the value
-     * provided here.
-     * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 2; - */ - public Builder setObjectChecksums( - com.google.storage.v2.ObjectChecksums.Builder builderForValue) { - if (objectChecksumsBuilder_ == null) { - objectChecksums_ = builderForValue.build(); - onChanged(); - } else { - objectChecksumsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * The checksums of the complete object. The client should compute one of
-     * these checksums over the downloaded object and compare it against the value
-     * provided here.
-     * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 2; - */ - public Builder mergeObjectChecksums(com.google.storage.v2.ObjectChecksums value) { - if (objectChecksumsBuilder_ == null) { - if (objectChecksums_ != null) { - objectChecksums_ = - com.google.storage.v2.ObjectChecksums.newBuilder(objectChecksums_) - .mergeFrom(value) - .buildPartial(); - } else { - objectChecksums_ = value; - } - onChanged(); - } else { - objectChecksumsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * The checksums of the complete object. The client should compute one of
-     * these checksums over the downloaded object and compare it against the value
-     * provided here.
-     * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 2; - */ - public Builder clearObjectChecksums() { - if (objectChecksumsBuilder_ == null) { - objectChecksums_ = null; - onChanged(); - } else { - objectChecksums_ = null; - objectChecksumsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * The checksums of the complete object. The client should compute one of
-     * these checksums over the downloaded object and compare it against the value
-     * provided here.
-     * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 2; - */ - public com.google.storage.v2.ObjectChecksums.Builder getObjectChecksumsBuilder() { - - onChanged(); - return getObjectChecksumsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The checksums of the complete object. The client should compute one of
-     * these checksums over the downloaded object and compare it against the value
-     * provided here.
-     * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 2; - */ - public com.google.storage.v2.ObjectChecksumsOrBuilder getObjectChecksumsOrBuilder() { - if (objectChecksumsBuilder_ != null) { - return objectChecksumsBuilder_.getMessageOrBuilder(); - } else { - return objectChecksums_ == null - ? com.google.storage.v2.ObjectChecksums.getDefaultInstance() - : objectChecksums_; - } - } - /** - * - * - *
-     * The checksums of the complete object. The client should compute one of
-     * these checksums over the downloaded object and compare it against the value
-     * provided here.
-     * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ObjectChecksums, - com.google.storage.v2.ObjectChecksums.Builder, - com.google.storage.v2.ObjectChecksumsOrBuilder> - getObjectChecksumsFieldBuilder() { - if (objectChecksumsBuilder_ == null) { - objectChecksumsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ObjectChecksums, - com.google.storage.v2.ObjectChecksums.Builder, - com.google.storage.v2.ObjectChecksumsOrBuilder>( - getObjectChecksums(), getParentForChildren(), isClean()); - objectChecksums_ = null; - } - return objectChecksumsBuilder_; - } - - private com.google.storage.v2.ContentRange contentRange_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ContentRange, - com.google.storage.v2.ContentRange.Builder, - com.google.storage.v2.ContentRangeOrBuilder> - contentRangeBuilder_; - /** - * - * - *
-     * If read_offset and or read_limit was specified on the
-     * ReadObjectRequest, ContentRange will be populated on the first
-     * ReadObjectResponse message of the read stream.
-     * 
- * - * .google.storage.v2.ContentRange content_range = 3; - * - * @return Whether the contentRange field is set. - */ - public boolean hasContentRange() { - return contentRangeBuilder_ != null || contentRange_ != null; - } - /** - * - * - *
-     * If read_offset and or read_limit was specified on the
-     * ReadObjectRequest, ContentRange will be populated on the first
-     * ReadObjectResponse message of the read stream.
-     * 
- * - * .google.storage.v2.ContentRange content_range = 3; - * - * @return The contentRange. - */ - public com.google.storage.v2.ContentRange getContentRange() { - if (contentRangeBuilder_ == null) { - return contentRange_ == null - ? com.google.storage.v2.ContentRange.getDefaultInstance() - : contentRange_; - } else { - return contentRangeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * If read_offset and or read_limit was specified on the
-     * ReadObjectRequest, ContentRange will be populated on the first
-     * ReadObjectResponse message of the read stream.
-     * 
- * - * .google.storage.v2.ContentRange content_range = 3; - */ - public Builder setContentRange(com.google.storage.v2.ContentRange value) { - if (contentRangeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - contentRange_ = value; - onChanged(); - } else { - contentRangeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * If read_offset and or read_limit was specified on the
-     * ReadObjectRequest, ContentRange will be populated on the first
-     * ReadObjectResponse message of the read stream.
-     * 
- * - * .google.storage.v2.ContentRange content_range = 3; - */ - public Builder setContentRange(com.google.storage.v2.ContentRange.Builder builderForValue) { - if (contentRangeBuilder_ == null) { - contentRange_ = builderForValue.build(); - onChanged(); - } else { - contentRangeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * If read_offset and or read_limit was specified on the
-     * ReadObjectRequest, ContentRange will be populated on the first
-     * ReadObjectResponse message of the read stream.
-     * 
- * - * .google.storage.v2.ContentRange content_range = 3; - */ - public Builder mergeContentRange(com.google.storage.v2.ContentRange value) { - if (contentRangeBuilder_ == null) { - if (contentRange_ != null) { - contentRange_ = - com.google.storage.v2.ContentRange.newBuilder(contentRange_) - .mergeFrom(value) - .buildPartial(); - } else { - contentRange_ = value; - } - onChanged(); - } else { - contentRangeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * If read_offset and or read_limit was specified on the
-     * ReadObjectRequest, ContentRange will be populated on the first
-     * ReadObjectResponse message of the read stream.
-     * 
- * - * .google.storage.v2.ContentRange content_range = 3; - */ - public Builder clearContentRange() { - if (contentRangeBuilder_ == null) { - contentRange_ = null; - onChanged(); - } else { - contentRange_ = null; - contentRangeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * If read_offset and or read_limit was specified on the
-     * ReadObjectRequest, ContentRange will be populated on the first
-     * ReadObjectResponse message of the read stream.
-     * 
- * - * .google.storage.v2.ContentRange content_range = 3; - */ - public com.google.storage.v2.ContentRange.Builder getContentRangeBuilder() { - - onChanged(); - return getContentRangeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * If read_offset and or read_limit was specified on the
-     * ReadObjectRequest, ContentRange will be populated on the first
-     * ReadObjectResponse message of the read stream.
-     * 
- * - * .google.storage.v2.ContentRange content_range = 3; - */ - public com.google.storage.v2.ContentRangeOrBuilder getContentRangeOrBuilder() { - if (contentRangeBuilder_ != null) { - return contentRangeBuilder_.getMessageOrBuilder(); - } else { - return contentRange_ == null - ? com.google.storage.v2.ContentRange.getDefaultInstance() - : contentRange_; - } - } - /** - * - * - *
-     * If read_offset and or read_limit was specified on the
-     * ReadObjectRequest, ContentRange will be populated on the first
-     * ReadObjectResponse message of the read stream.
-     * 
- * - * .google.storage.v2.ContentRange content_range = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ContentRange, - com.google.storage.v2.ContentRange.Builder, - com.google.storage.v2.ContentRangeOrBuilder> - getContentRangeFieldBuilder() { - if (contentRangeBuilder_ == null) { - contentRangeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ContentRange, - com.google.storage.v2.ContentRange.Builder, - com.google.storage.v2.ContentRangeOrBuilder>( - getContentRange(), getParentForChildren(), isClean()); - contentRange_ = null; - } - return contentRangeBuilder_; - } - - private com.google.storage.v2.Object metadata_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder> - metadataBuilder_; - /** - * - * - *
-     * Metadata of the object whose media is being returned.
-     * Only populated in the first response in the stream.
-     * 
- * - * .google.storage.v2.Object metadata = 4; - * - * @return Whether the metadata field is set. - */ - public boolean hasMetadata() { - return metadataBuilder_ != null || metadata_ != null; - } - /** - * - * - *
-     * Metadata of the object whose media is being returned.
-     * Only populated in the first response in the stream.
-     * 
- * - * .google.storage.v2.Object metadata = 4; - * - * @return The metadata. - */ - public com.google.storage.v2.Object getMetadata() { - if (metadataBuilder_ == null) { - return metadata_ == null ? com.google.storage.v2.Object.getDefaultInstance() : metadata_; - } else { - return metadataBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Metadata of the object whose media is being returned.
-     * Only populated in the first response in the stream.
-     * 
- * - * .google.storage.v2.Object metadata = 4; - */ - public Builder setMetadata(com.google.storage.v2.Object value) { - if (metadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - metadata_ = value; - onChanged(); - } else { - metadataBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Metadata of the object whose media is being returned.
-     * Only populated in the first response in the stream.
-     * 
- * - * .google.storage.v2.Object metadata = 4; - */ - public Builder setMetadata(com.google.storage.v2.Object.Builder builderForValue) { - if (metadataBuilder_ == null) { - metadata_ = builderForValue.build(); - onChanged(); - } else { - metadataBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Metadata of the object whose media is being returned.
-     * Only populated in the first response in the stream.
-     * 
- * - * .google.storage.v2.Object metadata = 4; - */ - public Builder mergeMetadata(com.google.storage.v2.Object value) { - if (metadataBuilder_ == null) { - if (metadata_ != null) { - metadata_ = - com.google.storage.v2.Object.newBuilder(metadata_).mergeFrom(value).buildPartial(); - } else { - metadata_ = value; - } - onChanged(); - } else { - metadataBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Metadata of the object whose media is being returned.
-     * Only populated in the first response in the stream.
-     * 
- * - * .google.storage.v2.Object metadata = 4; - */ - public Builder clearMetadata() { - if (metadataBuilder_ == null) { - metadata_ = null; - onChanged(); - } else { - metadata_ = null; - metadataBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Metadata of the object whose media is being returned.
-     * Only populated in the first response in the stream.
-     * 
- * - * .google.storage.v2.Object metadata = 4; - */ - public com.google.storage.v2.Object.Builder getMetadataBuilder() { - - onChanged(); - return getMetadataFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Metadata of the object whose media is being returned.
-     * Only populated in the first response in the stream.
-     * 
- * - * .google.storage.v2.Object metadata = 4; - */ - public com.google.storage.v2.ObjectOrBuilder getMetadataOrBuilder() { - if (metadataBuilder_ != null) { - return metadataBuilder_.getMessageOrBuilder(); - } else { - return metadata_ == null ? com.google.storage.v2.Object.getDefaultInstance() : metadata_; - } - } - /** - * - * - *
-     * Metadata of the object whose media is being returned.
-     * Only populated in the first response in the stream.
-     * 
- * - * .google.storage.v2.Object metadata = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder> - getMetadataFieldBuilder() { - if (metadataBuilder_ == null) { - metadataBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder>( - getMetadata(), getParentForChildren(), isClean()); - metadata_ = null; - } - return metadataBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.ReadObjectResponse) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.ReadObjectResponse) - private static final com.google.storage.v2.ReadObjectResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.ReadObjectResponse(); - } - - public static com.google.storage.v2.ReadObjectResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ReadObjectResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ReadObjectResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.ReadObjectResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectResponseOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectResponseOrBuilder.java deleted file mode 100644 index 6fea82c9bf..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectResponseOrBuilder.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface ReadObjectResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.ReadObjectResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * A portion of the data for the object. The service **may** leave `data`
-   * empty for any given `ReadResponse`. This enables the service to inform the
-   * client that the request is still live while it is running an operation to
-   * generate more data.
-   * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 1; - * - * @return Whether the checksummedData field is set. - */ - boolean hasChecksummedData(); - /** - * - * - *
-   * A portion of the data for the object. The service **may** leave `data`
-   * empty for any given `ReadResponse`. This enables the service to inform the
-   * client that the request is still live while it is running an operation to
-   * generate more data.
-   * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 1; - * - * @return The checksummedData. - */ - com.google.storage.v2.ChecksummedData getChecksummedData(); - /** - * - * - *
-   * A portion of the data for the object. The service **may** leave `data`
-   * empty for any given `ReadResponse`. This enables the service to inform the
-   * client that the request is still live while it is running an operation to
-   * generate more data.
-   * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 1; - */ - com.google.storage.v2.ChecksummedDataOrBuilder getChecksummedDataOrBuilder(); - - /** - * - * - *
-   * The checksums of the complete object. The client should compute one of
-   * these checksums over the downloaded object and compare it against the value
-   * provided here.
-   * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 2; - * - * @return Whether the objectChecksums field is set. - */ - boolean hasObjectChecksums(); - /** - * - * - *
-   * The checksums of the complete object. The client should compute one of
-   * these checksums over the downloaded object and compare it against the value
-   * provided here.
-   * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 2; - * - * @return The objectChecksums. - */ - com.google.storage.v2.ObjectChecksums getObjectChecksums(); - /** - * - * - *
-   * The checksums of the complete object. The client should compute one of
-   * these checksums over the downloaded object and compare it against the value
-   * provided here.
-   * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 2; - */ - com.google.storage.v2.ObjectChecksumsOrBuilder getObjectChecksumsOrBuilder(); - - /** - * - * - *
-   * If read_offset and or read_limit was specified on the
-   * ReadObjectRequest, ContentRange will be populated on the first
-   * ReadObjectResponse message of the read stream.
-   * 
- * - * .google.storage.v2.ContentRange content_range = 3; - * - * @return Whether the contentRange field is set. - */ - boolean hasContentRange(); - /** - * - * - *
-   * If read_offset and or read_limit was specified on the
-   * ReadObjectRequest, ContentRange will be populated on the first
-   * ReadObjectResponse message of the read stream.
-   * 
- * - * .google.storage.v2.ContentRange content_range = 3; - * - * @return The contentRange. - */ - com.google.storage.v2.ContentRange getContentRange(); - /** - * - * - *
-   * If read_offset and or read_limit was specified on the
-   * ReadObjectRequest, ContentRange will be populated on the first
-   * ReadObjectResponse message of the read stream.
-   * 
- * - * .google.storage.v2.ContentRange content_range = 3; - */ - com.google.storage.v2.ContentRangeOrBuilder getContentRangeOrBuilder(); - - /** - * - * - *
-   * Metadata of the object whose media is being returned.
-   * Only populated in the first response in the stream.
-   * 
- * - * .google.storage.v2.Object metadata = 4; - * - * @return Whether the metadata field is set. - */ - boolean hasMetadata(); - /** - * - * - *
-   * Metadata of the object whose media is being returned.
-   * Only populated in the first response in the stream.
-   * 
- * - * .google.storage.v2.Object metadata = 4; - * - * @return The metadata. - */ - com.google.storage.v2.Object getMetadata(); - /** - * - * - *
-   * Metadata of the object whose media is being returned.
-   * Only populated in the first response in the stream.
-   * 
- * - * .google.storage.v2.Object metadata = 4; - */ - com.google.storage.v2.ObjectOrBuilder getMetadataOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/RewriteObjectRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/RewriteObjectRequest.java deleted file mode 100644 index 1a69d9a09f..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/RewriteObjectRequest.java +++ /dev/null @@ -1,4444 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request message for RewriteObject.
- * If the source object is encrypted using a Customer-Supplied Encryption Key
- * the key information must be provided in the copy_source_encryption_algorithm,
- * copy_source_encryption_key_bytes, and copy_source_encryption_key_sha256_bytes
- * fields. If the destination object should be encrypted the keying information
- * should be provided in the encryption_algorithm, encryption_key_bytes, and
- * encryption_key_sha256_bytes fields of the
- * common_object_request_params.customer_encryption field.
- * 
- * - * Protobuf type {@code google.storage.v2.RewriteObjectRequest} - */ -public final class RewriteObjectRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.RewriteObjectRequest) - RewriteObjectRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use RewriteObjectRequest.newBuilder() to construct. - private RewriteObjectRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private RewriteObjectRequest() { - destinationName_ = ""; - destinationBucket_ = ""; - destinationKmsKey_ = ""; - sourceBucket_ = ""; - sourceObject_ = ""; - rewriteToken_ = ""; - destinationPredefinedAcl_ = 0; - copySourceEncryptionAlgorithm_ = ""; - copySourceEncryptionKeyBytes_ = com.google.protobuf.ByteString.EMPTY; - copySourceEncryptionKeySha256Bytes_ = com.google.protobuf.ByteString.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RewriteObjectRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private RewriteObjectRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.storage.v2.Object.Builder subBuilder = null; - if (destination_ != null) { - subBuilder = destination_.toBuilder(); - } - destination_ = - input.readMessage(com.google.storage.v2.Object.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(destination_); - destination_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - sourceBucket_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - sourceObject_ = s; - break; - } - case 32: - { - sourceGeneration_ = input.readInt64(); - break; - } - case 42: - { - java.lang.String s = input.readStringRequireUtf8(); - - rewriteToken_ = s; - break; - } - case 48: - { - int rawValue = input.readEnum(); - - destinationPredefinedAcl_ = rawValue; - break; - } - case 56: - { - bitField0_ |= 0x00000001; - ifGenerationMatch_ = input.readInt64(); - break; - } - case 64: - { - bitField0_ |= 0x00000002; - ifGenerationNotMatch_ = input.readInt64(); - break; - } - case 72: - { - bitField0_ |= 0x00000004; - ifMetagenerationMatch_ = input.readInt64(); - break; - } - case 80: - { - bitField0_ |= 0x00000008; - ifMetagenerationNotMatch_ = input.readInt64(); - break; - } - case 88: - { - bitField0_ |= 0x00000010; - ifSourceGenerationMatch_ = input.readInt64(); - break; - } - case 96: - { - bitField0_ |= 0x00000020; - ifSourceGenerationNotMatch_ = input.readInt64(); - break; - } - case 104: - { - bitField0_ |= 0x00000040; - ifSourceMetagenerationMatch_ = input.readInt64(); - break; - } - case 112: - { - bitField0_ |= 0x00000080; - ifSourceMetagenerationNotMatch_ = input.readInt64(); - break; - } - case 120: - { - maxBytesRewrittenPerCall_ = input.readInt64(); - break; - } - case 130: - { - java.lang.String s = input.readStringRequireUtf8(); - - copySourceEncryptionAlgorithm_ = s; - break; - } - case 154: - { - com.google.storage.v2.CommonObjectRequestParams.Builder subBuilder = null; - if (commonObjectRequestParams_ != null) { - subBuilder = commonObjectRequestParams_.toBuilder(); - } - commonObjectRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonObjectRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonObjectRequestParams_); - commonObjectRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - case 162: - { - com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; - if (commonRequestParams_ != null) { - subBuilder = commonRequestParams_.toBuilder(); - } - commonRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonRequestParams_); - commonRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - case 170: - { - copySourceEncryptionKeyBytes_ = input.readBytes(); - break; - } - case 178: - { - copySourceEncryptionKeySha256Bytes_ = input.readBytes(); - break; - } - case 194: - { - java.lang.String s = input.readStringRequireUtf8(); - - destinationName_ = s; - break; - } - case 202: - { - java.lang.String s = input.readStringRequireUtf8(); - - destinationBucket_ = s; - break; - } - case 218: - { - java.lang.String s = input.readStringRequireUtf8(); - - destinationKmsKey_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_RewriteObjectRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_RewriteObjectRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.RewriteObjectRequest.class, - com.google.storage.v2.RewriteObjectRequest.Builder.class); - } - - private int bitField0_; - public static final int DESTINATION_NAME_FIELD_NUMBER = 24; - private volatile java.lang.Object destinationName_; - /** - * - * - *
-   * Immutable. The name of the destination object. Nearly any sequence of unicode
-   * characters is valid. See
-   * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
-   * Example: `test.txt`
-   * The `name` field by itself does not uniquely identify a Cloud Storage
-   * object. A Cloud Storage object is uniquely identified by the tuple of
-   * (bucket, object, generation).
-   * 
- * - * string destination_name = 24 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The destinationName. - */ - @java.lang.Override - public java.lang.String getDestinationName() { - java.lang.Object ref = destinationName_; - 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(); - destinationName_ = s; - return s; - } - } - /** - * - * - *
-   * Immutable. The name of the destination object. Nearly any sequence of unicode
-   * characters is valid. See
-   * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
-   * Example: `test.txt`
-   * The `name` field by itself does not uniquely identify a Cloud Storage
-   * object. A Cloud Storage object is uniquely identified by the tuple of
-   * (bucket, object, generation).
-   * 
- * - * string destination_name = 24 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The bytes for destinationName. - */ - @java.lang.Override - public com.google.protobuf.ByteString getDestinationNameBytes() { - java.lang.Object ref = destinationName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - destinationName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DESTINATION_BUCKET_FIELD_NUMBER = 25; - private volatile java.lang.Object destinationBucket_; - /** - * - * - *
-   * Immutable. The name of the bucket containing The name of the destination object.
-   * 
- * - * - * string destination_bucket = 25 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @return The destinationBucket. - */ - @java.lang.Override - public java.lang.String getDestinationBucket() { - java.lang.Object ref = destinationBucket_; - 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(); - destinationBucket_ = s; - return s; - } - } - /** - * - * - *
-   * Immutable. The name of the bucket containing The name of the destination object.
-   * 
- * - * - * string destination_bucket = 25 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for destinationBucket. - */ - @java.lang.Override - public com.google.protobuf.ByteString getDestinationBucketBytes() { - java.lang.Object ref = destinationBucket_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - destinationBucket_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DESTINATION_KMS_KEY_FIELD_NUMBER = 27; - private volatile java.lang.Object destinationKmsKey_; - /** - * - * - *
-   * The name of the Cloud KMS key that will be used to encrypt the destination
-   * object. The Cloud KMS key must be located in same location as the object.
-   * If the parameter is not specified, the request uses the destination
-   * bucket's default encryption key, if any, or else the Google-managed
-   * encryption key.
-   * 
- * - * string destination_kms_key = 27 [(.google.api.resource_reference) = { ... } - * - * @return The destinationKmsKey. - */ - @java.lang.Override - public java.lang.String getDestinationKmsKey() { - java.lang.Object ref = destinationKmsKey_; - 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(); - destinationKmsKey_ = s; - return s; - } - } - /** - * - * - *
-   * The name of the Cloud KMS key that will be used to encrypt the destination
-   * object. The Cloud KMS key must be located in same location as the object.
-   * If the parameter is not specified, the request uses the destination
-   * bucket's default encryption key, if any, or else the Google-managed
-   * encryption key.
-   * 
- * - * string destination_kms_key = 27 [(.google.api.resource_reference) = { ... } - * - * @return The bytes for destinationKmsKey. - */ - @java.lang.Override - public com.google.protobuf.ByteString getDestinationKmsKeyBytes() { - java.lang.Object ref = destinationKmsKey_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - destinationKmsKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DESTINATION_FIELD_NUMBER = 1; - private com.google.storage.v2.Object destination_; - /** - * - * - *
-   * Properties of the destination, post-rewrite object.
-   * The `name`, `bucket` and `kms_key` fields must not be populated (these
-   * values are specified in the `destination_name`, `destination_bucket`, and
-   * `destination_kms_key` fields).
-   * If `destination` is present it will be used to construct the destination
-   * object's metadata; otherwise the destination object's metadata will be
-   * copied from the source object.
-   * 
- * - * .google.storage.v2.Object destination = 1; - * - * @return Whether the destination field is set. - */ - @java.lang.Override - public boolean hasDestination() { - return destination_ != null; - } - /** - * - * - *
-   * Properties of the destination, post-rewrite object.
-   * The `name`, `bucket` and `kms_key` fields must not be populated (these
-   * values are specified in the `destination_name`, `destination_bucket`, and
-   * `destination_kms_key` fields).
-   * If `destination` is present it will be used to construct the destination
-   * object's metadata; otherwise the destination object's metadata will be
-   * copied from the source object.
-   * 
- * - * .google.storage.v2.Object destination = 1; - * - * @return The destination. - */ - @java.lang.Override - public com.google.storage.v2.Object getDestination() { - return destination_ == null ? com.google.storage.v2.Object.getDefaultInstance() : destination_; - } - /** - * - * - *
-   * Properties of the destination, post-rewrite object.
-   * The `name`, `bucket` and `kms_key` fields must not be populated (these
-   * values are specified in the `destination_name`, `destination_bucket`, and
-   * `destination_kms_key` fields).
-   * If `destination` is present it will be used to construct the destination
-   * object's metadata; otherwise the destination object's metadata will be
-   * copied from the source object.
-   * 
- * - * .google.storage.v2.Object destination = 1; - */ - @java.lang.Override - public com.google.storage.v2.ObjectOrBuilder getDestinationOrBuilder() { - return getDestination(); - } - - public static final int SOURCE_BUCKET_FIELD_NUMBER = 2; - private volatile java.lang.Object sourceBucket_; - /** - * - * - *
-   * Required. Name of the bucket in which to find the source object.
-   * 
- * - * string source_bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The sourceBucket. - */ - @java.lang.Override - public java.lang.String getSourceBucket() { - java.lang.Object ref = sourceBucket_; - 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(); - sourceBucket_ = s; - return s; - } - } - /** - * - * - *
-   * Required. Name of the bucket in which to find the source object.
-   * 
- * - * string source_bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for sourceBucket. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSourceBucketBytes() { - java.lang.Object ref = sourceBucket_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - sourceBucket_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SOURCE_OBJECT_FIELD_NUMBER = 3; - private volatile java.lang.Object sourceObject_; - /** - * - * - *
-   * Required. Name of the source object.
-   * 
- * - * string source_object = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The sourceObject. - */ - @java.lang.Override - public java.lang.String getSourceObject() { - java.lang.Object ref = sourceObject_; - 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(); - sourceObject_ = s; - return s; - } - } - /** - * - * - *
-   * Required. Name of the source object.
-   * 
- * - * string source_object = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for sourceObject. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSourceObjectBytes() { - java.lang.Object ref = sourceObject_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - sourceObject_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SOURCE_GENERATION_FIELD_NUMBER = 4; - private long sourceGeneration_; - /** - * - * - *
-   * If present, selects a specific revision of the source object (as opposed to
-   * the latest version, the default).
-   * 
- * - * int64 source_generation = 4; - * - * @return The sourceGeneration. - */ - @java.lang.Override - public long getSourceGeneration() { - return sourceGeneration_; - } - - public static final int REWRITE_TOKEN_FIELD_NUMBER = 5; - private volatile java.lang.Object rewriteToken_; - /** - * - * - *
-   * Include this field (from the previous rewrite response) on each rewrite
-   * request after the first one, until the rewrite response 'done' flag is
-   * true. Calls that provide a rewriteToken can omit all other request fields,
-   * but if included those fields must match the values provided in the first
-   * rewrite request.
-   * 
- * - * string rewrite_token = 5; - * - * @return The rewriteToken. - */ - @java.lang.Override - public java.lang.String getRewriteToken() { - java.lang.Object ref = rewriteToken_; - 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(); - rewriteToken_ = s; - return s; - } - } - /** - * - * - *
-   * Include this field (from the previous rewrite response) on each rewrite
-   * request after the first one, until the rewrite response 'done' flag is
-   * true. Calls that provide a rewriteToken can omit all other request fields,
-   * but if included those fields must match the values provided in the first
-   * rewrite request.
-   * 
- * - * string rewrite_token = 5; - * - * @return The bytes for rewriteToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString getRewriteTokenBytes() { - java.lang.Object ref = rewriteToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - rewriteToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DESTINATION_PREDEFINED_ACL_FIELD_NUMBER = 6; - private int destinationPredefinedAcl_; - /** - * - * - *
-   * Apply a predefined set of access controls to the destination object.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl destination_predefined_acl = 6; - * - * @return The enum numeric value on the wire for destinationPredefinedAcl. - */ - @java.lang.Override - public int getDestinationPredefinedAclValue() { - return destinationPredefinedAcl_; - } - /** - * - * - *
-   * Apply a predefined set of access controls to the destination object.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl destination_predefined_acl = 6; - * - * @return The destinationPredefinedAcl. - */ - @java.lang.Override - public com.google.storage.v2.PredefinedObjectAcl getDestinationPredefinedAcl() { - @SuppressWarnings("deprecation") - com.google.storage.v2.PredefinedObjectAcl result = - com.google.storage.v2.PredefinedObjectAcl.valueOf(destinationPredefinedAcl_); - return result == null ? com.google.storage.v2.PredefinedObjectAcl.UNRECOGNIZED : result; - } - - public static final int IF_GENERATION_MATCH_FIELD_NUMBER = 7; - 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 = 7; - * - * @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 = 7; - * - * @return The ifGenerationMatch. - */ - @java.lang.Override - public long getIfGenerationMatch() { - return ifGenerationMatch_; - } - - public static final int IF_GENERATION_NOT_MATCH_FIELD_NUMBER = 8; - private long ifGenerationNotMatch_; - /** - * - * - *
-   * Makes the operation conditional on whether the object's current generation
-   * does not match the given value. If no live object exists, the precondition
-   * fails. Setting to 0 makes the operation succeed only if there is a live
-   * version of the object.
-   * 
- * - * optional int64 if_generation_not_match = 8; - * - * @return Whether the ifGenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfGenerationNotMatch() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-   * Makes the operation conditional on whether the object's current generation
-   * does not match the given value. If no live object exists, the precondition
-   * fails. Setting to 0 makes the operation succeed only if there is a live
-   * version of the object.
-   * 
- * - * optional int64 if_generation_not_match = 8; - * - * @return The ifGenerationNotMatch. - */ - @java.lang.Override - public long getIfGenerationNotMatch() { - return ifGenerationNotMatch_; - } - - public static final int IF_METAGENERATION_MATCH_FIELD_NUMBER = 9; - private long ifMetagenerationMatch_; - /** - * - * - *
-   * Makes the operation conditional on whether the destination object's current
-   * metageneration matches the given value.
-   * 
- * - * optional int64 if_metageneration_match = 9; - * - * @return Whether the ifMetagenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationMatch() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * - * - *
-   * Makes the operation conditional on whether the destination object's current
-   * metageneration matches the given value.
-   * 
- * - * optional int64 if_metageneration_match = 9; - * - * @return The ifMetagenerationMatch. - */ - @java.lang.Override - public long getIfMetagenerationMatch() { - return ifMetagenerationMatch_; - } - - public static final int IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER = 10; - private long ifMetagenerationNotMatch_; - /** - * - * - *
-   * Makes the operation conditional on whether the destination object's current
-   * metageneration does not match the given value.
-   * 
- * - * optional int64 if_metageneration_not_match = 10; - * - * @return Whether the ifMetagenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationNotMatch() { - return ((bitField0_ & 0x00000008) != 0); - } - /** - * - * - *
-   * Makes the operation conditional on whether the destination object's current
-   * metageneration does not match the given value.
-   * 
- * - * optional int64 if_metageneration_not_match = 10; - * - * @return The ifMetagenerationNotMatch. - */ - @java.lang.Override - public long getIfMetagenerationNotMatch() { - return ifMetagenerationNotMatch_; - } - - public static final int IF_SOURCE_GENERATION_MATCH_FIELD_NUMBER = 11; - private long ifSourceGenerationMatch_; - /** - * - * - *
-   * Makes the operation conditional on whether the source object's current
-   * generation matches the given value.
-   * 
- * - * optional int64 if_source_generation_match = 11; - * - * @return Whether the ifSourceGenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfSourceGenerationMatch() { - return ((bitField0_ & 0x00000010) != 0); - } - /** - * - * - *
-   * Makes the operation conditional on whether the source object's current
-   * generation matches the given value.
-   * 
- * - * optional int64 if_source_generation_match = 11; - * - * @return The ifSourceGenerationMatch. - */ - @java.lang.Override - public long getIfSourceGenerationMatch() { - return ifSourceGenerationMatch_; - } - - public static final int IF_SOURCE_GENERATION_NOT_MATCH_FIELD_NUMBER = 12; - private long ifSourceGenerationNotMatch_; - /** - * - * - *
-   * Makes the operation conditional on whether the source object's current
-   * generation does not match the given value.
-   * 
- * - * optional int64 if_source_generation_not_match = 12; - * - * @return Whether the ifSourceGenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfSourceGenerationNotMatch() { - return ((bitField0_ & 0x00000020) != 0); - } - /** - * - * - *
-   * Makes the operation conditional on whether the source object's current
-   * generation does not match the given value.
-   * 
- * - * optional int64 if_source_generation_not_match = 12; - * - * @return The ifSourceGenerationNotMatch. - */ - @java.lang.Override - public long getIfSourceGenerationNotMatch() { - return ifSourceGenerationNotMatch_; - } - - public static final int IF_SOURCE_METAGENERATION_MATCH_FIELD_NUMBER = 13; - private long ifSourceMetagenerationMatch_; - /** - * - * - *
-   * Makes the operation conditional on whether the source object's current
-   * metageneration matches the given value.
-   * 
- * - * optional int64 if_source_metageneration_match = 13; - * - * @return Whether the ifSourceMetagenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfSourceMetagenerationMatch() { - return ((bitField0_ & 0x00000040) != 0); - } - /** - * - * - *
-   * Makes the operation conditional on whether the source object's current
-   * metageneration matches the given value.
-   * 
- * - * optional int64 if_source_metageneration_match = 13; - * - * @return The ifSourceMetagenerationMatch. - */ - @java.lang.Override - public long getIfSourceMetagenerationMatch() { - return ifSourceMetagenerationMatch_; - } - - public static final int IF_SOURCE_METAGENERATION_NOT_MATCH_FIELD_NUMBER = 14; - private long ifSourceMetagenerationNotMatch_; - /** - * - * - *
-   * Makes the operation conditional on whether the source object's current
-   * metageneration does not match the given value.
-   * 
- * - * optional int64 if_source_metageneration_not_match = 14; - * - * @return Whether the ifSourceMetagenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfSourceMetagenerationNotMatch() { - return ((bitField0_ & 0x00000080) != 0); - } - /** - * - * - *
-   * Makes the operation conditional on whether the source object's current
-   * metageneration does not match the given value.
-   * 
- * - * optional int64 if_source_metageneration_not_match = 14; - * - * @return The ifSourceMetagenerationNotMatch. - */ - @java.lang.Override - public long getIfSourceMetagenerationNotMatch() { - return ifSourceMetagenerationNotMatch_; - } - - public static final int MAX_BYTES_REWRITTEN_PER_CALL_FIELD_NUMBER = 15; - private long maxBytesRewrittenPerCall_; - /** - * - * - *
-   * The maximum number of bytes that will be rewritten per rewrite request.
-   * Most callers
-   * shouldn't need to specify this parameter - it is primarily in place to
-   * support testing. If specified the value must be an integral multiple of
-   * 1 MiB (1048576). Also, this only applies to requests where the source and
-   * destination span locations and/or storage classes. Finally, this value must
-   * not change across rewrite calls else you'll get an error that the
-   * `rewriteToken` is invalid.
-   * 
- * - * int64 max_bytes_rewritten_per_call = 15; - * - * @return The maxBytesRewrittenPerCall. - */ - @java.lang.Override - public long getMaxBytesRewrittenPerCall() { - return maxBytesRewrittenPerCall_; - } - - public static final int COPY_SOURCE_ENCRYPTION_ALGORITHM_FIELD_NUMBER = 16; - private volatile java.lang.Object copySourceEncryptionAlgorithm_; - /** - * - * - *
-   * The algorithm used to encrypt the source object, if any. Used if the source
-   * object was encrypted with a Customer-Supplied Encryption Key.
-   * 
- * - * string copy_source_encryption_algorithm = 16; - * - * @return The copySourceEncryptionAlgorithm. - */ - @java.lang.Override - public java.lang.String getCopySourceEncryptionAlgorithm() { - java.lang.Object ref = copySourceEncryptionAlgorithm_; - 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(); - copySourceEncryptionAlgorithm_ = s; - return s; - } - } - /** - * - * - *
-   * The algorithm used to encrypt the source object, if any. Used if the source
-   * object was encrypted with a Customer-Supplied Encryption Key.
-   * 
- * - * string copy_source_encryption_algorithm = 16; - * - * @return The bytes for copySourceEncryptionAlgorithm. - */ - @java.lang.Override - public com.google.protobuf.ByteString getCopySourceEncryptionAlgorithmBytes() { - java.lang.Object ref = copySourceEncryptionAlgorithm_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - copySourceEncryptionAlgorithm_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int COPY_SOURCE_ENCRYPTION_KEY_BYTES_FIELD_NUMBER = 21; - private com.google.protobuf.ByteString copySourceEncryptionKeyBytes_; - /** - * - * - *
-   * The raw bytes (not base64-encoded) AES-256 encryption key used to encrypt
-   * the source object, if it was encrypted with a Customer-Supplied Encryption
-   * Key.
-   * 
- * - * bytes copy_source_encryption_key_bytes = 21; - * - * @return The copySourceEncryptionKeyBytes. - */ - @java.lang.Override - public com.google.protobuf.ByteString getCopySourceEncryptionKeyBytes() { - return copySourceEncryptionKeyBytes_; - } - - public static final int COPY_SOURCE_ENCRYPTION_KEY_SHA256_BYTES_FIELD_NUMBER = 22; - private com.google.protobuf.ByteString copySourceEncryptionKeySha256Bytes_; - /** - * - * - *
-   * The raw bytes (not base64-encoded) SHA256 hash of the encryption key used
-   * to encrypt the source object, if it was encrypted with a Customer-Supplied
-   * Encryption Key.
-   * 
- * - * bytes copy_source_encryption_key_sha256_bytes = 22; - * - * @return The copySourceEncryptionKeySha256Bytes. - */ - @java.lang.Override - public com.google.protobuf.ByteString getCopySourceEncryptionKeySha256Bytes() { - return copySourceEncryptionKeySha256Bytes_; - } - - public static final int COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER = 19; - 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 = 19; - * - * @return Whether the commonObjectRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonObjectRequestParams() { - return commonObjectRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 19; - * - * @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 = 19; - */ - @java.lang.Override - public com.google.storage.v2.CommonObjectRequestParamsOrBuilder - getCommonObjectRequestParamsOrBuilder() { - return getCommonObjectRequestParams(); - } - - public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 20; - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 20; - * - * @return Whether the commonRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonRequestParams() { - return commonRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 20; - * - * @return The commonRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 20; - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - return getCommonRequestParams(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (destination_ != null) { - output.writeMessage(1, getDestination()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceBucket_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, sourceBucket_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceObject_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, sourceObject_); - } - if (sourceGeneration_ != 0L) { - output.writeInt64(4, sourceGeneration_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rewriteToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, rewriteToken_); - } - if (destinationPredefinedAcl_ - != com.google.storage.v2.PredefinedObjectAcl.PREDEFINED_OBJECT_ACL_UNSPECIFIED - .getNumber()) { - output.writeEnum(6, destinationPredefinedAcl_); - } - if (((bitField0_ & 0x00000001) != 0)) { - output.writeInt64(7, ifGenerationMatch_); - } - if (((bitField0_ & 0x00000002) != 0)) { - output.writeInt64(8, ifGenerationNotMatch_); - } - if (((bitField0_ & 0x00000004) != 0)) { - output.writeInt64(9, ifMetagenerationMatch_); - } - if (((bitField0_ & 0x00000008) != 0)) { - output.writeInt64(10, ifMetagenerationNotMatch_); - } - if (((bitField0_ & 0x00000010) != 0)) { - output.writeInt64(11, ifSourceGenerationMatch_); - } - if (((bitField0_ & 0x00000020) != 0)) { - output.writeInt64(12, ifSourceGenerationNotMatch_); - } - if (((bitField0_ & 0x00000040) != 0)) { - output.writeInt64(13, ifSourceMetagenerationMatch_); - } - if (((bitField0_ & 0x00000080) != 0)) { - output.writeInt64(14, ifSourceMetagenerationNotMatch_); - } - if (maxBytesRewrittenPerCall_ != 0L) { - output.writeInt64(15, maxBytesRewrittenPerCall_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(copySourceEncryptionAlgorithm_)) { - com.google.protobuf.GeneratedMessageV3.writeString( - output, 16, copySourceEncryptionAlgorithm_); - } - if (commonObjectRequestParams_ != null) { - output.writeMessage(19, getCommonObjectRequestParams()); - } - if (commonRequestParams_ != null) { - output.writeMessage(20, getCommonRequestParams()); - } - if (!copySourceEncryptionKeyBytes_.isEmpty()) { - output.writeBytes(21, copySourceEncryptionKeyBytes_); - } - if (!copySourceEncryptionKeySha256Bytes_.isEmpty()) { - output.writeBytes(22, copySourceEncryptionKeySha256Bytes_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destinationName_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 24, destinationName_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destinationBucket_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 25, destinationBucket_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destinationKmsKey_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 27, destinationKmsKey_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (destination_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDestination()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceBucket_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, sourceBucket_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceObject_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, sourceObject_); - } - if (sourceGeneration_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, sourceGeneration_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rewriteToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, rewriteToken_); - } - if (destinationPredefinedAcl_ - != com.google.storage.v2.PredefinedObjectAcl.PREDEFINED_OBJECT_ACL_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, destinationPredefinedAcl_); - } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(7, ifGenerationMatch_); - } - if (((bitField0_ & 0x00000002) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(8, ifGenerationNotMatch_); - } - if (((bitField0_ & 0x00000004) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(9, ifMetagenerationMatch_); - } - if (((bitField0_ & 0x00000008) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(10, ifMetagenerationNotMatch_); - } - if (((bitField0_ & 0x00000010) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(11, ifSourceGenerationMatch_); - } - if (((bitField0_ & 0x00000020) != 0)) { - size += - com.google.protobuf.CodedOutputStream.computeInt64Size(12, ifSourceGenerationNotMatch_); - } - if (((bitField0_ & 0x00000040) != 0)) { - size += - com.google.protobuf.CodedOutputStream.computeInt64Size(13, ifSourceMetagenerationMatch_); - } - if (((bitField0_ & 0x00000080) != 0)) { - size += - com.google.protobuf.CodedOutputStream.computeInt64Size( - 14, ifSourceMetagenerationNotMatch_); - } - if (maxBytesRewrittenPerCall_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(15, maxBytesRewrittenPerCall_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(copySourceEncryptionAlgorithm_)) { - size += - com.google.protobuf.GeneratedMessageV3.computeStringSize( - 16, copySourceEncryptionAlgorithm_); - } - if (commonObjectRequestParams_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 19, getCommonObjectRequestParams()); - } - if (commonRequestParams_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize(20, getCommonRequestParams()); - } - if (!copySourceEncryptionKeyBytes_.isEmpty()) { - size += - com.google.protobuf.CodedOutputStream.computeBytesSize(21, copySourceEncryptionKeyBytes_); - } - if (!copySourceEncryptionKeySha256Bytes_.isEmpty()) { - size += - com.google.protobuf.CodedOutputStream.computeBytesSize( - 22, copySourceEncryptionKeySha256Bytes_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destinationName_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(24, destinationName_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destinationBucket_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(25, destinationBucket_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destinationKmsKey_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(27, destinationKmsKey_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.RewriteObjectRequest)) { - return super.equals(obj); - } - com.google.storage.v2.RewriteObjectRequest other = - (com.google.storage.v2.RewriteObjectRequest) obj; - - if (!getDestinationName().equals(other.getDestinationName())) return false; - if (!getDestinationBucket().equals(other.getDestinationBucket())) return false; - if (!getDestinationKmsKey().equals(other.getDestinationKmsKey())) return false; - if (hasDestination() != other.hasDestination()) return false; - if (hasDestination()) { - if (!getDestination().equals(other.getDestination())) return false; - } - if (!getSourceBucket().equals(other.getSourceBucket())) return false; - if (!getSourceObject().equals(other.getSourceObject())) return false; - if (getSourceGeneration() != other.getSourceGeneration()) return false; - if (!getRewriteToken().equals(other.getRewriteToken())) return false; - if (destinationPredefinedAcl_ != other.destinationPredefinedAcl_) 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 (hasIfSourceGenerationMatch() != other.hasIfSourceGenerationMatch()) return false; - if (hasIfSourceGenerationMatch()) { - if (getIfSourceGenerationMatch() != other.getIfSourceGenerationMatch()) return false; - } - if (hasIfSourceGenerationNotMatch() != other.hasIfSourceGenerationNotMatch()) return false; - if (hasIfSourceGenerationNotMatch()) { - if (getIfSourceGenerationNotMatch() != other.getIfSourceGenerationNotMatch()) return false; - } - if (hasIfSourceMetagenerationMatch() != other.hasIfSourceMetagenerationMatch()) return false; - if (hasIfSourceMetagenerationMatch()) { - if (getIfSourceMetagenerationMatch() != other.getIfSourceMetagenerationMatch()) return false; - } - if (hasIfSourceMetagenerationNotMatch() != other.hasIfSourceMetagenerationNotMatch()) - return false; - if (hasIfSourceMetagenerationNotMatch()) { - if (getIfSourceMetagenerationNotMatch() != other.getIfSourceMetagenerationNotMatch()) - return false; - } - if (getMaxBytesRewrittenPerCall() != other.getMaxBytesRewrittenPerCall()) return false; - if (!getCopySourceEncryptionAlgorithm().equals(other.getCopySourceEncryptionAlgorithm())) - return false; - if (!getCopySourceEncryptionKeyBytes().equals(other.getCopySourceEncryptionKeyBytes())) - return false; - if (!getCopySourceEncryptionKeySha256Bytes() - .equals(other.getCopySourceEncryptionKeySha256Bytes())) return false; - if (hasCommonObjectRequestParams() != other.hasCommonObjectRequestParams()) return false; - if (hasCommonObjectRequestParams()) { - if (!getCommonObjectRequestParams().equals(other.getCommonObjectRequestParams())) - return false; - } - if (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; - if (hasCommonRequestParams()) { - if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + DESTINATION_NAME_FIELD_NUMBER; - hash = (53 * hash) + getDestinationName().hashCode(); - hash = (37 * hash) + DESTINATION_BUCKET_FIELD_NUMBER; - hash = (53 * hash) + getDestinationBucket().hashCode(); - hash = (37 * hash) + DESTINATION_KMS_KEY_FIELD_NUMBER; - hash = (53 * hash) + getDestinationKmsKey().hashCode(); - if (hasDestination()) { - hash = (37 * hash) + DESTINATION_FIELD_NUMBER; - hash = (53 * hash) + getDestination().hashCode(); - } - hash = (37 * hash) + SOURCE_BUCKET_FIELD_NUMBER; - hash = (53 * hash) + getSourceBucket().hashCode(); - hash = (37 * hash) + SOURCE_OBJECT_FIELD_NUMBER; - hash = (53 * hash) + getSourceObject().hashCode(); - hash = (37 * hash) + SOURCE_GENERATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSourceGeneration()); - hash = (37 * hash) + REWRITE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getRewriteToken().hashCode(); - hash = (37 * hash) + DESTINATION_PREDEFINED_ACL_FIELD_NUMBER; - hash = (53 * hash) + destinationPredefinedAcl_; - 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 (hasIfSourceGenerationMatch()) { - hash = (37 * hash) + IF_SOURCE_GENERATION_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfSourceGenerationMatch()); - } - if (hasIfSourceGenerationNotMatch()) { - hash = (37 * hash) + IF_SOURCE_GENERATION_NOT_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfSourceGenerationNotMatch()); - } - if (hasIfSourceMetagenerationMatch()) { - hash = (37 * hash) + IF_SOURCE_METAGENERATION_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfSourceMetagenerationMatch()); - } - if (hasIfSourceMetagenerationNotMatch()) { - hash = (37 * hash) + IF_SOURCE_METAGENERATION_NOT_MATCH_FIELD_NUMBER; - hash = - (53 * hash) + com.google.protobuf.Internal.hashLong(getIfSourceMetagenerationNotMatch()); - } - hash = (37 * hash) + MAX_BYTES_REWRITTEN_PER_CALL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMaxBytesRewrittenPerCall()); - hash = (37 * hash) + COPY_SOURCE_ENCRYPTION_ALGORITHM_FIELD_NUMBER; - hash = (53 * hash) + getCopySourceEncryptionAlgorithm().hashCode(); - hash = (37 * hash) + COPY_SOURCE_ENCRYPTION_KEY_BYTES_FIELD_NUMBER; - hash = (53 * hash) + getCopySourceEncryptionKeyBytes().hashCode(); - hash = (37 * hash) + COPY_SOURCE_ENCRYPTION_KEY_SHA256_BYTES_FIELD_NUMBER; - hash = (53 * hash) + getCopySourceEncryptionKeySha256Bytes().hashCode(); - if (hasCommonObjectRequestParams()) { - hash = (37 * hash) + COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonObjectRequestParams().hashCode(); - } - if (hasCommonRequestParams()) { - hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonRequestParams().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.RewriteObjectRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.RewriteObjectRequest 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.RewriteObjectRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.RewriteObjectRequest 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.RewriteObjectRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.RewriteObjectRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.RewriteObjectRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.RewriteObjectRequest 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.RewriteObjectRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.RewriteObjectRequest 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.RewriteObjectRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.RewriteObjectRequest 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.RewriteObjectRequest 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 RewriteObject.
-   * If the source object is encrypted using a Customer-Supplied Encryption Key
-   * the key information must be provided in the copy_source_encryption_algorithm,
-   * copy_source_encryption_key_bytes, and copy_source_encryption_key_sha256_bytes
-   * fields. If the destination object should be encrypted the keying information
-   * should be provided in the encryption_algorithm, encryption_key_bytes, and
-   * encryption_key_sha256_bytes fields of the
-   * common_object_request_params.customer_encryption field.
-   * 
- * - * Protobuf type {@code google.storage.v2.RewriteObjectRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.RewriteObjectRequest) - com.google.storage.v2.RewriteObjectRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_RewriteObjectRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_RewriteObjectRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.RewriteObjectRequest.class, - com.google.storage.v2.RewriteObjectRequest.Builder.class); - } - - // Construct using com.google.storage.v2.RewriteObjectRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - destinationName_ = ""; - - destinationBucket_ = ""; - - destinationKmsKey_ = ""; - - if (destinationBuilder_ == null) { - destination_ = null; - } else { - destination_ = null; - destinationBuilder_ = null; - } - sourceBucket_ = ""; - - sourceObject_ = ""; - - sourceGeneration_ = 0L; - - rewriteToken_ = ""; - - destinationPredefinedAcl_ = 0; - - ifGenerationMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000001); - ifGenerationNotMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000002); - ifMetagenerationMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000004); - ifMetagenerationNotMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000008); - ifSourceGenerationMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000010); - ifSourceGenerationNotMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000020); - ifSourceMetagenerationMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000040); - ifSourceMetagenerationNotMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000080); - maxBytesRewrittenPerCall_ = 0L; - - copySourceEncryptionAlgorithm_ = ""; - - copySourceEncryptionKeyBytes_ = com.google.protobuf.ByteString.EMPTY; - - copySourceEncryptionKeySha256Bytes_ = com.google.protobuf.ByteString.EMPTY; - - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = null; - } else { - commonObjectRequestParams_ = null; - commonObjectRequestParamsBuilder_ = null; - } - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_RewriteObjectRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.RewriteObjectRequest getDefaultInstanceForType() { - return com.google.storage.v2.RewriteObjectRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.RewriteObjectRequest build() { - com.google.storage.v2.RewriteObjectRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.RewriteObjectRequest buildPartial() { - com.google.storage.v2.RewriteObjectRequest result = - new com.google.storage.v2.RewriteObjectRequest(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - result.destinationName_ = destinationName_; - result.destinationBucket_ = destinationBucket_; - result.destinationKmsKey_ = destinationKmsKey_; - if (destinationBuilder_ == null) { - result.destination_ = destination_; - } else { - result.destination_ = destinationBuilder_.build(); - } - result.sourceBucket_ = sourceBucket_; - result.sourceObject_ = sourceObject_; - result.sourceGeneration_ = sourceGeneration_; - result.rewriteToken_ = rewriteToken_; - result.destinationPredefinedAcl_ = destinationPredefinedAcl_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.ifGenerationMatch_ = ifGenerationMatch_; - to_bitField0_ |= 0x00000001; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.ifGenerationNotMatch_ = ifGenerationNotMatch_; - to_bitField0_ |= 0x00000002; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.ifMetagenerationMatch_ = ifMetagenerationMatch_; - to_bitField0_ |= 0x00000004; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.ifMetagenerationNotMatch_ = ifMetagenerationNotMatch_; - to_bitField0_ |= 0x00000008; - } - if (((from_bitField0_ & 0x00000010) != 0)) { - result.ifSourceGenerationMatch_ = ifSourceGenerationMatch_; - to_bitField0_ |= 0x00000010; - } - if (((from_bitField0_ & 0x00000020) != 0)) { - result.ifSourceGenerationNotMatch_ = ifSourceGenerationNotMatch_; - to_bitField0_ |= 0x00000020; - } - if (((from_bitField0_ & 0x00000040) != 0)) { - result.ifSourceMetagenerationMatch_ = ifSourceMetagenerationMatch_; - to_bitField0_ |= 0x00000040; - } - if (((from_bitField0_ & 0x00000080) != 0)) { - result.ifSourceMetagenerationNotMatch_ = ifSourceMetagenerationNotMatch_; - to_bitField0_ |= 0x00000080; - } - result.maxBytesRewrittenPerCall_ = maxBytesRewrittenPerCall_; - result.copySourceEncryptionAlgorithm_ = copySourceEncryptionAlgorithm_; - result.copySourceEncryptionKeyBytes_ = copySourceEncryptionKeyBytes_; - result.copySourceEncryptionKeySha256Bytes_ = copySourceEncryptionKeySha256Bytes_; - if (commonObjectRequestParamsBuilder_ == null) { - result.commonObjectRequestParams_ = commonObjectRequestParams_; - } else { - result.commonObjectRequestParams_ = commonObjectRequestParamsBuilder_.build(); - } - if (commonRequestParamsBuilder_ == null) { - result.commonRequestParams_ = commonRequestParams_; - } else { - result.commonRequestParams_ = commonRequestParamsBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.RewriteObjectRequest) { - return mergeFrom((com.google.storage.v2.RewriteObjectRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.RewriteObjectRequest other) { - if (other == com.google.storage.v2.RewriteObjectRequest.getDefaultInstance()) return this; - if (!other.getDestinationName().isEmpty()) { - destinationName_ = other.destinationName_; - onChanged(); - } - if (!other.getDestinationBucket().isEmpty()) { - destinationBucket_ = other.destinationBucket_; - onChanged(); - } - if (!other.getDestinationKmsKey().isEmpty()) { - destinationKmsKey_ = other.destinationKmsKey_; - onChanged(); - } - if (other.hasDestination()) { - mergeDestination(other.getDestination()); - } - if (!other.getSourceBucket().isEmpty()) { - sourceBucket_ = other.sourceBucket_; - onChanged(); - } - if (!other.getSourceObject().isEmpty()) { - sourceObject_ = other.sourceObject_; - onChanged(); - } - if (other.getSourceGeneration() != 0L) { - setSourceGeneration(other.getSourceGeneration()); - } - if (!other.getRewriteToken().isEmpty()) { - rewriteToken_ = other.rewriteToken_; - onChanged(); - } - if (other.destinationPredefinedAcl_ != 0) { - setDestinationPredefinedAclValue(other.getDestinationPredefinedAclValue()); - } - 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.hasIfSourceGenerationMatch()) { - setIfSourceGenerationMatch(other.getIfSourceGenerationMatch()); - } - if (other.hasIfSourceGenerationNotMatch()) { - setIfSourceGenerationNotMatch(other.getIfSourceGenerationNotMatch()); - } - if (other.hasIfSourceMetagenerationMatch()) { - setIfSourceMetagenerationMatch(other.getIfSourceMetagenerationMatch()); - } - if (other.hasIfSourceMetagenerationNotMatch()) { - setIfSourceMetagenerationNotMatch(other.getIfSourceMetagenerationNotMatch()); - } - if (other.getMaxBytesRewrittenPerCall() != 0L) { - setMaxBytesRewrittenPerCall(other.getMaxBytesRewrittenPerCall()); - } - if (!other.getCopySourceEncryptionAlgorithm().isEmpty()) { - copySourceEncryptionAlgorithm_ = other.copySourceEncryptionAlgorithm_; - onChanged(); - } - if (other.getCopySourceEncryptionKeyBytes() != com.google.protobuf.ByteString.EMPTY) { - setCopySourceEncryptionKeyBytes(other.getCopySourceEncryptionKeyBytes()); - } - if (other.getCopySourceEncryptionKeySha256Bytes() != com.google.protobuf.ByteString.EMPTY) { - setCopySourceEncryptionKeySha256Bytes(other.getCopySourceEncryptionKeySha256Bytes()); - } - if (other.hasCommonObjectRequestParams()) { - mergeCommonObjectRequestParams(other.getCommonObjectRequestParams()); - } - if (other.hasCommonRequestParams()) { - mergeCommonRequestParams(other.getCommonRequestParams()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.RewriteObjectRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.RewriteObjectRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object destinationName_ = ""; - /** - * - * - *
-     * Immutable. The name of the destination object. Nearly any sequence of unicode
-     * characters is valid. See
-     * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
-     * Example: `test.txt`
-     * The `name` field by itself does not uniquely identify a Cloud Storage
-     * object. A Cloud Storage object is uniquely identified by the tuple of
-     * (bucket, object, generation).
-     * 
- * - * string destination_name = 24 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The destinationName. - */ - public java.lang.String getDestinationName() { - java.lang.Object ref = destinationName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - destinationName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Immutable. The name of the destination object. Nearly any sequence of unicode
-     * characters is valid. See
-     * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
-     * Example: `test.txt`
-     * The `name` field by itself does not uniquely identify a Cloud Storage
-     * object. A Cloud Storage object is uniquely identified by the tuple of
-     * (bucket, object, generation).
-     * 
- * - * string destination_name = 24 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The bytes for destinationName. - */ - public com.google.protobuf.ByteString getDestinationNameBytes() { - java.lang.Object ref = destinationName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - destinationName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Immutable. The name of the destination object. Nearly any sequence of unicode
-     * characters is valid. See
-     * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
-     * Example: `test.txt`
-     * The `name` field by itself does not uniquely identify a Cloud Storage
-     * object. A Cloud Storage object is uniquely identified by the tuple of
-     * (bucket, object, generation).
-     * 
- * - * string destination_name = 24 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @param value The destinationName to set. - * @return This builder for chaining. - */ - public Builder setDestinationName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - destinationName_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Immutable. The name of the destination object. Nearly any sequence of unicode
-     * characters is valid. See
-     * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
-     * Example: `test.txt`
-     * The `name` field by itself does not uniquely identify a Cloud Storage
-     * object. A Cloud Storage object is uniquely identified by the tuple of
-     * (bucket, object, generation).
-     * 
- * - * string destination_name = 24 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return This builder for chaining. - */ - public Builder clearDestinationName() { - - destinationName_ = getDefaultInstance().getDestinationName(); - onChanged(); - return this; - } - /** - * - * - *
-     * Immutable. The name of the destination object. Nearly any sequence of unicode
-     * characters is valid. See
-     * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
-     * Example: `test.txt`
-     * The `name` field by itself does not uniquely identify a Cloud Storage
-     * object. A Cloud Storage object is uniquely identified by the tuple of
-     * (bucket, object, generation).
-     * 
- * - * string destination_name = 24 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @param value The bytes for destinationName to set. - * @return This builder for chaining. - */ - public Builder setDestinationNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - destinationName_ = value; - onChanged(); - return this; - } - - private java.lang.Object destinationBucket_ = ""; - /** - * - * - *
-     * Immutable. The name of the bucket containing The name of the destination object.
-     * 
- * - * - * string destination_bucket = 25 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @return The destinationBucket. - */ - public java.lang.String getDestinationBucket() { - java.lang.Object ref = destinationBucket_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - destinationBucket_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Immutable. The name of the bucket containing The name of the destination object.
-     * 
- * - * - * string destination_bucket = 25 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for destinationBucket. - */ - public com.google.protobuf.ByteString getDestinationBucketBytes() { - java.lang.Object ref = destinationBucket_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - destinationBucket_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Immutable. The name of the bucket containing The name of the destination object.
-     * 
- * - * - * string destination_bucket = 25 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @param value The destinationBucket to set. - * @return This builder for chaining. - */ - public Builder setDestinationBucket(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - destinationBucket_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Immutable. The name of the bucket containing The name of the destination object.
-     * 
- * - * - * string destination_bucket = 25 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearDestinationBucket() { - - destinationBucket_ = getDefaultInstance().getDestinationBucket(); - onChanged(); - return this; - } - /** - * - * - *
-     * Immutable. The name of the bucket containing The name of the destination object.
-     * 
- * - * - * string destination_bucket = 25 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for destinationBucket to set. - * @return This builder for chaining. - */ - public Builder setDestinationBucketBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - destinationBucket_ = value; - onChanged(); - return this; - } - - private java.lang.Object destinationKmsKey_ = ""; - /** - * - * - *
-     * The name of the Cloud KMS key that will be used to encrypt the destination
-     * object. The Cloud KMS key must be located in same location as the object.
-     * If the parameter is not specified, the request uses the destination
-     * bucket's default encryption key, if any, or else the Google-managed
-     * encryption key.
-     * 
- * - * string destination_kms_key = 27 [(.google.api.resource_reference) = { ... } - * - * @return The destinationKmsKey. - */ - public java.lang.String getDestinationKmsKey() { - java.lang.Object ref = destinationKmsKey_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - destinationKmsKey_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The name of the Cloud KMS key that will be used to encrypt the destination
-     * object. The Cloud KMS key must be located in same location as the object.
-     * If the parameter is not specified, the request uses the destination
-     * bucket's default encryption key, if any, or else the Google-managed
-     * encryption key.
-     * 
- * - * string destination_kms_key = 27 [(.google.api.resource_reference) = { ... } - * - * @return The bytes for destinationKmsKey. - */ - public com.google.protobuf.ByteString getDestinationKmsKeyBytes() { - java.lang.Object ref = destinationKmsKey_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - destinationKmsKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The name of the Cloud KMS key that will be used to encrypt the destination
-     * object. The Cloud KMS key must be located in same location as the object.
-     * If the parameter is not specified, the request uses the destination
-     * bucket's default encryption key, if any, or else the Google-managed
-     * encryption key.
-     * 
- * - * string destination_kms_key = 27 [(.google.api.resource_reference) = { ... } - * - * @param value The destinationKmsKey to set. - * @return This builder for chaining. - */ - public Builder setDestinationKmsKey(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - destinationKmsKey_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The name of the Cloud KMS key that will be used to encrypt the destination
-     * object. The Cloud KMS key must be located in same location as the object.
-     * If the parameter is not specified, the request uses the destination
-     * bucket's default encryption key, if any, or else the Google-managed
-     * encryption key.
-     * 
- * - * string destination_kms_key = 27 [(.google.api.resource_reference) = { ... } - * - * @return This builder for chaining. - */ - public Builder clearDestinationKmsKey() { - - destinationKmsKey_ = getDefaultInstance().getDestinationKmsKey(); - onChanged(); - return this; - } - /** - * - * - *
-     * The name of the Cloud KMS key that will be used to encrypt the destination
-     * object. The Cloud KMS key must be located in same location as the object.
-     * If the parameter is not specified, the request uses the destination
-     * bucket's default encryption key, if any, or else the Google-managed
-     * encryption key.
-     * 
- * - * string destination_kms_key = 27 [(.google.api.resource_reference) = { ... } - * - * @param value The bytes for destinationKmsKey to set. - * @return This builder for chaining. - */ - public Builder setDestinationKmsKeyBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - destinationKmsKey_ = value; - onChanged(); - return this; - } - - private com.google.storage.v2.Object destination_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder> - destinationBuilder_; - /** - * - * - *
-     * Properties of the destination, post-rewrite object.
-     * The `name`, `bucket` and `kms_key` fields must not be populated (these
-     * values are specified in the `destination_name`, `destination_bucket`, and
-     * `destination_kms_key` fields).
-     * If `destination` is present it will be used to construct the destination
-     * object's metadata; otherwise the destination object's metadata will be
-     * copied from the source object.
-     * 
- * - * .google.storage.v2.Object destination = 1; - * - * @return Whether the destination field is set. - */ - public boolean hasDestination() { - return destinationBuilder_ != null || destination_ != null; - } - /** - * - * - *
-     * Properties of the destination, post-rewrite object.
-     * The `name`, `bucket` and `kms_key` fields must not be populated (these
-     * values are specified in the `destination_name`, `destination_bucket`, and
-     * `destination_kms_key` fields).
-     * If `destination` is present it will be used to construct the destination
-     * object's metadata; otherwise the destination object's metadata will be
-     * copied from the source object.
-     * 
- * - * .google.storage.v2.Object destination = 1; - * - * @return The destination. - */ - public com.google.storage.v2.Object getDestination() { - if (destinationBuilder_ == null) { - return destination_ == null - ? com.google.storage.v2.Object.getDefaultInstance() - : destination_; - } else { - return destinationBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Properties of the destination, post-rewrite object.
-     * The `name`, `bucket` and `kms_key` fields must not be populated (these
-     * values are specified in the `destination_name`, `destination_bucket`, and
-     * `destination_kms_key` fields).
-     * If `destination` is present it will be used to construct the destination
-     * object's metadata; otherwise the destination object's metadata will be
-     * copied from the source object.
-     * 
- * - * .google.storage.v2.Object destination = 1; - */ - public Builder setDestination(com.google.storage.v2.Object value) { - if (destinationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - destination_ = value; - onChanged(); - } else { - destinationBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Properties of the destination, post-rewrite object.
-     * The `name`, `bucket` and `kms_key` fields must not be populated (these
-     * values are specified in the `destination_name`, `destination_bucket`, and
-     * `destination_kms_key` fields).
-     * If `destination` is present it will be used to construct the destination
-     * object's metadata; otherwise the destination object's metadata will be
-     * copied from the source object.
-     * 
- * - * .google.storage.v2.Object destination = 1; - */ - public Builder setDestination(com.google.storage.v2.Object.Builder builderForValue) { - if (destinationBuilder_ == null) { - destination_ = builderForValue.build(); - onChanged(); - } else { - destinationBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Properties of the destination, post-rewrite object.
-     * The `name`, `bucket` and `kms_key` fields must not be populated (these
-     * values are specified in the `destination_name`, `destination_bucket`, and
-     * `destination_kms_key` fields).
-     * If `destination` is present it will be used to construct the destination
-     * object's metadata; otherwise the destination object's metadata will be
-     * copied from the source object.
-     * 
- * - * .google.storage.v2.Object destination = 1; - */ - public Builder mergeDestination(com.google.storage.v2.Object value) { - if (destinationBuilder_ == null) { - if (destination_ != null) { - destination_ = - com.google.storage.v2.Object.newBuilder(destination_).mergeFrom(value).buildPartial(); - } else { - destination_ = value; - } - onChanged(); - } else { - destinationBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Properties of the destination, post-rewrite object.
-     * The `name`, `bucket` and `kms_key` fields must not be populated (these
-     * values are specified in the `destination_name`, `destination_bucket`, and
-     * `destination_kms_key` fields).
-     * If `destination` is present it will be used to construct the destination
-     * object's metadata; otherwise the destination object's metadata will be
-     * copied from the source object.
-     * 
- * - * .google.storage.v2.Object destination = 1; - */ - public Builder clearDestination() { - if (destinationBuilder_ == null) { - destination_ = null; - onChanged(); - } else { - destination_ = null; - destinationBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Properties of the destination, post-rewrite object.
-     * The `name`, `bucket` and `kms_key` fields must not be populated (these
-     * values are specified in the `destination_name`, `destination_bucket`, and
-     * `destination_kms_key` fields).
-     * If `destination` is present it will be used to construct the destination
-     * object's metadata; otherwise the destination object's metadata will be
-     * copied from the source object.
-     * 
- * - * .google.storage.v2.Object destination = 1; - */ - public com.google.storage.v2.Object.Builder getDestinationBuilder() { - - onChanged(); - return getDestinationFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Properties of the destination, post-rewrite object.
-     * The `name`, `bucket` and `kms_key` fields must not be populated (these
-     * values are specified in the `destination_name`, `destination_bucket`, and
-     * `destination_kms_key` fields).
-     * If `destination` is present it will be used to construct the destination
-     * object's metadata; otherwise the destination object's metadata will be
-     * copied from the source object.
-     * 
- * - * .google.storage.v2.Object destination = 1; - */ - public com.google.storage.v2.ObjectOrBuilder getDestinationOrBuilder() { - if (destinationBuilder_ != null) { - return destinationBuilder_.getMessageOrBuilder(); - } else { - return destination_ == null - ? com.google.storage.v2.Object.getDefaultInstance() - : destination_; - } - } - /** - * - * - *
-     * Properties of the destination, post-rewrite object.
-     * The `name`, `bucket` and `kms_key` fields must not be populated (these
-     * values are specified in the `destination_name`, `destination_bucket`, and
-     * `destination_kms_key` fields).
-     * If `destination` is present it will be used to construct the destination
-     * object's metadata; otherwise the destination object's metadata will be
-     * copied from the source object.
-     * 
- * - * .google.storage.v2.Object destination = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder> - getDestinationFieldBuilder() { - if (destinationBuilder_ == null) { - destinationBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder>( - getDestination(), getParentForChildren(), isClean()); - destination_ = null; - } - return destinationBuilder_; - } - - private java.lang.Object sourceBucket_ = ""; - /** - * - * - *
-     * Required. Name of the bucket in which to find the source object.
-     * 
- * - * string source_bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The sourceBucket. - */ - public java.lang.String getSourceBucket() { - java.lang.Object ref = sourceBucket_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - sourceBucket_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. Name of the bucket in which to find the source object.
-     * 
- * - * string source_bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for sourceBucket. - */ - public com.google.protobuf.ByteString getSourceBucketBytes() { - java.lang.Object ref = sourceBucket_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - sourceBucket_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. Name of the bucket in which to find the source object.
-     * 
- * - * string source_bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The sourceBucket to set. - * @return This builder for chaining. - */ - public Builder setSourceBucket(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - sourceBucket_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of the bucket in which to find the source object.
-     * 
- * - * string source_bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearSourceBucket() { - - sourceBucket_ = getDefaultInstance().getSourceBucket(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of the bucket in which to find the source object.
-     * 
- * - * string source_bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for sourceBucket to set. - * @return This builder for chaining. - */ - public Builder setSourceBucketBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - sourceBucket_ = value; - onChanged(); - return this; - } - - private java.lang.Object sourceObject_ = ""; - /** - * - * - *
-     * Required. Name of the source object.
-     * 
- * - * string source_object = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The sourceObject. - */ - public java.lang.String getSourceObject() { - java.lang.Object ref = sourceObject_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - sourceObject_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. Name of the source object.
-     * 
- * - * string source_object = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for sourceObject. - */ - public com.google.protobuf.ByteString getSourceObjectBytes() { - java.lang.Object ref = sourceObject_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - sourceObject_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. Name of the source object.
-     * 
- * - * string source_object = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The sourceObject to set. - * @return This builder for chaining. - */ - public Builder setSourceObject(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - sourceObject_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of the source object.
-     * 
- * - * string source_object = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearSourceObject() { - - sourceObject_ = getDefaultInstance().getSourceObject(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of the source object.
-     * 
- * - * string source_object = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for sourceObject to set. - * @return This builder for chaining. - */ - public Builder setSourceObjectBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - sourceObject_ = value; - onChanged(); - return this; - } - - private long sourceGeneration_; - /** - * - * - *
-     * If present, selects a specific revision of the source object (as opposed to
-     * the latest version, the default).
-     * 
- * - * int64 source_generation = 4; - * - * @return The sourceGeneration. - */ - @java.lang.Override - public long getSourceGeneration() { - return sourceGeneration_; - } - /** - * - * - *
-     * If present, selects a specific revision of the source object (as opposed to
-     * the latest version, the default).
-     * 
- * - * int64 source_generation = 4; - * - * @param value The sourceGeneration to set. - * @return This builder for chaining. - */ - public Builder setSourceGeneration(long value) { - - sourceGeneration_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If present, selects a specific revision of the source object (as opposed to
-     * the latest version, the default).
-     * 
- * - * int64 source_generation = 4; - * - * @return This builder for chaining. - */ - public Builder clearSourceGeneration() { - - sourceGeneration_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object rewriteToken_ = ""; - /** - * - * - *
-     * Include this field (from the previous rewrite response) on each rewrite
-     * request after the first one, until the rewrite response 'done' flag is
-     * true. Calls that provide a rewriteToken can omit all other request fields,
-     * but if included those fields must match the values provided in the first
-     * rewrite request.
-     * 
- * - * string rewrite_token = 5; - * - * @return The rewriteToken. - */ - public java.lang.String getRewriteToken() { - java.lang.Object ref = rewriteToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - rewriteToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Include this field (from the previous rewrite response) on each rewrite
-     * request after the first one, until the rewrite response 'done' flag is
-     * true. Calls that provide a rewriteToken can omit all other request fields,
-     * but if included those fields must match the values provided in the first
-     * rewrite request.
-     * 
- * - * string rewrite_token = 5; - * - * @return The bytes for rewriteToken. - */ - public com.google.protobuf.ByteString getRewriteTokenBytes() { - java.lang.Object ref = rewriteToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - rewriteToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Include this field (from the previous rewrite response) on each rewrite
-     * request after the first one, until the rewrite response 'done' flag is
-     * true. Calls that provide a rewriteToken can omit all other request fields,
-     * but if included those fields must match the values provided in the first
-     * rewrite request.
-     * 
- * - * string rewrite_token = 5; - * - * @param value The rewriteToken to set. - * @return This builder for chaining. - */ - public Builder setRewriteToken(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - rewriteToken_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Include this field (from the previous rewrite response) on each rewrite
-     * request after the first one, until the rewrite response 'done' flag is
-     * true. Calls that provide a rewriteToken can omit all other request fields,
-     * but if included those fields must match the values provided in the first
-     * rewrite request.
-     * 
- * - * string rewrite_token = 5; - * - * @return This builder for chaining. - */ - public Builder clearRewriteToken() { - - rewriteToken_ = getDefaultInstance().getRewriteToken(); - onChanged(); - return this; - } - /** - * - * - *
-     * Include this field (from the previous rewrite response) on each rewrite
-     * request after the first one, until the rewrite response 'done' flag is
-     * true. Calls that provide a rewriteToken can omit all other request fields,
-     * but if included those fields must match the values provided in the first
-     * rewrite request.
-     * 
- * - * string rewrite_token = 5; - * - * @param value The bytes for rewriteToken to set. - * @return This builder for chaining. - */ - public Builder setRewriteTokenBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - rewriteToken_ = value; - onChanged(); - return this; - } - - private int destinationPredefinedAcl_ = 0; - /** - * - * - *
-     * Apply a predefined set of access controls to the destination object.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl destination_predefined_acl = 6; - * - * @return The enum numeric value on the wire for destinationPredefinedAcl. - */ - @java.lang.Override - public int getDestinationPredefinedAclValue() { - return destinationPredefinedAcl_; - } - /** - * - * - *
-     * Apply a predefined set of access controls to the destination object.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl destination_predefined_acl = 6; - * - * @param value The enum numeric value on the wire for destinationPredefinedAcl to set. - * @return This builder for chaining. - */ - public Builder setDestinationPredefinedAclValue(int value) { - - destinationPredefinedAcl_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Apply a predefined set of access controls to the destination object.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl destination_predefined_acl = 6; - * - * @return The destinationPredefinedAcl. - */ - @java.lang.Override - public com.google.storage.v2.PredefinedObjectAcl getDestinationPredefinedAcl() { - @SuppressWarnings("deprecation") - com.google.storage.v2.PredefinedObjectAcl result = - com.google.storage.v2.PredefinedObjectAcl.valueOf(destinationPredefinedAcl_); - return result == null ? com.google.storage.v2.PredefinedObjectAcl.UNRECOGNIZED : result; - } - /** - * - * - *
-     * Apply a predefined set of access controls to the destination object.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl destination_predefined_acl = 6; - * - * @param value The destinationPredefinedAcl to set. - * @return This builder for chaining. - */ - public Builder setDestinationPredefinedAcl(com.google.storage.v2.PredefinedObjectAcl value) { - if (value == null) { - throw new NullPointerException(); - } - - destinationPredefinedAcl_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * Apply a predefined set of access controls to the destination object.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl destination_predefined_acl = 6; - * - * @return This builder for chaining. - */ - public Builder clearDestinationPredefinedAcl() { - - destinationPredefinedAcl_ = 0; - onChanged(); - return this; - } - - private long ifGenerationMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * matches the given value. Setting to 0 makes the operation succeed only if
-     * there are no live versions of the object.
-     * 
- * - * optional int64 if_generation_match = 7; - * - * @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 = 7; - * - * @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 = 7; - * - * @param value The ifGenerationMatch to set. - * @return This builder for chaining. - */ - public Builder setIfGenerationMatch(long value) { - bitField0_ |= 0x00000001; - ifGenerationMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * matches the given value. Setting to 0 makes the operation succeed only if
-     * there are no live versions of the object.
-     * 
- * - * optional int64 if_generation_match = 7; - * - * @return This builder for chaining. - */ - public Builder clearIfGenerationMatch() { - bitField0_ = (bitField0_ & ~0x00000001); - ifGenerationMatch_ = 0L; - onChanged(); - return this; - } - - private long ifGenerationNotMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * does not match the given value. If no live object exists, the precondition
-     * fails. Setting to 0 makes the operation succeed only if there is a live
-     * version of the object.
-     * 
- * - * optional int64 if_generation_not_match = 8; - * - * @return Whether the ifGenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfGenerationNotMatch() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * does not match the given value. If no live object exists, the precondition
-     * fails. Setting to 0 makes the operation succeed only if there is a live
-     * version of the object.
-     * 
- * - * optional int64 if_generation_not_match = 8; - * - * @return The ifGenerationNotMatch. - */ - @java.lang.Override - public long getIfGenerationNotMatch() { - return ifGenerationNotMatch_; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * does not match the given value. If no live object exists, the precondition
-     * fails. Setting to 0 makes the operation succeed only if there is a live
-     * version of the object.
-     * 
- * - * optional int64 if_generation_not_match = 8; - * - * @param value The ifGenerationNotMatch to set. - * @return This builder for chaining. - */ - public Builder setIfGenerationNotMatch(long value) { - bitField0_ |= 0x00000002; - ifGenerationNotMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * does not match the given value. If no live object exists, the precondition
-     * fails. Setting to 0 makes the operation succeed only if there is a live
-     * version of the object.
-     * 
- * - * optional int64 if_generation_not_match = 8; - * - * @return This builder for chaining. - */ - public Builder clearIfGenerationNotMatch() { - bitField0_ = (bitField0_ & ~0x00000002); - ifGenerationNotMatch_ = 0L; - onChanged(); - return this; - } - - private long ifMetagenerationMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the destination object's current
-     * metageneration matches the given value.
-     * 
- * - * optional int64 if_metageneration_match = 9; - * - * @return Whether the ifMetagenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationMatch() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * - * - *
-     * Makes the operation conditional on whether the destination object's current
-     * metageneration matches the given value.
-     * 
- * - * optional int64 if_metageneration_match = 9; - * - * @return The ifMetagenerationMatch. - */ - @java.lang.Override - public long getIfMetagenerationMatch() { - return ifMetagenerationMatch_; - } - /** - * - * - *
-     * Makes the operation conditional on whether the destination object's current
-     * metageneration matches the given value.
-     * 
- * - * optional int64 if_metageneration_match = 9; - * - * @param value The ifMetagenerationMatch to set. - * @return This builder for chaining. - */ - public Builder setIfMetagenerationMatch(long value) { - bitField0_ |= 0x00000004; - ifMetagenerationMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the destination object's current
-     * metageneration matches the given value.
-     * 
- * - * optional int64 if_metageneration_match = 9; - * - * @return This builder for chaining. - */ - public Builder clearIfMetagenerationMatch() { - bitField0_ = (bitField0_ & ~0x00000004); - ifMetagenerationMatch_ = 0L; - onChanged(); - return this; - } - - private long ifMetagenerationNotMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the destination object's current
-     * metageneration does not match the given value.
-     * 
- * - * optional int64 if_metageneration_not_match = 10; - * - * @return Whether the ifMetagenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationNotMatch() { - return ((bitField0_ & 0x00000008) != 0); - } - /** - * - * - *
-     * Makes the operation conditional on whether the destination object's current
-     * metageneration does not match the given value.
-     * 
- * - * optional int64 if_metageneration_not_match = 10; - * - * @return The ifMetagenerationNotMatch. - */ - @java.lang.Override - public long getIfMetagenerationNotMatch() { - return ifMetagenerationNotMatch_; - } - /** - * - * - *
-     * Makes the operation conditional on whether the destination object's current
-     * metageneration does not match the given value.
-     * 
- * - * optional int64 if_metageneration_not_match = 10; - * - * @param value The ifMetagenerationNotMatch to set. - * @return This builder for chaining. - */ - public Builder setIfMetagenerationNotMatch(long value) { - bitField0_ |= 0x00000008; - ifMetagenerationNotMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the destination object's current
-     * metageneration does not match the given value.
-     * 
- * - * optional int64 if_metageneration_not_match = 10; - * - * @return This builder for chaining. - */ - public Builder clearIfMetagenerationNotMatch() { - bitField0_ = (bitField0_ & ~0x00000008); - ifMetagenerationNotMatch_ = 0L; - onChanged(); - return this; - } - - private long ifSourceGenerationMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the source object's current
-     * generation matches the given value.
-     * 
- * - * optional int64 if_source_generation_match = 11; - * - * @return Whether the ifSourceGenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfSourceGenerationMatch() { - return ((bitField0_ & 0x00000010) != 0); - } - /** - * - * - *
-     * Makes the operation conditional on whether the source object's current
-     * generation matches the given value.
-     * 
- * - * optional int64 if_source_generation_match = 11; - * - * @return The ifSourceGenerationMatch. - */ - @java.lang.Override - public long getIfSourceGenerationMatch() { - return ifSourceGenerationMatch_; - } - /** - * - * - *
-     * Makes the operation conditional on whether the source object's current
-     * generation matches the given value.
-     * 
- * - * optional int64 if_source_generation_match = 11; - * - * @param value The ifSourceGenerationMatch to set. - * @return This builder for chaining. - */ - public Builder setIfSourceGenerationMatch(long value) { - bitField0_ |= 0x00000010; - ifSourceGenerationMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the source object's current
-     * generation matches the given value.
-     * 
- * - * optional int64 if_source_generation_match = 11; - * - * @return This builder for chaining. - */ - public Builder clearIfSourceGenerationMatch() { - bitField0_ = (bitField0_ & ~0x00000010); - ifSourceGenerationMatch_ = 0L; - onChanged(); - return this; - } - - private long ifSourceGenerationNotMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the source object's current
-     * generation does not match the given value.
-     * 
- * - * optional int64 if_source_generation_not_match = 12; - * - * @return Whether the ifSourceGenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfSourceGenerationNotMatch() { - return ((bitField0_ & 0x00000020) != 0); - } - /** - * - * - *
-     * Makes the operation conditional on whether the source object's current
-     * generation does not match the given value.
-     * 
- * - * optional int64 if_source_generation_not_match = 12; - * - * @return The ifSourceGenerationNotMatch. - */ - @java.lang.Override - public long getIfSourceGenerationNotMatch() { - return ifSourceGenerationNotMatch_; - } - /** - * - * - *
-     * Makes the operation conditional on whether the source object's current
-     * generation does not match the given value.
-     * 
- * - * optional int64 if_source_generation_not_match = 12; - * - * @param value The ifSourceGenerationNotMatch to set. - * @return This builder for chaining. - */ - public Builder setIfSourceGenerationNotMatch(long value) { - bitField0_ |= 0x00000020; - ifSourceGenerationNotMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the source object's current
-     * generation does not match the given value.
-     * 
- * - * optional int64 if_source_generation_not_match = 12; - * - * @return This builder for chaining. - */ - public Builder clearIfSourceGenerationNotMatch() { - bitField0_ = (bitField0_ & ~0x00000020); - ifSourceGenerationNotMatch_ = 0L; - onChanged(); - return this; - } - - private long ifSourceMetagenerationMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the source object's current
-     * metageneration matches the given value.
-     * 
- * - * optional int64 if_source_metageneration_match = 13; - * - * @return Whether the ifSourceMetagenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfSourceMetagenerationMatch() { - return ((bitField0_ & 0x00000040) != 0); - } - /** - * - * - *
-     * Makes the operation conditional on whether the source object's current
-     * metageneration matches the given value.
-     * 
- * - * optional int64 if_source_metageneration_match = 13; - * - * @return The ifSourceMetagenerationMatch. - */ - @java.lang.Override - public long getIfSourceMetagenerationMatch() { - return ifSourceMetagenerationMatch_; - } - /** - * - * - *
-     * Makes the operation conditional on whether the source object's current
-     * metageneration matches the given value.
-     * 
- * - * optional int64 if_source_metageneration_match = 13; - * - * @param value The ifSourceMetagenerationMatch to set. - * @return This builder for chaining. - */ - public Builder setIfSourceMetagenerationMatch(long value) { - bitField0_ |= 0x00000040; - ifSourceMetagenerationMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the source object's current
-     * metageneration matches the given value.
-     * 
- * - * optional int64 if_source_metageneration_match = 13; - * - * @return This builder for chaining. - */ - public Builder clearIfSourceMetagenerationMatch() { - bitField0_ = (bitField0_ & ~0x00000040); - ifSourceMetagenerationMatch_ = 0L; - onChanged(); - return this; - } - - private long ifSourceMetagenerationNotMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the source object's current
-     * metageneration does not match the given value.
-     * 
- * - * optional int64 if_source_metageneration_not_match = 14; - * - * @return Whether the ifSourceMetagenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfSourceMetagenerationNotMatch() { - return ((bitField0_ & 0x00000080) != 0); - } - /** - * - * - *
-     * Makes the operation conditional on whether the source object's current
-     * metageneration does not match the given value.
-     * 
- * - * optional int64 if_source_metageneration_not_match = 14; - * - * @return The ifSourceMetagenerationNotMatch. - */ - @java.lang.Override - public long getIfSourceMetagenerationNotMatch() { - return ifSourceMetagenerationNotMatch_; - } - /** - * - * - *
-     * Makes the operation conditional on whether the source object's current
-     * metageneration does not match the given value.
-     * 
- * - * optional int64 if_source_metageneration_not_match = 14; - * - * @param value The ifSourceMetagenerationNotMatch to set. - * @return This builder for chaining. - */ - public Builder setIfSourceMetagenerationNotMatch(long value) { - bitField0_ |= 0x00000080; - ifSourceMetagenerationNotMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the source object's current
-     * metageneration does not match the given value.
-     * 
- * - * optional int64 if_source_metageneration_not_match = 14; - * - * @return This builder for chaining. - */ - public Builder clearIfSourceMetagenerationNotMatch() { - bitField0_ = (bitField0_ & ~0x00000080); - ifSourceMetagenerationNotMatch_ = 0L; - onChanged(); - return this; - } - - private long maxBytesRewrittenPerCall_; - /** - * - * - *
-     * The maximum number of bytes that will be rewritten per rewrite request.
-     * Most callers
-     * shouldn't need to specify this parameter - it is primarily in place to
-     * support testing. If specified the value must be an integral multiple of
-     * 1 MiB (1048576). Also, this only applies to requests where the source and
-     * destination span locations and/or storage classes. Finally, this value must
-     * not change across rewrite calls else you'll get an error that the
-     * `rewriteToken` is invalid.
-     * 
- * - * int64 max_bytes_rewritten_per_call = 15; - * - * @return The maxBytesRewrittenPerCall. - */ - @java.lang.Override - public long getMaxBytesRewrittenPerCall() { - return maxBytesRewrittenPerCall_; - } - /** - * - * - *
-     * The maximum number of bytes that will be rewritten per rewrite request.
-     * Most callers
-     * shouldn't need to specify this parameter - it is primarily in place to
-     * support testing. If specified the value must be an integral multiple of
-     * 1 MiB (1048576). Also, this only applies to requests where the source and
-     * destination span locations and/or storage classes. Finally, this value must
-     * not change across rewrite calls else you'll get an error that the
-     * `rewriteToken` is invalid.
-     * 
- * - * int64 max_bytes_rewritten_per_call = 15; - * - * @param value The maxBytesRewrittenPerCall to set. - * @return This builder for chaining. - */ - public Builder setMaxBytesRewrittenPerCall(long value) { - - maxBytesRewrittenPerCall_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The maximum number of bytes that will be rewritten per rewrite request.
-     * Most callers
-     * shouldn't need to specify this parameter - it is primarily in place to
-     * support testing. If specified the value must be an integral multiple of
-     * 1 MiB (1048576). Also, this only applies to requests where the source and
-     * destination span locations and/or storage classes. Finally, this value must
-     * not change across rewrite calls else you'll get an error that the
-     * `rewriteToken` is invalid.
-     * 
- * - * int64 max_bytes_rewritten_per_call = 15; - * - * @return This builder for chaining. - */ - public Builder clearMaxBytesRewrittenPerCall() { - - maxBytesRewrittenPerCall_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object copySourceEncryptionAlgorithm_ = ""; - /** - * - * - *
-     * The algorithm used to encrypt the source object, if any. Used if the source
-     * object was encrypted with a Customer-Supplied Encryption Key.
-     * 
- * - * string copy_source_encryption_algorithm = 16; - * - * @return The copySourceEncryptionAlgorithm. - */ - public java.lang.String getCopySourceEncryptionAlgorithm() { - java.lang.Object ref = copySourceEncryptionAlgorithm_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - copySourceEncryptionAlgorithm_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The algorithm used to encrypt the source object, if any. Used if the source
-     * object was encrypted with a Customer-Supplied Encryption Key.
-     * 
- * - * string copy_source_encryption_algorithm = 16; - * - * @return The bytes for copySourceEncryptionAlgorithm. - */ - public com.google.protobuf.ByteString getCopySourceEncryptionAlgorithmBytes() { - java.lang.Object ref = copySourceEncryptionAlgorithm_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - copySourceEncryptionAlgorithm_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The algorithm used to encrypt the source object, if any. Used if the source
-     * object was encrypted with a Customer-Supplied Encryption Key.
-     * 
- * - * string copy_source_encryption_algorithm = 16; - * - * @param value The copySourceEncryptionAlgorithm to set. - * @return This builder for chaining. - */ - public Builder setCopySourceEncryptionAlgorithm(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - copySourceEncryptionAlgorithm_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The algorithm used to encrypt the source object, if any. Used if the source
-     * object was encrypted with a Customer-Supplied Encryption Key.
-     * 
- * - * string copy_source_encryption_algorithm = 16; - * - * @return This builder for chaining. - */ - public Builder clearCopySourceEncryptionAlgorithm() { - - copySourceEncryptionAlgorithm_ = getDefaultInstance().getCopySourceEncryptionAlgorithm(); - onChanged(); - return this; - } - /** - * - * - *
-     * The algorithm used to encrypt the source object, if any. Used if the source
-     * object was encrypted with a Customer-Supplied Encryption Key.
-     * 
- * - * string copy_source_encryption_algorithm = 16; - * - * @param value The bytes for copySourceEncryptionAlgorithm to set. - * @return This builder for chaining. - */ - public Builder setCopySourceEncryptionAlgorithmBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - copySourceEncryptionAlgorithm_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString copySourceEncryptionKeyBytes_ = - com.google.protobuf.ByteString.EMPTY; - /** - * - * - *
-     * The raw bytes (not base64-encoded) AES-256 encryption key used to encrypt
-     * the source object, if it was encrypted with a Customer-Supplied Encryption
-     * Key.
-     * 
- * - * bytes copy_source_encryption_key_bytes = 21; - * - * @return The copySourceEncryptionKeyBytes. - */ - @java.lang.Override - public com.google.protobuf.ByteString getCopySourceEncryptionKeyBytes() { - return copySourceEncryptionKeyBytes_; - } - /** - * - * - *
-     * The raw bytes (not base64-encoded) AES-256 encryption key used to encrypt
-     * the source object, if it was encrypted with a Customer-Supplied Encryption
-     * Key.
-     * 
- * - * bytes copy_source_encryption_key_bytes = 21; - * - * @param value The copySourceEncryptionKeyBytes to set. - * @return This builder for chaining. - */ - public Builder setCopySourceEncryptionKeyBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - copySourceEncryptionKeyBytes_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The raw bytes (not base64-encoded) AES-256 encryption key used to encrypt
-     * the source object, if it was encrypted with a Customer-Supplied Encryption
-     * Key.
-     * 
- * - * bytes copy_source_encryption_key_bytes = 21; - * - * @return This builder for chaining. - */ - public Builder clearCopySourceEncryptionKeyBytes() { - - copySourceEncryptionKeyBytes_ = getDefaultInstance().getCopySourceEncryptionKeyBytes(); - onChanged(); - return this; - } - - private com.google.protobuf.ByteString copySourceEncryptionKeySha256Bytes_ = - com.google.protobuf.ByteString.EMPTY; - /** - * - * - *
-     * The raw bytes (not base64-encoded) SHA256 hash of the encryption key used
-     * to encrypt the source object, if it was encrypted with a Customer-Supplied
-     * Encryption Key.
-     * 
- * - * bytes copy_source_encryption_key_sha256_bytes = 22; - * - * @return The copySourceEncryptionKeySha256Bytes. - */ - @java.lang.Override - public com.google.protobuf.ByteString getCopySourceEncryptionKeySha256Bytes() { - return copySourceEncryptionKeySha256Bytes_; - } - /** - * - * - *
-     * The raw bytes (not base64-encoded) SHA256 hash of the encryption key used
-     * to encrypt the source object, if it was encrypted with a Customer-Supplied
-     * Encryption Key.
-     * 
- * - * bytes copy_source_encryption_key_sha256_bytes = 22; - * - * @param value The copySourceEncryptionKeySha256Bytes to set. - * @return This builder for chaining. - */ - public Builder setCopySourceEncryptionKeySha256Bytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - copySourceEncryptionKeySha256Bytes_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The raw bytes (not base64-encoded) SHA256 hash of the encryption key used
-     * to encrypt the source object, if it was encrypted with a Customer-Supplied
-     * Encryption Key.
-     * 
- * - * bytes copy_source_encryption_key_sha256_bytes = 22; - * - * @return This builder for chaining. - */ - public Builder clearCopySourceEncryptionKeySha256Bytes() { - - copySourceEncryptionKeySha256Bytes_ = - getDefaultInstance().getCopySourceEncryptionKeySha256Bytes(); - 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 = 19; - * - * @return Whether the commonObjectRequestParams field is set. - */ - public boolean hasCommonObjectRequestParams() { - return commonObjectRequestParamsBuilder_ != null || commonObjectRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 19; - * - * @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 = 19; - */ - public Builder setCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams value) { - if (commonObjectRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonObjectRequestParams_ = value; - onChanged(); - } else { - commonObjectRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 19; - */ - public Builder setCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams.Builder builderForValue) { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonObjectRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 19; - */ - public Builder mergeCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams value) { - if (commonObjectRequestParamsBuilder_ == null) { - if (commonObjectRequestParams_ != null) { - commonObjectRequestParams_ = - com.google.storage.v2.CommonObjectRequestParams.newBuilder(commonObjectRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonObjectRequestParams_ = value; - } - onChanged(); - } else { - commonObjectRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 19; - */ - public Builder clearCommonObjectRequestParams() { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = null; - onChanged(); - } else { - commonObjectRequestParams_ = null; - commonObjectRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 19; - */ - public com.google.storage.v2.CommonObjectRequestParams.Builder - getCommonObjectRequestParamsBuilder() { - - onChanged(); - return getCommonObjectRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 19; - */ - 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 = 19; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder> - getCommonObjectRequestParamsFieldBuilder() { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder>( - getCommonObjectRequestParams(), getParentForChildren(), isClean()); - commonObjectRequestParams_ = null; - } - return commonObjectRequestParamsBuilder_; - } - - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - commonRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 20; - * - * @return Whether the commonRequestParams field is set. - */ - public boolean hasCommonRequestParams() { - return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 20; - * - * @return The commonRequestParams. - */ - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } else { - return commonRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 20; - */ - public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonRequestParams_ = value; - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 20; - */ - public Builder setCommonRequestParams( - com.google.storage.v2.CommonRequestParams.Builder builderForValue) { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 20; - */ - public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (commonRequestParams_ != null) { - commonRequestParams_ = - com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonRequestParams_ = value; - } - onChanged(); - } else { - commonRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 20; - */ - public Builder clearCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - onChanged(); - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 20; - */ - public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { - - onChanged(); - return getCommonRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 20; - */ - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - if (commonRequestParamsBuilder_ != null) { - return commonRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 20; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - getCommonRequestParamsFieldBuilder() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder>( - getCommonRequestParams(), getParentForChildren(), isClean()); - commonRequestParams_ = null; - } - return commonRequestParamsBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.RewriteObjectRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.RewriteObjectRequest) - private static final com.google.storage.v2.RewriteObjectRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.RewriteObjectRequest(); - } - - public static com.google.storage.v2.RewriteObjectRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RewriteObjectRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RewriteObjectRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.RewriteObjectRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/RewriteObjectRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/RewriteObjectRequestOrBuilder.java deleted file mode 100644 index 549946c697..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/RewriteObjectRequestOrBuilder.java +++ /dev/null @@ -1,668 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface RewriteObjectRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.RewriteObjectRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Immutable. The name of the destination object. Nearly any sequence of unicode
-   * characters is valid. See
-   * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
-   * Example: `test.txt`
-   * The `name` field by itself does not uniquely identify a Cloud Storage
-   * object. A Cloud Storage object is uniquely identified by the tuple of
-   * (bucket, object, generation).
-   * 
- * - * string destination_name = 24 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The destinationName. - */ - java.lang.String getDestinationName(); - /** - * - * - *
-   * Immutable. The name of the destination object. Nearly any sequence of unicode
-   * characters is valid. See
-   * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
-   * Example: `test.txt`
-   * The `name` field by itself does not uniquely identify a Cloud Storage
-   * object. A Cloud Storage object is uniquely identified by the tuple of
-   * (bucket, object, generation).
-   * 
- * - * string destination_name = 24 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The bytes for destinationName. - */ - com.google.protobuf.ByteString getDestinationNameBytes(); - - /** - * - * - *
-   * Immutable. The name of the bucket containing The name of the destination object.
-   * 
- * - * - * string destination_bucket = 25 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @return The destinationBucket. - */ - java.lang.String getDestinationBucket(); - /** - * - * - *
-   * Immutable. The name of the bucket containing The name of the destination object.
-   * 
- * - * - * string destination_bucket = 25 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for destinationBucket. - */ - com.google.protobuf.ByteString getDestinationBucketBytes(); - - /** - * - * - *
-   * The name of the Cloud KMS key that will be used to encrypt the destination
-   * object. The Cloud KMS key must be located in same location as the object.
-   * If the parameter is not specified, the request uses the destination
-   * bucket's default encryption key, if any, or else the Google-managed
-   * encryption key.
-   * 
- * - * string destination_kms_key = 27 [(.google.api.resource_reference) = { ... } - * - * @return The destinationKmsKey. - */ - java.lang.String getDestinationKmsKey(); - /** - * - * - *
-   * The name of the Cloud KMS key that will be used to encrypt the destination
-   * object. The Cloud KMS key must be located in same location as the object.
-   * If the parameter is not specified, the request uses the destination
-   * bucket's default encryption key, if any, or else the Google-managed
-   * encryption key.
-   * 
- * - * string destination_kms_key = 27 [(.google.api.resource_reference) = { ... } - * - * @return The bytes for destinationKmsKey. - */ - com.google.protobuf.ByteString getDestinationKmsKeyBytes(); - - /** - * - * - *
-   * Properties of the destination, post-rewrite object.
-   * The `name`, `bucket` and `kms_key` fields must not be populated (these
-   * values are specified in the `destination_name`, `destination_bucket`, and
-   * `destination_kms_key` fields).
-   * If `destination` is present it will be used to construct the destination
-   * object's metadata; otherwise the destination object's metadata will be
-   * copied from the source object.
-   * 
- * - * .google.storage.v2.Object destination = 1; - * - * @return Whether the destination field is set. - */ - boolean hasDestination(); - /** - * - * - *
-   * Properties of the destination, post-rewrite object.
-   * The `name`, `bucket` and `kms_key` fields must not be populated (these
-   * values are specified in the `destination_name`, `destination_bucket`, and
-   * `destination_kms_key` fields).
-   * If `destination` is present it will be used to construct the destination
-   * object's metadata; otherwise the destination object's metadata will be
-   * copied from the source object.
-   * 
- * - * .google.storage.v2.Object destination = 1; - * - * @return The destination. - */ - com.google.storage.v2.Object getDestination(); - /** - * - * - *
-   * Properties of the destination, post-rewrite object.
-   * The `name`, `bucket` and `kms_key` fields must not be populated (these
-   * values are specified in the `destination_name`, `destination_bucket`, and
-   * `destination_kms_key` fields).
-   * If `destination` is present it will be used to construct the destination
-   * object's metadata; otherwise the destination object's metadata will be
-   * copied from the source object.
-   * 
- * - * .google.storage.v2.Object destination = 1; - */ - com.google.storage.v2.ObjectOrBuilder getDestinationOrBuilder(); - - /** - * - * - *
-   * Required. Name of the bucket in which to find the source object.
-   * 
- * - * string source_bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The sourceBucket. - */ - java.lang.String getSourceBucket(); - /** - * - * - *
-   * Required. Name of the bucket in which to find the source object.
-   * 
- * - * string source_bucket = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for sourceBucket. - */ - com.google.protobuf.ByteString getSourceBucketBytes(); - - /** - * - * - *
-   * Required. Name of the source object.
-   * 
- * - * string source_object = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The sourceObject. - */ - java.lang.String getSourceObject(); - /** - * - * - *
-   * Required. Name of the source object.
-   * 
- * - * string source_object = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for sourceObject. - */ - com.google.protobuf.ByteString getSourceObjectBytes(); - - /** - * - * - *
-   * If present, selects a specific revision of the source object (as opposed to
-   * the latest version, the default).
-   * 
- * - * int64 source_generation = 4; - * - * @return The sourceGeneration. - */ - long getSourceGeneration(); - - /** - * - * - *
-   * Include this field (from the previous rewrite response) on each rewrite
-   * request after the first one, until the rewrite response 'done' flag is
-   * true. Calls that provide a rewriteToken can omit all other request fields,
-   * but if included those fields must match the values provided in the first
-   * rewrite request.
-   * 
- * - * string rewrite_token = 5; - * - * @return The rewriteToken. - */ - java.lang.String getRewriteToken(); - /** - * - * - *
-   * Include this field (from the previous rewrite response) on each rewrite
-   * request after the first one, until the rewrite response 'done' flag is
-   * true. Calls that provide a rewriteToken can omit all other request fields,
-   * but if included those fields must match the values provided in the first
-   * rewrite request.
-   * 
- * - * string rewrite_token = 5; - * - * @return The bytes for rewriteToken. - */ - com.google.protobuf.ByteString getRewriteTokenBytes(); - - /** - * - * - *
-   * Apply a predefined set of access controls to the destination object.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl destination_predefined_acl = 6; - * - * @return The enum numeric value on the wire for destinationPredefinedAcl. - */ - int getDestinationPredefinedAclValue(); - /** - * - * - *
-   * Apply a predefined set of access controls to the destination object.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl destination_predefined_acl = 6; - * - * @return The destinationPredefinedAcl. - */ - com.google.storage.v2.PredefinedObjectAcl getDestinationPredefinedAcl(); - - /** - * - * - *
-   * 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 = 7; - * - * @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 = 7; - * - * @return The ifGenerationMatch. - */ - long getIfGenerationMatch(); - - /** - * - * - *
-   * Makes the operation conditional on whether the object's current generation
-   * does not match the given value. If no live object exists, the precondition
-   * fails. Setting to 0 makes the operation succeed only if there is a live
-   * version of the object.
-   * 
- * - * optional int64 if_generation_not_match = 8; - * - * @return Whether the ifGenerationNotMatch field is set. - */ - boolean hasIfGenerationNotMatch(); - /** - * - * - *
-   * Makes the operation conditional on whether the object's current generation
-   * does not match the given value. If no live object exists, the precondition
-   * fails. Setting to 0 makes the operation succeed only if there is a live
-   * version of the object.
-   * 
- * - * optional int64 if_generation_not_match = 8; - * - * @return The ifGenerationNotMatch. - */ - long getIfGenerationNotMatch(); - - /** - * - * - *
-   * Makes the operation conditional on whether the destination object's current
-   * metageneration matches the given value.
-   * 
- * - * optional int64 if_metageneration_match = 9; - * - * @return Whether the ifMetagenerationMatch field is set. - */ - boolean hasIfMetagenerationMatch(); - /** - * - * - *
-   * Makes the operation conditional on whether the destination object's current
-   * metageneration matches the given value.
-   * 
- * - * optional int64 if_metageneration_match = 9; - * - * @return The ifMetagenerationMatch. - */ - long getIfMetagenerationMatch(); - - /** - * - * - *
-   * Makes the operation conditional on whether the destination object's current
-   * metageneration does not match the given value.
-   * 
- * - * optional int64 if_metageneration_not_match = 10; - * - * @return Whether the ifMetagenerationNotMatch field is set. - */ - boolean hasIfMetagenerationNotMatch(); - /** - * - * - *
-   * Makes the operation conditional on whether the destination object's current
-   * metageneration does not match the given value.
-   * 
- * - * optional int64 if_metageneration_not_match = 10; - * - * @return The ifMetagenerationNotMatch. - */ - long getIfMetagenerationNotMatch(); - - /** - * - * - *
-   * Makes the operation conditional on whether the source object's current
-   * generation matches the given value.
-   * 
- * - * optional int64 if_source_generation_match = 11; - * - * @return Whether the ifSourceGenerationMatch field is set. - */ - boolean hasIfSourceGenerationMatch(); - /** - * - * - *
-   * Makes the operation conditional on whether the source object's current
-   * generation matches the given value.
-   * 
- * - * optional int64 if_source_generation_match = 11; - * - * @return The ifSourceGenerationMatch. - */ - long getIfSourceGenerationMatch(); - - /** - * - * - *
-   * Makes the operation conditional on whether the source object's current
-   * generation does not match the given value.
-   * 
- * - * optional int64 if_source_generation_not_match = 12; - * - * @return Whether the ifSourceGenerationNotMatch field is set. - */ - boolean hasIfSourceGenerationNotMatch(); - /** - * - * - *
-   * Makes the operation conditional on whether the source object's current
-   * generation does not match the given value.
-   * 
- * - * optional int64 if_source_generation_not_match = 12; - * - * @return The ifSourceGenerationNotMatch. - */ - long getIfSourceGenerationNotMatch(); - - /** - * - * - *
-   * Makes the operation conditional on whether the source object's current
-   * metageneration matches the given value.
-   * 
- * - * optional int64 if_source_metageneration_match = 13; - * - * @return Whether the ifSourceMetagenerationMatch field is set. - */ - boolean hasIfSourceMetagenerationMatch(); - /** - * - * - *
-   * Makes the operation conditional on whether the source object's current
-   * metageneration matches the given value.
-   * 
- * - * optional int64 if_source_metageneration_match = 13; - * - * @return The ifSourceMetagenerationMatch. - */ - long getIfSourceMetagenerationMatch(); - - /** - * - * - *
-   * Makes the operation conditional on whether the source object's current
-   * metageneration does not match the given value.
-   * 
- * - * optional int64 if_source_metageneration_not_match = 14; - * - * @return Whether the ifSourceMetagenerationNotMatch field is set. - */ - boolean hasIfSourceMetagenerationNotMatch(); - /** - * - * - *
-   * Makes the operation conditional on whether the source object's current
-   * metageneration does not match the given value.
-   * 
- * - * optional int64 if_source_metageneration_not_match = 14; - * - * @return The ifSourceMetagenerationNotMatch. - */ - long getIfSourceMetagenerationNotMatch(); - - /** - * - * - *
-   * The maximum number of bytes that will be rewritten per rewrite request.
-   * Most callers
-   * shouldn't need to specify this parameter - it is primarily in place to
-   * support testing. If specified the value must be an integral multiple of
-   * 1 MiB (1048576). Also, this only applies to requests where the source and
-   * destination span locations and/or storage classes. Finally, this value must
-   * not change across rewrite calls else you'll get an error that the
-   * `rewriteToken` is invalid.
-   * 
- * - * int64 max_bytes_rewritten_per_call = 15; - * - * @return The maxBytesRewrittenPerCall. - */ - long getMaxBytesRewrittenPerCall(); - - /** - * - * - *
-   * The algorithm used to encrypt the source object, if any. Used if the source
-   * object was encrypted with a Customer-Supplied Encryption Key.
-   * 
- * - * string copy_source_encryption_algorithm = 16; - * - * @return The copySourceEncryptionAlgorithm. - */ - java.lang.String getCopySourceEncryptionAlgorithm(); - /** - * - * - *
-   * The algorithm used to encrypt the source object, if any. Used if the source
-   * object was encrypted with a Customer-Supplied Encryption Key.
-   * 
- * - * string copy_source_encryption_algorithm = 16; - * - * @return The bytes for copySourceEncryptionAlgorithm. - */ - com.google.protobuf.ByteString getCopySourceEncryptionAlgorithmBytes(); - - /** - * - * - *
-   * The raw bytes (not base64-encoded) AES-256 encryption key used to encrypt
-   * the source object, if it was encrypted with a Customer-Supplied Encryption
-   * Key.
-   * 
- * - * bytes copy_source_encryption_key_bytes = 21; - * - * @return The copySourceEncryptionKeyBytes. - */ - com.google.protobuf.ByteString getCopySourceEncryptionKeyBytes(); - - /** - * - * - *
-   * The raw bytes (not base64-encoded) SHA256 hash of the encryption key used
-   * to encrypt the source object, if it was encrypted with a Customer-Supplied
-   * Encryption Key.
-   * 
- * - * bytes copy_source_encryption_key_sha256_bytes = 22; - * - * @return The copySourceEncryptionKeySha256Bytes. - */ - com.google.protobuf.ByteString getCopySourceEncryptionKeySha256Bytes(); - - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 19; - * - * @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 = 19; - * - * @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 = 19; - */ - com.google.storage.v2.CommonObjectRequestParamsOrBuilder getCommonObjectRequestParamsOrBuilder(); - - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 20; - * - * @return Whether the commonRequestParams field is set. - */ - boolean hasCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 20; - * - * @return The commonRequestParams. - */ - com.google.storage.v2.CommonRequestParams getCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 20; - */ - com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/RewriteResponse.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/RewriteResponse.java deleted file mode 100644 index 61be8437a6..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/RewriteResponse.java +++ /dev/null @@ -1,1201 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * A rewrite response.
- * 
- * - * Protobuf type {@code google.storage.v2.RewriteResponse} - */ -public final class RewriteResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.RewriteResponse) - RewriteResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use RewriteResponse.newBuilder() to construct. - private RewriteResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private RewriteResponse() { - rewriteToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RewriteResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private RewriteResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - totalBytesRewritten_ = input.readInt64(); - break; - } - case 16: - { - objectSize_ = input.readInt64(); - break; - } - case 24: - { - done_ = input.readBool(); - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - - rewriteToken_ = s; - break; - } - case 42: - { - com.google.storage.v2.Object.Builder subBuilder = null; - if (resource_ != null) { - subBuilder = resource_.toBuilder(); - } - resource_ = - input.readMessage(com.google.storage.v2.Object.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(resource_); - resource_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_RewriteResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_RewriteResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.RewriteResponse.class, - com.google.storage.v2.RewriteResponse.Builder.class); - } - - public static final int TOTAL_BYTES_REWRITTEN_FIELD_NUMBER = 1; - private long totalBytesRewritten_; - /** - * - * - *
-   * The total bytes written so far, which can be used to provide a waiting user
-   * with a progress indicator. This property is always present in the response.
-   * 
- * - * int64 total_bytes_rewritten = 1; - * - * @return The totalBytesRewritten. - */ - @java.lang.Override - public long getTotalBytesRewritten() { - return totalBytesRewritten_; - } - - public static final int OBJECT_SIZE_FIELD_NUMBER = 2; - private long objectSize_; - /** - * - * - *
-   * The total size of the object being copied in bytes. This property is always
-   * present in the response.
-   * 
- * - * int64 object_size = 2; - * - * @return The objectSize. - */ - @java.lang.Override - public long getObjectSize() { - return objectSize_; - } - - public static final int DONE_FIELD_NUMBER = 3; - private boolean done_; - /** - * - * - *
-   * `true` if the copy is finished; otherwise, `false` if
-   * the copy is in progress. This property is always present in the response.
-   * 
- * - * bool done = 3; - * - * @return The done. - */ - @java.lang.Override - public boolean getDone() { - return done_; - } - - public static final int REWRITE_TOKEN_FIELD_NUMBER = 4; - private volatile java.lang.Object rewriteToken_; - /** - * - * - *
-   * A token to use in subsequent requests to continue copying data. This token
-   * is present in the response only when there is more data to copy.
-   * 
- * - * string rewrite_token = 4; - * - * @return The rewriteToken. - */ - @java.lang.Override - public java.lang.String getRewriteToken() { - java.lang.Object ref = rewriteToken_; - 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(); - rewriteToken_ = s; - return s; - } - } - /** - * - * - *
-   * A token to use in subsequent requests to continue copying data. This token
-   * is present in the response only when there is more data to copy.
-   * 
- * - * string rewrite_token = 4; - * - * @return The bytes for rewriteToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString getRewriteTokenBytes() { - java.lang.Object ref = rewriteToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - rewriteToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RESOURCE_FIELD_NUMBER = 5; - private com.google.storage.v2.Object resource_; - /** - * - * - *
-   * A resource containing the metadata for the copied-to object. This property
-   * is present in the response only when copying completes.
-   * 
- * - * .google.storage.v2.Object resource = 5; - * - * @return Whether the resource field is set. - */ - @java.lang.Override - public boolean hasResource() { - return resource_ != null; - } - /** - * - * - *
-   * A resource containing the metadata for the copied-to object. This property
-   * is present in the response only when copying completes.
-   * 
- * - * .google.storage.v2.Object resource = 5; - * - * @return The resource. - */ - @java.lang.Override - public com.google.storage.v2.Object getResource() { - return resource_ == null ? com.google.storage.v2.Object.getDefaultInstance() : resource_; - } - /** - * - * - *
-   * A resource containing the metadata for the copied-to object. This property
-   * is present in the response only when copying completes.
-   * 
- * - * .google.storage.v2.Object resource = 5; - */ - @java.lang.Override - public com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder() { - return getResource(); - } - - 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 (totalBytesRewritten_ != 0L) { - output.writeInt64(1, totalBytesRewritten_); - } - if (objectSize_ != 0L) { - output.writeInt64(2, objectSize_); - } - if (done_ != false) { - output.writeBool(3, done_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rewriteToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, rewriteToken_); - } - if (resource_ != null) { - output.writeMessage(5, getResource()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (totalBytesRewritten_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, totalBytesRewritten_); - } - if (objectSize_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, objectSize_); - } - if (done_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, done_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rewriteToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, rewriteToken_); - } - if (resource_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getResource()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.RewriteResponse)) { - return super.equals(obj); - } - com.google.storage.v2.RewriteResponse other = (com.google.storage.v2.RewriteResponse) obj; - - if (getTotalBytesRewritten() != other.getTotalBytesRewritten()) return false; - if (getObjectSize() != other.getObjectSize()) return false; - if (getDone() != other.getDone()) return false; - if (!getRewriteToken().equals(other.getRewriteToken())) return false; - if (hasResource() != other.hasResource()) return false; - if (hasResource()) { - if (!getResource().equals(other.getResource())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + TOTAL_BYTES_REWRITTEN_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTotalBytesRewritten()); - hash = (37 * hash) + OBJECT_SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getObjectSize()); - hash = (37 * hash) + DONE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDone()); - hash = (37 * hash) + REWRITE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getRewriteToken().hashCode(); - if (hasResource()) { - hash = (37 * hash) + RESOURCE_FIELD_NUMBER; - hash = (53 * hash) + getResource().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.RewriteResponse parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.RewriteResponse 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.RewriteResponse parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.RewriteResponse 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.RewriteResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.RewriteResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.RewriteResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.RewriteResponse 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.RewriteResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.RewriteResponse 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.RewriteResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.RewriteResponse 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.RewriteResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * A rewrite response.
-   * 
- * - * Protobuf type {@code google.storage.v2.RewriteResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.RewriteResponse) - com.google.storage.v2.RewriteResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_RewriteResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_RewriteResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.RewriteResponse.class, - com.google.storage.v2.RewriteResponse.Builder.class); - } - - // Construct using com.google.storage.v2.RewriteResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - totalBytesRewritten_ = 0L; - - objectSize_ = 0L; - - done_ = false; - - rewriteToken_ = ""; - - if (resourceBuilder_ == null) { - resource_ = null; - } else { - resource_ = null; - resourceBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_RewriteResponse_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.RewriteResponse getDefaultInstanceForType() { - return com.google.storage.v2.RewriteResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.RewriteResponse build() { - com.google.storage.v2.RewriteResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.RewriteResponse buildPartial() { - com.google.storage.v2.RewriteResponse result = - new com.google.storage.v2.RewriteResponse(this); - result.totalBytesRewritten_ = totalBytesRewritten_; - result.objectSize_ = objectSize_; - result.done_ = done_; - result.rewriteToken_ = rewriteToken_; - if (resourceBuilder_ == null) { - result.resource_ = resource_; - } else { - result.resource_ = resourceBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.RewriteResponse) { - return mergeFrom((com.google.storage.v2.RewriteResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.RewriteResponse other) { - if (other == com.google.storage.v2.RewriteResponse.getDefaultInstance()) return this; - if (other.getTotalBytesRewritten() != 0L) { - setTotalBytesRewritten(other.getTotalBytesRewritten()); - } - if (other.getObjectSize() != 0L) { - setObjectSize(other.getObjectSize()); - } - if (other.getDone() != false) { - setDone(other.getDone()); - } - if (!other.getRewriteToken().isEmpty()) { - rewriteToken_ = other.rewriteToken_; - onChanged(); - } - if (other.hasResource()) { - mergeResource(other.getResource()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.RewriteResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.RewriteResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long totalBytesRewritten_; - /** - * - * - *
-     * The total bytes written so far, which can be used to provide a waiting user
-     * with a progress indicator. This property is always present in the response.
-     * 
- * - * int64 total_bytes_rewritten = 1; - * - * @return The totalBytesRewritten. - */ - @java.lang.Override - public long getTotalBytesRewritten() { - return totalBytesRewritten_; - } - /** - * - * - *
-     * The total bytes written so far, which can be used to provide a waiting user
-     * with a progress indicator. This property is always present in the response.
-     * 
- * - * int64 total_bytes_rewritten = 1; - * - * @param value The totalBytesRewritten to set. - * @return This builder for chaining. - */ - public Builder setTotalBytesRewritten(long value) { - - totalBytesRewritten_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The total bytes written so far, which can be used to provide a waiting user
-     * with a progress indicator. This property is always present in the response.
-     * 
- * - * int64 total_bytes_rewritten = 1; - * - * @return This builder for chaining. - */ - public Builder clearTotalBytesRewritten() { - - totalBytesRewritten_ = 0L; - onChanged(); - return this; - } - - private long objectSize_; - /** - * - * - *
-     * The total size of the object being copied in bytes. This property is always
-     * present in the response.
-     * 
- * - * int64 object_size = 2; - * - * @return The objectSize. - */ - @java.lang.Override - public long getObjectSize() { - return objectSize_; - } - /** - * - * - *
-     * The total size of the object being copied in bytes. This property is always
-     * present in the response.
-     * 
- * - * int64 object_size = 2; - * - * @param value The objectSize to set. - * @return This builder for chaining. - */ - public Builder setObjectSize(long value) { - - objectSize_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The total size of the object being copied in bytes. This property is always
-     * present in the response.
-     * 
- * - * int64 object_size = 2; - * - * @return This builder for chaining. - */ - public Builder clearObjectSize() { - - objectSize_ = 0L; - onChanged(); - return this; - } - - private boolean done_; - /** - * - * - *
-     * `true` if the copy is finished; otherwise, `false` if
-     * the copy is in progress. This property is always present in the response.
-     * 
- * - * bool done = 3; - * - * @return The done. - */ - @java.lang.Override - public boolean getDone() { - return done_; - } - /** - * - * - *
-     * `true` if the copy is finished; otherwise, `false` if
-     * the copy is in progress. This property is always present in the response.
-     * 
- * - * bool done = 3; - * - * @param value The done to set. - * @return This builder for chaining. - */ - public Builder setDone(boolean value) { - - done_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * `true` if the copy is finished; otherwise, `false` if
-     * the copy is in progress. This property is always present in the response.
-     * 
- * - * bool done = 3; - * - * @return This builder for chaining. - */ - public Builder clearDone() { - - done_ = false; - onChanged(); - return this; - } - - private java.lang.Object rewriteToken_ = ""; - /** - * - * - *
-     * A token to use in subsequent requests to continue copying data. This token
-     * is present in the response only when there is more data to copy.
-     * 
- * - * string rewrite_token = 4; - * - * @return The rewriteToken. - */ - public java.lang.String getRewriteToken() { - java.lang.Object ref = rewriteToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - rewriteToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * A token to use in subsequent requests to continue copying data. This token
-     * is present in the response only when there is more data to copy.
-     * 
- * - * string rewrite_token = 4; - * - * @return The bytes for rewriteToken. - */ - public com.google.protobuf.ByteString getRewriteTokenBytes() { - java.lang.Object ref = rewriteToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - rewriteToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * A token to use in subsequent requests to continue copying data. This token
-     * is present in the response only when there is more data to copy.
-     * 
- * - * string rewrite_token = 4; - * - * @param value The rewriteToken to set. - * @return This builder for chaining. - */ - public Builder setRewriteToken(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - rewriteToken_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * A token to use in subsequent requests to continue copying data. This token
-     * is present in the response only when there is more data to copy.
-     * 
- * - * string rewrite_token = 4; - * - * @return This builder for chaining. - */ - public Builder clearRewriteToken() { - - rewriteToken_ = getDefaultInstance().getRewriteToken(); - onChanged(); - return this; - } - /** - * - * - *
-     * A token to use in subsequent requests to continue copying data. This token
-     * is present in the response only when there is more data to copy.
-     * 
- * - * string rewrite_token = 4; - * - * @param value The bytes for rewriteToken to set. - * @return This builder for chaining. - */ - public Builder setRewriteTokenBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - rewriteToken_ = value; - onChanged(); - return this; - } - - private com.google.storage.v2.Object resource_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder> - resourceBuilder_; - /** - * - * - *
-     * A resource containing the metadata for the copied-to object. This property
-     * is present in the response only when copying completes.
-     * 
- * - * .google.storage.v2.Object resource = 5; - * - * @return Whether the resource field is set. - */ - public boolean hasResource() { - return resourceBuilder_ != null || resource_ != null; - } - /** - * - * - *
-     * A resource containing the metadata for the copied-to object. This property
-     * is present in the response only when copying completes.
-     * 
- * - * .google.storage.v2.Object resource = 5; - * - * @return The resource. - */ - public com.google.storage.v2.Object getResource() { - if (resourceBuilder_ == null) { - return resource_ == null ? com.google.storage.v2.Object.getDefaultInstance() : resource_; - } else { - return resourceBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A resource containing the metadata for the copied-to object. This property
-     * is present in the response only when copying completes.
-     * 
- * - * .google.storage.v2.Object resource = 5; - */ - public Builder setResource(com.google.storage.v2.Object value) { - if (resourceBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - resource_ = value; - onChanged(); - } else { - resourceBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A resource containing the metadata for the copied-to object. This property
-     * is present in the response only when copying completes.
-     * 
- * - * .google.storage.v2.Object resource = 5; - */ - public Builder setResource(com.google.storage.v2.Object.Builder builderForValue) { - if (resourceBuilder_ == null) { - resource_ = builderForValue.build(); - onChanged(); - } else { - resourceBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A resource containing the metadata for the copied-to object. This property
-     * is present in the response only when copying completes.
-     * 
- * - * .google.storage.v2.Object resource = 5; - */ - public Builder mergeResource(com.google.storage.v2.Object value) { - if (resourceBuilder_ == null) { - if (resource_ != null) { - resource_ = - com.google.storage.v2.Object.newBuilder(resource_).mergeFrom(value).buildPartial(); - } else { - resource_ = value; - } - onChanged(); - } else { - resourceBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A resource containing the metadata for the copied-to object. This property
-     * is present in the response only when copying completes.
-     * 
- * - * .google.storage.v2.Object resource = 5; - */ - public Builder clearResource() { - if (resourceBuilder_ == null) { - resource_ = null; - onChanged(); - } else { - resource_ = null; - resourceBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A resource containing the metadata for the copied-to object. This property
-     * is present in the response only when copying completes.
-     * 
- * - * .google.storage.v2.Object resource = 5; - */ - public com.google.storage.v2.Object.Builder getResourceBuilder() { - - onChanged(); - return getResourceFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A resource containing the metadata for the copied-to object. This property
-     * is present in the response only when copying completes.
-     * 
- * - * .google.storage.v2.Object resource = 5; - */ - public com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder() { - if (resourceBuilder_ != null) { - return resourceBuilder_.getMessageOrBuilder(); - } else { - return resource_ == null ? com.google.storage.v2.Object.getDefaultInstance() : resource_; - } - } - /** - * - * - *
-     * A resource containing the metadata for the copied-to object. This property
-     * is present in the response only when copying completes.
-     * 
- * - * .google.storage.v2.Object resource = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder> - getResourceFieldBuilder() { - if (resourceBuilder_ == null) { - resourceBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder>( - getResource(), getParentForChildren(), isClean()); - resource_ = null; - } - return resourceBuilder_; - } - - @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.RewriteResponse) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.RewriteResponse) - private static final com.google.storage.v2.RewriteResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.RewriteResponse(); - } - - public static com.google.storage.v2.RewriteResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RewriteResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RewriteResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.RewriteResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/RewriteResponseOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/RewriteResponseOrBuilder.java deleted file mode 100644 index 3e38750e35..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/RewriteResponseOrBuilder.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface RewriteResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.RewriteResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The total bytes written so far, which can be used to provide a waiting user
-   * with a progress indicator. This property is always present in the response.
-   * 
- * - * int64 total_bytes_rewritten = 1; - * - * @return The totalBytesRewritten. - */ - long getTotalBytesRewritten(); - - /** - * - * - *
-   * The total size of the object being copied in bytes. This property is always
-   * present in the response.
-   * 
- * - * int64 object_size = 2; - * - * @return The objectSize. - */ - long getObjectSize(); - - /** - * - * - *
-   * `true` if the copy is finished; otherwise, `false` if
-   * the copy is in progress. This property is always present in the response.
-   * 
- * - * bool done = 3; - * - * @return The done. - */ - boolean getDone(); - - /** - * - * - *
-   * A token to use in subsequent requests to continue copying data. This token
-   * is present in the response only when there is more data to copy.
-   * 
- * - * string rewrite_token = 4; - * - * @return The rewriteToken. - */ - java.lang.String getRewriteToken(); - /** - * - * - *
-   * A token to use in subsequent requests to continue copying data. This token
-   * is present in the response only when there is more data to copy.
-   * 
- * - * string rewrite_token = 4; - * - * @return The bytes for rewriteToken. - */ - com.google.protobuf.ByteString getRewriteTokenBytes(); - - /** - * - * - *
-   * A resource containing the metadata for the copied-to object. This property
-   * is present in the response only when copying completes.
-   * 
- * - * .google.storage.v2.Object resource = 5; - * - * @return Whether the resource field is set. - */ - boolean hasResource(); - /** - * - * - *
-   * A resource containing the metadata for the copied-to object. This property
-   * is present in the response only when copying completes.
-   * 
- * - * .google.storage.v2.Object resource = 5; - * - * @return The resource. - */ - com.google.storage.v2.Object getResource(); - /** - * - * - *
-   * A resource containing the metadata for the copied-to object. This property
-   * is present in the response only when copying completes.
-   * 
- * - * .google.storage.v2.Object resource = 5; - */ - com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceAccount.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceAccount.java deleted file mode 100644 index 34d0d2a04a..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceAccount.java +++ /dev/null @@ -1,635 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * A service account, owned by Cloud Storage, which may be used when taking
- * action on behalf of a given project, for example to publish Pub/Sub
- * notifications or to retrieve security keys.
- * 
- * - * Protobuf type {@code google.storage.v2.ServiceAccount} - */ -public final class ServiceAccount extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.ServiceAccount) - ServiceAccountOrBuilder { - private static final long serialVersionUID = 0L; - // Use ServiceAccount.newBuilder() to construct. - private ServiceAccount(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ServiceAccount() { - emailAddress_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ServiceAccount(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ServiceAccount( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - emailAddress_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ServiceAccount_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ServiceAccount_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ServiceAccount.class, - com.google.storage.v2.ServiceAccount.Builder.class); - } - - public static final int EMAIL_ADDRESS_FIELD_NUMBER = 1; - private volatile java.lang.Object emailAddress_; - /** - * - * - *
-   * The ID of the notification.
-   * 
- * - * string email_address = 1; - * - * @return The emailAddress. - */ - @java.lang.Override - public java.lang.String getEmailAddress() { - java.lang.Object ref = emailAddress_; - 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(); - emailAddress_ = s; - return s; - } - } - /** - * - * - *
-   * The ID of the notification.
-   * 
- * - * string email_address = 1; - * - * @return The bytes for emailAddress. - */ - @java.lang.Override - public com.google.protobuf.ByteString getEmailAddressBytes() { - java.lang.Object ref = emailAddress_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - emailAddress_ = 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(emailAddress_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, emailAddress_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(emailAddress_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, emailAddress_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.ServiceAccount)) { - return super.equals(obj); - } - com.google.storage.v2.ServiceAccount other = (com.google.storage.v2.ServiceAccount) obj; - - if (!getEmailAddress().equals(other.getEmailAddress())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + EMAIL_ADDRESS_FIELD_NUMBER; - hash = (53 * hash) + getEmailAddress().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.ServiceAccount parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ServiceAccount 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.ServiceAccount parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ServiceAccount 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.ServiceAccount parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ServiceAccount parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ServiceAccount parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ServiceAccount 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.ServiceAccount parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ServiceAccount 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.ServiceAccount parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ServiceAccount 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.ServiceAccount prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * A service account, owned by Cloud Storage, which may be used when taking
-   * action on behalf of a given project, for example to publish Pub/Sub
-   * notifications or to retrieve security keys.
-   * 
- * - * Protobuf type {@code google.storage.v2.ServiceAccount} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.ServiceAccount) - com.google.storage.v2.ServiceAccountOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ServiceAccount_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ServiceAccount_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ServiceAccount.class, - com.google.storage.v2.ServiceAccount.Builder.class); - } - - // Construct using com.google.storage.v2.ServiceAccount.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - emailAddress_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ServiceAccount_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.ServiceAccount getDefaultInstanceForType() { - return com.google.storage.v2.ServiceAccount.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.ServiceAccount build() { - com.google.storage.v2.ServiceAccount result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.ServiceAccount buildPartial() { - com.google.storage.v2.ServiceAccount result = new com.google.storage.v2.ServiceAccount(this); - result.emailAddress_ = emailAddress_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.ServiceAccount) { - return mergeFrom((com.google.storage.v2.ServiceAccount) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.ServiceAccount other) { - if (other == com.google.storage.v2.ServiceAccount.getDefaultInstance()) return this; - if (!other.getEmailAddress().isEmpty()) { - emailAddress_ = other.emailAddress_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.ServiceAccount parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.ServiceAccount) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object emailAddress_ = ""; - /** - * - * - *
-     * The ID of the notification.
-     * 
- * - * string email_address = 1; - * - * @return The emailAddress. - */ - public java.lang.String getEmailAddress() { - java.lang.Object ref = emailAddress_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - emailAddress_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The ID of the notification.
-     * 
- * - * string email_address = 1; - * - * @return The bytes for emailAddress. - */ - public com.google.protobuf.ByteString getEmailAddressBytes() { - java.lang.Object ref = emailAddress_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - emailAddress_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The ID of the notification.
-     * 
- * - * string email_address = 1; - * - * @param value The emailAddress to set. - * @return This builder for chaining. - */ - public Builder setEmailAddress(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - emailAddress_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The ID of the notification.
-     * 
- * - * string email_address = 1; - * - * @return This builder for chaining. - */ - public Builder clearEmailAddress() { - - emailAddress_ = getDefaultInstance().getEmailAddress(); - onChanged(); - return this; - } - /** - * - * - *
-     * The ID of the notification.
-     * 
- * - * string email_address = 1; - * - * @param value The bytes for emailAddress to set. - * @return This builder for chaining. - */ - public Builder setEmailAddressBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - emailAddress_ = value; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.ServiceAccount) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.ServiceAccount) - private static final com.google.storage.v2.ServiceAccount DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.ServiceAccount(); - } - - public static com.google.storage.v2.ServiceAccount getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ServiceAccount parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ServiceAccount(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.ServiceAccount getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceAccountOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceAccountOrBuilder.java deleted file mode 100644 index d6637ee207..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceAccountOrBuilder.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface ServiceAccountOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.ServiceAccount) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The ID of the notification.
-   * 
- * - * string email_address = 1; - * - * @return The emailAddress. - */ - java.lang.String getEmailAddress(); - /** - * - * - *
-   * The ID of the notification.
-   * 
- * - * string email_address = 1; - * - * @return The bytes for emailAddress. - */ - com.google.protobuf.ByteString getEmailAddressBytes(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceConstants.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceConstants.java deleted file mode 100644 index 90b6e08e55..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceConstants.java +++ /dev/null @@ -1,1002 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Shared constants.
- * 
- * - * Protobuf type {@code google.storage.v2.ServiceConstants} - */ -public final class ServiceConstants extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.ServiceConstants) - ServiceConstantsOrBuilder { - private static final long serialVersionUID = 0L; - // Use ServiceConstants.newBuilder() to construct. - private ServiceConstants(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ServiceConstants() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ServiceConstants(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ServiceConstants( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ServiceConstants_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ServiceConstants_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ServiceConstants.class, - com.google.storage.v2.ServiceConstants.Builder.class); - } - - /** - * - * - *
-   * A collection of constant values meaningful to the Storage API.
-   * 
- * - * Protobuf enum {@code google.storage.v2.ServiceConstants.Values} - */ - public enum Values implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-     * Unused. Proto3 requires first enum to be 0.
-     * 
- * - * VALUES_UNSPECIFIED = 0; - */ - VALUES_UNSPECIFIED(0, 0), - /** - * - * - *
-     * The maximum size chunk that can will be returned in a single
-     * ReadRequest.
-     * 2 MiB.
-     * 
- * - * MAX_READ_CHUNK_BYTES = 2097152; - */ - MAX_READ_CHUNK_BYTES(1, 2097152), - /** - * - * - *
-     * The maximum size of an object in MB - whether written in a single stream
-     * or composed from multiple other objects.
-     * 5 TiB.
-     * 
- * - * MAX_OBJECT_SIZE_MB = 5242880; - */ - MAX_OBJECT_SIZE_MB(3, 5242880), - /** - * - * - *
-     * The maximum length field name that can be sent in a single
-     * custom metadata field.
-     * 1 KiB.
-     * 
- * - * MAX_CUSTOM_METADATA_FIELD_NAME_BYTES = 1024; - */ - MAX_CUSTOM_METADATA_FIELD_NAME_BYTES(4, 1024), - /** - * - * - *
-     * The maximum length field value that can be sent in a single
-     * custom_metadata field.
-     * 4 KiB.
-     * 
- * - * MAX_CUSTOM_METADATA_FIELD_VALUE_BYTES = 4096; - */ - MAX_CUSTOM_METADATA_FIELD_VALUE_BYTES(5, 4096), - /** - * - * - *
-     * The maximum total bytes that can be populated into all field names and
-     * values of the custom_metadata for one object.
-     * 8 KiB.
-     * 
- * - * MAX_CUSTOM_METADATA_TOTAL_SIZE_BYTES = 8192; - */ - MAX_CUSTOM_METADATA_TOTAL_SIZE_BYTES(6, 8192), - /** - * - * - *
-     * The maximum total bytes that can be populated into all bucket metadata
-     * fields.
-     * 20 KiB.
-     * 
- * - * MAX_BUCKET_METADATA_TOTAL_SIZE_BYTES = 20480; - */ - MAX_BUCKET_METADATA_TOTAL_SIZE_BYTES(7, 20480), - /** - * - * - *
-     * The maximum number of NotificationConfigs that can be registered
-     * for a given bucket.
-     * 
- * - * MAX_NOTIFICATION_CONFIGS_PER_BUCKET = 100; - */ - MAX_NOTIFICATION_CONFIGS_PER_BUCKET(8, 100), - /** - * - * - *
-     * The maximum number of custom attributes per NotificationConfigs.
-     * 
- * - * MAX_NOTIFICATION_CUSTOM_ATTRIBUTES = 5; - */ - MAX_NOTIFICATION_CUSTOM_ATTRIBUTES(10, 5), - /** - * - * - *
-     * The maximum length of a custom attribute key included in
-     * NotificationConfig.
-     * 
- * - * MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_KEY_LENGTH = 256; - */ - MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_KEY_LENGTH(11, 256), - /** - * - * - *
-     * The maximum number of key/value entries per bucket label.
-     * 
- * - * MAX_LABELS_ENTRIES_COUNT = 64; - */ - MAX_LABELS_ENTRIES_COUNT(13, 64), - /** - * - * - *
-     * The maximum character length of the key or value in a bucket
-     * label map.
-     * 
- * - * MAX_LABELS_KEY_VALUE_LENGTH = 63; - */ - MAX_LABELS_KEY_VALUE_LENGTH(14, 63), - /** - * - * - *
-     * The maximum byte size of the key or value in a bucket label
-     * map.
-     * 
- * - * MAX_LABELS_KEY_VALUE_BYTES = 128; - */ - MAX_LABELS_KEY_VALUE_BYTES(15, 128), - /** - * - * - *
-     * The maximum number of object IDs that can be included in a
-     * DeleteObjectsRequest.
-     * 
- * - * MAX_OBJECT_IDS_PER_DELETE_OBJECTS_REQUEST = 1000; - */ - MAX_OBJECT_IDS_PER_DELETE_OBJECTS_REQUEST(16, 1000), - /** - * - * - *
-     * The maximum number of days for which a token returned by the
-     * GetListObjectsSplitPoints RPC is valid.
-     * 
- * - * SPLIT_TOKEN_MAX_VALID_DAYS = 14; - */ - SPLIT_TOKEN_MAX_VALID_DAYS(17, 14), - UNRECOGNIZED(-1, -1), - ; - - /** - * - * - *
-     * The maximum size chunk that can be sent in a single WriteObjectRequest.
-     * 2 MiB.
-     * 
- * - * MAX_WRITE_CHUNK_BYTES = 2097152; - */ - public static final Values MAX_WRITE_CHUNK_BYTES = MAX_READ_CHUNK_BYTES; - /** - * - * - *
-     * The maximum number of LifecycleRules that can be registered for a given
-     * bucket.
-     * 
- * - * MAX_LIFECYCLE_RULES_PER_BUCKET = 100; - */ - public static final Values MAX_LIFECYCLE_RULES_PER_BUCKET = MAX_NOTIFICATION_CONFIGS_PER_BUCKET; - /** - * - * - *
-     * The maximum length of a custom attribute value included in a
-     * NotificationConfig.
-     * 
- * - * MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_VALUE_LENGTH = 1024; - */ - public static final Values MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_VALUE_LENGTH = - MAX_CUSTOM_METADATA_FIELD_NAME_BYTES; - /** - * - * - *
-     * Unused. Proto3 requires first enum to be 0.
-     * 
- * - * VALUES_UNSPECIFIED = 0; - */ - public static final int VALUES_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-     * The maximum size chunk that can will be returned in a single
-     * ReadRequest.
-     * 2 MiB.
-     * 
- * - * MAX_READ_CHUNK_BYTES = 2097152; - */ - public static final int MAX_READ_CHUNK_BYTES_VALUE = 2097152; - /** - * - * - *
-     * The maximum size chunk that can be sent in a single WriteObjectRequest.
-     * 2 MiB.
-     * 
- * - * MAX_WRITE_CHUNK_BYTES = 2097152; - */ - public static final int MAX_WRITE_CHUNK_BYTES_VALUE = 2097152; - /** - * - * - *
-     * The maximum size of an object in MB - whether written in a single stream
-     * or composed from multiple other objects.
-     * 5 TiB.
-     * 
- * - * MAX_OBJECT_SIZE_MB = 5242880; - */ - public static final int MAX_OBJECT_SIZE_MB_VALUE = 5242880; - /** - * - * - *
-     * The maximum length field name that can be sent in a single
-     * custom metadata field.
-     * 1 KiB.
-     * 
- * - * MAX_CUSTOM_METADATA_FIELD_NAME_BYTES = 1024; - */ - public static final int MAX_CUSTOM_METADATA_FIELD_NAME_BYTES_VALUE = 1024; - /** - * - * - *
-     * The maximum length field value that can be sent in a single
-     * custom_metadata field.
-     * 4 KiB.
-     * 
- * - * MAX_CUSTOM_METADATA_FIELD_VALUE_BYTES = 4096; - */ - public static final int MAX_CUSTOM_METADATA_FIELD_VALUE_BYTES_VALUE = 4096; - /** - * - * - *
-     * The maximum total bytes that can be populated into all field names and
-     * values of the custom_metadata for one object.
-     * 8 KiB.
-     * 
- * - * MAX_CUSTOM_METADATA_TOTAL_SIZE_BYTES = 8192; - */ - public static final int MAX_CUSTOM_METADATA_TOTAL_SIZE_BYTES_VALUE = 8192; - /** - * - * - *
-     * The maximum total bytes that can be populated into all bucket metadata
-     * fields.
-     * 20 KiB.
-     * 
- * - * MAX_BUCKET_METADATA_TOTAL_SIZE_BYTES = 20480; - */ - public static final int MAX_BUCKET_METADATA_TOTAL_SIZE_BYTES_VALUE = 20480; - /** - * - * - *
-     * The maximum number of NotificationConfigs that can be registered
-     * for a given bucket.
-     * 
- * - * MAX_NOTIFICATION_CONFIGS_PER_BUCKET = 100; - */ - public static final int MAX_NOTIFICATION_CONFIGS_PER_BUCKET_VALUE = 100; - /** - * - * - *
-     * The maximum number of LifecycleRules that can be registered for a given
-     * bucket.
-     * 
- * - * MAX_LIFECYCLE_RULES_PER_BUCKET = 100; - */ - public static final int MAX_LIFECYCLE_RULES_PER_BUCKET_VALUE = 100; - /** - * - * - *
-     * The maximum number of custom attributes per NotificationConfigs.
-     * 
- * - * MAX_NOTIFICATION_CUSTOM_ATTRIBUTES = 5; - */ - public static final int MAX_NOTIFICATION_CUSTOM_ATTRIBUTES_VALUE = 5; - /** - * - * - *
-     * The maximum length of a custom attribute key included in
-     * NotificationConfig.
-     * 
- * - * MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_KEY_LENGTH = 256; - */ - public static final int MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_KEY_LENGTH_VALUE = 256; - /** - * - * - *
-     * The maximum length of a custom attribute value included in a
-     * NotificationConfig.
-     * 
- * - * MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_VALUE_LENGTH = 1024; - */ - public static final int MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_VALUE_LENGTH_VALUE = 1024; - /** - * - * - *
-     * The maximum number of key/value entries per bucket label.
-     * 
- * - * MAX_LABELS_ENTRIES_COUNT = 64; - */ - public static final int MAX_LABELS_ENTRIES_COUNT_VALUE = 64; - /** - * - * - *
-     * The maximum character length of the key or value in a bucket
-     * label map.
-     * 
- * - * MAX_LABELS_KEY_VALUE_LENGTH = 63; - */ - public static final int MAX_LABELS_KEY_VALUE_LENGTH_VALUE = 63; - /** - * - * - *
-     * The maximum byte size of the key or value in a bucket label
-     * map.
-     * 
- * - * MAX_LABELS_KEY_VALUE_BYTES = 128; - */ - public static final int MAX_LABELS_KEY_VALUE_BYTES_VALUE = 128; - /** - * - * - *
-     * The maximum number of object IDs that can be included in a
-     * DeleteObjectsRequest.
-     * 
- * - * MAX_OBJECT_IDS_PER_DELETE_OBJECTS_REQUEST = 1000; - */ - public static final int MAX_OBJECT_IDS_PER_DELETE_OBJECTS_REQUEST_VALUE = 1000; - /** - * - * - *
-     * The maximum number of days for which a token returned by the
-     * GetListObjectsSplitPoints RPC is valid.
-     * 
- * - * SPLIT_TOKEN_MAX_VALID_DAYS = 14; - */ - public static final int SPLIT_TOKEN_MAX_VALID_DAYS_VALUE = 14; - - public final int getNumber() { - if (index == -1) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static Values valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static Values forNumber(int value) { - switch (value) { - case 0: - return VALUES_UNSPECIFIED; - case 2097152: - return MAX_READ_CHUNK_BYTES; - case 5242880: - return MAX_OBJECT_SIZE_MB; - case 1024: - return MAX_CUSTOM_METADATA_FIELD_NAME_BYTES; - case 4096: - return MAX_CUSTOM_METADATA_FIELD_VALUE_BYTES; - case 8192: - return MAX_CUSTOM_METADATA_TOTAL_SIZE_BYTES; - case 20480: - return MAX_BUCKET_METADATA_TOTAL_SIZE_BYTES; - case 100: - return MAX_NOTIFICATION_CONFIGS_PER_BUCKET; - case 5: - return MAX_NOTIFICATION_CUSTOM_ATTRIBUTES; - case 256: - return MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_KEY_LENGTH; - case 64: - return MAX_LABELS_ENTRIES_COUNT; - case 63: - return MAX_LABELS_KEY_VALUE_LENGTH; - case 128: - return MAX_LABELS_KEY_VALUE_BYTES; - case 1000: - return MAX_OBJECT_IDS_PER_DELETE_OBJECTS_REQUEST; - case 14: - return SPLIT_TOKEN_MAX_VALID_DAYS; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Values findValueByNumber(int number) { - return Values.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - if (index == -1) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(index); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.storage.v2.ServiceConstants.getDescriptor().getEnumTypes().get(0); - } - - private static final Values[] VALUES = getStaticValuesArray(); - - private static Values[] getStaticValuesArray() { - return new Values[] { - VALUES_UNSPECIFIED, - MAX_READ_CHUNK_BYTES, - MAX_WRITE_CHUNK_BYTES, - MAX_OBJECT_SIZE_MB, - MAX_CUSTOM_METADATA_FIELD_NAME_BYTES, - MAX_CUSTOM_METADATA_FIELD_VALUE_BYTES, - MAX_CUSTOM_METADATA_TOTAL_SIZE_BYTES, - MAX_BUCKET_METADATA_TOTAL_SIZE_BYTES, - MAX_NOTIFICATION_CONFIGS_PER_BUCKET, - MAX_LIFECYCLE_RULES_PER_BUCKET, - MAX_NOTIFICATION_CUSTOM_ATTRIBUTES, - MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_KEY_LENGTH, - MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_VALUE_LENGTH, - MAX_LABELS_ENTRIES_COUNT, - MAX_LABELS_KEY_VALUE_LENGTH, - MAX_LABELS_KEY_VALUE_BYTES, - MAX_OBJECT_IDS_PER_DELETE_OBJECTS_REQUEST, - SPLIT_TOKEN_MAX_VALID_DAYS, - }; - } - - public static Values valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int index; - private final int value; - - private Values(int index, int value) { - this.index = index; - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.storage.v2.ServiceConstants.Values) - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.ServiceConstants)) { - return super.equals(obj); - } - com.google.storage.v2.ServiceConstants other = (com.google.storage.v2.ServiceConstants) obj; - - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.ServiceConstants parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ServiceConstants parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ServiceConstants parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ServiceConstants parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ServiceConstants parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.ServiceConstants parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.ServiceConstants parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ServiceConstants parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.ServiceConstants parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ServiceConstants parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.ServiceConstants parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.ServiceConstants parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.ServiceConstants prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Shared constants.
-   * 
- * - * Protobuf type {@code google.storage.v2.ServiceConstants} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.ServiceConstants) - com.google.storage.v2.ServiceConstantsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ServiceConstants_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ServiceConstants_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.ServiceConstants.class, - com.google.storage.v2.ServiceConstants.Builder.class); - } - - // Construct using com.google.storage.v2.ServiceConstants.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ServiceConstants_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.ServiceConstants getDefaultInstanceForType() { - return com.google.storage.v2.ServiceConstants.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.ServiceConstants build() { - com.google.storage.v2.ServiceConstants result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.ServiceConstants buildPartial() { - com.google.storage.v2.ServiceConstants result = - new com.google.storage.v2.ServiceConstants(this); - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.ServiceConstants) { - return mergeFrom((com.google.storage.v2.ServiceConstants) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.ServiceConstants other) { - if (other == com.google.storage.v2.ServiceConstants.getDefaultInstance()) return this; - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.ServiceConstants parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.ServiceConstants) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.ServiceConstants) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.ServiceConstants) - private static final com.google.storage.v2.ServiceConstants DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.ServiceConstants(); - } - - public static com.google.storage.v2.ServiceConstants getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ServiceConstants parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ServiceConstants(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.ServiceConstants getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceConstantsOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceConstantsOrBuilder.java deleted file mode 100644 index 9722940ed4..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceConstantsOrBuilder.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface ServiceConstantsOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.ServiceConstants) - com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequest.java deleted file mode 100644 index 62b80bbf6c..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequest.java +++ /dev/null @@ -1,1297 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request message StartResumableWrite.
- * 
- * - * Protobuf type {@code google.storage.v2.StartResumableWriteRequest} - */ -public final class StartResumableWriteRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.StartResumableWriteRequest) - StartResumableWriteRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use StartResumableWriteRequest.newBuilder() to construct. - private StartResumableWriteRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private StartResumableWriteRequest() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new StartResumableWriteRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private StartResumableWriteRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.storage.v2.WriteObjectSpec.Builder subBuilder = null; - if (writeObjectSpec_ != null) { - subBuilder = writeObjectSpec_.toBuilder(); - } - writeObjectSpec_ = - input.readMessage( - com.google.storage.v2.WriteObjectSpec.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(writeObjectSpec_); - writeObjectSpec_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - com.google.storage.v2.CommonObjectRequestParams.Builder subBuilder = null; - if (commonObjectRequestParams_ != null) { - subBuilder = commonObjectRequestParams_.toBuilder(); - } - commonObjectRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonObjectRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonObjectRequestParams_); - commonObjectRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - case 34: - { - com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; - if (commonRequestParams_ != null) { - subBuilder = commonRequestParams_.toBuilder(); - } - commonRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonRequestParams_); - commonRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_StartResumableWriteRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_StartResumableWriteRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.StartResumableWriteRequest.class, - com.google.storage.v2.StartResumableWriteRequest.Builder.class); - } - - public static final int WRITE_OBJECT_SPEC_FIELD_NUMBER = 1; - private com.google.storage.v2.WriteObjectSpec writeObjectSpec_; - /** - * - * - *
-   * The destination bucket, object, and metadata, as well as any preconditions.
-   * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 1; - * - * @return Whether the writeObjectSpec field is set. - */ - @java.lang.Override - public boolean hasWriteObjectSpec() { - return writeObjectSpec_ != null; - } - /** - * - * - *
-   * The destination bucket, object, and metadata, as well as any preconditions.
-   * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 1; - * - * @return The writeObjectSpec. - */ - @java.lang.Override - public com.google.storage.v2.WriteObjectSpec getWriteObjectSpec() { - return writeObjectSpec_ == null - ? com.google.storage.v2.WriteObjectSpec.getDefaultInstance() - : writeObjectSpec_; - } - /** - * - * - *
-   * The destination bucket, object, and metadata, as well as any preconditions.
-   * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 1; - */ - @java.lang.Override - public com.google.storage.v2.WriteObjectSpecOrBuilder getWriteObjectSpecOrBuilder() { - return getWriteObjectSpec(); - } - - public static final int COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER = 3; - private com.google.storage.v2.CommonObjectRequestParams commonObjectRequestParams_; - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; - * - * @return Whether the commonObjectRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonObjectRequestParams() { - return commonObjectRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; - * - * @return The commonObjectRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { - return commonObjectRequestParams_ == null - ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() - : commonObjectRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; - */ - @java.lang.Override - public com.google.storage.v2.CommonObjectRequestParamsOrBuilder - getCommonObjectRequestParamsOrBuilder() { - return getCommonObjectRequestParams(); - } - - public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 4; - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - * - * @return Whether the commonRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonRequestParams() { - return commonRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - * - * @return The commonRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - return getCommonRequestParams(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (writeObjectSpec_ != null) { - output.writeMessage(1, getWriteObjectSpec()); - } - if (commonObjectRequestParams_ != null) { - output.writeMessage(3, getCommonObjectRequestParams()); - } - if (commonRequestParams_ != null) { - output.writeMessage(4, getCommonRequestParams()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (writeObjectSpec_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getWriteObjectSpec()); - } - if (commonObjectRequestParams_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 3, getCommonObjectRequestParams()); - } - if (commonRequestParams_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCommonRequestParams()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.StartResumableWriteRequest)) { - return super.equals(obj); - } - com.google.storage.v2.StartResumableWriteRequest other = - (com.google.storage.v2.StartResumableWriteRequest) obj; - - if (hasWriteObjectSpec() != other.hasWriteObjectSpec()) return false; - if (hasWriteObjectSpec()) { - if (!getWriteObjectSpec().equals(other.getWriteObjectSpec())) return false; - } - if (hasCommonObjectRequestParams() != other.hasCommonObjectRequestParams()) return false; - if (hasCommonObjectRequestParams()) { - if (!getCommonObjectRequestParams().equals(other.getCommonObjectRequestParams())) - return false; - } - if (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; - if (hasCommonRequestParams()) { - if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasWriteObjectSpec()) { - hash = (37 * hash) + WRITE_OBJECT_SPEC_FIELD_NUMBER; - hash = (53 * hash) + getWriteObjectSpec().hashCode(); - } - if (hasCommonObjectRequestParams()) { - hash = (37 * hash) + COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonObjectRequestParams().hashCode(); - } - if (hasCommonRequestParams()) { - hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonRequestParams().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.StartResumableWriteRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.StartResumableWriteRequest parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.StartResumableWriteRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.StartResumableWriteRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.StartResumableWriteRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.StartResumableWriteRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.StartResumableWriteRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.StartResumableWriteRequest parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.StartResumableWriteRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.StartResumableWriteRequest parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.StartResumableWriteRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.StartResumableWriteRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.StartResumableWriteRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Request message StartResumableWrite.
-   * 
- * - * Protobuf type {@code google.storage.v2.StartResumableWriteRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.StartResumableWriteRequest) - com.google.storage.v2.StartResumableWriteRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_StartResumableWriteRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_StartResumableWriteRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.StartResumableWriteRequest.class, - com.google.storage.v2.StartResumableWriteRequest.Builder.class); - } - - // Construct using com.google.storage.v2.StartResumableWriteRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (writeObjectSpecBuilder_ == null) { - writeObjectSpec_ = null; - } else { - writeObjectSpec_ = null; - writeObjectSpecBuilder_ = null; - } - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = null; - } else { - commonObjectRequestParams_ = null; - commonObjectRequestParamsBuilder_ = null; - } - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_StartResumableWriteRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.StartResumableWriteRequest getDefaultInstanceForType() { - return com.google.storage.v2.StartResumableWriteRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.StartResumableWriteRequest build() { - com.google.storage.v2.StartResumableWriteRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.StartResumableWriteRequest buildPartial() { - com.google.storage.v2.StartResumableWriteRequest result = - new com.google.storage.v2.StartResumableWriteRequest(this); - if (writeObjectSpecBuilder_ == null) { - result.writeObjectSpec_ = writeObjectSpec_; - } else { - result.writeObjectSpec_ = writeObjectSpecBuilder_.build(); - } - if (commonObjectRequestParamsBuilder_ == null) { - result.commonObjectRequestParams_ = commonObjectRequestParams_; - } else { - result.commonObjectRequestParams_ = commonObjectRequestParamsBuilder_.build(); - } - if (commonRequestParamsBuilder_ == null) { - result.commonRequestParams_ = commonRequestParams_; - } else { - result.commonRequestParams_ = commonRequestParamsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.StartResumableWriteRequest) { - return mergeFrom((com.google.storage.v2.StartResumableWriteRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.StartResumableWriteRequest other) { - if (other == com.google.storage.v2.StartResumableWriteRequest.getDefaultInstance()) - return this; - if (other.hasWriteObjectSpec()) { - mergeWriteObjectSpec(other.getWriteObjectSpec()); - } - if (other.hasCommonObjectRequestParams()) { - mergeCommonObjectRequestParams(other.getCommonObjectRequestParams()); - } - if (other.hasCommonRequestParams()) { - mergeCommonRequestParams(other.getCommonRequestParams()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.StartResumableWriteRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.StartResumableWriteRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.storage.v2.WriteObjectSpec writeObjectSpec_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.WriteObjectSpec, - com.google.storage.v2.WriteObjectSpec.Builder, - com.google.storage.v2.WriteObjectSpecOrBuilder> - writeObjectSpecBuilder_; - /** - * - * - *
-     * The destination bucket, object, and metadata, as well as any preconditions.
-     * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 1; - * - * @return Whether the writeObjectSpec field is set. - */ - public boolean hasWriteObjectSpec() { - return writeObjectSpecBuilder_ != null || writeObjectSpec_ != null; - } - /** - * - * - *
-     * The destination bucket, object, and metadata, as well as any preconditions.
-     * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 1; - * - * @return The writeObjectSpec. - */ - public com.google.storage.v2.WriteObjectSpec getWriteObjectSpec() { - if (writeObjectSpecBuilder_ == null) { - return writeObjectSpec_ == null - ? com.google.storage.v2.WriteObjectSpec.getDefaultInstance() - : writeObjectSpec_; - } else { - return writeObjectSpecBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The destination bucket, object, and metadata, as well as any preconditions.
-     * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 1; - */ - public Builder setWriteObjectSpec(com.google.storage.v2.WriteObjectSpec value) { - if (writeObjectSpecBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - writeObjectSpec_ = value; - onChanged(); - } else { - writeObjectSpecBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * The destination bucket, object, and metadata, as well as any preconditions.
-     * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 1; - */ - public Builder setWriteObjectSpec( - com.google.storage.v2.WriteObjectSpec.Builder builderForValue) { - if (writeObjectSpecBuilder_ == null) { - writeObjectSpec_ = builderForValue.build(); - onChanged(); - } else { - writeObjectSpecBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * The destination bucket, object, and metadata, as well as any preconditions.
-     * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 1; - */ - public Builder mergeWriteObjectSpec(com.google.storage.v2.WriteObjectSpec value) { - if (writeObjectSpecBuilder_ == null) { - if (writeObjectSpec_ != null) { - writeObjectSpec_ = - com.google.storage.v2.WriteObjectSpec.newBuilder(writeObjectSpec_) - .mergeFrom(value) - .buildPartial(); - } else { - writeObjectSpec_ = value; - } - onChanged(); - } else { - writeObjectSpecBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * The destination bucket, object, and metadata, as well as any preconditions.
-     * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 1; - */ - public Builder clearWriteObjectSpec() { - if (writeObjectSpecBuilder_ == null) { - writeObjectSpec_ = null; - onChanged(); - } else { - writeObjectSpec_ = null; - writeObjectSpecBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * The destination bucket, object, and metadata, as well as any preconditions.
-     * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 1; - */ - public com.google.storage.v2.WriteObjectSpec.Builder getWriteObjectSpecBuilder() { - - onChanged(); - return getWriteObjectSpecFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The destination bucket, object, and metadata, as well as any preconditions.
-     * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 1; - */ - public com.google.storage.v2.WriteObjectSpecOrBuilder getWriteObjectSpecOrBuilder() { - if (writeObjectSpecBuilder_ != null) { - return writeObjectSpecBuilder_.getMessageOrBuilder(); - } else { - return writeObjectSpec_ == null - ? com.google.storage.v2.WriteObjectSpec.getDefaultInstance() - : writeObjectSpec_; - } - } - /** - * - * - *
-     * The destination bucket, object, and metadata, as well as any preconditions.
-     * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.WriteObjectSpec, - com.google.storage.v2.WriteObjectSpec.Builder, - com.google.storage.v2.WriteObjectSpecOrBuilder> - getWriteObjectSpecFieldBuilder() { - if (writeObjectSpecBuilder_ == null) { - writeObjectSpecBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.WriteObjectSpec, - com.google.storage.v2.WriteObjectSpec.Builder, - com.google.storage.v2.WriteObjectSpecOrBuilder>( - getWriteObjectSpec(), getParentForChildren(), isClean()); - writeObjectSpec_ = null; - } - return writeObjectSpecBuilder_; - } - - private com.google.storage.v2.CommonObjectRequestParams commonObjectRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder> - commonObjectRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; - * - * @return Whether the commonObjectRequestParams field is set. - */ - public boolean hasCommonObjectRequestParams() { - return commonObjectRequestParamsBuilder_ != null || commonObjectRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; - * - * @return The commonObjectRequestParams. - */ - public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { - if (commonObjectRequestParamsBuilder_ == null) { - return commonObjectRequestParams_ == null - ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() - : commonObjectRequestParams_; - } else { - return commonObjectRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; - */ - public Builder setCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams value) { - if (commonObjectRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonObjectRequestParams_ = value; - onChanged(); - } else { - commonObjectRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; - */ - public Builder setCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams.Builder builderForValue) { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonObjectRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; - */ - public Builder mergeCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams value) { - if (commonObjectRequestParamsBuilder_ == null) { - if (commonObjectRequestParams_ != null) { - commonObjectRequestParams_ = - com.google.storage.v2.CommonObjectRequestParams.newBuilder(commonObjectRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonObjectRequestParams_ = value; - } - onChanged(); - } else { - commonObjectRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; - */ - public Builder clearCommonObjectRequestParams() { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = null; - onChanged(); - } else { - commonObjectRequestParams_ = null; - commonObjectRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; - */ - public com.google.storage.v2.CommonObjectRequestParams.Builder - getCommonObjectRequestParamsBuilder() { - - onChanged(); - return getCommonObjectRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; - */ - public com.google.storage.v2.CommonObjectRequestParamsOrBuilder - getCommonObjectRequestParamsOrBuilder() { - if (commonObjectRequestParamsBuilder_ != null) { - return commonObjectRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonObjectRequestParams_ == null - ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() - : commonObjectRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder> - getCommonObjectRequestParamsFieldBuilder() { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder>( - getCommonObjectRequestParams(), getParentForChildren(), isClean()); - commonObjectRequestParams_ = null; - } - return commonObjectRequestParamsBuilder_; - } - - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - commonRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - * - * @return Whether the commonRequestParams field is set. - */ - public boolean hasCommonRequestParams() { - return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - * - * @return The commonRequestParams. - */ - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } else { - return commonRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - */ - public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonRequestParams_ = value; - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - */ - public Builder setCommonRequestParams( - com.google.storage.v2.CommonRequestParams.Builder builderForValue) { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - */ - public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (commonRequestParams_ != null) { - commonRequestParams_ = - com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonRequestParams_ = value; - } - onChanged(); - } else { - commonRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - */ - public Builder clearCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - onChanged(); - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - */ - public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { - - onChanged(); - return getCommonRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - */ - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - if (commonRequestParamsBuilder_ != null) { - return commonRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - getCommonRequestParamsFieldBuilder() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder>( - getCommonRequestParams(), getParentForChildren(), isClean()); - commonRequestParams_ = null; - } - return commonRequestParamsBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.StartResumableWriteRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.StartResumableWriteRequest) - private static final com.google.storage.v2.StartResumableWriteRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.StartResumableWriteRequest(); - } - - public static com.google.storage.v2.StartResumableWriteRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StartResumableWriteRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StartResumableWriteRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.StartResumableWriteRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequestOrBuilder.java deleted file mode 100644 index 9889f461ac..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequestOrBuilder.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface StartResumableWriteRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.StartResumableWriteRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The destination bucket, object, and metadata, as well as any preconditions.
-   * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 1; - * - * @return Whether the writeObjectSpec field is set. - */ - boolean hasWriteObjectSpec(); - /** - * - * - *
-   * The destination bucket, object, and metadata, as well as any preconditions.
-   * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 1; - * - * @return The writeObjectSpec. - */ - com.google.storage.v2.WriteObjectSpec getWriteObjectSpec(); - /** - * - * - *
-   * The destination bucket, object, and metadata, as well as any preconditions.
-   * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 1; - */ - com.google.storage.v2.WriteObjectSpecOrBuilder getWriteObjectSpecOrBuilder(); - - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; - * - * @return Whether the commonObjectRequestParams field is set. - */ - boolean hasCommonObjectRequestParams(); - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; - * - * @return The commonObjectRequestParams. - */ - com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams(); - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; - */ - com.google.storage.v2.CommonObjectRequestParamsOrBuilder getCommonObjectRequestParamsOrBuilder(); - - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - * - * @return Whether the commonRequestParams field is set. - */ - boolean hasCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - * - * @return The commonRequestParams. - */ - com.google.storage.v2.CommonRequestParams getCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 4; - */ - com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponse.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponse.java deleted file mode 100644 index 98440f0e6c..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponse.java +++ /dev/null @@ -1,643 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Response object for `StartResumableWrite`.
- * 
- * - * Protobuf type {@code google.storage.v2.StartResumableWriteResponse} - */ -public final class StartResumableWriteResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.StartResumableWriteResponse) - StartResumableWriteResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use StartResumableWriteResponse.newBuilder() to construct. - private StartResumableWriteResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private StartResumableWriteResponse() { - uploadId_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new StartResumableWriteResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private StartResumableWriteResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - uploadId_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_StartResumableWriteResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_StartResumableWriteResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.StartResumableWriteResponse.class, - com.google.storage.v2.StartResumableWriteResponse.Builder.class); - } - - public static final int UPLOAD_ID_FIELD_NUMBER = 1; - private volatile java.lang.Object uploadId_; - /** - * - * - *
-   * The upload_id of the newly started resumable write operation. This
-   * value should be copied into the `WriteObjectRequest.upload_id` field.
-   * 
- * - * string upload_id = 1; - * - * @return The uploadId. - */ - @java.lang.Override - public java.lang.String getUploadId() { - java.lang.Object ref = uploadId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uploadId_ = s; - return s; - } - } - /** - * - * - *
-   * The upload_id of the newly started resumable write operation. This
-   * value should be copied into the `WriteObjectRequest.upload_id` field.
-   * 
- * - * string upload_id = 1; - * - * @return The bytes for uploadId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getUploadIdBytes() { - java.lang.Object ref = uploadId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - uploadId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uploadId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uploadId_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uploadId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uploadId_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.StartResumableWriteResponse)) { - return super.equals(obj); - } - com.google.storage.v2.StartResumableWriteResponse other = - (com.google.storage.v2.StartResumableWriteResponse) obj; - - if (!getUploadId().equals(other.getUploadId())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + UPLOAD_ID_FIELD_NUMBER; - hash = (53 * hash) + getUploadId().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.StartResumableWriteResponse parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.StartResumableWriteResponse parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.StartResumableWriteResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.StartResumableWriteResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.StartResumableWriteResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.StartResumableWriteResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.StartResumableWriteResponse parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.StartResumableWriteResponse parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.StartResumableWriteResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.StartResumableWriteResponse parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.StartResumableWriteResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.StartResumableWriteResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.StartResumableWriteResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Response object for `StartResumableWrite`.
-   * 
- * - * Protobuf type {@code google.storage.v2.StartResumableWriteResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.StartResumableWriteResponse) - com.google.storage.v2.StartResumableWriteResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_StartResumableWriteResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_StartResumableWriteResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.StartResumableWriteResponse.class, - com.google.storage.v2.StartResumableWriteResponse.Builder.class); - } - - // Construct using com.google.storage.v2.StartResumableWriteResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - uploadId_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_StartResumableWriteResponse_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.StartResumableWriteResponse getDefaultInstanceForType() { - return com.google.storage.v2.StartResumableWriteResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.StartResumableWriteResponse build() { - com.google.storage.v2.StartResumableWriteResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.StartResumableWriteResponse buildPartial() { - com.google.storage.v2.StartResumableWriteResponse result = - new com.google.storage.v2.StartResumableWriteResponse(this); - result.uploadId_ = uploadId_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.StartResumableWriteResponse) { - return mergeFrom((com.google.storage.v2.StartResumableWriteResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.StartResumableWriteResponse other) { - if (other == com.google.storage.v2.StartResumableWriteResponse.getDefaultInstance()) - return this; - if (!other.getUploadId().isEmpty()) { - uploadId_ = other.uploadId_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.StartResumableWriteResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.storage.v2.StartResumableWriteResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object uploadId_ = ""; - /** - * - * - *
-     * The upload_id of the newly started resumable write operation. This
-     * value should be copied into the `WriteObjectRequest.upload_id` field.
-     * 
- * - * string upload_id = 1; - * - * @return The uploadId. - */ - public java.lang.String getUploadId() { - java.lang.Object ref = uploadId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uploadId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The upload_id of the newly started resumable write operation. This
-     * value should be copied into the `WriteObjectRequest.upload_id` field.
-     * 
- * - * string upload_id = 1; - * - * @return The bytes for uploadId. - */ - public com.google.protobuf.ByteString getUploadIdBytes() { - java.lang.Object ref = uploadId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - uploadId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The upload_id of the newly started resumable write operation. This
-     * value should be copied into the `WriteObjectRequest.upload_id` field.
-     * 
- * - * string upload_id = 1; - * - * @param value The uploadId to set. - * @return This builder for chaining. - */ - public Builder setUploadId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - uploadId_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The upload_id of the newly started resumable write operation. This
-     * value should be copied into the `WriteObjectRequest.upload_id` field.
-     * 
- * - * string upload_id = 1; - * - * @return This builder for chaining. - */ - public Builder clearUploadId() { - - uploadId_ = getDefaultInstance().getUploadId(); - onChanged(); - return this; - } - /** - * - * - *
-     * The upload_id of the newly started resumable write operation. This
-     * value should be copied into the `WriteObjectRequest.upload_id` field.
-     * 
- * - * string upload_id = 1; - * - * @param value The bytes for uploadId to set. - * @return This builder for chaining. - */ - public Builder setUploadIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - uploadId_ = value; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.StartResumableWriteResponse) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.StartResumableWriteResponse) - private static final com.google.storage.v2.StartResumableWriteResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.StartResumableWriteResponse(); - } - - public static com.google.storage.v2.StartResumableWriteResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StartResumableWriteResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StartResumableWriteResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.StartResumableWriteResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponseOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponseOrBuilder.java deleted file mode 100644 index 4936df9ca2..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponseOrBuilder.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface StartResumableWriteResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.StartResumableWriteResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The upload_id of the newly started resumable write operation. This
-   * value should be copied into the `WriteObjectRequest.upload_id` field.
-   * 
- * - * string upload_id = 1; - * - * @return The uploadId. - */ - java.lang.String getUploadId(); - /** - * - * - *
-   * The upload_id of the newly started resumable write operation. This
-   * value should be copied into the `WriteObjectRequest.upload_id` field.
-   * 
- * - * string upload_id = 1; - * - * @return The bytes for uploadId. - */ - com.google.protobuf.ByteString getUploadIdBytes(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageProto.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageProto.java deleted file mode 100644 index e1748b3f11..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageProto.java +++ /dev/null @@ -1,1715 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public final class StorageProto { - private StorageProto() {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); - } - - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_DeleteBucketRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_DeleteBucketRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_GetBucketRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_GetBucketRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_CreateBucketRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_CreateBucketRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_ListBucketsRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_ListBucketsRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_ListBucketsResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_ListBucketsResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_LockBucketRetentionPolicyRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_LockBucketRetentionPolicyRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_UpdateBucketRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_UpdateBucketRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_DeleteNotificationRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_DeleteNotificationRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_GetNotificationRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_GetNotificationRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_CreateNotificationRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_CreateNotificationRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_ListNotificationsRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_ListNotificationsRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_ListNotificationsResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_ListNotificationsResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_ComposeObjectRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_ComposeObjectRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_ComposeObjectRequest_SourceObject_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_ComposeObjectRequest_SourceObject_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_ComposeObjectRequest_SourceObject_ObjectPreconditions_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_ComposeObjectRequest_SourceObject_ObjectPreconditions_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_DeleteObjectRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_DeleteObjectRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_ReadObjectRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_ReadObjectRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_GetObjectRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_GetObjectRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_ReadObjectResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_ReadObjectResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_WriteObjectSpec_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_WriteObjectSpec_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_WriteObjectRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_WriteObjectRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_WriteObjectResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_WriteObjectResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_ListObjectsRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_ListObjectsRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_QueryWriteStatusRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_QueryWriteStatusRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_QueryWriteStatusResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_QueryWriteStatusResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_RewriteObjectRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_RewriteObjectRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_RewriteResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_RewriteResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_StartResumableWriteRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_StartResumableWriteRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_StartResumableWriteResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_StartResumableWriteResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_UpdateObjectRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_UpdateObjectRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_GetServiceAccountRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_GetServiceAccountRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_CreateHmacKeyRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_CreateHmacKeyRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_CreateHmacKeyResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_CreateHmacKeyResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_DeleteHmacKeyRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_DeleteHmacKeyRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_GetHmacKeyRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_GetHmacKeyRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_ListHmacKeysRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_ListHmacKeysRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_ListHmacKeysResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_ListHmacKeysResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_UpdateHmacKeyRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_UpdateHmacKeyRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_CommonObjectRequestParams_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_CommonObjectRequestParams_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_CommonRequestParams_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_CommonRequestParams_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_ServiceConstants_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_ServiceConstants_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_Bucket_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_Bucket_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_Bucket_Billing_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_Bucket_Billing_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_Bucket_Cors_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_Bucket_Cors_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_Bucket_Encryption_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_Bucket_Encryption_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_Bucket_IamConfig_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_Bucket_IamConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_Bucket_IamConfig_UniformBucketLevelAccess_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_Bucket_IamConfig_UniformBucketLevelAccess_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_Bucket_Lifecycle_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_Bucket_Lifecycle_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_Bucket_Lifecycle_Rule_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_Bucket_Lifecycle_Rule_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Action_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Action_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Condition_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Condition_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_Bucket_Logging_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_Bucket_Logging_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_Bucket_RetentionPolicy_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_Bucket_RetentionPolicy_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_Bucket_Versioning_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_Bucket_Versioning_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_Bucket_Website_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_Bucket_Website_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_Bucket_CustomPlacementConfig_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_Bucket_CustomPlacementConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_Bucket_LabelsEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_Bucket_LabelsEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_BucketAccessControl_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_BucketAccessControl_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_ChecksummedData_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_ChecksummedData_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_ObjectChecksums_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_ObjectChecksums_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_HmacKeyMetadata_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_HmacKeyMetadata_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_Notification_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_Notification_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_Notification_CustomAttributesEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_Notification_CustomAttributesEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_CustomerEncryption_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_CustomerEncryption_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_Object_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_Object_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_Object_MetadataEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_Object_MetadataEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_ObjectAccessControl_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_ObjectAccessControl_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_ListObjectsResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_ListObjectsResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_ProjectTeam_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_ProjectTeam_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_ServiceAccount_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_ServiceAccount_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_Owner_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_Owner_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_ContentRange_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_ContentRange_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - - static { - java.lang.String[] descriptorData = { - "\n\037google/storage/v2/storage.proto\022\021googl" - + "e.storage.v2\032\027google/api/client.proto\032\037g" - + "oogle/api/field_behavior.proto\032\031google/a" - + "pi/resource.proto\032\036google/iam/v1/iam_pol" - + "icy.proto\032\032google/iam/v1/policy.proto\032\033g" - + "oogle/protobuf/empty.proto\032 google/proto" - + "buf/field_mask.proto\032\037google/protobuf/ti" - + "mestamp.proto\032\026google/type/date.proto\"\235\002" - + "\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\033if_m" - + "etageneration_not_match\030\003 \001(\003H\001\210\001\001\022E\n\025co" - + "mmon_request_params\030\005 \001(\0132&.google.stora" - + "ge.v2.CommonRequestParamsB\032\n\030_if_metagen" - + "eration_matchB\036\n\034_if_metageneration_not_" - + "match\"\334\002\n\020GetBucketRequest\0223\n\004name\030\001 \001(\t" - + "B%\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\022" - + "E\n\025common_request_params\030\004 \001(\0132&.google." - + "storage.v2.CommonRequestParams\0222\n\tread_m" - + "ask\030\005 \001(\0132\032.google.protobuf.FieldMaskH\002\210" - + "\001\001B\032\n\030_if_metageneration_matchB\036\n\034_if_me" - + "tageneration_not_matchB\014\n\n_read_mask\"\261\002\n" - + "\023CreateBucketRequest\022C\n\006parent\030\001 \001(\tB3\340A" - + "\002\372A-\n+cloudresourcemanager.googleapis.co" - + "m/Project\022.\n\006bucket\030\002 \001(\0132\031.google.stora" - + "ge.v2.BucketB\003\340A\002\022\026\n\tbucket_id\030\003 \001(\tB\003\340A" - + "\002\022>\n\016predefined_acl\030\004 \001(\0162&.google.stora" - + "ge.v2.PredefinedBucketAcl\022M\n\035predefined_" - + "default_object_acl\030\005 \001(\0162&.google.storag" - + "e.v2.PredefinedObjectAcl\"\231\002\n\022ListBuckets" - + "Request\022C\n\006parent\030\001 \001(\tB3\340A\002\372A-\n+cloudre" - + "sourcemanager.googleapis.com/Project\022\021\n\t" - + "page_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n\006p" - + "refix\030\004 \001(\t\0222\n\tread_mask\030\005 \001(\0132\032.google." - + "protobuf.FieldMaskH\000\210\001\001\022E\n\025common_reques" - + "t_params\030\006 \001(\0132&.google.storage.v2.Commo" - + "nRequestParamsB\014\n\n_read_mask\"Z\n\023ListBuck" - + "etsResponse\022*\n\007buckets\030\001 \003(\0132\031.google.st" - + "orage.v2.Bucket\022\027\n\017next_page_token\030\002 \001(\t" - + "\"\301\001\n LockBucketRetentionPolicyRequest\0225\n" - + "\006bucket\030\001 \001(\tB%\340A\002\372A\037\n\035storage.googleapi" - + "s.com/Bucket\022\037\n\027if_metageneration_match\030" - + "\002 \001(\003\022E\n\025common_request_params\030\003 \001(\0132&.g" - + "oogle.storage.v2.CommonRequestParams\"\323\003\n" - + "\023UpdateBucketRequest\022)\n\006bucket\030\001 \001(\0132\031.g" - + "oogle.storage.v2.Bucket\022$\n\027if_metagenera" - + "tion_match\030\002 \001(\003H\000\210\001\001\022(\n\033if_metagenerati" - + "on_not_match\030\003 \001(\003H\001\210\001\001\022>\n\016predefined_ac" - + "l\030\004 \001(\0162&.google.storage.v2.PredefinedBu" - + "cketAcl\022M\n\035predefined_default_object_acl" - + "\030\005 \001(\0162&.google.storage.v2.PredefinedObj" - + "ectAcl\022/\n\013update_mask\030\006 \001(\0132\032.google.pro" - + "tobuf.FieldMask\022E\n\025common_request_params" - + "\030\007 \001(\0132&.google.storage.v2.CommonRequest" - + "ParamsB\032\n\030_if_metageneration_matchB\036\n\034_i" - + "f_metageneration_not_match\"V\n\031DeleteNoti" - + "ficationRequest\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#s" - + "torage.googleapis.com/Notification\"M\n\026Ge" - + "tNotificationRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372" - + "A\037\n\035storage.googleapis.com/Bucket\"\216\001\n\031Cr" - + "eateNotificationRequest\0225\n\006parent\030\001 \001(\tB" - + "%\340A\002\372A\037\022\035storage.googleapis.com/Bucket\022:" - + "\n\014notification\030\002 \001(\0132\037.google.storage.v2" - + ".NotificationB\003\340A\002\"x\n\030ListNotificationsR" - + "equest\0225\n\006parent\030\001 \001(\tB%\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\"l\n\031ListNotification" - + "sResponse\0226\n\rnotifications\030\001 \003(\0132\037.googl" - + "e.storage.v2.Notification\022\027\n\017next_page_t" - + "oken\030\002 \001(\t\"\246\006\n\024ComposeObjectRequest\0223\n\013d" - + "estination\030\001 \001(\0132\031.google.storage.v2.Obj" - + "ectB\003\340A\002\022L\n\016source_objects\030\002 \003(\01324.googl" - + "e.storage.v2.ComposeObjectRequest.Source" - + "Object\022J\n\032destination_predefined_acl\030\003 \001" - + "(\0162&.google.storage.v2.PredefinedObjectA" - + "cl\022 \n\023if_generation_match\030\004 \001(\003H\000\210\001\001\022$\n\027" - + "if_metageneration_match\030\005 \001(\003H\001\210\001\001\0227\n\007km" - + "s_key\030\006 \001(\tB&\372A#\n!cloudkms.googleapis.co" - + "m/CryptoKey\022R\n\034common_object_request_par" - + "ams\030\007 \001(\0132,.google.storage.v2.CommonObje" - + "ctRequestParams\022E\n\025common_request_params" - + "\030\010 \001(\0132&.google.storage.v2.CommonRequest" - + "Params\032\356\001\n\014SourceObject\022\021\n\004name\030\001 \001(\tB\003\340" - + "A\002\022\022\n\ngeneration\030\002 \001(\003\022f\n\024object_precond" - + "itions\030\003 \001(\0132H.google.storage.v2.Compose" - + "ObjectRequest.SourceObject.ObjectPrecond" - + "itions\032O\n\023ObjectPreconditions\022 \n\023if_gene" - + "ration_match\030\001 \001(\003H\000\210\001\001B\026\n\024_if_generatio" - + "n_matchB\026\n\024_if_generation_matchB\032\n\030_if_m" - + "etageneration_match\"\211\004\n\023DeleteObjectRequ" - + "est\022\023\n\006bucket\030\001 \001(\tB\003\340A\002\022\023\n\006object\030\002 \001(\t" - + "B\003\340A\002\022\021\n\tupload_id\030\003 \001(\t\022\022\n\ngeneration\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\027" - + "if_metageneration_match\030\007 \001(\003H\002\210\001\001\022(\n\033if" - + "_metageneration_not_match\030\010 \001(\003H\003\210\001\001\022R\n\034" - + "common_object_request_params\030\n \001(\0132,.goo" - + "gle.storage.v2.CommonObjectRequestParams" - + "\022E\n\025common_request_params\030\013 \001(\0132&.google" - + ".storage.v2.CommonRequestParamsB\026\n\024_if_g" - + "eneration_matchB\032\n\030_if_generation_not_ma" - + "tchB\032\n\030_if_metageneration_matchB\036\n\034_if_m" - + "etageneration_not_match\"\325\004\n\021ReadObjectRe" - + "quest\022\016\n\006bucket\030\001 \001(\t\022\016\n\006object\030\002 \001(\t\022\022\n" - + "\ngeneration\030\003 \001(\003\022\023\n\013read_offset\030\004 \001(\003\022\022" - + "\n\nread_limit\030\005 \001(\003\022 \n\023if_generation_matc" - + "h\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_para" - + "ms\030\n \001(\0132,.google.storage.v2.CommonObjec" - + "tRequestParams\022E\n\025common_request_params\030" - + "\013 \001(\0132&.google.storage.v2.CommonRequestP" - + "arams\0222\n\tread_mask\030\014 \001(\0132\032.google.protob" - + "uf.FieldMaskH\004\210\001\001B\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\014\n\n_read_mask\"\265\004\n\020GetObjectReq" - + "uest\022\023\n\006bucket\030\001 \001(\tB\003\340A\002\022\023\n\006object\030\002 \001(" - + "\tB\003\340A\002\022\022\n\ngeneration\030\003 \001(\003\022 \n\023if_generat" - + "ion_match\030\004 \001(\003H\000\210\001\001\022$\n\027if_generation_no" - + "t_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_no" - + "t_match\030\007 \001(\003H\003\210\001\001\022R\n\034common_object_requ" - + "est_params\030\010 \001(\0132,.google.storage.v2.Com" - + "monObjectRequestParams\022E\n\025common_request" - + "_params\030\t \001(\0132&.google.storage.v2.Common" - + "RequestParams\0222\n\tread_mask\030\n \001(\0132\032.googl" - + "e.protobuf.FieldMaskH\004\210\001\001B\026\n\024_if_generat" - + "ion_matchB\032\n\030_if_generation_not_matchB\032\n" - + "\030_if_metageneration_matchB\036\n\034_if_metagen" - + "eration_not_matchB\014\n\n_read_mask\"\365\001\n\022Read" - + "ObjectResponse\022<\n\020checksummed_data\030\001 \001(\013" - + "2\".google.storage.v2.ChecksummedData\022<\n\020" - + "object_checksums\030\002 \001(\0132\".google.storage." - + "v2.ObjectChecksums\0226\n\rcontent_range\030\003 \001(" - + "\0132\037.google.storage.v2.ContentRange\022+\n\010me" - + "tadata\030\004 \001(\0132\031.google.storage.v2.Object\"" - + "\206\003\n\017WriteObjectSpec\022+\n\010resource\030\001 \001(\0132\031." - + "google.storage.v2.Object\022>\n\016predefined_a" - + "cl\030\002 \001(\0162&.google.storage.v2.PredefinedO" - + "bjectAcl\022 \n\023if_generation_match\030\003 \001(\003H\000\210" - + "\001\001\022$\n\027if_generation_not_match\030\004 \001(\003H\001\210\001\001" - + "\022$\n\027if_metageneration_match\030\005 \001(\003H\002\210\001\001\022(" - + "\n\033if_metageneration_not_match\030\006 \001(\003H\003\210\001\001" - + "B\026\n\024_if_generation_matchB\032\n\030_if_generati" - + "on_not_matchB\032\n\030_if_metageneration_match" - + "B\036\n\034_if_metageneration_not_match\"\315\003\n\022Wri" - + "teObjectRequest\022\023\n\tupload_id\030\001 \001(\tH\000\022?\n\021" - + "write_object_spec\030\002 \001(\0132\".google.storage" - + ".v2.WriteObjectSpecH\000\022\031\n\014write_offset\030\003 " - + "\001(\003B\003\340A\002\022>\n\020checksummed_data\030\004 \001(\0132\".goo" - + "gle.storage.v2.ChecksummedDataH\001\022<\n\020obje" - + "ct_checksums\030\006 \001(\0132\".google.storage.v2.O" - + "bjectChecksums\022\024\n\014finish_write\030\007 \001(\010\022R\n\034" - + "common_object_request_params\030\010 \001(\0132,.goo" - + "gle.storage.v2.CommonObjectRequestParams" - + "\022E\n\025common_request_params\030\t \001(\0132&.google" - + ".storage.v2.CommonRequestParamsB\017\n\rfirst" - + "_messageB\006\n\004data\"n\n\023WriteObjectResponse\022" - + "\030\n\016persisted_size\030\001 \001(\003H\000\022-\n\010resource\030\002 " - + "\001(\0132\031.google.storage.v2.ObjectH\000B\016\n\014writ" - + "e_status\"\214\003\n\022ListObjectsRequest\0225\n\006paren" - + "t\030\001 \001(\tB%\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\021\n\tdelimiter\030\004 \001(\t\022\"\n\032include_trai" - + "ling_delimiter\030\005 \001(\010\022\016\n\006prefix\030\006 \001(\t\022\020\n\010" - + "versions\030\007 \001(\010\0222\n\tread_mask\030\010 \001(\0132\032.goog" - + "le.protobuf.FieldMaskH\000\210\001\001\022\033\n\023lexicograp" - + "hic_start\030\n \001(\t\022\031\n\021lexicographic_end\030\013 \001" - + "(\t\022E\n\025common_request_params\030\t \001(\0132&.goog" - + "le.storage.v2.CommonRequestParamsB\014\n\n_re" - + "ad_mask\"\314\001\n\027QueryWriteStatusRequest\022\026\n\tu" - + "pload_id\030\001 \001(\tB\003\340A\002\022R\n\034common_object_req" - + "uest_params\030\002 \001(\0132,.google.storage.v2.Co" - + "mmonObjectRequestParams\022E\n\025common_reques" - + "t_params\030\003 \001(\0132&.google.storage.v2.Commo" - + "nRequestParams\"s\n\030QueryWriteStatusRespon" - + "se\022\030\n\016persisted_size\030\001 \001(\003H\000\022-\n\010resource" - + "\030\002 \001(\0132\031.google.storage.v2.ObjectH\000B\016\n\014w" - + "rite_status\"\261\n\n\024RewriteObjectRequest\022\035\n\020" - + "destination_name\030\030 \001(\tB\003\340A\005\022A\n\022destinati" - + "on_bucket\030\031 \001(\tB%\340A\005\372A\037\n\035storage.googlea" - + "pis.com/Bucket\022C\n\023destination_kms_key\030\033 " - + "\001(\tB&\372A#\n!cloudkms.googleapis.com/Crypto" - + "Key\022.\n\013destination\030\001 \001(\0132\031.google.storag" - + "e.v2.Object\022\032\n\rsource_bucket\030\002 \001(\tB\003\340A\002\022" - + "\032\n\rsource_object\030\003 \001(\tB\003\340A\002\022\031\n\021source_ge" - + "neration\030\004 \001(\003\022\025\n\rrewrite_token\030\005 \001(\t\022J\n" - + "\032destination_predefined_acl\030\006 \001(\0162&.goog" - + "le.storage.v2.PredefinedObjectAcl\022 \n\023if_" - + "generation_match\030\007 \001(\003H\000\210\001\001\022$\n\027if_genera" - + "tion_not_match\030\010 \001(\003H\001\210\001\001\022$\n\027if_metagene" - + "ration_match\030\t \001(\003H\002\210\001\001\022(\n\033if_metagenera" - + "tion_not_match\030\n \001(\003H\003\210\001\001\022\'\n\032if_source_g" - + "eneration_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_so" - + "urce_metageneration_match\030\r \001(\003H\006\210\001\001\022/\n\"" - + "if_source_metageneration_not_match\030\016 \001(\003" - + "H\007\210\001\001\022$\n\034max_bytes_rewritten_per_call\030\017 " - + "\001(\003\022(\n copy_source_encryption_algorithm\030" - + "\020 \001(\t\022(\n copy_source_encryption_key_byte" - + "s\030\025 \001(\014\022/\n\'copy_source_encryption_key_sh" - + "a256_bytes\030\026 \001(\014\022R\n\034common_object_reques" - + "t_params\030\023 \001(\0132,.google.storage.v2.Commo" - + "nObjectRequestParams\022E\n\025common_request_p" - + "arams\030\024 \001(\0132&.google.storage.v2.CommonRe" - + "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" - + "tchB\035\n\033_if_source_generation_matchB!\n\037_i" - + "f_source_generation_not_matchB!\n\037_if_sou" - + "rce_metageneration_matchB%\n#_if_source_m" - + "etageneration_not_match\"\227\001\n\017RewriteRespo" - + "nse\022\035\n\025total_bytes_rewritten\030\001 \001(\003\022\023\n\013ob" - + "ject_size\030\002 \001(\003\022\014\n\004done\030\003 \001(\010\022\025\n\rrewrite" - + "_token\030\004 \001(\t\022+\n\010resource\030\005 \001(\0132\031.google." - + "storage.v2.Object\"\366\001\n\032StartResumableWrit" - + "eRequest\022=\n\021write_object_spec\030\001 \001(\0132\".go" - + "ogle.storage.v2.WriteObjectSpec\022R\n\034commo" - + "n_object_request_params\030\003 \001(\0132,.google.s" - + "torage.v2.CommonObjectRequestParams\022E\n\025c" - + "ommon_request_params\030\004 \001(\0132&.google.stor" - + "age.v2.CommonRequestParams\"0\n\033StartResum" - + "ableWriteResponse\022\021\n\tupload_id\030\001 \001(\t\"\324\004\n" - + "\023UpdateObjectRequest\022)\n\006object\030\001 \001(\0132\031.g" - + "oogle.storage.v2.Object\022 \n\023if_generation" - + "_match\030\002 \001(\003H\000\210\001\001\022$\n\027if_generation_not_m" - + "atch\030\003 \001(\003H\001\210\001\001\022$\n\027if_metageneration_mat" - + "ch\030\004 \001(\003H\002\210\001\001\022(\n\033if_metageneration_not_m" - + "atch\030\005 \001(\003H\003\210\001\001\022>\n\016predefined_acl\030\006 \001(\0162" - + "&.google.storage.v2.PredefinedObjectAcl\022" - + "/\n\013update_mask\030\007 \001(\0132\032.google.protobuf.F" - + "ieldMask\022R\n\034common_object_request_params" - + "\030\010 \001(\0132,.google.storage.v2.CommonObjectR" - + "equestParams\022E\n\025common_request_params\030\t " - + "\001(\0132&.google.storage.v2.CommonRequestPar" - + "amsB\026\n\024_if_generation_matchB\032\n\030_if_gener" - + "ation_not_matchB\032\n\030_if_metageneration_ma" - + "tchB\036\n\034_if_metageneration_not_match\"\247\001\n\030" - + "GetServiceAccountRequest\022D\n\007project\030\001 \001(" - + "\tB3\340A\002\372A-\n+cloudresourcemanager.googleap" - + "is.com/Project\022E\n\025common_request_params\030" - + "\002 \001(\0132&.google.storage.v2.CommonRequestP" - + "arams\"\307\001\n\024CreateHmacKeyRequest\022D\n\007projec" - + "t\030\001 \001(\tB3\340A\002\372A-\n+cloudresourcemanager.go" - + "ogleapis.com/Project\022\"\n\025service_account_" - + "email\030\002 \001(\tB\003\340A\002\022E\n\025common_request_param" - + "s\030\003 \001(\0132&.google.storage.v2.CommonReques" - + "tParams\"g\n\025CreateHmacKeyResponse\0224\n\010meta" - + "data\030\001 \001(\0132\".google.storage.v2.HmacKeyMe" - + "tadata\022\030\n\020secret_key_bytes\030\003 \001(\014\"\273\001\n\024Del" - + "eteHmacKeyRequest\022\026\n\taccess_id\030\001 \001(\tB\003\340A" - + "\002\022D\n\007project\030\002 \001(\tB3\340A\002\372A-\n+cloudresourc" - + "emanager.googleapis.com/Project\022E\n\025commo" - + "n_request_params\030\003 \001(\0132&.google.storage." - + "v2.CommonRequestParams\"\270\001\n\021GetHmacKeyReq" - + "uest\022\026\n\taccess_id\030\001 \001(\tB\003\340A\002\022D\n\007project\030" - + "\002 \001(\tB3\340A\002\372A-\n+cloudresourcemanager.goog" - + "leapis.com/Project\022E\n\025common_request_par" - + "ams\030\003 \001(\0132&.google.storage.v2.CommonRequ" - + "estParams\"\234\002\n\023ListHmacKeysRequest\022D\n\007pro" - + "ject\030\001 \001(\tB3\340A\002\372A-\n+cloudresourcemanager" - + ".googleapis.com/Project\022\026\n\tpage_size\030\002 \001" - + "(\005B\003\340A\001\022\027\n\npage_token\030\003 \001(\tB\003\340A\001\022\"\n\025serv" - + "ice_account_email\030\004 \001(\tB\003\340A\001\022\036\n\021show_del" - + "eted_keys\030\005 \001(\010B\003\340A\001\022J\n\025common_request_p" - + "arams\030\006 \001(\0132&.google.storage.v2.CommonRe" - + "questParamsB\003\340A\001\"f\n\024ListHmacKeysResponse" - + "\0225\n\thmac_keys\030\001 \003(\0132\".google.storage.v2." - + "HmacKeyMetadata\022\027\n\017next_page_token\030\002 \001(\t" - + "\"\311\001\n\024UpdateHmacKeyRequest\0229\n\010hmac_key\030\001 " - + "\001(\0132\".google.storage.v2.HmacKeyMetadataB" - + "\003\340A\002\022E\n\025common_request_params\030\002 \001(\0132&.go" - + "ogle.storage.v2.CommonRequestParams\022/\n\013u" - + "pdate_mask\030\003 \001(\0132\032.google.protobuf.Field" - + "Mask\"|\n\031CommonObjectRequestParams\022\034\n\024enc" - + "ryption_algorithm\030\001 \001(\t\022\034\n\024encryption_ke" - + "y_bytes\030\004 \001(\014\022#\n\033encryption_key_sha256_b" - + "ytes\030\005 \001(\014\"`\n\023CommonRequestParams\022I\n\014use" - + "r_project\030\001 \001(\tB3\340A\002\372A-\n+cloudresourcema" - + "nager.googleapis.com/Project\"\312\005\n\020Service" - + "Constants\"\265\005\n\006Values\022\026\n\022VALUES_UNSPECIFI" - + "ED\020\000\022\033\n\024MAX_READ_CHUNK_BYTES\020\200\200\200\001\022\034\n\025MAX" - + "_WRITE_CHUNK_BYTES\020\200\200\200\001\022\031\n\022MAX_OBJECT_SI" - + "ZE_MB\020\200\200\300\002\022)\n$MAX_CUSTOM_METADATA_FIELD_" - + "NAME_BYTES\020\200\010\022*\n%MAX_CUSTOM_METADATA_FIE" - + "LD_VALUE_BYTES\020\200 \022)\n$MAX_CUSTOM_METADATA" - + "_TOTAL_SIZE_BYTES\020\200@\022*\n$MAX_BUCKET_METAD" - + "ATA_TOTAL_SIZE_BYTES\020\200\240\001\022\'\n#MAX_NOTIFICA" - + "TION_CONFIGS_PER_BUCKET\020d\022\"\n\036MAX_LIFECYC" - + "LE_RULES_PER_BUCKET\020d\022&\n\"MAX_NOTIFICATIO" - + "N_CUSTOM_ATTRIBUTES\020\005\0221\n,MAX_NOTIFICATIO" - + "N_CUSTOM_ATTRIBUTE_KEY_LENGTH\020\200\002\0223\n.MAX_" - + "NOTIFICATION_CUSTOM_ATTRIBUTE_VALUE_LENG" - + "TH\020\200\010\022\034\n\030MAX_LABELS_ENTRIES_COUNT\020@\022\037\n\033M" - + "AX_LABELS_KEY_VALUE_LENGTH\020?\022\037\n\032MAX_LABE" - + "LS_KEY_VALUE_BYTES\020\200\001\022.\n)MAX_OBJECT_IDS_" - + "PER_DELETE_OBJECTS_REQUEST\020\350\007\022\036\n\032SPLIT_T" - + "OKEN_MAX_VALID_DAYS\020\016\032\002\020\001\"\207\027\n\006Bucket\022\021\n\004" - + "name\030\001 \001(\tB\003\340A\005\022\026\n\tbucket_id\030\002 \001(\tB\003\340A\003\022" - + "D\n\007project\030\003 \001(\tB3\340A\005\372A-\n+cloudresourcem" - + "anager.googleapis.com/Project\022\033\n\016metagen" - + "eration\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\003acl\030\010 \003(\0132&" - + ".google.storage.v2.BucketAccessControl\022B" - + "\n\022default_object_acl\030\t \003(\0132&.google.stor" - + "age.v2.ObjectAccessControl\0226\n\tlifecycle\030" - + "\n \001(\0132#.google.storage.v2.Bucket.Lifecyc" - + "le\0224\n\013create_time\030\013 \001(\0132\032.google.protobu" - + "f.TimestampB\003\340A\003\022,\n\004cors\030\014 \003(\0132\036.google." - + "storage.v2.Bucket.Cors\0224\n\013update_time\030\r " - + "\001(\0132\032.google.protobuf.TimestampB\003\340A\003\022 \n\030" - + "default_event_based_hold\030\016 \001(\010\0225\n\006labels" - + "\030\017 \003(\0132%.google.storage.v2.Bucket.Labels" - + "Entry\0222\n\007website\030\020 \001(\0132!.google.storage." - + "v2.Bucket.Website\0228\n\nversioning\030\021 \001(\0132$." - + "google.storage.v2.Bucket.Versioning\0222\n\007l" - + "ogging\030\022 \001(\0132!.google.storage.v2.Bucket." - + "Logging\022,\n\005owner\030\023 \001(\0132\030.google.storage." - + "v2.OwnerB\003\340A\003\0228\n\nencryption\030\024 \001(\0132$.goog" - + "le.storage.v2.Bucket.Encryption\0222\n\007billi" - + "ng\030\025 \001(\0132!.google.storage.v2.Bucket.Bill" - + "ing\022C\n\020retention_policy\030\026 \001(\0132).google.s" - + "torage.v2.Bucket.RetentionPolicy\0227\n\niam_" - + "config\030\027 \001(\0132#.google.storage.v2.Bucket." - + "IamConfig\022\025\n\rsatisfies_pzs\030\031 \001(\010\022P\n\027cust" - + "om_placement_config\030\032 \001(\0132/.google.stora" - + "ge.v2.Bucket.CustomPlacementConfig\032!\n\007Bi" - + "lling\022\026\n\016requester_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\017respons" - + "e_header\030\003 \003(\t\022\027\n\017max_age_seconds\030\004 \001(\005\032" - + "M\n\nEncryption\022?\n\017default_kms_key\030\001 \001(\tB&" - + "\372A#\n!cloudkms.googleapis.com/CryptoKey\032\211" - + "\003\n\tIamConfig\022a\n\033uniform_bucket_level_acc" - + "ess\030\001 \001(\0132<.google.storage.v2.Bucket.Iam" - + "Config.UniformBucketLevelAccess\022\\\n\030publi" - + "c_access_prevention\030\002 \001(\0162:.google.stora" - + "ge.v2.Bucket.IamConfig.PublicAccessPreve" - + "ntion\032Z\n\030UniformBucketLevelAccess\022\017\n\007ena" - + "bled\030\001 \001(\010\022-\n\tlock_time\030\002 \001(\0132\032.google.p" - + "rotobuf.Timestamp\"_\n\026PublicAccessPrevent" - + "ion\022(\n$PUBLIC_ACCESS_PREVENTION_UNSPECIF" - + "IED\020\000\022\014\n\010ENFORCED\020\001\022\r\n\tINHERITED\020\002\032\303\005\n\tL" - + "ifecycle\0226\n\004rule\030\001 \003(\0132(.google.storage." - + "v2.Bucket.Lifecycle.Rule\032\375\004\n\004Rule\022?\n\006act" - + "ion\030\001 \001(\0132/.google.storage.v2.Bucket.Lif" - + "ecycle.Rule.Action\022E\n\tcondition\030\002 \001(\01322." - + "google.storage.v2.Bucket.Lifecycle.Rule." - + "Condition\032-\n\006Action\022\014\n\004type\030\001 \001(\t\022\025\n\rsto" - + "rage_class\030\002 \001(\t\032\275\003\n\tCondition\022\025\n\010age_da" - + "ys\030\001 \001(\005H\000\210\001\001\022)\n\016created_before\030\002 \001(\0132\021." - + "google.type.Date\022\024\n\007is_live\030\003 \001(\010H\001\210\001\001\022\037" - + "\n\022num_newer_versions\030\004 \001(\005H\002\210\001\001\022\035\n\025match" - + "es_storage_class\030\005 \003(\t\022#\n\026days_since_cus" - + "tom_time\030\007 \001(\005H\003\210\001\001\022-\n\022custom_time_befor" - + "e\030\010 \001(\0132\021.google.type.Date\022\'\n\032days_since" - + "_noncurrent_time\030\t \001(\005H\004\210\001\001\0221\n\026noncurren" - + "t_time_before\030\n \001(\0132\021.google.type.DateB\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\032r\n\017RetentionPolicy\0222\n\016effective_time\030" - + "\001 \001(\0132\032.google.protobuf.Timestamp\022\021\n\tis_" - + "locked\030\002 \001(\010\022\030\n\020retention_period\030\003 \001(\003\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\016not_found_" - + "page\030\002 \001(\t\032/\n\025CustomPlacementConfig\022\026\n\016d" - + "ata_locations\030\001 \003(\t\032-\n\013LabelsEntry\022\013\n\003ke" - + "y\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:G\352AD\n\035storage" - + ".googleapis.com/Bucket\022#projects/{projec" - + "t}/buckets/{bucket}\"\247\001\n\023BucketAccessCont" - + "rol\022\014\n\004role\030\001 \001(\t\022\n\n\002id\030\002 \001(\t\022\016\n\006entity\030" - + "\003 \001(\t\022\021\n\tentity_id\030\004 \001(\t\022\r\n\005email\030\005 \001(\t\022" - + "\016\n\006domain\030\006 \001(\t\0224\n\014project_team\030\007 \001(\0132\036." - + "google.storage.v2.ProjectTeam\"B\n\017Checksu" - + "mmedData\022\017\n\007content\030\001 \001(\014\022\023\n\006crc32c\030\002 \001(" - + "\007H\000\210\001\001B\t\n\007_crc32c\"C\n\017ObjectChecksums\022\023\n\006" - + "crc32c\030\001 \001(\007H\000\210\001\001\022\020\n\010md5_hash\030\002 \001(\014B\t\n\007_" - + "crc32c\"\203\002\n\017HmacKeyMetadata\022\n\n\002id\030\001 \001(\t\022\021" - + "\n\taccess_id\030\002 \001(\t\022A\n\007project\030\003 \001(\tB0\372A-\n" - + "+cloudresourcemanager.googleapis.com/Pro" - + "ject\022\035\n\025service_account_email\030\004 \001(\t\022\r\n\005s" - + "tate\030\005 \001(\t\022/\n\013create_time\030\006 \001(\0132\032.google" - + ".protobuf.Timestamp\022/\n\013update_time\030\007 \001(\013" - + "2\032.google.protobuf.Timestamp\"\217\003\n\014Notific" - + "ation\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\022\n\005topic\030\002 \001(\tB" - + "\003\340A\002\022\030\n\013event_types\030\003 \003(\tB\003\340A\001\022U\n\021custom" - + "_attributes\030\004 \003(\01325.google.storage.v2.No" - + "tification.CustomAttributesEntryB\003\340A\001\022\037\n" - + "\022object_name_prefix\030\005 \001(\tB\003\340A\001\022\033\n\016payloa" - + "d_format\030\006 \001(\tB\003\340A\002\0327\n\025CustomAttributesE" - + "ntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:p\352A" - + "m\n#storage.googleapis.com/Notification\022F" - + "projects/{project}/buckets/{bucket}/noti" - + "ficationConfigs/{notification}\"L\n\022Custom", - "erEncryption\022\034\n\024encryption_algorithm\030\001 \001" - + "(\t\022\030\n\020key_sha256_bytes\030\003 \001(\014\"\364\010\n\006Object\022" - + "\021\n\004name\030\001 \001(\tB\003\340A\005\0225\n\006bucket\030\002 \001(\tB%\340A\005\372" - + "A\037\n\035storage.googleapis.com/Bucket\022\027\n\ngen" - + "eration\030\003 \001(\003B\003\340A\005\022\033\n\016metageneration\030\004 \001" - + "(\003B\003\340A\003\022\025\n\rstorage_class\030\005 \001(\t\022\021\n\004size\030\006" - + " \001(\003B\003\340A\003\022\030\n\020content_encoding\030\007 \001(\t\022\033\n\023c" - + "ontent_disposition\030\010 \001(\t\022\025\n\rcache_contro" - + "l\030\t \001(\t\0223\n\003acl\030\n \003(\0132&.google.storage.v2" - + ".ObjectAccessControl\022\030\n\020content_language" - + "\030\013 \001(\t\0224\n\013delete_time\030\014 \001(\0132\032.google.pro" - + "tobuf.TimestampB\003\340A\003\022\024\n\014content_type\030\r \001" - + "(\t\0224\n\013create_time\030\016 \001(\0132\032.google.protobu" - + "f.TimestampB\003\340A\003\022\034\n\017component_count\030\017 \001(" - + "\005B\003\340A\003\022:\n\tchecksums\030\020 \001(\0132\".google.stora" - + "ge.v2.ObjectChecksumsB\003\340A\003\0224\n\013update_tim" - + "e\030\021 \001(\0132\032.google.protobuf.TimestampB\003\340A\003" - + "\0227\n\007kms_key\030\022 \001(\tB&\372A#\n!cloudkms.googlea" - + "pis.com/CryptoKey\022B\n\031update_storage_clas" - + "s_time\030\023 \001(\0132\032.google.protobuf.Timestamp" - + "B\003\340A\003\022\026\n\016temporary_hold\030\024 \001(\010\0229\n\025retenti" - + "on_expire_time\030\025 \001(\0132\032.google.protobuf.T" - + "imestamp\0229\n\010metadata\030\026 \003(\0132\'.google.stor" - + "age.v2.Object.MetadataEntry\022\035\n\020event_bas" - + "ed_hold\030\027 \001(\010H\000\210\001\001\022,\n\005owner\030\030 \001(\0132\030.goog" - + "le.storage.v2.OwnerB\003\340A\003\022B\n\023customer_enc" - + "ryption\030\031 \001(\0132%.google.storage.v2.Custom" - + "erEncryption\022/\n\013custom_time\030\032 \001(\0132\032.goog" - + "le.protobuf.Timestamp\032/\n\rMetadataEntry\022\013" - + "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\023\n\021_event" - + "_based_hold\"\247\001\n\023ObjectAccessControl\022\014\n\004r" - + "ole\030\001 \001(\t\022\n\n\002id\030\002 \001(\t\022\016\n\006entity\030\003 \001(\t\022\021\n" - + "\tentity_id\030\004 \001(\t\022\r\n\005email\030\005 \001(\t\022\016\n\006domai" - + "n\030\006 \001(\t\0224\n\014project_team\030\007 \001(\0132\036.google.s" - + "torage.v2.ProjectTeam\"l\n\023ListObjectsResp" - + "onse\022*\n\007objects\030\001 \003(\0132\031.google.storage.v" - + "2.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_nu" - + "mber\030\001 \001(\t\022\014\n\004team\030\002 \001(\t\"\'\n\016ServiceAccou" - + "nt\022\025\n\remail_address\030\001 \001(\t\"*\n\005Owner\022\016\n\006en" - + "tity\030\001 \001(\t\022\021\n\tentity_id\030\002 \001(\t\"C\n\014Content" - + "Range\022\r\n\005start\030\001 \001(\003\022\013\n\003end\030\002 \001(\003\022\027\n\017com" - + "plete_length\030\003 \001(\003*\377\001\n\023PredefinedObjectA" - + "cl\022%\n!PREDEFINED_OBJECT_ACL_UNSPECIFIED\020" - + "\000\022!\n\035OBJECT_ACL_AUTHENTICATED_READ\020\001\022(\n$" - + "OBJECT_ACL_BUCKET_OWNER_FULL_CONTROL\020\002\022 " - + "\n\034OBJECT_ACL_BUCKET_OWNER_READ\020\003\022\026\n\022OBJE" - + "CT_ACL_PRIVATE\020\004\022\036\n\032OBJECT_ACL_PROJECT_P" - + "RIVATE\020\005\022\032\n\026OBJECT_ACL_PUBLIC_READ\020\006*\325\001\n" - + "\023PredefinedBucketAcl\022%\n!PREDEFINED_BUCKE" - + "T_ACL_UNSPECIFIED\020\000\022!\n\035BUCKET_ACL_AUTHEN" - + "TICATED_READ\020\001\022\026\n\022BUCKET_ACL_PRIVATE\020\002\022\036" - + "\n\032BUCKET_ACL_PROJECT_PRIVATE\020\003\022\032\n\026BUCKET" - + "_ACL_PUBLIC_READ\020\004\022 \n\034BUCKET_ACL_PUBLIC_" - + "READ_WRITE\020\0052\260\033\n\007Storage\022W\n\014DeleteBucket" - + "\022&.google.storage.v2.DeleteBucketRequest" - + "\032\026.google.protobuf.Empty\"\007\332A\004name\022T\n\tGet" - + "Bucket\022#.google.storage.v2.GetBucketRequ" - + "est\032\031.google.storage.v2.Bucket\"\007\332A\004name\022" - + "m\n\014CreateBucket\022&.google.storage.v2.Crea" - + "teBucketRequest\032\031.google.storage.v2.Buck" - + "et\"\032\332A\027parent,bucket,bucket_id\022g\n\013ListBu" - + "ckets\022%.google.storage.v2.ListBucketsReq" - + "uest\032&.google.storage.v2.ListBucketsResp" - + "onse\"\t\332A\006parent\022v\n\031LockBucketRetentionPo" - + "licy\0223.google.storage.v2.LockBucketReten" - + "tionPolicyRequest\032\031.google.storage.v2.Bu" - + "cket\"\t\332A\006bucket\022V\n\014GetIamPolicy\022\".google" - + ".iam.v1.GetIamPolicyRequest\032\025.google.iam" - + ".v1.Policy\"\013\332A\010resource\022]\n\014SetIamPolicy\022" - + "\".google.iam.v1.SetIamPolicyRequest\032\025.go" - + "ogle.iam.v1.Policy\"\022\332A\017resource,policy\022\202" - + "\001\n\022TestIamPermissions\022(.google.iam.v1.Te" - + "stIamPermissionsRequest\032).google.iam.v1." - + "TestIamPermissionsResponse\"\027\332A\024resource," - + "permissions\022h\n\014UpdateBucket\022&.google.sto" - + "rage.v2.UpdateBucketRequest\032\031.google.sto" - + "rage.v2.Bucket\"\025\332A\022bucket,update_mask\022c\n" - + "\022DeleteNotification\022,.google.storage.v2." - + "DeleteNotificationRequest\032\026.google.proto" - + "buf.Empty\"\007\332A\004name\022f\n\017GetNotification\022)." - + "google.storage.v2.GetNotificationRequest" - + "\032\037.google.storage.v2.Notification\"\007\332A\004na" - + "me\022{\n\022CreateNotification\022,.google.storag" - + "e.v2.CreateNotificationRequest\032\037.google." - + "storage.v2.Notification\"\026\332A\023parent,notif" - + "ication\022y\n\021ListNotifications\022+.google.st" - + "orage.v2.ListNotificationsRequest\032,.goog" - + "le.storage.v2.ListNotificationsResponse\"" - + "\t\332A\006parent\022U\n\rComposeObject\022\'.google.sto" - + "rage.v2.ComposeObjectRequest\032\031.google.st" - + "orage.v2.Object\"\000\022{\n\014DeleteObject\022&.goog" - + "le.storage.v2.DeleteObjectRequest\032\026.goog" - + "le.protobuf.Empty\"+\332A\rbucket,object\332A\030bu" - + "cket,object,generation\022x\n\tGetObject\022#.go" - + "ogle.storage.v2.GetObjectRequest\032\031.googl" - + "e.storage.v2.Object\"+\332A\rbucket,object\332A\030" - + "bucket,object,generation\022\210\001\n\nReadObject\022" - + "$.google.storage.v2.ReadObjectRequest\032%." - + "google.storage.v2.ReadObjectResponse\"+\332A" - + "\rbucket,object\332A\030bucket,object,generatio" - + "n0\001\022h\n\014UpdateObject\022&.google.storage.v2." - + "UpdateObjectRequest\032\031.google.storage.v2." - + "Object\"\025\332A\022object,update_mask\022`\n\013WriteOb" - + "ject\022%.google.storage.v2.WriteObjectRequ" - + "est\032&.google.storage.v2.WriteObjectRespo" - + "nse\"\000(\001\022g\n\013ListObjects\022%.google.storage." - + "v2.ListObjectsRequest\032&.google.storage.v" - + "2.ListObjectsResponse\"\t\332A\006parent\022^\n\rRewr" - + "iteObject\022\'.google.storage.v2.RewriteObj" - + "ectRequest\032\".google.storage.v2.RewriteRe" - + "sponse\"\000\022v\n\023StartResumableWrite\022-.google" - + ".storage.v2.StartResumableWriteRequest\032." - + ".google.storage.v2.StartResumableWriteRe" - + "sponse\"\000\022y\n\020QueryWriteStatus\022*.google.st" - + "orage.v2.QueryWriteStatusRequest\032+.googl" - + "e.storage.v2.QueryWriteStatusResponse\"\014\332" - + "A\tupload_id\022o\n\021GetServiceAccount\022+.googl" - + "e.storage.v2.GetServiceAccountRequest\032!." - + "google.storage.v2.ServiceAccount\"\n\332A\007pro" - + "ject\022\204\001\n\rCreateHmacKey\022\'.google.storage." - + "v2.CreateHmacKeyRequest\032(.google.storage" - + ".v2.CreateHmacKeyResponse\" \332A\035project,se" - + "rvice_account_email\022f\n\rDeleteHmacKey\022\'.g" - + "oogle.storage.v2.DeleteHmacKeyRequest\032\026." - + "google.protobuf.Empty\"\024\332A\021access_id,proj" - + "ect\022l\n\nGetHmacKey\022$.google.storage.v2.Ge" - + "tHmacKeyRequest\032\".google.storage.v2.Hmac" - + "KeyMetadata\"\024\332A\021access_id,project\022k\n\014Lis" - + "tHmacKeys\022&.google.storage.v2.ListHmacKe" - + "ysRequest\032\'.google.storage.v2.ListHmacKe" - + "ysResponse\"\n\332A\007project\022u\n\rUpdateHmacKey\022" - + "\'.google.storage.v2.UpdateHmacKeyRequest" - + "\032\".google.storage.v2.HmacKeyMetadata\"\027\332A" - + "\024hmac_key,update_mask\032\247\002\312A\026storage.googl" - + "eapis.com\322A\212\002https://www.googleapis.com/" - + "auth/cloud-platform,https://www.googleap" - + "is.com/auth/cloud-platform.read-only,htt" - + "ps://www.googleapis.com/auth/devstorage." - + "full_control,https://www.googleapis.com/" - + "auth/devstorage.read_only,https://www.go" - + "ogleapis.com/auth/devstorage.read_writeB" - + "\334\001\n\025com.google.storage.v2B\014StorageProtoP" - + "\001Z8google.golang.org/genproto/googleapis" - + "/storage/v2;storage\352Ax\n!cloudkms.googlea" - + "pis.com/CryptoKey\022Sprojects/{project}/lo" - + "cations/{location}/keyRings/{key_ring}/c" - + "ryptoKeys/{crypto_key}b\006proto3" - }; - descriptor = - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.ClientProto.getDescriptor(), - com.google.api.FieldBehaviorProto.getDescriptor(), - com.google.api.ResourceProto.getDescriptor(), - com.google.iam.v1.IamPolicyProto.getDescriptor(), - com.google.iam.v1.PolicyProto.getDescriptor(), - com.google.protobuf.EmptyProto.getDescriptor(), - com.google.protobuf.FieldMaskProto.getDescriptor(), - com.google.protobuf.TimestampProto.getDescriptor(), - com.google.type.DateProto.getDescriptor(), - }); - internal_static_google_storage_v2_DeleteBucketRequest_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_google_storage_v2_DeleteBucketRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_DeleteBucketRequest_descriptor, - new java.lang.String[] { - "Name", - "IfMetagenerationMatch", - "IfMetagenerationNotMatch", - "CommonRequestParams", - "IfMetagenerationMatch", - "IfMetagenerationNotMatch", - }); - internal_static_google_storage_v2_GetBucketRequest_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_google_storage_v2_GetBucketRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_GetBucketRequest_descriptor, - new java.lang.String[] { - "Name", - "IfMetagenerationMatch", - "IfMetagenerationNotMatch", - "CommonRequestParams", - "ReadMask", - "IfMetagenerationMatch", - "IfMetagenerationNotMatch", - "ReadMask", - }); - internal_static_google_storage_v2_CreateBucketRequest_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_google_storage_v2_CreateBucketRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_CreateBucketRequest_descriptor, - new java.lang.String[] { - "Parent", "Bucket", "BucketId", "PredefinedAcl", "PredefinedDefaultObjectAcl", - }); - internal_static_google_storage_v2_ListBucketsRequest_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_google_storage_v2_ListBucketsRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_ListBucketsRequest_descriptor, - new java.lang.String[] { - "Parent", - "PageSize", - "PageToken", - "Prefix", - "ReadMask", - "CommonRequestParams", - "ReadMask", - }); - internal_static_google_storage_v2_ListBucketsResponse_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_google_storage_v2_ListBucketsResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_ListBucketsResponse_descriptor, - new java.lang.String[] { - "Buckets", "NextPageToken", - }); - internal_static_google_storage_v2_LockBucketRetentionPolicyRequest_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_google_storage_v2_LockBucketRetentionPolicyRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_LockBucketRetentionPolicyRequest_descriptor, - new java.lang.String[] { - "Bucket", "IfMetagenerationMatch", "CommonRequestParams", - }); - internal_static_google_storage_v2_UpdateBucketRequest_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_google_storage_v2_UpdateBucketRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_UpdateBucketRequest_descriptor, - new java.lang.String[] { - "Bucket", - "IfMetagenerationMatch", - "IfMetagenerationNotMatch", - "PredefinedAcl", - "PredefinedDefaultObjectAcl", - "UpdateMask", - "CommonRequestParams", - "IfMetagenerationMatch", - "IfMetagenerationNotMatch", - }); - internal_static_google_storage_v2_DeleteNotificationRequest_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_google_storage_v2_DeleteNotificationRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_DeleteNotificationRequest_descriptor, - new java.lang.String[] { - "Name", - }); - internal_static_google_storage_v2_GetNotificationRequest_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_google_storage_v2_GetNotificationRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_GetNotificationRequest_descriptor, - new java.lang.String[] { - "Name", - }); - internal_static_google_storage_v2_CreateNotificationRequest_descriptor = - getDescriptor().getMessageTypes().get(9); - internal_static_google_storage_v2_CreateNotificationRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_CreateNotificationRequest_descriptor, - new java.lang.String[] { - "Parent", "Notification", - }); - internal_static_google_storage_v2_ListNotificationsRequest_descriptor = - getDescriptor().getMessageTypes().get(10); - internal_static_google_storage_v2_ListNotificationsRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_ListNotificationsRequest_descriptor, - new java.lang.String[] { - "Parent", "PageSize", "PageToken", - }); - internal_static_google_storage_v2_ListNotificationsResponse_descriptor = - getDescriptor().getMessageTypes().get(11); - internal_static_google_storage_v2_ListNotificationsResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_ListNotificationsResponse_descriptor, - new java.lang.String[] { - "Notifications", "NextPageToken", - }); - internal_static_google_storage_v2_ComposeObjectRequest_descriptor = - getDescriptor().getMessageTypes().get(12); - internal_static_google_storage_v2_ComposeObjectRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_ComposeObjectRequest_descriptor, - new java.lang.String[] { - "Destination", - "SourceObjects", - "DestinationPredefinedAcl", - "IfGenerationMatch", - "IfMetagenerationMatch", - "KmsKey", - "CommonObjectRequestParams", - "CommonRequestParams", - "IfGenerationMatch", - "IfMetagenerationMatch", - }); - internal_static_google_storage_v2_ComposeObjectRequest_SourceObject_descriptor = - internal_static_google_storage_v2_ComposeObjectRequest_descriptor.getNestedTypes().get(0); - internal_static_google_storage_v2_ComposeObjectRequest_SourceObject_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_ComposeObjectRequest_SourceObject_descriptor, - new java.lang.String[] { - "Name", "Generation", "ObjectPreconditions", - }); - internal_static_google_storage_v2_ComposeObjectRequest_SourceObject_ObjectPreconditions_descriptor = - internal_static_google_storage_v2_ComposeObjectRequest_SourceObject_descriptor - .getNestedTypes() - .get(0); - internal_static_google_storage_v2_ComposeObjectRequest_SourceObject_ObjectPreconditions_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_ComposeObjectRequest_SourceObject_ObjectPreconditions_descriptor, - new java.lang.String[] { - "IfGenerationMatch", "IfGenerationMatch", - }); - internal_static_google_storage_v2_DeleteObjectRequest_descriptor = - getDescriptor().getMessageTypes().get(13); - internal_static_google_storage_v2_DeleteObjectRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_DeleteObjectRequest_descriptor, - new java.lang.String[] { - "Bucket", - "Object", - "UploadId", - "Generation", - "IfGenerationMatch", - "IfGenerationNotMatch", - "IfMetagenerationMatch", - "IfMetagenerationNotMatch", - "CommonObjectRequestParams", - "CommonRequestParams", - "IfGenerationMatch", - "IfGenerationNotMatch", - "IfMetagenerationMatch", - "IfMetagenerationNotMatch", - }); - internal_static_google_storage_v2_ReadObjectRequest_descriptor = - getDescriptor().getMessageTypes().get(14); - internal_static_google_storage_v2_ReadObjectRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_ReadObjectRequest_descriptor, - new java.lang.String[] { - "Bucket", - "Object", - "Generation", - "ReadOffset", - "ReadLimit", - "IfGenerationMatch", - "IfGenerationNotMatch", - "IfMetagenerationMatch", - "IfMetagenerationNotMatch", - "CommonObjectRequestParams", - "CommonRequestParams", - "ReadMask", - "IfGenerationMatch", - "IfGenerationNotMatch", - "IfMetagenerationMatch", - "IfMetagenerationNotMatch", - "ReadMask", - }); - internal_static_google_storage_v2_GetObjectRequest_descriptor = - getDescriptor().getMessageTypes().get(15); - internal_static_google_storage_v2_GetObjectRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_GetObjectRequest_descriptor, - new java.lang.String[] { - "Bucket", - "Object", - "Generation", - "IfGenerationMatch", - "IfGenerationNotMatch", - "IfMetagenerationMatch", - "IfMetagenerationNotMatch", - "CommonObjectRequestParams", - "CommonRequestParams", - "ReadMask", - "IfGenerationMatch", - "IfGenerationNotMatch", - "IfMetagenerationMatch", - "IfMetagenerationNotMatch", - "ReadMask", - }); - internal_static_google_storage_v2_ReadObjectResponse_descriptor = - getDescriptor().getMessageTypes().get(16); - internal_static_google_storage_v2_ReadObjectResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_ReadObjectResponse_descriptor, - new java.lang.String[] { - "ChecksummedData", "ObjectChecksums", "ContentRange", "Metadata", - }); - internal_static_google_storage_v2_WriteObjectSpec_descriptor = - getDescriptor().getMessageTypes().get(17); - internal_static_google_storage_v2_WriteObjectSpec_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_WriteObjectSpec_descriptor, - new java.lang.String[] { - "Resource", - "PredefinedAcl", - "IfGenerationMatch", - "IfGenerationNotMatch", - "IfMetagenerationMatch", - "IfMetagenerationNotMatch", - "IfGenerationMatch", - "IfGenerationNotMatch", - "IfMetagenerationMatch", - "IfMetagenerationNotMatch", - }); - internal_static_google_storage_v2_WriteObjectRequest_descriptor = - getDescriptor().getMessageTypes().get(18); - internal_static_google_storage_v2_WriteObjectRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_WriteObjectRequest_descriptor, - new java.lang.String[] { - "UploadId", - "WriteObjectSpec", - "WriteOffset", - "ChecksummedData", - "ObjectChecksums", - "FinishWrite", - "CommonObjectRequestParams", - "CommonRequestParams", - "FirstMessage", - "Data", - }); - internal_static_google_storage_v2_WriteObjectResponse_descriptor = - getDescriptor().getMessageTypes().get(19); - 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_ListObjectsRequest_descriptor = - getDescriptor().getMessageTypes().get(20); - internal_static_google_storage_v2_ListObjectsRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_ListObjectsRequest_descriptor, - new java.lang.String[] { - "Parent", - "PageSize", - "PageToken", - "Delimiter", - "IncludeTrailingDelimiter", - "Prefix", - "Versions", - "ReadMask", - "LexicographicStart", - "LexicographicEnd", - "CommonRequestParams", - "ReadMask", - }); - internal_static_google_storage_v2_QueryWriteStatusRequest_descriptor = - getDescriptor().getMessageTypes().get(21); - internal_static_google_storage_v2_QueryWriteStatusRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_QueryWriteStatusRequest_descriptor, - new java.lang.String[] { - "UploadId", "CommonObjectRequestParams", "CommonRequestParams", - }); - internal_static_google_storage_v2_QueryWriteStatusResponse_descriptor = - getDescriptor().getMessageTypes().get(22); - internal_static_google_storage_v2_QueryWriteStatusResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_QueryWriteStatusResponse_descriptor, - new java.lang.String[] { - "PersistedSize", "Resource", "WriteStatus", - }); - internal_static_google_storage_v2_RewriteObjectRequest_descriptor = - getDescriptor().getMessageTypes().get(23); - internal_static_google_storage_v2_RewriteObjectRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_RewriteObjectRequest_descriptor, - new java.lang.String[] { - "DestinationName", - "DestinationBucket", - "DestinationKmsKey", - "Destination", - "SourceBucket", - "SourceObject", - "SourceGeneration", - "RewriteToken", - "DestinationPredefinedAcl", - "IfGenerationMatch", - "IfGenerationNotMatch", - "IfMetagenerationMatch", - "IfMetagenerationNotMatch", - "IfSourceGenerationMatch", - "IfSourceGenerationNotMatch", - "IfSourceMetagenerationMatch", - "IfSourceMetagenerationNotMatch", - "MaxBytesRewrittenPerCall", - "CopySourceEncryptionAlgorithm", - "CopySourceEncryptionKeyBytes", - "CopySourceEncryptionKeySha256Bytes", - "CommonObjectRequestParams", - "CommonRequestParams", - "IfGenerationMatch", - "IfGenerationNotMatch", - "IfMetagenerationMatch", - "IfMetagenerationNotMatch", - "IfSourceGenerationMatch", - "IfSourceGenerationNotMatch", - "IfSourceMetagenerationMatch", - "IfSourceMetagenerationNotMatch", - }); - internal_static_google_storage_v2_RewriteResponse_descriptor = - getDescriptor().getMessageTypes().get(24); - internal_static_google_storage_v2_RewriteResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_RewriteResponse_descriptor, - new java.lang.String[] { - "TotalBytesRewritten", "ObjectSize", "Done", "RewriteToken", "Resource", - }); - internal_static_google_storage_v2_StartResumableWriteRequest_descriptor = - getDescriptor().getMessageTypes().get(25); - internal_static_google_storage_v2_StartResumableWriteRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_StartResumableWriteRequest_descriptor, - new java.lang.String[] { - "WriteObjectSpec", "CommonObjectRequestParams", "CommonRequestParams", - }); - internal_static_google_storage_v2_StartResumableWriteResponse_descriptor = - getDescriptor().getMessageTypes().get(26); - internal_static_google_storage_v2_StartResumableWriteResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_StartResumableWriteResponse_descriptor, - new java.lang.String[] { - "UploadId", - }); - internal_static_google_storage_v2_UpdateObjectRequest_descriptor = - getDescriptor().getMessageTypes().get(27); - internal_static_google_storage_v2_UpdateObjectRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_UpdateObjectRequest_descriptor, - new java.lang.String[] { - "Object", - "IfGenerationMatch", - "IfGenerationNotMatch", - "IfMetagenerationMatch", - "IfMetagenerationNotMatch", - "PredefinedAcl", - "UpdateMask", - "CommonObjectRequestParams", - "CommonRequestParams", - "IfGenerationMatch", - "IfGenerationNotMatch", - "IfMetagenerationMatch", - "IfMetagenerationNotMatch", - }); - internal_static_google_storage_v2_GetServiceAccountRequest_descriptor = - getDescriptor().getMessageTypes().get(28); - internal_static_google_storage_v2_GetServiceAccountRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_GetServiceAccountRequest_descriptor, - new java.lang.String[] { - "Project", "CommonRequestParams", - }); - internal_static_google_storage_v2_CreateHmacKeyRequest_descriptor = - getDescriptor().getMessageTypes().get(29); - internal_static_google_storage_v2_CreateHmacKeyRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_CreateHmacKeyRequest_descriptor, - new java.lang.String[] { - "Project", "ServiceAccountEmail", "CommonRequestParams", - }); - internal_static_google_storage_v2_CreateHmacKeyResponse_descriptor = - getDescriptor().getMessageTypes().get(30); - internal_static_google_storage_v2_CreateHmacKeyResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_CreateHmacKeyResponse_descriptor, - new java.lang.String[] { - "Metadata", "SecretKeyBytes", - }); - internal_static_google_storage_v2_DeleteHmacKeyRequest_descriptor = - getDescriptor().getMessageTypes().get(31); - internal_static_google_storage_v2_DeleteHmacKeyRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_DeleteHmacKeyRequest_descriptor, - new java.lang.String[] { - "AccessId", "Project", "CommonRequestParams", - }); - internal_static_google_storage_v2_GetHmacKeyRequest_descriptor = - getDescriptor().getMessageTypes().get(32); - internal_static_google_storage_v2_GetHmacKeyRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_GetHmacKeyRequest_descriptor, - new java.lang.String[] { - "AccessId", "Project", "CommonRequestParams", - }); - internal_static_google_storage_v2_ListHmacKeysRequest_descriptor = - getDescriptor().getMessageTypes().get(33); - internal_static_google_storage_v2_ListHmacKeysRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_ListHmacKeysRequest_descriptor, - new java.lang.String[] { - "Project", - "PageSize", - "PageToken", - "ServiceAccountEmail", - "ShowDeletedKeys", - "CommonRequestParams", - }); - internal_static_google_storage_v2_ListHmacKeysResponse_descriptor = - getDescriptor().getMessageTypes().get(34); - internal_static_google_storage_v2_ListHmacKeysResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_ListHmacKeysResponse_descriptor, - new java.lang.String[] { - "HmacKeys", "NextPageToken", - }); - internal_static_google_storage_v2_UpdateHmacKeyRequest_descriptor = - getDescriptor().getMessageTypes().get(35); - internal_static_google_storage_v2_UpdateHmacKeyRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_UpdateHmacKeyRequest_descriptor, - new java.lang.String[] { - "HmacKey", "CommonRequestParams", "UpdateMask", - }); - internal_static_google_storage_v2_CommonObjectRequestParams_descriptor = - getDescriptor().getMessageTypes().get(36); - internal_static_google_storage_v2_CommonObjectRequestParams_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_CommonObjectRequestParams_descriptor, - new java.lang.String[] { - "EncryptionAlgorithm", "EncryptionKeyBytes", "EncryptionKeySha256Bytes", - }); - internal_static_google_storage_v2_CommonRequestParams_descriptor = - getDescriptor().getMessageTypes().get(37); - internal_static_google_storage_v2_CommonRequestParams_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_CommonRequestParams_descriptor, - new java.lang.String[] { - "UserProject", - }); - internal_static_google_storage_v2_ServiceConstants_descriptor = - getDescriptor().getMessageTypes().get(38); - 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(39); - internal_static_google_storage_v2_Bucket_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_Bucket_descriptor, - new java.lang.String[] { - "Name", - "BucketId", - "Project", - "Metageneration", - "Location", - "LocationType", - "StorageClass", - "Rpo", - "Acl", - "DefaultObjectAcl", - "Lifecycle", - "CreateTime", - "Cors", - "UpdateTime", - "DefaultEventBasedHold", - "Labels", - "Website", - "Versioning", - "Logging", - "Owner", - "Encryption", - "Billing", - "RetentionPolicy", - "IamConfig", - "SatisfiesPzs", - "CustomPlacementConfig", - }); - internal_static_google_storage_v2_Bucket_Billing_descriptor = - internal_static_google_storage_v2_Bucket_descriptor.getNestedTypes().get(0); - internal_static_google_storage_v2_Bucket_Billing_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_Bucket_Billing_descriptor, - new java.lang.String[] { - "RequesterPays", - }); - internal_static_google_storage_v2_Bucket_Cors_descriptor = - internal_static_google_storage_v2_Bucket_descriptor.getNestedTypes().get(1); - internal_static_google_storage_v2_Bucket_Cors_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_Bucket_Cors_descriptor, - new java.lang.String[] { - "Origin", "Method", "ResponseHeader", "MaxAgeSeconds", - }); - internal_static_google_storage_v2_Bucket_Encryption_descriptor = - internal_static_google_storage_v2_Bucket_descriptor.getNestedTypes().get(2); - internal_static_google_storage_v2_Bucket_Encryption_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_Bucket_Encryption_descriptor, - new java.lang.String[] { - "DefaultKmsKey", - }); - internal_static_google_storage_v2_Bucket_IamConfig_descriptor = - internal_static_google_storage_v2_Bucket_descriptor.getNestedTypes().get(3); - internal_static_google_storage_v2_Bucket_IamConfig_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_Bucket_IamConfig_descriptor, - new java.lang.String[] { - "UniformBucketLevelAccess", "PublicAccessPrevention", - }); - internal_static_google_storage_v2_Bucket_IamConfig_UniformBucketLevelAccess_descriptor = - internal_static_google_storage_v2_Bucket_IamConfig_descriptor.getNestedTypes().get(0); - internal_static_google_storage_v2_Bucket_IamConfig_UniformBucketLevelAccess_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_Bucket_IamConfig_UniformBucketLevelAccess_descriptor, - new java.lang.String[] { - "Enabled", "LockTime", - }); - internal_static_google_storage_v2_Bucket_Lifecycle_descriptor = - internal_static_google_storage_v2_Bucket_descriptor.getNestedTypes().get(4); - internal_static_google_storage_v2_Bucket_Lifecycle_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_Bucket_Lifecycle_descriptor, - new java.lang.String[] { - "Rule", - }); - internal_static_google_storage_v2_Bucket_Lifecycle_Rule_descriptor = - internal_static_google_storage_v2_Bucket_Lifecycle_descriptor.getNestedTypes().get(0); - internal_static_google_storage_v2_Bucket_Lifecycle_Rule_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_Bucket_Lifecycle_Rule_descriptor, - new java.lang.String[] { - "Action", "Condition", - }); - internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Action_descriptor = - internal_static_google_storage_v2_Bucket_Lifecycle_Rule_descriptor.getNestedTypes().get(0); - internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Action_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Action_descriptor, - new java.lang.String[] { - "Type", "StorageClass", - }); - internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Condition_descriptor = - internal_static_google_storage_v2_Bucket_Lifecycle_Rule_descriptor.getNestedTypes().get(1); - internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Condition_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Condition_descriptor, - new java.lang.String[] { - "AgeDays", - "CreatedBefore", - "IsLive", - "NumNewerVersions", - "MatchesStorageClass", - "DaysSinceCustomTime", - "CustomTimeBefore", - "DaysSinceNoncurrentTime", - "NoncurrentTimeBefore", - "AgeDays", - "IsLive", - "NumNewerVersions", - "DaysSinceCustomTime", - "DaysSinceNoncurrentTime", - }); - internal_static_google_storage_v2_Bucket_Logging_descriptor = - internal_static_google_storage_v2_Bucket_descriptor.getNestedTypes().get(5); - internal_static_google_storage_v2_Bucket_Logging_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_Bucket_Logging_descriptor, - new java.lang.String[] { - "LogBucket", "LogObjectPrefix", - }); - internal_static_google_storage_v2_Bucket_RetentionPolicy_descriptor = - internal_static_google_storage_v2_Bucket_descriptor.getNestedTypes().get(6); - internal_static_google_storage_v2_Bucket_RetentionPolicy_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_Bucket_RetentionPolicy_descriptor, - new java.lang.String[] { - "EffectiveTime", "IsLocked", "RetentionPeriod", - }); - internal_static_google_storage_v2_Bucket_Versioning_descriptor = - internal_static_google_storage_v2_Bucket_descriptor.getNestedTypes().get(7); - internal_static_google_storage_v2_Bucket_Versioning_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_Bucket_Versioning_descriptor, - new java.lang.String[] { - "Enabled", - }); - internal_static_google_storage_v2_Bucket_Website_descriptor = - internal_static_google_storage_v2_Bucket_descriptor.getNestedTypes().get(8); - internal_static_google_storage_v2_Bucket_Website_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_Bucket_Website_descriptor, - new java.lang.String[] { - "MainPageSuffix", "NotFoundPage", - }); - internal_static_google_storage_v2_Bucket_CustomPlacementConfig_descriptor = - internal_static_google_storage_v2_Bucket_descriptor.getNestedTypes().get(9); - internal_static_google_storage_v2_Bucket_CustomPlacementConfig_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_Bucket_CustomPlacementConfig_descriptor, - new java.lang.String[] { - "DataLocations", - }); - internal_static_google_storage_v2_Bucket_LabelsEntry_descriptor = - internal_static_google_storage_v2_Bucket_descriptor.getNestedTypes().get(10); - internal_static_google_storage_v2_Bucket_LabelsEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_Bucket_LabelsEntry_descriptor, - new java.lang.String[] { - "Key", "Value", - }); - internal_static_google_storage_v2_BucketAccessControl_descriptor = - getDescriptor().getMessageTypes().get(40); - internal_static_google_storage_v2_BucketAccessControl_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_BucketAccessControl_descriptor, - new java.lang.String[] { - "Role", "Id", "Entity", "EntityId", "Email", "Domain", "ProjectTeam", - }); - internal_static_google_storage_v2_ChecksummedData_descriptor = - getDescriptor().getMessageTypes().get(41); - internal_static_google_storage_v2_ChecksummedData_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_ChecksummedData_descriptor, - new java.lang.String[] { - "Content", "Crc32C", "Crc32C", - }); - internal_static_google_storage_v2_ObjectChecksums_descriptor = - getDescriptor().getMessageTypes().get(42); - internal_static_google_storage_v2_ObjectChecksums_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_ObjectChecksums_descriptor, - new java.lang.String[] { - "Crc32C", "Md5Hash", "Crc32C", - }); - internal_static_google_storage_v2_HmacKeyMetadata_descriptor = - getDescriptor().getMessageTypes().get(43); - internal_static_google_storage_v2_HmacKeyMetadata_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_HmacKeyMetadata_descriptor, - new java.lang.String[] { - "Id", - "AccessId", - "Project", - "ServiceAccountEmail", - "State", - "CreateTime", - "UpdateTime", - }); - internal_static_google_storage_v2_Notification_descriptor = - getDescriptor().getMessageTypes().get(44); - internal_static_google_storage_v2_Notification_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_Notification_descriptor, - new java.lang.String[] { - "Name", - "Topic", - "EventTypes", - "CustomAttributes", - "ObjectNamePrefix", - "PayloadFormat", - }); - internal_static_google_storage_v2_Notification_CustomAttributesEntry_descriptor = - internal_static_google_storage_v2_Notification_descriptor.getNestedTypes().get(0); - internal_static_google_storage_v2_Notification_CustomAttributesEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_Notification_CustomAttributesEntry_descriptor, - new java.lang.String[] { - "Key", "Value", - }); - internal_static_google_storage_v2_CustomerEncryption_descriptor = - getDescriptor().getMessageTypes().get(45); - 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(46); - internal_static_google_storage_v2_Object_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_Object_descriptor, - new java.lang.String[] { - "Name", - "Bucket", - "Generation", - "Metageneration", - "StorageClass", - "Size", - "ContentEncoding", - "ContentDisposition", - "CacheControl", - "Acl", - "ContentLanguage", - "DeleteTime", - "ContentType", - "CreateTime", - "ComponentCount", - "Checksums", - "UpdateTime", - "KmsKey", - "UpdateStorageClassTime", - "TemporaryHold", - "RetentionExpireTime", - "Metadata", - "EventBasedHold", - "Owner", - "CustomerEncryption", - "CustomTime", - "EventBasedHold", - }); - internal_static_google_storage_v2_Object_MetadataEntry_descriptor = - internal_static_google_storage_v2_Object_descriptor.getNestedTypes().get(0); - internal_static_google_storage_v2_Object_MetadataEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_Object_MetadataEntry_descriptor, - new java.lang.String[] { - "Key", "Value", - }); - internal_static_google_storage_v2_ObjectAccessControl_descriptor = - getDescriptor().getMessageTypes().get(47); - internal_static_google_storage_v2_ObjectAccessControl_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_ObjectAccessControl_descriptor, - new java.lang.String[] { - "Role", "Id", "Entity", "EntityId", "Email", "Domain", "ProjectTeam", - }); - internal_static_google_storage_v2_ListObjectsResponse_descriptor = - getDescriptor().getMessageTypes().get(48); - internal_static_google_storage_v2_ListObjectsResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_ListObjectsResponse_descriptor, - new java.lang.String[] { - "Objects", "Prefixes", "NextPageToken", - }); - internal_static_google_storage_v2_ProjectTeam_descriptor = - getDescriptor().getMessageTypes().get(49); - 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_ServiceAccount_descriptor = - getDescriptor().getMessageTypes().get(50); - internal_static_google_storage_v2_ServiceAccount_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_ServiceAccount_descriptor, - new java.lang.String[] { - "EmailAddress", - }); - internal_static_google_storage_v2_Owner_descriptor = getDescriptor().getMessageTypes().get(51); - internal_static_google_storage_v2_Owner_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_Owner_descriptor, - new java.lang.String[] { - "Entity", "EntityId", - }); - internal_static_google_storage_v2_ContentRange_descriptor = - getDescriptor().getMessageTypes().get(52); - internal_static_google_storage_v2_ContentRange_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_ContentRange_descriptor, - new java.lang.String[] { - "Start", "End", "CompleteLength", - }); - com.google.protobuf.ExtensionRegistry registry = - com.google.protobuf.ExtensionRegistry.newInstance(); - registry.add(com.google.api.ClientProto.defaultHost); - registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); - registry.add(com.google.api.ClientProto.methodSignature); - registry.add(com.google.api.ClientProto.oauthScopes); - registry.add(com.google.api.ResourceProto.resource); - registry.add(com.google.api.ResourceProto.resourceDefinition); - registry.add(com.google.api.ResourceProto.resourceReference); - com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( - descriptor, registry); - com.google.api.ClientProto.getDescriptor(); - com.google.api.FieldBehaviorProto.getDescriptor(); - com.google.api.ResourceProto.getDescriptor(); - com.google.iam.v1.IamPolicyProto.getDescriptor(); - com.google.iam.v1.PolicyProto.getDescriptor(); - com.google.protobuf.EmptyProto.getDescriptor(); - com.google.protobuf.FieldMaskProto.getDescriptor(); - com.google.protobuf.TimestampProto.getDescriptor(); - com.google.type.DateProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateBucketRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateBucketRequest.java deleted file mode 100644 index a2cbb063d5..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateBucketRequest.java +++ /dev/null @@ -1,1953 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request for UpdateBucket method.
- * 
- * - * Protobuf type {@code google.storage.v2.UpdateBucketRequest} - */ -public final class UpdateBucketRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.UpdateBucketRequest) - UpdateBucketRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use UpdateBucketRequest.newBuilder() to construct. - private UpdateBucketRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private UpdateBucketRequest() { - predefinedAcl_ = 0; - predefinedDefaultObjectAcl_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new UpdateBucketRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private UpdateBucketRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.storage.v2.Bucket.Builder subBuilder = null; - if (bucket_ != null) { - subBuilder = bucket_.toBuilder(); - } - bucket_ = input.readMessage(com.google.storage.v2.Bucket.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(bucket_); - bucket_ = subBuilder.buildPartial(); - } - - break; - } - case 16: - { - bitField0_ |= 0x00000001; - ifMetagenerationMatch_ = input.readInt64(); - break; - } - case 24: - { - bitField0_ |= 0x00000002; - ifMetagenerationNotMatch_ = input.readInt64(); - break; - } - case 32: - { - int rawValue = input.readEnum(); - - predefinedAcl_ = rawValue; - break; - } - case 40: - { - int rawValue = input.readEnum(); - - predefinedDefaultObjectAcl_ = rawValue; - break; - } - case 50: - { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (updateMask_ != null) { - subBuilder = updateMask_.toBuilder(); - } - updateMask_ = - input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateMask_); - updateMask_ = subBuilder.buildPartial(); - } - - break; - } - case 58: - { - com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; - if (commonRequestParams_ != null) { - subBuilder = commonRequestParams_.toBuilder(); - } - commonRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonRequestParams_); - commonRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_UpdateBucketRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_UpdateBucketRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.UpdateBucketRequest.class, - com.google.storage.v2.UpdateBucketRequest.Builder.class); - } - - private int bitField0_; - public static final int BUCKET_FIELD_NUMBER = 1; - private com.google.storage.v2.Bucket bucket_; - /** - * - * - *
-   * The bucket to update.
-   * The bucket's `name` field will be used to identify the bucket.
-   * 
- * - * .google.storage.v2.Bucket bucket = 1; - * - * @return Whether the bucket field is set. - */ - @java.lang.Override - public boolean hasBucket() { - return bucket_ != null; - } - /** - * - * - *
-   * The bucket to update.
-   * The bucket's `name` field will be used to identify the bucket.
-   * 
- * - * .google.storage.v2.Bucket bucket = 1; - * - * @return The bucket. - */ - @java.lang.Override - public com.google.storage.v2.Bucket getBucket() { - return bucket_ == null ? com.google.storage.v2.Bucket.getDefaultInstance() : bucket_; - } - /** - * - * - *
-   * The bucket to update.
-   * The bucket's `name` field will be used to identify the bucket.
-   * 
- * - * .google.storage.v2.Bucket bucket = 1; - */ - @java.lang.Override - public com.google.storage.v2.BucketOrBuilder getBucketOrBuilder() { - return getBucket(); - } - - public static final int IF_METAGENERATION_MATCH_FIELD_NUMBER = 2; - private long ifMetagenerationMatch_; - /** - * - * - *
-   * If set, will only modify the bucket if its metageneration matches this
-   * value.
-   * 
- * - * optional int64 if_metageneration_match = 2; - * - * @return Whether the ifMetagenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationMatch() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-   * If set, will only modify the bucket if its metageneration matches this
-   * value.
-   * 
- * - * optional int64 if_metageneration_match = 2; - * - * @return The ifMetagenerationMatch. - */ - @java.lang.Override - public long getIfMetagenerationMatch() { - return ifMetagenerationMatch_; - } - - public static final int IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER = 3; - private long ifMetagenerationNotMatch_; - /** - * - * - *
-   * If set, will only modify the bucket if its metageneration does not match
-   * this value.
-   * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @return Whether the ifMetagenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationNotMatch() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-   * If set, will only modify the bucket if its metageneration does not match
-   * this value.
-   * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @return The ifMetagenerationNotMatch. - */ - @java.lang.Override - public long getIfMetagenerationNotMatch() { - return ifMetagenerationNotMatch_; - } - - public static final int PREDEFINED_ACL_FIELD_NUMBER = 4; - private int predefinedAcl_; - /** - * - * - *
-   * Apply a predefined set of access controls to this bucket.
-   * 
- * - * .google.storage.v2.PredefinedBucketAcl predefined_acl = 4; - * - * @return The enum numeric value on the wire for predefinedAcl. - */ - @java.lang.Override - public int getPredefinedAclValue() { - return predefinedAcl_; - } - /** - * - * - *
-   * Apply a predefined set of access controls to this bucket.
-   * 
- * - * .google.storage.v2.PredefinedBucketAcl predefined_acl = 4; - * - * @return The predefinedAcl. - */ - @java.lang.Override - public com.google.storage.v2.PredefinedBucketAcl getPredefinedAcl() { - @SuppressWarnings("deprecation") - com.google.storage.v2.PredefinedBucketAcl result = - com.google.storage.v2.PredefinedBucketAcl.valueOf(predefinedAcl_); - return result == null ? com.google.storage.v2.PredefinedBucketAcl.UNRECOGNIZED : result; - } - - public static final int PREDEFINED_DEFAULT_OBJECT_ACL_FIELD_NUMBER = 5; - private int predefinedDefaultObjectAcl_; - /** - * - * - *
-   * Apply a predefined set of default object access controls to this bucket.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_default_object_acl = 5; - * - * @return The enum numeric value on the wire for predefinedDefaultObjectAcl. - */ - @java.lang.Override - public int getPredefinedDefaultObjectAclValue() { - return predefinedDefaultObjectAcl_; - } - /** - * - * - *
-   * Apply a predefined set of default object access controls to this bucket.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_default_object_acl = 5; - * - * @return The predefinedDefaultObjectAcl. - */ - @java.lang.Override - public com.google.storage.v2.PredefinedObjectAcl getPredefinedDefaultObjectAcl() { - @SuppressWarnings("deprecation") - com.google.storage.v2.PredefinedObjectAcl result = - com.google.storage.v2.PredefinedObjectAcl.valueOf(predefinedDefaultObjectAcl_); - return result == null ? com.google.storage.v2.PredefinedObjectAcl.UNRECOGNIZED : result; - } - - public static final int UPDATE_MASK_FIELD_NUMBER = 6; - private com.google.protobuf.FieldMask updateMask_; - /** - * - * - *
-   * List of fields to be updated.
-   * To specify ALL fields, equivalent to the JSON API's "update" function,
-   * specify a single field with the value `*`. Note: not recommended. If a new
-   * field is introduced at a later time, an older client updating with the `*`
-   * may accidentally reset the new field's value.
-   * Not specifying any fields is an error.
-   * Not specifying a field while setting that field to a non-default value is
-   * an error.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 6; - * - * @return Whether the updateMask field is set. - */ - @java.lang.Override - public boolean hasUpdateMask() { - return updateMask_ != null; - } - /** - * - * - *
-   * List of fields to be updated.
-   * To specify ALL fields, equivalent to the JSON API's "update" function,
-   * specify a single field with the value `*`. Note: not recommended. If a new
-   * field is introduced at a later time, an older client updating with the `*`
-   * may accidentally reset the new field's value.
-   * Not specifying any fields is an error.
-   * Not specifying a field while setting that field to a non-default value is
-   * an error.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 6; - * - * @return The updateMask. - */ - @java.lang.Override - public com.google.protobuf.FieldMask getUpdateMask() { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - /** - * - * - *
-   * List of fields to be updated.
-   * To specify ALL fields, equivalent to the JSON API's "update" function,
-   * specify a single field with the value `*`. Note: not recommended. If a new
-   * field is introduced at a later time, an older client updating with the `*`
-   * may accidentally reset the new field's value.
-   * Not specifying any fields is an error.
-   * Not specifying a field while setting that field to a non-default value is
-   * an error.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 6; - */ - @java.lang.Override - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - return getUpdateMask(); - } - - public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 7; - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 7; - * - * @return Whether the commonRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonRequestParams() { - return commonRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 7; - * - * @return The commonRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 7; - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - return getCommonRequestParams(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (bucket_ != null) { - output.writeMessage(1, getBucket()); - } - if (((bitField0_ & 0x00000001) != 0)) { - output.writeInt64(2, ifMetagenerationMatch_); - } - if (((bitField0_ & 0x00000002) != 0)) { - output.writeInt64(3, ifMetagenerationNotMatch_); - } - if (predefinedAcl_ - != com.google.storage.v2.PredefinedBucketAcl.PREDEFINED_BUCKET_ACL_UNSPECIFIED - .getNumber()) { - output.writeEnum(4, predefinedAcl_); - } - if (predefinedDefaultObjectAcl_ - != com.google.storage.v2.PredefinedObjectAcl.PREDEFINED_OBJECT_ACL_UNSPECIFIED - .getNumber()) { - output.writeEnum(5, predefinedDefaultObjectAcl_); - } - if (updateMask_ != null) { - output.writeMessage(6, getUpdateMask()); - } - if (commonRequestParams_ != null) { - output.writeMessage(7, getCommonRequestParams()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (bucket_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBucket()); - } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, ifMetagenerationMatch_); - } - if (((bitField0_ & 0x00000002) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, ifMetagenerationNotMatch_); - } - if (predefinedAcl_ - != com.google.storage.v2.PredefinedBucketAcl.PREDEFINED_BUCKET_ACL_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, predefinedAcl_); - } - if (predefinedDefaultObjectAcl_ - != com.google.storage.v2.PredefinedObjectAcl.PREDEFINED_OBJECT_ACL_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, predefinedDefaultObjectAcl_); - } - if (updateMask_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getUpdateMask()); - } - if (commonRequestParams_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getCommonRequestParams()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.UpdateBucketRequest)) { - return super.equals(obj); - } - com.google.storage.v2.UpdateBucketRequest other = - (com.google.storage.v2.UpdateBucketRequest) obj; - - if (hasBucket() != other.hasBucket()) return false; - if (hasBucket()) { - if (!getBucket().equals(other.getBucket())) 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 (predefinedAcl_ != other.predefinedAcl_) return false; - if (predefinedDefaultObjectAcl_ != other.predefinedDefaultObjectAcl_) return false; - if (hasUpdateMask() != other.hasUpdateMask()) return false; - if (hasUpdateMask()) { - if (!getUpdateMask().equals(other.getUpdateMask())) return false; - } - if (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; - if (hasCommonRequestParams()) { - if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasBucket()) { - hash = (37 * hash) + BUCKET_FIELD_NUMBER; - hash = (53 * hash) + getBucket().hashCode(); - } - if (hasIfMetagenerationMatch()) { - hash = (37 * hash) + IF_METAGENERATION_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationMatch()); - } - if (hasIfMetagenerationNotMatch()) { - hash = (37 * hash) + IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationNotMatch()); - } - hash = (37 * hash) + PREDEFINED_ACL_FIELD_NUMBER; - hash = (53 * hash) + predefinedAcl_; - hash = (37 * hash) + PREDEFINED_DEFAULT_OBJECT_ACL_FIELD_NUMBER; - hash = (53 * hash) + predefinedDefaultObjectAcl_; - if (hasUpdateMask()) { - hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; - hash = (53 * hash) + getUpdateMask().hashCode(); - } - if (hasCommonRequestParams()) { - hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonRequestParams().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.UpdateBucketRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.UpdateBucketRequest 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.UpdateBucketRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.UpdateBucketRequest 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.UpdateBucketRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.UpdateBucketRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.UpdateBucketRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.UpdateBucketRequest 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.UpdateBucketRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.UpdateBucketRequest 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.UpdateBucketRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.UpdateBucketRequest 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.UpdateBucketRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Request for UpdateBucket method.
-   * 
- * - * Protobuf type {@code google.storage.v2.UpdateBucketRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.UpdateBucketRequest) - com.google.storage.v2.UpdateBucketRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_UpdateBucketRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_UpdateBucketRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.UpdateBucketRequest.class, - com.google.storage.v2.UpdateBucketRequest.Builder.class); - } - - // Construct using com.google.storage.v2.UpdateBucketRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (bucketBuilder_ == null) { - bucket_ = null; - } else { - bucket_ = null; - bucketBuilder_ = null; - } - ifMetagenerationMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000001); - ifMetagenerationNotMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000002); - predefinedAcl_ = 0; - - predefinedDefaultObjectAcl_ = 0; - - if (updateMaskBuilder_ == null) { - updateMask_ = null; - } else { - updateMask_ = null; - updateMaskBuilder_ = null; - } - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_UpdateBucketRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.UpdateBucketRequest getDefaultInstanceForType() { - return com.google.storage.v2.UpdateBucketRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.UpdateBucketRequest build() { - com.google.storage.v2.UpdateBucketRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.UpdateBucketRequest buildPartial() { - com.google.storage.v2.UpdateBucketRequest result = - new com.google.storage.v2.UpdateBucketRequest(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (bucketBuilder_ == null) { - result.bucket_ = bucket_; - } else { - result.bucket_ = bucketBuilder_.build(); - } - if (((from_bitField0_ & 0x00000001) != 0)) { - result.ifMetagenerationMatch_ = ifMetagenerationMatch_; - to_bitField0_ |= 0x00000001; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.ifMetagenerationNotMatch_ = ifMetagenerationNotMatch_; - to_bitField0_ |= 0x00000002; - } - result.predefinedAcl_ = predefinedAcl_; - result.predefinedDefaultObjectAcl_ = predefinedDefaultObjectAcl_; - if (updateMaskBuilder_ == null) { - result.updateMask_ = updateMask_; - } else { - result.updateMask_ = updateMaskBuilder_.build(); - } - if (commonRequestParamsBuilder_ == null) { - result.commonRequestParams_ = commonRequestParams_; - } else { - result.commonRequestParams_ = commonRequestParamsBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.UpdateBucketRequest) { - return mergeFrom((com.google.storage.v2.UpdateBucketRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.UpdateBucketRequest other) { - if (other == com.google.storage.v2.UpdateBucketRequest.getDefaultInstance()) return this; - if (other.hasBucket()) { - mergeBucket(other.getBucket()); - } - if (other.hasIfMetagenerationMatch()) { - setIfMetagenerationMatch(other.getIfMetagenerationMatch()); - } - if (other.hasIfMetagenerationNotMatch()) { - setIfMetagenerationNotMatch(other.getIfMetagenerationNotMatch()); - } - if (other.predefinedAcl_ != 0) { - setPredefinedAclValue(other.getPredefinedAclValue()); - } - if (other.predefinedDefaultObjectAcl_ != 0) { - setPredefinedDefaultObjectAclValue(other.getPredefinedDefaultObjectAclValue()); - } - if (other.hasUpdateMask()) { - mergeUpdateMask(other.getUpdateMask()); - } - if (other.hasCommonRequestParams()) { - mergeCommonRequestParams(other.getCommonRequestParams()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.UpdateBucketRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.UpdateBucketRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private com.google.storage.v2.Bucket bucket_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket, - com.google.storage.v2.Bucket.Builder, - com.google.storage.v2.BucketOrBuilder> - bucketBuilder_; - /** - * - * - *
-     * The bucket to update.
-     * The bucket's `name` field will be used to identify the bucket.
-     * 
- * - * .google.storage.v2.Bucket bucket = 1; - * - * @return Whether the bucket field is set. - */ - public boolean hasBucket() { - return bucketBuilder_ != null || bucket_ != null; - } - /** - * - * - *
-     * The bucket to update.
-     * The bucket's `name` field will be used to identify the bucket.
-     * 
- * - * .google.storage.v2.Bucket bucket = 1; - * - * @return The bucket. - */ - public com.google.storage.v2.Bucket getBucket() { - if (bucketBuilder_ == null) { - return bucket_ == null ? com.google.storage.v2.Bucket.getDefaultInstance() : bucket_; - } else { - return bucketBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The bucket to update.
-     * The bucket's `name` field will be used to identify the bucket.
-     * 
- * - * .google.storage.v2.Bucket bucket = 1; - */ - public Builder setBucket(com.google.storage.v2.Bucket value) { - if (bucketBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - bucket_ = value; - onChanged(); - } else { - bucketBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * The bucket to update.
-     * The bucket's `name` field will be used to identify the bucket.
-     * 
- * - * .google.storage.v2.Bucket bucket = 1; - */ - public Builder setBucket(com.google.storage.v2.Bucket.Builder builderForValue) { - if (bucketBuilder_ == null) { - bucket_ = builderForValue.build(); - onChanged(); - } else { - bucketBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * The bucket to update.
-     * The bucket's `name` field will be used to identify the bucket.
-     * 
- * - * .google.storage.v2.Bucket bucket = 1; - */ - public Builder mergeBucket(com.google.storage.v2.Bucket value) { - if (bucketBuilder_ == null) { - if (bucket_ != null) { - bucket_ = - com.google.storage.v2.Bucket.newBuilder(bucket_).mergeFrom(value).buildPartial(); - } else { - bucket_ = value; - } - onChanged(); - } else { - bucketBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * The bucket to update.
-     * The bucket's `name` field will be used to identify the bucket.
-     * 
- * - * .google.storage.v2.Bucket bucket = 1; - */ - public Builder clearBucket() { - if (bucketBuilder_ == null) { - bucket_ = null; - onChanged(); - } else { - bucket_ = null; - bucketBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * The bucket to update.
-     * The bucket's `name` field will be used to identify the bucket.
-     * 
- * - * .google.storage.v2.Bucket bucket = 1; - */ - public com.google.storage.v2.Bucket.Builder getBucketBuilder() { - - onChanged(); - return getBucketFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The bucket to update.
-     * The bucket's `name` field will be used to identify the bucket.
-     * 
- * - * .google.storage.v2.Bucket bucket = 1; - */ - public com.google.storage.v2.BucketOrBuilder getBucketOrBuilder() { - if (bucketBuilder_ != null) { - return bucketBuilder_.getMessageOrBuilder(); - } else { - return bucket_ == null ? com.google.storage.v2.Bucket.getDefaultInstance() : bucket_; - } - } - /** - * - * - *
-     * The bucket to update.
-     * The bucket's `name` field will be used to identify the bucket.
-     * 
- * - * .google.storage.v2.Bucket bucket = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket, - com.google.storage.v2.Bucket.Builder, - com.google.storage.v2.BucketOrBuilder> - getBucketFieldBuilder() { - if (bucketBuilder_ == null) { - bucketBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Bucket, - com.google.storage.v2.Bucket.Builder, - com.google.storage.v2.BucketOrBuilder>( - getBucket(), getParentForChildren(), isClean()); - bucket_ = null; - } - return bucketBuilder_; - } - - private long ifMetagenerationMatch_; - /** - * - * - *
-     * If set, will only modify the bucket if its metageneration matches this
-     * value.
-     * 
- * - * optional int64 if_metageneration_match = 2; - * - * @return Whether the ifMetagenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationMatch() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-     * If set, will only modify the bucket if its metageneration matches this
-     * value.
-     * 
- * - * optional int64 if_metageneration_match = 2; - * - * @return The ifMetagenerationMatch. - */ - @java.lang.Override - public long getIfMetagenerationMatch() { - return ifMetagenerationMatch_; - } - /** - * - * - *
-     * If set, will only modify the bucket if its metageneration matches this
-     * value.
-     * 
- * - * optional int64 if_metageneration_match = 2; - * - * @param value The ifMetagenerationMatch to set. - * @return This builder for chaining. - */ - public Builder setIfMetagenerationMatch(long value) { - bitField0_ |= 0x00000001; - ifMetagenerationMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If set, will only modify the bucket if its metageneration matches this
-     * value.
-     * 
- * - * optional int64 if_metageneration_match = 2; - * - * @return This builder for chaining. - */ - public Builder clearIfMetagenerationMatch() { - bitField0_ = (bitField0_ & ~0x00000001); - ifMetagenerationMatch_ = 0L; - onChanged(); - return this; - } - - private long ifMetagenerationNotMatch_; - /** - * - * - *
-     * If set, will only modify the bucket if its metageneration does not match
-     * this value.
-     * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @return Whether the ifMetagenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationNotMatch() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-     * If set, will only modify the bucket if its metageneration does not match
-     * this value.
-     * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @return The ifMetagenerationNotMatch. - */ - @java.lang.Override - public long getIfMetagenerationNotMatch() { - return ifMetagenerationNotMatch_; - } - /** - * - * - *
-     * If set, will only modify the bucket if its metageneration does not match
-     * this value.
-     * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @param value The ifMetagenerationNotMatch to set. - * @return This builder for chaining. - */ - public Builder setIfMetagenerationNotMatch(long value) { - bitField0_ |= 0x00000002; - ifMetagenerationNotMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If set, will only modify the bucket if its metageneration does not match
-     * this value.
-     * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @return This builder for chaining. - */ - public Builder clearIfMetagenerationNotMatch() { - bitField0_ = (bitField0_ & ~0x00000002); - ifMetagenerationNotMatch_ = 0L; - onChanged(); - return this; - } - - private int predefinedAcl_ = 0; - /** - * - * - *
-     * Apply a predefined set of access controls to this bucket.
-     * 
- * - * .google.storage.v2.PredefinedBucketAcl predefined_acl = 4; - * - * @return The enum numeric value on the wire for predefinedAcl. - */ - @java.lang.Override - public int getPredefinedAclValue() { - return predefinedAcl_; - } - /** - * - * - *
-     * Apply a predefined set of access controls to this bucket.
-     * 
- * - * .google.storage.v2.PredefinedBucketAcl predefined_acl = 4; - * - * @param value The enum numeric value on the wire for predefinedAcl to set. - * @return This builder for chaining. - */ - public Builder setPredefinedAclValue(int value) { - - predefinedAcl_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Apply a predefined set of access controls to this bucket.
-     * 
- * - * .google.storage.v2.PredefinedBucketAcl predefined_acl = 4; - * - * @return The predefinedAcl. - */ - @java.lang.Override - public com.google.storage.v2.PredefinedBucketAcl getPredefinedAcl() { - @SuppressWarnings("deprecation") - com.google.storage.v2.PredefinedBucketAcl result = - com.google.storage.v2.PredefinedBucketAcl.valueOf(predefinedAcl_); - return result == null ? com.google.storage.v2.PredefinedBucketAcl.UNRECOGNIZED : result; - } - /** - * - * - *
-     * Apply a predefined set of access controls to this bucket.
-     * 
- * - * .google.storage.v2.PredefinedBucketAcl predefined_acl = 4; - * - * @param value The predefinedAcl to set. - * @return This builder for chaining. - */ - public Builder setPredefinedAcl(com.google.storage.v2.PredefinedBucketAcl value) { - if (value == null) { - throw new NullPointerException(); - } - - predefinedAcl_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * Apply a predefined set of access controls to this bucket.
-     * 
- * - * .google.storage.v2.PredefinedBucketAcl predefined_acl = 4; - * - * @return This builder for chaining. - */ - public Builder clearPredefinedAcl() { - - predefinedAcl_ = 0; - onChanged(); - return this; - } - - private int predefinedDefaultObjectAcl_ = 0; - /** - * - * - *
-     * Apply a predefined set of default object access controls to this bucket.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_default_object_acl = 5; - * - * @return The enum numeric value on the wire for predefinedDefaultObjectAcl. - */ - @java.lang.Override - public int getPredefinedDefaultObjectAclValue() { - return predefinedDefaultObjectAcl_; - } - /** - * - * - *
-     * Apply a predefined set of default object access controls to this bucket.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_default_object_acl = 5; - * - * @param value The enum numeric value on the wire for predefinedDefaultObjectAcl to set. - * @return This builder for chaining. - */ - public Builder setPredefinedDefaultObjectAclValue(int value) { - - predefinedDefaultObjectAcl_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Apply a predefined set of default object access controls to this bucket.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_default_object_acl = 5; - * - * @return The predefinedDefaultObjectAcl. - */ - @java.lang.Override - public com.google.storage.v2.PredefinedObjectAcl getPredefinedDefaultObjectAcl() { - @SuppressWarnings("deprecation") - com.google.storage.v2.PredefinedObjectAcl result = - com.google.storage.v2.PredefinedObjectAcl.valueOf(predefinedDefaultObjectAcl_); - return result == null ? com.google.storage.v2.PredefinedObjectAcl.UNRECOGNIZED : result; - } - /** - * - * - *
-     * Apply a predefined set of default object access controls to this bucket.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_default_object_acl = 5; - * - * @param value The predefinedDefaultObjectAcl to set. - * @return This builder for chaining. - */ - public Builder setPredefinedDefaultObjectAcl(com.google.storage.v2.PredefinedObjectAcl value) { - if (value == null) { - throw new NullPointerException(); - } - - predefinedDefaultObjectAcl_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * Apply a predefined set of default object access controls to this bucket.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_default_object_acl = 5; - * - * @return This builder for chaining. - */ - public Builder clearPredefinedDefaultObjectAcl() { - - predefinedDefaultObjectAcl_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.FieldMask updateMask_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder> - updateMaskBuilder_; - /** - * - * - *
-     * List of fields to be updated.
-     * To specify ALL fields, equivalent to the JSON API's "update" function,
-     * specify a single field with the value `*`. Note: not recommended. If a new
-     * field is introduced at a later time, an older client updating with the `*`
-     * may accidentally reset the new field's value.
-     * Not specifying any fields is an error.
-     * Not specifying a field while setting that field to a non-default value is
-     * an error.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 6; - * - * @return Whether the updateMask field is set. - */ - public boolean hasUpdateMask() { - return updateMaskBuilder_ != null || updateMask_ != null; - } - /** - * - * - *
-     * List of fields to be updated.
-     * To specify ALL fields, equivalent to the JSON API's "update" function,
-     * specify a single field with the value `*`. Note: not recommended. If a new
-     * field is introduced at a later time, an older client updating with the `*`
-     * may accidentally reset the new field's value.
-     * Not specifying any fields is an error.
-     * Not specifying a field while setting that field to a non-default value is
-     * an error.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 6; - * - * @return The updateMask. - */ - public com.google.protobuf.FieldMask getUpdateMask() { - if (updateMaskBuilder_ == null) { - return updateMask_ == null - ? com.google.protobuf.FieldMask.getDefaultInstance() - : updateMask_; - } else { - return updateMaskBuilder_.getMessage(); - } - } - /** - * - * - *
-     * List of fields to be updated.
-     * To specify ALL fields, equivalent to the JSON API's "update" function,
-     * specify a single field with the value `*`. Note: not recommended. If a new
-     * field is introduced at a later time, an older client updating with the `*`
-     * may accidentally reset the new field's value.
-     * Not specifying any fields is an error.
-     * Not specifying a field while setting that field to a non-default value is
-     * an error.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 6; - */ - public Builder setUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - updateMask_ = value; - onChanged(); - } else { - updateMaskBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * List of fields to be updated.
-     * To specify ALL fields, equivalent to the JSON API's "update" function,
-     * specify a single field with the value `*`. Note: not recommended. If a new
-     * field is introduced at a later time, an older client updating with the `*`
-     * may accidentally reset the new field's value.
-     * Not specifying any fields is an error.
-     * Not specifying a field while setting that field to a non-default value is
-     * an error.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 6; - */ - public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { - if (updateMaskBuilder_ == null) { - updateMask_ = builderForValue.build(); - onChanged(); - } else { - updateMaskBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * List of fields to be updated.
-     * To specify ALL fields, equivalent to the JSON API's "update" function,
-     * specify a single field with the value `*`. Note: not recommended. If a new
-     * field is introduced at a later time, an older client updating with the `*`
-     * may accidentally reset the new field's value.
-     * Not specifying any fields is an error.
-     * Not specifying a field while setting that field to a non-default value is
-     * an error.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 6; - */ - public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (updateMask_ != null) { - updateMask_ = - com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); - } else { - updateMask_ = value; - } - onChanged(); - } else { - updateMaskBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * List of fields to be updated.
-     * To specify ALL fields, equivalent to the JSON API's "update" function,
-     * specify a single field with the value `*`. Note: not recommended. If a new
-     * field is introduced at a later time, an older client updating with the `*`
-     * may accidentally reset the new field's value.
-     * Not specifying any fields is an error.
-     * Not specifying a field while setting that field to a non-default value is
-     * an error.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 6; - */ - public Builder clearUpdateMask() { - if (updateMaskBuilder_ == null) { - updateMask_ = null; - onChanged(); - } else { - updateMask_ = null; - updateMaskBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * List of fields to be updated.
-     * To specify ALL fields, equivalent to the JSON API's "update" function,
-     * specify a single field with the value `*`. Note: not recommended. If a new
-     * field is introduced at a later time, an older client updating with the `*`
-     * may accidentally reset the new field's value.
-     * Not specifying any fields is an error.
-     * Not specifying a field while setting that field to a non-default value is
-     * an error.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 6; - */ - public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { - - onChanged(); - return getUpdateMaskFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * List of fields to be updated.
-     * To specify ALL fields, equivalent to the JSON API's "update" function,
-     * specify a single field with the value `*`. Note: not recommended. If a new
-     * field is introduced at a later time, an older client updating with the `*`
-     * may accidentally reset the new field's value.
-     * Not specifying any fields is an error.
-     * Not specifying a field while setting that field to a non-default value is
-     * an error.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 6; - */ - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - if (updateMaskBuilder_ != null) { - return updateMaskBuilder_.getMessageOrBuilder(); - } else { - return updateMask_ == null - ? com.google.protobuf.FieldMask.getDefaultInstance() - : updateMask_; - } - } - /** - * - * - *
-     * List of fields to be updated.
-     * To specify ALL fields, equivalent to the JSON API's "update" function,
-     * specify a single field with the value `*`. Note: not recommended. If a new
-     * field is introduced at a later time, an older client updating with the `*`
-     * may accidentally reset the new field's value.
-     * Not specifying any fields is an error.
-     * Not specifying a field while setting that field to a non-default value is
-     * an error.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 6; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder> - getUpdateMaskFieldBuilder() { - if (updateMaskBuilder_ == null) { - updateMaskBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder>( - getUpdateMask(), getParentForChildren(), isClean()); - updateMask_ = null; - } - return updateMaskBuilder_; - } - - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - commonRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 7; - * - * @return Whether the commonRequestParams field is set. - */ - public boolean hasCommonRequestParams() { - return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 7; - * - * @return The commonRequestParams. - */ - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } else { - return commonRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 7; - */ - public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonRequestParams_ = value; - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 7; - */ - public Builder setCommonRequestParams( - com.google.storage.v2.CommonRequestParams.Builder builderForValue) { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 7; - */ - public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (commonRequestParams_ != null) { - commonRequestParams_ = - com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonRequestParams_ = value; - } - onChanged(); - } else { - commonRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 7; - */ - public Builder clearCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - onChanged(); - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 7; - */ - public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { - - onChanged(); - return getCommonRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 7; - */ - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - if (commonRequestParamsBuilder_ != null) { - return commonRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 7; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - getCommonRequestParamsFieldBuilder() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder>( - getCommonRequestParams(), getParentForChildren(), isClean()); - commonRequestParams_ = null; - } - return commonRequestParamsBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.UpdateBucketRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.UpdateBucketRequest) - private static final com.google.storage.v2.UpdateBucketRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.UpdateBucketRequest(); - } - - public static com.google.storage.v2.UpdateBucketRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public UpdateBucketRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdateBucketRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.UpdateBucketRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateBucketRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateBucketRequestOrBuilder.java deleted file mode 100644 index 9aa813a4e9..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateBucketRequestOrBuilder.java +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface UpdateBucketRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.UpdateBucketRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The bucket to update.
-   * The bucket's `name` field will be used to identify the bucket.
-   * 
- * - * .google.storage.v2.Bucket bucket = 1; - * - * @return Whether the bucket field is set. - */ - boolean hasBucket(); - /** - * - * - *
-   * The bucket to update.
-   * The bucket's `name` field will be used to identify the bucket.
-   * 
- * - * .google.storage.v2.Bucket bucket = 1; - * - * @return The bucket. - */ - com.google.storage.v2.Bucket getBucket(); - /** - * - * - *
-   * The bucket to update.
-   * The bucket's `name` field will be used to identify the bucket.
-   * 
- * - * .google.storage.v2.Bucket bucket = 1; - */ - com.google.storage.v2.BucketOrBuilder getBucketOrBuilder(); - - /** - * - * - *
-   * If set, will only modify the bucket if its metageneration matches this
-   * value.
-   * 
- * - * optional int64 if_metageneration_match = 2; - * - * @return Whether the ifMetagenerationMatch field is set. - */ - boolean hasIfMetagenerationMatch(); - /** - * - * - *
-   * If set, will only modify the bucket if its metageneration matches this
-   * value.
-   * 
- * - * optional int64 if_metageneration_match = 2; - * - * @return The ifMetagenerationMatch. - */ - long getIfMetagenerationMatch(); - - /** - * - * - *
-   * If set, will only modify the bucket if its metageneration does not match
-   * this value.
-   * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @return Whether the ifMetagenerationNotMatch field is set. - */ - boolean hasIfMetagenerationNotMatch(); - /** - * - * - *
-   * If set, will only modify the bucket if its metageneration does not match
-   * this value.
-   * 
- * - * optional int64 if_metageneration_not_match = 3; - * - * @return The ifMetagenerationNotMatch. - */ - long getIfMetagenerationNotMatch(); - - /** - * - * - *
-   * Apply a predefined set of access controls to this bucket.
-   * 
- * - * .google.storage.v2.PredefinedBucketAcl predefined_acl = 4; - * - * @return The enum numeric value on the wire for predefinedAcl. - */ - int getPredefinedAclValue(); - /** - * - * - *
-   * Apply a predefined set of access controls to this bucket.
-   * 
- * - * .google.storage.v2.PredefinedBucketAcl predefined_acl = 4; - * - * @return The predefinedAcl. - */ - com.google.storage.v2.PredefinedBucketAcl getPredefinedAcl(); - - /** - * - * - *
-   * Apply a predefined set of default object access controls to this bucket.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_default_object_acl = 5; - * - * @return The enum numeric value on the wire for predefinedDefaultObjectAcl. - */ - int getPredefinedDefaultObjectAclValue(); - /** - * - * - *
-   * Apply a predefined set of default object access controls to this bucket.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_default_object_acl = 5; - * - * @return The predefinedDefaultObjectAcl. - */ - com.google.storage.v2.PredefinedObjectAcl getPredefinedDefaultObjectAcl(); - - /** - * - * - *
-   * List of fields to be updated.
-   * To specify ALL fields, equivalent to the JSON API's "update" function,
-   * specify a single field with the value `*`. Note: not recommended. If a new
-   * field is introduced at a later time, an older client updating with the `*`
-   * may accidentally reset the new field's value.
-   * Not specifying any fields is an error.
-   * Not specifying a field while setting that field to a non-default value is
-   * an error.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 6; - * - * @return Whether the updateMask field is set. - */ - boolean hasUpdateMask(); - /** - * - * - *
-   * List of fields to be updated.
-   * To specify ALL fields, equivalent to the JSON API's "update" function,
-   * specify a single field with the value `*`. Note: not recommended. If a new
-   * field is introduced at a later time, an older client updating with the `*`
-   * may accidentally reset the new field's value.
-   * Not specifying any fields is an error.
-   * Not specifying a field while setting that field to a non-default value is
-   * an error.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 6; - * - * @return The updateMask. - */ - com.google.protobuf.FieldMask getUpdateMask(); - /** - * - * - *
-   * List of fields to be updated.
-   * To specify ALL fields, equivalent to the JSON API's "update" function,
-   * specify a single field with the value `*`. Note: not recommended. If a new
-   * field is introduced at a later time, an older client updating with the `*`
-   * may accidentally reset the new field's value.
-   * Not specifying any fields is an error.
-   * Not specifying a field while setting that field to a non-default value is
-   * an error.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 6; - */ - com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); - - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 7; - * - * @return Whether the commonRequestParams field is set. - */ - boolean hasCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 7; - * - * @return The commonRequestParams. - */ - com.google.storage.v2.CommonRequestParams getCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 7; - */ - com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateHmacKeyRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateHmacKeyRequest.java deleted file mode 100644 index 2d77ae92e4..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateHmacKeyRequest.java +++ /dev/null @@ -1,1339 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request object to update an HMAC key state.
- * 
- * - * Protobuf type {@code google.storage.v2.UpdateHmacKeyRequest} - */ -public final class UpdateHmacKeyRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.UpdateHmacKeyRequest) - UpdateHmacKeyRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use UpdateHmacKeyRequest.newBuilder() to construct. - private UpdateHmacKeyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private UpdateHmacKeyRequest() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new UpdateHmacKeyRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private UpdateHmacKeyRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.storage.v2.HmacKeyMetadata.Builder subBuilder = null; - if (hmacKey_ != null) { - subBuilder = hmacKey_.toBuilder(); - } - hmacKey_ = - input.readMessage( - com.google.storage.v2.HmacKeyMetadata.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(hmacKey_); - hmacKey_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; - if (commonRequestParams_ != null) { - subBuilder = commonRequestParams_.toBuilder(); - } - commonRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonRequestParams_); - commonRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (updateMask_ != null) { - subBuilder = updateMask_.toBuilder(); - } - updateMask_ = - input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateMask_); - updateMask_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_UpdateHmacKeyRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_UpdateHmacKeyRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.UpdateHmacKeyRequest.class, - com.google.storage.v2.UpdateHmacKeyRequest.Builder.class); - } - - public static final int HMAC_KEY_FIELD_NUMBER = 1; - private com.google.storage.v2.HmacKeyMetadata hmacKey_; - /** - * - * - *
-   * Required. The HMAC key to update.
-   * If present, the hmac_key's `id` field will be used to identify the key.
-   * Otherwise, the hmac_key's access_id and project fields will be used to
-   * identify the key.
-   * 
- * - * - * .google.storage.v2.HmacKeyMetadata hmac_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the hmacKey field is set. - */ - @java.lang.Override - public boolean hasHmacKey() { - return hmacKey_ != null; - } - /** - * - * - *
-   * Required. The HMAC key to update.
-   * If present, the hmac_key's `id` field will be used to identify the key.
-   * Otherwise, the hmac_key's access_id and project fields will be used to
-   * identify the key.
-   * 
- * - * - * .google.storage.v2.HmacKeyMetadata hmac_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The hmacKey. - */ - @java.lang.Override - public com.google.storage.v2.HmacKeyMetadata getHmacKey() { - return hmacKey_ == null ? com.google.storage.v2.HmacKeyMetadata.getDefaultInstance() : hmacKey_; - } - /** - * - * - *
-   * Required. The HMAC key to update.
-   * If present, the hmac_key's `id` field will be used to identify the key.
-   * Otherwise, the hmac_key's access_id and project fields will be used to
-   * identify the key.
-   * 
- * - * - * .google.storage.v2.HmacKeyMetadata hmac_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.storage.v2.HmacKeyMetadataOrBuilder getHmacKeyOrBuilder() { - return getHmacKey(); - } - - public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 2; - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - * - * @return Whether the commonRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonRequestParams() { - return commonRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - * - * @return The commonRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - return getCommonRequestParams(); - } - - public static final int UPDATE_MASK_FIELD_NUMBER = 3; - private com.google.protobuf.FieldMask updateMask_; - /** - * - * - *
-   * Update mask for hmac_key.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 3; - * - * @return Whether the updateMask field is set. - */ - @java.lang.Override - public boolean hasUpdateMask() { - return updateMask_ != null; - } - /** - * - * - *
-   * Update mask for hmac_key.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 3; - * - * @return The updateMask. - */ - @java.lang.Override - public com.google.protobuf.FieldMask getUpdateMask() { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - /** - * - * - *
-   * Update mask for hmac_key.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 3; - */ - @java.lang.Override - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - return getUpdateMask(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (hmacKey_ != null) { - output.writeMessage(1, getHmacKey()); - } - if (commonRequestParams_ != null) { - output.writeMessage(2, getCommonRequestParams()); - } - if (updateMask_ != null) { - output.writeMessage(3, getUpdateMask()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (hmacKey_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getHmacKey()); - } - if (commonRequestParams_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCommonRequestParams()); - } - if (updateMask_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateMask()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.UpdateHmacKeyRequest)) { - return super.equals(obj); - } - com.google.storage.v2.UpdateHmacKeyRequest other = - (com.google.storage.v2.UpdateHmacKeyRequest) obj; - - if (hasHmacKey() != other.hasHmacKey()) return false; - if (hasHmacKey()) { - if (!getHmacKey().equals(other.getHmacKey())) return false; - } - if (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; - if (hasCommonRequestParams()) { - if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; - } - if (hasUpdateMask() != other.hasUpdateMask()) return false; - if (hasUpdateMask()) { - if (!getUpdateMask().equals(other.getUpdateMask())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasHmacKey()) { - hash = (37 * hash) + HMAC_KEY_FIELD_NUMBER; - hash = (53 * hash) + getHmacKey().hashCode(); - } - if (hasCommonRequestParams()) { - hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonRequestParams().hashCode(); - } - if (hasUpdateMask()) { - hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; - hash = (53 * hash) + getUpdateMask().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.UpdateHmacKeyRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.UpdateHmacKeyRequest 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.UpdateHmacKeyRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.UpdateHmacKeyRequest 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.UpdateHmacKeyRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.UpdateHmacKeyRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.UpdateHmacKeyRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.UpdateHmacKeyRequest 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.UpdateHmacKeyRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.UpdateHmacKeyRequest 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.UpdateHmacKeyRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.UpdateHmacKeyRequest 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.UpdateHmacKeyRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Request object to update an HMAC key state.
-   * 
- * - * Protobuf type {@code google.storage.v2.UpdateHmacKeyRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.UpdateHmacKeyRequest) - com.google.storage.v2.UpdateHmacKeyRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_UpdateHmacKeyRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_UpdateHmacKeyRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.UpdateHmacKeyRequest.class, - com.google.storage.v2.UpdateHmacKeyRequest.Builder.class); - } - - // Construct using com.google.storage.v2.UpdateHmacKeyRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (hmacKeyBuilder_ == null) { - hmacKey_ = null; - } else { - hmacKey_ = null; - hmacKeyBuilder_ = null; - } - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - if (updateMaskBuilder_ == null) { - updateMask_ = null; - } else { - updateMask_ = null; - updateMaskBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_UpdateHmacKeyRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.UpdateHmacKeyRequest getDefaultInstanceForType() { - return com.google.storage.v2.UpdateHmacKeyRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.UpdateHmacKeyRequest build() { - com.google.storage.v2.UpdateHmacKeyRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.UpdateHmacKeyRequest buildPartial() { - com.google.storage.v2.UpdateHmacKeyRequest result = - new com.google.storage.v2.UpdateHmacKeyRequest(this); - if (hmacKeyBuilder_ == null) { - result.hmacKey_ = hmacKey_; - } else { - result.hmacKey_ = hmacKeyBuilder_.build(); - } - if (commonRequestParamsBuilder_ == null) { - result.commonRequestParams_ = commonRequestParams_; - } else { - result.commonRequestParams_ = commonRequestParamsBuilder_.build(); - } - if (updateMaskBuilder_ == null) { - result.updateMask_ = updateMask_; - } else { - result.updateMask_ = updateMaskBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.UpdateHmacKeyRequest) { - return mergeFrom((com.google.storage.v2.UpdateHmacKeyRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.UpdateHmacKeyRequest other) { - if (other == com.google.storage.v2.UpdateHmacKeyRequest.getDefaultInstance()) return this; - if (other.hasHmacKey()) { - mergeHmacKey(other.getHmacKey()); - } - if (other.hasCommonRequestParams()) { - mergeCommonRequestParams(other.getCommonRequestParams()); - } - if (other.hasUpdateMask()) { - mergeUpdateMask(other.getUpdateMask()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.UpdateHmacKeyRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.UpdateHmacKeyRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.storage.v2.HmacKeyMetadata hmacKey_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.HmacKeyMetadata, - com.google.storage.v2.HmacKeyMetadata.Builder, - com.google.storage.v2.HmacKeyMetadataOrBuilder> - hmacKeyBuilder_; - /** - * - * - *
-     * Required. The HMAC key to update.
-     * If present, the hmac_key's `id` field will be used to identify the key.
-     * Otherwise, the hmac_key's access_id and project fields will be used to
-     * identify the key.
-     * 
- * - * - * .google.storage.v2.HmacKeyMetadata hmac_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the hmacKey field is set. - */ - public boolean hasHmacKey() { - return hmacKeyBuilder_ != null || hmacKey_ != null; - } - /** - * - * - *
-     * Required. The HMAC key to update.
-     * If present, the hmac_key's `id` field will be used to identify the key.
-     * Otherwise, the hmac_key's access_id and project fields will be used to
-     * identify the key.
-     * 
- * - * - * .google.storage.v2.HmacKeyMetadata hmac_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The hmacKey. - */ - public com.google.storage.v2.HmacKeyMetadata getHmacKey() { - if (hmacKeyBuilder_ == null) { - return hmacKey_ == null - ? com.google.storage.v2.HmacKeyMetadata.getDefaultInstance() - : hmacKey_; - } else { - return hmacKeyBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. The HMAC key to update.
-     * If present, the hmac_key's `id` field will be used to identify the key.
-     * Otherwise, the hmac_key's access_id and project fields will be used to
-     * identify the key.
-     * 
- * - * - * .google.storage.v2.HmacKeyMetadata hmac_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setHmacKey(com.google.storage.v2.HmacKeyMetadata value) { - if (hmacKeyBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - hmacKey_ = value; - onChanged(); - } else { - hmacKeyBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. The HMAC key to update.
-     * If present, the hmac_key's `id` field will be used to identify the key.
-     * Otherwise, the hmac_key's access_id and project fields will be used to
-     * identify the key.
-     * 
- * - * - * .google.storage.v2.HmacKeyMetadata hmac_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setHmacKey(com.google.storage.v2.HmacKeyMetadata.Builder builderForValue) { - if (hmacKeyBuilder_ == null) { - hmacKey_ = builderForValue.build(); - onChanged(); - } else { - hmacKeyBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. The HMAC key to update.
-     * If present, the hmac_key's `id` field will be used to identify the key.
-     * Otherwise, the hmac_key's access_id and project fields will be used to
-     * identify the key.
-     * 
- * - * - * .google.storage.v2.HmacKeyMetadata hmac_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeHmacKey(com.google.storage.v2.HmacKeyMetadata value) { - if (hmacKeyBuilder_ == null) { - if (hmacKey_ != null) { - hmacKey_ = - com.google.storage.v2.HmacKeyMetadata.newBuilder(hmacKey_) - .mergeFrom(value) - .buildPartial(); - } else { - hmacKey_ = value; - } - onChanged(); - } else { - hmacKeyBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. The HMAC key to update.
-     * If present, the hmac_key's `id` field will be used to identify the key.
-     * Otherwise, the hmac_key's access_id and project fields will be used to
-     * identify the key.
-     * 
- * - * - * .google.storage.v2.HmacKeyMetadata hmac_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearHmacKey() { - if (hmacKeyBuilder_ == null) { - hmacKey_ = null; - onChanged(); - } else { - hmacKey_ = null; - hmacKeyBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. The HMAC key to update.
-     * If present, the hmac_key's `id` field will be used to identify the key.
-     * Otherwise, the hmac_key's access_id and project fields will be used to
-     * identify the key.
-     * 
- * - * - * .google.storage.v2.HmacKeyMetadata hmac_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.storage.v2.HmacKeyMetadata.Builder getHmacKeyBuilder() { - - onChanged(); - return getHmacKeyFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. The HMAC key to update.
-     * If present, the hmac_key's `id` field will be used to identify the key.
-     * Otherwise, the hmac_key's access_id and project fields will be used to
-     * identify the key.
-     * 
- * - * - * .google.storage.v2.HmacKeyMetadata hmac_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.storage.v2.HmacKeyMetadataOrBuilder getHmacKeyOrBuilder() { - if (hmacKeyBuilder_ != null) { - return hmacKeyBuilder_.getMessageOrBuilder(); - } else { - return hmacKey_ == null - ? com.google.storage.v2.HmacKeyMetadata.getDefaultInstance() - : hmacKey_; - } - } - /** - * - * - *
-     * Required. The HMAC key to update.
-     * If present, the hmac_key's `id` field will be used to identify the key.
-     * Otherwise, the hmac_key's access_id and project fields will be used to
-     * identify the key.
-     * 
- * - * - * .google.storage.v2.HmacKeyMetadata hmac_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.HmacKeyMetadata, - com.google.storage.v2.HmacKeyMetadata.Builder, - com.google.storage.v2.HmacKeyMetadataOrBuilder> - getHmacKeyFieldBuilder() { - if (hmacKeyBuilder_ == null) { - hmacKeyBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.HmacKeyMetadata, - com.google.storage.v2.HmacKeyMetadata.Builder, - com.google.storage.v2.HmacKeyMetadataOrBuilder>( - getHmacKey(), getParentForChildren(), isClean()); - hmacKey_ = null; - } - return hmacKeyBuilder_; - } - - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - commonRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - * - * @return Whether the commonRequestParams field is set. - */ - public boolean hasCommonRequestParams() { - return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - * - * @return The commonRequestParams. - */ - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } else { - return commonRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - */ - public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonRequestParams_ = value; - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - */ - public Builder setCommonRequestParams( - com.google.storage.v2.CommonRequestParams.Builder builderForValue) { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - */ - public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (commonRequestParams_ != null) { - commonRequestParams_ = - com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonRequestParams_ = value; - } - onChanged(); - } else { - commonRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - */ - public Builder clearCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - onChanged(); - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - */ - public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { - - onChanged(); - return getCommonRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - */ - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - if (commonRequestParamsBuilder_ != null) { - return commonRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - getCommonRequestParamsFieldBuilder() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder>( - getCommonRequestParams(), getParentForChildren(), isClean()); - commonRequestParams_ = null; - } - return commonRequestParamsBuilder_; - } - - private com.google.protobuf.FieldMask updateMask_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder> - updateMaskBuilder_; - /** - * - * - *
-     * Update mask for hmac_key.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 3; - * - * @return Whether the updateMask field is set. - */ - public boolean hasUpdateMask() { - return updateMaskBuilder_ != null || updateMask_ != null; - } - /** - * - * - *
-     * Update mask for hmac_key.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 3; - * - * @return The updateMask. - */ - public com.google.protobuf.FieldMask getUpdateMask() { - if (updateMaskBuilder_ == null) { - return updateMask_ == null - ? com.google.protobuf.FieldMask.getDefaultInstance() - : updateMask_; - } else { - return updateMaskBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Update mask for hmac_key.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 3; - */ - public Builder setUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - updateMask_ = value; - onChanged(); - } else { - updateMaskBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Update mask for hmac_key.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 3; - */ - public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { - if (updateMaskBuilder_ == null) { - updateMask_ = builderForValue.build(); - onChanged(); - } else { - updateMaskBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Update mask for hmac_key.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 3; - */ - public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (updateMask_ != null) { - updateMask_ = - com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); - } else { - updateMask_ = value; - } - onChanged(); - } else { - updateMaskBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Update mask for hmac_key.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 3; - */ - public Builder clearUpdateMask() { - if (updateMaskBuilder_ == null) { - updateMask_ = null; - onChanged(); - } else { - updateMask_ = null; - updateMaskBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Update mask for hmac_key.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 3; - */ - public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { - - onChanged(); - return getUpdateMaskFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Update mask for hmac_key.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 3; - */ - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - if (updateMaskBuilder_ != null) { - return updateMaskBuilder_.getMessageOrBuilder(); - } else { - return updateMask_ == null - ? com.google.protobuf.FieldMask.getDefaultInstance() - : updateMask_; - } - } - /** - * - * - *
-     * Update mask for hmac_key.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder> - getUpdateMaskFieldBuilder() { - if (updateMaskBuilder_ == null) { - updateMaskBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder>( - getUpdateMask(), getParentForChildren(), isClean()); - updateMask_ = null; - } - return updateMaskBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.UpdateHmacKeyRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.UpdateHmacKeyRequest) - private static final com.google.storage.v2.UpdateHmacKeyRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.UpdateHmacKeyRequest(); - } - - public static com.google.storage.v2.UpdateHmacKeyRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public UpdateHmacKeyRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdateHmacKeyRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.UpdateHmacKeyRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateHmacKeyRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateHmacKeyRequestOrBuilder.java deleted file mode 100644 index f2749f5591..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateHmacKeyRequestOrBuilder.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface UpdateHmacKeyRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.UpdateHmacKeyRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The HMAC key to update.
-   * If present, the hmac_key's `id` field will be used to identify the key.
-   * Otherwise, the hmac_key's access_id and project fields will be used to
-   * identify the key.
-   * 
- * - * - * .google.storage.v2.HmacKeyMetadata hmac_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the hmacKey field is set. - */ - boolean hasHmacKey(); - /** - * - * - *
-   * Required. The HMAC key to update.
-   * If present, the hmac_key's `id` field will be used to identify the key.
-   * Otherwise, the hmac_key's access_id and project fields will be used to
-   * identify the key.
-   * 
- * - * - * .google.storage.v2.HmacKeyMetadata hmac_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The hmacKey. - */ - com.google.storage.v2.HmacKeyMetadata getHmacKey(); - /** - * - * - *
-   * Required. The HMAC key to update.
-   * If present, the hmac_key's `id` field will be used to identify the key.
-   * Otherwise, the hmac_key's access_id and project fields will be used to
-   * identify the key.
-   * 
- * - * - * .google.storage.v2.HmacKeyMetadata hmac_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.storage.v2.HmacKeyMetadataOrBuilder getHmacKeyOrBuilder(); - - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - * - * @return Whether the commonRequestParams field is set. - */ - boolean hasCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - * - * @return The commonRequestParams. - */ - com.google.storage.v2.CommonRequestParams getCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 2; - */ - com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); - - /** - * - * - *
-   * Update mask for hmac_key.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 3; - * - * @return Whether the updateMask field is set. - */ - boolean hasUpdateMask(); - /** - * - * - *
-   * Update mask for hmac_key.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 3; - * - * @return The updateMask. - */ - com.google.protobuf.FieldMask getUpdateMask(); - /** - * - * - *
-   * Update mask for hmac_key.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 3; - */ - com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateObjectRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateObjectRequest.java deleted file mode 100644 index 88393c393d..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateObjectRequest.java +++ /dev/null @@ -1,2409 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request message for UpdateObject.
- * 
- * - * Protobuf type {@code google.storage.v2.UpdateObjectRequest} - */ -public final class UpdateObjectRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.UpdateObjectRequest) - UpdateObjectRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use UpdateObjectRequest.newBuilder() to construct. - private UpdateObjectRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private UpdateObjectRequest() { - predefinedAcl_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new UpdateObjectRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private UpdateObjectRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.storage.v2.Object.Builder subBuilder = null; - if (object_ != null) { - subBuilder = object_.toBuilder(); - } - object_ = input.readMessage(com.google.storage.v2.Object.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(object_); - object_ = subBuilder.buildPartial(); - } - - break; - } - case 16: - { - bitField0_ |= 0x00000001; - ifGenerationMatch_ = input.readInt64(); - break; - } - case 24: - { - bitField0_ |= 0x00000002; - ifGenerationNotMatch_ = input.readInt64(); - break; - } - case 32: - { - bitField0_ |= 0x00000004; - ifMetagenerationMatch_ = input.readInt64(); - break; - } - case 40: - { - bitField0_ |= 0x00000008; - ifMetagenerationNotMatch_ = input.readInt64(); - break; - } - case 48: - { - int rawValue = input.readEnum(); - - predefinedAcl_ = rawValue; - break; - } - case 58: - { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (updateMask_ != null) { - subBuilder = updateMask_.toBuilder(); - } - updateMask_ = - input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateMask_); - updateMask_ = subBuilder.buildPartial(); - } - - break; - } - case 66: - { - com.google.storage.v2.CommonObjectRequestParams.Builder subBuilder = null; - if (commonObjectRequestParams_ != null) { - subBuilder = commonObjectRequestParams_.toBuilder(); - } - commonObjectRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonObjectRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonObjectRequestParams_); - commonObjectRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - case 74: - { - com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; - if (commonRequestParams_ != null) { - subBuilder = commonRequestParams_.toBuilder(); - } - commonRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonRequestParams_); - commonRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_UpdateObjectRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_UpdateObjectRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.UpdateObjectRequest.class, - com.google.storage.v2.UpdateObjectRequest.Builder.class); - } - - private int bitField0_; - public static final int OBJECT_FIELD_NUMBER = 1; - private com.google.storage.v2.Object object_; - /** - * - * - *
-   * The object to update.
-   * The object's bucket and name fields are used to identify the object to
-   * update. If present, the object's generation field selects a specific
-   * revision of this object whose metadata should be updated. Otherwise,
-   * assumes the current, live version of the object.
-   * 
- * - * .google.storage.v2.Object object = 1; - * - * @return Whether the object field is set. - */ - @java.lang.Override - public boolean hasObject() { - return object_ != null; - } - /** - * - * - *
-   * The object to update.
-   * The object's bucket and name fields are used to identify the object to
-   * update. If present, the object's generation field selects a specific
-   * revision of this object whose metadata should be updated. Otherwise,
-   * assumes the current, live version of the object.
-   * 
- * - * .google.storage.v2.Object object = 1; - * - * @return The object. - */ - @java.lang.Override - public com.google.storage.v2.Object getObject() { - return object_ == null ? com.google.storage.v2.Object.getDefaultInstance() : object_; - } - /** - * - * - *
-   * The object to update.
-   * The object's bucket and name fields are used to identify the object to
-   * update. If present, the object's generation field selects a specific
-   * revision of this object whose metadata should be updated. Otherwise,
-   * assumes the current, live version of the object.
-   * 
- * - * .google.storage.v2.Object object = 1; - */ - @java.lang.Override - public com.google.storage.v2.ObjectOrBuilder getObjectOrBuilder() { - return getObject(); - } - - public static final int IF_GENERATION_MATCH_FIELD_NUMBER = 2; - 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 = 2; - * - * @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 = 2; - * - * @return The ifGenerationMatch. - */ - @java.lang.Override - public long getIfGenerationMatch() { - return ifGenerationMatch_; - } - - public static final int IF_GENERATION_NOT_MATCH_FIELD_NUMBER = 3; - private long ifGenerationNotMatch_; - /** - * - * - *
-   * Makes the operation conditional on whether the object's current generation
-   * does not match the given value. If no live object exists, the precondition
-   * fails. Setting to 0 makes the operation succeed only if there is a live
-   * version of the object.
-   * 
- * - * optional int64 if_generation_not_match = 3; - * - * @return Whether the ifGenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfGenerationNotMatch() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-   * Makes the operation conditional on whether the object's current generation
-   * does not match the given value. If no live object exists, the precondition
-   * fails. Setting to 0 makes the operation succeed only if there is a live
-   * version of the object.
-   * 
- * - * optional int64 if_generation_not_match = 3; - * - * @return The ifGenerationNotMatch. - */ - @java.lang.Override - public long getIfGenerationNotMatch() { - return ifGenerationNotMatch_; - } - - public static final int IF_METAGENERATION_MATCH_FIELD_NUMBER = 4; - 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_ & 0x00000004) != 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_; - /** - * - * - *
-   * 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_ & 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 = 5; - * - * @return The ifMetagenerationNotMatch. - */ - @java.lang.Override - public long getIfMetagenerationNotMatch() { - return ifMetagenerationNotMatch_; - } - - public static final int PREDEFINED_ACL_FIELD_NUMBER = 6; - private int predefinedAcl_; - /** - * - * - *
-   * Apply a predefined set of access controls to this object.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_acl = 6; - * - * @return The enum numeric value on the wire for predefinedAcl. - */ - @java.lang.Override - public int getPredefinedAclValue() { - return predefinedAcl_; - } - /** - * - * - *
-   * Apply a predefined set of access controls to this object.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_acl = 6; - * - * @return The predefinedAcl. - */ - @java.lang.Override - public com.google.storage.v2.PredefinedObjectAcl getPredefinedAcl() { - @SuppressWarnings("deprecation") - com.google.storage.v2.PredefinedObjectAcl result = - com.google.storage.v2.PredefinedObjectAcl.valueOf(predefinedAcl_); - return result == null ? com.google.storage.v2.PredefinedObjectAcl.UNRECOGNIZED : result; - } - - public static final int UPDATE_MASK_FIELD_NUMBER = 7; - private com.google.protobuf.FieldMask updateMask_; - /** - * - * - *
-   * List of fields to be updated.
-   * To specify ALL fields, equivalent to the JSON API's "update" function,
-   * specify a single field with the value `*`. Note: not recommended. If a new
-   * field is introduced at a later time, an older client updating with the `*`
-   * may accidentally reset the new field's value.
-   * Not specifying any fields is an error.
-   * Not specifying a field while setting that field to a non-default value is
-   * an error.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 7; - * - * @return Whether the updateMask field is set. - */ - @java.lang.Override - public boolean hasUpdateMask() { - return updateMask_ != null; - } - /** - * - * - *
-   * List of fields to be updated.
-   * To specify ALL fields, equivalent to the JSON API's "update" function,
-   * specify a single field with the value `*`. Note: not recommended. If a new
-   * field is introduced at a later time, an older client updating with the `*`
-   * may accidentally reset the new field's value.
-   * Not specifying any fields is an error.
-   * Not specifying a field while setting that field to a non-default value is
-   * an error.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 7; - * - * @return The updateMask. - */ - @java.lang.Override - public com.google.protobuf.FieldMask getUpdateMask() { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - /** - * - * - *
-   * List of fields to be updated.
-   * To specify ALL fields, equivalent to the JSON API's "update" function,
-   * specify a single field with the value `*`. Note: not recommended. If a new
-   * field is introduced at a later time, an older client updating with the `*`
-   * may accidentally reset the new field's value.
-   * Not specifying any fields is an error.
-   * Not specifying a field while setting that field to a non-default value is
-   * an error.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 7; - */ - @java.lang.Override - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - return getUpdateMask(); - } - - public static final int COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER = 8; - private com.google.storage.v2.CommonObjectRequestParams commonObjectRequestParams_; - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - * - * @return Whether the commonObjectRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonObjectRequestParams() { - return commonObjectRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - * - * @return The commonObjectRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { - return commonObjectRequestParams_ == null - ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() - : commonObjectRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - @java.lang.Override - public com.google.storage.v2.CommonObjectRequestParamsOrBuilder - getCommonObjectRequestParamsOrBuilder() { - return getCommonObjectRequestParams(); - } - - public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 9; - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return Whether the commonRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonRequestParams() { - return commonRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return The commonRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - return getCommonRequestParams(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (object_ != null) { - output.writeMessage(1, getObject()); - } - if (((bitField0_ & 0x00000001) != 0)) { - output.writeInt64(2, ifGenerationMatch_); - } - if (((bitField0_ & 0x00000002) != 0)) { - output.writeInt64(3, ifGenerationNotMatch_); - } - if (((bitField0_ & 0x00000004) != 0)) { - output.writeInt64(4, ifMetagenerationMatch_); - } - if (((bitField0_ & 0x00000008) != 0)) { - output.writeInt64(5, ifMetagenerationNotMatch_); - } - if (predefinedAcl_ - != com.google.storage.v2.PredefinedObjectAcl.PREDEFINED_OBJECT_ACL_UNSPECIFIED - .getNumber()) { - output.writeEnum(6, predefinedAcl_); - } - if (updateMask_ != null) { - output.writeMessage(7, getUpdateMask()); - } - if (commonObjectRequestParams_ != null) { - output.writeMessage(8, getCommonObjectRequestParams()); - } - if (commonRequestParams_ != null) { - output.writeMessage(9, getCommonRequestParams()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (object_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getObject()); - } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, ifGenerationMatch_); - } - if (((bitField0_ & 0x00000002) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, ifGenerationNotMatch_); - } - if (((bitField0_ & 0x00000004) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, ifMetagenerationMatch_); - } - if (((bitField0_ & 0x00000008) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, ifMetagenerationNotMatch_); - } - if (predefinedAcl_ - != com.google.storage.v2.PredefinedObjectAcl.PREDEFINED_OBJECT_ACL_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, predefinedAcl_); - } - if (updateMask_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getUpdateMask()); - } - if (commonObjectRequestParams_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 8, getCommonObjectRequestParams()); - } - if (commonRequestParams_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getCommonRequestParams()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.UpdateObjectRequest)) { - return super.equals(obj); - } - com.google.storage.v2.UpdateObjectRequest other = - (com.google.storage.v2.UpdateObjectRequest) obj; - - if (hasObject() != other.hasObject()) return false; - if (hasObject()) { - if (!getObject().equals(other.getObject())) 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 (predefinedAcl_ != other.predefinedAcl_) return false; - if (hasUpdateMask() != other.hasUpdateMask()) return false; - if (hasUpdateMask()) { - if (!getUpdateMask().equals(other.getUpdateMask())) return false; - } - if (hasCommonObjectRequestParams() != other.hasCommonObjectRequestParams()) return false; - if (hasCommonObjectRequestParams()) { - if (!getCommonObjectRequestParams().equals(other.getCommonObjectRequestParams())) - return false; - } - if (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; - if (hasCommonRequestParams()) { - if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasObject()) { - hash = (37 * hash) + OBJECT_FIELD_NUMBER; - hash = (53 * hash) + getObject().hashCode(); - } - if (hasIfGenerationMatch()) { - hash = (37 * hash) + IF_GENERATION_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfGenerationMatch()); - } - if (hasIfGenerationNotMatch()) { - hash = (37 * hash) + IF_GENERATION_NOT_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfGenerationNotMatch()); - } - if (hasIfMetagenerationMatch()) { - hash = (37 * hash) + IF_METAGENERATION_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationMatch()); - } - if (hasIfMetagenerationNotMatch()) { - hash = (37 * hash) + IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationNotMatch()); - } - hash = (37 * hash) + PREDEFINED_ACL_FIELD_NUMBER; - hash = (53 * hash) + predefinedAcl_; - if (hasUpdateMask()) { - hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; - hash = (53 * hash) + getUpdateMask().hashCode(); - } - if (hasCommonObjectRequestParams()) { - hash = (37 * hash) + COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonObjectRequestParams().hashCode(); - } - if (hasCommonRequestParams()) { - hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonRequestParams().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.UpdateObjectRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.UpdateObjectRequest 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.UpdateObjectRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.UpdateObjectRequest 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.UpdateObjectRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.UpdateObjectRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.UpdateObjectRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.UpdateObjectRequest 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.UpdateObjectRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.UpdateObjectRequest 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.UpdateObjectRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.UpdateObjectRequest 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.UpdateObjectRequest 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 UpdateObject.
-   * 
- * - * Protobuf type {@code google.storage.v2.UpdateObjectRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.UpdateObjectRequest) - com.google.storage.v2.UpdateObjectRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_UpdateObjectRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_UpdateObjectRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.UpdateObjectRequest.class, - com.google.storage.v2.UpdateObjectRequest.Builder.class); - } - - // Construct using com.google.storage.v2.UpdateObjectRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (objectBuilder_ == null) { - object_ = null; - } else { - object_ = null; - objectBuilder_ = null; - } - ifGenerationMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000001); - ifGenerationNotMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000002); - ifMetagenerationMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000004); - ifMetagenerationNotMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000008); - predefinedAcl_ = 0; - - if (updateMaskBuilder_ == null) { - updateMask_ = null; - } else { - updateMask_ = null; - updateMaskBuilder_ = null; - } - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = null; - } else { - commonObjectRequestParams_ = null; - commonObjectRequestParamsBuilder_ = null; - } - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_UpdateObjectRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.UpdateObjectRequest getDefaultInstanceForType() { - return com.google.storage.v2.UpdateObjectRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.UpdateObjectRequest build() { - com.google.storage.v2.UpdateObjectRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.UpdateObjectRequest buildPartial() { - com.google.storage.v2.UpdateObjectRequest result = - new com.google.storage.v2.UpdateObjectRequest(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (objectBuilder_ == null) { - result.object_ = object_; - } else { - result.object_ = objectBuilder_.build(); - } - if (((from_bitField0_ & 0x00000001) != 0)) { - result.ifGenerationMatch_ = ifGenerationMatch_; - to_bitField0_ |= 0x00000001; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.ifGenerationNotMatch_ = ifGenerationNotMatch_; - to_bitField0_ |= 0x00000002; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.ifMetagenerationMatch_ = ifMetagenerationMatch_; - to_bitField0_ |= 0x00000004; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.ifMetagenerationNotMatch_ = ifMetagenerationNotMatch_; - to_bitField0_ |= 0x00000008; - } - result.predefinedAcl_ = predefinedAcl_; - if (updateMaskBuilder_ == null) { - result.updateMask_ = updateMask_; - } else { - result.updateMask_ = updateMaskBuilder_.build(); - } - if (commonObjectRequestParamsBuilder_ == null) { - result.commonObjectRequestParams_ = commonObjectRequestParams_; - } else { - result.commonObjectRequestParams_ = commonObjectRequestParamsBuilder_.build(); - } - if (commonRequestParamsBuilder_ == null) { - result.commonRequestParams_ = commonRequestParams_; - } else { - result.commonRequestParams_ = commonRequestParamsBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.UpdateObjectRequest) { - return mergeFrom((com.google.storage.v2.UpdateObjectRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.UpdateObjectRequest other) { - if (other == com.google.storage.v2.UpdateObjectRequest.getDefaultInstance()) return this; - if (other.hasObject()) { - mergeObject(other.getObject()); - } - 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.predefinedAcl_ != 0) { - setPredefinedAclValue(other.getPredefinedAclValue()); - } - if (other.hasUpdateMask()) { - mergeUpdateMask(other.getUpdateMask()); - } - if (other.hasCommonObjectRequestParams()) { - mergeCommonObjectRequestParams(other.getCommonObjectRequestParams()); - } - if (other.hasCommonRequestParams()) { - mergeCommonRequestParams(other.getCommonRequestParams()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.UpdateObjectRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.UpdateObjectRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private com.google.storage.v2.Object object_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder> - objectBuilder_; - /** - * - * - *
-     * The object to update.
-     * The object's bucket and name fields are used to identify the object to
-     * update. If present, the object's generation field selects a specific
-     * revision of this object whose metadata should be updated. Otherwise,
-     * assumes the current, live version of the object.
-     * 
- * - * .google.storage.v2.Object object = 1; - * - * @return Whether the object field is set. - */ - public boolean hasObject() { - return objectBuilder_ != null || object_ != null; - } - /** - * - * - *
-     * The object to update.
-     * The object's bucket and name fields are used to identify the object to
-     * update. If present, the object's generation field selects a specific
-     * revision of this object whose metadata should be updated. Otherwise,
-     * assumes the current, live version of the object.
-     * 
- * - * .google.storage.v2.Object object = 1; - * - * @return The object. - */ - public com.google.storage.v2.Object getObject() { - if (objectBuilder_ == null) { - return object_ == null ? com.google.storage.v2.Object.getDefaultInstance() : object_; - } else { - return objectBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The object to update.
-     * The object's bucket and name fields are used to identify the object to
-     * update. If present, the object's generation field selects a specific
-     * revision of this object whose metadata should be updated. Otherwise,
-     * assumes the current, live version of the object.
-     * 
- * - * .google.storage.v2.Object object = 1; - */ - public Builder setObject(com.google.storage.v2.Object value) { - if (objectBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - object_ = value; - onChanged(); - } else { - objectBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * The object to update.
-     * The object's bucket and name fields are used to identify the object to
-     * update. If present, the object's generation field selects a specific
-     * revision of this object whose metadata should be updated. Otherwise,
-     * assumes the current, live version of the object.
-     * 
- * - * .google.storage.v2.Object object = 1; - */ - public Builder setObject(com.google.storage.v2.Object.Builder builderForValue) { - if (objectBuilder_ == null) { - object_ = builderForValue.build(); - onChanged(); - } else { - objectBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * The object to update.
-     * The object's bucket and name fields are used to identify the object to
-     * update. If present, the object's generation field selects a specific
-     * revision of this object whose metadata should be updated. Otherwise,
-     * assumes the current, live version of the object.
-     * 
- * - * .google.storage.v2.Object object = 1; - */ - public Builder mergeObject(com.google.storage.v2.Object value) { - if (objectBuilder_ == null) { - if (object_ != null) { - object_ = - com.google.storage.v2.Object.newBuilder(object_).mergeFrom(value).buildPartial(); - } else { - object_ = value; - } - onChanged(); - } else { - objectBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * The object to update.
-     * The object's bucket and name fields are used to identify the object to
-     * update. If present, the object's generation field selects a specific
-     * revision of this object whose metadata should be updated. Otherwise,
-     * assumes the current, live version of the object.
-     * 
- * - * .google.storage.v2.Object object = 1; - */ - public Builder clearObject() { - if (objectBuilder_ == null) { - object_ = null; - onChanged(); - } else { - object_ = null; - objectBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * The object to update.
-     * The object's bucket and name fields are used to identify the object to
-     * update. If present, the object's generation field selects a specific
-     * revision of this object whose metadata should be updated. Otherwise,
-     * assumes the current, live version of the object.
-     * 
- * - * .google.storage.v2.Object object = 1; - */ - public com.google.storage.v2.Object.Builder getObjectBuilder() { - - onChanged(); - return getObjectFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The object to update.
-     * The object's bucket and name fields are used to identify the object to
-     * update. If present, the object's generation field selects a specific
-     * revision of this object whose metadata should be updated. Otherwise,
-     * assumes the current, live version of the object.
-     * 
- * - * .google.storage.v2.Object object = 1; - */ - public com.google.storage.v2.ObjectOrBuilder getObjectOrBuilder() { - if (objectBuilder_ != null) { - return objectBuilder_.getMessageOrBuilder(); - } else { - return object_ == null ? com.google.storage.v2.Object.getDefaultInstance() : object_; - } - } - /** - * - * - *
-     * The object to update.
-     * The object's bucket and name fields are used to identify the object to
-     * update. If present, the object's generation field selects a specific
-     * revision of this object whose metadata should be updated. Otherwise,
-     * assumes the current, live version of the object.
-     * 
- * - * .google.storage.v2.Object object = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder> - getObjectFieldBuilder() { - if (objectBuilder_ == null) { - objectBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder>( - getObject(), getParentForChildren(), isClean()); - object_ = null; - } - return objectBuilder_; - } - - 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 = 2; - * - * @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 = 2; - * - * @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 = 2; - * - * @param value The ifGenerationMatch to set. - * @return This builder for chaining. - */ - public Builder setIfGenerationMatch(long value) { - bitField0_ |= 0x00000001; - ifGenerationMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * matches the given value. Setting to 0 makes the operation succeed only if
-     * there are no live versions of the object.
-     * 
- * - * optional int64 if_generation_match = 2; - * - * @return This builder for chaining. - */ - public Builder clearIfGenerationMatch() { - bitField0_ = (bitField0_ & ~0x00000001); - ifGenerationMatch_ = 0L; - onChanged(); - return this; - } - - private long ifGenerationNotMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * does not match the given value. If no live object exists, the precondition
-     * fails. Setting to 0 makes the operation succeed only if there is a live
-     * version of the object.
-     * 
- * - * optional int64 if_generation_not_match = 3; - * - * @return Whether the ifGenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfGenerationNotMatch() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * does not match the given value. If no live object exists, the precondition
-     * fails. Setting to 0 makes the operation succeed only if there is a live
-     * version of the object.
-     * 
- * - * optional int64 if_generation_not_match = 3; - * - * @return The ifGenerationNotMatch. - */ - @java.lang.Override - public long getIfGenerationNotMatch() { - return ifGenerationNotMatch_; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * does not match the given value. If no live object exists, the precondition
-     * fails. Setting to 0 makes the operation succeed only if there is a live
-     * version of the object.
-     * 
- * - * optional int64 if_generation_not_match = 3; - * - * @param value The ifGenerationNotMatch to set. - * @return This builder for chaining. - */ - public Builder setIfGenerationNotMatch(long value) { - bitField0_ |= 0x00000002; - ifGenerationNotMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current generation
-     * does not match the given value. If no live object exists, the precondition
-     * fails. Setting to 0 makes the operation succeed only if there is a live
-     * version of the object.
-     * 
- * - * optional int64 if_generation_not_match = 3; - * - * @return This builder for chaining. - */ - public Builder clearIfGenerationNotMatch() { - bitField0_ = (bitField0_ & ~0x00000002); - ifGenerationNotMatch_ = 0L; - onChanged(); - return this; - } - - private long ifMetagenerationMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration matches the given value.
-     * 
- * - * optional int64 if_metageneration_match = 4; - * - * @return Whether the ifMetagenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationMatch() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * - * - *
-     * Makes the operation 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) { - bitField0_ |= 0x00000004; - ifMetagenerationMatch_ = value; - 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_ & ~0x00000004); - ifMetagenerationMatch_ = 0L; - onChanged(); - return this; - } - - private long ifMetagenerationNotMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration does not match the given value.
-     * 
- * - * optional int64 if_metageneration_not_match = 5; - * - * @return Whether the ifMetagenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationNotMatch() { - return ((bitField0_ & 0x00000008) != 0); - } - /** - * - * - *
-     * Makes the operation 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) { - bitField0_ |= 0x00000008; - ifMetagenerationNotMatch_ = value; - 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_ & ~0x00000008); - ifMetagenerationNotMatch_ = 0L; - onChanged(); - return this; - } - - private int predefinedAcl_ = 0; - /** - * - * - *
-     * Apply a predefined set of access controls to this object.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_acl = 6; - * - * @return The enum numeric value on the wire for predefinedAcl. - */ - @java.lang.Override - public int getPredefinedAclValue() { - return predefinedAcl_; - } - /** - * - * - *
-     * Apply a predefined set of access controls to this object.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_acl = 6; - * - * @param value The enum numeric value on the wire for predefinedAcl to set. - * @return This builder for chaining. - */ - public Builder setPredefinedAclValue(int value) { - - predefinedAcl_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Apply a predefined set of access controls to this object.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_acl = 6; - * - * @return The predefinedAcl. - */ - @java.lang.Override - public com.google.storage.v2.PredefinedObjectAcl getPredefinedAcl() { - @SuppressWarnings("deprecation") - com.google.storage.v2.PredefinedObjectAcl result = - com.google.storage.v2.PredefinedObjectAcl.valueOf(predefinedAcl_); - return result == null ? com.google.storage.v2.PredefinedObjectAcl.UNRECOGNIZED : result; - } - /** - * - * - *
-     * Apply a predefined set of access controls to this object.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_acl = 6; - * - * @param value The predefinedAcl to set. - * @return This builder for chaining. - */ - public Builder setPredefinedAcl(com.google.storage.v2.PredefinedObjectAcl value) { - if (value == null) { - throw new NullPointerException(); - } - - predefinedAcl_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * Apply a predefined set of access controls to this object.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_acl = 6; - * - * @return This builder for chaining. - */ - public Builder clearPredefinedAcl() { - - predefinedAcl_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.FieldMask updateMask_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder> - updateMaskBuilder_; - /** - * - * - *
-     * List of fields to be updated.
-     * To specify ALL fields, equivalent to the JSON API's "update" function,
-     * specify a single field with the value `*`. Note: not recommended. If a new
-     * field is introduced at a later time, an older client updating with the `*`
-     * may accidentally reset the new field's value.
-     * Not specifying any fields is an error.
-     * Not specifying a field while setting that field to a non-default value is
-     * an error.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 7; - * - * @return Whether the updateMask field is set. - */ - public boolean hasUpdateMask() { - return updateMaskBuilder_ != null || updateMask_ != null; - } - /** - * - * - *
-     * List of fields to be updated.
-     * To specify ALL fields, equivalent to the JSON API's "update" function,
-     * specify a single field with the value `*`. Note: not recommended. If a new
-     * field is introduced at a later time, an older client updating with the `*`
-     * may accidentally reset the new field's value.
-     * Not specifying any fields is an error.
-     * Not specifying a field while setting that field to a non-default value is
-     * an error.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 7; - * - * @return The updateMask. - */ - public com.google.protobuf.FieldMask getUpdateMask() { - if (updateMaskBuilder_ == null) { - return updateMask_ == null - ? com.google.protobuf.FieldMask.getDefaultInstance() - : updateMask_; - } else { - return updateMaskBuilder_.getMessage(); - } - } - /** - * - * - *
-     * List of fields to be updated.
-     * To specify ALL fields, equivalent to the JSON API's "update" function,
-     * specify a single field with the value `*`. Note: not recommended. If a new
-     * field is introduced at a later time, an older client updating with the `*`
-     * may accidentally reset the new field's value.
-     * Not specifying any fields is an error.
-     * Not specifying a field while setting that field to a non-default value is
-     * an error.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 7; - */ - public Builder setUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - updateMask_ = value; - onChanged(); - } else { - updateMaskBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * List of fields to be updated.
-     * To specify ALL fields, equivalent to the JSON API's "update" function,
-     * specify a single field with the value `*`. Note: not recommended. If a new
-     * field is introduced at a later time, an older client updating with the `*`
-     * may accidentally reset the new field's value.
-     * Not specifying any fields is an error.
-     * Not specifying a field while setting that field to a non-default value is
-     * an error.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 7; - */ - public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { - if (updateMaskBuilder_ == null) { - updateMask_ = builderForValue.build(); - onChanged(); - } else { - updateMaskBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * List of fields to be updated.
-     * To specify ALL fields, equivalent to the JSON API's "update" function,
-     * specify a single field with the value `*`. Note: not recommended. If a new
-     * field is introduced at a later time, an older client updating with the `*`
-     * may accidentally reset the new field's value.
-     * Not specifying any fields is an error.
-     * Not specifying a field while setting that field to a non-default value is
-     * an error.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 7; - */ - public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (updateMask_ != null) { - updateMask_ = - com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); - } else { - updateMask_ = value; - } - onChanged(); - } else { - updateMaskBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * List of fields to be updated.
-     * To specify ALL fields, equivalent to the JSON API's "update" function,
-     * specify a single field with the value `*`. Note: not recommended. If a new
-     * field is introduced at a later time, an older client updating with the `*`
-     * may accidentally reset the new field's value.
-     * Not specifying any fields is an error.
-     * Not specifying a field while setting that field to a non-default value is
-     * an error.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 7; - */ - public Builder clearUpdateMask() { - if (updateMaskBuilder_ == null) { - updateMask_ = null; - onChanged(); - } else { - updateMask_ = null; - updateMaskBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * List of fields to be updated.
-     * To specify ALL fields, equivalent to the JSON API's "update" function,
-     * specify a single field with the value `*`. Note: not recommended. If a new
-     * field is introduced at a later time, an older client updating with the `*`
-     * may accidentally reset the new field's value.
-     * Not specifying any fields is an error.
-     * Not specifying a field while setting that field to a non-default value is
-     * an error.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 7; - */ - public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { - - onChanged(); - return getUpdateMaskFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * List of fields to be updated.
-     * To specify ALL fields, equivalent to the JSON API's "update" function,
-     * specify a single field with the value `*`. Note: not recommended. If a new
-     * field is introduced at a later time, an older client updating with the `*`
-     * may accidentally reset the new field's value.
-     * Not specifying any fields is an error.
-     * Not specifying a field while setting that field to a non-default value is
-     * an error.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 7; - */ - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - if (updateMaskBuilder_ != null) { - return updateMaskBuilder_.getMessageOrBuilder(); - } else { - return updateMask_ == null - ? com.google.protobuf.FieldMask.getDefaultInstance() - : updateMask_; - } - } - /** - * - * - *
-     * List of fields to be updated.
-     * To specify ALL fields, equivalent to the JSON API's "update" function,
-     * specify a single field with the value `*`. Note: not recommended. If a new
-     * field is introduced at a later time, an older client updating with the `*`
-     * may accidentally reset the new field's value.
-     * Not specifying any fields is an error.
-     * Not specifying a field while setting that field to a non-default value is
-     * an error.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 7; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder> - getUpdateMaskFieldBuilder() { - if (updateMaskBuilder_ == null) { - updateMaskBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder>( - getUpdateMask(), getParentForChildren(), isClean()); - updateMask_ = null; - } - return updateMaskBuilder_; - } - - private com.google.storage.v2.CommonObjectRequestParams commonObjectRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder> - commonObjectRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - * - * @return Whether the commonObjectRequestParams field is set. - */ - public boolean hasCommonObjectRequestParams() { - return commonObjectRequestParamsBuilder_ != null || commonObjectRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - * - * @return The commonObjectRequestParams. - */ - public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { - if (commonObjectRequestParamsBuilder_ == null) { - return commonObjectRequestParams_ == null - ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() - : commonObjectRequestParams_; - } else { - return commonObjectRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - public Builder setCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams value) { - if (commonObjectRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonObjectRequestParams_ = value; - onChanged(); - } else { - commonObjectRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - public Builder setCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams.Builder builderForValue) { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonObjectRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - public Builder mergeCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams value) { - if (commonObjectRequestParamsBuilder_ == null) { - if (commonObjectRequestParams_ != null) { - commonObjectRequestParams_ = - com.google.storage.v2.CommonObjectRequestParams.newBuilder(commonObjectRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonObjectRequestParams_ = value; - } - onChanged(); - } else { - commonObjectRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - public Builder clearCommonObjectRequestParams() { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = null; - onChanged(); - } else { - commonObjectRequestParams_ = null; - commonObjectRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - public com.google.storage.v2.CommonObjectRequestParams.Builder - getCommonObjectRequestParamsBuilder() { - - onChanged(); - return getCommonObjectRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - public com.google.storage.v2.CommonObjectRequestParamsOrBuilder - getCommonObjectRequestParamsOrBuilder() { - if (commonObjectRequestParamsBuilder_ != null) { - return commonObjectRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonObjectRequestParams_ == null - ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() - : commonObjectRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder> - getCommonObjectRequestParamsFieldBuilder() { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder>( - getCommonObjectRequestParams(), getParentForChildren(), isClean()); - commonObjectRequestParams_ = null; - } - return commonObjectRequestParamsBuilder_; - } - - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - commonRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return Whether the commonRequestParams field is set. - */ - public boolean hasCommonRequestParams() { - return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return The commonRequestParams. - */ - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } else { - return commonRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonRequestParams_ = value; - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public Builder setCommonRequestParams( - com.google.storage.v2.CommonRequestParams.Builder builderForValue) { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (commonRequestParams_ != null) { - commonRequestParams_ = - com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonRequestParams_ = value; - } - onChanged(); - } else { - commonRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public Builder clearCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - onChanged(); - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { - - onChanged(); - return getCommonRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - if (commonRequestParamsBuilder_ != null) { - return commonRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - getCommonRequestParamsFieldBuilder() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder>( - getCommonRequestParams(), getParentForChildren(), isClean()); - commonRequestParams_ = null; - } - return commonRequestParamsBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.UpdateObjectRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.UpdateObjectRequest) - private static final com.google.storage.v2.UpdateObjectRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.UpdateObjectRequest(); - } - - public static com.google.storage.v2.UpdateObjectRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public UpdateObjectRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdateObjectRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.UpdateObjectRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateObjectRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateObjectRequestOrBuilder.java deleted file mode 100644 index 4433f2dcf3..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/UpdateObjectRequestOrBuilder.java +++ /dev/null @@ -1,337 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface UpdateObjectRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.UpdateObjectRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The object to update.
-   * The object's bucket and name fields are used to identify the object to
-   * update. If present, the object's generation field selects a specific
-   * revision of this object whose metadata should be updated. Otherwise,
-   * assumes the current, live version of the object.
-   * 
- * - * .google.storage.v2.Object object = 1; - * - * @return Whether the object field is set. - */ - boolean hasObject(); - /** - * - * - *
-   * The object to update.
-   * The object's bucket and name fields are used to identify the object to
-   * update. If present, the object's generation field selects a specific
-   * revision of this object whose metadata should be updated. Otherwise,
-   * assumes the current, live version of the object.
-   * 
- * - * .google.storage.v2.Object object = 1; - * - * @return The object. - */ - com.google.storage.v2.Object getObject(); - /** - * - * - *
-   * The object to update.
-   * The object's bucket and name fields are used to identify the object to
-   * update. If present, the object's generation field selects a specific
-   * revision of this object whose metadata should be updated. Otherwise,
-   * assumes the current, live version of the object.
-   * 
- * - * .google.storage.v2.Object object = 1; - */ - com.google.storage.v2.ObjectOrBuilder getObjectOrBuilder(); - - /** - * - * - *
-   * 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 = 2; - * - * @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 = 2; - * - * @return The ifGenerationMatch. - */ - long getIfGenerationMatch(); - - /** - * - * - *
-   * Makes the operation conditional on whether the object's current generation
-   * does not match the given value. If no live object exists, the precondition
-   * fails. Setting to 0 makes the operation succeed only if there is a live
-   * version of the object.
-   * 
- * - * optional int64 if_generation_not_match = 3; - * - * @return Whether the ifGenerationNotMatch field is set. - */ - boolean hasIfGenerationNotMatch(); - /** - * - * - *
-   * Makes the operation conditional on whether the object's current generation
-   * does not match the given value. If no live object exists, the precondition
-   * fails. Setting to 0 makes the operation succeed only if there is a live
-   * version of the object.
-   * 
- * - * optional int64 if_generation_not_match = 3; - * - * @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 = 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(); - - /** - * - * - *
-   * Apply a predefined set of access controls to this object.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_acl = 6; - * - * @return The enum numeric value on the wire for predefinedAcl. - */ - int getPredefinedAclValue(); - /** - * - * - *
-   * Apply a predefined set of access controls to this object.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_acl = 6; - * - * @return The predefinedAcl. - */ - com.google.storage.v2.PredefinedObjectAcl getPredefinedAcl(); - - /** - * - * - *
-   * List of fields to be updated.
-   * To specify ALL fields, equivalent to the JSON API's "update" function,
-   * specify a single field with the value `*`. Note: not recommended. If a new
-   * field is introduced at a later time, an older client updating with the `*`
-   * may accidentally reset the new field's value.
-   * Not specifying any fields is an error.
-   * Not specifying a field while setting that field to a non-default value is
-   * an error.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 7; - * - * @return Whether the updateMask field is set. - */ - boolean hasUpdateMask(); - /** - * - * - *
-   * List of fields to be updated.
-   * To specify ALL fields, equivalent to the JSON API's "update" function,
-   * specify a single field with the value `*`. Note: not recommended. If a new
-   * field is introduced at a later time, an older client updating with the `*`
-   * may accidentally reset the new field's value.
-   * Not specifying any fields is an error.
-   * Not specifying a field while setting that field to a non-default value is
-   * an error.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 7; - * - * @return The updateMask. - */ - com.google.protobuf.FieldMask getUpdateMask(); - /** - * - * - *
-   * List of fields to be updated.
-   * To specify ALL fields, equivalent to the JSON API's "update" function,
-   * specify a single field with the value `*`. Note: not recommended. If a new
-   * field is introduced at a later time, an older client updating with the `*`
-   * may accidentally reset the new field's value.
-   * Not specifying any fields is an error.
-   * Not specifying a field while setting that field to a non-default value is
-   * an error.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 7; - */ - com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); - - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - * - * @return Whether the commonObjectRequestParams field is set. - */ - boolean hasCommonObjectRequestParams(); - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - * - * @return The commonObjectRequestParams. - */ - com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams(); - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - com.google.storage.v2.CommonObjectRequestParamsOrBuilder getCommonObjectRequestParamsOrBuilder(); - - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return Whether the commonRequestParams field is set. - */ - boolean hasCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return The commonRequestParams. - */ - com.google.storage.v2.CommonRequestParams getCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequest.java deleted file mode 100644 index d7ec58b074..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequest.java +++ /dev/null @@ -1,2592 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Request message for WriteObject.
- * 
- * - * Protobuf type {@code google.storage.v2.WriteObjectRequest} - */ -public final class WriteObjectRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.WriteObjectRequest) - WriteObjectRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use WriteObjectRequest.newBuilder() to construct. - private WriteObjectRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private WriteObjectRequest() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new WriteObjectRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private WriteObjectRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - firstMessageCase_ = 1; - firstMessage_ = s; - break; - } - case 18: - { - com.google.storage.v2.WriteObjectSpec.Builder subBuilder = null; - if (firstMessageCase_ == 2) { - subBuilder = ((com.google.storage.v2.WriteObjectSpec) firstMessage_).toBuilder(); - } - firstMessage_ = - input.readMessage( - com.google.storage.v2.WriteObjectSpec.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.storage.v2.WriteObjectSpec) firstMessage_); - firstMessage_ = subBuilder.buildPartial(); - } - firstMessageCase_ = 2; - break; - } - case 24: - { - writeOffset_ = input.readInt64(); - break; - } - case 34: - { - com.google.storage.v2.ChecksummedData.Builder subBuilder = null; - if (dataCase_ == 4) { - subBuilder = ((com.google.storage.v2.ChecksummedData) data_).toBuilder(); - } - data_ = - input.readMessage( - com.google.storage.v2.ChecksummedData.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.storage.v2.ChecksummedData) data_); - data_ = subBuilder.buildPartial(); - } - dataCase_ = 4; - break; - } - case 50: - { - com.google.storage.v2.ObjectChecksums.Builder subBuilder = null; - if (objectChecksums_ != null) { - subBuilder = objectChecksums_.toBuilder(); - } - objectChecksums_ = - input.readMessage( - com.google.storage.v2.ObjectChecksums.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(objectChecksums_); - objectChecksums_ = subBuilder.buildPartial(); - } - - break; - } - case 56: - { - finishWrite_ = input.readBool(); - break; - } - case 66: - { - com.google.storage.v2.CommonObjectRequestParams.Builder subBuilder = null; - if (commonObjectRequestParams_ != null) { - subBuilder = commonObjectRequestParams_.toBuilder(); - } - commonObjectRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonObjectRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonObjectRequestParams_); - commonObjectRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - case 74: - { - com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; - if (commonRequestParams_ != null) { - subBuilder = commonRequestParams_.toBuilder(); - } - commonRequestParams_ = - input.readMessage( - com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commonRequestParams_); - commonRequestParams_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_WriteObjectRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_WriteObjectRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.WriteObjectRequest.class, - com.google.storage.v2.WriteObjectRequest.Builder.class); - } - - private int firstMessageCase_ = 0; - private java.lang.Object firstMessage_; - - public enum FirstMessageCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - UPLOAD_ID(1), - WRITE_OBJECT_SPEC(2), - FIRSTMESSAGE_NOT_SET(0); - private final int value; - - private FirstMessageCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static FirstMessageCase valueOf(int value) { - return forNumber(value); - } - - public static FirstMessageCase forNumber(int value) { - switch (value) { - case 1: - return UPLOAD_ID; - case 2: - return WRITE_OBJECT_SPEC; - case 0: - return FIRSTMESSAGE_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public FirstMessageCase getFirstMessageCase() { - return FirstMessageCase.forNumber(firstMessageCase_); - } - - private int dataCase_ = 0; - private java.lang.Object data_; - - public enum DataCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - CHECKSUMMED_DATA(4), - DATA_NOT_SET(0); - private final int value; - - private DataCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static DataCase valueOf(int value) { - return forNumber(value); - } - - public static DataCase forNumber(int value) { - switch (value) { - case 4: - return CHECKSUMMED_DATA; - case 0: - return DATA_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public DataCase getDataCase() { - return DataCase.forNumber(dataCase_); - } - - public static final int UPLOAD_ID_FIELD_NUMBER = 1; - /** - * - * - *
-   * For resumable uploads. This should be the `upload_id` returned from a
-   * call to `StartResumableWriteResponse`.
-   * 
- * - * string upload_id = 1; - * - * @return Whether the uploadId field is set. - */ - public boolean hasUploadId() { - return firstMessageCase_ == 1; - } - /** - * - * - *
-   * For resumable uploads. This should be the `upload_id` returned from a
-   * call to `StartResumableWriteResponse`.
-   * 
- * - * string upload_id = 1; - * - * @return The uploadId. - */ - public java.lang.String getUploadId() { - java.lang.Object ref = ""; - if (firstMessageCase_ == 1) { - ref = firstMessage_; - } - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (firstMessageCase_ == 1) { - firstMessage_ = s; - } - return s; - } - } - /** - * - * - *
-   * For resumable uploads. This should be the `upload_id` returned from a
-   * call to `StartResumableWriteResponse`.
-   * 
- * - * string upload_id = 1; - * - * @return The bytes for uploadId. - */ - public com.google.protobuf.ByteString getUploadIdBytes() { - java.lang.Object ref = ""; - if (firstMessageCase_ == 1) { - ref = firstMessage_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - if (firstMessageCase_ == 1) { - firstMessage_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int WRITE_OBJECT_SPEC_FIELD_NUMBER = 2; - /** - * - * - *
-   * For non-resumable uploads. Describes the overall upload, including the
-   * destination bucket and object name, preconditions, etc.
-   * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 2; - * - * @return Whether the writeObjectSpec field is set. - */ - @java.lang.Override - public boolean hasWriteObjectSpec() { - return firstMessageCase_ == 2; - } - /** - * - * - *
-   * For non-resumable uploads. Describes the overall upload, including the
-   * destination bucket and object name, preconditions, etc.
-   * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 2; - * - * @return The writeObjectSpec. - */ - @java.lang.Override - public com.google.storage.v2.WriteObjectSpec getWriteObjectSpec() { - if (firstMessageCase_ == 2) { - return (com.google.storage.v2.WriteObjectSpec) firstMessage_; - } - return com.google.storage.v2.WriteObjectSpec.getDefaultInstance(); - } - /** - * - * - *
-   * For non-resumable uploads. Describes the overall upload, including the
-   * destination bucket and object name, preconditions, etc.
-   * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 2; - */ - @java.lang.Override - public com.google.storage.v2.WriteObjectSpecOrBuilder getWriteObjectSpecOrBuilder() { - if (firstMessageCase_ == 2) { - return (com.google.storage.v2.WriteObjectSpec) firstMessage_; - } - return com.google.storage.v2.WriteObjectSpec.getDefaultInstance(); - } - - public static final int WRITE_OFFSET_FIELD_NUMBER = 3; - private long writeOffset_; - /** - * - * - *
-   * Required. The offset from the beginning of the object at which the data should be
-   * written.
-   * In the first `WriteObjectRequest` of a `WriteObject()` action, it
-   * indicates the initial offset for the `Write()` call. The value **must** be
-   * equal to the `persisted_size` that a call to `QueryWriteStatus()` would
-   * return (0 if this is the first write to the object).
-   * On subsequent calls, this value **must** be no larger than the sum of the
-   * first `write_offset` and the sizes of all `data` chunks sent previously on
-   * this stream.
-   * An incorrect value will cause an error.
-   * 
- * - * int64 write_offset = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The writeOffset. - */ - @java.lang.Override - public long getWriteOffset() { - return writeOffset_; - } - - public static final int CHECKSUMMED_DATA_FIELD_NUMBER = 4; - /** - * - * - *
-   * The data to insert. If a crc32c checksum is provided that doesn't match
-   * the checksum computed by the service, the request will fail.
-   * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 4; - * - * @return Whether the checksummedData field is set. - */ - @java.lang.Override - public boolean hasChecksummedData() { - return dataCase_ == 4; - } - /** - * - * - *
-   * The data to insert. If a crc32c checksum is provided that doesn't match
-   * the checksum computed by the service, the request will fail.
-   * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 4; - * - * @return The checksummedData. - */ - @java.lang.Override - public com.google.storage.v2.ChecksummedData getChecksummedData() { - if (dataCase_ == 4) { - return (com.google.storage.v2.ChecksummedData) data_; - } - return com.google.storage.v2.ChecksummedData.getDefaultInstance(); - } - /** - * - * - *
-   * The data to insert. If a crc32c checksum is provided that doesn't match
-   * the checksum computed by the service, the request will fail.
-   * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 4; - */ - @java.lang.Override - public com.google.storage.v2.ChecksummedDataOrBuilder getChecksummedDataOrBuilder() { - if (dataCase_ == 4) { - return (com.google.storage.v2.ChecksummedData) data_; - } - return com.google.storage.v2.ChecksummedData.getDefaultInstance(); - } - - public static final int OBJECT_CHECKSUMS_FIELD_NUMBER = 6; - private com.google.storage.v2.ObjectChecksums objectChecksums_; - /** - * - * - *
-   * Checksums for the complete object. If the checksums computed by the service
-   * don't match the specifified checksums the call will fail. May only be
-   * provided in the first or last request (either with first_message, or
-   * finish_write set).
-   * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 6; - * - * @return Whether the objectChecksums field is set. - */ - @java.lang.Override - public boolean hasObjectChecksums() { - return objectChecksums_ != null; - } - /** - * - * - *
-   * Checksums for the complete object. If the checksums computed by the service
-   * don't match the specifified checksums the call will fail. May only be
-   * provided in the first or last request (either with first_message, or
-   * finish_write set).
-   * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 6; - * - * @return The objectChecksums. - */ - @java.lang.Override - public com.google.storage.v2.ObjectChecksums getObjectChecksums() { - return objectChecksums_ == null - ? com.google.storage.v2.ObjectChecksums.getDefaultInstance() - : objectChecksums_; - } - /** - * - * - *
-   * Checksums for the complete object. If the checksums computed by the service
-   * don't match the specifified checksums the call will fail. May only be
-   * provided in the first or last request (either with first_message, or
-   * finish_write set).
-   * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 6; - */ - @java.lang.Override - public com.google.storage.v2.ObjectChecksumsOrBuilder getObjectChecksumsOrBuilder() { - return getObjectChecksums(); - } - - public static final int FINISH_WRITE_FIELD_NUMBER = 7; - private boolean finishWrite_; - /** - * - * - *
-   * If `true`, this indicates that the write is complete. Sending any
-   * `WriteObjectRequest`s subsequent to one in which `finish_write` is `true`
-   * will cause an error.
-   * For a non-resumable write (where the upload_id was not set in the first
-   * message), it is an error not to set this field in the final message of the
-   * stream.
-   * 
- * - * bool finish_write = 7; - * - * @return The finishWrite. - */ - @java.lang.Override - public boolean getFinishWrite() { - return finishWrite_; - } - - public static final int COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER = 8; - private com.google.storage.v2.CommonObjectRequestParams commonObjectRequestParams_; - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - * - * @return Whether the commonObjectRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonObjectRequestParams() { - return commonObjectRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - * - * @return The commonObjectRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { - return commonObjectRequestParams_ == null - ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() - : commonObjectRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - @java.lang.Override - public com.google.storage.v2.CommonObjectRequestParamsOrBuilder - getCommonObjectRequestParamsOrBuilder() { - return getCommonObjectRequestParams(); - } - - public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 9; - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return Whether the commonRequestParams field is set. - */ - @java.lang.Override - public boolean hasCommonRequestParams() { - return commonRequestParams_ != null; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return The commonRequestParams. - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - @java.lang.Override - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - return getCommonRequestParams(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (firstMessageCase_ == 1) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, firstMessage_); - } - if (firstMessageCase_ == 2) { - output.writeMessage(2, (com.google.storage.v2.WriteObjectSpec) firstMessage_); - } - if (writeOffset_ != 0L) { - output.writeInt64(3, writeOffset_); - } - if (dataCase_ == 4) { - output.writeMessage(4, (com.google.storage.v2.ChecksummedData) data_); - } - if (objectChecksums_ != null) { - output.writeMessage(6, getObjectChecksums()); - } - if (finishWrite_ != false) { - output.writeBool(7, finishWrite_); - } - if (commonObjectRequestParams_ != null) { - output.writeMessage(8, getCommonObjectRequestParams()); - } - if (commonRequestParams_ != null) { - output.writeMessage(9, getCommonRequestParams()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (firstMessageCase_ == 1) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, firstMessage_); - } - if (firstMessageCase_ == 2) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 2, (com.google.storage.v2.WriteObjectSpec) firstMessage_); - } - if (writeOffset_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, writeOffset_); - } - if (dataCase_ == 4) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 4, (com.google.storage.v2.ChecksummedData) data_); - } - if (objectChecksums_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getObjectChecksums()); - } - if (finishWrite_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, finishWrite_); - } - if (commonObjectRequestParams_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 8, getCommonObjectRequestParams()); - } - if (commonRequestParams_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getCommonRequestParams()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.WriteObjectRequest)) { - return super.equals(obj); - } - com.google.storage.v2.WriteObjectRequest other = (com.google.storage.v2.WriteObjectRequest) obj; - - if (getWriteOffset() != other.getWriteOffset()) return false; - if (hasObjectChecksums() != other.hasObjectChecksums()) return false; - if (hasObjectChecksums()) { - if (!getObjectChecksums().equals(other.getObjectChecksums())) return false; - } - if (getFinishWrite() != other.getFinishWrite()) return false; - if (hasCommonObjectRequestParams() != other.hasCommonObjectRequestParams()) return false; - if (hasCommonObjectRequestParams()) { - if (!getCommonObjectRequestParams().equals(other.getCommonObjectRequestParams())) - return false; - } - if (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; - if (hasCommonRequestParams()) { - if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; - } - if (!getFirstMessageCase().equals(other.getFirstMessageCase())) return false; - switch (firstMessageCase_) { - case 1: - if (!getUploadId().equals(other.getUploadId())) return false; - break; - case 2: - if (!getWriteObjectSpec().equals(other.getWriteObjectSpec())) return false; - break; - case 0: - default: - } - if (!getDataCase().equals(other.getDataCase())) return false; - switch (dataCase_) { - case 4: - if (!getChecksummedData().equals(other.getChecksummedData())) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + WRITE_OFFSET_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getWriteOffset()); - if (hasObjectChecksums()) { - hash = (37 * hash) + OBJECT_CHECKSUMS_FIELD_NUMBER; - hash = (53 * hash) + getObjectChecksums().hashCode(); - } - hash = (37 * hash) + FINISH_WRITE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFinishWrite()); - if (hasCommonObjectRequestParams()) { - hash = (37 * hash) + COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonObjectRequestParams().hashCode(); - } - if (hasCommonRequestParams()) { - hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getCommonRequestParams().hashCode(); - } - switch (firstMessageCase_) { - case 1: - hash = (37 * hash) + UPLOAD_ID_FIELD_NUMBER; - hash = (53 * hash) + getUploadId().hashCode(); - break; - case 2: - hash = (37 * hash) + WRITE_OBJECT_SPEC_FIELD_NUMBER; - hash = (53 * hash) + getWriteObjectSpec().hashCode(); - break; - case 0: - default: - } - switch (dataCase_) { - case 4: - hash = (37 * hash) + CHECKSUMMED_DATA_FIELD_NUMBER; - hash = (53 * hash) + getChecksummedData().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.WriteObjectRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.WriteObjectRequest parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.WriteObjectRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.WriteObjectRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.WriteObjectRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.WriteObjectRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.WriteObjectRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.WriteObjectRequest parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.WriteObjectRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.WriteObjectRequest parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.WriteObjectRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.WriteObjectRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.WriteObjectRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Request message for WriteObject.
-   * 
- * - * Protobuf type {@code google.storage.v2.WriteObjectRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.WriteObjectRequest) - com.google.storage.v2.WriteObjectRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_WriteObjectRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_WriteObjectRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.WriteObjectRequest.class, - com.google.storage.v2.WriteObjectRequest.Builder.class); - } - - // Construct using com.google.storage.v2.WriteObjectRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - writeOffset_ = 0L; - - if (objectChecksumsBuilder_ == null) { - objectChecksums_ = null; - } else { - objectChecksums_ = null; - objectChecksumsBuilder_ = null; - } - finishWrite_ = false; - - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = null; - } else { - commonObjectRequestParams_ = null; - commonObjectRequestParamsBuilder_ = null; - } - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - firstMessageCase_ = 0; - firstMessage_ = null; - dataCase_ = 0; - data_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_WriteObjectRequest_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.WriteObjectRequest getDefaultInstanceForType() { - return com.google.storage.v2.WriteObjectRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.WriteObjectRequest build() { - com.google.storage.v2.WriteObjectRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.WriteObjectRequest buildPartial() { - com.google.storage.v2.WriteObjectRequest result = - new com.google.storage.v2.WriteObjectRequest(this); - if (firstMessageCase_ == 1) { - result.firstMessage_ = firstMessage_; - } - if (firstMessageCase_ == 2) { - if (writeObjectSpecBuilder_ == null) { - result.firstMessage_ = firstMessage_; - } else { - result.firstMessage_ = writeObjectSpecBuilder_.build(); - } - } - result.writeOffset_ = writeOffset_; - if (dataCase_ == 4) { - if (checksummedDataBuilder_ == null) { - result.data_ = data_; - } else { - result.data_ = checksummedDataBuilder_.build(); - } - } - if (objectChecksumsBuilder_ == null) { - result.objectChecksums_ = objectChecksums_; - } else { - result.objectChecksums_ = objectChecksumsBuilder_.build(); - } - result.finishWrite_ = finishWrite_; - if (commonObjectRequestParamsBuilder_ == null) { - result.commonObjectRequestParams_ = commonObjectRequestParams_; - } else { - result.commonObjectRequestParams_ = commonObjectRequestParamsBuilder_.build(); - } - if (commonRequestParamsBuilder_ == null) { - result.commonRequestParams_ = commonRequestParams_; - } else { - result.commonRequestParams_ = commonRequestParamsBuilder_.build(); - } - result.firstMessageCase_ = firstMessageCase_; - result.dataCase_ = dataCase_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.WriteObjectRequest) { - return mergeFrom((com.google.storage.v2.WriteObjectRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.WriteObjectRequest other) { - if (other == com.google.storage.v2.WriteObjectRequest.getDefaultInstance()) return this; - if (other.getWriteOffset() != 0L) { - setWriteOffset(other.getWriteOffset()); - } - if (other.hasObjectChecksums()) { - mergeObjectChecksums(other.getObjectChecksums()); - } - if (other.getFinishWrite() != false) { - setFinishWrite(other.getFinishWrite()); - } - if (other.hasCommonObjectRequestParams()) { - mergeCommonObjectRequestParams(other.getCommonObjectRequestParams()); - } - if (other.hasCommonRequestParams()) { - mergeCommonRequestParams(other.getCommonRequestParams()); - } - switch (other.getFirstMessageCase()) { - case UPLOAD_ID: - { - firstMessageCase_ = 1; - firstMessage_ = other.firstMessage_; - onChanged(); - break; - } - case WRITE_OBJECT_SPEC: - { - mergeWriteObjectSpec(other.getWriteObjectSpec()); - break; - } - case FIRSTMESSAGE_NOT_SET: - { - break; - } - } - switch (other.getDataCase()) { - case CHECKSUMMED_DATA: - { - mergeChecksummedData(other.getChecksummedData()); - break; - } - case DATA_NOT_SET: - { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.WriteObjectRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.WriteObjectRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int firstMessageCase_ = 0; - private java.lang.Object firstMessage_; - - public FirstMessageCase getFirstMessageCase() { - return FirstMessageCase.forNumber(firstMessageCase_); - } - - public Builder clearFirstMessage() { - firstMessageCase_ = 0; - firstMessage_ = null; - onChanged(); - return this; - } - - private int dataCase_ = 0; - private java.lang.Object data_; - - public DataCase getDataCase() { - return DataCase.forNumber(dataCase_); - } - - public Builder clearData() { - dataCase_ = 0; - data_ = null; - onChanged(); - return this; - } - - /** - * - * - *
-     * For resumable uploads. This should be the `upload_id` returned from a
-     * call to `StartResumableWriteResponse`.
-     * 
- * - * string upload_id = 1; - * - * @return Whether the uploadId field is set. - */ - @java.lang.Override - public boolean hasUploadId() { - return firstMessageCase_ == 1; - } - /** - * - * - *
-     * For resumable uploads. This should be the `upload_id` returned from a
-     * call to `StartResumableWriteResponse`.
-     * 
- * - * string upload_id = 1; - * - * @return The uploadId. - */ - @java.lang.Override - public java.lang.String getUploadId() { - java.lang.Object ref = ""; - if (firstMessageCase_ == 1) { - ref = firstMessage_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (firstMessageCase_ == 1) { - firstMessage_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * For resumable uploads. This should be the `upload_id` returned from a
-     * call to `StartResumableWriteResponse`.
-     * 
- * - * string upload_id = 1; - * - * @return The bytes for uploadId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getUploadIdBytes() { - java.lang.Object ref = ""; - if (firstMessageCase_ == 1) { - ref = firstMessage_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - if (firstMessageCase_ == 1) { - firstMessage_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * For resumable uploads. This should be the `upload_id` returned from a
-     * call to `StartResumableWriteResponse`.
-     * 
- * - * string upload_id = 1; - * - * @param value The uploadId to set. - * @return This builder for chaining. - */ - public Builder setUploadId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - firstMessageCase_ = 1; - firstMessage_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * For resumable uploads. This should be the `upload_id` returned from a
-     * call to `StartResumableWriteResponse`.
-     * 
- * - * string upload_id = 1; - * - * @return This builder for chaining. - */ - public Builder clearUploadId() { - if (firstMessageCase_ == 1) { - firstMessageCase_ = 0; - firstMessage_ = null; - onChanged(); - } - return this; - } - /** - * - * - *
-     * For resumable uploads. This should be the `upload_id` returned from a
-     * call to `StartResumableWriteResponse`.
-     * 
- * - * string upload_id = 1; - * - * @param value The bytes for uploadId to set. - * @return This builder for chaining. - */ - public Builder setUploadIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - firstMessageCase_ = 1; - firstMessage_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.WriteObjectSpec, - com.google.storage.v2.WriteObjectSpec.Builder, - com.google.storage.v2.WriteObjectSpecOrBuilder> - writeObjectSpecBuilder_; - /** - * - * - *
-     * For non-resumable uploads. Describes the overall upload, including the
-     * destination bucket and object name, preconditions, etc.
-     * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 2; - * - * @return Whether the writeObjectSpec field is set. - */ - @java.lang.Override - public boolean hasWriteObjectSpec() { - return firstMessageCase_ == 2; - } - /** - * - * - *
-     * For non-resumable uploads. Describes the overall upload, including the
-     * destination bucket and object name, preconditions, etc.
-     * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 2; - * - * @return The writeObjectSpec. - */ - @java.lang.Override - public com.google.storage.v2.WriteObjectSpec getWriteObjectSpec() { - if (writeObjectSpecBuilder_ == null) { - if (firstMessageCase_ == 2) { - return (com.google.storage.v2.WriteObjectSpec) firstMessage_; - } - return com.google.storage.v2.WriteObjectSpec.getDefaultInstance(); - } else { - if (firstMessageCase_ == 2) { - return writeObjectSpecBuilder_.getMessage(); - } - return com.google.storage.v2.WriteObjectSpec.getDefaultInstance(); - } - } - /** - * - * - *
-     * For non-resumable uploads. Describes the overall upload, including the
-     * destination bucket and object name, preconditions, etc.
-     * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 2; - */ - public Builder setWriteObjectSpec(com.google.storage.v2.WriteObjectSpec value) { - if (writeObjectSpecBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - firstMessage_ = value; - onChanged(); - } else { - writeObjectSpecBuilder_.setMessage(value); - } - firstMessageCase_ = 2; - return this; - } - /** - * - * - *
-     * For non-resumable uploads. Describes the overall upload, including the
-     * destination bucket and object name, preconditions, etc.
-     * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 2; - */ - public Builder setWriteObjectSpec( - com.google.storage.v2.WriteObjectSpec.Builder builderForValue) { - if (writeObjectSpecBuilder_ == null) { - firstMessage_ = builderForValue.build(); - onChanged(); - } else { - writeObjectSpecBuilder_.setMessage(builderForValue.build()); - } - firstMessageCase_ = 2; - return this; - } - /** - * - * - *
-     * For non-resumable uploads. Describes the overall upload, including the
-     * destination bucket and object name, preconditions, etc.
-     * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 2; - */ - public Builder mergeWriteObjectSpec(com.google.storage.v2.WriteObjectSpec value) { - if (writeObjectSpecBuilder_ == null) { - if (firstMessageCase_ == 2 - && firstMessage_ != com.google.storage.v2.WriteObjectSpec.getDefaultInstance()) { - firstMessage_ = - com.google.storage.v2.WriteObjectSpec.newBuilder( - (com.google.storage.v2.WriteObjectSpec) firstMessage_) - .mergeFrom(value) - .buildPartial(); - } else { - firstMessage_ = value; - } - onChanged(); - } else { - if (firstMessageCase_ == 2) { - writeObjectSpecBuilder_.mergeFrom(value); - } - writeObjectSpecBuilder_.setMessage(value); - } - firstMessageCase_ = 2; - return this; - } - /** - * - * - *
-     * For non-resumable uploads. Describes the overall upload, including the
-     * destination bucket and object name, preconditions, etc.
-     * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 2; - */ - public Builder clearWriteObjectSpec() { - if (writeObjectSpecBuilder_ == null) { - if (firstMessageCase_ == 2) { - firstMessageCase_ = 0; - firstMessage_ = null; - onChanged(); - } - } else { - if (firstMessageCase_ == 2) { - firstMessageCase_ = 0; - firstMessage_ = null; - } - writeObjectSpecBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * For non-resumable uploads. Describes the overall upload, including the
-     * destination bucket and object name, preconditions, etc.
-     * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 2; - */ - public com.google.storage.v2.WriteObjectSpec.Builder getWriteObjectSpecBuilder() { - return getWriteObjectSpecFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * For non-resumable uploads. Describes the overall upload, including the
-     * destination bucket and object name, preconditions, etc.
-     * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 2; - */ - @java.lang.Override - public com.google.storage.v2.WriteObjectSpecOrBuilder getWriteObjectSpecOrBuilder() { - if ((firstMessageCase_ == 2) && (writeObjectSpecBuilder_ != null)) { - return writeObjectSpecBuilder_.getMessageOrBuilder(); - } else { - if (firstMessageCase_ == 2) { - return (com.google.storage.v2.WriteObjectSpec) firstMessage_; - } - return com.google.storage.v2.WriteObjectSpec.getDefaultInstance(); - } - } - /** - * - * - *
-     * For non-resumable uploads. Describes the overall upload, including the
-     * destination bucket and object name, preconditions, etc.
-     * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.WriteObjectSpec, - com.google.storage.v2.WriteObjectSpec.Builder, - com.google.storage.v2.WriteObjectSpecOrBuilder> - getWriteObjectSpecFieldBuilder() { - if (writeObjectSpecBuilder_ == null) { - if (!(firstMessageCase_ == 2)) { - firstMessage_ = com.google.storage.v2.WriteObjectSpec.getDefaultInstance(); - } - writeObjectSpecBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.WriteObjectSpec, - com.google.storage.v2.WriteObjectSpec.Builder, - com.google.storage.v2.WriteObjectSpecOrBuilder>( - (com.google.storage.v2.WriteObjectSpec) firstMessage_, - getParentForChildren(), - isClean()); - firstMessage_ = null; - } - firstMessageCase_ = 2; - onChanged(); - ; - return writeObjectSpecBuilder_; - } - - private long writeOffset_; - /** - * - * - *
-     * Required. The offset from the beginning of the object at which the data should be
-     * written.
-     * In the first `WriteObjectRequest` of a `WriteObject()` action, it
-     * indicates the initial offset for the `Write()` call. The value **must** be
-     * equal to the `persisted_size` that a call to `QueryWriteStatus()` would
-     * return (0 if this is the first write to the object).
-     * On subsequent calls, this value **must** be no larger than the sum of the
-     * first `write_offset` and the sizes of all `data` chunks sent previously on
-     * this stream.
-     * An incorrect value will cause an error.
-     * 
- * - * int64 write_offset = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The writeOffset. - */ - @java.lang.Override - public long getWriteOffset() { - return writeOffset_; - } - /** - * - * - *
-     * Required. The offset from the beginning of the object at which the data should be
-     * written.
-     * In the first `WriteObjectRequest` of a `WriteObject()` action, it
-     * indicates the initial offset for the `Write()` call. The value **must** be
-     * equal to the `persisted_size` that a call to `QueryWriteStatus()` would
-     * return (0 if this is the first write to the object).
-     * On subsequent calls, this value **must** be no larger than the sum of the
-     * first `write_offset` and the sizes of all `data` chunks sent previously on
-     * this stream.
-     * An incorrect value will cause an error.
-     * 
- * - * int64 write_offset = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The writeOffset to set. - * @return This builder for chaining. - */ - public Builder setWriteOffset(long value) { - - writeOffset_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The offset from the beginning of the object at which the data should be
-     * written.
-     * In the first `WriteObjectRequest` of a `WriteObject()` action, it
-     * indicates the initial offset for the `Write()` call. The value **must** be
-     * equal to the `persisted_size` that a call to `QueryWriteStatus()` would
-     * return (0 if this is the first write to the object).
-     * On subsequent calls, this value **must** be no larger than the sum of the
-     * first `write_offset` and the sizes of all `data` chunks sent previously on
-     * this stream.
-     * An incorrect value will cause an error.
-     * 
- * - * int64 write_offset = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearWriteOffset() { - - writeOffset_ = 0L; - onChanged(); - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ChecksummedData, - com.google.storage.v2.ChecksummedData.Builder, - com.google.storage.v2.ChecksummedDataOrBuilder> - checksummedDataBuilder_; - /** - * - * - *
-     * The data to insert. If a crc32c checksum is provided that doesn't match
-     * the checksum computed by the service, the request will fail.
-     * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 4; - * - * @return Whether the checksummedData field is set. - */ - @java.lang.Override - public boolean hasChecksummedData() { - return dataCase_ == 4; - } - /** - * - * - *
-     * The data to insert. If a crc32c checksum is provided that doesn't match
-     * the checksum computed by the service, the request will fail.
-     * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 4; - * - * @return The checksummedData. - */ - @java.lang.Override - public com.google.storage.v2.ChecksummedData getChecksummedData() { - if (checksummedDataBuilder_ == null) { - if (dataCase_ == 4) { - return (com.google.storage.v2.ChecksummedData) data_; - } - return com.google.storage.v2.ChecksummedData.getDefaultInstance(); - } else { - if (dataCase_ == 4) { - return checksummedDataBuilder_.getMessage(); - } - return com.google.storage.v2.ChecksummedData.getDefaultInstance(); - } - } - /** - * - * - *
-     * The data to insert. If a crc32c checksum is provided that doesn't match
-     * the checksum computed by the service, the request will fail.
-     * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 4; - */ - public Builder setChecksummedData(com.google.storage.v2.ChecksummedData value) { - if (checksummedDataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - data_ = value; - onChanged(); - } else { - checksummedDataBuilder_.setMessage(value); - } - dataCase_ = 4; - return this; - } - /** - * - * - *
-     * The data to insert. If a crc32c checksum is provided that doesn't match
-     * the checksum computed by the service, the request will fail.
-     * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 4; - */ - public Builder setChecksummedData( - com.google.storage.v2.ChecksummedData.Builder builderForValue) { - if (checksummedDataBuilder_ == null) { - data_ = builderForValue.build(); - onChanged(); - } else { - checksummedDataBuilder_.setMessage(builderForValue.build()); - } - dataCase_ = 4; - return this; - } - /** - * - * - *
-     * The data to insert. If a crc32c checksum is provided that doesn't match
-     * the checksum computed by the service, the request will fail.
-     * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 4; - */ - public Builder mergeChecksummedData(com.google.storage.v2.ChecksummedData value) { - if (checksummedDataBuilder_ == null) { - if (dataCase_ == 4 && data_ != com.google.storage.v2.ChecksummedData.getDefaultInstance()) { - data_ = - com.google.storage.v2.ChecksummedData.newBuilder( - (com.google.storage.v2.ChecksummedData) data_) - .mergeFrom(value) - .buildPartial(); - } else { - data_ = value; - } - onChanged(); - } else { - if (dataCase_ == 4) { - checksummedDataBuilder_.mergeFrom(value); - } - checksummedDataBuilder_.setMessage(value); - } - dataCase_ = 4; - return this; - } - /** - * - * - *
-     * The data to insert. If a crc32c checksum is provided that doesn't match
-     * the checksum computed by the service, the request will fail.
-     * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 4; - */ - public Builder clearChecksummedData() { - if (checksummedDataBuilder_ == null) { - if (dataCase_ == 4) { - dataCase_ = 0; - data_ = null; - onChanged(); - } - } else { - if (dataCase_ == 4) { - dataCase_ = 0; - data_ = null; - } - checksummedDataBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * The data to insert. If a crc32c checksum is provided that doesn't match
-     * the checksum computed by the service, the request will fail.
-     * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 4; - */ - public com.google.storage.v2.ChecksummedData.Builder getChecksummedDataBuilder() { - return getChecksummedDataFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The data to insert. If a crc32c checksum is provided that doesn't match
-     * the checksum computed by the service, the request will fail.
-     * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 4; - */ - @java.lang.Override - public com.google.storage.v2.ChecksummedDataOrBuilder getChecksummedDataOrBuilder() { - if ((dataCase_ == 4) && (checksummedDataBuilder_ != null)) { - return checksummedDataBuilder_.getMessageOrBuilder(); - } else { - if (dataCase_ == 4) { - return (com.google.storage.v2.ChecksummedData) data_; - } - return com.google.storage.v2.ChecksummedData.getDefaultInstance(); - } - } - /** - * - * - *
-     * The data to insert. If a crc32c checksum is provided that doesn't match
-     * the checksum computed by the service, the request will fail.
-     * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ChecksummedData, - com.google.storage.v2.ChecksummedData.Builder, - com.google.storage.v2.ChecksummedDataOrBuilder> - getChecksummedDataFieldBuilder() { - if (checksummedDataBuilder_ == null) { - if (!(dataCase_ == 4)) { - data_ = com.google.storage.v2.ChecksummedData.getDefaultInstance(); - } - checksummedDataBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ChecksummedData, - com.google.storage.v2.ChecksummedData.Builder, - com.google.storage.v2.ChecksummedDataOrBuilder>( - (com.google.storage.v2.ChecksummedData) data_, getParentForChildren(), isClean()); - data_ = null; - } - dataCase_ = 4; - onChanged(); - ; - return checksummedDataBuilder_; - } - - private com.google.storage.v2.ObjectChecksums objectChecksums_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ObjectChecksums, - com.google.storage.v2.ObjectChecksums.Builder, - com.google.storage.v2.ObjectChecksumsOrBuilder> - objectChecksumsBuilder_; - /** - * - * - *
-     * Checksums for the complete object. If the checksums computed by the service
-     * don't match the specifified checksums the call will fail. May only be
-     * provided in the first or last request (either with first_message, or
-     * finish_write set).
-     * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 6; - * - * @return Whether the objectChecksums field is set. - */ - public boolean hasObjectChecksums() { - return objectChecksumsBuilder_ != null || objectChecksums_ != null; - } - /** - * - * - *
-     * Checksums for the complete object. If the checksums computed by the service
-     * don't match the specifified checksums the call will fail. May only be
-     * provided in the first or last request (either with first_message, or
-     * finish_write set).
-     * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 6; - * - * @return The objectChecksums. - */ - public com.google.storage.v2.ObjectChecksums getObjectChecksums() { - if (objectChecksumsBuilder_ == null) { - return objectChecksums_ == null - ? com.google.storage.v2.ObjectChecksums.getDefaultInstance() - : objectChecksums_; - } else { - return objectChecksumsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Checksums for the complete object. If the checksums computed by the service
-     * don't match the specifified checksums the call will fail. May only be
-     * provided in the first or last request (either with first_message, or
-     * finish_write set).
-     * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 6; - */ - public Builder setObjectChecksums(com.google.storage.v2.ObjectChecksums value) { - if (objectChecksumsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - objectChecksums_ = value; - onChanged(); - } else { - objectChecksumsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Checksums for the complete object. If the checksums computed by the service
-     * don't match the specifified checksums the call will fail. May only be
-     * provided in the first or last request (either with first_message, or
-     * finish_write set).
-     * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 6; - */ - public Builder setObjectChecksums( - com.google.storage.v2.ObjectChecksums.Builder builderForValue) { - if (objectChecksumsBuilder_ == null) { - objectChecksums_ = builderForValue.build(); - onChanged(); - } else { - objectChecksumsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Checksums for the complete object. If the checksums computed by the service
-     * don't match the specifified checksums the call will fail. May only be
-     * provided in the first or last request (either with first_message, or
-     * finish_write set).
-     * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 6; - */ - public Builder mergeObjectChecksums(com.google.storage.v2.ObjectChecksums value) { - if (objectChecksumsBuilder_ == null) { - if (objectChecksums_ != null) { - objectChecksums_ = - com.google.storage.v2.ObjectChecksums.newBuilder(objectChecksums_) - .mergeFrom(value) - .buildPartial(); - } else { - objectChecksums_ = value; - } - onChanged(); - } else { - objectChecksumsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Checksums for the complete object. If the checksums computed by the service
-     * don't match the specifified checksums the call will fail. May only be
-     * provided in the first or last request (either with first_message, or
-     * finish_write set).
-     * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 6; - */ - public Builder clearObjectChecksums() { - if (objectChecksumsBuilder_ == null) { - objectChecksums_ = null; - onChanged(); - } else { - objectChecksums_ = null; - objectChecksumsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Checksums for the complete object. If the checksums computed by the service
-     * don't match the specifified checksums the call will fail. May only be
-     * provided in the first or last request (either with first_message, or
-     * finish_write set).
-     * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 6; - */ - public com.google.storage.v2.ObjectChecksums.Builder getObjectChecksumsBuilder() { - - onChanged(); - return getObjectChecksumsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Checksums for the complete object. If the checksums computed by the service
-     * don't match the specifified checksums the call will fail. May only be
-     * provided in the first or last request (either with first_message, or
-     * finish_write set).
-     * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 6; - */ - public com.google.storage.v2.ObjectChecksumsOrBuilder getObjectChecksumsOrBuilder() { - if (objectChecksumsBuilder_ != null) { - return objectChecksumsBuilder_.getMessageOrBuilder(); - } else { - return objectChecksums_ == null - ? com.google.storage.v2.ObjectChecksums.getDefaultInstance() - : objectChecksums_; - } - } - /** - * - * - *
-     * Checksums for the complete object. If the checksums computed by the service
-     * don't match the specifified checksums the call will fail. May only be
-     * provided in the first or last request (either with first_message, or
-     * finish_write set).
-     * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 6; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ObjectChecksums, - com.google.storage.v2.ObjectChecksums.Builder, - com.google.storage.v2.ObjectChecksumsOrBuilder> - getObjectChecksumsFieldBuilder() { - if (objectChecksumsBuilder_ == null) { - objectChecksumsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.ObjectChecksums, - com.google.storage.v2.ObjectChecksums.Builder, - com.google.storage.v2.ObjectChecksumsOrBuilder>( - getObjectChecksums(), getParentForChildren(), isClean()); - objectChecksums_ = null; - } - return objectChecksumsBuilder_; - } - - private boolean finishWrite_; - /** - * - * - *
-     * If `true`, this indicates that the write is complete. Sending any
-     * `WriteObjectRequest`s subsequent to one in which `finish_write` is `true`
-     * will cause an error.
-     * For a non-resumable write (where the upload_id was not set in the first
-     * message), it is an error not to set this field in the final message of the
-     * stream.
-     * 
- * - * bool finish_write = 7; - * - * @return The finishWrite. - */ - @java.lang.Override - public boolean getFinishWrite() { - return finishWrite_; - } - /** - * - * - *
-     * If `true`, this indicates that the write is complete. Sending any
-     * `WriteObjectRequest`s subsequent to one in which `finish_write` is `true`
-     * will cause an error.
-     * For a non-resumable write (where the upload_id was not set in the first
-     * message), it is an error not to set this field in the final message of the
-     * stream.
-     * 
- * - * bool finish_write = 7; - * - * @param value The finishWrite to set. - * @return This builder for chaining. - */ - public Builder setFinishWrite(boolean value) { - - finishWrite_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If `true`, this indicates that the write is complete. Sending any
-     * `WriteObjectRequest`s subsequent to one in which `finish_write` is `true`
-     * will cause an error.
-     * For a non-resumable write (where the upload_id was not set in the first
-     * message), it is an error not to set this field in the final message of the
-     * stream.
-     * 
- * - * bool finish_write = 7; - * - * @return This builder for chaining. - */ - public Builder clearFinishWrite() { - - finishWrite_ = false; - onChanged(); - return this; - } - - private com.google.storage.v2.CommonObjectRequestParams commonObjectRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder> - commonObjectRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - * - * @return Whether the commonObjectRequestParams field is set. - */ - public boolean hasCommonObjectRequestParams() { - return commonObjectRequestParamsBuilder_ != null || commonObjectRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - * - * @return The commonObjectRequestParams. - */ - public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { - if (commonObjectRequestParamsBuilder_ == null) { - return commonObjectRequestParams_ == null - ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() - : commonObjectRequestParams_; - } else { - return commonObjectRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - public Builder setCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams value) { - if (commonObjectRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonObjectRequestParams_ = value; - onChanged(); - } else { - commonObjectRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - public Builder setCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams.Builder builderForValue) { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonObjectRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - public Builder mergeCommonObjectRequestParams( - com.google.storage.v2.CommonObjectRequestParams value) { - if (commonObjectRequestParamsBuilder_ == null) { - if (commonObjectRequestParams_ != null) { - commonObjectRequestParams_ = - com.google.storage.v2.CommonObjectRequestParams.newBuilder(commonObjectRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonObjectRequestParams_ = value; - } - onChanged(); - } else { - commonObjectRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - public Builder clearCommonObjectRequestParams() { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParams_ = null; - onChanged(); - } else { - commonObjectRequestParams_ = null; - commonObjectRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - public com.google.storage.v2.CommonObjectRequestParams.Builder - getCommonObjectRequestParamsBuilder() { - - onChanged(); - return getCommonObjectRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - public com.google.storage.v2.CommonObjectRequestParamsOrBuilder - getCommonObjectRequestParamsOrBuilder() { - if (commonObjectRequestParamsBuilder_ != null) { - return commonObjectRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonObjectRequestParams_ == null - ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() - : commonObjectRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to Storage API requests concerning an object.
-     * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder> - getCommonObjectRequestParamsFieldBuilder() { - if (commonObjectRequestParamsBuilder_ == null) { - commonObjectRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonObjectRequestParams, - com.google.storage.v2.CommonObjectRequestParams.Builder, - com.google.storage.v2.CommonObjectRequestParamsOrBuilder>( - getCommonObjectRequestParams(), getParentForChildren(), isClean()); - commonObjectRequestParams_ = null; - } - return commonObjectRequestParamsBuilder_; - } - - private com.google.storage.v2.CommonRequestParams commonRequestParams_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - commonRequestParamsBuilder_; - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return Whether the commonRequestParams field is set. - */ - public boolean hasCommonRequestParams() { - return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return The commonRequestParams. - */ - public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } else { - return commonRequestParamsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commonRequestParams_ = value; - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public Builder setCommonRequestParams( - com.google.storage.v2.CommonRequestParams.Builder builderForValue) { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = builderForValue.build(); - onChanged(); - } else { - commonRequestParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { - if (commonRequestParamsBuilder_ == null) { - if (commonRequestParams_ != null) { - commonRequestParams_ = - com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) - .mergeFrom(value) - .buildPartial(); - } else { - commonRequestParams_ = value; - } - onChanged(); - } else { - commonRequestParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public Builder clearCommonRequestParams() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParams_ = null; - onChanged(); - } else { - commonRequestParams_ = null; - commonRequestParamsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { - - onChanged(); - return getCommonRequestParamsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { - if (commonRequestParamsBuilder_ != null) { - return commonRequestParamsBuilder_.getMessageOrBuilder(); - } else { - return commonRequestParams_ == null - ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() - : commonRequestParams_; - } - } - /** - * - * - *
-     * A set of parameters common to all Storage API requests.
-     * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder> - getCommonRequestParamsFieldBuilder() { - if (commonRequestParamsBuilder_ == null) { - commonRequestParamsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.CommonRequestParams, - com.google.storage.v2.CommonRequestParams.Builder, - com.google.storage.v2.CommonRequestParamsOrBuilder>( - getCommonRequestParams(), getParentForChildren(), isClean()); - commonRequestParams_ = null; - } - return commonRequestParamsBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.WriteObjectRequest) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.WriteObjectRequest) - private static final com.google.storage.v2.WriteObjectRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.WriteObjectRequest(); - } - - public static com.google.storage.v2.WriteObjectRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public WriteObjectRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new WriteObjectRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.WriteObjectRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequestOrBuilder.java deleted file mode 100644 index 175e2c48a4..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequestOrBuilder.java +++ /dev/null @@ -1,299 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface WriteObjectRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.WriteObjectRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * For resumable uploads. This should be the `upload_id` returned from a
-   * call to `StartResumableWriteResponse`.
-   * 
- * - * string upload_id = 1; - * - * @return Whether the uploadId field is set. - */ - boolean hasUploadId(); - /** - * - * - *
-   * For resumable uploads. This should be the `upload_id` returned from a
-   * call to `StartResumableWriteResponse`.
-   * 
- * - * string upload_id = 1; - * - * @return The uploadId. - */ - java.lang.String getUploadId(); - /** - * - * - *
-   * For resumable uploads. This should be the `upload_id` returned from a
-   * call to `StartResumableWriteResponse`.
-   * 
- * - * string upload_id = 1; - * - * @return The bytes for uploadId. - */ - com.google.protobuf.ByteString getUploadIdBytes(); - - /** - * - * - *
-   * For non-resumable uploads. Describes the overall upload, including the
-   * destination bucket and object name, preconditions, etc.
-   * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 2; - * - * @return Whether the writeObjectSpec field is set. - */ - boolean hasWriteObjectSpec(); - /** - * - * - *
-   * For non-resumable uploads. Describes the overall upload, including the
-   * destination bucket and object name, preconditions, etc.
-   * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 2; - * - * @return The writeObjectSpec. - */ - com.google.storage.v2.WriteObjectSpec getWriteObjectSpec(); - /** - * - * - *
-   * For non-resumable uploads. Describes the overall upload, including the
-   * destination bucket and object name, preconditions, etc.
-   * 
- * - * .google.storage.v2.WriteObjectSpec write_object_spec = 2; - */ - com.google.storage.v2.WriteObjectSpecOrBuilder getWriteObjectSpecOrBuilder(); - - /** - * - * - *
-   * Required. The offset from the beginning of the object at which the data should be
-   * written.
-   * In the first `WriteObjectRequest` of a `WriteObject()` action, it
-   * indicates the initial offset for the `Write()` call. The value **must** be
-   * equal to the `persisted_size` that a call to `QueryWriteStatus()` would
-   * return (0 if this is the first write to the object).
-   * On subsequent calls, this value **must** be no larger than the sum of the
-   * first `write_offset` and the sizes of all `data` chunks sent previously on
-   * this stream.
-   * An incorrect value will cause an error.
-   * 
- * - * int64 write_offset = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The writeOffset. - */ - long getWriteOffset(); - - /** - * - * - *
-   * The data to insert. If a crc32c checksum is provided that doesn't match
-   * the checksum computed by the service, the request will fail.
-   * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 4; - * - * @return Whether the checksummedData field is set. - */ - boolean hasChecksummedData(); - /** - * - * - *
-   * The data to insert. If a crc32c checksum is provided that doesn't match
-   * the checksum computed by the service, the request will fail.
-   * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 4; - * - * @return The checksummedData. - */ - com.google.storage.v2.ChecksummedData getChecksummedData(); - /** - * - * - *
-   * The data to insert. If a crc32c checksum is provided that doesn't match
-   * the checksum computed by the service, the request will fail.
-   * 
- * - * .google.storage.v2.ChecksummedData checksummed_data = 4; - */ - com.google.storage.v2.ChecksummedDataOrBuilder getChecksummedDataOrBuilder(); - - /** - * - * - *
-   * Checksums for the complete object. If the checksums computed by the service
-   * don't match the specifified checksums the call will fail. May only be
-   * provided in the first or last request (either with first_message, or
-   * finish_write set).
-   * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 6; - * - * @return Whether the objectChecksums field is set. - */ - boolean hasObjectChecksums(); - /** - * - * - *
-   * Checksums for the complete object. If the checksums computed by the service
-   * don't match the specifified checksums the call will fail. May only be
-   * provided in the first or last request (either with first_message, or
-   * finish_write set).
-   * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 6; - * - * @return The objectChecksums. - */ - com.google.storage.v2.ObjectChecksums getObjectChecksums(); - /** - * - * - *
-   * Checksums for the complete object. If the checksums computed by the service
-   * don't match the specifified checksums the call will fail. May only be
-   * provided in the first or last request (either with first_message, or
-   * finish_write set).
-   * 
- * - * .google.storage.v2.ObjectChecksums object_checksums = 6; - */ - com.google.storage.v2.ObjectChecksumsOrBuilder getObjectChecksumsOrBuilder(); - - /** - * - * - *
-   * If `true`, this indicates that the write is complete. Sending any
-   * `WriteObjectRequest`s subsequent to one in which `finish_write` is `true`
-   * will cause an error.
-   * For a non-resumable write (where the upload_id was not set in the first
-   * message), it is an error not to set this field in the final message of the
-   * stream.
-   * 
- * - * bool finish_write = 7; - * - * @return The finishWrite. - */ - boolean getFinishWrite(); - - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - * - * @return Whether the commonObjectRequestParams field is set. - */ - boolean hasCommonObjectRequestParams(); - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - * - * @return The commonObjectRequestParams. - */ - com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams(); - /** - * - * - *
-   * A set of parameters common to Storage API requests concerning an object.
-   * 
- * - * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; - */ - com.google.storage.v2.CommonObjectRequestParamsOrBuilder getCommonObjectRequestParamsOrBuilder(); - - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return Whether the commonRequestParams field is set. - */ - boolean hasCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - * - * @return The commonRequestParams. - */ - com.google.storage.v2.CommonRequestParams getCommonRequestParams(); - /** - * - * - *
-   * A set of parameters common to all Storage API requests.
-   * 
- * - * .google.storage.v2.CommonRequestParams common_request_params = 9; - */ - com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); - - public com.google.storage.v2.WriteObjectRequest.FirstMessageCase getFirstMessageCase(); - - public com.google.storage.v2.WriteObjectRequest.DataCase getDataCase(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponse.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponse.java deleted file mode 100644 index 06576899b4..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponse.java +++ /dev/null @@ -1,982 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Response message for WriteObject.
- * 
- * - * Protobuf type {@code google.storage.v2.WriteObjectResponse} - */ -public final class WriteObjectResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.WriteObjectResponse) - WriteObjectResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use WriteObjectResponse.newBuilder() to construct. - private WriteObjectResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private WriteObjectResponse() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new WriteObjectResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private WriteObjectResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - writeStatusCase_ = 1; - writeStatus_ = input.readInt64(); - break; - } - case 18: - { - com.google.storage.v2.Object.Builder subBuilder = null; - if (writeStatusCase_ == 2) { - subBuilder = ((com.google.storage.v2.Object) writeStatus_).toBuilder(); - } - writeStatus_ = - input.readMessage(com.google.storage.v2.Object.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.storage.v2.Object) writeStatus_); - writeStatus_ = subBuilder.buildPartial(); - } - writeStatusCase_ = 2; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_WriteObjectResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_WriteObjectResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.WriteObjectResponse.class, - com.google.storage.v2.WriteObjectResponse.Builder.class); - } - - private int writeStatusCase_ = 0; - private java.lang.Object writeStatus_; - - public enum WriteStatusCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - PERSISTED_SIZE(1), - RESOURCE(2), - WRITESTATUS_NOT_SET(0); - private final int value; - - private WriteStatusCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static WriteStatusCase valueOf(int value) { - return forNumber(value); - } - - public static WriteStatusCase forNumber(int value) { - switch (value) { - case 1: - return PERSISTED_SIZE; - case 2: - return RESOURCE; - case 0: - return WRITESTATUS_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public WriteStatusCase getWriteStatusCase() { - return WriteStatusCase.forNumber(writeStatusCase_); - } - - public static final int PERSISTED_SIZE_FIELD_NUMBER = 1; - /** - * - * - *
-   * The total number of bytes that have been processed for the given object
-   * from all `WriteObject` calls. Only set if the upload has not finalized.
-   * 
- * - * int64 persisted_size = 1; - * - * @return Whether the persistedSize field is set. - */ - @java.lang.Override - public boolean hasPersistedSize() { - return writeStatusCase_ == 1; - } - /** - * - * - *
-   * The total number of bytes that have been processed for the given object
-   * from all `WriteObject` calls. Only set if the upload has not finalized.
-   * 
- * - * int64 persisted_size = 1; - * - * @return The persistedSize. - */ - @java.lang.Override - public long getPersistedSize() { - if (writeStatusCase_ == 1) { - return (java.lang.Long) writeStatus_; - } - return 0L; - } - - public static final int RESOURCE_FIELD_NUMBER = 2; - /** - * - * - *
-   * A resource containing the metadata for the uploaded object. Only set if
-   * the upload has finalized.
-   * 
- * - * .google.storage.v2.Object resource = 2; - * - * @return Whether the resource field is set. - */ - @java.lang.Override - public boolean hasResource() { - return writeStatusCase_ == 2; - } - /** - * - * - *
-   * A resource containing the metadata for the uploaded object. Only set if
-   * the upload has finalized.
-   * 
- * - * .google.storage.v2.Object resource = 2; - * - * @return The resource. - */ - @java.lang.Override - public com.google.storage.v2.Object getResource() { - if (writeStatusCase_ == 2) { - return (com.google.storage.v2.Object) writeStatus_; - } - return com.google.storage.v2.Object.getDefaultInstance(); - } - /** - * - * - *
-   * A resource containing the metadata for the uploaded object. Only set if
-   * the upload has finalized.
-   * 
- * - * .google.storage.v2.Object resource = 2; - */ - @java.lang.Override - public com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder() { - if (writeStatusCase_ == 2) { - return (com.google.storage.v2.Object) writeStatus_; - } - return com.google.storage.v2.Object.getDefaultInstance(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (writeStatusCase_ == 1) { - output.writeInt64(1, (long) ((java.lang.Long) writeStatus_)); - } - if (writeStatusCase_ == 2) { - output.writeMessage(2, (com.google.storage.v2.Object) writeStatus_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (writeStatusCase_ == 1) { - size += - com.google.protobuf.CodedOutputStream.computeInt64Size( - 1, (long) ((java.lang.Long) writeStatus_)); - } - if (writeStatusCase_ == 2) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 2, (com.google.storage.v2.Object) writeStatus_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.WriteObjectResponse)) { - return super.equals(obj); - } - com.google.storage.v2.WriteObjectResponse other = - (com.google.storage.v2.WriteObjectResponse) obj; - - if (!getWriteStatusCase().equals(other.getWriteStatusCase())) return false; - switch (writeStatusCase_) { - case 1: - if (getPersistedSize() != other.getPersistedSize()) return false; - break; - case 2: - if (!getResource().equals(other.getResource())) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (writeStatusCase_) { - case 1: - hash = (37 * hash) + PERSISTED_SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPersistedSize()); - break; - case 2: - hash = (37 * hash) + RESOURCE_FIELD_NUMBER; - hash = (53 * hash) + getResource().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.WriteObjectResponse parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.WriteObjectResponse parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.WriteObjectResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.WriteObjectResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.WriteObjectResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.WriteObjectResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.WriteObjectResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.WriteObjectResponse parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.WriteObjectResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.WriteObjectResponse parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.WriteObjectResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.WriteObjectResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.WriteObjectResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Response message for WriteObject.
-   * 
- * - * Protobuf type {@code google.storage.v2.WriteObjectResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.WriteObjectResponse) - com.google.storage.v2.WriteObjectResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_WriteObjectResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_WriteObjectResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.WriteObjectResponse.class, - com.google.storage.v2.WriteObjectResponse.Builder.class); - } - - // Construct using com.google.storage.v2.WriteObjectResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - writeStatusCase_ = 0; - writeStatus_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_WriteObjectResponse_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.WriteObjectResponse getDefaultInstanceForType() { - return com.google.storage.v2.WriteObjectResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.WriteObjectResponse build() { - com.google.storage.v2.WriteObjectResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.WriteObjectResponse buildPartial() { - com.google.storage.v2.WriteObjectResponse result = - new com.google.storage.v2.WriteObjectResponse(this); - if (writeStatusCase_ == 1) { - result.writeStatus_ = writeStatus_; - } - if (writeStatusCase_ == 2) { - if (resourceBuilder_ == null) { - result.writeStatus_ = writeStatus_; - } else { - result.writeStatus_ = resourceBuilder_.build(); - } - } - result.writeStatusCase_ = writeStatusCase_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.WriteObjectResponse) { - return mergeFrom((com.google.storage.v2.WriteObjectResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.WriteObjectResponse other) { - if (other == com.google.storage.v2.WriteObjectResponse.getDefaultInstance()) return this; - switch (other.getWriteStatusCase()) { - case PERSISTED_SIZE: - { - setPersistedSize(other.getPersistedSize()); - break; - } - case RESOURCE: - { - mergeResource(other.getResource()); - break; - } - case WRITESTATUS_NOT_SET: - { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.WriteObjectResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.WriteObjectResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int writeStatusCase_ = 0; - private java.lang.Object writeStatus_; - - public WriteStatusCase getWriteStatusCase() { - return WriteStatusCase.forNumber(writeStatusCase_); - } - - public Builder clearWriteStatus() { - writeStatusCase_ = 0; - writeStatus_ = null; - onChanged(); - return this; - } - - /** - * - * - *
-     * The total number of bytes that have been processed for the given object
-     * from all `WriteObject` calls. Only set if the upload has not finalized.
-     * 
- * - * int64 persisted_size = 1; - * - * @return Whether the persistedSize field is set. - */ - public boolean hasPersistedSize() { - return writeStatusCase_ == 1; - } - /** - * - * - *
-     * The total number of bytes that have been processed for the given object
-     * from all `WriteObject` calls. Only set if the upload has not finalized.
-     * 
- * - * int64 persisted_size = 1; - * - * @return The persistedSize. - */ - public long getPersistedSize() { - if (writeStatusCase_ == 1) { - return (java.lang.Long) writeStatus_; - } - return 0L; - } - /** - * - * - *
-     * The total number of bytes that have been processed for the given object
-     * from all `WriteObject` calls. Only set if the upload has not finalized.
-     * 
- * - * int64 persisted_size = 1; - * - * @param value The persistedSize to set. - * @return This builder for chaining. - */ - public Builder setPersistedSize(long value) { - writeStatusCase_ = 1; - writeStatus_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The total number of bytes that have been processed for the given object
-     * from all `WriteObject` calls. Only set if the upload has not finalized.
-     * 
- * - * int64 persisted_size = 1; - * - * @return This builder for chaining. - */ - public Builder clearPersistedSize() { - if (writeStatusCase_ == 1) { - writeStatusCase_ = 0; - writeStatus_ = null; - onChanged(); - } - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder> - resourceBuilder_; - /** - * - * - *
-     * A resource containing the metadata for the uploaded object. Only set if
-     * the upload has finalized.
-     * 
- * - * .google.storage.v2.Object resource = 2; - * - * @return Whether the resource field is set. - */ - @java.lang.Override - public boolean hasResource() { - return writeStatusCase_ == 2; - } - /** - * - * - *
-     * A resource containing the metadata for the uploaded object. Only set if
-     * the upload has finalized.
-     * 
- * - * .google.storage.v2.Object resource = 2; - * - * @return The resource. - */ - @java.lang.Override - public com.google.storage.v2.Object getResource() { - if (resourceBuilder_ == null) { - if (writeStatusCase_ == 2) { - return (com.google.storage.v2.Object) writeStatus_; - } - return com.google.storage.v2.Object.getDefaultInstance(); - } else { - if (writeStatusCase_ == 2) { - return resourceBuilder_.getMessage(); - } - return com.google.storage.v2.Object.getDefaultInstance(); - } - } - /** - * - * - *
-     * A resource containing the metadata for the uploaded object. Only set if
-     * the upload has finalized.
-     * 
- * - * .google.storage.v2.Object resource = 2; - */ - public Builder setResource(com.google.storage.v2.Object value) { - if (resourceBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - writeStatus_ = value; - onChanged(); - } else { - resourceBuilder_.setMessage(value); - } - writeStatusCase_ = 2; - return this; - } - /** - * - * - *
-     * A resource containing the metadata for the uploaded object. Only set if
-     * the upload has finalized.
-     * 
- * - * .google.storage.v2.Object resource = 2; - */ - public Builder setResource(com.google.storage.v2.Object.Builder builderForValue) { - if (resourceBuilder_ == null) { - writeStatus_ = builderForValue.build(); - onChanged(); - } else { - resourceBuilder_.setMessage(builderForValue.build()); - } - writeStatusCase_ = 2; - return this; - } - /** - * - * - *
-     * A resource containing the metadata for the uploaded object. Only set if
-     * the upload has finalized.
-     * 
- * - * .google.storage.v2.Object resource = 2; - */ - public Builder mergeResource(com.google.storage.v2.Object value) { - if (resourceBuilder_ == null) { - if (writeStatusCase_ == 2 - && writeStatus_ != com.google.storage.v2.Object.getDefaultInstance()) { - writeStatus_ = - com.google.storage.v2.Object.newBuilder((com.google.storage.v2.Object) writeStatus_) - .mergeFrom(value) - .buildPartial(); - } else { - writeStatus_ = value; - } - onChanged(); - } else { - if (writeStatusCase_ == 2) { - resourceBuilder_.mergeFrom(value); - } - resourceBuilder_.setMessage(value); - } - writeStatusCase_ = 2; - return this; - } - /** - * - * - *
-     * A resource containing the metadata for the uploaded object. Only set if
-     * the upload has finalized.
-     * 
- * - * .google.storage.v2.Object resource = 2; - */ - public Builder clearResource() { - if (resourceBuilder_ == null) { - if (writeStatusCase_ == 2) { - writeStatusCase_ = 0; - writeStatus_ = null; - onChanged(); - } - } else { - if (writeStatusCase_ == 2) { - writeStatusCase_ = 0; - writeStatus_ = null; - } - resourceBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * A resource containing the metadata for the uploaded object. Only set if
-     * the upload has finalized.
-     * 
- * - * .google.storage.v2.Object resource = 2; - */ - public com.google.storage.v2.Object.Builder getResourceBuilder() { - return getResourceFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A resource containing the metadata for the uploaded object. Only set if
-     * the upload has finalized.
-     * 
- * - * .google.storage.v2.Object resource = 2; - */ - @java.lang.Override - public com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder() { - if ((writeStatusCase_ == 2) && (resourceBuilder_ != null)) { - return resourceBuilder_.getMessageOrBuilder(); - } else { - if (writeStatusCase_ == 2) { - return (com.google.storage.v2.Object) writeStatus_; - } - return com.google.storage.v2.Object.getDefaultInstance(); - } - } - /** - * - * - *
-     * A resource containing the metadata for the uploaded object. Only set if
-     * the upload has finalized.
-     * 
- * - * .google.storage.v2.Object resource = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder> - getResourceFieldBuilder() { - if (resourceBuilder_ == null) { - if (!(writeStatusCase_ == 2)) { - writeStatus_ = com.google.storage.v2.Object.getDefaultInstance(); - } - resourceBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder>( - (com.google.storage.v2.Object) writeStatus_, getParentForChildren(), isClean()); - writeStatus_ = null; - } - writeStatusCase_ = 2; - onChanged(); - ; - return resourceBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.WriteObjectResponse) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.WriteObjectResponse) - private static final com.google.storage.v2.WriteObjectResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.WriteObjectResponse(); - } - - public static com.google.storage.v2.WriteObjectResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public WriteObjectResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new WriteObjectResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.WriteObjectResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponseOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponseOrBuilder.java deleted file mode 100644 index fe718a7761..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponseOrBuilder.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface WriteObjectResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.WriteObjectResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The total number of bytes that have been processed for the given object
-   * from all `WriteObject` calls. Only set if the upload has not finalized.
-   * 
- * - * int64 persisted_size = 1; - * - * @return Whether the persistedSize field is set. - */ - boolean hasPersistedSize(); - /** - * - * - *
-   * The total number of bytes that have been processed for the given object
-   * from all `WriteObject` calls. Only set if the upload has not finalized.
-   * 
- * - * int64 persisted_size = 1; - * - * @return The persistedSize. - */ - long getPersistedSize(); - - /** - * - * - *
-   * A resource containing the metadata for the uploaded object. Only set if
-   * the upload has finalized.
-   * 
- * - * .google.storage.v2.Object resource = 2; - * - * @return Whether the resource field is set. - */ - boolean hasResource(); - /** - * - * - *
-   * A resource containing the metadata for the uploaded object. Only set if
-   * the upload has finalized.
-   * 
- * - * .google.storage.v2.Object resource = 2; - * - * @return The resource. - */ - com.google.storage.v2.Object getResource(); - /** - * - * - *
-   * A resource containing the metadata for the uploaded object. Only set if
-   * the upload has finalized.
-   * 
- * - * .google.storage.v2.Object resource = 2; - */ - com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder(); - - public com.google.storage.v2.WriteObjectResponse.WriteStatusCase getWriteStatusCase(); -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpec.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpec.java deleted file mode 100644 index d1ef0a7a66..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpec.java +++ /dev/null @@ -1,1440 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -/** - * - * - *
- * Describes an attempt to insert an object, possibly over multiple requests.
- * 
- * - * Protobuf type {@code google.storage.v2.WriteObjectSpec} - */ -public final class WriteObjectSpec extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.storage.v2.WriteObjectSpec) - WriteObjectSpecOrBuilder { - private static final long serialVersionUID = 0L; - // Use WriteObjectSpec.newBuilder() to construct. - private WriteObjectSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private WriteObjectSpec() { - predefinedAcl_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new WriteObjectSpec(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private WriteObjectSpec( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.storage.v2.Object.Builder subBuilder = null; - if (resource_ != null) { - subBuilder = resource_.toBuilder(); - } - resource_ = - input.readMessage(com.google.storage.v2.Object.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(resource_); - resource_ = subBuilder.buildPartial(); - } - - break; - } - case 16: - { - int rawValue = input.readEnum(); - - predefinedAcl_ = rawValue; - break; - } - case 24: - { - bitField0_ |= 0x00000001; - ifGenerationMatch_ = input.readInt64(); - break; - } - case 32: - { - bitField0_ |= 0x00000002; - ifGenerationNotMatch_ = input.readInt64(); - break; - } - case 40: - { - bitField0_ |= 0x00000004; - ifMetagenerationMatch_ = input.readInt64(); - break; - } - case 48: - { - bitField0_ |= 0x00000008; - ifMetagenerationNotMatch_ = input.readInt64(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_WriteObjectSpec_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_WriteObjectSpec_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.WriteObjectSpec.class, - com.google.storage.v2.WriteObjectSpec.Builder.class); - } - - private int bitField0_; - public static final int RESOURCE_FIELD_NUMBER = 1; - private com.google.storage.v2.Object resource_; - /** - * - * - *
-   * Destination object, including its name and its metadata.
-   * 
- * - * .google.storage.v2.Object resource = 1; - * - * @return Whether the resource field is set. - */ - @java.lang.Override - public boolean hasResource() { - return resource_ != null; - } - /** - * - * - *
-   * Destination object, including its name and its metadata.
-   * 
- * - * .google.storage.v2.Object resource = 1; - * - * @return The resource. - */ - @java.lang.Override - public com.google.storage.v2.Object getResource() { - return resource_ == null ? com.google.storage.v2.Object.getDefaultInstance() : resource_; - } - /** - * - * - *
-   * Destination object, including its name and its metadata.
-   * 
- * - * .google.storage.v2.Object resource = 1; - */ - @java.lang.Override - public com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder() { - return getResource(); - } - - public static final int PREDEFINED_ACL_FIELD_NUMBER = 2; - private int predefinedAcl_; - /** - * - * - *
-   * Apply a predefined set of access controls to this object.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_acl = 2; - * - * @return The enum numeric value on the wire for predefinedAcl. - */ - @java.lang.Override - public int getPredefinedAclValue() { - return predefinedAcl_; - } - /** - * - * - *
-   * Apply a predefined set of access controls to this object.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_acl = 2; - * - * @return The predefinedAcl. - */ - @java.lang.Override - public com.google.storage.v2.PredefinedObjectAcl getPredefinedAcl() { - @SuppressWarnings("deprecation") - com.google.storage.v2.PredefinedObjectAcl result = - com.google.storage.v2.PredefinedObjectAcl.valueOf(predefinedAcl_); - return result == null ? com.google.storage.v2.PredefinedObjectAcl.UNRECOGNIZED : result; - } - - public static final int IF_GENERATION_MATCH_FIELD_NUMBER = 3; - private long ifGenerationMatch_; - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * generation matches the given value. Setting to 0 makes the operation
-   * succeed only if there are no live versions of the object.
-   * 
- * - * optional int64 if_generation_match = 3; - * - * @return Whether the ifGenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfGenerationMatch() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * generation matches the given value. Setting to 0 makes the operation
-   * succeed only if there are no live versions of the object.
-   * 
- * - * optional int64 if_generation_match = 3; - * - * @return The ifGenerationMatch. - */ - @java.lang.Override - public long getIfGenerationMatch() { - return ifGenerationMatch_; - } - - public static final int IF_GENERATION_NOT_MATCH_FIELD_NUMBER = 4; - private long ifGenerationNotMatch_; - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * generation does not match the given value. If no live object exists, the
-   * precondition fails. Setting to 0 makes the operation succeed only if
-   * there is a live version of the object.
-   * 
- * - * optional int64 if_generation_not_match = 4; - * - * @return Whether the ifGenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfGenerationNotMatch() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * generation does not match the given value. If no live object exists, the
-   * precondition fails. Setting to 0 makes the operation succeed only if
-   * there is a live version of the object.
-   * 
- * - * optional int64 if_generation_not_match = 4; - * - * @return The ifGenerationNotMatch. - */ - @java.lang.Override - public long getIfGenerationNotMatch() { - return ifGenerationNotMatch_; - } - - public static final int IF_METAGENERATION_MATCH_FIELD_NUMBER = 5; - private long ifMetagenerationMatch_; - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * metageneration matches the given value.
-   * 
- * - * optional int64 if_metageneration_match = 5; - * - * @return Whether the ifMetagenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationMatch() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * metageneration matches the given value.
-   * 
- * - * optional int64 if_metageneration_match = 5; - * - * @return The ifMetagenerationMatch. - */ - @java.lang.Override - public long getIfMetagenerationMatch() { - return ifMetagenerationMatch_; - } - - public static final int IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER = 6; - private long ifMetagenerationNotMatch_; - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * metageneration does not match the given value.
-   * 
- * - * optional int64 if_metageneration_not_match = 6; - * - * @return Whether the ifMetagenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationNotMatch() { - return ((bitField0_ & 0x00000008) != 0); - } - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * metageneration does not match the given value.
-   * 
- * - * optional int64 if_metageneration_not_match = 6; - * - * @return The ifMetagenerationNotMatch. - */ - @java.lang.Override - public long getIfMetagenerationNotMatch() { - return ifMetagenerationNotMatch_; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (resource_ != null) { - output.writeMessage(1, getResource()); - } - if (predefinedAcl_ - != com.google.storage.v2.PredefinedObjectAcl.PREDEFINED_OBJECT_ACL_UNSPECIFIED - .getNumber()) { - output.writeEnum(2, predefinedAcl_); - } - if (((bitField0_ & 0x00000001) != 0)) { - output.writeInt64(3, ifGenerationMatch_); - } - if (((bitField0_ & 0x00000002) != 0)) { - output.writeInt64(4, ifGenerationNotMatch_); - } - if (((bitField0_ & 0x00000004) != 0)) { - output.writeInt64(5, ifMetagenerationMatch_); - } - if (((bitField0_ & 0x00000008) != 0)) { - output.writeInt64(6, ifMetagenerationNotMatch_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (resource_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getResource()); - } - if (predefinedAcl_ - != com.google.storage.v2.PredefinedObjectAcl.PREDEFINED_OBJECT_ACL_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, predefinedAcl_); - } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, ifGenerationMatch_); - } - if (((bitField0_ & 0x00000002) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, ifGenerationNotMatch_); - } - if (((bitField0_ & 0x00000004) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, ifMetagenerationMatch_); - } - if (((bitField0_ & 0x00000008) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(6, ifMetagenerationNotMatch_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.storage.v2.WriteObjectSpec)) { - return super.equals(obj); - } - com.google.storage.v2.WriteObjectSpec other = (com.google.storage.v2.WriteObjectSpec) obj; - - if (hasResource() != other.hasResource()) return false; - if (hasResource()) { - if (!getResource().equals(other.getResource())) return false; - } - if (predefinedAcl_ != other.predefinedAcl_) return false; - if (hasIfGenerationMatch() != other.hasIfGenerationMatch()) return false; - if (hasIfGenerationMatch()) { - if (getIfGenerationMatch() != other.getIfGenerationMatch()) return false; - } - if (hasIfGenerationNotMatch() != other.hasIfGenerationNotMatch()) return false; - if (hasIfGenerationNotMatch()) { - if (getIfGenerationNotMatch() != other.getIfGenerationNotMatch()) return false; - } - if (hasIfMetagenerationMatch() != other.hasIfMetagenerationMatch()) return false; - if (hasIfMetagenerationMatch()) { - if (getIfMetagenerationMatch() != other.getIfMetagenerationMatch()) return false; - } - if (hasIfMetagenerationNotMatch() != other.hasIfMetagenerationNotMatch()) return false; - if (hasIfMetagenerationNotMatch()) { - if (getIfMetagenerationNotMatch() != other.getIfMetagenerationNotMatch()) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasResource()) { - hash = (37 * hash) + RESOURCE_FIELD_NUMBER; - hash = (53 * hash) + getResource().hashCode(); - } - hash = (37 * hash) + PREDEFINED_ACL_FIELD_NUMBER; - hash = (53 * hash) + predefinedAcl_; - if (hasIfGenerationMatch()) { - hash = (37 * hash) + IF_GENERATION_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfGenerationMatch()); - } - if (hasIfGenerationNotMatch()) { - hash = (37 * hash) + IF_GENERATION_NOT_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfGenerationNotMatch()); - } - if (hasIfMetagenerationMatch()) { - hash = (37 * hash) + IF_METAGENERATION_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationMatch()); - } - if (hasIfMetagenerationNotMatch()) { - hash = (37 * hash) + IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationNotMatch()); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.storage.v2.WriteObjectSpec parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.WriteObjectSpec parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.WriteObjectSpec parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.WriteObjectSpec parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.WriteObjectSpec parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.storage.v2.WriteObjectSpec parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.storage.v2.WriteObjectSpec parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.WriteObjectSpec parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.WriteObjectSpec parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.storage.v2.WriteObjectSpec parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.storage.v2.WriteObjectSpec parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.storage.v2.WriteObjectSpec parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.storage.v2.WriteObjectSpec prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Describes an attempt to insert an object, possibly over multiple requests.
-   * 
- * - * Protobuf type {@code google.storage.v2.WriteObjectSpec} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.storage.v2.WriteObjectSpec) - com.google.storage.v2.WriteObjectSpecOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_WriteObjectSpec_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_WriteObjectSpec_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.storage.v2.WriteObjectSpec.class, - com.google.storage.v2.WriteObjectSpec.Builder.class); - } - - // Construct using com.google.storage.v2.WriteObjectSpec.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (resourceBuilder_ == null) { - resource_ = null; - } else { - resource_ = null; - resourceBuilder_ = null; - } - predefinedAcl_ = 0; - - ifGenerationMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000001); - ifGenerationNotMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000002); - ifMetagenerationMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000004); - ifMetagenerationNotMatch_ = 0L; - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_WriteObjectSpec_descriptor; - } - - @java.lang.Override - public com.google.storage.v2.WriteObjectSpec getDefaultInstanceForType() { - return com.google.storage.v2.WriteObjectSpec.getDefaultInstance(); - } - - @java.lang.Override - public com.google.storage.v2.WriteObjectSpec build() { - com.google.storage.v2.WriteObjectSpec result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.storage.v2.WriteObjectSpec buildPartial() { - com.google.storage.v2.WriteObjectSpec result = - new com.google.storage.v2.WriteObjectSpec(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (resourceBuilder_ == null) { - result.resource_ = resource_; - } else { - result.resource_ = resourceBuilder_.build(); - } - result.predefinedAcl_ = predefinedAcl_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.ifGenerationMatch_ = ifGenerationMatch_; - to_bitField0_ |= 0x00000001; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.ifGenerationNotMatch_ = ifGenerationNotMatch_; - to_bitField0_ |= 0x00000002; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.ifMetagenerationMatch_ = ifMetagenerationMatch_; - to_bitField0_ |= 0x00000004; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.ifMetagenerationNotMatch_ = ifMetagenerationNotMatch_; - to_bitField0_ |= 0x00000008; - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.storage.v2.WriteObjectSpec) { - return mergeFrom((com.google.storage.v2.WriteObjectSpec) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.storage.v2.WriteObjectSpec other) { - if (other == com.google.storage.v2.WriteObjectSpec.getDefaultInstance()) return this; - if (other.hasResource()) { - mergeResource(other.getResource()); - } - if (other.predefinedAcl_ != 0) { - setPredefinedAclValue(other.getPredefinedAclValue()); - } - if (other.hasIfGenerationMatch()) { - setIfGenerationMatch(other.getIfGenerationMatch()); - } - if (other.hasIfGenerationNotMatch()) { - setIfGenerationNotMatch(other.getIfGenerationNotMatch()); - } - if (other.hasIfMetagenerationMatch()) { - setIfMetagenerationMatch(other.getIfMetagenerationMatch()); - } - if (other.hasIfMetagenerationNotMatch()) { - setIfMetagenerationNotMatch(other.getIfMetagenerationNotMatch()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.storage.v2.WriteObjectSpec parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.storage.v2.WriteObjectSpec) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private com.google.storage.v2.Object resource_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder> - resourceBuilder_; - /** - * - * - *
-     * Destination object, including its name and its metadata.
-     * 
- * - * .google.storage.v2.Object resource = 1; - * - * @return Whether the resource field is set. - */ - public boolean hasResource() { - return resourceBuilder_ != null || resource_ != null; - } - /** - * - * - *
-     * Destination object, including its name and its metadata.
-     * 
- * - * .google.storage.v2.Object resource = 1; - * - * @return The resource. - */ - public com.google.storage.v2.Object getResource() { - if (resourceBuilder_ == null) { - return resource_ == null ? com.google.storage.v2.Object.getDefaultInstance() : resource_; - } else { - return resourceBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Destination object, including its name and its metadata.
-     * 
- * - * .google.storage.v2.Object resource = 1; - */ - public Builder setResource(com.google.storage.v2.Object value) { - if (resourceBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - resource_ = value; - onChanged(); - } else { - resourceBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Destination object, including its name and its metadata.
-     * 
- * - * .google.storage.v2.Object resource = 1; - */ - public Builder setResource(com.google.storage.v2.Object.Builder builderForValue) { - if (resourceBuilder_ == null) { - resource_ = builderForValue.build(); - onChanged(); - } else { - resourceBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Destination object, including its name and its metadata.
-     * 
- * - * .google.storage.v2.Object resource = 1; - */ - public Builder mergeResource(com.google.storage.v2.Object value) { - if (resourceBuilder_ == null) { - if (resource_ != null) { - resource_ = - com.google.storage.v2.Object.newBuilder(resource_).mergeFrom(value).buildPartial(); - } else { - resource_ = value; - } - onChanged(); - } else { - resourceBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Destination object, including its name and its metadata.
-     * 
- * - * .google.storage.v2.Object resource = 1; - */ - public Builder clearResource() { - if (resourceBuilder_ == null) { - resource_ = null; - onChanged(); - } else { - resource_ = null; - resourceBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Destination object, including its name and its metadata.
-     * 
- * - * .google.storage.v2.Object resource = 1; - */ - public com.google.storage.v2.Object.Builder getResourceBuilder() { - - onChanged(); - return getResourceFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Destination object, including its name and its metadata.
-     * 
- * - * .google.storage.v2.Object resource = 1; - */ - public com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder() { - if (resourceBuilder_ != null) { - return resourceBuilder_.getMessageOrBuilder(); - } else { - return resource_ == null ? com.google.storage.v2.Object.getDefaultInstance() : resource_; - } - } - /** - * - * - *
-     * Destination object, including its name and its metadata.
-     * 
- * - * .google.storage.v2.Object resource = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder> - getResourceFieldBuilder() { - if (resourceBuilder_ == null) { - resourceBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Object, - com.google.storage.v2.Object.Builder, - com.google.storage.v2.ObjectOrBuilder>( - getResource(), getParentForChildren(), isClean()); - resource_ = null; - } - return resourceBuilder_; - } - - private int predefinedAcl_ = 0; - /** - * - * - *
-     * Apply a predefined set of access controls to this object.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_acl = 2; - * - * @return The enum numeric value on the wire for predefinedAcl. - */ - @java.lang.Override - public int getPredefinedAclValue() { - return predefinedAcl_; - } - /** - * - * - *
-     * Apply a predefined set of access controls to this object.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_acl = 2; - * - * @param value The enum numeric value on the wire for predefinedAcl to set. - * @return This builder for chaining. - */ - public Builder setPredefinedAclValue(int value) { - - predefinedAcl_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Apply a predefined set of access controls to this object.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_acl = 2; - * - * @return The predefinedAcl. - */ - @java.lang.Override - public com.google.storage.v2.PredefinedObjectAcl getPredefinedAcl() { - @SuppressWarnings("deprecation") - com.google.storage.v2.PredefinedObjectAcl result = - com.google.storage.v2.PredefinedObjectAcl.valueOf(predefinedAcl_); - return result == null ? com.google.storage.v2.PredefinedObjectAcl.UNRECOGNIZED : result; - } - /** - * - * - *
-     * Apply a predefined set of access controls to this object.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_acl = 2; - * - * @param value The predefinedAcl to set. - * @return This builder for chaining. - */ - public Builder setPredefinedAcl(com.google.storage.v2.PredefinedObjectAcl value) { - if (value == null) { - throw new NullPointerException(); - } - - predefinedAcl_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * Apply a predefined set of access controls to this object.
-     * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_acl = 2; - * - * @return This builder for chaining. - */ - public Builder clearPredefinedAcl() { - - predefinedAcl_ = 0; - onChanged(); - return this; - } - - private long ifGenerationMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * generation matches the given value. Setting to 0 makes the operation
-     * succeed only if there are no live versions of the object.
-     * 
- * - * optional int64 if_generation_match = 3; - * - * @return Whether the ifGenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfGenerationMatch() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * generation matches the given value. Setting to 0 makes the operation
-     * succeed only if there are no live versions of the object.
-     * 
- * - * optional int64 if_generation_match = 3; - * - * @return The ifGenerationMatch. - */ - @java.lang.Override - public long getIfGenerationMatch() { - return ifGenerationMatch_; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * generation matches the given value. Setting to 0 makes the operation
-     * succeed only if there are no live versions of the object.
-     * 
- * - * optional int64 if_generation_match = 3; - * - * @param value The ifGenerationMatch to set. - * @return This builder for chaining. - */ - public Builder setIfGenerationMatch(long value) { - bitField0_ |= 0x00000001; - ifGenerationMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * generation matches the given value. Setting to 0 makes the operation
-     * succeed only if there are no live versions of the object.
-     * 
- * - * optional int64 if_generation_match = 3; - * - * @return This builder for chaining. - */ - public Builder clearIfGenerationMatch() { - bitField0_ = (bitField0_ & ~0x00000001); - ifGenerationMatch_ = 0L; - onChanged(); - return this; - } - - private long ifGenerationNotMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * generation does not match the given value. If no live object exists, the
-     * precondition fails. Setting to 0 makes the operation succeed only if
-     * there is a live version of the object.
-     * 
- * - * optional int64 if_generation_not_match = 4; - * - * @return Whether the ifGenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfGenerationNotMatch() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * generation does not match the given value. If no live object exists, the
-     * precondition fails. Setting to 0 makes the operation succeed only if
-     * there is a live version of the object.
-     * 
- * - * optional int64 if_generation_not_match = 4; - * - * @return The ifGenerationNotMatch. - */ - @java.lang.Override - public long getIfGenerationNotMatch() { - return ifGenerationNotMatch_; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * generation does not match the given value. If no live object exists, the
-     * precondition fails. Setting to 0 makes the operation succeed only if
-     * there is a live version of the object.
-     * 
- * - * optional int64 if_generation_not_match = 4; - * - * @param value The ifGenerationNotMatch to set. - * @return This builder for chaining. - */ - public Builder setIfGenerationNotMatch(long value) { - bitField0_ |= 0x00000002; - ifGenerationNotMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * generation does not match the given value. If no live object exists, the
-     * precondition fails. Setting to 0 makes the operation succeed only if
-     * there is a live version of the object.
-     * 
- * - * optional int64 if_generation_not_match = 4; - * - * @return This builder for chaining. - */ - public Builder clearIfGenerationNotMatch() { - bitField0_ = (bitField0_ & ~0x00000002); - ifGenerationNotMatch_ = 0L; - onChanged(); - return this; - } - - private long ifMetagenerationMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration matches the given value.
-     * 
- * - * optional int64 if_metageneration_match = 5; - * - * @return Whether the ifMetagenerationMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationMatch() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration matches the given value.
-     * 
- * - * optional int64 if_metageneration_match = 5; - * - * @return The ifMetagenerationMatch. - */ - @java.lang.Override - public long getIfMetagenerationMatch() { - return ifMetagenerationMatch_; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration matches the given value.
-     * 
- * - * optional int64 if_metageneration_match = 5; - * - * @param value The ifMetagenerationMatch to set. - * @return This builder for chaining. - */ - public Builder setIfMetagenerationMatch(long value) { - bitField0_ |= 0x00000004; - ifMetagenerationMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration matches the given value.
-     * 
- * - * optional int64 if_metageneration_match = 5; - * - * @return This builder for chaining. - */ - public Builder clearIfMetagenerationMatch() { - bitField0_ = (bitField0_ & ~0x00000004); - ifMetagenerationMatch_ = 0L; - onChanged(); - return this; - } - - private long ifMetagenerationNotMatch_; - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration does not match the given value.
-     * 
- * - * optional int64 if_metageneration_not_match = 6; - * - * @return Whether the ifMetagenerationNotMatch field is set. - */ - @java.lang.Override - public boolean hasIfMetagenerationNotMatch() { - return ((bitField0_ & 0x00000008) != 0); - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration does not match the given value.
-     * 
- * - * optional int64 if_metageneration_not_match = 6; - * - * @return The ifMetagenerationNotMatch. - */ - @java.lang.Override - public long getIfMetagenerationNotMatch() { - return ifMetagenerationNotMatch_; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration does not match the given value.
-     * 
- * - * optional int64 if_metageneration_not_match = 6; - * - * @param value The ifMetagenerationNotMatch to set. - * @return This builder for chaining. - */ - public Builder setIfMetagenerationNotMatch(long value) { - bitField0_ |= 0x00000008; - ifMetagenerationNotMatch_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Makes the operation conditional on whether the object's current
-     * metageneration does not match the given value.
-     * 
- * - * optional int64 if_metageneration_not_match = 6; - * - * @return This builder for chaining. - */ - public Builder clearIfMetagenerationNotMatch() { - bitField0_ = (bitField0_ & ~0x00000008); - ifMetagenerationNotMatch_ = 0L; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.storage.v2.WriteObjectSpec) - } - - // @@protoc_insertion_point(class_scope:google.storage.v2.WriteObjectSpec) - private static final com.google.storage.v2.WriteObjectSpec DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.storage.v2.WriteObjectSpec(); - } - - public static com.google.storage.v2.WriteObjectSpec getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public WriteObjectSpec parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new WriteObjectSpec(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.storage.v2.WriteObjectSpec getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpecOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpecOrBuilder.java deleted file mode 100644 index 459b4e9c3d..0000000000 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpecOrBuilder.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/storage/v2/storage.proto - -package com.google.storage.v2; - -public interface WriteObjectSpecOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.WriteObjectSpec) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Destination object, including its name and its metadata.
-   * 
- * - * .google.storage.v2.Object resource = 1; - * - * @return Whether the resource field is set. - */ - boolean hasResource(); - /** - * - * - *
-   * Destination object, including its name and its metadata.
-   * 
- * - * .google.storage.v2.Object resource = 1; - * - * @return The resource. - */ - com.google.storage.v2.Object getResource(); - /** - * - * - *
-   * Destination object, including its name and its metadata.
-   * 
- * - * .google.storage.v2.Object resource = 1; - */ - com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder(); - - /** - * - * - *
-   * Apply a predefined set of access controls to this object.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_acl = 2; - * - * @return The enum numeric value on the wire for predefinedAcl. - */ - int getPredefinedAclValue(); - /** - * - * - *
-   * Apply a predefined set of access controls to this object.
-   * 
- * - * .google.storage.v2.PredefinedObjectAcl predefined_acl = 2; - * - * @return The predefinedAcl. - */ - com.google.storage.v2.PredefinedObjectAcl getPredefinedAcl(); - - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * generation matches the given value. Setting to 0 makes the operation
-   * succeed only if there are no live versions of the object.
-   * 
- * - * optional int64 if_generation_match = 3; - * - * @return Whether the ifGenerationMatch field is set. - */ - boolean hasIfGenerationMatch(); - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * generation matches the given value. Setting to 0 makes the operation
-   * succeed only if there are no live versions of the object.
-   * 
- * - * optional int64 if_generation_match = 3; - * - * @return The ifGenerationMatch. - */ - long getIfGenerationMatch(); - - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * generation does not match the given value. If no live object exists, the
-   * precondition fails. Setting to 0 makes the operation succeed only if
-   * there is a live version of the object.
-   * 
- * - * optional int64 if_generation_not_match = 4; - * - * @return Whether the ifGenerationNotMatch field is set. - */ - boolean hasIfGenerationNotMatch(); - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * generation does not match the given value. If no live object exists, the
-   * precondition fails. Setting to 0 makes the operation succeed only if
-   * there is a live version of the object.
-   * 
- * - * optional int64 if_generation_not_match = 4; - * - * @return The ifGenerationNotMatch. - */ - long getIfGenerationNotMatch(); - - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * metageneration matches the given value.
-   * 
- * - * optional int64 if_metageneration_match = 5; - * - * @return Whether the ifMetagenerationMatch field is set. - */ - boolean hasIfMetagenerationMatch(); - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * metageneration matches the given value.
-   * 
- * - * optional int64 if_metageneration_match = 5; - * - * @return The ifMetagenerationMatch. - */ - long getIfMetagenerationMatch(); - - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * metageneration does not match the given value.
-   * 
- * - * optional int64 if_metageneration_not_match = 6; - * - * @return Whether the ifMetagenerationNotMatch field is set. - */ - boolean hasIfMetagenerationNotMatch(); - /** - * - * - *
-   * Makes the operation conditional on whether the object's current
-   * metageneration does not match the given value.
-   * 
- * - * optional int64 if_metageneration_not_match = 6; - * - * @return The ifMetagenerationNotMatch. - */ - long getIfMetagenerationNotMatch(); -} diff --git a/proto-google-cloud-storage-v2/src/main/proto/google/storage/v2/storage.proto b/proto-google-cloud-storage-v2/src/main/proto/google/storage/v2/storage.proto deleted file mode 100644 index 33b1f1cffc..0000000000 --- a/proto-google-cloud-storage-v2/src/main/proto/google/storage/v2/storage.proto +++ /dev/null @@ -1,2177 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.storage.v2; - -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/iam/v1/iam_policy.proto"; -import "google/iam/v1/policy.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/type/date.proto"; - -option go_package = "google.golang.org/genproto/googleapis/storage/v2;storage"; -option java_multiple_files = true; -option java_outer_classname = "StorageProto"; -option java_package = "com.google.storage.v2"; -option (google.api.resource_definition) = { - type: "cloudkms.googleapis.com/CryptoKey" - pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" -}; - -// ## API Overview and Naming Syntax -// -// The Cloud Storage gRPC API allows applications to read and write data through -// the abstractions of buckets and objects. For a description of these -// abstractions please see https://cloud.google.com/storage/docs. -// -// Resources are named as follows: -// - Projects are referred to as they are defined by the Resource Manager API, -// using strings like `projects/123456` or `projects/my-string-id`. -// - Buckets are named using string names of the form: -// `projects/{project}/buckets/{bucket}` -// For globally unique buckets, `_` may be substituted for the project. -// - Objects are uniquely identified by their name along with the name of the -// bucket they belong to, as separate strings in this API. For example: -// -// ReadObjectRequest { -// bucket: 'projects/_/buckets/my-bucket' -// object: 'my-object' -// } -// Note that object names can contain `/` characters, which are treated as -// any other character (no special directory semantics). -service Storage { - option (google.api.default_host) = "storage.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/cloud-platform.read-only," - "https://www.googleapis.com/auth/devstorage.full_control," - "https://www.googleapis.com/auth/devstorage.read_only," - "https://www.googleapis.com/auth/devstorage.read_write"; - - // Permanently deletes an empty bucket. - rpc DeleteBucket(DeleteBucketRequest) returns (google.protobuf.Empty) { - option (google.api.method_signature) = "name"; - } - - // Returns metadata for the specified bucket. - rpc GetBucket(GetBucketRequest) returns (Bucket) { - option (google.api.method_signature) = "name"; - } - - // Creates a new bucket. - rpc CreateBucket(CreateBucketRequest) returns (Bucket) { - option (google.api.method_signature) = "parent,bucket,bucket_id"; - } - - // Retrieves a list of buckets for a given project. - rpc ListBuckets(ListBucketsRequest) returns (ListBucketsResponse) { - option (google.api.method_signature) = "parent"; - } - - // Locks retention policy on a bucket. - rpc LockBucketRetentionPolicy(LockBucketRetentionPolicyRequest) returns (Bucket) { - option (google.api.method_signature) = "bucket"; - } - - // Gets the IAM policy for a specified bucket. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { - option (google.api.method_signature) = "resource"; - } - - // Updates an IAM policy for the specified bucket. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { - option (google.api.method_signature) = "resource,policy"; - } - - // Tests a set of permissions on the given bucket to see which, if - // any, are held by the caller. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { - option (google.api.method_signature) = "resource,permissions"; - } - - // Updates a bucket. Equivalent to JSON API's storage.buckets.patch method. - rpc UpdateBucket(UpdateBucketRequest) returns (Bucket) { - option (google.api.method_signature) = "bucket,update_mask"; - } - - // Permanently deletes a notification subscription. - rpc DeleteNotification(DeleteNotificationRequest) returns (google.protobuf.Empty) { - option (google.api.method_signature) = "name"; - } - - // View a notification config. - rpc GetNotification(GetNotificationRequest) returns (Notification) { - option (google.api.method_signature) = "name"; - } - - // Creates a notification subscription for a given bucket. - // These notifications, when triggered, publish messages to the specified - // Pub/Sub topics. - // See https://cloud.google.com/storage/docs/pubsub-notifications. - rpc CreateNotification(CreateNotificationRequest) returns (Notification) { - option (google.api.method_signature) = "parent,notification"; - } - - // Retrieves a list of notification subscriptions for a given bucket. - rpc ListNotifications(ListNotificationsRequest) returns (ListNotificationsResponse) { - option (google.api.method_signature) = "parent"; - } - - // Concatenates a list of existing objects into a new object in the same - // bucket. - rpc ComposeObject(ComposeObjectRequest) returns (Object) { - } - - // Deletes an object and its metadata. Deletions are permanent if versioning - // is not enabled for the bucket, or if the `generation` parameter - // is used. - rpc DeleteObject(DeleteObjectRequest) returns (google.protobuf.Empty) { - option (google.api.method_signature) = "bucket,object"; - option (google.api.method_signature) = "bucket,object,generation"; - } - - // Retrieves an object's metadata. - rpc GetObject(GetObjectRequest) returns (Object) { - option (google.api.method_signature) = "bucket,object"; - option (google.api.method_signature) = "bucket,object,generation"; - } - - // Reads an object's data. - rpc ReadObject(ReadObjectRequest) returns (stream ReadObjectResponse) { - option (google.api.method_signature) = "bucket,object"; - option (google.api.method_signature) = "bucket,object,generation"; - } - - // Updates an object's metadata. - // Equivalent to JSON API's storage.objects.patch. - rpc UpdateObject(UpdateObjectRequest) returns (Object) { - option (google.api.method_signature) = "object,update_mask"; - } - - // Stores a new object and metadata. - // - // An object can be written either in a single message stream or in a - // resumable sequence of message streams. To write using a single stream, - // the client should include in the first message of the stream an - // `WriteObjectSpec` describing the destination bucket, object, and any - // preconditions. Additionally, the final message must set 'finish_write' to - // true, or else it is an error. - // - // For a resumable write, the client should instead call - // `StartResumableWrite()` and provide that method an `WriteObjectSpec.` - // They should then attach the returned `upload_id` to the first message of - // each following call to `Create`. If there is an error or the connection is - // broken during the resumable `Create()`, the client should check the status - // of the `Create()` by calling `QueryWriteStatus()` and continue writing from - // the returned `persisted_size`. This may be less than the amount of data the - // client previously sent. - // - // The service will not view the object as complete until the client has - // sent a `WriteObjectRequest` with `finish_write` set to `true`. Sending any - // requests on a stream after sending a request with `finish_write` set to - // `true` will cause an error. The client **should** check the response it - // receives to determine how much data the service was able to commit and - // whether the service views the object as complete. - rpc WriteObject(stream WriteObjectRequest) returns (WriteObjectResponse) { - } - - // Retrieves a list of objects matching the criteria. - rpc ListObjects(ListObjectsRequest) returns (ListObjectsResponse) { - option (google.api.method_signature) = "parent"; - } - - // Rewrites a source object to a destination object. Optionally overrides - // metadata. - rpc RewriteObject(RewriteObjectRequest) returns (RewriteResponse) { - } - - // Starts a resumable write. How long the write operation remains valid, and - // what happens when the write operation becomes invalid, are - // service-dependent. - rpc StartResumableWrite(StartResumableWriteRequest) returns (StartResumableWriteResponse) { - } - - // Determines the `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. - rpc QueryWriteStatus(QueryWriteStatusRequest) returns (QueryWriteStatusResponse) { - option (google.api.method_signature) = "upload_id"; - } - - // Retrieves the name of a project's Google Cloud Storage service account. - rpc GetServiceAccount(GetServiceAccountRequest) returns (ServiceAccount) { - option (google.api.method_signature) = "project"; - } - - // Creates a new HMAC key for the given service account. - rpc CreateHmacKey(CreateHmacKeyRequest) returns (CreateHmacKeyResponse) { - option (google.api.method_signature) = "project,service_account_email"; - } - - // Deletes a given HMAC key. Key must be in an INACTIVE state. - rpc DeleteHmacKey(DeleteHmacKeyRequest) returns (google.protobuf.Empty) { - option (google.api.method_signature) = "access_id,project"; - } - - // Gets an existing HMAC key metadata for the given id. - rpc GetHmacKey(GetHmacKeyRequest) returns (HmacKeyMetadata) { - option (google.api.method_signature) = "access_id,project"; - } - - // Lists HMAC keys under a given project with the additional filters provided. - rpc ListHmacKeys(ListHmacKeysRequest) returns (ListHmacKeysResponse) { - option (google.api.method_signature) = "project"; - } - - // Updates a given HMAC key state between ACTIVE and INACTIVE. - rpc UpdateHmacKey(UpdateHmacKeyRequest) returns (HmacKeyMetadata) { - option (google.api.method_signature) = "hmac_key,update_mask"; - } -} - -// Request message for DeleteBucket. -message DeleteBucketRequest { - // Required. Name of a bucket to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "storage.googleapis.com/Bucket" - } - ]; - - // If set, only deletes the bucket if its metageneration matches this value. - optional int64 if_metageneration_match = 2; - - // If set, only deletes the bucket if its metageneration does not match this - // value. - optional int64 if_metageneration_not_match = 3; - - // A set of parameters common to all Storage API requests. - CommonRequestParams common_request_params = 5; -} - -// Request message for GetBucket. -message GetBucketRequest { - // Required. Name of a bucket. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "storage.googleapis.com/Bucket" - } - ]; - - // If set, and if the bucket's current metageneration does not match the - // specified value, the request will return an error. - optional int64 if_metageneration_match = 2; - - // If set, and if the bucket's current metageneration matches the specified - // value, the request will return an error. - optional int64 if_metageneration_not_match = 3; - - // A set of parameters common to all Storage API requests. - CommonRequestParams common_request_params = 4; - - // Mask specifying which fields to read. - // A "*" field may be used to indicate all fields. - // If no mask is specified, will default to all fields. - optional google.protobuf.FieldMask read_mask = 5; -} - -// Request message for CreateBucket. -message CreateBucketRequest { - // Required. The project to which this bucket will belong. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Required. Properties of the new bucket being inserted. - // The project and name of the bucket are specified in this request, not in - // the bucket resource. - Bucket bucket = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID to use for this bucket, which will become the final component of - // the bucket's resource name. For example, the value `foo` might result in - // a bucket with the name `projects/123456/buckets/foo`. - string bucket_id = 3 [(google.api.field_behavior) = REQUIRED]; - - // Apply a predefined set of access controls to this bucket. - PredefinedBucketAcl predefined_acl = 4; - - // Apply a predefined set of default object access controls to this bucket. - PredefinedObjectAcl predefined_default_object_acl = 5; -} - -// Request message for ListBuckets. -message ListBucketsRequest { - // Required. The project whose buckets we are listing. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Maximum number of buckets to return in a single response. The service will - // use this parameter or 1,000 items, whichever is smaller. If "acl" is - // present in the read_mask, the service will use this parameter of 200 items, - // whichever is smaller. - int32 page_size = 2; - - // A previously-returned page token representing part of the larger set of - // results to view. - string page_token = 3; - - // Filter results to buckets whose names begin with this prefix. - string prefix = 4; - - // Mask specifying which fields to read from each result. - // If no mask is specified, will default to all fields except items.owner, - // items.acl, and items.default_object_acl. - // * may be used to mean "all fields". - optional google.protobuf.FieldMask read_mask = 5; - - // A set of parameters common to all Storage API requests. - CommonRequestParams common_request_params = 6; -} - -// The result of a call to Buckets.ListBuckets -message ListBucketsResponse { - // The list of items. - repeated Bucket buckets = 1; - - // The continuation token, used to page through large result sets. Provide - // this value in a subsequent request to return the next page of results. - string next_page_token = 2; -} - -// Request message for LockBucketRetentionPolicyRequest. -message LockBucketRetentionPolicyRequest { - // Required. Name of a bucket. - string bucket = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "storage.googleapis.com/Bucket" - } - ]; - - // Makes the operation conditional on whether bucket's current metageneration - // matches the given value. Must be positive. - int64 if_metageneration_match = 2; - - // A set of parameters common to all Storage API requests. - CommonRequestParams common_request_params = 3; -} - -// Request for UpdateBucket method. -message UpdateBucketRequest { - // The bucket to update. - // The bucket's `name` field will be used to identify the bucket. - Bucket bucket = 1; - - // If set, will only modify the bucket if its metageneration matches this - // value. - optional int64 if_metageneration_match = 2; - - // If set, will only modify the bucket if its metageneration does not match - // this value. - optional int64 if_metageneration_not_match = 3; - - // Apply a predefined set of access controls to this bucket. - PredefinedBucketAcl predefined_acl = 4; - - // Apply a predefined set of default object access controls to this bucket. - PredefinedObjectAcl predefined_default_object_acl = 5; - - // List of fields to be updated. - // - // To specify ALL fields, equivalent to the JSON API's "update" function, - // specify a single field with the value `*`. Note: not recommended. If a new - // field is introduced at a later time, an older client updating with the `*` - // may accidentally reset the new field's value. - // - // Not specifying any fields is an error. - // Not specifying a field while setting that field to a non-default value is - // an error. - google.protobuf.FieldMask update_mask = 6; - - // A set of parameters common to all Storage API requests. - CommonRequestParams common_request_params = 7; -} - -// Request message for DeleteNotification. -message DeleteNotificationRequest { - // Required. The parent bucket of the notification. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "storage.googleapis.com/Notification" - } - ]; -} - -// Request message for GetNotification. -message GetNotificationRequest { - // Required. The parent bucket of the notification. - // Format: - // `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "storage.googleapis.com/Bucket" - } - ]; -} - -// Request message for CreateNotification. -message CreateNotificationRequest { - // Required. The bucket to which this notification belongs. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "storage.googleapis.com/Bucket" - } - ]; - - // Required. Properties of the notification to be inserted. - Notification notification = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for ListNotifications. -message ListNotificationsRequest { - // Required. Name of a Google Cloud Storage bucket. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "storage.googleapis.com/Bucket" - } - ]; - - // The maximum number of notifications to return. The service may return fewer - // than this value. - // The maximum value is 100; values above 100 will be coerced to 100. - int32 page_size = 2; - - // A page token, received from a previous `ListNotifications` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListNotifications` must - // match the call that provided the page token. - string page_token = 3; -} - -// The result of a call to Notifications.ListNotifications -message ListNotificationsResponse { - // The list of items. - repeated Notification notifications = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for ComposeObject. -message ComposeObjectRequest { - // Description of a source object for a composition request. - message SourceObject { - // Preconditions for a source object of a composition request. - message ObjectPreconditions { - // Only perform the composition if the generation of the source object - // that would be used matches this value. If this value and a generation - // are both specified, they must be the same value or the call will fail. - optional int64 if_generation_match = 1; - } - - // Required. The source object's name. All source objects must reside in the same - // bucket. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // The generation of this object to use as the source. - int64 generation = 2; - - // Conditions that must be met for this operation to execute. - ObjectPreconditions object_preconditions = 3; - } - - // Required. Properties of the resulting object. - Object destination = 1 [(google.api.field_behavior) = REQUIRED]; - - // The list of source objects that will be concatenated into a single object. - repeated SourceObject source_objects = 2; - - // Apply a predefined set of access controls to the destination object. - PredefinedObjectAcl destination_predefined_acl = 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 current - // metageneration matches the given value. - optional int64 if_metageneration_match = 5; - - // Resource name of the Cloud KMS key, of the form - // `projects/my-project/locations/my-location/keyRings/my-kr/cryptoKeys/my-key`, - // that will be used to encrypt the object. Overrides the object - // metadata's `kms_key_name` value, if any. - string kms_key = 6 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; - - // A set of parameters common to Storage API requests concerning an object. - CommonObjectRequestParams common_object_request_params = 7; - - // A set of parameters common to all Storage API requests. - CommonRequestParams common_request_params = 8; -} - -// Message for deleting an object. -// Either `bucket` and `object` *or* `upload_id` **must** be set (but not both). -message DeleteObjectRequest { - // Required. Name of the bucket in which the object resides. - string bucket = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the object to delete (when not using a resumable write). - string object = 2 [(google.api.field_behavior) = REQUIRED]; - - // The resumable upload_id of the object to delete (when deleting an - // in-progress resumable write). This should be copied from the `upload_id` - // field of `StartResumableWriteResponse`. - string upload_id = 3; - - // If present, permanently deletes a specific revision of this object (as - // opposed to the latest version, the default). - int64 generation = 4; - - // 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 = 5; - - // Makes the operation conditional on whether the object's current generation - // does not match the given value. If no live object exists, the precondition - // fails. Setting to 0 makes the operation succeed only if there is a live - // version of the object. - optional int64 if_generation_not_match = 6; - - // Makes the operation conditional on whether the object's current - // metageneration matches the given value. - optional int64 if_metageneration_match = 7; - - // Makes the operation conditional on whether the object's current - // metageneration does not match the given value. - optional int64 if_metageneration_not_match = 8; - - // A set of parameters common to Storage API requests concerning an object. - CommonObjectRequestParams common_object_request_params = 10; - - // A set of parameters common to all Storage API requests. - CommonRequestParams common_request_params = 11; -} - -// Request message for ReadObject. -message ReadObjectRequest { - // The name of the bucket containing the object to read. - string bucket = 1; - - // The name of the object to read. - string object = 2; - - // If present, selects a specific revision of this object (as opposed - // to the latest version, the default). - int64 generation = 3; - - // The offset for the first byte to return in the read, relative to the start - // of the object. - // - // A negative `read_offset` value will be interpreted as the number of bytes - // back from the end of the object to be returned. For example, if an object's - // length is 15 bytes, a ReadObjectRequest with `read_offset` = -5 and - // `read_limit` = 3 would return bytes 10 through 12 of the object. Requesting - // a negative offset whose magnitude is larger than the size of the object - // will result in an error. - int64 read_offset = 4; - - // The maximum number of `data` bytes the server is allowed to return in the - // sum of all `Object` messages. A `read_limit` of zero indicates that there - // is no limit, and a negative `read_limit` will cause an error. - // - // If the stream returns fewer bytes than allowed by the `read_limit` and no - // error occurred, the stream includes all data from the `read_offset` to the - // end of the resource. - int64 read_limit = 5; - - // Makes the operation conditional on whether the object's current generation - // matches the given value. Setting to 0 makes the operation succeed only if - // there are no live versions of the object. - optional int64 if_generation_match = 6; - - // Makes the operation conditional on whether the object's current generation - // does not match the given value. If no live object exists, the precondition - // fails. Setting to 0 makes the operation succeed only if there is a live - // version of the object. - optional int64 if_generation_not_match = 7; - - // Makes the operation conditional on whether the object's current - // metageneration matches the given value. - optional int64 if_metageneration_match = 8; - - // Makes the operation conditional on whether the object's current - // metageneration does not match the given value. - optional int64 if_metageneration_not_match = 9; - - // A set of parameters common to Storage API requests concerning an object. - CommonObjectRequestParams common_object_request_params = 10; - - // A set of parameters common to all Storage API requests. - CommonRequestParams common_request_params = 11; - - // Mask specifying which fields to read. - // The checksummed_data field and its children will always be present. - // If no mask is specified, will default to all fields except metadata.owner - // and metadata.acl. - // * may be used to mean "all fields". - optional google.protobuf.FieldMask read_mask = 12; -} - -// Request message for GetObject. -message GetObjectRequest { - // Required. Name of the bucket in which the object resides. - string bucket = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Name of the object. - 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 current generation - // does not match the given value. If no live object exists, the precondition - // fails. Setting to 0 makes the operation succeed only if there is a live - // version of the object. - optional int64 if_generation_not_match = 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; - - // A set of parameters common to all Storage API requests. - CommonRequestParams common_request_params = 9; - - // Mask specifying which fields to read. - // If no mask is specified, will default to all fields except metadata.acl and - // metadata.owner. - // * may be used to mean "all fields". - optional google.protobuf.FieldMask read_mask = 10; -} - -// Response message for GetObject. -message ReadObjectResponse { - // A portion of the data for the object. The service **may** leave `data` - // empty for any given `ReadResponse`. This enables the service to inform the - // client that the request is still live while it is running an operation to - // generate more data. - ChecksummedData checksummed_data = 1; - - // The checksums of the complete object. The client should compute one of - // these checksums over the downloaded object and compare it against the value - // provided here. - ObjectChecksums object_checksums = 2; - - // If read_offset and or read_limit was specified on the - // ReadObjectRequest, ContentRange will be populated on the first - // ReadObjectResponse message of the read stream. - ContentRange content_range = 3; - - // Metadata of the object whose media is being returned. - // Only populated in the first response in the stream. - Object metadata = 4; -} - -// Describes an attempt to insert an object, possibly over multiple requests. -message WriteObjectSpec { - // Destination object, including its name and its metadata. - Object resource = 1; - - // Apply a predefined set of access controls to this object. - PredefinedObjectAcl predefined_acl = 2; - - // Makes the operation conditional on whether the object's current - // generation matches the given value. Setting to 0 makes the operation - // succeed only if there are no live versions of the object. - optional int64 if_generation_match = 3; - - // Makes the operation conditional on whether the object's current - // generation does not match the given value. If no live object exists, the - // precondition fails. Setting to 0 makes the operation succeed only if - // there is a live version of the object. - optional int64 if_generation_not_match = 4; - - // Makes the operation conditional on whether the object's current - // metageneration matches the given value. - optional int64 if_metageneration_match = 5; - - // Makes the operation conditional on whether the object's current - // metageneration does not match the given value. - optional int64 if_metageneration_not_match = 6; -} - -// Request message for WriteObject. -message WriteObjectRequest { - // The first message of each stream should set one of the following. - oneof first_message { - // For resumable uploads. This should be the `upload_id` returned from a - // call to `StartResumableWriteResponse`. - string upload_id = 1; - - // For non-resumable uploads. Describes the overall upload, including the - // destination bucket and object name, preconditions, etc. - WriteObjectSpec write_object_spec = 2; - } - - // Required. The offset from the beginning of the object at which the data should be - // written. - // - // In the first `WriteObjectRequest` of a `WriteObject()` action, it - // indicates the initial offset for the `Write()` call. The value **must** be - // equal to the `persisted_size` that a call to `QueryWriteStatus()` would - // return (0 if this is the first write to the object). - // - // On subsequent calls, this value **must** be no larger than the sum of the - // first `write_offset` and the sizes of all `data` chunks sent previously on - // this stream. - // - // An incorrect value will cause an error. - int64 write_offset = 3 [(google.api.field_behavior) = REQUIRED]; - - // A portion of the data for the object. - oneof data { - // The data to insert. If a crc32c checksum is provided that doesn't match - // the checksum computed by the service, the request will fail. - ChecksummedData checksummed_data = 4; - } - - // Checksums for the complete object. If the checksums computed by the service - // don't match the specifified checksums the call will fail. May only be - // provided in the first or last request (either with first_message, or - // finish_write set). - ObjectChecksums object_checksums = 6; - - // If `true`, this indicates that the write is complete. Sending any - // `WriteObjectRequest`s subsequent to one in which `finish_write` is `true` - // will cause an error. - // For a non-resumable write (where the upload_id was not set in the first - // message), it is an error not to set this field in the final message of the - // stream. - bool finish_write = 7; - - // A set of parameters common to Storage API requests concerning an object. - CommonObjectRequestParams common_object_request_params = 8; - - // A set of parameters common to all Storage API requests. - CommonRequestParams common_request_params = 9; -} - -// Response message for WriteObject. -message WriteObjectResponse { - // The response will set one of the following. - oneof write_status { - // The total number of bytes that have been processed for the given object - // from all `WriteObject` calls. Only set if the upload has not finalized. - int64 persisted_size = 1; - - // A resource containing the metadata for the uploaded object. Only set if - // the upload has finalized. - Object resource = 2; - } -} - -// Request message for ListObjects. -message ListObjectsRequest { - // Required. Name of the bucket in which to look for objects. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "storage.googleapis.com/Bucket" - } - ]; - - // Maximum number of `items` plus `prefixes` to return - // in a single page of responses. As duplicate `prefixes` are - // omitted, fewer total results may be returned than requested. The service - // will use this parameter or 1,000 items, whichever is smaller. - int32 page_size = 2; - - // A previously-returned page token representing part of the larger set of - // results to view. - string page_token = 3; - - // If set, returns results in a directory-like mode. `items` will contain - // only objects whose names, aside from the `prefix`, do not - // contain `delimiter`. Objects whose names, aside from the - // `prefix`, contain `delimiter` will have their name, - // truncated after the `delimiter`, returned in - // `prefixes`. Duplicate `prefixes` are omitted. - string delimiter = 4; - - // If true, objects that end in exactly one instance of `delimiter` - // will have their metadata included in `items` in addition to - // `prefixes`. - bool include_trailing_delimiter = 5; - - // Filter results to objects whose names begin with this prefix. - string prefix = 6; - - // If `true`, lists all versions of an object as distinct results. - // For more information, see - // [Object - // Versioning](https://cloud.google.com/storage/docs/object-versioning). - bool versions = 7; - - // Mask specifying which fields to read from each result. - // If no mask is specified, will default to all fields except items.acl and - // items.owner. - // * may be used to mean "all fields". - optional google.protobuf.FieldMask read_mask = 8; - - // Filter results to objects whose names are lexicographically equal to or - // after lexicographic_start. If lexicographic_end is also set, the objects - // listed have names between lexicographic_start (inclusive) and - // lexicographic_end (exclusive). - string lexicographic_start = 10; - - // Filter results to objects whose names are lexicographically before - // lexicographic_end. If lexicographic_start is also set, the objects listed - // have names between lexicographic_start (inclusive) and lexicographic_end - // (exclusive). - string lexicographic_end = 11; - - // A set of parameters common to all Storage API requests. - CommonRequestParams common_request_params = 9; -} - -// Request object for `QueryWriteStatus`. -message QueryWriteStatusRequest { - // Required. The name of the resume token for the object whose write status is being - // requested. - string upload_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // A set of parameters common to Storage API requests concerning an object. - CommonObjectRequestParams common_object_request_params = 2; - - // A set of parameters common to all Storage API requests. - CommonRequestParams common_request_params = 3; -} - -// Response object for `QueryWriteStatus`. -message QueryWriteStatusResponse { - // The response will set one of the following. - oneof write_status { - // The total number of bytes that have been processed for the given object - // from all `WriteObject` calls. This is the correct value for the - // 'write_offset' field to use when resuming the `WriteObject` operation. - // Only set if the upload has not finalized. - int64 persisted_size = 1; - - // A resource containing the metadata for the uploaded object. Only set if - // the upload has finalized. - Object resource = 2; - } -} - -// Request message for RewriteObject. -// If the source object is encrypted using a Customer-Supplied Encryption Key -// the key information must be provided in the copy_source_encryption_algorithm, -// copy_source_encryption_key_bytes, and copy_source_encryption_key_sha256_bytes -// fields. If the destination object should be encrypted the keying information -// should be provided in the encryption_algorithm, encryption_key_bytes, and -// encryption_key_sha256_bytes fields of the -// common_object_request_params.customer_encryption field. -message RewriteObjectRequest { - // Immutable. The name of the destination object. Nearly any sequence of unicode - // characters is valid. See - // [Guidelines](https://cloud.google.com/storage/docs/naming-objects). - // Example: `test.txt` - // The `name` field by itself does not uniquely identify a Cloud Storage - // object. A Cloud Storage object is uniquely identified by the tuple of - // (bucket, object, generation). - string destination_name = 24 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. The name of the bucket containing The name of the destination object. - string destination_bucket = 25 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.resource_reference) = { - type: "storage.googleapis.com/Bucket" - } - ]; - - // The name of the Cloud KMS key that will be used to encrypt the destination - // object. The Cloud KMS key must be located in same location as the object. - // If the parameter is not specified, the request uses the destination - // bucket's default encryption key, if any, or else the Google-managed - // encryption key. - string destination_kms_key = 27 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; - - // Properties of the destination, post-rewrite object. - // The `name`, `bucket` and `kms_key` fields must not be populated (these - // values are specified in the `destination_name`, `destination_bucket`, and - // `destination_kms_key` fields). - // If `destination` is present it will be used to construct the destination - // object's metadata; otherwise the destination object's metadata will be - // copied from the source object. - Object destination = 1; - - // Required. Name of the bucket in which to find the source object. - string source_bucket = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Name of the source object. - string source_object = 3 [(google.api.field_behavior) = REQUIRED]; - - // If present, selects a specific revision of the source object (as opposed to - // the latest version, the default). - int64 source_generation = 4; - - // Include this field (from the previous rewrite response) on each rewrite - // request after the first one, until the rewrite response 'done' flag is - // true. Calls that provide a rewriteToken can omit all other request fields, - // but if included those fields must match the values provided in the first - // rewrite request. - string rewrite_token = 5; - - // Apply a predefined set of access controls to the destination object. - PredefinedObjectAcl destination_predefined_acl = 6; - - // 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 = 7; - - // Makes the operation conditional on whether the object's current generation - // does not match the given value. If no live object exists, the precondition - // fails. Setting to 0 makes the operation succeed only if there is a live - // version of the object. - optional int64 if_generation_not_match = 8; - - // Makes the operation conditional on whether the destination object's current - // metageneration matches the given value. - optional int64 if_metageneration_match = 9; - - // Makes the operation conditional on whether the destination object's current - // metageneration does not match the given value. - optional int64 if_metageneration_not_match = 10; - - // Makes the operation conditional on whether the source object's current - // generation matches the given value. - optional int64 if_source_generation_match = 11; - - // Makes the operation conditional on whether the source object's current - // generation does not match the given value. - optional int64 if_source_generation_not_match = 12; - - // Makes the operation conditional on whether the source object's current - // metageneration matches the given value. - optional int64 if_source_metageneration_match = 13; - - // Makes the operation conditional on whether the source object's current - // metageneration does not match the given value. - optional int64 if_source_metageneration_not_match = 14; - - // The maximum number of bytes that will be rewritten per rewrite request. - // Most callers - // shouldn't need to specify this parameter - it is primarily in place to - // support testing. If specified the value must be an integral multiple of - // 1 MiB (1048576). Also, this only applies to requests where the source and - // destination span locations and/or storage classes. Finally, this value must - // not change across rewrite calls else you'll get an error that the - // `rewriteToken` is invalid. - int64 max_bytes_rewritten_per_call = 15; - - // The algorithm used to encrypt the source object, if any. Used if the source - // object was encrypted with a Customer-Supplied Encryption Key. - string copy_source_encryption_algorithm = 16; - - // The raw bytes (not base64-encoded) AES-256 encryption key used to encrypt - // the source object, if it was encrypted with a Customer-Supplied Encryption - // Key. - bytes copy_source_encryption_key_bytes = 21; - - // The raw bytes (not base64-encoded) SHA256 hash of the encryption key used - // to encrypt the source object, if it was encrypted with a Customer-Supplied - // Encryption Key. - bytes copy_source_encryption_key_sha256_bytes = 22; - - // A set of parameters common to Storage API requests concerning an object. - CommonObjectRequestParams common_object_request_params = 19; - - // A set of parameters common to all Storage API requests. - CommonRequestParams common_request_params = 20; -} - -// A rewrite response. -message RewriteResponse { - // The total bytes written so far, which can be used to provide a waiting user - // with a progress indicator. This property is always present in the response. - int64 total_bytes_rewritten = 1; - - // The total size of the object being copied in bytes. This property is always - // present in the response. - int64 object_size = 2; - - // `true` if the copy is finished; otherwise, `false` if - // the copy is in progress. This property is always present in the response. - bool done = 3; - - // A token to use in subsequent requests to continue copying data. This token - // is present in the response only when there is more data to copy. - string rewrite_token = 4; - - // A resource containing the metadata for the copied-to object. This property - // is present in the response only when copying completes. - Object resource = 5; -} - -// Request message StartResumableWrite. -message StartResumableWriteRequest { - // The destination bucket, object, and metadata, as well as any preconditions. - WriteObjectSpec write_object_spec = 1; - - // A set of parameters common to Storage API requests concerning an object. - CommonObjectRequestParams common_object_request_params = 3; - - // A set of parameters common to all Storage API requests. - CommonRequestParams common_request_params = 4; -} - -// Response object for `StartResumableWrite`. -message StartResumableWriteResponse { - // The upload_id of the newly started resumable write operation. This - // value should be copied into the `WriteObjectRequest.upload_id` field. - string upload_id = 1; -} - -// Request message for UpdateObject. -message UpdateObjectRequest { - // The object to update. - // The object's bucket and name fields are used to identify the object to - // update. If present, the object's generation field selects a specific - // revision of this object whose metadata should be updated. Otherwise, - // assumes the current, live version of the object. - Object object = 1; - - // 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 = 2; - - // Makes the operation conditional on whether the object's current generation - // does not match the given value. If no live object exists, the precondition - // fails. Setting to 0 makes the operation succeed only if there is a live - // version of the object. - optional int64 if_generation_not_match = 3; - - // 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; - - // Apply a predefined set of access controls to this object. - PredefinedObjectAcl predefined_acl = 6; - - // List of fields to be updated. - // - // To specify ALL fields, equivalent to the JSON API's "update" function, - // specify a single field with the value `*`. Note: not recommended. If a new - // field is introduced at a later time, an older client updating with the `*` - // may accidentally reset the new field's value. - // - // Not specifying any fields is an error. - // Not specifying a field while setting that field to a non-default value is - // an error. - google.protobuf.FieldMask update_mask = 7; - - // A set of parameters common to Storage API requests concerning an object. - CommonObjectRequestParams common_object_request_params = 8; - - // A set of parameters common to all Storage API requests. - CommonRequestParams common_request_params = 9; -} - -// Request message for GetServiceAccount. -message GetServiceAccountRequest { - // Required. Project ID. - string project = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // A set of parameters common to all Storage API requests. - CommonRequestParams common_request_params = 2; -} - -// Request message for CreateHmacKey. -message CreateHmacKeyRequest { - // Required. The project that the HMAC-owning service account lives in. - string project = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Required. The service account to create the HMAC for. - string service_account_email = 2 [(google.api.field_behavior) = REQUIRED]; - - // A set of parameters common to all Storage API requests. - CommonRequestParams common_request_params = 3; -} - -// Create hmac response. The only time the secret for an HMAC will be returned. -message CreateHmacKeyResponse { - // Key metadata. - HmacKeyMetadata metadata = 1; - - // HMAC key secret material. - // In raw bytes format (not base64-encoded). - bytes secret_key_bytes = 3; -} - -// Request object to delete a given HMAC key. -message DeleteHmacKeyRequest { - // Required. The identifying key for the HMAC to delete. - string access_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The project id the HMAC key lies in. - string project = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // A set of parameters common to all Storage API requests. - CommonRequestParams common_request_params = 3; -} - -// Request object to get metadata on a given HMAC key. -message GetHmacKeyRequest { - // Required. The identifying key for the HMAC to delete. - string access_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The project id the HMAC key lies in. - string project = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // A set of parameters common to all Storage API requests. - CommonRequestParams common_request_params = 3; -} - -// Request to fetch a list of HMAC keys under a given project. -message ListHmacKeysRequest { - // Required. The project id to list HMAC keys for. - string project = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Optional. The maximum number of keys to return. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A previously returned token from ListHmacKeysResponse to get the next page. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, filters to only return HMAC keys for specified service account. - string service_account_email = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, return deleted keys that have not yet been wiped out. - bool show_deleted_keys = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A set of parameters common to all Storage API requests. - CommonRequestParams common_request_params = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Hmac key list response with next page information. -message ListHmacKeysResponse { - // The list of items. - repeated HmacKeyMetadata hmac_keys = 1; - - // The continuation token, used to page through large result sets. Provide - // this value in a subsequent request to return the next page of results. - string next_page_token = 2; -} - -// Request object to update an HMAC key state. -message UpdateHmacKeyRequest { - // Required. The HMAC key to update. - // If present, the hmac_key's `id` field will be used to identify the key. - // Otherwise, the hmac_key's access_id and project fields will be used to - // identify the key. - HmacKeyMetadata hmac_key = 1 [(google.api.field_behavior) = REQUIRED]; - - // A set of parameters common to all Storage API requests. - CommonRequestParams common_request_params = 2; - - // Update mask for hmac_key. - google.protobuf.FieldMask update_mask = 3; -} - -// Parameters that can be passed to any object request. -message CommonObjectRequestParams { - // Encryption algorithm used with the Customer-Supplied Encryption Keys - // feature. - string encryption_algorithm = 1; - - // Encryption key used with the Customer-Supplied Encryption Keys feature. - // In raw bytes format (not base64-encoded). - bytes encryption_key_bytes = 4; - - // SHA256 hash of encryption key used with the Customer-Supplied Encryption - // Keys feature. - bytes encryption_key_sha256_bytes = 5; -} - -// Parameters that can be passed to any request. -message CommonRequestParams { - // Required. Required when using buckets with Requestor Pays feature enabled. - string user_project = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; -} - -// Shared constants. -message ServiceConstants { - // A collection of constant values meaningful to the Storage API. - enum Values { - option allow_alias = true; - - // Unused. Proto3 requires first enum to be 0. - VALUES_UNSPECIFIED = 0; - - // The maximum size chunk that can will be returned in a single - // ReadRequest. - // 2 MiB. - MAX_READ_CHUNK_BYTES = 2097152; - - // The maximum size chunk that can be sent in a single WriteObjectRequest. - // 2 MiB. - MAX_WRITE_CHUNK_BYTES = 2097152; - - // The maximum size of an object in MB - whether written in a single stream - // or composed from multiple other objects. - // 5 TiB. - MAX_OBJECT_SIZE_MB = 5242880; - - // The maximum length field name that can be sent in a single - // custom metadata field. - // 1 KiB. - MAX_CUSTOM_METADATA_FIELD_NAME_BYTES = 1024; - - // The maximum length field value that can be sent in a single - // custom_metadata field. - // 4 KiB. - MAX_CUSTOM_METADATA_FIELD_VALUE_BYTES = 4096; - - // The maximum total bytes that can be populated into all field names and - // values of the custom_metadata for one object. - // 8 KiB. - MAX_CUSTOM_METADATA_TOTAL_SIZE_BYTES = 8192; - - // The maximum total bytes that can be populated into all bucket metadata - // fields. - // 20 KiB. - MAX_BUCKET_METADATA_TOTAL_SIZE_BYTES = 20480; - - // The maximum number of NotificationConfigs that can be registered - // for a given bucket. - MAX_NOTIFICATION_CONFIGS_PER_BUCKET = 100; - - // The maximum number of LifecycleRules that can be registered for a given - // bucket. - MAX_LIFECYCLE_RULES_PER_BUCKET = 100; - - // The maximum number of custom attributes per NotificationConfigs. - MAX_NOTIFICATION_CUSTOM_ATTRIBUTES = 5; - - // The maximum length of a custom attribute key included in - // NotificationConfig. - MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_KEY_LENGTH = 256; - - // The maximum length of a custom attribute value included in a - // NotificationConfig. - MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_VALUE_LENGTH = 1024; - - // The maximum number of key/value entries per bucket label. - MAX_LABELS_ENTRIES_COUNT = 64; - - // The maximum character length of the key or value in a bucket - // label map. - MAX_LABELS_KEY_VALUE_LENGTH = 63; - - // The maximum byte size of the key or value in a bucket label - // map. - MAX_LABELS_KEY_VALUE_BYTES = 128; - - // The maximum number of object IDs that can be included in a - // DeleteObjectsRequest. - MAX_OBJECT_IDS_PER_DELETE_OBJECTS_REQUEST = 1000; - - // The maximum number of days for which a token returned by the - // GetListObjectsSplitPoints RPC is valid. - SPLIT_TOKEN_MAX_VALID_DAYS = 14; - } - - -} - -// A bucket. -message Bucket { - option (google.api.resource) = { - type: "storage.googleapis.com/Bucket" - pattern: "projects/{project}/buckets/{bucket}" - }; - - // Billing properties of a bucket. - message Billing { - // When set to true, Requester Pays is enabled for this bucket. - bool requester_pays = 1; - } - - // Cross-Origin Response sharing (CORS) properties for a bucket. - // For more on Cloud Storage and CORS, see - // https://cloud.google.com/storage/docs/cross-origin. - // For more on CORS in general, see https://tools.ietf.org/html/rfc6454. - message Cors { - // The list of Origins eligible to receive CORS response headers. See - // [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins. - // Note: "*" is permitted in the list of origins, and means "any Origin". - repeated string origin = 1; - - // The list of HTTP methods on which to include CORS response headers, - // (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of - // methods, and means "any method". - repeated string method = 2; - - // The list of HTTP headers other than the - // [https://www.w3.org/TR/cors/#simple-response-header][simple response - // headers] to give permission for the user-agent to share across domains. - repeated string response_header = 3; - - // The value, in seconds, to return in the - // [https://www.w3.org/TR/cors/#access-control-max-age-response-header][Access-Control-Max-Age - // header] used in preflight responses. - int32 max_age_seconds = 4; - } - - // Encryption properties of a bucket. - message Encryption { - // The name of the Cloud KMS key that will be used to encrypt objects - // inserted into this bucket, if no encryption method is specified. - string default_kms_key = 1 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; - } - - // Bucket restriction options. - message IamConfig { - // Settings for Uniform Bucket level access. - // See https://cloud.google.com/storage/docs/uniform-bucket-level-access. - message UniformBucketLevelAccess { - // If set, access checks only use bucket-level IAM policies or above. - bool enabled = 1; - - // The deadline time for changing - // `iamConfig.uniformBucketLevelAccess.enabled` from - // true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339). - // Mutable until the specified deadline is reached, but not afterward. - google.protobuf.Timestamp lock_time = 2; - } - - // Public Access Prevention config values. - enum PublicAccessPrevention { - // No specified PublicAccessPrevention. - PUBLIC_ACCESS_PREVENTION_UNSPECIFIED = 0; - - // Prevents access from being granted to public members 'allUsers' and - // 'allAuthenticatedUsers'. Prevents attempts to grant new access to - // public members. - ENFORCED = 1; - - // This setting is inherited from Org Policy. Does not prevent access from - // being granted to public members 'allUsers' or 'allAuthenticatedUsers'. - INHERITED = 2; - } - - // Bucket restriction options currently enforced on the bucket. - UniformBucketLevelAccess uniform_bucket_level_access = 1; - - // Whether IAM will enforce public access prevention. - PublicAccessPrevention public_access_prevention = 2; - } - - // Lifecycle properties of a bucket. - // For more information, see https://cloud.google.com/storage/docs/lifecycle. - message Lifecycle { - // A lifecycle Rule, combining an action to take on an object and a - // condition which will trigger that action. - message Rule { - // An action to take on an object. - message Action { - // Type of the action. Currently, only `Delete`, `SetStorageClass`, and - // `AbortIncompleteMultipartUpload` are supported. - string type = 1; - - // Target storage class. Required iff the type of the action is - // SetStorageClass. - string storage_class = 2; - } - - // A condition of an object which triggers some action. - message Condition { - // Age of an object (in days). This condition is satisfied when an - // object reaches the specified age. - // A value of 0 indicates that all objects immediately match this - // condition. - optional int32 age_days = 1; - - // This condition is satisfied when an object is created before midnight - // of the specified date in UTC. - google.type.Date created_before = 2; - - // Relevant only for versioned objects. If the value is - // `true`, this condition matches live objects; if the value - // is `false`, it matches archived objects. - optional bool is_live = 3; - - // Relevant only for versioned objects. If the value is N, this - // condition is satisfied when there are at least N versions (including - // the live version) newer than this version of the object. - optional int32 num_newer_versions = 4; - - // Objects having any of the storage classes specified by this condition - // will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`, - // `NEARLINE`, `COLDLINE`, `STANDARD`, and - // `DURABLE_REDUCED_AVAILABILITY`. - repeated string matches_storage_class = 5; - - // Number of days that have elapsed since the custom timestamp set on an - // object. - // The value of the field must be a nonnegative integer. - optional int32 days_since_custom_time = 7; - - // An object matches this condition if the custom timestamp set on the - // object is before the specified date in UTC. - google.type.Date custom_time_before = 8; - - // This condition is relevant only for versioned objects. An object - // version satisfies this condition only if these many days have been - // passed since it became noncurrent. The value of the field must be a - // nonnegative integer. If it's zero, the object version will become - // eligible for Lifecycle action as soon as it becomes noncurrent. - optional int32 days_since_noncurrent_time = 9; - - // This condition is relevant only for versioned objects. An object - // version satisfies this condition only if it became noncurrent before - // the specified date in UTC. - google.type.Date noncurrent_time_before = 10; - } - - // The action to take. - Action action = 1; - - // The condition(s) under which the action will be taken. - Condition condition = 2; - } - - // A lifecycle management rule, which is made of an action to take and the - // condition(s) under which the action will be taken. - repeated Rule rule = 1; - } - - // Logging-related properties of a bucket. - message Logging { - // The destination bucket where the current bucket's logs should be placed. - string log_bucket = 1; - - // A prefix for log object names. - string log_object_prefix = 2; - } - - // Retention policy properties of a bucket. - message RetentionPolicy { - // Server-determined value that indicates the time from which policy was - // enforced and effective. This value is in - // [https://tools.ietf.org/html/rfc3339][RFC 3339] format. - google.protobuf.Timestamp effective_time = 1; - - // Once locked, an object retention policy cannot be modified. - bool is_locked = 2; - - // The duration in seconds that objects need to be retained. Retention - // duration must be greater than zero and less than 100 years. Note that - // enforcement of retention periods less than a day is not guaranteed. Such - // periods should only be used for testing purposes. - int64 retention_period = 3; - } - - // Properties of a bucket related to versioning. - // For more on Cloud Storage versioning, see - // https://cloud.google.com/storage/docs/object-versioning. - message Versioning { - // While set to true, versioning is fully enabled for this bucket. - bool enabled = 1; - } - - // Properties of a bucket related to accessing the contents as a static - // website. For more on hosting a static website via Cloud Storage, see - // https://cloud.google.com/storage/docs/hosting-static-website. - message Website { - // If the requested object path is missing, the service will ensure the path - // has a trailing '/', append this suffix, and attempt to retrieve the - // resulting object. This allows the creation of `index.html` - // objects to represent directory pages. - string main_page_suffix = 1; - - // If the requested object path is missing, and any - // `mainPageSuffix` object is missing, if applicable, the service - // will return the named object from this bucket as the content for a - // [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found] - // result. - string not_found_page = 2; - } - - // Configuration for Custom Dual Regions. It should specify precisely two - // eligible regions within the same Multiregion. - message CustomPlacementConfig { - // List of locations to use for data placement. - repeated string data_locations = 1; - } - - // Immutable. The name of the bucket. - string name = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. The user-chosen part of the bucket name. The `{bucket}` portion of the - // `name` field. For globally unique buckets, this is equal to the "bucket - // name" of other Cloud Storage APIs. Example: "pub". - string bucket_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. The project which owns this bucket. - string project = 3 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Output only. The metadata generation of this bucket. - // Attempting to set or update this field will result in a - // [FieldViolation][google.rpc.BadRequest.FieldViolation]. - int64 metageneration = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. The location of the bucket. Object data for objects in the bucket resides - // in physical storage within this region. Defaults to `US`. See the - // [https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations"][developer's - // guide] for the authoritative list. Attempting to update this field after - // the bucket is created will result in an error. - string location = 5 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. The location type of the bucket (region, dual-region, multi-region, etc). - string location_type = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The bucket's default storage class, used whenever no storageClass is - // specified for a newly-created object. This defines how objects in the - // bucket are stored and determines the SLA and the cost of storage. - // If this value is not specified when the bucket is created, it will default - // to `STANDARD`. For more information, see - // https://developers.google.com/storage/docs/storage-classes. - string storage_class = 7; - - // The recovery point objective for cross-region replication of the bucket. - // Applicable only for dual- and multi-region buckets. "DEFAULT" uses default - // replication. "ASYNC_TURBO" enables turbo replication, valid for dual-region - // buckets only. If rpo is not specified when the bucket is created, it - // defaults to "DEFAULT". For more information, see - // https://cloud.google.com/storage/docs/turbo-replication. - string rpo = 27; - - // Access controls on the bucket. - // If iamConfig.uniformBucketLevelAccess is enabled on this bucket, - // requests to set, read, or modify acl is an error. - repeated BucketAccessControl acl = 8; - - // Default access controls to apply to new objects when no ACL is provided. - // If iamConfig.uniformBucketLevelAccess is enabled on this bucket, - // requests to set, read, or modify acl is an error. - repeated ObjectAccessControl default_object_acl = 9; - - // The bucket's lifecycle config. See - // [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management] - // for more information. - Lifecycle lifecycle = 10; - - // Output only. The creation time of the bucket in - // [https://tools.ietf.org/html/rfc3339][RFC 3339] format. - // Attempting to set or update this field will result in a - // [FieldViolation][google.rpc.BadRequest.FieldViolation]. - google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing] - // (CORS) config. - repeated Cors cors = 12; - - // Output only. The modification time of the bucket. - // Attempting to set or update this field will result in a - // [FieldViolation][google.rpc.BadRequest.FieldViolation]. - google.protobuf.Timestamp update_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The default value for event-based hold on newly created objects in this - // bucket. Event-based hold is a way to retain objects indefinitely until an - // event occurs, signified by the - // hold's release. After being released, such objects will be subject to - // bucket-level retention (if any). One sample use case of this flag is for - // banks to hold loan documents for at least 3 years after loan is paid in - // full. Here, bucket-level retention is 3 years and the event is loan being - // paid in full. In this example, these objects will be held intact for any - // number of years until the event has occurred (event-based hold on the - // object is released) and then 3 more years after that. That means retention - // duration of the objects begins from the moment event-based hold - // transitioned from true to false. Objects under event-based hold cannot be - // deleted, overwritten or archived until the hold is removed. - bool default_event_based_hold = 14; - - // User-provided labels, in key/value pairs. - map labels = 15; - - // The bucket's website config, controlling how the service behaves - // when accessing bucket contents as a web site. See the - // [https://cloud.google.com/storage/docs/static-website][Static Website - // Examples] for more information. - Website website = 16; - - // The bucket's versioning config. - Versioning versioning = 17; - - // The bucket's logging config, which defines the destination bucket - // and name prefix (if any) for the current bucket's logs. - Logging logging = 18; - - // Output only. The owner of the bucket. This is always the project team's owner group. - Owner owner = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Encryption config for a bucket. - Encryption encryption = 20; - - // The bucket's billing config. - Billing billing = 21; - - // The bucket's retention policy. The retention policy enforces a minimum - // retention time for all objects contained in the bucket, based on their - // creation time. Any attempt to overwrite or delete objects younger than the - // retention period will result in a PERMISSION_DENIED error. An unlocked - // retention policy can be modified or removed from the bucket via a - // storage.buckets.update operation. A locked retention policy cannot be - // removed or shortened in duration for the lifetime of the bucket. - // Attempting to remove or decrease period of a locked retention policy will - // result in a PERMISSION_DENIED error. - RetentionPolicy retention_policy = 22; - - // The bucket's IAM config. - IamConfig iam_config = 23; - - // Reserved for future use. - bool satisfies_pzs = 25; - - // Configuration that, if present, specifies the data placement for a Custom - // Dual Region. - CustomPlacementConfig custom_placement_config = 26; -} - -// An access-control entry. -message BucketAccessControl { - // The access permission for the entity. - string role = 1; - - // The ID of the access-control entry. - string id = 2; - - // The entity holding the permission, in one of the following forms: - // * `user-{userid}` - // * `user-{email}` - // * `group-{groupid}` - // * `group-{email}` - // * `domain-{domain}` - // * `project-{team-projectid}` - // * `allUsers` - // * `allAuthenticatedUsers` - // Examples: - // * The user `liz@example.com` would be `user-liz@example.com`. - // * The group `example@googlegroups.com` would be - // `group-example@googlegroups.com` - // * All members of the Google Apps for Business domain `example.com` would be - // `domain-example.com` - string entity = 3; - - // The ID for the entity, if any. - string entity_id = 4; - - // The email address associated with the entity, if any. - string email = 5; - - // The domain associated with the entity, if any. - string domain = 6; - - // The project team associated with the entity, if any. - ProjectTeam project_team = 7; -} - -// Message used to convey content being read or written, along with an optional -// checksum. -message ChecksummedData { - // The data. - bytes content = 1; - - // If set, the CRC32C digest of the content field. - optional fixed32 crc32c = 2; -} - -// Message used for storing full (not subrange) object checksums. -message ObjectChecksums { - // CRC32C digest of the object data. Computed by the Cloud Storage service for - // all written objects. - // If set in an WriteObjectRequest, service will validate that the stored - // object matches this checksum. - optional fixed32 crc32c = 1; - - // 128 bit MD5 hash of the object data. - // For more information about using the MD5 hash, see - // [https://cloud.google.com/storage/docs/hashes-etags#json-api][Hashes and - // ETags: Best Practices]. - // Not all objects will provide an MD5 hash. For example, composite objects - // provide only crc32c hashes. - // This value is equivalent to running `cat object.txt | openssl md5 -binary` - bytes md5_hash = 2; -} - -// Hmac Key Metadata, which includes all information other than the secret. -message HmacKeyMetadata { - // Resource name ID of the key in the format /. - string id = 1; - - // Globally unique id for keys. - string access_id = 2; - - // The project ID that the hmac key is contained in. - string project = 3 [(google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - }]; - - // Email of the service account the key authenticates as. - string service_account_email = 4; - - // State of the key. One of ACTIVE, INACTIVE, or DELETED. - string state = 5; - - // The creation time of the HMAC key in RFC 3339 format. - google.protobuf.Timestamp create_time = 6; - - // The last modification time of the HMAC key metadata in RFC 3339 format. - google.protobuf.Timestamp update_time = 7; -} - -// A directive to publish Pub/Sub notifications upon changes to a bucket. -message Notification { - option (google.api.resource) = { - type: "storage.googleapis.com/Notification" - pattern: "projects/{project}/buckets/{bucket}/notificationConfigs/{notification}" - }; - - // Required. The resource name of this notification. - // Format: - // `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}` - // The `{project}` portion may be `_` for globally unique buckets. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Pub/Sub topic to which this subscription publishes. Formatted as: - // '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}' - string topic = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. If present, only send notifications about listed event types. If empty, - // sent notifications for all event types. - repeated string event_types = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. An optional list of additional attributes to attach to each Pub/Sub - // message published for this notification subscription. - map custom_attributes = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If present, only apply this notification config to object names that - // begin with this prefix. - string object_name_prefix = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The desired content of the Payload. - string payload_format = 6 [(google.api.field_behavior) = REQUIRED]; -} - -// Describes the Customer-Supplied Encryption Key mechanism used to store an -// Object's data at rest. -message CustomerEncryption { - // The encryption algorithm. - string encryption_algorithm = 1; - - // SHA256 hash value of the encryption key. - // In raw bytes format (not base64-encoded). - bytes key_sha256_bytes = 3; -} - -// An object. -message Object { - // Immutable. The name of this object. Nearly any sequence of unicode characters is - // valid. See - // [Guidelines](https://cloud.google.com/storage/docs/naming-objects). - // Example: `test.txt` - // The `name` field by itself does not uniquely identify a Cloud Storage - // object. A Cloud Storage object is uniquely identified by the tuple of - // (bucket, object, generation). - string name = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. The name of the bucket containing this object. - string bucket = 2 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.resource_reference) = { - type: "storage.googleapis.com/Bucket" - } - ]; - - // Immutable. The content generation of this object. Used for object versioning. - // Attempting to set or update this field will result in a - // [FieldViolation][google.rpc.BadRequest.FieldViolation]. - int64 generation = 3 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. The version of the metadata for this generation of this object. Used for - // preconditions and for detecting changes in metadata. A metageneration - // number is only meaningful in the context of a particular generation of a - // particular object. - // Attempting to set or update this field will result in a - // [FieldViolation][google.rpc.BadRequest.FieldViolation]. - int64 metageneration = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Storage class of the object. - string storage_class = 5; - - // Output only. Content-Length of the object data in bytes, matching - // [https://tools.ietf.org/html/rfc7230#section-3.3.2][RFC 7230 §3.3.2]. - // Attempting to set or update this field will result in a - // [FieldViolation][google.rpc.BadRequest.FieldViolation]. - int64 size = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Content-Encoding of the object data, matching - // [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2] - string content_encoding = 7; - - // Content-Disposition of the object data, matching - // [https://tools.ietf.org/html/rfc6266][RFC 6266]. - string content_disposition = 8; - - // Cache-Control directive for the object data, matching - // [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2]. - // If omitted, and the object is accessible to all anonymous users, the - // default will be `public, max-age=3600`. - string cache_control = 9; - - // Access controls on the object. - // If iamConfig.uniformBucketLevelAccess is enabled on the parent - // bucket, requests to set, read, or modify acl is an error. - repeated ObjectAccessControl acl = 10; - - // Content-Language of the object data, matching - // [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2]. - string content_language = 11; - - // Output only. The deletion time of the object. Will be returned if and only if this - // version of the object has been deleted. - // Attempting to set or update this field will result in a - // [FieldViolation][google.rpc.BadRequest.FieldViolation]. - google.protobuf.Timestamp delete_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Content-Type of the object data, matching - // [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5]. - // If an object is stored without a Content-Type, it is served as - // `application/octet-stream`. - string content_type = 13; - - // Output only. The creation time of the object. - // Attempting to set or update this field will result in a - // [FieldViolation][google.rpc.BadRequest.FieldViolation]. - google.protobuf.Timestamp create_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Number of underlying components that make up this object. Components are - // accumulated by compose operations. - // Attempting to set or update this field will result in a - // [FieldViolation][google.rpc.BadRequest.FieldViolation]. - int32 component_count = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Hashes for the data part of this object. - ObjectChecksums checksums = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The modification time of the object metadata. - // Attempting to set or update this field will result in a - // [FieldViolation][google.rpc.BadRequest.FieldViolation]. - google.protobuf.Timestamp update_time = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Cloud KMS Key used to encrypt this object, if the object is encrypted by - // such a key. - string kms_key = 18 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; - - // Output only. The time at which the object's storage class was last changed. When the - // object is initially created, it will be set to time_created. - // Attempting to set or update this field will result in a - // [FieldViolation][google.rpc.BadRequest.FieldViolation]. - google.protobuf.Timestamp update_storage_class_time = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Whether an object is under temporary hold. While this flag is set to true, - // the object is protected against deletion and overwrites. A common use case - // of this flag is regulatory investigations where objects need to be retained - // while the investigation is ongoing. Note that unlike event-based hold, - // temporary hold does not impact retention expiration time of an object. - bool temporary_hold = 20; - - // A server-determined value that specifies the earliest time that the - // object's retention period expires. This value is in - // [https://tools.ietf.org/html/rfc3339][RFC 3339] format. - // Note 1: This field is not provided for objects with an active event-based - // hold, since retention expiration is unknown until the hold is removed. - // Note 2: This value can be provided even when temporary hold is set (so that - // the user can reason about policy without having to first unset the - // temporary hold). - google.protobuf.Timestamp retention_expire_time = 21; - - // User-provided metadata, in key/value pairs. - map metadata = 22; - - // Whether an object is under event-based hold. - // An event-based hold is a way to force the retention of an object until - // after some event occurs. Once the hold is released by explicitly setting - // this field to false, the object will become subject to any bucket-level - // retention policy, except that the retention duration will be calculated - // from the time the event based hold was lifted, rather than the time the - // object was created. - // - // In a WriteObject request, not setting this field implies that the value - // should be taken from the parent bucket's "default_event_based_hold" field. - // In a response, this field will always be set to true or false. - optional bool event_based_hold = 23; - - // Output only. The owner of the object. This will always be the uploader of the object. - // Attempting to set or update this field will result in a - // [FieldViolation][google.rpc.BadRequest.FieldViolation]. - Owner owner = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Metadata of Customer-Supplied Encryption Key, if the object is encrypted by - // such a key. - CustomerEncryption customer_encryption = 25; - - // A user-specified timestamp set on an object. - google.protobuf.Timestamp custom_time = 26; -} - -// An access-control entry. -message ObjectAccessControl { - // The access permission for the entity. - string role = 1; - - // The ID of the access-control entry. - string id = 2; - - // The entity holding the permission, in one of the following forms: - // * `user-{userid}` - // * `user-{email}` - // * `group-{groupid}` - // * `group-{email}` - // * `domain-{domain}` - // * `project-{team-projectid}` - // * `allUsers` - // * `allAuthenticatedUsers` - // Examples: - // * The user `liz@example.com` would be `user-liz@example.com`. - // * The group `example@googlegroups.com` would be - // `group-example@googlegroups.com`. - // * All members of the Google Apps for Business domain `example.com` would be - // `domain-example.com`. - string entity = 3; - - // The ID for the entity, if any. - string entity_id = 4; - - // The email address associated with the entity, if any. - string email = 5; - - // The domain associated with the entity, if any. - string domain = 6; - - // The project team associated with the entity, if any. - ProjectTeam project_team = 7; -} - -// The result of a call to Objects.ListObjects -message ListObjectsResponse { - // The list of items. - repeated Object objects = 1; - - // The list of prefixes of objects matching-but-not-listed up to and including - // the requested delimiter. - repeated string prefixes = 2; - - // The continuation token, used to page through large result sets. Provide - // this value in a subsequent request to return the next page of results. - string next_page_token = 3; -} - -// Represents the Viewers, Editors, or Owners of a given project. -message ProjectTeam { - // The project number. - string project_number = 1; - - // The team. - string team = 2; -} - -// A service account, owned by Cloud Storage, which may be used when taking -// action on behalf of a given project, for example to publish Pub/Sub -// notifications or to retrieve security keys. -message ServiceAccount { - // The ID of the notification. - string email_address = 1; -} - -// The owner of a specific resource. -message Owner { - // The entity, in the form `user-`*userId*. - string entity = 1; - - // The ID for the entity. - string entity_id = 2; -} - -// Specifies a requested range of bytes to download. -message ContentRange { - // The starting offset of the object data. - int64 start = 1; - - // The ending offset of the object data. - int64 end = 2; - - // The complete length of the object data. - int64 complete_length = 3; -} - -// Predefined or "canned" aliases for sets of specific object ACL entries. -enum PredefinedObjectAcl { - // No predefined ACL. - PREDEFINED_OBJECT_ACL_UNSPECIFIED = 0; - - // Object owner gets `OWNER` access, and - // `allAuthenticatedUsers` get `READER` access. - OBJECT_ACL_AUTHENTICATED_READ = 1; - - // Object owner gets `OWNER` access, and project team owners get - // `OWNER` access. - OBJECT_ACL_BUCKET_OWNER_FULL_CONTROL = 2; - - // Object owner gets `OWNER` access, and project team owners get - // `READER` access. - OBJECT_ACL_BUCKET_OWNER_READ = 3; - - // Object owner gets `OWNER` access. - OBJECT_ACL_PRIVATE = 4; - - // Object owner gets `OWNER` access, and project team members get - // access according to their roles. - OBJECT_ACL_PROJECT_PRIVATE = 5; - - // Object owner gets `OWNER` access, and `allUsers` - // get `READER` access. - OBJECT_ACL_PUBLIC_READ = 6; -} - -// A set of predefined, or "canned," ACLs that can be set on a -// bucket instead of manually specifying a complete ACL. -enum PredefinedBucketAcl { - // No predefined ACL. - PREDEFINED_BUCKET_ACL_UNSPECIFIED = 0; - - // Project team owners get `OWNER` access, and - // `allAuthenticatedUsers` get `READER` access. - BUCKET_ACL_AUTHENTICATED_READ = 1; - - // Project team owners get `OWNER` access. - BUCKET_ACL_PRIVATE = 2; - - // Project team members get access according to their roles. - BUCKET_ACL_PROJECT_PRIVATE = 3; - - // Project team owners get `OWNER` access, and - // `allUsers` get `READER` access. - BUCKET_ACL_PUBLIC_READ = 4; - - // Project team owners get `OWNER` access, and - // `allUsers` get `WRITER` access. - BUCKET_ACL_PUBLIC_READ_WRITE = 5; -} diff --git a/renovate.json b/renovate.json index f249b081c8..4dd661caf4 100644 --- a/renovate.json +++ b/renovate.json @@ -50,8 +50,7 @@ "^junit:junit", "^com.google.truth:truth", "^org.mockito:mockito-core", - "^org.objenesis:objenesis", - "^com.google.cloud:google-cloud-conformance-tests" + "^org.objenesis:objenesis" ], "semanticCommitType": "test", "semanticCommitScope": "deps" @@ -70,5 +69,5 @@ } ], "semanticCommits": true, - "dependencyDashboard": true + "masterIssue": true } diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 1c8498fde8..430731608e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.2.0 + 1.0.21 @@ -29,32 +29,20 @@ com.google.cloud google-cloud-storage - 2.4.5 + 1.113.4 junit junit - 4.13.2 + 4.13.1 test com.google.truth truth - 1.1.3 - test - - - org.apache.httpcomponents - httpclient - 4.5.13 - test - - - org.apache.httpcomponents - httpmime - 4.5.13 + 1.0.1 test @@ -65,7 +53,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.3.0 + 3.2.0 add-snippets-source diff --git a/samples/native-image-sample/README.md b/samples/native-image-sample/README.md deleted file mode 100644 index 092cdc0591..0000000000 --- a/samples/native-image-sample/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# Storage Sample Application with Native Image - -The Storage sample application demonstrates some common operations with Google Cloud Storage and is compatible with Native Image compilation. - -## Setup Instructions - -You will need to follow these prerequisite steps in order to run these samples: - -1. If you have not already, [create a Google Cloud Platform Project](https://cloud.google.com/resource-manager/docs/creating-managing-projects#creating_a_project). - -2. Install the [Google Cloud SDK](https://cloud.google.com/sdk/) which will allow you to run the sample with your project's credentials. - - Once installed, log in with Application Default Credentials using the following command: - - ``` - gcloud auth application-default login - ``` - - **Note:** Authenticating with Application Default Credentials is convenient to use during development, but we recommend [alternate methods of authentication](https://cloud.google.com/docs/authentication/production) during production use. - -3. Install the GraalVM compiler. - - You can follow the [official installation instructions](https://www.graalvm.org/docs/getting-started/#install-graalvm) from the GraalVM website. - After following the instructions, ensure that you install the Native Image extension installed by running: - - ``` - gu install native-image - ``` - - Once you finish following the instructions, verify that the default version of Java is set to the GraalVM version by running `java -version` in a terminal. - - You will see something similar to the below output: - - ``` - $ java -version - - openjdk version "11.0.7" 2020-04-14 - OpenJDK Runtime Environment GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02) - OpenJDK 64-Bit Server VM GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02, mixed mode, sharing) - ``` - -4. [Enable the Cloud Storage APIs](https://console.cloud.google.com/apis/api/storage.googleapis.com). - -### Run with Native Image Compilation - -Navigate to this directory in a new terminal. - -1. Compile the application using the Native Image Compiler. This step may take a few minutes. - - ``` - mvn package -P native -DskipTests - ``` - -2. Run the application: - - ``` - ./target/native-image-sample - ``` - -3. The application will run through basic Cloud Storage operations of creating, reading, and deleting Cloud Storage resources. - - You can manually manage Cloud Storage resources through [Google Cloud Console](https://console.cloud.google.com/storage) to verify that the resources are cleaned up. - - ``` - Creating bucket nativeimage-sample-bucket-7221f161-688c-4a7a-9120-8900d20f0802 - Write file to bucket. - Reading the file that was written... - Successfully wrote to file: Hello World! - Cleaning up resources... - Deleted file nativeimage-sample-file-5d927aaf-cb03-41de-8383-696733893db5 - Deleted bucket nativeimage-sample-bucket-7221f161-688c-4a7a-9120-8900d20f0802 - ``` - -## Sample Integration test with Native Image Support - -In order to run the sample integration test as a native image, call the following command: - - ``` - mvn test -Pnative - ``` \ No newline at end of file diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml deleted file mode 100644 index 207faccedc..0000000000 --- a/samples/native-image-sample/pom.xml +++ /dev/null @@ -1,173 +0,0 @@ - - - 4.0.0 - com.google.cloud - native-image-sample - Native Image Sample - https://github.com/googleapis/java-storage - - - - com.google.cloud.samples - shared-configuration - 1.2.0 - - - - - 1.8 - 1.8 - UTF-8 - - - - - - com.google.cloud - libraries-bom - 25.0.0 - pom - import - - - - - - - com.google.cloud - google-cloud-core - - - com.google.cloud - google-cloud-storage - - - - junit - junit - 4.13.2 - test - - - com.google.truth - truth - 1.1.3 - test - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.2.2 - - - - true - dependency-jars/ - com.example.storage.NativeImageStorageSample - - - - - - org.apache.maven.plugins - maven-dependency-plugin - 3.3.0 - - - copy-dependencies - package - - copy-dependencies - - - - ${project.build.directory}/dependency-jars/ - - - - - - - - - - - - native - - - - com.google.cloud - native-image-support - 0.12.10 - - - org.junit.vintage - junit-vintage-engine - 5.8.2 - test - - - org.graalvm.buildtools - junit-platform-native - 0.9.10 - test - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - 2.22.2 - - - **/*IT - - - - - org.graalvm.buildtools - native-maven-plugin - 0.9.9 - true - - com.example.storage.NativeImageStorageSample - - --no-fallback - --no-server - - - - - build-native - - build - test - - package - - - test-native - - test - - test - - - - - - - - \ No newline at end of file diff --git a/samples/native-image-sample/src/main/java/com/example/storage/NativeImageStorageSample.java b/samples/native-image-sample/src/main/java/com/example/storage/NativeImageStorageSample.java deleted file mode 100644 index ce4cf6b5ef..0000000000 --- a/samples/native-image-sample/src/main/java/com/example/storage/NativeImageStorageSample.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage; - -import com.google.cloud.BatchResult.Callback; -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.Storage; -import com.google.cloud.storage.StorageBatch; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; -import java.nio.charset.StandardCharsets; -import java.util.UUID; - -/** Sample Storage application compiled with Native Image. */ -public class NativeImageStorageSample { - - static String BUCKET_NAME = "nativeimage-sample-bucket-" + UUID.randomUUID(); - static String FILENAME = "nativeimage-sample-file-" + UUID.randomUUID(); - - /** Runs the storage sample application. */ - public static void main(String[] args) { - - Storage storageClient = StorageOptions.getDefaultInstance().getService(); - - try { - createBucket(storageClient, BUCKET_NAME); - createFile(storageClient, BUCKET_NAME, FILENAME); - runBatchOperations(storageClient, BUCKET_NAME, FILENAME); - } finally { - System.out.println("Deleting resources."); - storageClient.delete(BUCKET_NAME, FILENAME); - storageClient.delete(BUCKET_NAME); - } - } - - private static void runBatchOperations( - Storage storageClient, String bucketName, String fileName) { - BlobId blobId = BlobId.of(bucketName, fileName); - - StorageBatch batch = storageClient.batch(); - batch - .update(BlobInfo.newBuilder(blobId).build()) - .notify( - new Callback() { - @Override - public void success(Blob blob) { - System.out.println("Batch update succeeded on " + fileName); - } - - @Override - public void error(StorageException e) { - System.out.println("Batch update failed with cause: " + e); - } - }); - - batch.submit(); - } - - private static void createBucket(Storage storageClient, String bucketName) { - BucketInfo bucketInfo = BucketInfo.newBuilder(bucketName).setLocation("us-east1").build(); - storageClient.create(bucketInfo); - System.out.println("Created bucket " + bucketName); - } - - private static void createFile(Storage storageClient, String bucketName, String fileName) { - BlobInfo blobInfo = - BlobInfo.newBuilder(bucketName, fileName).setContentType("text/plain").build(); - storageClient.create(blobInfo, "Hello World!".getBytes(StandardCharsets.UTF_8)); - System.out.println("Created file " + blobInfo.getName()); - - Blob blob = storageClient.get(bucketName, fileName); - String content = new String(blob.getContent(), StandardCharsets.UTF_8); - System.out.println("Successfully wrote to file: " + content); - } -} diff --git a/samples/native-image-sample/src/test/java/com/example/storage/NativeImageStorageSampleIT.java b/samples/native-image-sample/src/test/java/com/example/storage/NativeImageStorageSampleIT.java deleted file mode 100644 index 5098402647..0000000000 --- a/samples/native-image-sample/src/test/java/com/example/storage/NativeImageStorageSampleIT.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage; - -import static com.google.common.truth.Truth.assertThat; - -import com.google.cloud.testing.junit4.StdOutCaptureRule; -import org.junit.Rule; -import org.junit.Test; - -public class NativeImageStorageSampleIT { - - @Rule public StdOutCaptureRule stdOut = new StdOutCaptureRule(); - - @Test - public void createAndReadStorageResources() { - NativeImageStorageSample.main(new String[] {}); - assertThat(stdOut.getCapturedOutputAsUtf8String()) - .contains("Created bucket " + NativeImageStorageSample.BUCKET_NAME); - assertThat(stdOut.getCapturedOutputAsUtf8String()) - .contains("Created file " + NativeImageStorageSample.FILENAME); - assertThat(stdOut.getCapturedOutputAsUtf8String()) - .contains("Successfully wrote to file: Hello World!"); - } -} diff --git a/samples/pom.xml b/samples/pom.xml index 2c01e6fca0..41362b00a9 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -18,7 +18,7 @@ com.google.cloud.samples shared-configuration - 1.2.0 + 1.0.21 @@ -31,7 +31,6 @@ install-without-bom snapshot snippets - native-image-sample @@ -47,7 +46,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.12 + 1.6.8 true diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 36ad6b4363..fad6ae5b16 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.2.0 + 1.0.21 @@ -28,25 +28,19 @@ com.google.cloud google-cloud-storage - 2.4.6-SNAPSHOT + 1.113.4 junit junit - 4.13.2 + 4.13.1 test com.google.truth truth - 1.1.3 - test - - - org.apache.httpcomponents - httpmime - 4.5.13 + 1.0.1 test @@ -58,7 +52,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.3.0 + 3.2.0 add-snippets-source diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 292403d526..71b94ba2e6 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.2.0 + 1.0.21 @@ -30,7 +30,7 @@ com.google.cloud libraries-bom - 25.0.0 + 16.1.0 pom import @@ -47,13 +47,13 @@ junit junit - 4.13.2 + 4.13.1 test com.google.truth truth - 1.1.3 + 1.0.1 test diff --git a/samples/snippets/src/main/java/com/example/storage/ConfigureRetries.java b/samples/snippets/src/main/java/com/example/storage/ConfigureRetries.java deleted file mode 100644 index e1db27ab02..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/ConfigureRetries.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage; - -// [START storage_configure_retries] - -import com.google.api.gax.retrying.RetrySettings; -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import com.google.cloud.storage.StorageRetryStrategy; -import org.threeten.bp.Duration; - -public final class ConfigureRetries { - public static void main(String[] args) { - String bucketName = "my-bucket"; - String blobName = "blob/to/delete"; - deleteBlob(bucketName, blobName); - } - - static void deleteBlob(String bucketName, String blobName) { - // Customize retry behavior - RetrySettings retrySettings = - StorageOptions.getDefaultRetrySettings() - .toBuilder() - // Set the max number of attempts to 10 (initial attempt plus 9 retries) - .setMaxAttempts(10) - // Set the backoff multiplier to 3.0 - .setRetryDelayMultiplier(3.0) - // Set the max duration of all attempts to 5 minutes - .setTotalTimeout(Duration.ofMinutes(5)) - .build(); - - StorageOptions alwaysRetryStorageOptions = - StorageOptions.newBuilder() - // Customize retry so all requests are retried even if they are non-idempotent. - .setStorageRetryStrategy(StorageRetryStrategy.getUniformStorageRetryStrategy()) - // provide the previously configured retrySettings - .setRetrySettings(retrySettings) - .build(); - - // Instantiate a client - Storage storage = alwaysRetryStorageOptions.getService(); - - // Delete the blob - BlobId blobId = BlobId.of(bucketName, blobName); - boolean success = storage.delete(blobId); - - System.out.printf( - "Deletion of Blob %s completed %s.%n", blobId, success ? "successfully" : "unsuccessfully"); - } -} -// [END storage_configure_retries] diff --git a/samples/snippets/src/main/java/com/example/storage/GenerateSignedPostPolicyV4.java b/samples/snippets/src/main/java/com/example/storage/GenerateSignedPostPolicyV4.java deleted file mode 100644 index a1dd9ebaaa..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/GenerateSignedPostPolicyV4.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage; - -// [START storage_generate_signed_post_policy_v4] - -import com.google.cloud.storage.BlobInfo; -import com.google.cloud.storage.PostPolicyV4; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import java.util.Map; -import java.util.concurrent.TimeUnit; - -public class GenerateSignedPostPolicyV4 { - /** - * Generating a signed POST policy requires Credentials which implement ServiceAccountSigner. - * These can be set explicitly using the Storage.PostPolicyV4Option.signWith(ServiceAccountSigner) - * option. If you don't, you could also pass a service account signer to StorageOptions, i.e. - * StorageOptions().newBuilder().setCredentials(ServiceAccountSignerCredentials). In this example, - * neither of these options are used, which means the following code only works when the - * credentials are defined via the environment variable GOOGLE_APPLICATION_CREDENTIALS, and those - * credentials are authorized to sign a policy. See the documentation for - * Storage.generateSignedPostPolicyV4 for more details. - */ - public static void generateSignedPostPolicyV4( - String projectId, String bucketName, String blobName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of the GCS bucket to upload to - // String bucketName = "your-bucket-name" - - // The name to give the object uploaded to GCS - // String blobName = "your-object-name" - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - PostPolicyV4.PostFieldsV4 fields = - PostPolicyV4.PostFieldsV4.newBuilder().setCustomMetadataField("test", "data").build(); - - PostPolicyV4 policy = - storage.generateSignedPostPolicyV4( - BlobInfo.newBuilder(bucketName, blobName).build(), 10, TimeUnit.MINUTES, fields); - - StringBuilder htmlForm = - new StringBuilder( - "
\n"); - for (Map.Entry entry : policy.getFields().entrySet()) { - htmlForm.append( - " \n"); - } - htmlForm.append("
\n"); - htmlForm.append("
\n"); - htmlForm.append("\n"); - - System.out.println( - "You can use the following HTML form to upload an object to bucket " - + bucketName - + " for the next ten minutes:"); - System.out.println(htmlForm.toString()); - } -} -// [END storage_generate_signed_post_policy_v4] diff --git a/samples/snippets/src/main/java/com/example/storage/GetServiceAccount.java b/samples/snippets/src/main/java/com/example/storage/GetServiceAccount.java deleted file mode 100644 index e190376a0a..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/GetServiceAccount.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage; - -// [START storage_get_service_account] -import com.google.cloud.storage.ServiceAccount; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class GetServiceAccount { - public static void getServiceAccount(String projectId) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - ServiceAccount serviceAccount = storage.getServiceAccount(projectId); - System.out.println( - "The GCS service account for project " + projectId + " is: " + serviceAccount.getEmail()); - } -} -// [END storage_get_service_account] diff --git a/samples/snippets/src/main/java/com/example/storage/QuickstartSample.java b/samples/snippets/src/main/java/com/example/storage/QuickstartSample.java index a5ef2b16d7..3307e18345 100644 --- a/samples/snippets/src/main/java/com/example/storage/QuickstartSample.java +++ b/samples/snippets/src/main/java/com/example/storage/QuickstartSample.java @@ -29,7 +29,7 @@ public static void main(String... args) throws Exception { Storage storage = StorageOptions.getDefaultInstance().getService(); // The name for the new bucket - String bucketName = args[0]; // "my-new-bucket"; + String bucketName = args[0]; // "my-new-bucket"; // Creates the new bucket Bucket bucket = storage.create(BucketInfo.of(bucketName)); diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/AddBucketDefaultOwner.java b/samples/snippets/src/main/java/com/example/storage/bucket/AddBucketDefaultOwner.java deleted file mode 100644 index 8e2e369fda..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/AddBucketDefaultOwner.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_add_bucket_default_owner] - -import com.google.cloud.storage.Acl; -import com.google.cloud.storage.Acl.Role; -import com.google.cloud.storage.Acl.User; -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class AddBucketDefaultOwner { - - public static void addBucketDefaultOwner(String bucketName, String userEmail) { - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The email of the user you wish to add as a default owner - // String userEmail = "someuser@domain.com" - - Storage storage = StorageOptions.newBuilder().build().getService(); - Bucket bucket = storage.get(bucketName); - Acl newDefaultOwner = Acl.of(new User(userEmail), Role.OWNER); - - bucket.createDefaultAcl(newDefaultOwner); - System.out.println("Added user " + userEmail + " as an owner on " + bucketName); - } -} -// [END storage_add_bucket_default_owner] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/AddBucketIamConditionalBinding.java b/samples/snippets/src/main/java/com/example/storage/bucket/AddBucketIamConditionalBinding.java deleted file mode 100644 index e1d08d3872..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/AddBucketIamConditionalBinding.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_add_bucket_conditional_iam_binding] - -import com.google.cloud.Binding; -import com.google.cloud.Condition; -import com.google.cloud.Policy; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -public class AddBucketIamConditionalBinding { - /** Example of adding a conditional binding to the Bucket-level IAM */ - public static void addBucketIamConditionalBinding(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // For more information please read: - // https://cloud.google.com/storage/docs/access-control/iam - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - Policy originalPolicy = - storage.getIamPolicy(bucketName, Storage.BucketSourceOption.requestedPolicyVersion(3)); - - String role = "roles/storage.objectViewer"; - String member = "group:example@google.com"; - - // Create a condition - String conditionTitle = "Title"; - String conditionDescription = "Description"; - String conditionExpression = - "resource.name.startsWith(\"projects/_/buckets/bucket-name/objects/prefix-a-\")"; - Condition.Builder conditionBuilder = Condition.newBuilder(); - conditionBuilder.setTitle(conditionTitle); - conditionBuilder.setDescription(conditionDescription); - conditionBuilder.setExpression(conditionExpression); - - // getBindingsList() returns an ImmutableList, we copy over to an ArrayList so it's mutable - List bindings = new ArrayList(originalPolicy.getBindingsList()); - - // Add condition to a binding - Binding.Builder newBindingBuilder = - Binding.newBuilder() - .setRole(role) - .setMembers(Arrays.asList(member)) - .setCondition(conditionBuilder.build()); - bindings.add(newBindingBuilder.build()); - - // Update policy with new conditional binding - Policy.Builder updatedPolicyBuilder = originalPolicy.toBuilder(); - updatedPolicyBuilder.setBindings(bindings).setVersion(3); - - storage.setIamPolicy(bucketName, updatedPolicyBuilder.build()); - - System.out.printf( - "Added %s with role %s to %s with condition %s %s %s\n", - member, role, bucketName, conditionTitle, conditionDescription, conditionExpression); - } -} -// [END storage_add_bucket_conditional_iam_binding] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/AddBucketIamMember.java b/samples/snippets/src/main/java/com/example/storage/bucket/AddBucketIamMember.java deleted file mode 100644 index c5c86e6224..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/AddBucketIamMember.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.bucket; - -// [START storage_add_bucket_iam_member] - -import com.google.cloud.Binding; -import com.google.cloud.Policy; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -public class AddBucketIamMember { - /** Example of adding a member to the Bucket-level IAM */ - public static void addBucketIamMember(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // For more information please read: - // https://cloud.google.com/storage/docs/access-control/iam - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - Policy originalPolicy = - storage.getIamPolicy(bucketName, Storage.BucketSourceOption.requestedPolicyVersion(3)); - - String role = "roles/storage.objectViewer"; - String member = "group:example@google.com"; - - // getBindingsList() returns an ImmutableList and copying over to an ArrayList so it's mutable. - List bindings = new ArrayList(originalPolicy.getBindingsList()); - - // Create a new binding using role and member - Binding.Builder newMemberBindingBuilder = Binding.newBuilder(); - newMemberBindingBuilder.setRole(role).setMembers(Arrays.asList(member)); - bindings.add(newMemberBindingBuilder.build()); - - // Update policy to add member - Policy.Builder updatedPolicyBuilder = originalPolicy.toBuilder(); - updatedPolicyBuilder.setBindings(bindings).setVersion(3); - Policy updatedPolicy = storage.setIamPolicy(bucketName, updatedPolicyBuilder.build()); - - System.out.printf("Added %s with role %s to %s\n", member, role, bucketName); - } -} -// [END storage_add_bucket_iam_member] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/AddBucketLabel.java b/samples/snippets/src/main/java/com/example/storage/bucket/AddBucketLabel.java deleted file mode 100644 index 473f270215..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/AddBucketLabel.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.bucket; - -// [START storage_add_bucket_label] - -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import java.util.HashMap; -import java.util.Map; - -public class AddBucketLabel { - public static void addBucketLabel( - String projectId, String bucketName, String labelKey, String labelValue) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The key of the label to add - // String labelKey = "label-key-to-add"; - - // The value of the label to add - // String labelValue = "label-value-to-add"; - - Map newLabels = new HashMap<>(); - newLabels.put(labelKey, labelValue); - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = storage.get(bucketName); - Map labels = bucket.getLabels(); - if (labels != null) { - newLabels.putAll(labels); - } - bucket.toBuilder().setLabels(newLabels).build().update(); - - System.out.println( - "Added label " + labelKey + " with value " + labelValue + " to bucket " + bucketName + "."); - } -} -// [END storage_add_bucket_label] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/AddBucketOwner.java b/samples/snippets/src/main/java/com/example/storage/bucket/AddBucketOwner.java deleted file mode 100644 index ddbd5bfefe..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/AddBucketOwner.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_add_bucket_owner] - -import com.google.cloud.storage.Acl; -import com.google.cloud.storage.Acl.Role; -import com.google.cloud.storage.Acl.User; -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class AddBucketOwner { - - public static void addBucketOwner(String projectId, String bucketName, String userEmail) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // Email of the user you wish to add as an owner - // String userEmail = "someuser@domain.com" - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = storage.get(bucketName); - Acl newOwner = Acl.of(new User(userEmail), Role.OWNER); - - bucket.createAcl(newOwner); - System.out.println("Added user " + userEmail + " as an owner on " + bucketName); - } -} - -// [END storage_add_bucket_owner] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/ChangeDefaultStorageClass.java b/samples/snippets/src/main/java/com/example/storage/bucket/ChangeDefaultStorageClass.java deleted file mode 100644 index 03c4358f6e..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/ChangeDefaultStorageClass.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.bucket; - -// [START storage_change_default_storage_class] -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageClass; -import com.google.cloud.storage.StorageOptions; - -public class ChangeDefaultStorageClass { - public static void changeDefaultStorageClass(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // See the StorageClass documentation for other valid storage classes: - // https://googleapis.dev/java/google-cloud-clients/latest/com/google/cloud/storage/StorageClass.html - StorageClass storageClass = StorageClass.COLDLINE; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = storage.get(bucketName); - bucket = bucket.toBuilder().setStorageClass(storageClass).build().update(); - - System.out.println( - "Default storage class for bucket " - + bucketName - + " has been set to " - + bucket.getStorageClass()); - } -} -// [END storage_change_default_storage_class] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/ConfigureBucketCors.java b/samples/snippets/src/main/java/com/example/storage/bucket/ConfigureBucketCors.java deleted file mode 100644 index 3097978ad3..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/ConfigureBucketCors.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.bucket; - -// [START storage_cors_configuration] -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Cors; -import com.google.cloud.storage.HttpMethod; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import com.google.common.collect.ImmutableList; - -public class ConfigureBucketCors { - public static void configureBucketCors( - String projectId, - String bucketName, - String origin, - String responseHeader, - Integer maxAgeSeconds) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The origin for this CORS config to allow requests from - // String origin = "http://example.appspot.com"; - - // The response header to share across origins - // String responseHeader = "Content-Type"; - - // The maximum amount of time the browser can make requests before it must repeat preflighted - // requests - // Integer maxAgeSeconds = 3600; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = storage.get(bucketName); - - // See the HttpMethod documentation for other HTTP methods available: - // https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/urlfetch/HTTPMethod - HttpMethod method = HttpMethod.GET; - - Cors cors = - Cors.newBuilder() - .setOrigins(ImmutableList.of(Cors.Origin.of(origin))) - .setMethods(ImmutableList.of(method)) - .setResponseHeaders(ImmutableList.of(responseHeader)) - .setMaxAgeSeconds(maxAgeSeconds) - .build(); - - bucket.toBuilder().setCors(ImmutableList.of(cors)).build().update(); - - System.out.println( - "Bucket " - + bucketName - + " was updated with a CORS config to allow GET requests from " - + origin - + " sharing " - + responseHeader - + " responses across origins"); - } -} -// [END storage_cors_configuration] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/CreateBucket.java b/samples/snippets/src/main/java/com/example/storage/bucket/CreateBucket.java deleted file mode 100644 index 53041f62c5..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/CreateBucket.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_create_bucket] -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.BucketInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class CreateBucket { - public static void createBucket(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID to give your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - Bucket bucket = storage.create(BucketInfo.newBuilder(bucketName).build()); - - System.out.println("Created bucket " + bucket.getName()); - } -} -// [END storage_create_bucket] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/CreateBucketWithStorageClassAndLocation.java b/samples/snippets/src/main/java/com/example/storage/bucket/CreateBucketWithStorageClassAndLocation.java deleted file mode 100644 index c1cb336b81..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/CreateBucketWithStorageClassAndLocation.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.bucket; - -// [START storage_create_bucket_class_location] -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.BucketInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageClass; -import com.google.cloud.storage.StorageOptions; - -public class CreateBucketWithStorageClassAndLocation { - public static void createBucketWithStorageClassAndLocation(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID to give your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - // See the StorageClass documentation for other valid storage classes: - // https://googleapis.dev/java/google-cloud-clients/latest/com/google/cloud/storage/StorageClass.html - StorageClass storageClass = StorageClass.COLDLINE; - - // See this documentation for other valid locations: - // http://g.co/cloud/storage/docs/bucket-locations#location-mr - String location = "ASIA"; - - Bucket bucket = - storage.create( - BucketInfo.newBuilder(bucketName) - .setStorageClass(storageClass) - .setLocation(location) - .build()); - - System.out.println( - "Created bucket " - + bucket.getName() - + " in " - + bucket.getLocation() - + " with storage class " - + bucket.getStorageClass()); - } -} -// [END storage_create_bucket_class_location] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/CreateBucketWithTurboReplication.java b/samples/snippets/src/main/java/com/example/storage/bucket/CreateBucketWithTurboReplication.java deleted file mode 100644 index 7c67b64e3d..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/CreateBucketWithTurboReplication.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_create_bucket_turbo_replication] -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.BucketInfo; -import com.google.cloud.storage.Rpo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class CreateBucketWithTurboReplication { - public static void createBucketWithTurboReplication( - String projectId, String bucketName, String location) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID to give your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The dual-region location to create your bucket in - // String location = "NAM4" - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - Bucket bucket = - storage.create( - BucketInfo.newBuilder(bucketName) - .setLocation(location) - .setRpo(Rpo.ASYNC_TURBO) - .build()); - - System.out.println( - "Created bucket " - + bucket.getName() - + " in " - + bucket.getLocation() - + " with RPO setting" - + bucket.getRpo()); - } -} -// [END storage_create_bucket_turbo_replication] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/DeleteBucket.java b/samples/snippets/src/main/java/com/example/storage/bucket/DeleteBucket.java deleted file mode 100644 index 925ca0d229..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/DeleteBucket.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.bucket; - -// [START storage_delete_bucket] -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class DeleteBucket { - public static void deleteBucket(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of the bucket to delete - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = storage.get(bucketName); - bucket.delete(); - - System.out.println("Bucket " + bucket.getName() + " was deleted"); - } -} -// [END storage_delete_bucket] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/DisableBucketVersioning.java b/samples/snippets/src/main/java/com/example/storage/bucket/DisableBucketVersioning.java deleted file mode 100644 index 49547c96a2..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/DisableBucketVersioning.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.bucket; - -// [START storage_disable_versioning] -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class DisableBucketVersioning { - public static void disableBucketVersioning(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = storage.get(bucketName); - bucket.toBuilder().setVersioningEnabled(false).build().update(); - - System.out.println("Versioning is now disabled for bucket " + bucketName); - } -} -// [END storage_disable_versioning] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/DisableDefaultEventBasedHold.java b/samples/snippets/src/main/java/com/example/storage/bucket/DisableDefaultEventBasedHold.java deleted file mode 100644 index 744e7fb7ff..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/DisableDefaultEventBasedHold.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_disable_default_event_based_hold] - -import com.google.cloud.storage.BucketInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; - -public class DisableDefaultEventBasedHold { - public static void disableDefaultEventBasedHold(String projectId, String bucketName) - throws StorageException { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - storage.update(BucketInfo.newBuilder(bucketName).setDefaultEventBasedHold(false).build()); - - System.out.println("Default event-based hold was disabled for " + bucketName); - } -} -// [END storage_disable_default_event_based_hold] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/DisableLifecycleManagement.java b/samples/snippets/src/main/java/com/example/storage/bucket/DisableLifecycleManagement.java deleted file mode 100644 index b0d5f19c4a..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/DisableLifecycleManagement.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.bucket; - -// [START storage_disable_bucket_lifecycle_management] -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class DisableLifecycleManagement { - public static void disableLifecycleManagement(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = storage.get(bucketName); - bucket.toBuilder().deleteLifecycleRules().build().update(); - - System.out.println("Lifecycle management was disabled for bucket " + bucketName); - } -} -// [END storage_disable_bucket_lifecycle_management] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/DisableRequesterPays.java b/samples/snippets/src/main/java/com/example/storage/bucket/DisableRequesterPays.java deleted file mode 100644 index 9cb40b1b65..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/DisableRequesterPays.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.bucket; - -// [START storage_disable_requester_pays] -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class DisableRequesterPays { - public static void disableRequesterPays(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = storage.get(bucketName, Storage.BucketGetOption.userProject(projectId)); - bucket - .toBuilder() - .setRequesterPays(false) - .build() - .update(Storage.BucketTargetOption.userProject(projectId)); - - System.out.println("Requester pays disabled for bucket " + bucketName); - } -} -// [END storage_disable_requester_pays] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/DisableUniformBucketLevelAccess.java b/samples/snippets/src/main/java/com/example/storage/bucket/DisableUniformBucketLevelAccess.java deleted file mode 100644 index 8beff201c5..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/DisableUniformBucketLevelAccess.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_disable_uniform_bucket_level_access] - -import com.google.cloud.storage.BucketInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; - -public class DisableUniformBucketLevelAccess { - public static void disableUniformBucketLevelAccess(String projectId, String bucketName) - throws StorageException { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - BucketInfo.IamConfiguration iamConfiguration = - BucketInfo.IamConfiguration.newBuilder() - .setIsUniformBucketLevelAccessEnabled(false) - .build(); - - storage.update(BucketInfo.newBuilder(bucketName).setIamConfiguration(iamConfiguration).build()); - - System.out.println("Uniform bucket-level access was disabled for " + bucketName); - } -} -// [END storage_disable_uniform_bucket_level_access] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/EnableBucketVersioning.java b/samples/snippets/src/main/java/com/example/storage/bucket/EnableBucketVersioning.java deleted file mode 100644 index 8685bf9278..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/EnableBucketVersioning.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.bucket; - -// [START storage_enable_versioning] -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class EnableBucketVersioning { - public static void enableBucketVersioning(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = storage.get(bucketName); - bucket.toBuilder().setVersioningEnabled(true).build().update(); - - System.out.println("Versioning is now enabled for bucket " + bucketName); - } -} -// [END storage_enable_versioning] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/EnableDefaultEventBasedHold.java b/samples/snippets/src/main/java/com/example/storage/bucket/EnableDefaultEventBasedHold.java deleted file mode 100644 index d443f9fc1b..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/EnableDefaultEventBasedHold.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_enable_default_event_based_hold] - -import com.google.cloud.storage.BucketInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; - -public class EnableDefaultEventBasedHold { - public static void enableDefaultEventBasedHold(String projectId, String bucketName) - throws StorageException { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - storage.update(BucketInfo.newBuilder(bucketName).setDefaultEventBasedHold(true).build()); - - System.out.println("Default event-based hold was enabled for " + bucketName); - } -} -// [END storage_enable_default_event_based_hold] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/EnableLifecycleManagement.java b/samples/snippets/src/main/java/com/example/storage/bucket/EnableLifecycleManagement.java deleted file mode 100644 index 5c8699f5ee..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/EnableLifecycleManagement.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.bucket; - -// [START storage_enable_bucket_lifecycle_management] -import static com.google.cloud.storage.BucketInfo.LifecycleRule.LifecycleAction; -import static com.google.cloud.storage.BucketInfo.LifecycleRule.LifecycleCondition; - -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.BucketInfo.LifecycleRule; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import com.google.common.collect.ImmutableList; - -public class EnableLifecycleManagement { - public static void enableLifecycleManagement(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = storage.get(bucketName); - - // See the LifecycleRule documentation for additional info on what you can do with lifecycle - // management rules. This one deletes objects that are over 100 days old. - // https://googleapis.dev/java/google-cloud-clients/latest/com/google/cloud/storage/BucketInfo.LifecycleRule.html - bucket - .toBuilder() - .setLifecycleRules( - ImmutableList.of( - new LifecycleRule( - LifecycleAction.newDeleteAction(), - LifecycleCondition.newBuilder().setAge(100).build()))) - .build() - .update(); - - System.out.println("Lifecycle management was enabled and configured for bucket " + bucketName); - } -} -// [END storage_enable_bucket_lifecycle_management] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/EnableRequesterPays.java b/samples/snippets/src/main/java/com/example/storage/bucket/EnableRequesterPays.java deleted file mode 100644 index 089cb2e549..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/EnableRequesterPays.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.bucket; - -// [START storage_enable_requester_pays] -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class EnableRequesterPays { - public static void enableRequesterPays(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = storage.get(bucketName); - bucket.toBuilder().setRequesterPays(true).build().update(); - - System.out.println("Requester pays enabled for bucket " + bucketName); - } -} -// [END storage_enable_requester_pays] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/EnableUniformBucketLevelAccess.java b/samples/snippets/src/main/java/com/example/storage/bucket/EnableUniformBucketLevelAccess.java deleted file mode 100644 index 7097562934..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/EnableUniformBucketLevelAccess.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_enable_uniform_bucket_level_access] - -import com.google.cloud.storage.BucketInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; - -public class EnableUniformBucketLevelAccess { - public static void enableUniformBucketLevelAccess(String projectId, String bucketName) - throws StorageException { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - BucketInfo.IamConfiguration iamConfiguration = - BucketInfo.IamConfiguration.newBuilder().setIsUniformBucketLevelAccessEnabled(true).build(); - - storage.update(BucketInfo.newBuilder(bucketName).setIamConfiguration(iamConfiguration).build()); - - System.out.println("Uniform bucket-level access was enabled for " + bucketName); - } -} -// [END storage_enable_uniform_bucket_level_access] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/GetBucketMetadata.java b/samples/snippets/src/main/java/com/example/storage/bucket/GetBucketMetadata.java deleted file mode 100644 index 95dd5c41e0..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/GetBucketMetadata.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.bucket; - -// [START storage_get_bucket_metadata] - -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.BucketInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import java.util.Map; - -public class GetBucketMetadata { - public static void getBucketMetadata(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - // Select all fields. Fields can be selected individually e.g. Storage.BucketField.NAME - Bucket bucket = - storage.get(bucketName, Storage.BucketGetOption.fields(Storage.BucketField.values())); - - // Print bucket metadata - System.out.println("BucketName: " + bucket.getName()); - System.out.println("DefaultEventBasedHold: " + bucket.getDefaultEventBasedHold()); - System.out.println("DefaultKmsKeyName: " + bucket.getDefaultKmsKeyName()); - System.out.println("Id: " + bucket.getGeneratedId()); - System.out.println("IndexPage: " + bucket.getIndexPage()); - System.out.println("Location: " + bucket.getLocation()); - System.out.println("LocationType: " + bucket.getLocationType()); - System.out.println("Metageneration: " + bucket.getMetageneration()); - System.out.println("NotFoundPage: " + bucket.getNotFoundPage()); - System.out.println("RetentionEffectiveTime: " + bucket.getRetentionEffectiveTime()); - System.out.println("RetentionPeriod: " + bucket.getRetentionPeriod()); - System.out.println("RetentionPolicyIsLocked: " + bucket.retentionPolicyIsLocked()); - System.out.println("RequesterPays: " + bucket.requesterPays()); - System.out.println("SelfLink: " + bucket.getSelfLink()); - System.out.println("StorageClass: " + bucket.getStorageClass().name()); - System.out.println("TimeCreated: " + bucket.getCreateTime()); - System.out.println("VersioningEnabled: " + bucket.versioningEnabled()); - if (bucket.getLabels() != null) { - System.out.println("\n\n\nLabels:"); - for (Map.Entry label : bucket.getLabels().entrySet()) { - System.out.println(label.getKey() + "=" + label.getValue()); - } - } - if (bucket.getLifecycleRules() != null) { - System.out.println("\n\n\nLifecycle Rules:"); - for (BucketInfo.LifecycleRule rule : bucket.getLifecycleRules()) { - System.out.println(rule); - } - } - } -} -// [END storage_get_bucket_metadata] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/GetBucketRpo.java b/samples/snippets/src/main/java/com/example/storage/bucket/GetBucketRpo.java deleted file mode 100644 index a0bc61681d..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/GetBucketRpo.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_get_rpo] -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class GetBucketRpo { - public static void getBucketRpo(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = storage.get(bucketName); - String rpo = bucket.getRpo().toString(); - - System.out.println("The RPO setting of bucket " + bucketName + " is " + rpo); - } -} -// [END storage_get_rpo] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/GetDefaultEventBasedHold.java b/samples/snippets/src/main/java/com/example/storage/bucket/GetDefaultEventBasedHold.java deleted file mode 100644 index 7bf9933843..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/GetDefaultEventBasedHold.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_get_default_event_based_hold] - -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; - -public class GetDefaultEventBasedHold { - public static void getDefaultEventBasedHold(String projectId, String bucketName) - throws StorageException { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = - storage.get( - bucketName, - Storage.BucketGetOption.fields(Storage.BucketField.DEFAULT_EVENT_BASED_HOLD)); - - if (bucket.getDefaultEventBasedHold() != null && bucket.getDefaultEventBasedHold()) { - System.out.println("Default event-based hold is enabled for " + bucketName); - } else { - System.out.println("Default event-based hold is not enabled for " + bucketName); - } - } -} -// [END storage_get_default_event_based_hold] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/GetPublicAccessPrevention.java b/samples/snippets/src/main/java/com/example/storage/bucket/GetPublicAccessPrevention.java deleted file mode 100644 index 204faf0f46..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/GetPublicAccessPrevention.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.bucket; - -// [START storage_get_public_access_prevention] -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.BucketInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class GetPublicAccessPrevention { - public static void getPublicAccessPrevention(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = storage.get(bucketName); - - // Gets Bucket Metadata and prints publicAccessPrevention value (either 'inherited' or - // 'enforced'). - BucketInfo.PublicAccessPrevention publicAccessPrevention = - bucket.getIamConfiguration().getPublicAccessPrevention(); - - System.out.println( - "Public access prevention is set to " - + publicAccessPrevention.getValue() - + " for " - + bucketName); - } -} -// [END storage_get_public_access_prevention] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/GetRequesterPaysStatus.java b/samples/snippets/src/main/java/com/example/storage/bucket/GetRequesterPaysStatus.java deleted file mode 100644 index 5665cf9106..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/GetRequesterPaysStatus.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_get_requester_pays_status] - -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; - -public class GetRequesterPaysStatus { - public static void getRequesterPaysStatus(String projectId, String bucketName) - throws StorageException { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = - storage.get(bucketName, Storage.BucketGetOption.fields(Storage.BucketField.BILLING)); - - System.out.println("Requester pays status : " + bucket.requesterPays()); - } -} -// [END storage_get_requester_pays_status] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/GetRetentionPolicy.java b/samples/snippets/src/main/java/com/example/storage/bucket/GetRetentionPolicy.java deleted file mode 100644 index 09938efd08..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/GetRetentionPolicy.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_get_retention_policy] - -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; -import java.util.Date; - -public class GetRetentionPolicy { - public static void getRetentionPolicy(String projectId, String bucketName) - throws StorageException { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = - storage.get( - bucketName, Storage.BucketGetOption.fields(Storage.BucketField.RETENTION_POLICY)); - - System.out.println("Retention Policy for " + bucketName); - System.out.println("Retention Period: " + bucket.getRetentionPeriod()); - if (bucket.retentionPolicyIsLocked() != null && bucket.retentionPolicyIsLocked()) { - System.out.println("Retention Policy is locked"); - } - if (bucket.getRetentionEffectiveTime() != null) { - System.out.println("Effective Time: " + new Date(bucket.getRetentionEffectiveTime())); - } - } -} -// [END storage_get_retention_policy] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/GetUniformBucketLevelAccess.java b/samples/snippets/src/main/java/com/example/storage/bucket/GetUniformBucketLevelAccess.java deleted file mode 100644 index 4e596887d9..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/GetUniformBucketLevelAccess.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_get_uniform_bucket_level_access] - -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.BucketInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; -import java.util.Date; - -public class GetUniformBucketLevelAccess { - public static void getUniformBucketLevelAccess(String projectId, String bucketName) - throws StorageException { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = - storage.get( - bucketName, Storage.BucketGetOption.fields(Storage.BucketField.IAMCONFIGURATION)); - BucketInfo.IamConfiguration iamConfiguration = bucket.getIamConfiguration(); - - Boolean enabled = iamConfiguration.isUniformBucketLevelAccessEnabled(); - Date lockedTime = new Date(iamConfiguration.getUniformBucketLevelAccessLockedTime()); - - if (enabled != null && enabled) { - System.out.println("Uniform bucket-level access is enabled for " + bucketName); - System.out.println("Bucket will be locked on " + lockedTime); - } else { - System.out.println("Uniform bucket-level access is disabled for " + bucketName); - } - } -} -// [END storage_get_uniform_bucket_level_access] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/ListBucketIamMembers.java b/samples/snippets/src/main/java/com/example/storage/bucket/ListBucketIamMembers.java deleted file mode 100644 index 4bbf3704b2..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/ListBucketIamMembers.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.bucket; - -// [START storage_view_bucket_iam_members] -import com.google.cloud.Binding; -import com.google.cloud.Policy; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class ListBucketIamMembers { - public static void listBucketIamMembers(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // For more information please read: - // https://cloud.google.com/storage/docs/access-control/iam - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - Policy policy = - storage.getIamPolicy(bucketName, Storage.BucketSourceOption.requestedPolicyVersion(3)); - - // Print binding information - for (Binding binding : policy.getBindingsList()) { - System.out.printf("Role: %s Members: %s\n", binding.getRole(), binding.getMembers()); - - // Print condition if one is set - boolean bindingIsConditional = binding.getCondition() != null; - if (bindingIsConditional) { - System.out.printf("Condition Title: %s\n", binding.getCondition().getTitle()); - System.out.printf("Condition Description: %s\n", binding.getCondition().getDescription()); - System.out.printf("Condition Expression: %s\n", binding.getCondition().getExpression()); - } - } - } -} -// [END storage_view_bucket_iam_members] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/ListBuckets.java b/samples/snippets/src/main/java/com/example/storage/bucket/ListBuckets.java deleted file mode 100644 index cd6237cb14..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/ListBuckets.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.bucket; - -// [START storage_list_buckets] -import com.google.api.gax.paging.Page; -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class ListBuckets { - public static void listBuckets(String projectId) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Page buckets = storage.list(); - - for (Bucket bucket : buckets.iterateAll()) { - System.out.println(bucket.getName()); - } - } -} -// [END storage_list_buckets] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/LockRetentionPolicy.java b/samples/snippets/src/main/java/com/example/storage/bucket/LockRetentionPolicy.java deleted file mode 100644 index fd339f4e3a..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/LockRetentionPolicy.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_lock_retention_policy] - -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; -import java.util.Date; - -public class LockRetentionPolicy { - public static void lockRetentionPolicy(String projectId, String bucketName) - throws StorageException { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = - storage.get(bucketName, Storage.BucketGetOption.fields(Storage.BucketField.METAGENERATION)); - Bucket lockedBucket = - bucket.lockRetentionPolicy(Storage.BucketTargetOption.metagenerationMatch()); - - System.out.println("Retention period for " + bucketName + " is now locked"); - System.out.println( - "Retention policy effective as of " + new Date(lockedBucket.getRetentionEffectiveTime())); - } -} -// [END storage_lock_retention_policy] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/MakeBucketPublic.java b/samples/snippets/src/main/java/com/example/storage/bucket/MakeBucketPublic.java deleted file mode 100644 index a77a1d99cf..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/MakeBucketPublic.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.bucket; - -// [START storage_set_bucket_public_iam] -import com.google.cloud.Identity; -import com.google.cloud.Policy; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import com.google.cloud.storage.StorageRoles; - -public class MakeBucketPublic { - public static void makeBucketPublic(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Policy originalPolicy = storage.getIamPolicy(bucketName); - storage.setIamPolicy( - bucketName, - originalPolicy - .toBuilder() - .addIdentity(StorageRoles.objectViewer(), Identity.allUsers()) // All users can view - .build()); - - System.out.println("Bucket " + bucketName + " is now publicly readable"); - } -} -// [END storage_set_bucket_public_iam] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/PrintBucketAcl.java b/samples/snippets/src/main/java/com/example/storage/bucket/PrintBucketAcl.java deleted file mode 100644 index 57974f7a5f..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/PrintBucketAcl.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_print_bucket_acl] - -import com.google.cloud.storage.Acl; -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import java.util.List; - -public class PrintBucketAcl { - - public static void printBucketAcl(String projectId, String bucketName) { - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = storage.get(bucketName); - List bucketAcls = bucket.getAcl(); - - for (Acl acl : bucketAcls) { - - // This will give you the role. - // See https://cloud.google.com/storage/docs/access-control/lists#permissions - String role = acl.getRole().name(); - - // This will give you the Entity type (i.e. User, Group, Project etc.) - // See https://cloud.google.com/storage/docs/access-control/lists#scopes - String entityType = acl.getEntity().getType().name(); - - System.out.printf("%s: %s \n", role, entityType); - } - } -} -// [END storage_print_bucket_acl] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/PrintBucketAclFilterByUser.java b/samples/snippets/src/main/java/com/example/storage/bucket/PrintBucketAclFilterByUser.java deleted file mode 100644 index 68690299e5..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/PrintBucketAclFilterByUser.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_print_bucket_acl_for_user] - -import com.google.cloud.storage.Acl; -import com.google.cloud.storage.Acl.User; -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class PrintBucketAclFilterByUser { - - public static void printBucketAclFilterByUser(String bucketName, String userEmail) { - - // The ID to give your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The email of the user whose acl is being retrieved. - // String userEmail = "someuser@domain.com" - - Storage storage = StorageOptions.newBuilder().build().getService(); - Bucket bucket = storage.get(bucketName); - - Acl userAcl = bucket.getAcl(new User(userEmail)); - String userRole = userAcl.getRole().name(); - System.out.println("User " + userEmail + " has role " + userRole); - } -} - -// [END storage_print_bucket_acl_for_user] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketCors.java b/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketCors.java deleted file mode 100644 index 220a24cb4e..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketCors.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.bucket; - -// [START storage_remove_cors_configuration] - -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Cors; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import java.util.ArrayList; -import java.util.List; - -public class RemoveBucketCors { - public static void removeBucketCors(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = - storage.get(bucketName, Storage.BucketGetOption.fields(Storage.BucketField.CORS)); - - // getCors() returns the List and copying over to an ArrayList so it's mutable. - List cors = new ArrayList<>(bucket.getCors()); - - // Clear bucket CORS configuration. - cors.clear(); - - // Update bucket to remove CORS. - bucket.toBuilder().setCors(cors).build().update(); - System.out.println("Removed CORS configuration from bucket " + bucketName); - } -} -// [END storage_remove_cors_configuration] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketDefaultKmsKey.java b/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketDefaultKmsKey.java deleted file mode 100644 index 83ab00d6d7..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketDefaultKmsKey.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.bucket; - -// [START storage_bucket_delete_default_kms_key] -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class RemoveBucketDefaultKmsKey { - public static void removeBucketDefaultKmsKey(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = storage.get(bucketName); - bucket.toBuilder().setDefaultKmsKeyName(null).build().update(); - - System.out.println("Default KMS key was removed from " + bucketName); - } -} -// [END storage_bucket_delete_default_kms_key] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketDefaultOwner.java b/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketDefaultOwner.java deleted file mode 100644 index f3e342b284..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketDefaultOwner.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_remove_bucket_default_owner] - -import com.google.cloud.storage.Acl.User; -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class RemoveBucketDefaultOwner { - - public static void removeBucketDefaultOwner(String bucketName, String userEmail) { - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The email of the user you wish to remove as a default owner - // String userEmail = "someuser@domain.com" - - Storage storage = StorageOptions.newBuilder().build().getService(); - Bucket bucket = storage.get(bucketName); - User userToRemove = new User(userEmail); - - boolean success = bucket.deleteDefaultAcl(userToRemove); - if (success) { - System.out.println("Removed user " + userEmail + " as an owner on " + bucketName); - } else { - System.out.println("User " + userEmail + " was not found"); - } - } -} -// [END storage_remove_bucket_default_owner] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketIamConditionalBinding.java b/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketIamConditionalBinding.java deleted file mode 100644 index 71ea948177..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketIamConditionalBinding.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_remove_bucket_conditional_iam_binding] - -import com.google.cloud.Binding; -import com.google.cloud.Condition; -import com.google.cloud.Policy; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -public class RemoveBucketIamConditionalBinding { - /** Example of removing a conditional binding to the Bucket-level IAM */ - public static void removeBucketIamConditionalBinding(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // For more information please read: - // https://cloud.google.com/storage/docs/access-control/iam - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - Policy originalPolicy = - storage.getIamPolicy(bucketName, Storage.BucketSourceOption.requestedPolicyVersion(3)); - - String role = "roles/storage.objectViewer"; - - // getBindingsList() returns an ImmutableList and copying over to an ArrayList so it's mutable. - List bindings = new ArrayList(originalPolicy.getBindingsList()); - - // Create a condition to compare against - Condition.Builder conditionBuilder = Condition.newBuilder(); - conditionBuilder.setTitle("Title"); - conditionBuilder.setDescription("Description"); - conditionBuilder.setExpression( - "resource.name.startsWith(\"projects/_/buckets/bucket-name/objects/prefix-a-\")"); - - Iterator iterator = bindings.iterator(); - while (iterator.hasNext()) { - Binding binding = (Binding) iterator.next(); - boolean foundRole = binding.getRole().equals(role); - boolean conditionsEqual = conditionBuilder.build().equals(binding.getCondition()); - - // Remove condition when the role and condition are equal - if (foundRole && conditionsEqual) { - iterator.remove(); - break; - } - } - - // Update policy to remove conditional binding - Policy.Builder updatedPolicyBuilder = originalPolicy.toBuilder(); - updatedPolicyBuilder.setBindings(bindings).setVersion(3); - Policy updatedPolicy = storage.setIamPolicy(bucketName, updatedPolicyBuilder.build()); - - System.out.println("Conditional Binding was removed."); - } -} -// [END storage_remove_bucket_conditional_iam_binding] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketIamMember.java b/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketIamMember.java deleted file mode 100644 index 026b3ab094..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketIamMember.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.bucket; - -// [START storage_remove_bucket_iam_member] - -import com.google.cloud.Binding; -import com.google.cloud.Policy; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import java.util.ArrayList; -import java.util.List; - -public class RemoveBucketIamMember { - public static void removeBucketIamMember(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // For more information please read: - // https://cloud.google.com/storage/docs/access-control/iam - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - Policy originalPolicy = - storage.getIamPolicy(bucketName, Storage.BucketSourceOption.requestedPolicyVersion(3)); - - String role = "roles/storage.objectViewer"; - String member = "group:example@google.com"; - - // getBindingsList() returns an ImmutableList and copying over to an ArrayList so it's mutable. - List bindings = new ArrayList(originalPolicy.getBindingsList()); - - // Remove role-member binding without a condition. - for (int index = 0; index < bindings.size(); index++) { - Binding binding = bindings.get(index); - boolean foundRole = binding.getRole().equals(role); - boolean foundMember = binding.getMembers().contains(member); - boolean bindingIsNotConditional = binding.getCondition() == null; - - if (foundRole && foundMember && bindingIsNotConditional) { - bindings.set(index, binding.toBuilder().removeMembers(member).build()); - break; - } - } - - // Update policy to remove member - Policy.Builder updatedPolicyBuilder = originalPolicy.toBuilder(); - updatedPolicyBuilder.setBindings(bindings).setVersion(3); - Policy updatedPolicy = storage.setIamPolicy(bucketName, updatedPolicyBuilder.build()); - - System.out.printf("Removed %s with role %s from %s\n", member, role, bucketName); - } -} -// [END storage_remove_bucket_iam_member] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketLabel.java b/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketLabel.java deleted file mode 100644 index 1e63ba76d3..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketLabel.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.bucket; - -// [START storage_remove_bucket_label] - -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import java.util.HashMap; -import java.util.Map; - -public class RemoveBucketLabel { - public static void removeBucketLabel(String projectId, String bucketName, String labelKey) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The key of the label to remove from the bucket - // String labelKey = "label-key-to-remove"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - Map labelsToRemove = new HashMap<>(); - labelsToRemove.put(labelKey, null); - - Bucket bucket = storage.get(bucketName); - Map labels; - if (bucket.getLabels() == null) { - labels = new HashMap<>(); - } else { - labels = new HashMap(bucket.getLabels()); - } - labels.putAll(labelsToRemove); - bucket.toBuilder().setLabels(labels).build().update(); - - System.out.println("Removed label " + labelKey + " from bucket " + bucketName); - } -} -// [END storage_remove_bucket_label] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketOwner.java b/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketOwner.java deleted file mode 100644 index 07334b78d5..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketOwner.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_remove_bucket_owner] - -import com.google.cloud.storage.Acl.User; -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class RemoveBucketOwner { - - public static void removeBucketOwner(String projectId, String bucketName, String userEmail) { - - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // Email of the user you wish to remove as an owner - // String userEmail = "someuser@domain.com" - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = storage.get(bucketName); - User ownerToRemove = new User(userEmail); - - boolean success = bucket.deleteAcl(ownerToRemove); - if (success) { - System.out.println("Removed user " + userEmail + " as an owner on " + bucketName); - } else { - System.out.println("User " + userEmail + " was not found"); - } - } -} - -// [END storage_remove_bucket_owner] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/RemoveRetentionPolicy.java b/samples/snippets/src/main/java/com/example/storage/bucket/RemoveRetentionPolicy.java deleted file mode 100644 index 8ad4875b29..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/RemoveRetentionPolicy.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_remove_retention_policy] - -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; - -public class RemoveRetentionPolicy { - public static void removeRetentionPolicy(String projectId, String bucketName) - throws StorageException, IllegalArgumentException { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - Bucket bucket = - storage.get( - bucketName, Storage.BucketGetOption.fields(Storage.BucketField.RETENTION_POLICY)); - if (bucket.retentionPolicyIsLocked() != null && bucket.retentionPolicyIsLocked()) { - throw new IllegalArgumentException( - "Unable to remove retention policy as retention policy is locked."); - } - - bucket.toBuilder().setRetentionPeriod(null).build().update(); - - System.out.println("Retention policy for " + bucketName + " has been removed"); - } -} -// [END storage_remove_retention_policy] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/SetAsyncTurboRpo.java b/samples/snippets/src/main/java/com/example/storage/bucket/SetAsyncTurboRpo.java deleted file mode 100644 index 137e940b26..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/SetAsyncTurboRpo.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_set_rpo_async_turbo] -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Rpo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class SetAsyncTurboRpo { - public static void setAsyncTurboRpo(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = storage.get(bucketName); - - bucket.toBuilder().setRpo(Rpo.ASYNC_TURBO).build().update(); - - System.out.println("Turbo replication was enabled for " + bucketName); - } -} -// [END storage_set_rpo_async_turbo] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/SetBucketDefaultKmsKey.java b/samples/snippets/src/main/java/com/example/storage/bucket/SetBucketDefaultKmsKey.java deleted file mode 100644 index 947eb7601c..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/SetBucketDefaultKmsKey.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_set_bucket_default_kms_key] - -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.BucketInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; - -public class SetBucketDefaultKmsKey { - public static void setBucketDefaultKmsKey(String projectId, String bucketName, String kmsKeyName) - throws StorageException { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The name of the KMS key to use as a default - // String kmsKeyName = - // "projects/your-project-id/locations/us/keyRings/my_key_ring/cryptoKeys/my_key" - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - BucketInfo bucketInfo = - BucketInfo.newBuilder(bucketName).setDefaultKmsKeyName(kmsKeyName).build(); - Bucket bucket = storage.update(bucketInfo); - - System.out.println( - "KMS Key " + bucket.getDefaultKmsKeyName() + "was set to default for bucket " + bucketName); - } -} -// [END storage_set_bucket_default_kms_key] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/SetBucketWebsiteInfo.java b/samples/snippets/src/main/java/com/example/storage/bucket/SetBucketWebsiteInfo.java deleted file mode 100644 index b9e1afd416..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/SetBucketWebsiteInfo.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.bucket; - -// [START storage_define_bucket_website_configuration] -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class SetBucketWebsiteInfo { - public static void setBucketWesbiteInfo( - String projectId, String bucketName, String indexPage, String notFoundPage) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your static website bucket - // String bucketName = "www.example.com"; - - // The index page for a static website bucket - // String indexPage = "index.html"; - - // The 404 page for a static website bucket - // String notFoundPage = "404.html"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = storage.get(bucketName); - bucket.toBuilder().setIndexPage(indexPage).setNotFoundPage(notFoundPage).build().update(); - - System.out.println( - "Static website bucket " - + bucketName - + " is set up to use " - + indexPage - + " as the index page and " - + notFoundPage - + " as the 404 page"); - } -} -// [END storage_define_bucket_website_configuration] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/SetClientEndpoint.java b/samples/snippets/src/main/java/com/example/storage/bucket/SetClientEndpoint.java deleted file mode 100644 index 9fdf7b9766..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/SetClientEndpoint.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_set_client_endpoint] - -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class SetClientEndpoint { - - public static void setClientEndpoint(String projectId, String endpoint) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The endpoint you wish to target - // String endpoint = "https://storage.googleapis.com" - - Storage storage = - StorageOptions.newBuilder().setProjectId(projectId).setHost(endpoint).build().getService(); - - System.out.println( - "Storage Client initialized with endpoint " + storage.getOptions().getHost()); - } -} - -// [END storage_set_client_endpoint] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/SetDefaultRpo.java b/samples/snippets/src/main/java/com/example/storage/bucket/SetDefaultRpo.java deleted file mode 100644 index c135e0436f..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/SetDefaultRpo.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_set_rpo_default] -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Rpo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class SetDefaultRpo { - public static void setDefaultRpo(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = storage.get(bucketName); - - bucket.toBuilder().setRpo(Rpo.DEFAULT).build().update(); - - System.out.println("Replication was set to default for " + bucketName); - } -} -// [END storage_set_rpo_default] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/SetPublicAccessPreventionEnforced.java b/samples/snippets/src/main/java/com/example/storage/bucket/SetPublicAccessPreventionEnforced.java deleted file mode 100644 index 8d679838a5..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/SetPublicAccessPreventionEnforced.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.bucket; - -// [START storage_set_public_access_prevention_enforced] -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.BucketInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class SetPublicAccessPreventionEnforced { - public static void setPublicAccessPreventionEnforced(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = storage.get(bucketName); - - // Enforces public access prevention for the bucket - bucket - .toBuilder() - .setIamConfiguration( - BucketInfo.IamConfiguration.newBuilder() - .setPublicAccessPrevention(BucketInfo.PublicAccessPrevention.ENFORCED) - .build()) - .build() - .update(); - - System.out.println("Public access prevention is set to enforced for " + bucketName); - } -} -// [END storage_set_public_access_prevention_enforced] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/SetPublicAccessPreventionInherited.java b/samples/snippets/src/main/java/com/example/storage/bucket/SetPublicAccessPreventionInherited.java deleted file mode 100644 index 57938b8c48..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/SetPublicAccessPreventionInherited.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_set_public_access_prevention_inherited] -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.BucketInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class SetPublicAccessPreventionInherited { - public static void setPublicAccessPreventionInherited(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = storage.get(bucketName); - - // Sets public access prevention to 'inherited' for the bucket - bucket - .toBuilder() - .setIamConfiguration( - BucketInfo.IamConfiguration.newBuilder() - .setPublicAccessPrevention(BucketInfo.PublicAccessPrevention.INHERITED) - .build()) - .build() - .update(); - - System.out.println("Public access prevention is set to 'inherited' for " + bucketName); - } -} -// [END storage_set_public_access_prevention_inherited] diff --git a/samples/snippets/src/main/java/com/example/storage/bucket/SetRetentionPolicy.java b/samples/snippets/src/main/java/com/example/storage/bucket/SetRetentionPolicy.java deleted file mode 100644 index 1d40f46a46..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/bucket/SetRetentionPolicy.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -// [START storage_set_retention_policy] - -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.BucketInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; - -public class SetRetentionPolicy { - public static void setRetentionPolicy( - String projectId, String bucketName, Long retentionPeriodSeconds) throws StorageException { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The retention period for objects in bucket - // Long retentionPeriodSeconds = 3600L; // 1 hour in seconds - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - Bucket bucketWithRetentionPolicy = - storage.update( - BucketInfo.newBuilder(bucketName).setRetentionPeriod(retentionPeriodSeconds).build()); - - System.out.println( - "Retention period for " - + bucketName - + " is now " - + bucketWithRetentionPolicy.getRetentionPeriod()); - } -} -// [END storage_set_retention_policy] diff --git a/samples/snippets/src/main/java/com/example/storage/hmac/ActivateHmacKey.java b/samples/snippets/src/main/java/com/example/storage/hmac/ActivateHmacKey.java deleted file mode 100644 index 9a23e39161..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/hmac/ActivateHmacKey.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.hmac; - -// [START storage_activate_hmac_key] - -import com.google.cloud.storage.HmacKey; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; -import java.util.Date; - -public class ActivateHmacKey { - public static void activateHmacKey(String accessId, String projectId) throws StorageException { - // The access ID of the HMAC key. - // String accessId = "GOOG0234230X00"; - - // The ID of the project to which the service account belongs. - // String projectId = "project-id"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - HmacKey.HmacKeyMetadata metadata = - storage.getHmacKey(accessId, Storage.GetHmacKeyOption.projectId(projectId)); - HmacKey.HmacKeyMetadata newMetadata = - storage.updateHmacKeyState(metadata, HmacKey.HmacKeyState.ACTIVE); - - System.out.println("The HMAC key is now active."); - System.out.println("The HMAC key metadata is:"); - System.out.println("ID: " + newMetadata.getId()); - System.out.println("Access ID: " + newMetadata.getAccessId()); - System.out.println("Project ID: " + newMetadata.getProjectId()); - System.out.println("Service Account Email: " + newMetadata.getServiceAccount().getEmail()); - System.out.println("State: " + newMetadata.getState().toString()); - System.out.println("Time Created: " + new Date(newMetadata.getCreateTime()).toString()); - System.out.println("Time Updated: " + new Date(newMetadata.getUpdateTime()).toString()); - System.out.println("ETag: " + newMetadata.getEtag()); - } -} -// [END storage_activate_hmac_key] diff --git a/samples/snippets/src/main/java/com/example/storage/hmac/CreateHmacKey.java b/samples/snippets/src/main/java/com/example/storage/hmac/CreateHmacKey.java deleted file mode 100644 index 5c729a8dd1..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/hmac/CreateHmacKey.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.hmac; - -// [START storage_create_hmac_key] - -import com.google.cloud.storage.HmacKey; -import com.google.cloud.storage.ServiceAccount; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; -import java.util.Date; - -public class CreateHmacKey { - public static void createHmacKey(String serviceAccountEmail, String projectId) - throws StorageException { - - // The service account email for which the new HMAC key will be created. - // String serviceAccountEmail = "service-account@iam.gserviceaccount.com"; - - // The ID of the project to which the service account belongs. - // String projectId = "project-id"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - ServiceAccount account = ServiceAccount.of(serviceAccountEmail); - HmacKey hmacKey = - storage.createHmacKey(account, Storage.CreateHmacKeyOption.projectId(projectId)); - - String secret = hmacKey.getSecretKey(); - HmacKey.HmacKeyMetadata metadata = hmacKey.getMetadata(); - - System.out.println("The Base64 encoded secret is: " + secret); - System.out.println("Do not lose that secret, there is no API to recover it."); - System.out.println("The HMAC key metadata is:"); - System.out.println("ID: " + metadata.getId()); - System.out.println("Access ID: " + metadata.getAccessId()); - System.out.println("Project ID: " + metadata.getProjectId()); - System.out.println("Service Account Email: " + metadata.getServiceAccount().getEmail()); - System.out.println("State: " + metadata.getState().toString()); - System.out.println("Time Created: " + new Date(metadata.getCreateTime()).toString()); - System.out.println("Time Updated: " + new Date(metadata.getUpdateTime()).toString()); - System.out.println("ETag: " + metadata.getEtag()); - } -} -// [END storage_create_hmac_key] diff --git a/samples/snippets/src/main/java/com/example/storage/hmac/DeactivateHmacKey.java b/samples/snippets/src/main/java/com/example/storage/hmac/DeactivateHmacKey.java deleted file mode 100644 index 129cedf9e4..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/hmac/DeactivateHmacKey.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.hmac; - -// [START storage_deactivate_hmac_key] - -import com.google.cloud.storage.HmacKey; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; -import java.util.Date; - -public class DeactivateHmacKey { - public static void deactivateHmacKey(String accessId, String projectId) throws StorageException { - // The access ID of the HMAC key. - // String accessId = "GOOG0234230X00"; - - // The ID of the project to which the service account belongs. - // String projectId = "project-id"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - HmacKey.HmacKeyMetadata metadata = - storage.getHmacKey(accessId, Storage.GetHmacKeyOption.projectId(projectId)); - HmacKey.HmacKeyMetadata newMetadata = - storage.updateHmacKeyState(metadata, HmacKey.HmacKeyState.INACTIVE); - - System.out.println("The HMAC key is now inactive."); - System.out.println("The HMAC key metadata is:"); - System.out.println("ID: " + newMetadata.getId()); - System.out.println("Access ID: " + newMetadata.getAccessId()); - System.out.println("Project ID: " + newMetadata.getProjectId()); - System.out.println("Service Account Email: " + newMetadata.getServiceAccount().getEmail()); - System.out.println("State: " + newMetadata.getState().toString()); - System.out.println("Time Created: " + new Date(newMetadata.getCreateTime()).toString()); - System.out.println("Time Updated: " + new Date(newMetadata.getUpdateTime()).toString()); - System.out.println("ETag: " + newMetadata.getEtag()); - } -} -// [END storage_deactivate_hmac_key] diff --git a/samples/snippets/src/main/java/com/example/storage/hmac/DeleteHmacKey.java b/samples/snippets/src/main/java/com/example/storage/hmac/DeleteHmacKey.java deleted file mode 100644 index afd599f6e2..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/hmac/DeleteHmacKey.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.hmac; - -// [START storage_delete_hmac_key] - -import com.google.cloud.storage.HmacKey; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; - -public class DeleteHmacKey { - public static void deleteHmacKey(String accessId, String projectId) throws StorageException { - - // The access ID of the HMAC key. - // String accessId = "GOOG0234230X00"; - - // The ID of the project to which the service account belongs. - // String projectId = "project-id"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - HmacKey.HmacKeyMetadata metadata = - storage.getHmacKey(accessId, Storage.GetHmacKeyOption.projectId(projectId)); - storage.deleteHmacKey(metadata); - - System.out.println( - "The key is deleted, though it will still appear in " - + "getHmacKeys() results if called with showDeletedKey."); - } -} -// [END storage_delete_hmac_key] diff --git a/samples/snippets/src/main/java/com/example/storage/hmac/GetHmacKey.java b/samples/snippets/src/main/java/com/example/storage/hmac/GetHmacKey.java deleted file mode 100644 index eea8fe22b5..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/hmac/GetHmacKey.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.hmac; - -// [START storage_get_hmac_key] - -import com.google.cloud.storage.HmacKey; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; -import java.util.Date; - -public class GetHmacKey { - public static void getHmacKey(String accessId, String projectId) throws StorageException { - // The access ID of the HMAC key. - // String accessId = "GOOG0234230X00"; - - // The ID of the project to which the service account belongs. - // String projectId = "project-id"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - HmacKey.HmacKeyMetadata metadata = - storage.getHmacKey(accessId, Storage.GetHmacKeyOption.projectId(projectId)); - - System.out.println("The HMAC key metadata is:"); - System.out.println("ID: " + metadata.getId()); - System.out.println("Access ID: " + metadata.getAccessId()); - System.out.println("Project ID: " + metadata.getProjectId()); - System.out.println("Service Account Email: " + metadata.getServiceAccount().getEmail()); - System.out.println("State: " + metadata.getState().toString()); - System.out.println("Time Created: " + new Date(metadata.getCreateTime()).toString()); - System.out.println("Time Updated: " + new Date(metadata.getUpdateTime()).toString()); - System.out.println("ETag: " + metadata.getEtag()); - } -} -// [END storage_get_hmac_key] diff --git a/samples/snippets/src/main/java/com/example/storage/hmac/ListHmacKeys.java b/samples/snippets/src/main/java/com/example/storage/hmac/ListHmacKeys.java deleted file mode 100644 index 538fc95909..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/hmac/ListHmacKeys.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.hmac; - -// [START storage_list_hmac_keys] - -import com.google.api.gax.paging.Page; -import com.google.cloud.storage.HmacKey; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; - -public class ListHmacKeys { - public static void listHmacKeys(String projectId) throws StorageException { - // The ID of the project to which the service account belongs. - // String projectId = "project-id"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - Page page = - storage.listHmacKeys(Storage.ListHmacKeysOption.projectId(projectId)); - - for (HmacKey.HmacKeyMetadata metadata : page.iterateAll()) { - System.out.println("Service Account Email: " + metadata.getServiceAccount().getEmail()); - System.out.println("Access ID: " + metadata.getAccessId()); - } - } -} -// [END storage_list_hmac_keys] diff --git a/samples/snippets/src/main/java/com/example/storage/object/AddFileOwner.java b/samples/snippets/src/main/java/com/example/storage/object/AddFileOwner.java deleted file mode 100644 index 394bc15b6f..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/AddFileOwner.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.object; - -// [START storage_add_file_owner] - -import com.google.cloud.storage.Acl; -import com.google.cloud.storage.Acl.Role; -import com.google.cloud.storage.Acl.User; -import com.google.cloud.storage.Blob; -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class AddFileOwner { - - public static void addFileOwner( - String projectId, String bucketName, String userEmail, String blobName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // Email of the user you wish to add as a file owner - // String userEmail = "someuser@domain.com" - - // The name of the blob/file that you wish to modify permissions on - // String blobName = "your-blob-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Blob blob = storage.get(BlobId.of(bucketName, blobName)); - Acl newOwner = Acl.of(new User(userEmail), Role.OWNER); - - blob.createAcl(newOwner); - System.out.println( - "Added user " - + userEmail - + " as an owner on file " - + blobName - + " in bucket " - + bucketName); - } -} -// [END storage_add_file_owner] diff --git a/samples/snippets/src/main/java/com/example/storage/object/ChangeObjectCsekToKms.java b/samples/snippets/src/main/java/com/example/storage/object/ChangeObjectCsekToKms.java deleted file mode 100644 index efedf5b0eb..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/ChangeObjectCsekToKms.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_object_csek_to_cmek] -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class ChangeObjectCsekToKms { - public static void changeObjectFromCsekToKms( - String projectId, - String bucketName, - String objectName, - String decryptionKey, - String kmsKeyName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of your GCS object - // String objectName = "your-object-name"; - - // The Base64 encoded decryption key, which should be the same key originally used to encrypt - // the object - // String decryptionKey = "TIbv/fjexq+VmtXzAlc63J4z5kFmWJ6NdAPQulQBT7g="; - - // The name of the KMS key to manage this object with - // String kmsKeyName = - // "projects/your-project-id/locations/global/keyRings/your-key-ring/cryptoKeys/your-key"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - BlobId blobId = BlobId.of(bucketName, objectName); - Storage.CopyRequest request = - Storage.CopyRequest.newBuilder() - .setSource(blobId) - .setSourceOptions(Storage.BlobSourceOption.decryptionKey(decryptionKey)) - .setTarget(blobId, Storage.BlobTargetOption.kmsKeyName(kmsKeyName)) - .build(); - storage.copy(request); - - System.out.println( - "Object " - + objectName - + " in bucket " - + bucketName - + " is now managed by the KMS key " - + kmsKeyName - + " instead of a customer-supplied encryption key"); - } -} -// [END storage_object_csek_to_cmek] diff --git a/samples/snippets/src/main/java/com/example/storage/object/ChangeObjectStorageClass.java b/samples/snippets/src/main/java/com/example/storage/object/ChangeObjectStorageClass.java deleted file mode 100644 index 82b86e7303..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/ChangeObjectStorageClass.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_change_file_storage_class] -import com.google.cloud.storage.Blob; -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.BlobInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageClass; -import com.google.cloud.storage.StorageOptions; - -public class ChangeObjectStorageClass { - public static void changeObjectStorageClass( - String projectId, String bucketName, String objectName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of your GCS object - // String objectName = "your-object-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - BlobId blobId = BlobId.of(bucketName, objectName); - - // See the StorageClass documentation for other valid storage classes: - // https://googleapis.dev/java/google-cloud-clients/latest/com/google/cloud/storage/StorageClass.html - StorageClass storageClass = StorageClass.COLDLINE; - - // You can't change an object's storage class directly, the only way is to rewrite the object - // with the - // desired storage class - Storage.CopyRequest request = - Storage.CopyRequest.newBuilder() - .setSource(blobId) - .setTarget(BlobInfo.newBuilder(blobId).setStorageClass(storageClass).build()) - .build(); - Blob updatedBlob = storage.copy(request).getResult(); - - System.out.println( - "Object " - + objectName - + " in bucket " - + bucketName - + " had its storage class set to " - + updatedBlob.getStorageClass().name()); - } -} -// [END storage_change_file_storage_class] diff --git a/samples/snippets/src/main/java/com/example/storage/object/ComposeObject.java b/samples/snippets/src/main/java/com/example/storage/object/ComposeObject.java deleted file mode 100644 index bfba31e6b7..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/ComposeObject.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_compose_file] -import com.google.cloud.storage.Blob; -import com.google.cloud.storage.BlobInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class ComposeObject { - public static void composeObject( - String bucketName, - String firstObjectName, - String secondObjectName, - String targetObjectName, - String projectId) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of the first GCS object to compose - // String firstObjectName = "your-first-object-name"; - - // The ID of the second GCS object to compose - // String secondObjectName = "your-second-object-name"; - - // The ID to give the new composite object - // String targetObjectName = "new-composite-object-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - Storage.ComposeRequest composeRequest = - Storage.ComposeRequest.newBuilder() - // addSource takes varargs, so you can put as many objects here as you want, up to the - // max of 32 - .addSource(firstObjectName, secondObjectName) - .setTarget(BlobInfo.newBuilder(bucketName, targetObjectName).build()) - .build(); - - Blob compositeObject = storage.compose(composeRequest); - - System.out.println( - "New composite object " - + compositeObject.getName() - + " was created by combining " - + firstObjectName - + " and " - + secondObjectName); - } -} -// [END storage_compose_file] diff --git a/samples/snippets/src/main/java/com/example/storage/object/CopyObject.java b/samples/snippets/src/main/java/com/example/storage/object/CopyObject.java deleted file mode 100644 index b1b8df8f35..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/CopyObject.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_copy_file] -import com.google.cloud.storage.Blob; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class CopyObject { - public static void copyObject( - String projectId, String sourceBucketName, String objectName, String targetBucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of the bucket the original object is in - // String sourceBucketName = "your-source-bucket"; - - // The ID of the GCS object to copy - // String objectName = "your-object-name"; - - // The ID of the bucket to copy the object to - // String targetBucketName = "target-object-bucket" - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Blob blob = storage.get(sourceBucketName, objectName); - - // This keeps the original name, you could also do - // copyTo(targetBucketName, "target-object-name") to change the name - blob.copyTo(targetBucketName); - - System.out.println( - "Copied object " - + objectName - + " from bucket " - + sourceBucketName - + " to " - + targetBucketName); - } -} -// [END storage_copy_file] diff --git a/samples/snippets/src/main/java/com/example/storage/object/CopyOldVersionOfObject.java b/samples/snippets/src/main/java/com/example/storage/object/CopyOldVersionOfObject.java deleted file mode 100644 index ed10ea24cd..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/CopyOldVersionOfObject.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_copy_file_archived_generation] -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class CopyOldVersionOfObject { - public static void copyOldVersionOfObject( - String projectId, - String bucketName, - String objectToCopy, - long generationToCopy, - String newObjectName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of the GCS object to copy an old version of - // String objectToCopy = "your-object-name"; - - // The generation of objectToCopy to copy - // long generationToCopy = 1579287380533984; - - // What to name the new object with the old data from objectToCopy - // String newObjectName = "your-new-object"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Storage.CopyRequest copyRequest = - Storage.CopyRequest.newBuilder() - .setSource(BlobId.of(bucketName, objectToCopy, generationToCopy)) - .setTarget(BlobId.of(bucketName, newObjectName)) - .build(); - storage.copy(copyRequest); - - System.out.println( - "Generation " - + generationToCopy - + " of object " - + objectToCopy - + " in bucket " - + bucketName - + " was copied to " - + newObjectName); - } -} -// [END storage_copy_file_archived_generation] diff --git a/samples/snippets/src/main/java/com/example/storage/object/DeleteObject.java b/samples/snippets/src/main/java/com/example/storage/object/DeleteObject.java deleted file mode 100644 index 68e9b2c845..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/DeleteObject.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_delete_file] -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class DeleteObject { - public static void deleteObject(String projectId, String bucketName, String objectName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of your GCS object - // String objectName = "your-object-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - storage.delete(bucketName, objectName); - - System.out.println("Object " + objectName + " was deleted from " + bucketName); - } -} -// [END storage_delete_file] diff --git a/samples/snippets/src/main/java/com/example/storage/object/DeleteOldVersionOfObject.java b/samples/snippets/src/main/java/com/example/storage/object/DeleteOldVersionOfObject.java deleted file mode 100644 index 5c0d6e1f7b..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/DeleteOldVersionOfObject.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_delete_file_archived_generation] -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class DeleteOldVersionOfObject { - public static void deleteOldVersionOfObject( - String projectId, String bucketName, String objectName, long generationToDelete) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of your GCS object - // String objectName = "your-object-name"; - - // The generation of objectName to delete - // long generationToDelete = 1579287380533984; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - storage.delete(BlobId.of(bucketName, objectName, generationToDelete)); - - System.out.println( - "Generation " - + generationToDelete - + " of object " - + objectName - + " was deleted from " - + bucketName); - } -} -// [END storage_delete_file_archived_generation] diff --git a/samples/snippets/src/main/java/com/example/storage/object/DownloadEncryptedObject.java b/samples/snippets/src/main/java/com/example/storage/object/DownloadEncryptedObject.java deleted file mode 100644 index 5fd72e75f1..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/DownloadEncryptedObject.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_download_encrypted_file] - -import com.google.cloud.storage.Blob; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import java.io.IOException; -import java.nio.file.Path; - -public class DownloadEncryptedObject { - public static void downloadEncryptedObject( - String projectId, - String bucketName, - String objectName, - Path destFilePath, - String decryptionKey) - throws IOException { - - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of your GCS object - // String objectName = "your-object-name"; - - // The path to which the file should be downloaded - // Path destFilePath = Paths.get("/local/path/to/file.txt"); - - // The Base64 encoded decryption key, which should be the same key originally used to encrypt - // the object - // String decryptionKey = "TIbv/fjexq+VmtXzAlc63J4z5kFmWJ6NdAPQulQBT7g="; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - Blob blob = storage.get(bucketName, objectName); - blob.downloadTo(destFilePath, Blob.BlobSourceOption.decryptionKey(decryptionKey)); - - System.out.println( - "Downloaded object " - + objectName - + " from bucket name " - + bucketName - + " to " - + destFilePath - + " using customer-supplied encryption key"); - } -} -// [END storage_download_encrypted_file] diff --git a/samples/snippets/src/main/java/com/example/storage/object/DownloadObject.java b/samples/snippets/src/main/java/com/example/storage/object/DownloadObject.java deleted file mode 100644 index 8f0f848e44..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/DownloadObject.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_download_file] - -import com.google.cloud.storage.Blob; -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import java.nio.file.Paths; - -public class DownloadObject { - public static void downloadObject( - String projectId, String bucketName, String objectName, String destFilePath) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of your GCS object - // String objectName = "your-object-name"; - - // The path to which the file should be downloaded - // String destFilePath = "/local/path/to/file.txt"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - Blob blob = storage.get(BlobId.of(bucketName, objectName)); - blob.downloadTo(Paths.get(destFilePath)); - - System.out.println( - "Downloaded object " - + objectName - + " from bucket name " - + bucketName - + " to " - + destFilePath); - } -} -// [END storage_download_file] diff --git a/samples/snippets/src/main/java/com/example/storage/object/DownloadObjectIntoMemory.java b/samples/snippets/src/main/java/com/example/storage/object/DownloadObjectIntoMemory.java deleted file mode 100644 index 57d1efc72d..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/DownloadObjectIntoMemory.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.object; - -// [START storage_file_download_into_memory] - -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import java.nio.charset.StandardCharsets; - -public class DownloadObjectIntoMemory { - public static void downloadObjectIntoMemory( - String projectId, String bucketName, String objectName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of your GCS object - // String objectName = "your-object-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - byte[] content = storage.readAllBytes(bucketName, objectName); - System.out.println( - "The contents of " - + objectName - + " from bucket name " - + bucketName - + " are: " - + new String(content, StandardCharsets.UTF_8)); - } -} -// [END storage_file_download_into_memory] diff --git a/samples/snippets/src/main/java/com/example/storage/object/DownloadPublicObject.java b/samples/snippets/src/main/java/com/example/storage/object/DownloadPublicObject.java deleted file mode 100644 index b8072893d4..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/DownloadPublicObject.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_download_public_file] - -import com.google.cloud.storage.Blob; -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import java.nio.file.Path; - -public class DownloadPublicObject { - public static void downloadPublicObject( - String bucketName, String publicObjectName, Path destFilePath) { - // The name of the bucket to access - // String bucketName = "my-bucket"; - - // The name of the remote public file to download - // String publicObjectName = "publicfile.txt"; - - // The path to which the file should be downloaded - // Path destFilePath = Paths.get("/local/path/to/file.txt"); - - // Instantiate an anonymous Google Cloud Storage client, which can only access public files - Storage storage = StorageOptions.getUnauthenticatedInstance().getService(); - - Blob blob = storage.get(BlobId.of(bucketName, publicObjectName)); - blob.downloadTo(destFilePath); - - System.out.println( - "Downloaded public object " - + publicObjectName - + " from bucket name " - + bucketName - + " to " - + destFilePath); - } -} -// [END storage_download_public_file] diff --git a/samples/snippets/src/main/java/com/example/storage/object/DownloadRequesterPaysObject.java b/samples/snippets/src/main/java/com/example/storage/object/DownloadRequesterPaysObject.java deleted file mode 100644 index 83d993853d..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/DownloadRequesterPaysObject.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_download_file_requester_pays] - -import com.google.cloud.storage.Blob; -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import java.nio.file.Path; - -public class DownloadRequesterPaysObject { - public static void downloadRequesterPaysObject( - String projectId, String bucketName, String objectName, Path destFilePath) { - // The project ID to bill - // String projectId = "my-billable-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of your GCS object - // String objectName = "your-object-name"; - - // The path to which the file should be downloaded - // Path destFilePath = Paths.get("/local/path/to/file.txt"); - - Storage storage = StorageOptions.getDefaultInstance().getService(); - Blob blob = - storage.get( - BlobId.of(bucketName, objectName), Storage.BlobGetOption.userProject(projectId)); - blob.downloadTo(destFilePath, Blob.BlobSourceOption.userProject(projectId)); - - System.out.println( - "Object " + objectName + " downloaded to " + destFilePath + " and billed to " + projectId); - } -} -// [END storage_download_file_requester_pays] diff --git a/samples/snippets/src/main/java/com/example/storage/object/GenerateEncryptionKey.java b/samples/snippets/src/main/java/com/example/storage/object/GenerateEncryptionKey.java deleted file mode 100644 index cab2274804..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/GenerateEncryptionKey.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_generate_encryption_key] - -import com.google.common.io.BaseEncoding; -import java.security.SecureRandom; - -public class GenerateEncryptionKey { - /** - * Generates a 256 bit (32 byte) AES encryption key and prints the base64 representation. This is - * included for demonstration purposes only. You should generate your own key, and consult your - * security team about best practices. Please remember that encryption keys should be handled with - * a comprehensive security policy. - */ - public static void generateEncryptionKey() { - byte[] key = new byte[32]; - new SecureRandom().nextBytes(key); - String encryptionKey = BaseEncoding.base64().encode(key); - - System.out.println("Generated Base64-encoded AES-256 encryption key: " + encryptionKey); - } -} -// [END storage_generate_encryption_key] diff --git a/samples/snippets/src/main/java/com/example/storage/object/GenerateV4GetObjectSignedUrl.java b/samples/snippets/src/main/java/com/example/storage/object/GenerateV4GetObjectSignedUrl.java deleted file mode 100644 index eed58bcccf..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/GenerateV4GetObjectSignedUrl.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_generate_signed_url_v4] - -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.BlobInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; -import java.net.URL; -import java.util.concurrent.TimeUnit; - -public class GenerateV4GetObjectSignedUrl { - /** - * Signing a URL requires Credentials which implement ServiceAccountSigner. These can be set - * explicitly using the Storage.SignUrlOption.signWith(ServiceAccountSigner) option. If you don't, - * you could also pass a service account signer to StorageOptions, i.e. - * StorageOptions().newBuilder().setCredentials(ServiceAccountSignerCredentials). In this example, - * neither of these options are used, which means the following code only works when the - * credentials are defined via the environment variable GOOGLE_APPLICATION_CREDENTIALS, and those - * credentials are authorized to sign a URL. See the documentation for Storage.signUrl for more - * details. - */ - public static void generateV4GetObjectSignedUrl( - String projectId, String bucketName, String objectName) throws StorageException { - // String projectId = "my-project-id"; - // String bucketName = "my-bucket"; - // String objectName = "my-object"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - // Define resource - BlobInfo blobInfo = BlobInfo.newBuilder(BlobId.of(bucketName, objectName)).build(); - - URL url = - storage.signUrl(blobInfo, 15, TimeUnit.MINUTES, Storage.SignUrlOption.withV4Signature()); - - System.out.println("Generated GET signed URL:"); - System.out.println(url); - System.out.println("You can use this URL with any user agent, for example:"); - System.out.println("curl '" + url + "'"); - } -} -// [END storage_generate_signed_url_v4] diff --git a/samples/snippets/src/main/java/com/example/storage/object/GenerateV4PutObjectSignedUrl.java b/samples/snippets/src/main/java/com/example/storage/object/GenerateV4PutObjectSignedUrl.java deleted file mode 100644 index c51b96d01b..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/GenerateV4PutObjectSignedUrl.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_generate_upload_signed_url_v4] - -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.BlobInfo; -import com.google.cloud.storage.HttpMethod; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; -import java.net.URL; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.TimeUnit; - -public class GenerateV4PutObjectSignedUrl { - /** - * Signing a URL requires Credentials which implement ServiceAccountSigner. These can be set - * explicitly using the Storage.SignUrlOption.signWith(ServiceAccountSigner) option. If you don't, - * you could also pass a service account signer to StorageOptions, i.e. - * StorageOptions().newBuilder().setCredentials(ServiceAccountSignerCredentials). In this example, - * neither of these options are used, which means the following code only works when the - * credentials are defined via the environment variable GOOGLE_APPLICATION_CREDENTIALS, and those - * credentials are authorized to sign a URL. See the documentation for Storage.signUrl for more - * details. - */ - public static void generateV4PutObjectSignedUrl( - String projectId, String bucketName, String objectName) throws StorageException { - // String projectId = "my-project-id"; - // String bucketName = "my-bucket"; - // String objectName = "my-object"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - // Define Resource - BlobInfo blobInfo = BlobInfo.newBuilder(BlobId.of(bucketName, objectName)).build(); - - // Generate Signed URL - Map extensionHeaders = new HashMap<>(); - extensionHeaders.put("Content-Type", "application/octet-stream"); - - URL url = - storage.signUrl( - blobInfo, - 15, - TimeUnit.MINUTES, - Storage.SignUrlOption.httpMethod(HttpMethod.PUT), - Storage.SignUrlOption.withExtHeaders(extensionHeaders), - Storage.SignUrlOption.withV4Signature()); - - System.out.println("Generated PUT signed URL:"); - System.out.println(url); - System.out.println("You can use this URL with any user agent, for example:"); - System.out.println( - "curl -X PUT -H 'Content-Type: application/octet-stream' --upload-file my-file '" - + url - + "'"); - } -} -// [END storage_generate_upload_signed_url_v4] diff --git a/samples/snippets/src/main/java/com/example/storage/object/GetObjectMetadata.java b/samples/snippets/src/main/java/com/example/storage/object/GetObjectMetadata.java deleted file mode 100644 index 74e452c3b2..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/GetObjectMetadata.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_get_metadata] - -import com.google.cloud.storage.Blob; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; -import java.util.Date; -import java.util.Map; - -public class GetObjectMetadata { - public static void getObjectMetadata(String projectId, String bucketName, String blobName) - throws StorageException { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of your GCS object - // String objectName = "your-object-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - // Select all fields - // Fields can be selected individually e.g. Storage.BlobField.CACHE_CONTROL - Blob blob = - storage.get(bucketName, blobName, Storage.BlobGetOption.fields(Storage.BlobField.values())); - - // Print blob metadata - System.out.println("Bucket: " + blob.getBucket()); - System.out.println("CacheControl: " + blob.getCacheControl()); - System.out.println("ComponentCount: " + blob.getComponentCount()); - System.out.println("ContentDisposition: " + blob.getContentDisposition()); - System.out.println("ContentEncoding: " + blob.getContentEncoding()); - System.out.println("ContentLanguage: " + blob.getContentLanguage()); - System.out.println("ContentType: " + blob.getContentType()); - System.out.println("CustomTime: " + blob.getCustomTime()); - System.out.println("Crc32c: " + blob.getCrc32c()); - System.out.println("Crc32cHexString: " + blob.getCrc32cToHexString()); - System.out.println("ETag: " + blob.getEtag()); - System.out.println("Generation: " + blob.getGeneration()); - System.out.println("Id: " + blob.getBlobId()); - System.out.println("KmsKeyName: " + blob.getKmsKeyName()); - System.out.println("Md5Hash: " + blob.getMd5()); - System.out.println("Md5HexString: " + blob.getMd5ToHexString()); - System.out.println("MediaLink: " + blob.getMediaLink()); - System.out.println("Metageneration: " + blob.getMetageneration()); - System.out.println("Name: " + blob.getName()); - System.out.println("Size: " + blob.getSize()); - System.out.println("StorageClass: " + blob.getStorageClass()); - System.out.println("TimeCreated: " + new Date(blob.getCreateTime())); - System.out.println("Last Metadata Update: " + new Date(blob.getUpdateTime())); - Boolean temporaryHoldIsEnabled = (blob.getTemporaryHold() != null && blob.getTemporaryHold()); - System.out.println("temporaryHold: " + (temporaryHoldIsEnabled ? "enabled" : "disabled")); - Boolean eventBasedHoldIsEnabled = - (blob.getEventBasedHold() != null && blob.getEventBasedHold()); - System.out.println("eventBasedHold: " + (eventBasedHoldIsEnabled ? "enabled" : "disabled")); - if (blob.getRetentionExpirationTime() != null) { - System.out.println("retentionExpirationTime: " + new Date(blob.getRetentionExpirationTime())); - } - if (blob.getMetadata() != null) { - System.out.println("\n\n\nUser metadata:"); - for (Map.Entry userMetadata : blob.getMetadata().entrySet()) { - System.out.println(userMetadata.getKey() + "=" + userMetadata.getValue()); - } - } - } -} -// [END storage_get_metadata] diff --git a/samples/snippets/src/main/java/com/example/storage/object/ListObjects.java b/samples/snippets/src/main/java/com/example/storage/object/ListObjects.java deleted file mode 100644 index c9eebfafe2..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/ListObjects.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_list_files] -import com.google.api.gax.paging.Page; -import com.google.cloud.storage.Blob; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class ListObjects { - public static void listObjects(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Page blobs = storage.list(bucketName); - - for (Blob blob : blobs.iterateAll()) { - System.out.println(blob.getName()); - } - } -} -// [END storage_list_files] diff --git a/samples/snippets/src/main/java/com/example/storage/object/ListObjectsWithOldVersions.java b/samples/snippets/src/main/java/com/example/storage/object/ListObjectsWithOldVersions.java deleted file mode 100644 index 093942c7fd..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/ListObjectsWithOldVersions.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_list_file_archived_generations] -import com.google.api.gax.paging.Page; -import com.google.cloud.storage.Blob; -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class ListObjectsWithOldVersions { - public static void listObjectsWithOldVersions(String projectId, String bucketName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Bucket bucket = storage.get(bucketName); - Page blobs = bucket.list(Storage.BlobListOption.versions(true)); - - for (Blob blob : blobs.iterateAll()) { - System.out.println(blob.getName() + "," + blob.getGeneration()); - } - } -} -// [END storage_list_file_archived_generations] diff --git a/samples/snippets/src/main/java/com/example/storage/object/ListObjectsWithPrefix.java b/samples/snippets/src/main/java/com/example/storage/object/ListObjectsWithPrefix.java deleted file mode 100644 index 3a9f564a9c..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/ListObjectsWithPrefix.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_list_files_with_prefix] -import com.google.api.gax.paging.Page; -import com.google.cloud.storage.Blob; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class ListObjectsWithPrefix { - public static void listObjectsWithPrefix( - String projectId, String bucketName, String directoryPrefix) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The directory prefix to search for - // String directoryPrefix = "myDirectory/" - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - /** - * Using the Storage.BlobListOption.currentDirectory() option here causes the results to display - * in a "directory-like" mode, showing what objects are in the directory you've specified, as - * well as what other directories exist in that directory. For example, given these blobs: - * - *

a/1.txt a/b/2.txt a/b/3.txt - * - *

If you specify prefix = "a/" and don't use Storage.BlobListOption.currentDirectory(), - * you'll get back: - * - *

a/1.txt a/b/2.txt a/b/3.txt - * - *

However, if you specify prefix = "a/" and do use - * Storage.BlobListOption.currentDirectory(), you'll get back: - * - *

a/1.txt a/b/ - * - *

Because a/1.txt is the only file in the a/ directory and a/b/ is a directory inside the - * /a/ directory. - */ - Page blobs = - storage.list( - bucketName, - Storage.BlobListOption.prefix(directoryPrefix), - Storage.BlobListOption.currentDirectory()); - - for (Blob blob : blobs.iterateAll()) { - System.out.println(blob.getName()); - } - } -} -// [END storage_list_files_with_prefix] diff --git a/samples/snippets/src/main/java/com/example/storage/object/MakeObjectPublic.java b/samples/snippets/src/main/java/com/example/storage/object/MakeObjectPublic.java deleted file mode 100644 index 245c030a6b..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/MakeObjectPublic.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_make_public] -import com.google.cloud.storage.Acl; -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class MakeObjectPublic { - public static void makeObjectPublic(String projectId, String bucketName, String objectName) { - // String projectId = "your-project-id"; - // String bucketName = "your-bucket-name"; - // String objectName = "your-object-name"; - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - BlobId blobId = BlobId.of(bucketName, objectName); - storage.createAcl(blobId, Acl.of(Acl.User.ofAllUsers(), Acl.Role.READER)); - - System.out.println( - "Object " + objectName + " in bucket " + bucketName + " was made publicly readable"); - } -} -// [END storage_make_public] diff --git a/samples/snippets/src/main/java/com/example/storage/object/MoveObject.java b/samples/snippets/src/main/java/com/example/storage/object/MoveObject.java deleted file mode 100644 index b90ec7ef93..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/MoveObject.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_move_file] -import com.google.cloud.storage.Blob; -import com.google.cloud.storage.CopyWriter; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class MoveObject { - public static void moveObject( - String projectId, - String sourceBucketName, - String sourceObjectName, - String targetBucketName, - String targetObjectName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of your GCS object - // String sourceObjectName = "your-object-name"; - - // The ID of the bucket to move the object objectName to - // String targetBucketName = "target-object-bucket" - - // The ID of your GCS object - // String targetObjectName = "your-new-object-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Blob blob = storage.get(sourceBucketName, sourceObjectName); - // Write a copy of the object to the target bucket - CopyWriter copyWriter = blob.copyTo(targetBucketName, targetObjectName); - Blob copiedBlob = copyWriter.getResult(); - // Delete the original blob now that we've copied to where we want it, finishing the "move" - // operation - blob.delete(); - - System.out.println( - "Moved object " - + sourceObjectName - + " from bucket " - + sourceBucketName - + " to " - + targetObjectName - + " in bucket " - + copiedBlob.getBucket()); - } -} -// [END storage_move_file] diff --git a/samples/snippets/src/main/java/com/example/storage/object/PrintFileAcl.java b/samples/snippets/src/main/java/com/example/storage/object/PrintFileAcl.java deleted file mode 100644 index 5fbcad0c78..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/PrintFileAcl.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.object; - -// [START storage_print_file_acl] - -import com.google.cloud.storage.Acl; -import com.google.cloud.storage.Blob; -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import java.util.List; - -public class PrintFileAcl { - - public static void printFileAcl(String bucketName, String blobName) { - - // The ID to give your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The name of the blob/file that you wish to view Acls of - // String blobName = "your-blob-name"; - - Storage storage = StorageOptions.newBuilder().build().getService(); - Blob blob = storage.get(BlobId.of(bucketName, blobName)); - List blobAcls = blob.getAcl(); - - for (Acl acl : blobAcls) { - - // This will give you the role. - // See https://cloud.google.com/storage/docs/access-control/lists#permissions - String role = acl.getRole().name(); - - // This will give you the Entity type (i.e. User, Group, Project etc.) - // See https://cloud.google.com/storage/docs/access-control/lists#scopes - String entityType = acl.getEntity().getType().name(); - - System.out.printf("%s: %s %n", role, entityType); - } - } -} -// [END storage_print_file_acl] diff --git a/samples/snippets/src/main/java/com/example/storage/object/PrintFileAclForUser.java b/samples/snippets/src/main/java/com/example/storage/object/PrintFileAclForUser.java deleted file mode 100644 index d150cfa935..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/PrintFileAclForUser.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.object; - -// [START storage_print_file_acl_for_user] - -import com.google.cloud.storage.Acl; -import com.google.cloud.storage.Acl.User; -import com.google.cloud.storage.Blob; -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class PrintFileAclForUser { - - public static void printFileAclForUser(String bucketName, String blobName, String userEmail) { - - // The ID to give your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The name of the blob/file that you wish to view Acls of - // String blobName = "your-blob-name"; - - // The email of the user whose acl is being retrieved. - // String userEmail = "someuser@domain.com" - - Storage storage = StorageOptions.newBuilder().build().getService(); - Blob blob = storage.get(BlobId.of(bucketName, blobName)); - Acl blobAcl = blob.getAcl(new User(userEmail)); - if (blobAcl != null) { - String userRole = blobAcl.getRole().name(); - System.out.println("User " + userEmail + " has role " + userRole); - } else { - System.out.println("User " + userEmail + " not found"); - } - } -} -// [END storage_print_file_acl_for_user] diff --git a/samples/snippets/src/main/java/com/example/storage/object/ReleaseEventBasedHold.java b/samples/snippets/src/main/java/com/example/storage/object/ReleaseEventBasedHold.java deleted file mode 100644 index ee19d37de9..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/ReleaseEventBasedHold.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.object; - -// [START storage_release_event_based_hold] - -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.BlobInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; - -public class ReleaseEventBasedHold { - public static void releaseEventBasedHold(String projectId, String bucketName, String objectName) - throws StorageException { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of your GCS object - // String objectName = "your-object-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - BlobId blobId = BlobId.of(bucketName, objectName); - - storage.update(BlobInfo.newBuilder(blobId).setEventBasedHold(false).build()); - - System.out.println("Event-based hold was released for " + objectName); - } -} -// [END storage_release_event_based_hold] diff --git a/samples/snippets/src/main/java/com/example/storage/object/ReleaseTemporaryHold.java b/samples/snippets/src/main/java/com/example/storage/object/ReleaseTemporaryHold.java deleted file mode 100644 index e99b0d3dc3..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/ReleaseTemporaryHold.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.object; - -// [START storage_release_temporary_hold] - -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.BlobInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; - -public class ReleaseTemporaryHold { - public static void releaseTemporaryHold(String projectId, String bucketName, String objectName) - throws StorageException { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of your GCS object - // String objectName = "your-object-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - - BlobId blobId = BlobId.of(bucketName, objectName); - storage.update(BlobInfo.newBuilder(blobId).setTemporaryHold(false).build()); - - System.out.println("Temporary hold was released for " + objectName); - } -} -// [END storage_release_temporary_hold] diff --git a/samples/snippets/src/main/java/com/example/storage/object/RemoveFileOwner.java b/samples/snippets/src/main/java/com/example/storage/object/RemoveFileOwner.java deleted file mode 100644 index bb6c35a9a3..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/RemoveFileOwner.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.object; - -// [START storage_remove_file_owner] - -import com.google.cloud.storage.Acl.User; -import com.google.cloud.storage.Blob; -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class RemoveFileOwner { - - public static void removeFileOwner( - String projectId, String bucketName, String userEmail, String blobName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // Email of the user you wish to remove as a file owner - // String userEmail = "someuser@domain.com" - - // The name of the blob/file that you wish to modify permissions on - // String blobName = "your-blob-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Blob blob = storage.get(BlobId.of(bucketName, blobName)); - User ownerToRemove = new User(userEmail); - - boolean success = blob.deleteAcl(ownerToRemove); - if (success) { - System.out.println( - "Removed user " - + userEmail - + " as an owner on file " - + blobName - + " in bucket " - + bucketName); - } else { - System.out.println("User " + userEmail + " was not found"); - } - } -} -// [END storage_remove_file_owner] diff --git a/samples/snippets/src/main/java/com/example/storage/object/RotateObjectEncryptionKey.java b/samples/snippets/src/main/java/com/example/storage/object/RotateObjectEncryptionKey.java deleted file mode 100644 index 8e0b5e795f..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/RotateObjectEncryptionKey.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_rotate_encryption_key] -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class RotateObjectEncryptionKey { - public static void rotateObjectEncryptionKey( - String projectId, - String bucketName, - String objectName, - String oldEncryptionKey, - String newEncryptionKey) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of your GCS object - // String objectName = "your-object-name"; - - // The Base64 encoded AES-256 encryption key originally used to encrypt the object. See the - // documentation - // on Customer-Supplied Encryption keys for more info: - // https://cloud.google.com/storage/docs/encryption/using-customer-supplied-keys - // String oldEncryptionKey = "TIbv/fjexq+VmtXzAlc63J4z5kFmWJ6NdAPQulQBT7g=" - - // The new encryption key to use - // String newEncryptionKey = "0mMWhFvQOdS4AmxRpo8SJxXn5MjFhbz7DkKBUdUIef8=" - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - BlobId blobId = BlobId.of(bucketName, objectName); - // You can't change an object's encryption key directly, the only way is to overwrite the object - Storage.CopyRequest request = - Storage.CopyRequest.newBuilder() - .setSource(blobId) - .setSourceOptions(Storage.BlobSourceOption.decryptionKey(oldEncryptionKey)) - .setTarget(blobId, Storage.BlobTargetOption.encryptionKey(newEncryptionKey)) - .build(); - storage.copy(request); - - System.out.println( - "Rotated encryption key for object " + objectName + "in bucket " + bucketName); - } -} -// [END storage_rotate_encryption_key] diff --git a/samples/snippets/src/main/java/com/example/storage/object/SetEventBasedHold.java b/samples/snippets/src/main/java/com/example/storage/object/SetEventBasedHold.java deleted file mode 100644 index 3ef53d54f7..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/SetEventBasedHold.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.object; - -// [START storage_set_event_based_hold] - -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.BlobInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; - -public class SetEventBasedHold { - public static void setEventBasedHold(String projectId, String bucketName, String objectName) - throws StorageException { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of your GCS object - // String objectName = "your-object-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - BlobId blobId = BlobId.of(bucketName, objectName); - - storage.update(BlobInfo.newBuilder(blobId).setEventBasedHold(true).build()); - - System.out.println("Event-based hold was set for " + objectName); - } -} -// [END storage_set_event_based_hold] diff --git a/samples/snippets/src/main/java/com/example/storage/object/SetObjectMetadata.java b/samples/snippets/src/main/java/com/example/storage/object/SetObjectMetadata.java deleted file mode 100644 index a05b94ecb3..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/SetObjectMetadata.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_set_metadata] - -import com.google.cloud.storage.Blob; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import java.util.HashMap; -import java.util.Map; - -public class SetObjectMetadata { - public static void setObjectMetadata(String projectId, String bucketName, String objectName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of your GCS object - // String objectName = "your-object-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - Map newMetadata = new HashMap<>(); - newMetadata.put("keyToAddOrUpdate", "value"); - Blob blob = storage.get(bucketName, objectName); - // Does an upsert operation, if the key already exists it's replaced by the new value, otherwise - // it's added. - blob.toBuilder().setMetadata(newMetadata).build().update(); - - System.out.println( - "Updated custom metadata for object " + objectName + " in bucket " + bucketName); - } -} -// [END storage_set_metadata] diff --git a/samples/snippets/src/main/java/com/example/storage/object/SetTemporaryHold.java b/samples/snippets/src/main/java/com/example/storage/object/SetTemporaryHold.java deleted file mode 100644 index 164fa815ce..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/SetTemporaryHold.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.object; - -// [START storage_set_temporary_hold] - -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.BlobInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageException; -import com.google.cloud.storage.StorageOptions; - -public class SetTemporaryHold { - public static void setTemporaryHold(String projectId, String bucketName, String objectName) - throws StorageException { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of your GCS object - // String objectName = "your-object-name"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - BlobId blobId = BlobId.of(bucketName, objectName); - - storage.update(BlobInfo.newBuilder(blobId).setTemporaryHold(true).build()); - - System.out.println("Temporary hold was set for " + objectName); - } -} -// [END storage_set_temporary_hold] diff --git a/samples/snippets/src/main/java/com/example/storage/object/StreamObjectDownload.java b/samples/snippets/src/main/java/com/example/storage/object/StreamObjectDownload.java deleted file mode 100644 index 4dd38bafd1..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/StreamObjectDownload.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.object; - -// [START storage_stream_file_download] - -import com.google.cloud.ReadChannel; -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import com.google.common.io.ByteStreams; -import java.io.IOException; -import java.nio.channels.FileChannel; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.StandardOpenOption; - -public class StreamObjectDownload { - - public static void streamObjectDownload( - String projectId, String bucketName, String objectName, String targetFile) - throws IOException { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of your GCS object - // String objectName = "your-object-name"; - - // The path to the file to download the object to - // String targetFile = "path/to/your/file"; - Path targetFilePath = Paths.get(targetFile); - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - try (ReadChannel reader = storage.reader(BlobId.of(bucketName, objectName)); - FileChannel targetFileChannel = - FileChannel.open(targetFilePath, StandardOpenOption.WRITE)) { - - ByteStreams.copy(reader, targetFileChannel); - - System.out.println( - "Downloaded object " - + objectName - + " from bucket " - + bucketName - + " to " - + targetFile - + " using a ReadChannel."); - } - } -} -// [END storage_stream_file_download] diff --git a/samples/snippets/src/main/java/com/example/storage/object/StreamObjectUpload.java b/samples/snippets/src/main/java/com/example/storage/object/StreamObjectUpload.java deleted file mode 100644 index b5b82d82c5..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/StreamObjectUpload.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.object; - -// [START storage_stream_file_upload] - -import com.google.cloud.WriteChannel; -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.BlobInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; - -public class StreamObjectUpload { - - public static void streamObjectUpload( - String projectId, String bucketName, String objectName, String contents) throws IOException { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of your GCS object - // String objectName = "your-object-name"; - - // The string of contents you wish to upload - // String contents = "Hello world!"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - BlobId blobId = BlobId.of(bucketName, objectName); - BlobInfo blobInfo = BlobInfo.newBuilder(blobId).build(); - byte[] content = contents.getBytes(StandardCharsets.UTF_8); - try (WriteChannel writer = storage.writer(blobInfo)) { - writer.write(ByteBuffer.wrap(content)); - System.out.println( - "Wrote to " + objectName + " in bucket " + bucketName + " using a WriteChannel."); - } - } -} - -// [END storage_stream_file_upload] diff --git a/samples/snippets/src/main/java/com/example/storage/object/UploadEncryptedObject.java b/samples/snippets/src/main/java/com/example/storage/object/UploadEncryptedObject.java deleted file mode 100644 index 724c3c102a..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/UploadEncryptedObject.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_upload_encrypted_file] - -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.BlobInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; - -public class UploadEncryptedObject { - public static void uploadEncryptedObject( - String projectId, String bucketName, String objectName, String filePath, String encryptionKey) - throws IOException { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of your GCS object - // String objectName = "your-object-name"; - - // The path to your file to upload - // String filePath = "path/to/your/file" - - // The key to encrypt the object with - // String encryptionKey = "TIbv/fjexq+VmtXzAlc63J4z5kFmWJ6NdAPQulQBT7g="; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - BlobId blobId = BlobId.of(bucketName, objectName); - BlobInfo blobInfo = BlobInfo.newBuilder(blobId).build(); - storage.create( - blobInfo, - Files.readAllBytes(Paths.get(filePath)), - Storage.BlobTargetOption.encryptionKey(encryptionKey)); - - System.out.println( - "File " - + filePath - + " uploaded to bucket " - + bucketName - + " as " - + objectName - + " with supplied encryption key"); - } -} -// [END storage_upload_encrypted_file] diff --git a/samples/snippets/src/main/java/com/example/storage/object/UploadKmsEncryptedObject.java b/samples/snippets/src/main/java/com/example/storage/object/UploadKmsEncryptedObject.java deleted file mode 100644 index 714e4a2f66..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/UploadKmsEncryptedObject.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.object; - -// [START storage_upload_with_kms_key] - -import static java.nio.charset.StandardCharsets.UTF_8; - -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.BlobInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; - -public class UploadKmsEncryptedObject { - public static void uploadKmsEncryptedObject( - String projectId, String bucketName, String objectName, String kmsKeyName) { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of your GCS object - // String objectName = "your-object-name"; - - // The name of the KMS key to encrypt with - // String kmsKeyName = "projects/my-project/locations/us/keyRings/my_key_ring/cryptoKeys/my_key" - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - byte[] data = "Hello, World!".getBytes(UTF_8); - - BlobId blobId = BlobId.of(bucketName, objectName); - BlobInfo blobInfo = BlobInfo.newBuilder(blobId).setContentType("text/plain").build(); - storage.create(blobInfo, data, Storage.BlobTargetOption.kmsKeyName(kmsKeyName)); - - System.out.println( - "Uploaded object " - + objectName - + " in bucket " - + bucketName - + " encrypted with " - + kmsKeyName); - } -} -// [END storage_upload_with_kms_key] diff --git a/samples/snippets/src/main/java/com/example/storage/object/UploadObject.java b/samples/snippets/src/main/java/com/example/storage/object/UploadObject.java deleted file mode 100644 index 399d9effbe..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/UploadObject.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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.example.storage.object; - -// [START storage_upload_file] - -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.BlobInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; - -public class UploadObject { - public static void uploadObject( - String projectId, String bucketName, String objectName, String filePath) throws IOException { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of your GCS object - // String objectName = "your-object-name"; - - // The path to your file to upload - // String filePath = "path/to/your/file" - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - BlobId blobId = BlobId.of(bucketName, objectName); - BlobInfo blobInfo = BlobInfo.newBuilder(blobId).build(); - storage.create(blobInfo, Files.readAllBytes(Paths.get(filePath))); - - System.out.println( - "File " + filePath + " uploaded to bucket " + bucketName + " as " + objectName); - } -} -// [END storage_upload_file] diff --git a/samples/snippets/src/main/java/com/example/storage/object/UploadObjectFromMemory.java b/samples/snippets/src/main/java/com/example/storage/object/UploadObjectFromMemory.java deleted file mode 100644 index e0190ee85a..0000000000 --- a/samples/snippets/src/main/java/com/example/storage/object/UploadObjectFromMemory.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.object; - -// [START storage_file_upload_from_memory] - -import com.google.cloud.storage.BlobId; -import com.google.cloud.storage.BlobInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.nio.charset.StandardCharsets; - -public class UploadObjectFromMemory { - public static void uploadObjectFromMemory( - String projectId, String bucketName, String objectName, String contents) throws IOException { - // The ID of your GCP project - // String projectId = "your-project-id"; - - // The ID of your GCS bucket - // String bucketName = "your-unique-bucket-name"; - - // The ID of your GCS object - // String objectName = "your-object-name"; - - // The string of contents you wish to upload - // String contents = "Hello world!"; - - Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); - BlobId blobId = BlobId.of(bucketName, objectName); - BlobInfo blobInfo = BlobInfo.newBuilder(blobId).build(); - byte[] content = contents.getBytes(StandardCharsets.UTF_8); - storage.createFrom(blobInfo, new ByteArrayInputStream(content)); - - System.out.println( - "Object " - + objectName - + " uploaded to bucket " - + bucketName - + " with contents " - + contents); - } -} -// [END storage_file_upload_from_memory] diff --git a/samples/snippets/src/test/java/com/example/storage/ConfigureRetriesTest.java b/samples/snippets/src/test/java/com/example/storage/ConfigureRetriesTest.java deleted file mode 100644 index 76ae1e38c9..0000000000 --- a/samples/snippets/src/test/java/com/example/storage/ConfigureRetriesTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage; - -import static com.google.common.truth.Truth.assertThat; - -import com.google.cloud.storage.Blob; -import com.google.cloud.storage.BlobInfo; -import com.google.cloud.storage.BucketInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import com.google.cloud.storage.testing.RemoteStorageHelper; -import com.google.cloud.testing.junit4.StdOutCaptureRule; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; - -public final class ConfigureRetriesTest { - @Rule public StdOutCaptureRule stdOut = new StdOutCaptureRule(); - - private String bucketName; - private Storage storage; - private String blobName; - - private Blob blob; - - @Before - public void setUp() { - blobName = "blob"; - bucketName = RemoteStorageHelper.generateBucketName(); - storage = StorageOptions.getDefaultInstance().getService(); - storage.create(BucketInfo.of(bucketName)); - blob = storage.create(BlobInfo.newBuilder(bucketName, blobName).build()); - } - - @After - public void tearDown() { - if (blob != null && blob.exists()) { - blob.delete(); - } - storage.delete(bucketName); - } - - @Test - public void testConfigureRetries() { - ConfigureRetries.deleteBlob(bucketName, blobName); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("Deletion"); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("successfully"); - assertThat(stdOut.getCapturedOutputAsUtf8String()).doesNotContain("unsuccessfully"); - } -} diff --git a/samples/snippets/src/test/java/com/example/storage/ITBucketSnippets.java b/samples/snippets/src/test/java/com/example/storage/ITBucketSnippets.java deleted file mode 100644 index 822c3189c9..0000000000 --- a/samples/snippets/src/test/java/com/example/storage/ITBucketSnippets.java +++ /dev/null @@ -1,658 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.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.example.storage; - -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import com.example.storage.bucket.AddBucketIamConditionalBinding; -import com.example.storage.bucket.AddBucketIamMember; -import com.example.storage.bucket.AddBucketLabel; -import com.example.storage.bucket.ChangeDefaultStorageClass; -import com.example.storage.bucket.ConfigureBucketCors; -import com.example.storage.bucket.CreateBucket; -import com.example.storage.bucket.CreateBucketWithStorageClassAndLocation; -import com.example.storage.bucket.CreateBucketWithTurboReplication; -import com.example.storage.bucket.DeleteBucket; -import com.example.storage.bucket.DisableBucketVersioning; -import com.example.storage.bucket.DisableDefaultEventBasedHold; -import com.example.storage.bucket.DisableLifecycleManagement; -import com.example.storage.bucket.DisableRequesterPays; -import com.example.storage.bucket.DisableUniformBucketLevelAccess; -import com.example.storage.bucket.EnableBucketVersioning; -import com.example.storage.bucket.EnableDefaultEventBasedHold; -import com.example.storage.bucket.EnableLifecycleManagement; -import com.example.storage.bucket.EnableRequesterPays; -import com.example.storage.bucket.EnableUniformBucketLevelAccess; -import com.example.storage.bucket.GetBucketMetadata; -import com.example.storage.bucket.GetBucketRpo; -import com.example.storage.bucket.GetDefaultEventBasedHold; -import com.example.storage.bucket.GetPublicAccessPrevention; -import com.example.storage.bucket.GetRetentionPolicy; -import com.example.storage.bucket.GetUniformBucketLevelAccess; -import com.example.storage.bucket.ListBucketIamMembers; -import com.example.storage.bucket.ListBuckets; -import com.example.storage.bucket.LockRetentionPolicy; -import com.example.storage.bucket.MakeBucketPublic; -import com.example.storage.bucket.RemoveBucketCors; -import com.example.storage.bucket.RemoveBucketDefaultKmsKey; -import com.example.storage.bucket.RemoveBucketIamConditionalBinding; -import com.example.storage.bucket.RemoveBucketIamMember; -import com.example.storage.bucket.RemoveBucketLabel; -import com.example.storage.bucket.RemoveRetentionPolicy; -import com.example.storage.bucket.SetAsyncTurboRpo; -import com.example.storage.bucket.SetBucketDefaultKmsKey; -import com.example.storage.bucket.SetBucketWebsiteInfo; -import com.example.storage.bucket.SetClientEndpoint; -import com.example.storage.bucket.SetDefaultRpo; -import com.example.storage.bucket.SetPublicAccessPreventionEnforced; -import com.example.storage.bucket.SetPublicAccessPreventionInherited; -import com.example.storage.bucket.SetRetentionPolicy; -import com.example.storage.object.DownloadRequesterPaysObject; -import com.example.storage.object.ReleaseEventBasedHold; -import com.example.storage.object.ReleaseTemporaryHold; -import com.example.storage.object.SetEventBasedHold; -import com.example.storage.object.SetTemporaryHold; -import com.google.cloud.Identity; -import com.google.cloud.ServiceOptions; -import com.google.cloud.storage.Blob; -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.BucketInfo; -import com.google.cloud.storage.Cors; -import com.google.cloud.storage.HttpMethod; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageRoles; -import com.google.cloud.storage.testing.RemoteStorageHelper; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import java.io.ByteArrayOutputStream; -import java.io.FileDescriptor; -import java.io.FileOutputStream; -import java.io.PrintStream; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.Map; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; -import org.junit.rules.Timeout; - -public class ITBucketSnippets { - - private static final Logger log = Logger.getLogger(ITBucketSnippets.class.getName()); - private static final String BUCKET = RemoteStorageHelper.generateBucketName(); - private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); - private static final String KMS_KEY_NAME = - "projects/java-docs-samples-testing/locations/us/keyRings/" - + "jds_test_kms_key_ring/cryptoKeys/gcs_kms_key_one"; - private final PrintStream standardOut = new PrintStream(new FileOutputStream(FileDescriptor.out)); - - private static Storage storage; - - @Rule public ExpectedException thrown = ExpectedException.none(); - - @Rule public Timeout globalTimeout = Timeout.seconds(300); - - @BeforeClass - public static void beforeClass() { - RemoteStorageHelper helper = RemoteStorageHelper.create(); - storage = - helper - .getOptions() - .toBuilder() - .setRetrySettings( - helper - .getOptions() - .getRetrySettings() - .toBuilder() - .setRetryDelayMultiplier(3.0) - .build()) - .build() - .getService(); - storage.create(BucketInfo.of(BUCKET)); - } - - @AfterClass - public static void afterClass() throws ExecutionException, InterruptedException { - if (storage != null) { - boolean wasDeleted = RemoteStorageHelper.forceDelete(storage, BUCKET, 5, TimeUnit.SECONDS); - if (!wasDeleted && log.isLoggable(Level.WARNING)) { - log.log(Level.WARNING, "Deletion of bucket {0} timed out, bucket is not empty", BUCKET); - } - } - } - - @After - public void after() throws Exception { - // This avoids 429 errors - Thread.sleep(3000); - - // This is just in case any tests failed before they could reset the value - System.setOut(standardOut); - } - - @Test - public void testAddBucketLabel() { - int oldSize = storage.get(BUCKET).getLabels().size(); - AddBucketLabel.addBucketLabel(PROJECT_ID, BUCKET, "key", "value"); - assertEquals(oldSize + 1, storage.get(BUCKET).getLabels().size()); - } - - @Test - public void testChangeDefaultStorageClass() { - Bucket remoteBucket = storage.get(BUCKET); - assertEquals("STANDARD", remoteBucket.getStorageClass().name()); - ChangeDefaultStorageClass.changeDefaultStorageClass(PROJECT_ID, BUCKET); - remoteBucket = storage.get(BUCKET); - assertEquals("COLDLINE", remoteBucket.getStorageClass().name()); - } - - @Test - public void testCreateBucket() { - String newBucket = RemoteStorageHelper.generateBucketName(); - CreateBucket.createBucket(PROJECT_ID, newBucket); - try { - Bucket remoteBucket = storage.get(newBucket); - assertNotNull(remoteBucket); - } finally { - storage.delete(newBucket); - } - } - - @Test - public void testCreateBucketWithStorageClassAndLocation() { - String newBucket = RemoteStorageHelper.generateBucketName(); - CreateBucketWithStorageClassAndLocation.createBucketWithStorageClassAndLocation( - PROJECT_ID, newBucket); - try { - Bucket remoteBucket = storage.get(newBucket); - assertNotNull(remoteBucket); - assertEquals("COLDLINE", remoteBucket.getStorageClass().name()); - assertEquals("ASIA", remoteBucket.getLocation()); - } finally { - storage.delete(newBucket); - } - } - - @Test - public void testDeleteBucket() { - String newBucket = RemoteStorageHelper.generateBucketName(); - storage.create(BucketInfo.newBuilder(newBucket).build()); - assertNotNull(storage.get(newBucket)); - try { - DeleteBucket.deleteBucket(PROJECT_ID, newBucket); - assertNull(storage.get(newBucket)); - } finally { - storage.delete(newBucket); - } - } - - @Test - public void testGetBucketMetadata() { - Bucket bucket = - storage.get(BUCKET, Storage.BucketGetOption.fields(Storage.BucketField.values())); - bucket = - bucket - .toBuilder() - .setLabels(ImmutableMap.of("k", "v")) - .setLifecycleRules( - ImmutableList.of( - new BucketInfo.LifecycleRule( - BucketInfo.LifecycleRule.LifecycleAction.newDeleteAction(), - BucketInfo.LifecycleRule.LifecycleCondition.newBuilder() - .setAge(5) - .build()))) - .build() - .update(); - - final ByteArrayOutputStream snippetOutputCapture = new ByteArrayOutputStream(); - System.setOut(new PrintStream(snippetOutputCapture)); - GetBucketMetadata.getBucketMetadata(PROJECT_ID, BUCKET); - String snippetOutput = snippetOutputCapture.toString(); - System.setOut(standardOut); - System.out.println(snippetOutput); - assertTrue(snippetOutput.contains(("BucketName: " + bucket.getName()))); - assertTrue( - snippetOutput.contains(("DefaultEventBasedHold: " + bucket.getDefaultEventBasedHold()))); - assertTrue(snippetOutput.contains(("DefaultKmsKeyName: " + bucket.getDefaultKmsKeyName()))); - assertTrue(snippetOutput.contains(("Id: " + bucket.getGeneratedId()))); - assertTrue(snippetOutput.contains(("IndexPage: " + bucket.getIndexPage()))); - assertTrue(snippetOutput.contains(("Location: " + bucket.getLocation()))); - assertTrue(snippetOutput.contains(("LocationType: " + bucket.getLocationType()))); - assertTrue(snippetOutput.contains(("Metageneration: " + bucket.getMetageneration()))); - assertTrue(snippetOutput.contains(("NotFoundPage: " + bucket.getNotFoundPage()))); - assertTrue( - snippetOutput.contains(("RetentionEffectiveTime: " + bucket.getRetentionEffectiveTime()))); - assertTrue(snippetOutput.contains(("RetentionPeriod: " + bucket.getRetentionPeriod()))); - assertTrue( - snippetOutput.contains(("RetentionPolicyIsLocked: " + bucket.retentionPolicyIsLocked()))); - assertTrue(snippetOutput.contains(("RequesterPays: " + bucket.requesterPays()))); - assertTrue(snippetOutput.contains(("SelfLink: " + bucket.getSelfLink()))); - assertTrue(snippetOutput.contains(("StorageClass: " + bucket.getStorageClass().name()))); - assertTrue(snippetOutput.contains(("TimeCreated: " + bucket.getCreateTime()))); - assertTrue(snippetOutput.contains(("VersioningEnabled: " + bucket.versioningEnabled()))); - assertTrue(snippetOutput.contains("Labels:")); - assertTrue(snippetOutput.contains("k=v")); - assertTrue(snippetOutput.contains("Lifecycle Rules:")); - } - - @Test - public void testListBuckets() { - final ByteArrayOutputStream snippetOutputCapture = new ByteArrayOutputStream(); - System.setOut(new PrintStream(snippetOutputCapture)); - ListBuckets.listBuckets(PROJECT_ID); - String snippetOutput = snippetOutputCapture.toString(); - System.setOut(standardOut); - assertTrue(snippetOutput.contains(BUCKET)); - } - - @Test - public void testRemoveBucketLabel() { - storage.get(BUCKET).toBuilder().setLabels(ImmutableMap.of("k", "v")).build().update(); - int oldSize = storage.get(BUCKET).getLabels().size(); - RemoveBucketLabel.removeBucketLabel(PROJECT_ID, BUCKET, "k"); - Map labels = storage.get(BUCKET).getLabels(); - if (labels != null) { - assertEquals(oldSize - 1, labels.size()); - } - } - - @Test - public void testEnableLifecycleManagement() { - EnableLifecycleManagement.enableLifecycleManagement(PROJECT_ID, BUCKET); - assertEquals(1, storage.get(BUCKET).getLifecycleRules().size()); - } - - @Test - public void testDisableLifecycleManagement() { - storage - .get(BUCKET) - .toBuilder() - .setLifecycleRules( - ImmutableList.of( - new BucketInfo.LifecycleRule( - BucketInfo.LifecycleRule.LifecycleAction.newDeleteAction(), - BucketInfo.LifecycleRule.LifecycleCondition.newBuilder().setAge(5).build()))) - .build() - .update(); - assertEquals(1, storage.get(BUCKET).getLifecycleRules().size()); - DisableLifecycleManagement.disableLifecycleManagement(PROJECT_ID, BUCKET); - assertEquals(0, storage.get(BUCKET).getLifecycleRules().size()); - } - - @Test - public void testGetPublicAccessPrevention() { - try { - // By default a bucket PAP state is INHERITED and we are changing the state to validate - // non-default state. - storage - .get(BUCKET) - .toBuilder() - .setIamConfiguration( - BucketInfo.IamConfiguration.newBuilder() - .setPublicAccessPrevention(BucketInfo.PublicAccessPrevention.ENFORCED) - .build()) - .build() - .update(); - final ByteArrayOutputStream snippetOutputCapture = new ByteArrayOutputStream(); - System.setOut(new PrintStream(snippetOutputCapture)); - GetPublicAccessPrevention.getPublicAccessPrevention(PROJECT_ID, BUCKET); - String snippetOutput = snippetOutputCapture.toString(); - System.setOut(standardOut); - assertTrue(snippetOutput.contains("enforced")); - storage - .get(BUCKET) - .toBuilder() - .setIamConfiguration( - BucketInfo.IamConfiguration.newBuilder() - .setPublicAccessPrevention(BucketInfo.PublicAccessPrevention.INHERITED) - .build()) - .build() - .update(); - } finally { - // No matter what happens make sure test set bucket back to INHERITED - storage - .get(BUCKET) - .toBuilder() - .setIamConfiguration( - BucketInfo.IamConfiguration.newBuilder() - .setPublicAccessPrevention(BucketInfo.PublicAccessPrevention.INHERITED) - .build()) - .build() - .update(); - } - } - - @Test - public void testSetPublicAccessPreventionEnforced() { - try { - SetPublicAccessPreventionEnforced.setPublicAccessPreventionEnforced(PROJECT_ID, BUCKET); - assertEquals( - storage.get(BUCKET).getIamConfiguration().getPublicAccessPrevention(), - BucketInfo.PublicAccessPrevention.ENFORCED); - storage - .get(BUCKET) - .toBuilder() - .setIamConfiguration( - BucketInfo.IamConfiguration.newBuilder() - .setPublicAccessPrevention(BucketInfo.PublicAccessPrevention.INHERITED) - .build()) - .build() - .update(); - } finally { - // No matter what happens make sure test set bucket back to INHERITED - storage - .get(BUCKET) - .toBuilder() - .setIamConfiguration( - BucketInfo.IamConfiguration.newBuilder() - .setPublicAccessPrevention(BucketInfo.PublicAccessPrevention.INHERITED) - .build()) - .build() - .update(); - } - } - - @Test - public void testSetPublicAccessPreventionInherited() { - try { - storage - .get(BUCKET) - .toBuilder() - .setIamConfiguration( - BucketInfo.IamConfiguration.newBuilder() - .setPublicAccessPrevention(BucketInfo.PublicAccessPrevention.ENFORCED) - .build()) - .build() - .update(); - SetPublicAccessPreventionInherited.setPublicAccessPreventionInherited(PROJECT_ID, BUCKET); - assertEquals( - storage.get(BUCKET).getIamConfiguration().getPublicAccessPrevention(), - BucketInfo.PublicAccessPrevention.INHERITED); - } finally { - // No matter what happens make sure test set bucket back to INHERITED - storage - .get(BUCKET) - .toBuilder() - .setIamConfiguration( - BucketInfo.IamConfiguration.newBuilder() - .setPublicAccessPrevention(BucketInfo.PublicAccessPrevention.INHERITED) - .build()) - .build() - .update(); - } - } - - @Test - public void testAddListRemoveBucketIamMembers() { - storage.update( - BucketInfo.newBuilder(BUCKET) - .setIamConfiguration( - BucketInfo.IamConfiguration.newBuilder() - .setIsUniformBucketLevelAccessEnabled(true) - .build()) - .build()); - int originalSize = storage.getIamPolicy(BUCKET).getBindingsList().size(); - AddBucketIamMember.addBucketIamMember(PROJECT_ID, BUCKET); - assertEquals(originalSize + 1, storage.getIamPolicy(BUCKET).getBindingsList().size()); - final ByteArrayOutputStream snippetOutputCapture = new ByteArrayOutputStream(); - System.setOut(new PrintStream(snippetOutputCapture)); - ListBucketIamMembers.listBucketIamMembers(PROJECT_ID, BUCKET); - String snippetOutput = snippetOutputCapture.toString(); - System.setOut(standardOut); - assertTrue(snippetOutput.contains("example@google.com")); - RemoveBucketIamMember.removeBucketIamMember(PROJECT_ID, BUCKET); - assertEquals(originalSize, storage.getIamPolicy(BUCKET).getBindingsList().size()); - AddBucketIamConditionalBinding.addBucketIamConditionalBinding(PROJECT_ID, BUCKET); - assertEquals(originalSize + 1, storage.getIamPolicy(BUCKET).getBindingsList().size()); - RemoveBucketIamConditionalBinding.removeBucketIamConditionalBinding(PROJECT_ID, BUCKET); - assertEquals(originalSize, storage.getIamPolicy(BUCKET).getBindingsList().size()); - storage.update( - BucketInfo.newBuilder(BUCKET) - .setIamConfiguration( - BucketInfo.IamConfiguration.newBuilder() - .setIsUniformBucketLevelAccessEnabled(false) - .build()) - .build()); - } - - @Test - public void testMakeBucketPublic() { - MakeBucketPublic.makeBucketPublic(PROJECT_ID, BUCKET); - assertTrue( - storage - .getIamPolicy(BUCKET) - .getBindings() - .get(StorageRoles.objectViewer()) - .contains(Identity.allUsers())); - } - - @Test - public void deleteBucketDefaultKmsKey() { - storage - .get(BUCKET) - .toBuilder() - .setDefaultKmsKeyName( - "projects/java-docs-samples-testing/locations/us/keyRings/" - + "jds_test_kms_key_ring/cryptoKeys/gcs_kms_key_one") - .build() - .update(); - assertNotNull(storage.get(BUCKET).getDefaultKmsKeyName()); - RemoveBucketDefaultKmsKey.removeBucketDefaultKmsKey(PROJECT_ID, BUCKET); - assertNull(storage.get(BUCKET).getDefaultKmsKeyName()); - } - - @Test - public void testEnableDisableVersioning() { - EnableBucketVersioning.enableBucketVersioning(PROJECT_ID, BUCKET); - assertTrue(storage.get(BUCKET).versioningEnabled()); - DisableBucketVersioning.disableBucketVersioning(PROJECT_ID, BUCKET); - Assert.assertFalse(storage.get(BUCKET).versioningEnabled()); - } - - @Test - public void testSetBucketWebsiteInfo() { - SetBucketWebsiteInfo.setBucketWesbiteInfo(PROJECT_ID, BUCKET, "index.html", "404.html"); - Bucket bucket = storage.get(BUCKET); - assertEquals("index.html", bucket.getIndexPage()); - assertEquals("404.html", bucket.getNotFoundPage()); - } - - @Test - public void testSetClientEndpoint() { - final ByteArrayOutputStream snippetOutputCapture = new ByteArrayOutputStream(); - System.setOut(new PrintStream(snippetOutputCapture)); - SetClientEndpoint.setClientEndpoint(PROJECT_ID, "https://storage.googleapis.com"); - String snippetOutput = snippetOutputCapture.toString(); - System.setOut(standardOut); - assertTrue(snippetOutput.contains("https://storage.googleapis.com")); - } - - @Test - public void testConfigureBucketCors() { - ConfigureBucketCors.configureBucketCors( - PROJECT_ID, BUCKET, "http://example.appspot.com", "Content-Type", 3600); - Cors cors = storage.get(BUCKET).getCors().get(0); - assertTrue(cors.getOrigins().get(0).toString().contains("example.appspot.com")); - assertTrue(cors.getResponseHeaders().contains("Content-Type")); - assertEquals(3600, cors.getMaxAgeSeconds().intValue()); - assertTrue(cors.getMethods().get(0).toString().equalsIgnoreCase("GET")); - } - - @Test - public void testRemoveBucketCors() { - storage - .get(BUCKET) - .toBuilder() - .setCors( - ImmutableList.of( - Cors.newBuilder() - .setOrigins(ImmutableList.of(Cors.Origin.of("http://example.appspot.com"))) - .setMethods(ImmutableList.of(HttpMethod.GET)) - .setResponseHeaders(ImmutableList.of("Content-Type")) - .setMaxAgeSeconds(3600) - .build())) - .build() - .update(); - Cors cors = storage.get(BUCKET).getCors().get(0); - assertNotNull(cors); - assertTrue(cors.getOrigins().get(0).toString().contains("example.appspot.com")); - assertTrue(cors.getResponseHeaders().contains("Content-Type")); - assertEquals(3600, cors.getMaxAgeSeconds().intValue()); - assertTrue(cors.getMethods().get(0).toString().equalsIgnoreCase("GET")); - RemoveBucketCors.removeBucketCors(PROJECT_ID, BUCKET); - assertNull(storage.get(BUCKET).getCors()); - } - - @Test - public void testRequesterPays() throws Exception { - EnableRequesterPays.enableRequesterPays(PROJECT_ID, BUCKET); - Bucket bucket = storage.get(BUCKET, Storage.BucketGetOption.userProject(PROJECT_ID)); - assertTrue(bucket.requesterPays()); - String projectId = ServiceOptions.getDefaultProjectId(); - String blobName = "test-create-empty-blob-requester-pays"; - byte[] content = {0xD, 0xE, 0xA, 0xD}; - Blob remoteBlob = - bucket.create(blobName, content, Bucket.BlobTargetOption.userProject(projectId)); - assertNotNull(remoteBlob); - DownloadRequesterPaysObject.downloadRequesterPaysObject( - projectId, BUCKET, blobName, Paths.get(blobName)); - byte[] readBytes = Files.readAllBytes(Paths.get(blobName)); - assertArrayEquals(content, readBytes); - DisableRequesterPays.disableRequesterPays(PROJECT_ID, BUCKET); - assertFalse(storage.get(BUCKET).requesterPays()); - } - - @Test - public void testRpo() throws Exception { - String rpoBucket = RemoteStorageHelper.generateBucketName(); - try { - CreateBucketWithTurboReplication.createBucketWithTurboReplication( - PROJECT_ID, rpoBucket, "NAM4"); - Bucket bucket = storage.get(rpoBucket); - assertEquals("ASYNC_TURBO", bucket.getRpo().toString()); - - SetDefaultRpo.setDefaultRpo(PROJECT_ID, rpoBucket); - bucket = storage.get(rpoBucket); - assertEquals("DEFAULT", bucket.getRpo().toString()); - - SetAsyncTurboRpo.setAsyncTurboRpo(PROJECT_ID, rpoBucket); - bucket = storage.get(rpoBucket); - assertEquals("ASYNC_TURBO", bucket.getRpo().toString()); - - final ByteArrayOutputStream snippetOutputCapture = new ByteArrayOutputStream(); - System.setOut(new PrintStream(snippetOutputCapture)); - GetBucketRpo.getBucketRpo(PROJECT_ID, rpoBucket); - String snippetOutput = snippetOutputCapture.toString(); - System.setOut(standardOut); - assertTrue(snippetOutput.contains("ASYNC_TURBO")); - } finally { - storage.delete(rpoBucket); - } - } - - @Test - public void testDefaultKMSKey() { - SetBucketDefaultKmsKey.setBucketDefaultKmsKey(PROJECT_ID, BUCKET, KMS_KEY_NAME); - assertEquals(KMS_KEY_NAME, storage.get(BUCKET).getDefaultKmsKeyName()); - - RemoveBucketDefaultKmsKey.removeBucketDefaultKmsKey(PROJECT_ID, BUCKET); - assertNull(storage.get(BUCKET).getDefaultKmsKeyName()); - } - - @Test - public void testBucketRetention() { - Long retention = 5L; - SetRetentionPolicy.setRetentionPolicy(PROJECT_ID, BUCKET, retention); - Bucket bucket = storage.get(BUCKET); - assertEquals(retention, bucket.getRetentionPeriod()); - assertNotNull(bucket.getRetentionEffectiveTime()); - - ByteArrayOutputStream snippetOutputCapture = new ByteArrayOutputStream(); - System.setOut(new PrintStream(snippetOutputCapture)); - GetRetentionPolicy.getRetentionPolicy(PROJECT_ID, BUCKET); - String snippetOutput = snippetOutputCapture.toString(); - assertTrue(snippetOutput.contains("5")); - - EnableDefaultEventBasedHold.enableDefaultEventBasedHold(PROJECT_ID, BUCKET); - assertTrue(storage.get(BUCKET).getDefaultEventBasedHold()); - - snippetOutputCapture = new ByteArrayOutputStream(); - System.setOut(new PrintStream(snippetOutputCapture)); - GetDefaultEventBasedHold.getDefaultEventBasedHold(PROJECT_ID, BUCKET); - snippetOutput = snippetOutputCapture.toString(); - assertTrue(snippetOutput.contains("enabled")); - System.setOut(standardOut); - - byte[] content = {0xD, 0xE, 0xA, 0xD}; - String blobName = "test-create-empty-blob-retention-policy"; - bucket.create(blobName, content); - SetEventBasedHold.setEventBasedHold(PROJECT_ID, BUCKET, blobName); - assertTrue(storage.get(BUCKET, blobName).getEventBasedHold()); - ReleaseEventBasedHold.releaseEventBasedHold(PROJECT_ID, BUCKET, blobName); - assertFalse(storage.get(BUCKET, blobName).getEventBasedHold()); - RemoveRetentionPolicy.removeRetentionPolicy(PROJECT_ID, BUCKET); - assertNull(storage.get(BUCKET).getRetentionPeriod()); - DisableDefaultEventBasedHold.disableDefaultEventBasedHold(PROJECT_ID, BUCKET); - assertFalse(storage.get(BUCKET).getDefaultEventBasedHold()); - SetTemporaryHold.setTemporaryHold(PROJECT_ID, BUCKET, blobName); - assertTrue(storage.get(BUCKET, blobName).getTemporaryHold()); - ReleaseTemporaryHold.releaseTemporaryHold(PROJECT_ID, BUCKET, blobName); - assertFalse(storage.get(BUCKET, blobName).getTemporaryHold()); - } - - @Test - public void testLockRetentionPolicy() { - String tempBucket = RemoteStorageHelper.generateBucketName(); - Bucket bucket = storage.create(BucketInfo.of(tempBucket)); - assertNotNull(bucket); - SetRetentionPolicy.setRetentionPolicy(PROJECT_ID, tempBucket, 5L); - assertEquals(5L, (long) storage.get(tempBucket).getRetentionPeriod()); - LockRetentionPolicy.lockRetentionPolicy(PROJECT_ID, tempBucket); - assertTrue(storage.get(tempBucket).retentionPolicyIsLocked()); - } - - @Test - public void testUniformBucketLevelAccess() { - EnableUniformBucketLevelAccess.enableUniformBucketLevelAccess(PROJECT_ID, BUCKET); - Bucket bucket = storage.get(BUCKET); - assertTrue(bucket.getIamConfiguration().isUniformBucketLevelAccessEnabled()); - assertNotNull(bucket.getIamConfiguration().getUniformBucketLevelAccessLockedTime()); - - ByteArrayOutputStream snippetOutputCapture = new ByteArrayOutputStream(); - System.setOut(new PrintStream(snippetOutputCapture)); - GetUniformBucketLevelAccess.getUniformBucketLevelAccess(PROJECT_ID, BUCKET); - String snippetOutput = snippetOutputCapture.toString(); - assertTrue(snippetOutput.contains("enabled")); - System.setOut(standardOut); - - DisableUniformBucketLevelAccess.disableUniformBucketLevelAccess(PROJECT_ID, BUCKET); - assertFalse(storage.get(BUCKET).getIamConfiguration().isUniformBucketLevelAccessEnabled()); - } -} diff --git a/samples/snippets/src/test/java/com/example/storage/ITHmacSnippets.java b/samples/snippets/src/test/java/com/example/storage/ITHmacSnippets.java deleted file mode 100644 index 2e1e45a3ff..0000000000 --- a/samples/snippets/src/test/java/com/example/storage/ITHmacSnippets.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.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.example.storage; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import com.example.storage.hmac.ActivateHmacKey; -import com.example.storage.hmac.CreateHmacKey; -import com.example.storage.hmac.DeactivateHmacKey; -import com.example.storage.hmac.DeleteHmacKey; -import com.example.storage.hmac.GetHmacKey; -import com.example.storage.hmac.ListHmacKeys; -import com.google.api.gax.paging.Page; -import com.google.cloud.ServiceOptions; -import com.google.cloud.storage.HmacKey; -import com.google.cloud.storage.HmacKey.HmacKeyMetadata; -import com.google.cloud.storage.HmacKey.HmacKeyState; -import com.google.cloud.storage.ServiceAccount; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.testing.RemoteStorageHelper; -import java.io.ByteArrayOutputStream; -import java.io.FileDescriptor; -import java.io.FileOutputStream; -import java.io.PrintStream; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -public class ITHmacSnippets { - private static final String PROJECT_ID = ServiceOptions.getDefaultProjectId(); - private static final String HMAC_KEY_TEST_SERVICE_ACCOUNT = - PROJECT_ID + "@" + PROJECT_ID + ".iam.gserviceaccount.com"; - private final PrintStream standardOut = new PrintStream(new FileOutputStream(FileDescriptor.out)); - - private static Storage storage; - - @BeforeClass - public static void beforeClass() { - RemoteStorageHelper helper = RemoteStorageHelper.create(); - storage = - helper - .getOptions() - .toBuilder() - .setRetrySettings( - helper - .getOptions() - .getRetrySettings() - .toBuilder() - .setRetryDelayMultiplier(3.0) - .build()) - .build() - .getService(); - } - - @Before - public void before() { - cleanUpHmacKeys(ServiceAccount.of(HMAC_KEY_TEST_SERVICE_ACCOUNT)); - - // This is just in case any tests failed before they could reset the value - System.setOut(standardOut); - } - - private static void cleanUpHmacKeys(ServiceAccount serviceAccount) { - Page metadatas = - storage.listHmacKeys(Storage.ListHmacKeysOption.serviceAccount(serviceAccount)); - for (HmacKey.HmacKeyMetadata hmacKeyMetadata : metadatas.iterateAll()) { - if (hmacKeyMetadata.getState() == HmacKeyState.ACTIVE) { - hmacKeyMetadata = storage.updateHmacKeyState(hmacKeyMetadata, HmacKeyState.INACTIVE); - } - if (hmacKeyMetadata.getState() == HmacKeyState.INACTIVE) { - storage.deleteHmacKey(hmacKeyMetadata); - } - } - } - - @Test - public void testCreateHmacKey() throws Exception { - final ByteArrayOutputStream snippetOutputCapture = new ByteArrayOutputStream(); - System.setOut(new PrintStream(snippetOutputCapture)); - CreateHmacKey.createHmacKey(HMAC_KEY_TEST_SERVICE_ACCOUNT, PROJECT_ID); - String snippetOutput = snippetOutputCapture.toString(); - System.setOut(standardOut); - String accessId = snippetOutput.split("Access ID: ")[1].split("\n")[0]; - Thread.sleep(5000); - assertNotNull(storage.getHmacKey(accessId)); - } - - @Test - public void testGetHmacKey() throws Exception { - HmacKey hmacKey = storage.createHmacKey(ServiceAccount.of(HMAC_KEY_TEST_SERVICE_ACCOUNT)); - - final ByteArrayOutputStream snippetOutputCapture = new ByteArrayOutputStream(); - System.setOut(new PrintStream(snippetOutputCapture)); - Thread.sleep(5000); - GetHmacKey.getHmacKey(hmacKey.getMetadata().getAccessId(), PROJECT_ID); - String snippetOutput = snippetOutputCapture.toString(); - System.setOut(standardOut); - Assert.assertTrue(snippetOutput.contains(HMAC_KEY_TEST_SERVICE_ACCOUNT)); - } - - @Test - public void testActivateHmacKey() throws Exception { - HmacKey hmacKey = storage.createHmacKey(ServiceAccount.of(HMAC_KEY_TEST_SERVICE_ACCOUNT)); - HmacKeyMetadata metadata = - storage.updateHmacKeyState(hmacKey.getMetadata(), HmacKeyState.INACTIVE); - - ActivateHmacKey.activateHmacKey(metadata.getAccessId(), PROJECT_ID); - Thread.sleep(5000); - assertEquals(HmacKeyState.ACTIVE, storage.getHmacKey(metadata.getAccessId()).getState()); - } - - @Test - public void testDeactivateHmacKey() throws Exception { - HmacKey hmacKey = storage.createHmacKey(ServiceAccount.of(HMAC_KEY_TEST_SERVICE_ACCOUNT)); - - DeactivateHmacKey.deactivateHmacKey(hmacKey.getMetadata().getAccessId(), PROJECT_ID); - Thread.sleep(5000); - assertEquals( - HmacKeyState.INACTIVE, storage.getHmacKey(hmacKey.getMetadata().getAccessId()).getState()); - } - - @Test - public void testDeleteHmacKey() { - HmacKey hmacKey = storage.createHmacKey(ServiceAccount.of(HMAC_KEY_TEST_SERVICE_ACCOUNT)); - HmacKeyMetadata metadata = - storage.updateHmacKeyState(hmacKey.getMetadata(), HmacKeyState.INACTIVE); - - DeleteHmacKey.deleteHmacKey(metadata.getAccessId(), PROJECT_ID); - assertEquals(HmacKeyState.DELETED, storage.getHmacKey(metadata.getAccessId()).getState()); - } - - @Test - public void testListHmacKeys() { - // Create 2 HMAC keys - final HmacKey one = - storage.createHmacKey( - ServiceAccount.of(HMAC_KEY_TEST_SERVICE_ACCOUNT), - Storage.CreateHmacKeyOption.projectId(PROJECT_ID)); - final HmacKey two = - storage.createHmacKey( - ServiceAccount.of(HMAC_KEY_TEST_SERVICE_ACCOUNT), - Storage.CreateHmacKeyOption.projectId(PROJECT_ID)); - - final ByteArrayOutputStream snippetOutputCapture = new ByteArrayOutputStream(); - System.setOut(new PrintStream(snippetOutputCapture)); - ListHmacKeys.listHmacKeys(PROJECT_ID); - String snippetOutput = snippetOutputCapture.toString(); - assertTrue(snippetOutput.contains(one.getMetadata().getAccessId())); - assertTrue(snippetOutput.contains(two.getMetadata().getAccessId())); - System.setOut(standardOut); - } -} diff --git a/samples/snippets/src/test/java/com/example/storage/ITObjectSnippets.java b/samples/snippets/src/test/java/com/example/storage/ITObjectSnippets.java deleted file mode 100644 index 6c6886eb53..0000000000 --- a/samples/snippets/src/test/java/com/example/storage/ITObjectSnippets.java +++ /dev/null @@ -1,455 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.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.example.storage; - -import static java.nio.charset.StandardCharsets.UTF_8; -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import com.example.storage.object.ChangeObjectCsekToKms; -import com.example.storage.object.ChangeObjectStorageClass; -import com.example.storage.object.ComposeObject; -import com.example.storage.object.CopyObject; -import com.example.storage.object.CopyOldVersionOfObject; -import com.example.storage.object.DeleteObject; -import com.example.storage.object.DeleteOldVersionOfObject; -import com.example.storage.object.DownloadEncryptedObject; -import com.example.storage.object.DownloadObject; -import com.example.storage.object.DownloadObjectIntoMemory; -import com.example.storage.object.DownloadPublicObject; -import com.example.storage.object.GenerateEncryptionKey; -import com.example.storage.object.GenerateV4GetObjectSignedUrl; -import com.example.storage.object.GenerateV4PutObjectSignedUrl; -import com.example.storage.object.GetObjectMetadata; -import com.example.storage.object.ListObjects; -import com.example.storage.object.ListObjectsWithOldVersions; -import com.example.storage.object.ListObjectsWithPrefix; -import com.example.storage.object.MakeObjectPublic; -import com.example.storage.object.MoveObject; -import com.example.storage.object.RotateObjectEncryptionKey; -import com.example.storage.object.SetObjectMetadata; -import com.example.storage.object.StreamObjectDownload; -import com.example.storage.object.StreamObjectUpload; -import com.example.storage.object.UploadEncryptedObject; -import com.example.storage.object.UploadKmsEncryptedObject; -import com.example.storage.object.UploadObject; -import com.example.storage.object.UploadObjectFromMemory; -import com.google.cloud.storage.Acl; -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.Storage; -import com.google.cloud.storage.Storage.BlobListOption; -import com.google.cloud.storage.StorageClass; -import com.google.cloud.storage.testing.RemoteStorageHelper; -import com.google.common.collect.ImmutableMap; -import com.google.common.io.BaseEncoding; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileDescriptor; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PrintStream; -import java.net.URL; -import java.nio.file.Files; -import java.util.Date; -import java.util.Map; -import java.util.Random; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.net.ssl.HttpsURLConnection; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; - -public class ITObjectSnippets { - - private static final Logger log = Logger.getLogger(ITObjectSnippets.class.getName()); - private static final String BUCKET = RemoteStorageHelper.generateBucketName(); - private static final String BLOB = "blob"; - private static final String STRING_CONTENT = "Hello, World!"; - private static final byte[] CONTENT = STRING_CONTENT.getBytes(UTF_8); - private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); - private final PrintStream standardOut = new PrintStream(new FileOutputStream(FileDescriptor.out)); - private static final String KMS_KEY_NAME = - "projects/java-docs-samples-testing/locations/us/keyRings/" - + "jds_test_kms_key_ring/cryptoKeys/gcs_kms_key_one"; - - private static Storage storage; - - @Rule public ExpectedException thrown = ExpectedException.none(); - - @BeforeClass - public static void beforeClass() { - RemoteStorageHelper helper = RemoteStorageHelper.create(); - storage = helper.getOptions().getService(); - storage.create(BucketInfo.of(BUCKET)); - storage.create(BlobInfo.newBuilder(BUCKET, BLOB).build(), CONTENT); - } - - @AfterClass - public static void afterClass() throws ExecutionException, InterruptedException { - if (storage != null) { - for (BlobInfo info : storage.list(BUCKET, BlobListOption.versions(true)).getValues()) { - storage.delete(info.getBlobId()); - } - boolean wasDeleted = RemoteStorageHelper.forceDelete(storage, BUCKET, 5, TimeUnit.SECONDS); - if (!wasDeleted && log.isLoggable(Level.WARNING)) { - log.log(Level.WARNING, "Deletion of bucket {0} timed out, bucket is not empty", BUCKET); - } - } - } - - @Before - public void before() { - // This is just in case any tests failed before they could reset the value - System.setOut(standardOut); - } - - @Test - public void testChangeObjectStorageClass() { - Blob blob = storage.get(BUCKET, BLOB); - Assert.assertNotEquals(StorageClass.COLDLINE, blob.getStorageClass()); - ChangeObjectStorageClass.changeObjectStorageClass(PROJECT_ID, BUCKET, BLOB); - assertEquals(StorageClass.COLDLINE, storage.get(BUCKET, BLOB).getStorageClass()); - assertArrayEquals(CONTENT, storage.get(BUCKET, BLOB).getContent()); - } - - @Test - public void testCopyObject() { - String newBucket = RemoteStorageHelper.generateBucketName(); - storage.create(BucketInfo.newBuilder(newBucket).build()); - try { - CopyObject.copyObject(PROJECT_ID, BUCKET, BLOB, newBucket); - assertNotNull(storage.get(newBucket, BLOB)); - } finally { - storage.delete(newBucket, BLOB); - storage.delete(newBucket); - } - } - - @Test - public void testDeleteObject() { - String blob = "deletethisblob"; - storage.create(BlobInfo.newBuilder(BlobId.of(BUCKET, blob)).build()); - assertNotNull(storage.get(BUCKET, blob)); - DeleteObject.deleteObject(PROJECT_ID, BUCKET, blob); - assertNull(storage.get(BUCKET, blob)); - } - - @Test - public void testDownloadObject() throws IOException { - File tempFile = File.createTempFile("file", ".txt"); - try { - DownloadObject.downloadObject(PROJECT_ID, BUCKET, BLOB, tempFile.getPath()); - assertEquals("Hello, World!", new String(Files.readAllBytes(tempFile.toPath()))); - } finally { - tempFile.delete(); - } - } - - @Test - public void testDownloadObjectIntoMemory() throws IOException { - final ByteArrayOutputStream snippetOutputCapture = new ByteArrayOutputStream(); - System.setOut(new PrintStream(snippetOutputCapture)); - DownloadObjectIntoMemory.downloadObjectIntoMemory(PROJECT_ID, BUCKET, BLOB); - String snippetOutput = snippetOutputCapture.toString(); - assertTrue(snippetOutput.contains("Hello, World!")); - System.setOut(standardOut); - } - - @Test - public void testDownloadPublicObject() throws IOException { - String publicBlob = "publicblob" + System.currentTimeMillis(); - BlobId publicBlobId = BlobId.of(BUCKET, publicBlob); - storage.create(BlobInfo.newBuilder(publicBlobId).build(), CONTENT); - storage.createAcl(publicBlobId, Acl.of(Acl.User.ofAllUsers(), Acl.Role.READER)); - File tempFile = File.createTempFile("file", ".txt"); - try { - DownloadPublicObject.downloadPublicObject(BUCKET, publicBlob, tempFile.toPath()); - assertEquals("Hello, World!", new String(Files.readAllBytes(tempFile.toPath()))); - } finally { - tempFile.delete(); - } - } - - @Test - public void testGetObjectMetadata() { - String blobName = "test-create-empty-blob"; - BlobId blobId = BlobId.of(BUCKET, blobName); - BlobInfo blobInfo = BlobInfo.newBuilder(blobId).setMetadata(ImmutableMap.of("k", "v")).build(); - Blob remoteBlob = storage.create(blobInfo, CONTENT); - assertNotNull(remoteBlob); - final PrintStream systemOut = System.out; - final ByteArrayOutputStream snippetOutputCapture = new ByteArrayOutputStream(); - System.setOut(new PrintStream(snippetOutputCapture)); - GetObjectMetadata.getObjectMetadata(PROJECT_ID, BUCKET, blobName); - String snippetOutput = snippetOutputCapture.toString(); - System.setOut(systemOut); - assertTrue(snippetOutput.contains("Bucket: " + remoteBlob.getBucket())); - assertTrue(snippetOutput.contains("Bucket: " + remoteBlob.getBucket())); - assertTrue(snippetOutput.contains("CacheControl: " + remoteBlob.getCacheControl())); - assertTrue(snippetOutput.contains("ComponentCount: " + remoteBlob.getComponentCount())); - assertTrue(snippetOutput.contains("ContentDisposition: " + remoteBlob.getContentDisposition())); - assertTrue(snippetOutput.contains("ContentEncoding: " + remoteBlob.getContentEncoding())); - assertTrue(snippetOutput.contains("ContentLanguage: " + remoteBlob.getContentLanguage())); - assertTrue(snippetOutput.contains("ContentType: " + remoteBlob.getContentType())); - assertTrue(snippetOutput.contains("CustomTime: " + remoteBlob.getCustomTime())); - assertTrue(snippetOutput.contains("Crc32c: " + remoteBlob.getCrc32c())); - assertTrue(snippetOutput.contains("Crc32cHexString: " + remoteBlob.getCrc32cToHexString())); - assertTrue(snippetOutput.contains("ETag: " + remoteBlob.getEtag())); - assertTrue(snippetOutput.contains("Generation: " + remoteBlob.getGeneration())); - assertTrue(snippetOutput.contains("Id: " + remoteBlob.getBlobId())); - assertTrue(snippetOutput.contains("KmsKeyName: " + remoteBlob.getKmsKeyName())); - assertTrue(snippetOutput.contains("Md5Hash: " + remoteBlob.getMd5())); - assertTrue(snippetOutput.contains("Md5HexString: " + remoteBlob.getMd5ToHexString())); - assertTrue(snippetOutput.contains("MediaLink: " + remoteBlob.getMediaLink())); - assertTrue(snippetOutput.contains("Metageneration: " + remoteBlob.getMetageneration())); - assertTrue(snippetOutput.contains("Name: " + remoteBlob.getName())); - assertTrue(snippetOutput.contains("Size: " + remoteBlob.getSize())); - assertTrue(snippetOutput.contains("StorageClass: " + remoteBlob.getStorageClass())); - assertTrue(snippetOutput.contains("TimeCreated: " + new Date(remoteBlob.getCreateTime()))); - assertTrue( - snippetOutput.contains("Last Metadata Update: " + new Date(remoteBlob.getUpdateTime()))); - assertTrue(snippetOutput.contains("temporaryHold: disabled")); - assertTrue(snippetOutput.contains("eventBasedHold: disabled")); - assertTrue(snippetOutput.contains("User metadata:")); - assertTrue(snippetOutput.contains("k=v")); - } - - @Test - public void testListObjects() { - final ByteArrayOutputStream snippetOutputCapture = new ByteArrayOutputStream(); - System.setOut(new PrintStream(snippetOutputCapture)); - ListObjects.listObjects(PROJECT_ID, BUCKET); - String snippetOutput = snippetOutputCapture.toString(); - assertTrue(snippetOutput.contains(BLOB)); - System.setOut(standardOut); - } - - @Test - public void testListObjectsWithPrefix() { - final PrintStream systemOutput = System.out; - final ByteArrayOutputStream snippetOutputCapture = new ByteArrayOutputStream(); - System.setOut(new PrintStream(snippetOutputCapture)); - storage.create(BlobInfo.newBuilder(BlobId.of(BUCKET, "a/1.txt")).build()); - storage.create(BlobInfo.newBuilder(BlobId.of(BUCKET, "a/b/2.txt")).build()); - storage.create(BlobInfo.newBuilder(BlobId.of(BUCKET, "a/b/3.txt")).build()); - ListObjectsWithPrefix.listObjectsWithPrefix(PROJECT_ID, BUCKET, "a/"); - String snippetOutput = snippetOutputCapture.toString(); - assertTrue(snippetOutput.contains("a/1.txt")); - assertTrue(snippetOutput.contains("a/b/")); - assertFalse(snippetOutput.contains("a/b/2.txt")); - System.setOut(systemOutput); - } - - @Test - public void testMoveObject() { - String blob = "movethisblob"; - String newBlob = "movedthisblob"; - - storage.create(BlobInfo.newBuilder(BlobId.of(BUCKET, blob)).build()); - assertNotNull(storage.get(BUCKET, blob)); - String newBucket = RemoteStorageHelper.generateBucketName(); - storage.create(BucketInfo.newBuilder(newBucket).build()); - try { - MoveObject.moveObject(PROJECT_ID, BUCKET, blob, newBucket, newBlob); - assertNotNull(storage.get(newBucket, newBlob)); - assertNull(storage.get(BUCKET, blob)); - } finally { - storage.delete(newBucket, newBlob); - storage.delete(newBucket); - } - } - - @Test - public void testSetObjectMetadata() { - SetObjectMetadata.setObjectMetadata(PROJECT_ID, BUCKET, BLOB); - Map metadata = storage.get(BUCKET, BLOB).getMetadata(); - assertEquals("value", metadata.get("keyToAddOrUpdate")); - } - - @Test - public void testUploadObject() throws IOException { - File tempFile = File.createTempFile("file", ".txt"); - try { - Files.write(tempFile.toPath(), CONTENT); - UploadObject.uploadObject(PROJECT_ID, BUCKET, "uploadobjecttest", tempFile.getPath()); - assertArrayEquals(CONTENT, storage.get(BUCKET, "uploadobjecttest").getContent()); - } finally { - tempFile.delete(); - } - } - - @Test - public void testUploadObjectFromMemory() throws IOException { - UploadObjectFromMemory.uploadObjectFromMemory( - PROJECT_ID, BUCKET, "uploadobjectfrommemorytest", STRING_CONTENT); - final byte[] output = storage.get(BUCKET, "uploadobjectfrommemorytest").getContent(); - assertEquals(STRING_CONTENT, new String(output, UTF_8)); - } - - @Test - public void testObjectCSEKOperations() throws IOException { - final PrintStream systemOut = System.out; - - final ByteArrayOutputStream snippetOutputCapture = new ByteArrayOutputStream(); - System.setOut(new PrintStream(snippetOutputCapture)); - GenerateEncryptionKey.generateEncryptionKey(); - String snippetOutput = snippetOutputCapture.toString(); - System.setOut(systemOut); - String encryptionKey = snippetOutput.split(": ")[1].trim(); - - File tempFile = File.createTempFile("file", ".txt"); - File downloadFile = File.createTempFile("dlfile", ".txt"); - String encryptedBlob = "uploadencryptedobjecttest"; - Files.write(tempFile.toPath(), CONTENT); - - UploadEncryptedObject.uploadEncryptedObject( - PROJECT_ID, BUCKET, encryptedBlob, tempFile.getPath(), encryptionKey); - DownloadEncryptedObject.downloadEncryptedObject( - PROJECT_ID, BUCKET, encryptedBlob, downloadFile.toPath(), encryptionKey); - assertArrayEquals(CONTENT, Files.readAllBytes(downloadFile.toPath())); - - byte[] key = new byte[32]; - new Random().nextBytes(key); - String newEncryptionKey = BaseEncoding.base64().encode(key); - RotateObjectEncryptionKey.rotateObjectEncryptionKey( - PROJECT_ID, BUCKET, encryptedBlob, encryptionKey, newEncryptionKey); - File newDownloadFile = File.createTempFile("newdownloadfile", ".txt"); - DownloadEncryptedObject.downloadEncryptedObject( - PROJECT_ID, BUCKET, encryptedBlob, newDownloadFile.toPath(), newEncryptionKey); - assertArrayEquals(CONTENT, Files.readAllBytes(newDownloadFile.toPath())); - - assertNull(storage.get(BUCKET, encryptedBlob).getKmsKeyName()); - ChangeObjectCsekToKms.changeObjectFromCsekToKms( - PROJECT_ID, BUCKET, encryptedBlob, newEncryptionKey, KMS_KEY_NAME); - assertTrue(storage.get(BUCKET, encryptedBlob).getKmsKeyName().contains(KMS_KEY_NAME)); - } - - @Test - public void testObjectVersioningOperations() { - storage.get(BUCKET).toBuilder().setVersioningEnabled(true).build().update(); - String versionedBlob = "versionedblob"; - final Blob originalBlob = - storage.create(BlobInfo.newBuilder(BUCKET, versionedBlob).build(), CONTENT); - byte[] content2 = "Hello, World 2".getBytes(UTF_8); - storage.create(BlobInfo.newBuilder(BUCKET, versionedBlob).build(), content2); - - final PrintStream systemOut = System.out; - final ByteArrayOutputStream snippetOutputCapture = new ByteArrayOutputStream(); - System.setOut(new PrintStream(snippetOutputCapture)); - ListObjectsWithOldVersions.listObjectsWithOldVersions(PROJECT_ID, BUCKET); - String snippetOutput = snippetOutputCapture.toString(); - System.setOut(systemOut); - - snippetOutput = snippetOutput.replaceFirst(versionedBlob, ""); - assertTrue(snippetOutput.contains(versionedBlob)); - - CopyOldVersionOfObject.copyOldVersionOfObject( - PROJECT_ID, BUCKET, versionedBlob, originalBlob.getGeneration(), "copiedblob"); - assertArrayEquals(CONTENT, storage.get(BUCKET, "copiedblob").getContent()); - - DeleteOldVersionOfObject.deleteOldVersionOfObject( - PROJECT_ID, BUCKET, versionedBlob, originalBlob.getGeneration()); - assertNull(storage.get(BlobId.of(BUCKET, versionedBlob, originalBlob.getGeneration()))); - assertNotNull(storage.get(BUCKET, versionedBlob)); - } - - @Test - public void testV4SignedURLs() throws IOException { - String tempObject = "test-upload-signed-url-object"; - final ByteArrayOutputStream snippetOutputCapture = new ByteArrayOutputStream(); - System.setOut(new PrintStream(snippetOutputCapture)); - GenerateV4PutObjectSignedUrl.generateV4PutObjectSignedUrl(PROJECT_ID, BUCKET, tempObject); - String snippetOutput = snippetOutputCapture.toString(); - String url = snippetOutput.split("\n")[1]; - URL uploadUrl = new URL(url); - HttpsURLConnection connection = (HttpsURLConnection) uploadUrl.openConnection(); - connection.setRequestMethod("PUT"); - connection.setDoOutput(true); - connection.setRequestProperty("Content-Type", "application/octet-stream"); - try (OutputStream out = connection.getOutputStream()) { - out.write(CONTENT); - assertEquals(connection.getResponseCode(), 200); - } - GenerateV4GetObjectSignedUrl.generateV4GetObjectSignedUrl(PROJECT_ID, BUCKET, tempObject); - snippetOutput = snippetOutputCapture.toString(); - url = snippetOutput.split("\n")[5]; - URL downloadUrl = new URL(url); - System.setOut(standardOut); - connection = (HttpsURLConnection) downloadUrl.openConnection(); - byte[] readBytes = new byte[CONTENT.length]; - try (InputStream responseStream = connection.getInputStream()) { - assertEquals(CONTENT.length, responseStream.read(readBytes)); - assertArrayEquals(CONTENT, readBytes); - } - } - - @Test - public void testMakeObjectPublic() { - String aclBlob = "acl-test-blob"; - assertNull( - storage.create(BlobInfo.newBuilder(BUCKET, aclBlob).build()).getAcl(Acl.User.ofAllUsers())); - MakeObjectPublic.makeObjectPublic(PROJECT_ID, BUCKET, aclBlob); - assertNotNull(storage.get(BUCKET, aclBlob).getAcl(Acl.User.ofAllUsers())); - } - - @Test - public void testComposeObject() { - String firstObject = "firstObject"; - String secondObject = "secondObject"; - String targetObject = "targetObject"; - storage.create(BlobInfo.newBuilder(BUCKET, firstObject).build(), firstObject.getBytes(UTF_8)); - storage.create(BlobInfo.newBuilder(BUCKET, secondObject).build(), secondObject.getBytes(UTF_8)); - - ComposeObject.composeObject(BUCKET, firstObject, secondObject, targetObject, PROJECT_ID); - - assertArrayEquals( - "firstObjectsecondObject".getBytes(UTF_8), storage.get(BUCKET, targetObject).getContent()); - } - - @Test - public void testStreamUploadDownload() throws Exception { - StreamObjectUpload.streamObjectUpload(PROJECT_ID, BUCKET, "streamBlob", "hello world"); - File file = File.createTempFile("stream", "test"); - StreamObjectDownload.streamObjectDownload( - PROJECT_ID, BUCKET, "streamBlob", file.getAbsolutePath()); - assertArrayEquals(Files.readAllBytes(file.toPath()), "hello world".getBytes()); - file.delete(); - } - - @Test - public void testUploadKMSEncryptedObject() { - String blobName = "kms-encrypted-blob"; - UploadKmsEncryptedObject.uploadKmsEncryptedObject(PROJECT_ID, BUCKET, blobName, KMS_KEY_NAME); - assertNotNull(storage.get(BUCKET, blobName)); - } -} diff --git a/samples/snippets/src/test/java/com/example/storage/ITStorageSnippets.java b/samples/snippets/src/test/java/com/example/storage/ITStorageSnippets.java deleted file mode 100644 index 092a681a7d..0000000000 --- a/samples/snippets/src/test/java/com/example/storage/ITStorageSnippets.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.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.example.storage; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import com.google.cloud.storage.BucketInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.testing.RemoteStorageHelper; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.PrintStream; -import java.nio.file.Files; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.ContentType; -import org.apache.http.entity.mime.MultipartEntityBuilder; -import org.apache.http.impl.client.HttpClientBuilder; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; -import org.junit.rules.Timeout; - -public class ITStorageSnippets { - - private static final Logger log = Logger.getLogger(ITStorageSnippets.class.getName()); - private static final String BUCKET = RemoteStorageHelper.generateBucketName(); - private static Storage storage; - private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); - - @Rule public ExpectedException thrown = ExpectedException.none(); - - @Rule public Timeout globalTimeout = Timeout.seconds(300); - - @BeforeClass - public static void beforeClass() { - RemoteStorageHelper helper = RemoteStorageHelper.create(); - storage = helper.getOptions().getService(); - storage.create(BucketInfo.of(BUCKET)); - } - - @AfterClass - public static void afterClass() throws ExecutionException, InterruptedException { - if (storage != null) { - // In beforeClass, we make buckets auto-delete blobs older than a day old. - // Here, delete all buckets older than 2 days. They should already be empty and easy. - long cleanTime = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(2); - long cleanTimeout = System.currentTimeMillis() - TimeUnit.MINUTES.toMillis(1); - RemoteStorageHelper.cleanBuckets(storage, cleanTime, cleanTimeout); - - boolean wasDeleted = RemoteStorageHelper.forceDelete(storage, BUCKET, 1, TimeUnit.MINUTES); - if (!wasDeleted && log.isLoggable(Level.WARNING)) { - log.log(Level.WARNING, "Deletion of bucket {0} timed out, bucket is not empty", BUCKET); - } - } - } - - @Test - public void testGetServiceAccount() { - PrintStream systemOut = System.out; - final ByteArrayOutputStream snippetOutputCapture = new ByteArrayOutputStream(); - System.setOut(new PrintStream(snippetOutputCapture)); - GetServiceAccount.getServiceAccount(PROJECT_ID); - String snippetOutput = snippetOutputCapture.toString(); - System.setOut(systemOut); - - assertTrue(snippetOutput.contains("service")); - assertTrue(snippetOutput.contains("@gs-project-accounts.iam.gserviceaccount.com")); - } - - @Test - public void testGenerateSignedPostPolicyV4() throws Exception { - PrintStream systemOut = System.out; - final ByteArrayOutputStream snippetOutputCapture = new ByteArrayOutputStream(); - System.setOut(new PrintStream(snippetOutputCapture)); - GenerateSignedPostPolicyV4.generateSignedPostPolicyV4(PROJECT_ID, BUCKET, "my-object"); - String snippetOutput = snippetOutputCapture.toString(); - System.setOut(systemOut); - assertTrue( - snippetOutput.contains("

")); - - String[] output = snippetOutput.split("'"); - final HttpClient client = HttpClientBuilder.create().build(); - final HttpPost request = new HttpPost(output[1]); - MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - - Map policy = new HashMap<>(); - /** - * When splitting by "'", any element in the form has its value two array elements ahead of it, - * for example ["x-goog-algorithm", "value=", "GOOG4-RSA-SHA256"] We take advantage of this to - * make a map which has any policy element easily accessible. The map also has a lot of noise, - * but we just use the parts we need - */ - for (int i = 3; i < output.length - 3; i += 2) { - policy.put(output[i], output[i + 2]); - } - - builder.addTextBody("x-goog-date", policy.get("x-goog-date")); - builder.addTextBody("x-goog-meta-test", "data"); - builder.addTextBody("x-goog-algorithm", "GOOG4-RSA-SHA256"); - builder.addTextBody("x-goog-credential", policy.get("x-goog-credential")); - builder.addTextBody("key", "my-object"); - builder.addTextBody("x-goog-signature", policy.get("x-goog-signature")); - builder.addTextBody("policy", policy.get("policy")); - - File file = File.createTempFile("temp", "file"); - Files.write(file.toPath(), "hello world".getBytes()); - builder.addBinaryBody( - "file", new FileInputStream(file), ContentType.APPLICATION_OCTET_STREAM, file.getName()); - request.setEntity(builder.build()); - - client.execute(request); - - assertEquals("hello world", new String(storage.get(BUCKET, "my-object").getContent())); - } -} diff --git a/samples/snippets/src/test/java/com/example/storage/QuickstartSampleIT.java b/samples/snippets/src/test/java/com/example/storage/QuickstartSampleIT.java index b00855d524..0e84f1291d 100644 --- a/samples/snippets/src/test/java/com/example/storage/QuickstartSampleIT.java +++ b/samples/snippets/src/test/java/com/example/storage/QuickstartSampleIT.java @@ -29,7 +29,9 @@ import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -/** Tests for quickstart sample. */ +/** + * Tests for quickstart sample. + */ @RunWith(JUnit4.class) @SuppressWarnings("checkstyle:abbreviationaswordinname") public class QuickstartSampleIT { diff --git a/samples/snippets/src/test/java/com/example/storage/TestBase.java b/samples/snippets/src/test/java/com/example/storage/TestBase.java deleted file mode 100644 index a13edb4ba1..0000000000 --- a/samples/snippets/src/test/java/com/example/storage/TestBase.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage; - -import com.google.cloud.storage.Blob; -import com.google.cloud.storage.BlobInfo; -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.BucketInfo; -import com.google.cloud.storage.Storage; -import com.google.cloud.storage.StorageOptions; -import com.google.cloud.storage.testing.RemoteStorageHelper; -import com.google.cloud.testing.junit4.StdOutCaptureRule; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; - -public abstract class TestBase { - - @Rule public StdOutCaptureRule stdOut = new StdOutCaptureRule(); - - protected String bucketName; - protected Storage storage; - protected String blobName; - protected Bucket bucket; - protected Blob blob; - - @Before - public void setUp() { - blobName = "blob"; - bucketName = RemoteStorageHelper.generateBucketName(); - storage = StorageOptions.getDefaultInstance().getService(); - bucket = storage.create(BucketInfo.of(bucketName)); - blob = storage.create(BlobInfo.newBuilder(bucketName, blobName).build()); - } - - @After - public void tearDown() { - RemoteStorageHelper.forceDelete(storage, bucketName); - } -} diff --git a/samples/snippets/src/test/java/com/example/storage/bucket/AddBucketDefaultOwnerTest.java b/samples/snippets/src/test/java/com/example/storage/bucket/AddBucketDefaultOwnerTest.java deleted file mode 100644 index 8dbb1786a2..0000000000 --- a/samples/snippets/src/test/java/com/example/storage/bucket/AddBucketDefaultOwnerTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertNotNull; - -import com.example.storage.TestBase; -import com.google.cloud.storage.Acl.User; -import org.junit.Test; - -public class AddBucketDefaultOwnerTest extends TestBase { - - public static final String IT_SERVICE_ACCOUNT_EMAIL = System.getenv("IT_SERVICE_ACCOUNT_EMAIL"); - - @Test - public void testAddBucketDefaultOwner() { - // Check for user email before the actual test. - assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL); - - AddBucketDefaultOwner.addBucketDefaultOwner(bucketName, IT_SERVICE_ACCOUNT_EMAIL); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL); - assertThat(bucket.getDefaultAcl(new User(IT_SERVICE_ACCOUNT_EMAIL))).isNotNull(); - } -} diff --git a/samples/snippets/src/test/java/com/example/storage/bucket/AddBucketOwnerTest.java b/samples/snippets/src/test/java/com/example/storage/bucket/AddBucketOwnerTest.java deleted file mode 100644 index 77c722421a..0000000000 --- a/samples/snippets/src/test/java/com/example/storage/bucket/AddBucketOwnerTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertNotNull; - -import com.example.storage.TestBase; -import com.google.cloud.storage.Acl.User; -import org.junit.Test; - -public class AddBucketOwnerTest extends TestBase { - - public static final String IT_SERVICE_ACCOUNT_EMAIL = System.getenv("IT_SERVICE_ACCOUNT_EMAIL"); - - @Test - public void testAddBucketOwner() { - // Check for user email before the actual test. - assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL); - - AddBucketOwner.addBucketOwner( - System.getenv("GOOGLE_CLOUD_PROJECT"), bucketName, IT_SERVICE_ACCOUNT_EMAIL); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL); - assertThat(bucket.getAcl(new User(IT_SERVICE_ACCOUNT_EMAIL))).isNotNull(); - } -} diff --git a/samples/snippets/src/test/java/com/example/storage/bucket/PrintBucketAclFilterByUserTest.java b/samples/snippets/src/test/java/com/example/storage/bucket/PrintBucketAclFilterByUserTest.java deleted file mode 100644 index 95443a237c..0000000000 --- a/samples/snippets/src/test/java/com/example/storage/bucket/PrintBucketAclFilterByUserTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertNotNull; - -import com.example.storage.TestBase; -import com.google.cloud.storage.Acl; -import com.google.cloud.storage.Acl.Entity; -import com.google.cloud.storage.Acl.Role; -import com.google.cloud.storage.Acl.User; -import org.junit.Test; - -public class PrintBucketAclFilterByUserTest extends TestBase { - - public static final String IT_SERVICE_ACCOUNT_EMAIL = System.getenv("IT_SERVICE_ACCOUNT_EMAIL"); - - @Test - public void testPrintBucketAclByUser() { - // Check for user email before the actual test. - assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL); - - Entity testUser = new User(IT_SERVICE_ACCOUNT_EMAIL); - storage.createAcl(bucketName, Acl.of(testUser, Role.READER)); - PrintBucketAclFilterByUser.printBucketAclFilterByUser(bucketName, IT_SERVICE_ACCOUNT_EMAIL); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(Role.READER.name()); - } -} diff --git a/samples/snippets/src/test/java/com/example/storage/bucket/PrintBucketAclTest.java b/samples/snippets/src/test/java/com/example/storage/bucket/PrintBucketAclTest.java deleted file mode 100644 index 399cbe65bf..0000000000 --- a/samples/snippets/src/test/java/com/example/storage/bucket/PrintBucketAclTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertNotNull; - -import com.example.storage.TestBase; -import com.google.cloud.storage.Acl; -import com.google.cloud.storage.Acl.Entity; -import com.google.cloud.storage.Acl.Role; -import com.google.cloud.storage.Acl.User; -import org.junit.Test; - -public class PrintBucketAclTest extends TestBase { - - public static final String IT_SERVICE_ACCOUNT_EMAIL = System.getenv("IT_SERVICE_ACCOUNT_EMAIL"); - - @Test - public void testPrintBucketAcls() { - // Check for user email before the actual test. - assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL); - - Entity testUser = new User(IT_SERVICE_ACCOUNT_EMAIL); - storage.createAcl(bucketName, Acl.of(testUser, Role.READER)); - PrintBucketAcl.printBucketAcl(System.getenv("GOOGLE_CLOUD_PROJECT"), bucketName); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("READER: USER"); - } -} diff --git a/samples/snippets/src/test/java/com/example/storage/bucket/RemoveBucketDefaultOwnerTest.java b/samples/snippets/src/test/java/com/example/storage/bucket/RemoveBucketDefaultOwnerTest.java deleted file mode 100644 index 8af2f1ef9c..0000000000 --- a/samples/snippets/src/test/java/com/example/storage/bucket/RemoveBucketDefaultOwnerTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertNotNull; - -import com.example.storage.TestBase; -import com.google.cloud.storage.Acl; -import com.google.cloud.storage.Acl.Role; -import com.google.cloud.storage.Acl.User; -import org.junit.Test; - -public class RemoveBucketDefaultOwnerTest extends TestBase { - - public static final String IT_SERVICE_ACCOUNT_EMAIL = System.getenv("IT_SERVICE_ACCOUNT_EMAIL"); - - @Test - public void testRemoveBucketDefaultOwner() { - // Check for user email before the actual test. - assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL); - // Add User as Default Owner - Acl newDefaultOwner = Acl.of(new User(IT_SERVICE_ACCOUNT_EMAIL), Role.OWNER); - bucket.createDefaultAcl(newDefaultOwner); - - // Remove User as Default owner - RemoveBucketDefaultOwner.removeBucketDefaultOwner(bucketName, IT_SERVICE_ACCOUNT_EMAIL); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("Removed user"); - assertThat(bucket.getDefaultAcl(new User(IT_SERVICE_ACCOUNT_EMAIL))).isNull(); - } - - @Test - public void testUserNotFound() { - // Remove User without Default Owner Permissions - RemoveBucketDefaultOwner.removeBucketDefaultOwner(bucketName, IT_SERVICE_ACCOUNT_EMAIL); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("was not found"); - } -} diff --git a/samples/snippets/src/test/java/com/example/storage/bucket/RemoveBucketOwnerTest.java b/samples/snippets/src/test/java/com/example/storage/bucket/RemoveBucketOwnerTest.java deleted file mode 100644 index add09380fb..0000000000 --- a/samples/snippets/src/test/java/com/example/storage/bucket/RemoveBucketOwnerTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.bucket; - -import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertNotNull; - -import com.example.storage.TestBase; -import com.google.cloud.storage.Acl; -import com.google.cloud.storage.Acl.Role; -import com.google.cloud.storage.Acl.User; -import org.junit.Test; - -public class RemoveBucketOwnerTest extends TestBase { - - public static final String IT_SERVICE_ACCOUNT_EMAIL = System.getenv("IT_SERVICE_ACCOUNT_EMAIL"); - - @Test - public void testRemoveBucketOwner() { - // Check for user email before the actual test. - assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL); - // Add User as Owner - Acl newOwner = Acl.of(new User(IT_SERVICE_ACCOUNT_EMAIL), Role.OWNER); - bucket.createAcl(newOwner); - - // Remove User as owner - RemoveBucketOwner.removeBucketOwner( - System.getenv("GOOGLE_CLOUD_PROJECT"), bucketName, IT_SERVICE_ACCOUNT_EMAIL); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("Removed user"); - assertThat(bucket.getAcl(new User(IT_SERVICE_ACCOUNT_EMAIL))).isNull(); - } - - @Test - public void testUserNotFound() { - // Remove User without Owner Permissions - RemoveBucketOwner.removeBucketOwner( - System.getenv("GOOGLE_CLOUD_PROJECT"), bucketName, IT_SERVICE_ACCOUNT_EMAIL); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("was not found"); - } -} diff --git a/samples/snippets/src/test/java/com/example/storage/object/AddFileOwnerTest.java b/samples/snippets/src/test/java/com/example/storage/object/AddFileOwnerTest.java deleted file mode 100644 index 7d56878a76..0000000000 --- a/samples/snippets/src/test/java/com/example/storage/object/AddFileOwnerTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.object; - -import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertNotNull; - -import com.example.storage.TestBase; -import com.google.cloud.storage.Acl.User; -import org.junit.Test; - -public class AddFileOwnerTest extends TestBase { - - public static final String IT_SERVICE_ACCOUNT_EMAIL = System.getenv("IT_SERVICE_ACCOUNT_EMAIL"); - - @Test - public void testAddFileOwner() { - // Check for user email before the actual test. - assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL); - - // Add Ownership to the file. - AddFileOwner.addFileOwner( - System.getenv("GOOGLE_CLOUD_PROJECT"), bucketName, IT_SERVICE_ACCOUNT_EMAIL, blobName); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL); - assertThat(blob.getAcl(new User(IT_SERVICE_ACCOUNT_EMAIL))).isNotNull(); - } -} diff --git a/samples/snippets/src/test/java/com/example/storage/object/PrintFileAclForUserTest.java b/samples/snippets/src/test/java/com/example/storage/object/PrintFileAclForUserTest.java deleted file mode 100644 index 20c728ed3c..0000000000 --- a/samples/snippets/src/test/java/com/example/storage/object/PrintFileAclForUserTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.object; - -import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertNotNull; - -import com.example.storage.TestBase; -import com.google.cloud.storage.Acl; -import com.google.cloud.storage.Acl.Entity; -import com.google.cloud.storage.Acl.Role; -import com.google.cloud.storage.Acl.User; -import org.junit.Test; - -public class PrintFileAclForUserTest extends TestBase { - - public static final String IT_SERVICE_ACCOUNT_EMAIL = System.getenv("IT_SERVICE_ACCOUNT_EMAIL"); - - @Test - public void testPrintBucketAclByUser() { - // Check for user email before the actual test. - assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL); - - Entity testUser = new User(IT_SERVICE_ACCOUNT_EMAIL); - blob.createAcl(Acl.of(testUser, Role.READER)); - PrintFileAclForUser.printFileAclForUser(bucketName, blobName, IT_SERVICE_ACCOUNT_EMAIL); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(Role.READER.name()); - } - - @Test - public void testUserNotFound() { - // Check for user email before the actual test. - assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL); - - // Delete Acl just in case to make sure the User ACL is not present - blob.deleteAcl(new User(IT_SERVICE_ACCOUNT_EMAIL)); - PrintFileAclForUser.printFileAclForUser(bucketName, blobName, IT_SERVICE_ACCOUNT_EMAIL); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("not found"); - } -} diff --git a/samples/snippets/src/test/java/com/example/storage/object/PrintFileAclTest.java b/samples/snippets/src/test/java/com/example/storage/object/PrintFileAclTest.java deleted file mode 100644 index 23bf7e7cae..0000000000 --- a/samples/snippets/src/test/java/com/example/storage/object/PrintFileAclTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.object; - -import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertNotNull; - -import com.example.storage.TestBase; -import com.google.cloud.storage.Acl; -import com.google.cloud.storage.Acl.Entity; -import com.google.cloud.storage.Acl.Role; -import com.google.cloud.storage.Acl.User; -import org.junit.Test; - -public class PrintFileAclTest extends TestBase { - - public static final String IT_SERVICE_ACCOUNT_EMAIL = System.getenv("IT_SERVICE_ACCOUNT_EMAIL"); - - @Test - public void testPrintFileAcls() { - // Check for user email before the actual test. - assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL); - - Entity testUser = new User(IT_SERVICE_ACCOUNT_EMAIL); - blob.createAcl(Acl.of(testUser, Role.READER)); - PrintFileAcl.printFileAcl(bucketName, blobName); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("READER: USER"); - } -} diff --git a/samples/snippets/src/test/java/com/example/storage/object/RemoveFileOwnerTest.java b/samples/snippets/src/test/java/com/example/storage/object/RemoveFileOwnerTest.java deleted file mode 100644 index edc077fe15..0000000000 --- a/samples/snippets/src/test/java/com/example/storage/object/RemoveFileOwnerTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.storage.object; - -import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertNotNull; - -import com.example.storage.TestBase; -import com.google.cloud.storage.Acl; -import com.google.cloud.storage.Acl.Role; -import com.google.cloud.storage.Acl.User; -import org.junit.Test; - -public class RemoveFileOwnerTest extends TestBase { - - public static final String IT_SERVICE_ACCOUNT_EMAIL = System.getenv("IT_SERVICE_ACCOUNT_EMAIL"); - - @Test - public void testRemoveFileOwner() { - // Check for user email before the actual test. - assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL); - - // Add User as Owner - Acl newFileOwner = Acl.of(new User(IT_SERVICE_ACCOUNT_EMAIL), Role.OWNER); - blob.createAcl(newFileOwner); - - // Remove User as owner - RemoveFileOwner.removeFileOwner( - System.getenv("GOOGLE_CLOUD_PROJECT"), bucketName, IT_SERVICE_ACCOUNT_EMAIL, blobName); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("Removed user"); - assertThat(blob.getAcl(new User(IT_SERVICE_ACCOUNT_EMAIL))).isNull(); - } - - @Test - public void testUserNotFound() { - // Check for user email before the actual test. - assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL); - - // Remove User without Owner Permissions - RemoveFileOwner.removeFileOwner( - System.getenv("GOOGLE_CLOUD_PROJECT"), bucketName, IT_SERVICE_ACCOUNT_EMAIL, blobName); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL); - assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("was not found"); - } -} diff --git a/synth.metadata b/synth.metadata index bf772f4fab..2369df01fa 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,33 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-storage.git", - "sha": "d2d24be499c79cebb6d1f035804825e5af691561" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "2921f9fb3bfbd16f6b2da0104373e2b47a80a65e", - "internalRef": "408420890" + "sha": "c1d1ece5abb23fd4766115e9d4a0310553625c4b" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "723f3ce6c8927683e96cd7a4a02b59606a14eafc" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "storage", - "apiVersion": "v2", - "language": "java", - "generator": "bazel" + "sha": "943bb78606d035001123030067dffcc34f4645f2" } } ], @@ -42,14 +23,14 @@ ".github/PULL_REQUEST_TEMPLATE.md", ".github/blunderbuss.yml", ".github/generated-files-bot.yml", + ".github/readme/synth.py", ".github/release-please.yml", - ".github/release-trigger.yml", ".github/snippet-bot.yml", - ".github/sync-repo-settings.yaml", ".github/trusted-contribution.yml", ".github/workflows/approve-readme.yaml", ".github/workflows/auto-release.yaml", ".github/workflows/ci.yaml", + ".github/workflows/formatting.yaml", ".github/workflows/samples.yaml", ".kokoro/build.bat", ".kokoro/build.sh", @@ -58,7 +39,9 @@ ".kokoro/common.sh", ".kokoro/continuous/common.cfg", ".kokoro/continuous/java8.cfg", + ".kokoro/continuous/readme.cfg", ".kokoro/dependencies.sh", + ".kokoro/linkage-monitor.sh", ".kokoro/nightly/common.cfg", ".kokoro/nightly/java11.cfg", ".kokoro/nightly/java7.cfg", @@ -70,7 +53,6 @@ ".kokoro/presubmit/clirr.cfg", ".kokoro/presubmit/common.cfg", ".kokoro/presubmit/dependencies.cfg", - ".kokoro/presubmit/graalvm-native.cfg", ".kokoro/presubmit/java11.cfg", ".kokoro/presubmit/java7.cfg", ".kokoro/presubmit/java8-osx.cfg", @@ -89,8 +71,6 @@ ".kokoro/release/promote.sh", ".kokoro/release/publish_javadoc.cfg", ".kokoro/release/publish_javadoc.sh", - ".kokoro/release/publish_javadoc11.cfg", - ".kokoro/release/publish_javadoc11.sh", ".kokoro/release/snapshot.cfg", ".kokoro/release/snapshot.sh", ".kokoro/release/stage.cfg", @@ -98,68 +78,9 @@ ".kokoro/trampoline.sh", "CODE_OF_CONDUCT.md", "LICENSE", - "SECURITY.md", "codecov.yaml", - "gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageClient.java", - "gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageSettings.java", - "gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/gapic_metadata.json", - "gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/package-info.java", - "gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageCallableFactory.java", - "gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageStub.java", - "gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStub.java", - "gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStubSettings.java", - "gapic-google-cloud-storage-v2/src/main/resources/com/google/storage/v2/gapic_metadata.json", - "gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorage.java", - "gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorageImpl.java", - "gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/StorageClientTest.java", - "grpc-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageGrpc.java", "java.header", "license-checks.xml", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Bucket.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketAccessControl.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketAccessControlOrBuilder.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketOrBuilder.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ChecksummedData.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ChecksummedDataOrBuilder.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonObjectRequestParams.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonObjectRequestParamsOrBuilder.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonRequestParams.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonRequestParamsOrBuilder.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ContentRange.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ContentRangeOrBuilder.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Object.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectAccessControl.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectAccessControlOrBuilder.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectChecksums.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectChecksumsOrBuilder.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectOrBuilder.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Owner.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/OwnerOrBuilder.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/PredefinedObjectAcl.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ProjectTeam.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ProjectTeamOrBuilder.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusRequest.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusRequestOrBuilder.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponse.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponseOrBuilder.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectRequest.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectRequestOrBuilder.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectResponse.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectResponseOrBuilder.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceConstants.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceConstantsOrBuilder.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequest.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequestOrBuilder.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponse.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponseOrBuilder.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageProto.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequest.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequestOrBuilder.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponse.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponseOrBuilder.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpec.java", - "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpecOrBuilder.java", - "proto-google-cloud-storage-v2/src/main/proto/google/storage/v2/storage.proto", "renovate.json", "samples/install-without-bom/pom.xml", "samples/pom.xml", diff --git a/owlbot.py b/synth.py similarity index 61% rename from owlbot.py rename to synth.py index 2b33b683f4..1c77d804c8 100644 --- a/owlbot.py +++ b/synth.py @@ -14,24 +14,13 @@ """This script is used to synthesize generated parts of this library.""" -import os -import synthtool as s import synthtool.languages.java as java - -for library in s.get_staging_dirs(): - # put any special-case replacements here - if os.path.exists("owl-bot-staging/v2/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/gapic_metadata.json"): - os.remove("owl-bot-staging/v2/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/gapic_metadata.json") - s.move(library) - -s.remove_staging_dirs() +AUTOSYNTH_MULTIPLE_COMMITS = True java.common_templates(excludes=[ '.kokoro/nightly/integration.cfg', - '.kokoro/nightly/java11-integration.cfg', - '.kokoro/nightly/samples.cfg', '.kokoro/presubmit/integration.cfg', - '.kokoro/presubmit/samples.cfg', 'CONTRIBUTING.md' ]) + diff --git a/versions.txt b/versions.txt index 76a9cfc0a8..19c540ba56 100644 --- a/versions.txt +++ b/versions.txt @@ -1,7 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-storage:2.4.5:2.4.6-SNAPSHOT -gapic-google-cloud-storage-v2:2.4.5-alpha:2.4.6-alpha-SNAPSHOT -grpc-google-cloud-storage-v2:2.4.5-alpha:2.4.6-alpha-SNAPSHOT -proto-google-cloud-storage-v2:2.4.5-alpha:2.4.6-alpha-SNAPSHOT +google-cloud-storage:1.113.4:1.113.5-SNAPSHOT \ No newline at end of file