diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index f8a8575314..a5361a30a3 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:bd5071596a47614d1fe15eb766c4255bae330f823b606e1196a3b0c8d2e96fd1 + digest: sha256:e62f3ea524b11c1cd6ff7f80362736d86c0056631346b5b106a421686fce2726 diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..c8f413b0da --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + - package-ecosystem: "maven" + directory: "/" + schedule: + interval: "daily" + # Disable version updates for Maven dependencies + open-pull-requests-limit: 0 + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + # Disable version updates for pip dependencies + open-pull-requests-limit: 0 \ No newline at end of file diff --git a/.github/release-please.yml b/.github/release-please.yml index e8fcfe4c58..57c7d5135d 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -26,3 +26,7 @@ branches: handleGHRelease: true releaseType: java-backport branch: 2.6.x + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-backport + branch: 2.15.x diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index b8ed0d54ff..f9effa1951 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -80,6 +80,39 @@ branchProtectionRules: - OwlBot Post Processor - 'Kokoro - Test: Java GraalVM Native Image' - 'Kokoro - Test: Java 17 GraalVM Native Image' + - pattern: 2.15.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 + - OwlBot Post Processor + - 'Kokoro - Test: Java GraalVM Native Image' + - 'Kokoro - Test: Java 17 GraalVM Native Image' + - pattern: feat/breaking-preview + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (8) + - dependencies (11) + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - 'Kokoro - Test: Java GraalVM Native Image' + - 'Kokoro - Test: Java 17 GraalVM Native Image' permissionRules: - team: yoshi-admins permission: admin diff --git a/.kokoro/build.sh b/.kokoro/build.sh index ca323478cd..f105d6757d 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -71,12 +71,12 @@ integration) ;; graalvm) # Run Unit and Integration Tests with Native Image - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative test RETURN_CODE=$? ;; graalvm17) # Run Unit and Integration Tests with Native Image - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative test RETURN_CODE=$? ;; samples) diff --git a/.kokoro/requirements.in b/.kokoro/requirements.in index b19a8dbfdd..2092cc741d 100644 --- a/.kokoro/requirements.in +++ b/.kokoro/requirements.in @@ -1,5 +1,5 @@ gcp-docuploader -gcp-releasetool +gcp-releasetool>=1.10.5 # required for compatibility with cryptography>=39.x wheel setuptools typing-extensions diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 4895c9631f..c80f0a87cc 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.9 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # # pip-compile --allow-unsafe --generate-hashes requirements.in @@ -97,33 +97,28 @@ colorlog==6.7.0 \ --hash=sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662 \ --hash=sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5 # via gcp-docuploader -cryptography==38.0.3 \ - --hash=sha256:068147f32fa662c81aebab95c74679b401b12b57494872886eb5c1139250ec5d \ - --hash=sha256:06fc3cc7b6f6cca87bd56ec80a580c88f1da5306f505876a71c8cfa7050257dd \ - --hash=sha256:25c1d1f19729fb09d42e06b4bf9895212292cb27bb50229f5aa64d039ab29146 \ - --hash=sha256:402852a0aea73833d982cabb6d0c3bb582c15483d29fb7085ef2c42bfa7e38d7 \ - --hash=sha256:4e269dcd9b102c5a3d72be3c45d8ce20377b8076a43cbed6f660a1afe365e436 \ - --hash=sha256:5419a127426084933076132d317911e3c6eb77568a1ce23c3ac1e12d111e61e0 \ - --hash=sha256:554bec92ee7d1e9d10ded2f7e92a5d70c1f74ba9524947c0ba0c850c7b011828 \ - --hash=sha256:5e89468fbd2fcd733b5899333bc54d0d06c80e04cd23d8c6f3e0542358c6060b \ - --hash=sha256:65535bc550b70bd6271984d9863a37741352b4aad6fb1b3344a54e6950249b55 \ - --hash=sha256:6ab9516b85bebe7aa83f309bacc5f44a61eeb90d0b4ec125d2d003ce41932d36 \ - --hash=sha256:6addc3b6d593cd980989261dc1cce38263c76954d758c3c94de51f1e010c9a50 \ - --hash=sha256:728f2694fa743a996d7784a6194da430f197d5c58e2f4e278612b359f455e4a2 \ - --hash=sha256:785e4056b5a8b28f05a533fab69febf5004458e20dad7e2e13a3120d8ecec75a \ - --hash=sha256:78cf5eefac2b52c10398a42765bfa981ce2372cbc0457e6bf9658f41ec3c41d8 \ - --hash=sha256:7f836217000342d448e1c9a342e9163149e45d5b5eca76a30e84503a5a96cab0 \ - --hash=sha256:8d41a46251bf0634e21fac50ffd643216ccecfaf3701a063257fe0b2be1b6548 \ - --hash=sha256:984fe150f350a3c91e84de405fe49e688aa6092b3525f407a18b9646f6612320 \ - --hash=sha256:9b24bcff7853ed18a63cfb0c2b008936a9554af24af2fb146e16d8e1aed75748 \ - --hash=sha256:b1b35d9d3a65542ed2e9d90115dfd16bbc027b3f07ee3304fc83580f26e43249 \ - --hash=sha256:b1b52c9e5f8aa2b802d48bd693190341fae201ea51c7a167d69fc48b60e8a959 \ - --hash=sha256:bbf203f1a814007ce24bd4d51362991d5cb90ba0c177a9c08825f2cc304d871f \ - --hash=sha256:be243c7e2bfcf6cc4cb350c0d5cdf15ca6383bbcb2a8ef51d3c9411a9d4386f0 \ - --hash=sha256:bfbe6ee19615b07a98b1d2287d6a6073f734735b49ee45b11324d85efc4d5cbd \ - --hash=sha256:c46837ea467ed1efea562bbeb543994c2d1f6e800785bd5a2c98bc096f5cb220 \ - --hash=sha256:dfb4f4dd568de1b6af9f4cda334adf7d72cf5bc052516e1b2608b683375dd95c \ - --hash=sha256:ed7b00096790213e09eb11c97cc6e2b757f15f3d2f85833cd2d3ec3fe37c1722 +cryptography==39.0.1 \ + --hash=sha256:0f8da300b5c8af9f98111ffd512910bc792b4c77392a9523624680f7956a99d4 \ + --hash=sha256:35f7c7d015d474f4011e859e93e789c87d21f6f4880ebdc29896a60403328f1f \ + --hash=sha256:5aa67414fcdfa22cf052e640cb5ddc461924a045cacf325cd164e65312d99502 \ + --hash=sha256:5d2d8b87a490bfcd407ed9d49093793d0f75198a35e6eb1a923ce1ee86c62b41 \ + --hash=sha256:6687ef6d0a6497e2b58e7c5b852b53f62142cfa7cd1555795758934da363a965 \ + --hash=sha256:6f8ba7f0328b79f08bdacc3e4e66fb4d7aab0c3584e0bd41328dce5262e26b2e \ + --hash=sha256:706843b48f9a3f9b9911979761c91541e3d90db1ca905fd63fee540a217698bc \ + --hash=sha256:807ce09d4434881ca3a7594733669bd834f5b2c6d5c7e36f8c00f691887042ad \ + --hash=sha256:83e17b26de248c33f3acffb922748151d71827d6021d98c70e6c1a25ddd78505 \ + --hash=sha256:96f1157a7c08b5b189b16b47bc9db2332269d6680a196341bf30046330d15388 \ + --hash=sha256:aec5a6c9864be7df2240c382740fcf3b96928c46604eaa7f3091f58b878c0bb6 \ + --hash=sha256:b0afd054cd42f3d213bf82c629efb1ee5f22eba35bf0eec88ea9ea7304f511a2 \ + --hash=sha256:ced4e447ae29ca194449a3f1ce132ded8fcab06971ef5f618605aacaa612beac \ + --hash=sha256:d1f6198ee6d9148405e49887803907fe8962a23e6c6f83ea7d98f1c0de375695 \ + --hash=sha256:e124352fd3db36a9d4a21c1aa27fd5d051e621845cb87fb851c08f4f75ce8be6 \ + --hash=sha256:e422abdec8b5fa8462aa016786680720d78bdce7a30c652b7fadf83a4ba35336 \ + --hash=sha256:ef8b72fa70b348724ff1218267e7f7375b8de4e8194d1636ee60510aae104cd0 \ + --hash=sha256:f0c64d1bd842ca2633e74a1a28033d139368ad959872533b1bab8c80e8240a0c \ + --hash=sha256:f24077a3b5298a5a06a8e0536e3ea9ec60e4c7ac486755e5fb6e6ea9b3500106 \ + --hash=sha256:fdd188c8a6ef8769f148f88f859884507b954cc64db6b52f66ef199bb9ad660a \ + --hash=sha256:fe913f20024eb2cb2f323e42a64bdf2911bb9738a15dba7d3cce48151034e3a8 # via # gcp-releasetool # secretstorage @@ -131,9 +126,9 @@ gcp-docuploader==0.6.4 \ --hash=sha256:01486419e24633af78fd0167db74a2763974765ee8078ca6eb6964d0ebd388af \ --hash=sha256:70861190c123d907b3b067da896265ead2eeb9263969d6955c9e0bb091b5ccbf # via -r requirements.in -gcp-releasetool==1.9.1 \ - --hash=sha256:952f4055d5d986b070ae2a71c4410b250000f9cc5a1e26398fcd55a5bbc5a15f \ - --hash=sha256:d0d3c814a97c1a237517e837d8cfa668ced8df4b882452578ecef4a4e79c583b +gcp-releasetool==1.10.5 \ + --hash=sha256:174b7b102d704b254f2a26a3eda2c684fd3543320ec239baf771542a2e58e109 \ + --hash=sha256:e29d29927fe2ca493105a82958c6873bb2b90d503acac56be2c229e74de0eec9 # via -r requirements.in google-api-core==2.8.2 \ --hash=sha256:06f7244c640322b508b125903bb5701bebabce8832f85aba9335ec00b3d02edc \ @@ -379,9 +374,9 @@ secretstorage==3.3.3 \ --hash=sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77 \ --hash=sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99 # via keyring -setuptools==65.6.3 \ - --hash=sha256:57f6f22bde4e042978bcd50176fdb381d7c21a9efa4041202288d3737a0c6a54 \ - --hash=sha256:a7620757bf984b58deaf32fc8a4577a9bbc0850cf92c20e1ce41c38c19e5fb75 +setuptools==67.3.2 \ + --hash=sha256:95f00380ef2ffa41d9bba85d95b27689d923c93dfbafed4aecd7cf988a25e012 \ + --hash=sha256:bb6d8e508de562768f2027902929f8523932fcd1fb784e6d573d2cafac995a48 # via -r requirements.in six==1.16.0 \ --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ diff --git a/CHANGELOG.md b/CHANGELOG.md index 221b07fd1d..9eac0ba393 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,63 @@ # Changelog +## [2.20.1](https://github.com/googleapis/java-storage/compare/v2.20.0...v2.20.1) (2023-03-07) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.4.0 ([#1919](https://github.com/googleapis/java-storage/issues/1919)) ([fb42336](https://github.com/googleapis/java-storage/commit/fb42336145d19b0a0c73eddda4318b3c88015ad6)) + +## [2.20.0](https://github.com/googleapis/java-storage/compare/v2.19.0...v2.20.0) (2023-03-01) + + +### Features + +* Allow specifying a negative offset to ReadChannel ([#1916](https://github.com/googleapis/java-storage/issues/1916)) ([6df5469](https://github.com/googleapis/java-storage/commit/6df546945211a767f73190773ab2754bf7842e75)) + +## [2.19.0](https://github.com/googleapis/java-storage/compare/v2.18.0...v2.19.0) (2023-02-21) + + +### Features + +* Update routing annotation for CreateBucketRequest ([#1892](https://github.com/googleapis/java-storage/issues/1892)) ([581120f](https://github.com/googleapis/java-storage/commit/581120f00b9adc2d8d45ac038772685d7e134e61)) + + +### Bug Fixes + +* Update Default RetryStrategy to retry SSLException caused by SocketException ([#1900](https://github.com/googleapis/java-storage/issues/1900)) ([be2aba0](https://github.com/googleapis/java-storage/commit/be2aba0704bcdd55fdfeb233802dea532e6c7882)) +* Update GrpcStorageImpl handling to be aware of quotaProjectId ([#1877](https://github.com/googleapis/java-storage/issues/1877)) ([ca8510e](https://github.com/googleapis/java-storage/commit/ca8510e3c16a5cc2fac1499b1888af612aa8e5b2)), closes [#1736](https://github.com/googleapis/java-storage/issues/1736) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.3.0 ([#1907](https://github.com/googleapis/java-storage/issues/1907)) ([85e22d7](https://github.com/googleapis/java-storage/commit/85e22d785b3abef152b2b4df4d394a7477555b08)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.20 ([#1904](https://github.com/googleapis/java-storage/issues/1904)) ([95b9aef](https://github.com/googleapis/java-storage/commit/95b9aef5fd390a1497bfe6baed3a7200e44f13cf)) + +## [2.18.0](https://github.com/googleapis/java-storage/compare/v2.17.2...v2.18.0) (2023-02-06) + + +### Features + +* Add Storage.BlobWriteOption.{meta,}generation{Not,}Match(long) methods to allow literal value construction ([#1875](https://github.com/googleapis/java-storage/issues/1875)) ([a9fab09](https://github.com/googleapis/java-storage/commit/a9fab098e23c93887f0aae8a5de6e3477d5f0f0c)) +* Setting up 2.15.x ([#1880](https://github.com/googleapis/java-storage/issues/1880)) ([1c88e83](https://github.com/googleapis/java-storage/commit/1c88e83974798d39a63ea4dd85d8f5bb9cb8f88c)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.2.0 ([#1886](https://github.com/googleapis/java-storage/issues/1886)) ([6928556](https://github.com/googleapis/java-storage/commit/6928556f0a0a61e8c68d9bf98403ce5b27a3bee2)) + +## [2.17.2](https://github.com/googleapis/java-storage/compare/v2.17.1...v2.17.2) (2023-01-23) + + +### Bug Fixes + +* Update BlobReadChannelV2 handling to correctly restart for decompressed object ([#1867](https://github.com/googleapis/java-storage/issues/1867)) ([93e8ed4](https://github.com/googleapis/java-storage/commit/93e8ed484224477cd1aeba24b3d84ed4003e9ee6)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.2 ([#1865](https://github.com/googleapis/java-storage/issues/1865)) ([ceb9a61](https://github.com/googleapis/java-storage/commit/ceb9a61921105f6c5dff80f4a1a41a0d3b51a06d)) + ## [2.17.1](https://github.com/googleapis/java-storage/compare/v2.17.0...v2.17.1) (2023-01-13) diff --git a/README.md b/README.md index 7c9938cacb..335f9ee045 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.4.0 + 26.9.0 pom import @@ -41,7 +41,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-storage - 2.17.1 + 2.19.0 ``` @@ -49,20 +49,20 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.4.0') +implementation platform('com.google.cloud:libraries-bom:26.9.0') implementation 'com.google.cloud:google-cloud-storage' ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-storage:2.17.1' +implementation 'com.google.cloud:google-cloud-storage:2.20.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-storage" % "2.17.1" +libraryDependencies += "com.google.cloud" % "google-cloud-storage" % "2.20.0" ``` ## Authentication diff --git a/gapic-google-cloud-storage-v2/clirr-ignored-differences.xml b/gapic-google-cloud-storage-v2/clirr-ignored-differences.xml index e5e71ddf19..0e52c33458 100644 --- a/gapic-google-cloud-storage-v2/clirr-ignored-differences.xml +++ b/gapic-google-cloud-storage-v2/clirr-ignored-differences.xml @@ -27,4 +27,20 @@ com/google/storage/v2/stub/HttpJsonStorageStub + + + 7002 + com/google/storage/v2/* + * *Notification*(*) + + + 7002 + com/google/storage/v2/stub/* + * *Notification*(*) + + + 8001 + com/google/storage/v2/StorageClient$ListNotification* + + diff --git a/gapic-google-cloud-storage-v2/pom.xml b/gapic-google-cloud-storage-v2/pom.xml index 7f56bfd90c..0f35151d5b 100644 --- a/gapic-google-cloud-storage-v2/pom.xml +++ b/gapic-google-cloud-storage-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc gapic-google-cloud-storage-v2 - 2.17.2-alpha-SNAPSHOT + 2.20.1-alpha gapic-google-cloud-storage-v2 GRPC library for gapic-google-cloud-storage-v2 com.google.cloud google-cloud-storage-parent - 2.17.2-SNAPSHOT + 2.20.1 diff --git a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageClient.java b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageClient.java index 51b7167e12..ea21e60483 100644 --- a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageClient.java +++ b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageClient.java @@ -1347,7 +1347,7 @@ public final UnaryCallable updateBucketCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Permanently deletes a notification subscription. + * Permanently deletes a NotificationConfig. * *

Sample code: * @@ -1358,25 +1358,26 @@ public final UnaryCallable updateBucketCallable() { * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (StorageClient storageClient = StorageClient.create()) { - * NotificationName name = NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]"); - * storageClient.deleteNotification(name); + * NotificationConfigName name = + * NotificationConfigName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION_CONFIG]"); + * storageClient.deleteNotificationConfig(name); * } * } * - * @param name Required. The parent bucket of the notification. + * @param name Required. The parent bucket of the NotificationConfig. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final void deleteNotification(NotificationName name) { - DeleteNotificationRequest request = - DeleteNotificationRequest.newBuilder() + public final void deleteNotificationConfig(NotificationConfigName name) { + DeleteNotificationConfigRequest request = + DeleteNotificationConfigRequest.newBuilder() .setName(name == null ? null : name.toString()) .build(); - deleteNotification(request); + deleteNotificationConfig(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Permanently deletes a notification subscription. + * Permanently deletes a NotificationConfig. * *

Sample code: * @@ -1387,23 +1388,24 @@ public final void deleteNotification(NotificationName name) { * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (StorageClient storageClient = StorageClient.create()) { - * String name = NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]").toString(); - * storageClient.deleteNotification(name); + * String name = + * NotificationConfigName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION_CONFIG]").toString(); + * storageClient.deleteNotificationConfig(name); * } * } * - * @param name Required. The parent bucket of the notification. + * @param name Required. The parent bucket of the NotificationConfig. * @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); + public final void deleteNotificationConfig(String name) { + DeleteNotificationConfigRequest request = + DeleteNotificationConfigRequest.newBuilder().setName(name).build(); + deleteNotificationConfig(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Permanently deletes a notification subscription. + * Permanently deletes a NotificationConfig. * *

Sample code: * @@ -1414,24 +1416,26 @@ public final void deleteNotification(String name) { * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (StorageClient storageClient = StorageClient.create()) { - * DeleteNotificationRequest request = - * DeleteNotificationRequest.newBuilder() - * .setName(NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]").toString()) + * DeleteNotificationConfigRequest request = + * DeleteNotificationConfigRequest.newBuilder() + * .setName( + * NotificationConfigName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION_CONFIG]") + * .toString()) * .build(); - * storageClient.deleteNotification(request); + * storageClient.deleteNotificationConfig(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); + public final void deleteNotificationConfig(DeleteNotificationConfigRequest request) { + deleteNotificationConfigCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Permanently deletes a notification subscription. + * Permanently deletes a NotificationConfig. * *

Sample code: * @@ -1442,23 +1446,27 @@ public final void deleteNotification(DeleteNotificationRequest request) { * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (StorageClient storageClient = StorageClient.create()) { - * DeleteNotificationRequest request = - * DeleteNotificationRequest.newBuilder() - * .setName(NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]").toString()) + * DeleteNotificationConfigRequest request = + * DeleteNotificationConfigRequest.newBuilder() + * .setName( + * NotificationConfigName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION_CONFIG]") + * .toString()) * .build(); - * ApiFuture future = storageClient.deleteNotificationCallable().futureCall(request); + * ApiFuture future = + * storageClient.deleteNotificationConfigCallable().futureCall(request); * // Do something. * future.get(); * } * } */ - public final UnaryCallable deleteNotificationCallable() { - return stub.deleteNotificationCallable(); + public final UnaryCallable + deleteNotificationConfigCallable() { + return stub.deleteNotificationConfigCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * View a notification config. + * View a NotificationConfig. * *

Sample code: * @@ -1470,23 +1478,25 @@ public final UnaryCallable deleteNotificationC * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (StorageClient storageClient = StorageClient.create()) { * BucketName name = BucketName.of("[PROJECT]", "[BUCKET]"); - * Notification response = storageClient.getNotification(name); + * NotificationConfig response = storageClient.getNotificationConfig(name); * } * } * - * @param name Required. The parent bucket of the notification. Format: - * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}` + * @param name Required. The parent bucket of the NotificationConfig. Format: + * `projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig}` * @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); + public final NotificationConfig getNotificationConfig(BucketName name) { + GetNotificationConfigRequest request = + GetNotificationConfigRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getNotificationConfig(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * View a notification config. + * View a NotificationConfig. * *

Sample code: * @@ -1498,22 +1508,23 @@ public final Notification getNotification(BucketName name) { * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (StorageClient storageClient = StorageClient.create()) { * String name = BucketName.of("[PROJECT]", "[BUCKET]").toString(); - * Notification response = storageClient.getNotification(name); + * NotificationConfig response = storageClient.getNotificationConfig(name); * } * } * - * @param name Required. The parent bucket of the notification. Format: - * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}` + * @param name Required. The parent bucket of the NotificationConfig. Format: + * `projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig}` * @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); + public final NotificationConfig getNotificationConfig(String name) { + GetNotificationConfigRequest request = + GetNotificationConfigRequest.newBuilder().setName(name).build(); + return getNotificationConfig(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * View a notification config. + * View a NotificationConfig. * *

Sample code: * @@ -1524,24 +1535,24 @@ public final Notification getNotification(String name) { * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (StorageClient storageClient = StorageClient.create()) { - * GetNotificationRequest request = - * GetNotificationRequest.newBuilder() + * GetNotificationConfigRequest request = + * GetNotificationConfigRequest.newBuilder() * .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()) * .build(); - * Notification response = storageClient.getNotification(request); + * NotificationConfig response = storageClient.getNotificationConfig(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); + public final NotificationConfig getNotificationConfig(GetNotificationConfigRequest request) { + return getNotificationConfigCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * View a notification config. + * View a NotificationConfig. * *

Sample code: * @@ -1552,23 +1563,25 @@ public final Notification getNotification(GetNotificationRequest request) { * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (StorageClient storageClient = StorageClient.create()) { - * GetNotificationRequest request = - * GetNotificationRequest.newBuilder() + * GetNotificationConfigRequest request = + * GetNotificationConfigRequest.newBuilder() * .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()) * .build(); - * ApiFuture future = storageClient.getNotificationCallable().futureCall(request); + * ApiFuture future = + * storageClient.getNotificationConfigCallable().futureCall(request); * // Do something. - * Notification response = future.get(); + * NotificationConfig response = future.get(); * } * } */ - public final UnaryCallable getNotificationCallable() { - return stub.getNotificationCallable(); + public final UnaryCallable + getNotificationConfigCallable() { + return stub.getNotificationConfigCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a notification subscription for a given bucket. These notifications, when triggered, + * Creates a NotificationConfig for a given bucket. These NotificationConfigs, when triggered, * publish messages to the specified Pub/Sub topics. See * https://cloud.google.com/storage/docs/pubsub-notifications. * @@ -1582,27 +1595,29 @@ public final UnaryCallable getNotification * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (StorageClient storageClient = StorageClient.create()) { * ProjectName parent = ProjectName.of("[PROJECT]"); - * Notification notification = Notification.newBuilder().build(); - * Notification response = storageClient.createNotification(parent, notification); + * NotificationConfig notificationConfig = NotificationConfig.newBuilder().build(); + * NotificationConfig response = + * storageClient.createNotificationConfig(parent, notificationConfig); * } * } * - * @param parent Required. The bucket to which this notification belongs. - * @param notification Required. Properties of the notification to be inserted. + * @param parent Required. The bucket to which this NotificationConfig belongs. + * @param notificationConfig Required. Properties of the NotificationConfig 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() + public final NotificationConfig createNotificationConfig( + ProjectName parent, NotificationConfig notificationConfig) { + CreateNotificationConfigRequest request = + CreateNotificationConfigRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) - .setNotification(notification) + .setNotificationConfig(notificationConfig) .build(); - return createNotification(request); + return createNotificationConfig(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a notification subscription for a given bucket. These notifications, when triggered, + * Creates a NotificationConfig for a given bucket. These NotificationConfigs, when triggered, * publish messages to the specified Pub/Sub topics. See * https://cloud.google.com/storage/docs/pubsub-notifications. * @@ -1616,27 +1631,29 @@ public final Notification createNotification(ProjectName parent, Notification no * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (StorageClient storageClient = StorageClient.create()) { * String parent = ProjectName.of("[PROJECT]").toString(); - * Notification notification = Notification.newBuilder().build(); - * Notification response = storageClient.createNotification(parent, notification); + * NotificationConfig notificationConfig = NotificationConfig.newBuilder().build(); + * NotificationConfig response = + * storageClient.createNotificationConfig(parent, notificationConfig); * } * } * - * @param parent Required. The bucket to which this notification belongs. - * @param notification Required. Properties of the notification to be inserted. + * @param parent Required. The bucket to which this NotificationConfig belongs. + * @param notificationConfig Required. Properties of the NotificationConfig 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() + public final NotificationConfig createNotificationConfig( + String parent, NotificationConfig notificationConfig) { + CreateNotificationConfigRequest request = + CreateNotificationConfigRequest.newBuilder() .setParent(parent) - .setNotification(notification) + .setNotificationConfig(notificationConfig) .build(); - return createNotification(request); + return createNotificationConfig(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a notification subscription for a given bucket. These notifications, when triggered, + * Creates a NotificationConfig for a given bucket. These NotificationConfigs, when triggered, * publish messages to the specified Pub/Sub topics. See * https://cloud.google.com/storage/docs/pubsub-notifications. * @@ -1649,25 +1666,26 @@ public final Notification createNotification(String parent, Notification notific * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (StorageClient storageClient = StorageClient.create()) { - * CreateNotificationRequest request = - * CreateNotificationRequest.newBuilder() + * CreateNotificationConfigRequest request = + * CreateNotificationConfigRequest.newBuilder() * .setParent(ProjectName.of("[PROJECT]").toString()) - * .setNotification(Notification.newBuilder().build()) + * .setNotificationConfig(NotificationConfig.newBuilder().build()) * .build(); - * Notification response = storageClient.createNotification(request); + * NotificationConfig response = storageClient.createNotificationConfig(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); + public final NotificationConfig createNotificationConfig( + CreateNotificationConfigRequest request) { + return createNotificationConfigCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a notification subscription for a given bucket. These notifications, when triggered, + * Creates a NotificationConfig for a given bucket. These NotificationConfigs, when triggered, * publish messages to the specified Pub/Sub topics. See * https://cloud.google.com/storage/docs/pubsub-notifications. * @@ -1680,25 +1698,26 @@ public final Notification createNotification(CreateNotificationRequest request) * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (StorageClient storageClient = StorageClient.create()) { - * CreateNotificationRequest request = - * CreateNotificationRequest.newBuilder() + * CreateNotificationConfigRequest request = + * CreateNotificationConfigRequest.newBuilder() * .setParent(ProjectName.of("[PROJECT]").toString()) - * .setNotification(Notification.newBuilder().build()) + * .setNotificationConfig(NotificationConfig.newBuilder().build()) * .build(); - * ApiFuture future = - * storageClient.createNotificationCallable().futureCall(request); + * ApiFuture future = + * storageClient.createNotificationConfigCallable().futureCall(request); * // Do something. - * Notification response = future.get(); + * NotificationConfig response = future.get(); * } * } */ - public final UnaryCallable createNotificationCallable() { - return stub.createNotificationCallable(); + public final UnaryCallable + createNotificationConfigCallable() { + return stub.createNotificationConfigCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Retrieves a list of notification subscriptions for a given bucket. + * Retrieves a list of NotificationConfigs for a given bucket. * *

Sample code: * @@ -1710,7 +1729,8 @@ public final UnaryCallable createNotifi * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (StorageClient storageClient = StorageClient.create()) { * ProjectName parent = ProjectName.of("[PROJECT]"); - * for (Notification element : storageClient.listNotifications(parent).iterateAll()) { + * for (NotificationConfig element : + * storageClient.listNotificationConfigs(parent).iterateAll()) { * // doThingsWith(element); * } * } @@ -1719,17 +1739,17 @@ public final UnaryCallable createNotifi * @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() + public final ListNotificationConfigsPagedResponse listNotificationConfigs(ProjectName parent) { + ListNotificationConfigsRequest request = + ListNotificationConfigsRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build(); - return listNotifications(request); + return listNotificationConfigs(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Retrieves a list of notification subscriptions for a given bucket. + * Retrieves a list of NotificationConfigs for a given bucket. * *

Sample code: * @@ -1741,7 +1761,8 @@ public final ListNotificationsPagedResponse listNotifications(ProjectName parent * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (StorageClient storageClient = StorageClient.create()) { * String parent = ProjectName.of("[PROJECT]").toString(); - * for (Notification element : storageClient.listNotifications(parent).iterateAll()) { + * for (NotificationConfig element : + * storageClient.listNotificationConfigs(parent).iterateAll()) { * // doThingsWith(element); * } * } @@ -1750,15 +1771,15 @@ public final ListNotificationsPagedResponse listNotifications(ProjectName parent * @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); + public final ListNotificationConfigsPagedResponse listNotificationConfigs(String parent) { + ListNotificationConfigsRequest request = + ListNotificationConfigsRequest.newBuilder().setParent(parent).build(); + return listNotificationConfigs(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Retrieves a list of notification subscriptions for a given bucket. + * Retrieves a list of NotificationConfigs for a given bucket. * *

Sample code: * @@ -1769,13 +1790,14 @@ public final ListNotificationsPagedResponse listNotifications(String parent) { * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (StorageClient storageClient = StorageClient.create()) { - * ListNotificationsRequest request = - * ListNotificationsRequest.newBuilder() + * ListNotificationConfigsRequest request = + * ListNotificationConfigsRequest.newBuilder() * .setParent(ProjectName.of("[PROJECT]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); - * for (Notification element : storageClient.listNotifications(request).iterateAll()) { + * for (NotificationConfig element : + * storageClient.listNotificationConfigs(request).iterateAll()) { * // doThingsWith(element); * } * } @@ -1784,13 +1806,14 @@ public final ListNotificationsPagedResponse listNotifications(String parent) { * @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); + public final ListNotificationConfigsPagedResponse listNotificationConfigs( + ListNotificationConfigsRequest request) { + return listNotificationConfigsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Retrieves a list of notification subscriptions for a given bucket. + * Retrieves a list of NotificationConfigs for a given bucket. * *

Sample code: * @@ -1801,29 +1824,29 @@ public final ListNotificationsPagedResponse listNotifications(ListNotificationsR * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (StorageClient storageClient = StorageClient.create()) { - * ListNotificationsRequest request = - * ListNotificationsRequest.newBuilder() + * ListNotificationConfigsRequest request = + * ListNotificationConfigsRequest.newBuilder() * .setParent(ProjectName.of("[PROJECT]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); - * ApiFuture future = - * storageClient.listNotificationsPagedCallable().futureCall(request); + * ApiFuture future = + * storageClient.listNotificationConfigsPagedCallable().futureCall(request); * // Do something. - * for (Notification element : future.get().iterateAll()) { + * for (NotificationConfig element : future.get().iterateAll()) { * // doThingsWith(element); * } * } * } */ - public final UnaryCallable - listNotificationsPagedCallable() { - return stub.listNotificationsPagedCallable(); + public final UnaryCallable + listNotificationConfigsPagedCallable() { + return stub.listNotificationConfigsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Retrieves a list of notification subscriptions for a given bucket. + * Retrieves a list of NotificationConfigs for a given bucket. * *

Sample code: * @@ -1834,16 +1857,16 @@ public final ListNotificationsPagedResponse listNotifications(ListNotificationsR * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (StorageClient storageClient = StorageClient.create()) { - * ListNotificationsRequest request = - * ListNotificationsRequest.newBuilder() + * ListNotificationConfigsRequest request = + * ListNotificationConfigsRequest.newBuilder() * .setParent(ProjectName.of("[PROJECT]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); * while (true) { - * ListNotificationsResponse response = - * storageClient.listNotificationsCallable().call(request); - * for (Notification element : response.getNotificationsList()) { + * ListNotificationConfigsResponse response = + * storageClient.listNotificationConfigsCallable().call(request); + * for (NotificationConfig element : response.getNotificationConfigsList()) { * // doThingsWith(element); * } * String nextPageToken = response.getNextPageToken(); @@ -1856,9 +1879,9 @@ public final ListNotificationsPagedResponse listNotifications(ListNotificationsR * } * } */ - public final UnaryCallable - listNotificationsCallable() { - return stub.listNotificationsCallable(); + public final UnaryCallable + listNotificationConfigsCallable() { + return stub.listNotificationConfigsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. @@ -2468,8 +2491,9 @@ public final UnaryCallable updateObjectCallable() { * previously sent. Note also that it is acceptable to send data starting at an offset earlier * than the returned `persisted_size`; in this case, the service will skip data at offsets that * were already persisted (without checking that it matches the previously written data), and - * write only the data starting from the persisted offset. This behavior can make client-side - * handling simpler in some cases. + * write only the data starting from the persisted offset. Even though the data isn't written, it + * may still incur a performance cost over resuming at the correct write offset. This behavior can + * make client-side handling simpler in some cases. * *

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 @@ -3838,83 +3862,91 @@ protected ListBucketsFixedSizeCollection createCollection( } } - public static class ListNotificationsPagedResponse + public static class ListNotificationConfigsPagedResponse extends AbstractPagedListResponse< - ListNotificationsRequest, - ListNotificationsResponse, - Notification, - ListNotificationsPage, - ListNotificationsFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListNotificationsPage.createEmptyPage().createPageAsync(context, futureResponse); + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + NotificationConfig, + ListNotificationConfigsPage, + ListNotificationConfigsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListNotificationConfigsRequest, ListNotificationConfigsResponse, NotificationConfig> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListNotificationConfigsPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - input -> new ListNotificationsPagedResponse(input), + input -> new ListNotificationConfigsPagedResponse(input), MoreExecutors.directExecutor()); } - private ListNotificationsPagedResponse(ListNotificationsPage page) { - super(page, ListNotificationsFixedSizeCollection.createEmptyCollection()); + private ListNotificationConfigsPagedResponse(ListNotificationConfigsPage page) { + super(page, ListNotificationConfigsFixedSizeCollection.createEmptyCollection()); } } - public static class ListNotificationsPage + public static class ListNotificationConfigsPage extends AbstractPage< - ListNotificationsRequest, - ListNotificationsResponse, - Notification, - ListNotificationsPage> { - - private ListNotificationsPage( - PageContext context, - ListNotificationsResponse response) { + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + NotificationConfig, + ListNotificationConfigsPage> { + + private ListNotificationConfigsPage( + PageContext< + ListNotificationConfigsRequest, ListNotificationConfigsResponse, NotificationConfig> + context, + ListNotificationConfigsResponse response) { super(context, response); } - private static ListNotificationsPage createEmptyPage() { - return new ListNotificationsPage(null, null); + private static ListNotificationConfigsPage createEmptyPage() { + return new ListNotificationConfigsPage(null, null); } @Override - protected ListNotificationsPage createPage( - PageContext context, - ListNotificationsResponse response) { - return new ListNotificationsPage(context, response); + protected ListNotificationConfigsPage createPage( + PageContext< + ListNotificationConfigsRequest, ListNotificationConfigsResponse, NotificationConfig> + context, + ListNotificationConfigsResponse response) { + return new ListNotificationConfigsPage(context, response); } @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { + public ApiFuture createPageAsync( + PageContext< + ListNotificationConfigsRequest, ListNotificationConfigsResponse, NotificationConfig> + context, + ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } } - public static class ListNotificationsFixedSizeCollection + public static class ListNotificationConfigsFixedSizeCollection extends AbstractFixedSizeCollection< - ListNotificationsRequest, - ListNotificationsResponse, - Notification, - ListNotificationsPage, - ListNotificationsFixedSizeCollection> { - - private ListNotificationsFixedSizeCollection( - List pages, int collectionSize) { + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + NotificationConfig, + ListNotificationConfigsPage, + ListNotificationConfigsFixedSizeCollection> { + + private ListNotificationConfigsFixedSizeCollection( + List pages, int collectionSize) { super(pages, collectionSize); } - private static ListNotificationsFixedSizeCollection createEmptyCollection() { - return new ListNotificationsFixedSizeCollection(null, 0); + private static ListNotificationConfigsFixedSizeCollection createEmptyCollection() { + return new ListNotificationConfigsFixedSizeCollection(null, 0); } @Override - protected ListNotificationsFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListNotificationsFixedSizeCollection(pages, collectionSize); + protected ListNotificationConfigsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListNotificationConfigsFixedSizeCollection(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 index 16de430f4e..74ff9b61d3 100644 --- a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageSettings.java +++ b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageSettings.java @@ -18,7 +18,7 @@ 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.ListNotificationConfigsPagedResponse; import static com.google.storage.v2.StorageClient.ListObjectsPagedResponse; import com.google.api.core.ApiFunction; @@ -132,26 +132,31 @@ 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 deleteNotificationConfig. */ + public UnaryCallSettings + deleteNotificationConfigSettings() { + return ((StorageStubSettings) getStubSettings()).deleteNotificationConfigSettings(); } - /** 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 getNotificationConfig. */ + public UnaryCallSettings + getNotificationConfigSettings() { + return ((StorageStubSettings) getStubSettings()).getNotificationConfigSettings(); } - /** 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 createNotificationConfig. */ + public UnaryCallSettings + createNotificationConfigSettings() { + return ((StorageStubSettings) getStubSettings()).createNotificationConfigSettings(); } - /** Returns the object with the settings used for calls to listNotifications. */ + /** Returns the object with the settings used for calls to listNotificationConfigs. */ public PagedCallSettings< - ListNotificationsRequest, ListNotificationsResponse, ListNotificationsPagedResponse> - listNotificationsSettings() { - return ((StorageStubSettings) getStubSettings()).listNotificationsSettings(); + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + ListNotificationConfigsPagedResponse> + listNotificationConfigsSettings() { + return ((StorageStubSettings) getStubSettings()).listNotificationConfigsSettings(); } /** Returns the object with the settings used for calls to composeObject. */ @@ -389,29 +394,31 @@ public UnaryCallSettings.Builder updateBucketSettin 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 deleteNotificationConfig. */ + public UnaryCallSettings.Builder + deleteNotificationConfigSettings() { + return getStubSettingsBuilder().deleteNotificationConfigSettings(); } - /** 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 getNotificationConfig. */ + public UnaryCallSettings.Builder + getNotificationConfigSettings() { + return getStubSettingsBuilder().getNotificationConfigSettings(); } - /** 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 createNotificationConfig. */ + public UnaryCallSettings.Builder + createNotificationConfigSettings() { + return getStubSettingsBuilder().createNotificationConfigSettings(); } - /** Returns the builder for the settings used for calls to listNotifications. */ + /** Returns the builder for the settings used for calls to listNotificationConfigs. */ public PagedCallSettings.Builder< - ListNotificationsRequest, ListNotificationsResponse, ListNotificationsPagedResponse> - listNotificationsSettings() { - return getStubSettingsBuilder().listNotificationsSettings(); + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + ListNotificationConfigsPagedResponse> + listNotificationConfigsSettings() { + return getStubSettingsBuilder().listNotificationConfigsSettings(); } /** Returns the builder for the settings used for calls to composeObject. */ diff --git a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageStub.java b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageStub.java index 2b568627a8..bf3d106405 100644 --- a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageStub.java +++ b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageStub.java @@ -18,7 +18,7 @@ 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.ListNotificationConfigsPagedResponse; import static com.google.storage.v2.StorageClient.ListObjectsPagedResponse; import com.google.api.gax.core.BackgroundResource; @@ -45,14 +45,14 @@ 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.CreateNotificationConfigRequest; import com.google.storage.v2.DeleteBucketRequest; import com.google.storage.v2.DeleteHmacKeyRequest; -import com.google.storage.v2.DeleteNotificationRequest; +import com.google.storage.v2.DeleteNotificationConfigRequest; 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.GetNotificationConfigRequest; import com.google.storage.v2.GetObjectRequest; import com.google.storage.v2.GetServiceAccountRequest; import com.google.storage.v2.HmacKeyMetadata; @@ -60,12 +60,12 @@ 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.ListNotificationConfigsRequest; +import com.google.storage.v2.ListNotificationConfigsResponse; 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.NotificationConfig; import com.google.storage.v2.Object; import com.google.storage.v2.QueryWriteStatusRequest; import com.google.storage.v2.QueryWriteStatusResponse; @@ -174,45 +174,47 @@ public class GrpcStorageStub extends StorageStub { .setResponseMarshaller(ProtoUtils.marshaller(Bucket.getDefaultInstance())) .build(); - private static final MethodDescriptor - deleteNotificationMethodDescriptor = - MethodDescriptor.newBuilder() + private static final MethodDescriptor + deleteNotificationConfigMethodDescriptor = + MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/DeleteNotification") + .setFullMethodName("google.storage.v2.Storage/DeleteNotificationConfig") .setRequestMarshaller( - ProtoUtils.marshaller(DeleteNotificationRequest.getDefaultInstance())) + ProtoUtils.marshaller(DeleteNotificationConfigRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); - private static final MethodDescriptor - getNotificationMethodDescriptor = - MethodDescriptor.newBuilder() + private static final MethodDescriptor + getNotificationConfigMethodDescriptor = + MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/GetNotification") + .setFullMethodName("google.storage.v2.Storage/GetNotificationConfig") .setRequestMarshaller( - ProtoUtils.marshaller(GetNotificationRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Notification.getDefaultInstance())) + ProtoUtils.marshaller(GetNotificationConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(NotificationConfig.getDefaultInstance())) .build(); - private static final MethodDescriptor - createNotificationMethodDescriptor = - MethodDescriptor.newBuilder() + private static final MethodDescriptor + createNotificationConfigMethodDescriptor = + MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/CreateNotification") + .setFullMethodName("google.storage.v2.Storage/CreateNotificationConfig") .setRequestMarshaller( - ProtoUtils.marshaller(CreateNotificationRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Notification.getDefaultInstance())) + ProtoUtils.marshaller(CreateNotificationConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(NotificationConfig.getDefaultInstance())) .build(); - private static final MethodDescriptor - listNotificationsMethodDescriptor = - MethodDescriptor.newBuilder() + private static final MethodDescriptor< + ListNotificationConfigsRequest, ListNotificationConfigsResponse> + listNotificationConfigsMethodDescriptor = + MethodDescriptor + .newBuilder() .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.storage.v2.Storage/ListNotifications") + .setFullMethodName("google.storage.v2.Storage/ListNotificationConfigs") .setRequestMarshaller( - ProtoUtils.marshaller(ListNotificationsRequest.getDefaultInstance())) + ProtoUtils.marshaller(ListNotificationConfigsRequest.getDefaultInstance())) .setResponseMarshaller( - ProtoUtils.marshaller(ListNotificationsResponse.getDefaultInstance())) + ProtoUtils.marshaller(ListNotificationConfigsResponse.getDefaultInstance())) .build(); private static final MethodDescriptor @@ -392,13 +394,16 @@ public class GrpcStorageStub extends StorageStub { 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 + deleteNotificationConfigCallable; + private final UnaryCallable + getNotificationConfigCallable; + private final UnaryCallable + createNotificationConfigCallable; + private final UnaryCallable + listNotificationConfigsCallable; + private final UnaryCallable + listNotificationConfigsPagedCallable; private final UnaryCallable composeObjectCallable; private final UnaryCallable deleteObjectCallable; private final UnaryCallable @@ -434,6 +439,8 @@ public class GrpcStorageStub extends StorageStub { private static final PathTemplate GET_BUCKET_0_PATH_TEMPLATE = PathTemplate.create("{bucket=**}"); private static final PathTemplate CREATE_BUCKET_0_PATH_TEMPLATE = PathTemplate.create("{project=**}"); + private static final PathTemplate CREATE_BUCKET_1_PATH_TEMPLATE = + PathTemplate.create("{project=**}"); private static final PathTemplate LIST_BUCKETS_0_PATH_TEMPLATE = PathTemplate.create("{project=**}"); private static final PathTemplate LOCK_BUCKET_RETENTION_POLICY_0_PATH_TEMPLATE = @@ -452,13 +459,13 @@ public class GrpcStorageStub extends StorageStub { PathTemplate.create("{bucket=projects/*/buckets/*}/objects/**"); private static final PathTemplate UPDATE_BUCKET_0_PATH_TEMPLATE = PathTemplate.create("{bucket=**}"); - private static final PathTemplate DELETE_NOTIFICATION_0_PATH_TEMPLATE = + private static final PathTemplate DELETE_NOTIFICATION_CONFIG_0_PATH_TEMPLATE = PathTemplate.create("{bucket=projects/*/buckets/*}/**"); - private static final PathTemplate GET_NOTIFICATION_0_PATH_TEMPLATE = + private static final PathTemplate GET_NOTIFICATION_CONFIG_0_PATH_TEMPLATE = PathTemplate.create("{bucket=projects/*/buckets/*}/**"); - private static final PathTemplate CREATE_NOTIFICATION_0_PATH_TEMPLATE = + private static final PathTemplate CREATE_NOTIFICATION_CONFIG_0_PATH_TEMPLATE = PathTemplate.create("{bucket=**}"); - private static final PathTemplate LIST_NOTIFICATIONS_0_PATH_TEMPLATE = + private static final PathTemplate LIST_NOTIFICATION_CONFIGS_0_PATH_TEMPLATE = PathTemplate.create("{bucket=**}"); private static final PathTemplate COMPOSE_OBJECT_0_PATH_TEMPLATE = PathTemplate.create("{bucket=**}"); @@ -556,6 +563,10 @@ protected GrpcStorageStub( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add(request.getParent(), "project", CREATE_BUCKET_0_PATH_TEMPLATE); + if (request.getBucket() != null) { + builder.add( + request.getBucket().getProject(), "project", CREATE_BUCKET_1_PATH_TEMPLATE); + } return builder.build(); }) .build(); @@ -632,45 +643,54 @@ protected GrpcStorageStub( return builder.build(); }) .build(); - GrpcCallSettings deleteNotificationTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteNotificationMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add(request.getName(), "bucket", DELETE_NOTIFICATION_0_PATH_TEMPLATE); - return builder.build(); - }) - .build(); - GrpcCallSettings getNotificationTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getNotificationMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add(request.getName(), "bucket", GET_NOTIFICATION_0_PATH_TEMPLATE); - return builder.build(); - }) - .build(); - GrpcCallSettings createNotificationTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createNotificationMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add(request.getParent(), "bucket", CREATE_NOTIFICATION_0_PATH_TEMPLATE); - return builder.build(); - }) - .build(); - GrpcCallSettings - listNotificationsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listNotificationsMethodDescriptor) + GrpcCallSettings + deleteNotificationConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteNotificationConfigMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add( - request.getParent(), "bucket", LIST_NOTIFICATIONS_0_PATH_TEMPLATE); + request.getName(), "bucket", DELETE_NOTIFICATION_CONFIG_0_PATH_TEMPLATE); + return builder.build(); + }) + .build(); + GrpcCallSettings + getNotificationConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getNotificationConfigMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + request.getName(), "bucket", GET_NOTIFICATION_CONFIG_0_PATH_TEMPLATE); + return builder.build(); + }) + .build(); + GrpcCallSettings + createNotificationConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createNotificationConfigMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + request.getParent(), + "bucket", + CREATE_NOTIFICATION_CONFIG_0_PATH_TEMPLATE); + return builder.build(); + }) + .build(); + GrpcCallSettings + listNotificationConfigsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listNotificationConfigsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + request.getParent(), "bucket", LIST_NOTIFICATION_CONFIGS_0_PATH_TEMPLATE); return builder.build(); }) .build(); @@ -900,28 +920,30 @@ protected GrpcStorageStub( this.updateBucketCallable = callableFactory.createUnaryCallable( updateBucketTransportSettings, settings.updateBucketSettings(), clientContext); - this.deleteNotificationCallable = + this.deleteNotificationConfigCallable = callableFactory.createUnaryCallable( - deleteNotificationTransportSettings, - settings.deleteNotificationSettings(), + deleteNotificationConfigTransportSettings, + settings.deleteNotificationConfigSettings(), clientContext); - this.getNotificationCallable = + this.getNotificationConfigCallable = callableFactory.createUnaryCallable( - getNotificationTransportSettings, settings.getNotificationSettings(), clientContext); - this.createNotificationCallable = + getNotificationConfigTransportSettings, + settings.getNotificationConfigSettings(), + clientContext); + this.createNotificationConfigCallable = callableFactory.createUnaryCallable( - createNotificationTransportSettings, - settings.createNotificationSettings(), + createNotificationConfigTransportSettings, + settings.createNotificationConfigSettings(), clientContext); - this.listNotificationsCallable = + this.listNotificationConfigsCallable = callableFactory.createUnaryCallable( - listNotificationsTransportSettings, - settings.listNotificationsSettings(), + listNotificationConfigsTransportSettings, + settings.listNotificationConfigsSettings(), clientContext); - this.listNotificationsPagedCallable = + this.listNotificationConfigsPagedCallable = callableFactory.createPagedCallable( - listNotificationsTransportSettings, - settings.listNotificationsSettings(), + listNotificationConfigsTransportSettings, + settings.listNotificationConfigsSettings(), clientContext); this.composeObjectCallable = callableFactory.createUnaryCallable( @@ -1048,30 +1070,32 @@ public UnaryCallable updateBucketCallable() { } @Override - public UnaryCallable deleteNotificationCallable() { - return deleteNotificationCallable; + public UnaryCallable deleteNotificationConfigCallable() { + return deleteNotificationConfigCallable; } @Override - public UnaryCallable getNotificationCallable() { - return getNotificationCallable; + public UnaryCallable + getNotificationConfigCallable() { + return getNotificationConfigCallable; } @Override - public UnaryCallable createNotificationCallable() { - return createNotificationCallable; + public UnaryCallable + createNotificationConfigCallable() { + return createNotificationConfigCallable; } @Override - public UnaryCallable - listNotificationsCallable() { - return listNotificationsCallable; + public UnaryCallable + listNotificationConfigsCallable() { + return listNotificationConfigsCallable; } @Override - public UnaryCallable - listNotificationsPagedCallable() { - return listNotificationsPagedCallable; + public UnaryCallable + listNotificationConfigsPagedCallable() { + return listNotificationConfigsPagedCallable; } @Override diff --git a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStub.java b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStub.java index c9562ed983..ced8e52c4a 100644 --- a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStub.java +++ b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStub.java @@ -18,7 +18,7 @@ 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.ListNotificationConfigsPagedResponse; import static com.google.storage.v2.StorageClient.ListObjectsPagedResponse; import com.google.api.gax.core.BackgroundResource; @@ -38,14 +38,14 @@ 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.CreateNotificationConfigRequest; import com.google.storage.v2.DeleteBucketRequest; import com.google.storage.v2.DeleteHmacKeyRequest; -import com.google.storage.v2.DeleteNotificationRequest; +import com.google.storage.v2.DeleteNotificationConfigRequest; 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.GetNotificationConfigRequest; import com.google.storage.v2.GetObjectRequest; import com.google.storage.v2.GetServiceAccountRequest; import com.google.storage.v2.HmacKeyMetadata; @@ -53,12 +53,12 @@ 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.ListNotificationConfigsRequest; +import com.google.storage.v2.ListNotificationConfigsResponse; 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.NotificationConfig; import com.google.storage.v2.Object; import com.google.storage.v2.QueryWriteStatusRequest; import com.google.storage.v2.QueryWriteStatusResponse; @@ -127,26 +127,29 @@ public UnaryCallable updateBucketCallable() { throw new UnsupportedOperationException("Not implemented: updateBucketCallable()"); } - public UnaryCallable deleteNotificationCallable() { - throw new UnsupportedOperationException("Not implemented: deleteNotificationCallable()"); + public UnaryCallable deleteNotificationConfigCallable() { + throw new UnsupportedOperationException("Not implemented: deleteNotificationConfigCallable()"); } - public UnaryCallable getNotificationCallable() { - throw new UnsupportedOperationException("Not implemented: getNotificationCallable()"); + public UnaryCallable + getNotificationConfigCallable() { + throw new UnsupportedOperationException("Not implemented: getNotificationConfigCallable()"); } - public UnaryCallable createNotificationCallable() { - throw new UnsupportedOperationException("Not implemented: createNotificationCallable()"); + public UnaryCallable + createNotificationConfigCallable() { + throw new UnsupportedOperationException("Not implemented: createNotificationConfigCallable()"); } - public UnaryCallable - listNotificationsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listNotificationsPagedCallable()"); + public UnaryCallable + listNotificationConfigsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listNotificationConfigsPagedCallable()"); } - public UnaryCallable - listNotificationsCallable() { - throw new UnsupportedOperationException("Not implemented: listNotificationsCallable()"); + public UnaryCallable + listNotificationConfigsCallable() { + throw new UnsupportedOperationException("Not implemented: listNotificationConfigsCallable()"); } public UnaryCallable composeObjectCallable() { diff --git a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStubSettings.java b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStubSettings.java index 3f882e3850..a7a999e69c 100644 --- a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStubSettings.java +++ b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStubSettings.java @@ -18,7 +18,7 @@ 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.ListNotificationConfigsPagedResponse; import static com.google.storage.v2.StorageClient.ListObjectsPagedResponse; import com.google.api.core.ApiFunction; @@ -62,14 +62,14 @@ 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.CreateNotificationConfigRequest; import com.google.storage.v2.DeleteBucketRequest; import com.google.storage.v2.DeleteHmacKeyRequest; -import com.google.storage.v2.DeleteNotificationRequest; +import com.google.storage.v2.DeleteNotificationConfigRequest; 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.GetNotificationConfigRequest; import com.google.storage.v2.GetObjectRequest; import com.google.storage.v2.GetServiceAccountRequest; import com.google.storage.v2.HmacKeyMetadata; @@ -77,12 +77,12 @@ 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.ListNotificationConfigsRequest; +import com.google.storage.v2.ListNotificationConfigsResponse; 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.NotificationConfig; import com.google.storage.v2.Object; import com.google.storage.v2.QueryWriteStatusRequest; import com.google.storage.v2.QueryWriteStatusResponse; @@ -163,13 +163,17 @@ public class StorageStubSettings extends StubSettings { private final UnaryCallSettings testIamPermissionsSettings; private final UnaryCallSettings updateBucketSettings; - private final UnaryCallSettings deleteNotificationSettings; - private final UnaryCallSettings getNotificationSettings; - private final UnaryCallSettings - createNotificationSettings; + private final UnaryCallSettings + deleteNotificationConfigSettings; + private final UnaryCallSettings + getNotificationConfigSettings; + private final UnaryCallSettings + createNotificationConfigSettings; private final PagedCallSettings< - ListNotificationsRequest, ListNotificationsResponse, ListNotificationsPagedResponse> - listNotificationsSettings; + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + ListNotificationConfigsPagedResponse> + listNotificationConfigsSettings; private final UnaryCallSettings composeObjectSettings; private final UnaryCallSettings deleteObjectSettings; private final UnaryCallSettings @@ -234,42 +238,47 @@ public Iterable extractResources(ListBucketsResponse payload) { }; private static final PagedListDescriptor< - ListNotificationsRequest, ListNotificationsResponse, Notification> - LIST_NOTIFICATIONS_PAGE_STR_DESC = + ListNotificationConfigsRequest, ListNotificationConfigsResponse, NotificationConfig> + LIST_NOTIFICATION_CONFIGS_PAGE_STR_DESC = new PagedListDescriptor< - ListNotificationsRequest, ListNotificationsResponse, Notification>() { + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + NotificationConfig>() { @Override public String emptyToken() { return ""; } @Override - public ListNotificationsRequest injectToken( - ListNotificationsRequest payload, String token) { - return ListNotificationsRequest.newBuilder(payload).setPageToken(token).build(); + public ListNotificationConfigsRequest injectToken( + ListNotificationConfigsRequest payload, String token) { + return ListNotificationConfigsRequest.newBuilder(payload).setPageToken(token).build(); } @Override - public ListNotificationsRequest injectPageSize( - ListNotificationsRequest payload, int pageSize) { - return ListNotificationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + public ListNotificationConfigsRequest injectPageSize( + ListNotificationConfigsRequest payload, int pageSize) { + return ListNotificationConfigsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); } @Override - public Integer extractPageSize(ListNotificationsRequest payload) { + public Integer extractPageSize(ListNotificationConfigsRequest payload) { return payload.getPageSize(); } @Override - public String extractNextToken(ListNotificationsResponse payload) { + public String extractNextToken(ListNotificationConfigsResponse payload) { return payload.getNextPageToken(); } @Override - public Iterable extractResources(ListNotificationsResponse payload) { - return payload.getNotificationsList() == null - ? ImmutableList.of() - : payload.getNotificationsList(); + public Iterable extractResources( + ListNotificationConfigsResponse payload) { + return payload.getNotificationConfigsList() == null + ? ImmutableList.of() + : payload.getNotificationConfigsList(); } }; @@ -364,23 +373,29 @@ public ApiFuture getFuturePagedResponse( }; private static final PagedListResponseFactory< - ListNotificationsRequest, ListNotificationsResponse, ListNotificationsPagedResponse> - LIST_NOTIFICATIONS_PAGE_STR_FACT = + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + ListNotificationConfigsPagedResponse> + LIST_NOTIFICATION_CONFIGS_PAGE_STR_FACT = new PagedListResponseFactory< - ListNotificationsRequest, - ListNotificationsResponse, - ListNotificationsPagedResponse>() { + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + ListNotificationConfigsPagedResponse>() { @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListNotificationsRequest request, + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListNotificationConfigsRequest request, ApiCallContext context, - ApiFuture futureResponse) { - PageContext + ApiFuture futureResponse) { + PageContext< + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + NotificationConfig> pageContext = PageContext.create( - callable, LIST_NOTIFICATIONS_PAGE_STR_DESC, request, context); - return ListNotificationsPagedResponse.createAsync(pageContext, futureResponse); + callable, LIST_NOTIFICATION_CONFIGS_PAGE_STR_DESC, request, context); + return ListNotificationConfigsPagedResponse.createAsync(pageContext, futureResponse); } }; @@ -466,26 +481,31 @@ 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 deleteNotificationConfig. */ + public UnaryCallSettings + deleteNotificationConfigSettings() { + return deleteNotificationConfigSettings; } - /** 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 getNotificationConfig. */ + public UnaryCallSettings + getNotificationConfigSettings() { + return getNotificationConfigSettings; } - /** 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 createNotificationConfig. */ + public UnaryCallSettings + createNotificationConfigSettings() { + return createNotificationConfigSettings; } - /** Returns the object with the settings used for calls to listNotifications. */ + /** Returns the object with the settings used for calls to listNotificationConfigs. */ public PagedCallSettings< - ListNotificationsRequest, ListNotificationsResponse, ListNotificationsPagedResponse> - listNotificationsSettings() { - return listNotificationsSettings; + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + ListNotificationConfigsPagedResponse> + listNotificationConfigsSettings() { + return listNotificationConfigsSettings; } /** Returns the object with the settings used for calls to composeObject. */ @@ -661,10 +681,10 @@ protected StorageStubSettings(Builder settingsBuilder) throws IOException { 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(); + deleteNotificationConfigSettings = settingsBuilder.deleteNotificationConfigSettings().build(); + getNotificationConfigSettings = settingsBuilder.getNotificationConfigSettings().build(); + createNotificationConfigSettings = settingsBuilder.createNotificationConfigSettings().build(); + listNotificationConfigsSettings = settingsBuilder.listNotificationConfigsSettings().build(); composeObjectSettings = settingsBuilder.composeObjectSettings().build(); deleteObjectSettings = settingsBuilder.deleteObjectSettings().build(); cancelResumableWriteSettings = settingsBuilder.cancelResumableWriteSettings().build(); @@ -700,15 +720,17 @@ public static class Builder extends StubSettings.Builder testIamPermissionsSettings; private final UnaryCallSettings.Builder updateBucketSettings; - private final UnaryCallSettings.Builder - deleteNotificationSettings; - private final UnaryCallSettings.Builder - getNotificationSettings; - private final UnaryCallSettings.Builder - createNotificationSettings; + private final UnaryCallSettings.Builder + deleteNotificationConfigSettings; + private final UnaryCallSettings.Builder + getNotificationConfigSettings; + private final UnaryCallSettings.Builder + createNotificationConfigSettings; private final PagedCallSettings.Builder< - ListNotificationsRequest, ListNotificationsResponse, ListNotificationsPagedResponse> - listNotificationsSettings; + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + ListNotificationConfigsPagedResponse> + listNotificationConfigsSettings; private final UnaryCallSettings.Builder composeObjectSettings; private final UnaryCallSettings.Builder deleteObjectSettings; private final UnaryCallSettings.Builder< @@ -789,10 +811,11 @@ protected Builder(ClientContext clientContext) { 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); + deleteNotificationConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getNotificationConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createNotificationConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listNotificationConfigsSettings = + PagedCallSettings.newBuilder(LIST_NOTIFICATION_CONFIGS_PAGE_STR_FACT); composeObjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteObjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); cancelResumableWriteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -822,10 +845,10 @@ protected Builder(ClientContext clientContext) { setIamPolicySettings, testIamPermissionsSettings, updateBucketSettings, - deleteNotificationSettings, - getNotificationSettings, - createNotificationSettings, - listNotificationsSettings, + deleteNotificationConfigSettings, + getNotificationConfigSettings, + createNotificationConfigSettings, + listNotificationConfigsSettings, composeObjectSettings, deleteObjectSettings, cancelResumableWriteSettings, @@ -856,10 +879,10 @@ protected Builder(StorageStubSettings settings) { 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(); + deleteNotificationConfigSettings = settings.deleteNotificationConfigSettings.toBuilder(); + getNotificationConfigSettings = settings.getNotificationConfigSettings.toBuilder(); + createNotificationConfigSettings = settings.createNotificationConfigSettings.toBuilder(); + listNotificationConfigsSettings = settings.listNotificationConfigsSettings.toBuilder(); composeObjectSettings = settings.composeObjectSettings.toBuilder(); deleteObjectSettings = settings.deleteObjectSettings.toBuilder(); cancelResumableWriteSettings = settings.cancelResumableWriteSettings.toBuilder(); @@ -889,10 +912,10 @@ protected Builder(StorageStubSettings settings) { setIamPolicySettings, testIamPermissionsSettings, updateBucketSettings, - deleteNotificationSettings, - getNotificationSettings, - createNotificationSettings, - listNotificationsSettings, + deleteNotificationConfigSettings, + getNotificationConfigSettings, + createNotificationConfigSettings, + listNotificationConfigsSettings, composeObjectSettings, deleteObjectSettings, cancelResumableWriteSettings, @@ -970,22 +993,22 @@ private static Builder initDefaults(Builder builder) { .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder - .deleteNotificationSettings() + .deleteNotificationConfigSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder - .getNotificationSettings() + .getNotificationConfigSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder - .createNotificationSettings() + .createNotificationConfigSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder - .listNotificationsSettings() + .listNotificationConfigsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); @@ -1136,29 +1159,31 @@ public UnaryCallSettings.Builder updateBucketSettin 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 deleteNotificationConfig. */ + public UnaryCallSettings.Builder + deleteNotificationConfigSettings() { + return deleteNotificationConfigSettings; } - /** 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 getNotificationConfig. */ + public UnaryCallSettings.Builder + getNotificationConfigSettings() { + return getNotificationConfigSettings; } - /** 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 createNotificationConfig. */ + public UnaryCallSettings.Builder + createNotificationConfigSettings() { + return createNotificationConfigSettings; } - /** Returns the builder for the settings used for calls to listNotifications. */ + /** Returns the builder for the settings used for calls to listNotificationConfigs. */ public PagedCallSettings.Builder< - ListNotificationsRequest, ListNotificationsResponse, ListNotificationsPagedResponse> - listNotificationsSettings() { - return listNotificationsSettings; + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + ListNotificationConfigsPagedResponse> + listNotificationConfigsSettings() { + return listNotificationConfigsSettings; } /** Returns the builder for the settings used for calls to composeObject. */ diff --git a/gapic-google-cloud-storage-v2/src/main/resources/com/google/storage/v2/gapic_metadata.json b/gapic-google-cloud-storage-v2/src/main/resources/com/google/storage/v2/gapic_metadata.json index 9442f71159..45b0f29779 100644 --- a/gapic-google-cloud-storage-v2/src/main/resources/com/google/storage/v2/gapic_metadata.json +++ b/gapic-google-cloud-storage-v2/src/main/resources/com/google/storage/v2/gapic_metadata.json @@ -22,8 +22,8 @@ "CreateHmacKey": { "methods": ["createHmacKey", "createHmacKey", "createHmacKey", "createHmacKeyCallable"] }, - "CreateNotification": { - "methods": ["createNotification", "createNotification", "createNotification", "createNotificationCallable"] + "CreateNotificationConfig": { + "methods": ["createNotificationConfig", "createNotificationConfig", "createNotificationConfig", "createNotificationConfigCallable"] }, "DeleteBucket": { "methods": ["deleteBucket", "deleteBucket", "deleteBucket", "deleteBucketCallable"] @@ -31,8 +31,8 @@ "DeleteHmacKey": { "methods": ["deleteHmacKey", "deleteHmacKey", "deleteHmacKey", "deleteHmacKeyCallable"] }, - "DeleteNotification": { - "methods": ["deleteNotification", "deleteNotification", "deleteNotification", "deleteNotificationCallable"] + "DeleteNotificationConfig": { + "methods": ["deleteNotificationConfig", "deleteNotificationConfig", "deleteNotificationConfig", "deleteNotificationConfigCallable"] }, "DeleteObject": { "methods": ["deleteObject", "deleteObject", "deleteObject", "deleteObjectCallable"] @@ -46,8 +46,8 @@ "GetIamPolicy": { "methods": ["getIamPolicy", "getIamPolicy", "getIamPolicy", "getIamPolicyCallable"] }, - "GetNotification": { - "methods": ["getNotification", "getNotification", "getNotification", "getNotificationCallable"] + "GetNotificationConfig": { + "methods": ["getNotificationConfig", "getNotificationConfig", "getNotificationConfig", "getNotificationConfigCallable"] }, "GetObject": { "methods": ["getObject", "getObject", "getObject", "getObjectCallable"] @@ -61,8 +61,8 @@ "ListHmacKeys": { "methods": ["listHmacKeys", "listHmacKeys", "listHmacKeys", "listHmacKeysPagedCallable", "listHmacKeysCallable"] }, - "ListNotifications": { - "methods": ["listNotifications", "listNotifications", "listNotifications", "listNotificationsPagedCallable", "listNotificationsCallable"] + "ListNotificationConfigs": { + "methods": ["listNotificationConfigs", "listNotificationConfigs", "listNotificationConfigs", "listNotificationConfigsPagedCallable", "listNotificationConfigsCallable"] }, "ListObjects": { "methods": ["listObjects", "listObjects", "listObjects", "listObjectsPagedCallable", "listObjectsCallable"] diff --git a/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorageImpl.java b/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorageImpl.java index f9781c107f..a29e115caf 100644 --- a/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorageImpl.java +++ b/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorageImpl.java @@ -249,8 +249,8 @@ public void updateBucket(UpdateBucketRequest request, StreamObserver res } @Override - public void deleteNotification( - DeleteNotificationRequest request, StreamObserver responseObserver) { + public void deleteNotificationConfig( + DeleteNotificationConfigRequest request, StreamObserver responseObserver) { java.lang.Object response = responses.poll(); if (response instanceof Empty) { requests.add(request); @@ -262,7 +262,7 @@ public void deleteNotification( responseObserver.onError( new IllegalArgumentException( String.format( - "Unrecognized response type %s for method DeleteNotification, expected %s or %s", + "Unrecognized response type %s for method DeleteNotificationConfig, expected %s or %s", response == null ? "null" : response.getClass().getName(), Empty.class.getName(), Exception.class.getName()))); @@ -270,12 +270,12 @@ public void deleteNotification( } @Override - public void getNotification( - GetNotificationRequest request, StreamObserver responseObserver) { + public void getNotificationConfig( + GetNotificationConfigRequest request, StreamObserver responseObserver) { java.lang.Object response = responses.poll(); - if (response instanceof Notification) { + if (response instanceof NotificationConfig) { requests.add(request); - responseObserver.onNext(((Notification) response)); + responseObserver.onNext(((NotificationConfig) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); @@ -283,20 +283,21 @@ public void getNotification( responseObserver.onError( new IllegalArgumentException( String.format( - "Unrecognized response type %s for method GetNotification, expected %s or %s", + "Unrecognized response type %s for method GetNotificationConfig, expected %s or %s", response == null ? "null" : response.getClass().getName(), - Notification.class.getName(), + NotificationConfig.class.getName(), Exception.class.getName()))); } } @Override - public void createNotification( - CreateNotificationRequest request, StreamObserver responseObserver) { + public void createNotificationConfig( + CreateNotificationConfigRequest request, + StreamObserver responseObserver) { java.lang.Object response = responses.poll(); - if (response instanceof Notification) { + if (response instanceof NotificationConfig) { requests.add(request); - responseObserver.onNext(((Notification) response)); + responseObserver.onNext(((NotificationConfig) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); @@ -304,21 +305,21 @@ public void createNotification( responseObserver.onError( new IllegalArgumentException( String.format( - "Unrecognized response type %s for method CreateNotification, expected %s or %s", + "Unrecognized response type %s for method CreateNotificationConfig, expected %s or %s", response == null ? "null" : response.getClass().getName(), - Notification.class.getName(), + NotificationConfig.class.getName(), Exception.class.getName()))); } } @Override - public void listNotifications( - ListNotificationsRequest request, - StreamObserver responseObserver) { + public void listNotificationConfigs( + ListNotificationConfigsRequest request, + StreamObserver responseObserver) { java.lang.Object response = responses.poll(); - if (response instanceof ListNotificationsResponse) { + if (response instanceof ListNotificationConfigsResponse) { requests.add(request); - responseObserver.onNext(((ListNotificationsResponse) response)); + responseObserver.onNext(((ListNotificationConfigsResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); @@ -326,9 +327,9 @@ public void listNotifications( responseObserver.onError( new IllegalArgumentException( String.format( - "Unrecognized response type %s for method ListNotifications, expected %s or %s", + "Unrecognized response type %s for method ListNotificationConfigs, expected %s or %s", response == null ? "null" : response.getClass().getName(), - ListNotificationsResponse.class.getName(), + ListNotificationConfigsResponse.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 index 9f1c7c9aa6..8584cb4b63 100644 --- a/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/StorageClientTest.java +++ b/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/StorageClientTest.java @@ -18,7 +18,7 @@ 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.ListNotificationConfigsPagedResponse; import static com.google.storage.v2.StorageClient.ListObjectsPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; @@ -984,17 +984,19 @@ public void updateBucketExceptionTest() throws Exception { } @Test - public void deleteNotificationTest() throws Exception { + public void deleteNotificationConfigTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockStorage.addResponse(expectedResponse); - NotificationName name = NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]"); + NotificationConfigName name = + NotificationConfigName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION_CONFIG]"); - client.deleteNotification(name); + client.deleteNotificationConfig(name); List actualRequests = mockStorage.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteNotificationRequest actualRequest = ((DeleteNotificationRequest) actualRequests.get(0)); + DeleteNotificationConfigRequest actualRequest = + ((DeleteNotificationConfigRequest) actualRequests.get(0)); Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( @@ -1004,13 +1006,14 @@ public void deleteNotificationTest() throws Exception { } @Test - public void deleteNotificationExceptionTest() throws Exception { + public void deleteNotificationConfigExceptionTest() 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); + NotificationConfigName name = + NotificationConfigName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION_CONFIG]"); + client.deleteNotificationConfig(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -1018,17 +1021,18 @@ public void deleteNotificationExceptionTest() throws Exception { } @Test - public void deleteNotificationTest2() throws Exception { + public void deleteNotificationConfigTest2() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockStorage.addResponse(expectedResponse); String name = "name3373707"; - client.deleteNotification(name); + client.deleteNotificationConfig(name); List actualRequests = mockStorage.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteNotificationRequest actualRequest = ((DeleteNotificationRequest) actualRequests.get(0)); + DeleteNotificationConfigRequest actualRequest = + ((DeleteNotificationConfigRequest) actualRequests.get(0)); Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( @@ -1038,13 +1042,13 @@ public void deleteNotificationTest2() throws Exception { } @Test - public void deleteNotificationExceptionTest2() throws Exception { + public void deleteNotificationConfigExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockStorage.addException(exception); try { String name = "name3373707"; - client.deleteNotification(name); + client.deleteNotificationConfig(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -1052,10 +1056,12 @@ public void deleteNotificationExceptionTest2() throws Exception { } @Test - public void getNotificationTest() throws Exception { - Notification expectedResponse = - Notification.newBuilder() - .setName(NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]").toString()) + public void getNotificationConfigTest() throws Exception { + NotificationConfig expectedResponse = + NotificationConfig.newBuilder() + .setName( + NotificationConfigName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION_CONFIG]") + .toString()) .setTopic("topic110546223") .setEtag("etag3123477") .addAllEventTypes(new ArrayList()) @@ -1067,12 +1073,13 @@ public void getNotificationTest() throws Exception { BucketName name = BucketName.of("[PROJECT]", "[BUCKET]"); - Notification actualResponse = client.getNotification(name); + NotificationConfig actualResponse = client.getNotificationConfig(name); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockStorage.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetNotificationRequest actualRequest = ((GetNotificationRequest) actualRequests.get(0)); + GetNotificationConfigRequest actualRequest = + ((GetNotificationConfigRequest) actualRequests.get(0)); Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( @@ -1082,13 +1089,13 @@ public void getNotificationTest() throws Exception { } @Test - public void getNotificationExceptionTest() throws Exception { + public void getNotificationConfigExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockStorage.addException(exception); try { BucketName name = BucketName.of("[PROJECT]", "[BUCKET]"); - client.getNotification(name); + client.getNotificationConfig(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -1096,10 +1103,12 @@ public void getNotificationExceptionTest() throws Exception { } @Test - public void getNotificationTest2() throws Exception { - Notification expectedResponse = - Notification.newBuilder() - .setName(NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]").toString()) + public void getNotificationConfigTest2() throws Exception { + NotificationConfig expectedResponse = + NotificationConfig.newBuilder() + .setName( + NotificationConfigName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION_CONFIG]") + .toString()) .setTopic("topic110546223") .setEtag("etag3123477") .addAllEventTypes(new ArrayList()) @@ -1111,12 +1120,13 @@ public void getNotificationTest2() throws Exception { String name = "name3373707"; - Notification actualResponse = client.getNotification(name); + NotificationConfig actualResponse = client.getNotificationConfig(name); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockStorage.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetNotificationRequest actualRequest = ((GetNotificationRequest) actualRequests.get(0)); + GetNotificationConfigRequest actualRequest = + ((GetNotificationConfigRequest) actualRequests.get(0)); Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( @@ -1126,13 +1136,13 @@ public void getNotificationTest2() throws Exception { } @Test - public void getNotificationExceptionTest2() throws Exception { + public void getNotificationConfigExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockStorage.addException(exception); try { String name = "name3373707"; - client.getNotification(name); + client.getNotificationConfig(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -1140,10 +1150,12 @@ public void getNotificationExceptionTest2() throws Exception { } @Test - public void createNotificationTest() throws Exception { - Notification expectedResponse = - Notification.newBuilder() - .setName(NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]").toString()) + public void createNotificationConfigTest() throws Exception { + NotificationConfig expectedResponse = + NotificationConfig.newBuilder() + .setName( + NotificationConfigName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION_CONFIG]") + .toString()) .setTopic("topic110546223") .setEtag("etag3123477") .addAllEventTypes(new ArrayList()) @@ -1154,17 +1166,18 @@ public void createNotificationTest() throws Exception { mockStorage.addResponse(expectedResponse); ProjectName parent = ProjectName.of("[PROJECT]"); - Notification notification = Notification.newBuilder().build(); + NotificationConfig notificationConfig = NotificationConfig.newBuilder().build(); - Notification actualResponse = client.createNotification(parent, notification); + NotificationConfig actualResponse = client.createNotificationConfig(parent, notificationConfig); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockStorage.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateNotificationRequest actualRequest = ((CreateNotificationRequest) actualRequests.get(0)); + CreateNotificationConfigRequest actualRequest = + ((CreateNotificationConfigRequest) actualRequests.get(0)); Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(notification, actualRequest.getNotification()); + Assert.assertEquals(notificationConfig, actualRequest.getNotificationConfig()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -1172,14 +1185,14 @@ public void createNotificationTest() throws Exception { } @Test - public void createNotificationExceptionTest() throws Exception { + public void createNotificationConfigExceptionTest() 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); + NotificationConfig notificationConfig = NotificationConfig.newBuilder().build(); + client.createNotificationConfig(parent, notificationConfig); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -1187,10 +1200,12 @@ public void createNotificationExceptionTest() throws Exception { } @Test - public void createNotificationTest2() throws Exception { - Notification expectedResponse = - Notification.newBuilder() - .setName(NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]").toString()) + public void createNotificationConfigTest2() throws Exception { + NotificationConfig expectedResponse = + NotificationConfig.newBuilder() + .setName( + NotificationConfigName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION_CONFIG]") + .toString()) .setTopic("topic110546223") .setEtag("etag3123477") .addAllEventTypes(new ArrayList()) @@ -1201,17 +1216,18 @@ public void createNotificationTest2() throws Exception { mockStorage.addResponse(expectedResponse); String parent = "parent-995424086"; - Notification notification = Notification.newBuilder().build(); + NotificationConfig notificationConfig = NotificationConfig.newBuilder().build(); - Notification actualResponse = client.createNotification(parent, notification); + NotificationConfig actualResponse = client.createNotificationConfig(parent, notificationConfig); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockStorage.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateNotificationRequest actualRequest = ((CreateNotificationRequest) actualRequests.get(0)); + CreateNotificationConfigRequest actualRequest = + ((CreateNotificationConfigRequest) actualRequests.get(0)); Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertEquals(notification, actualRequest.getNotification()); + Assert.assertEquals(notificationConfig, actualRequest.getNotificationConfig()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -1219,14 +1235,14 @@ public void createNotificationTest2() throws Exception { } @Test - public void createNotificationExceptionTest2() throws Exception { + public void createNotificationConfigExceptionTest2() 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); + NotificationConfig notificationConfig = NotificationConfig.newBuilder().build(); + client.createNotificationConfig(parent, notificationConfig); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -1234,27 +1250,28 @@ public void createNotificationExceptionTest2() throws Exception { } @Test - public void listNotificationsTest() throws Exception { - Notification responsesElement = Notification.newBuilder().build(); - ListNotificationsResponse expectedResponse = - ListNotificationsResponse.newBuilder() + public void listNotificationConfigsTest() throws Exception { + NotificationConfig responsesElement = NotificationConfig.newBuilder().build(); + ListNotificationConfigsResponse expectedResponse = + ListNotificationConfigsResponse.newBuilder() .setNextPageToken("") - .addAllNotifications(Arrays.asList(responsesElement)) + .addAllNotificationConfigs(Arrays.asList(responsesElement)) .build(); mockStorage.addResponse(expectedResponse); ProjectName parent = ProjectName.of("[PROJECT]"); - ListNotificationsPagedResponse pagedListResponse = client.listNotifications(parent); + ListNotificationConfigsPagedResponse pagedListResponse = client.listNotificationConfigs(parent); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getNotificationsList().get(0), resources.get(0)); + Assert.assertEquals(expectedResponse.getNotificationConfigsList().get(0), resources.get(0)); List actualRequests = mockStorage.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListNotificationsRequest actualRequest = ((ListNotificationsRequest) actualRequests.get(0)); + ListNotificationConfigsRequest actualRequest = + ((ListNotificationConfigsRequest) actualRequests.get(0)); Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( @@ -1264,13 +1281,13 @@ public void listNotificationsTest() throws Exception { } @Test - public void listNotificationsExceptionTest() throws Exception { + public void listNotificationConfigsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockStorage.addException(exception); try { ProjectName parent = ProjectName.of("[PROJECT]"); - client.listNotifications(parent); + client.listNotificationConfigs(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -1278,27 +1295,28 @@ public void listNotificationsExceptionTest() throws Exception { } @Test - public void listNotificationsTest2() throws Exception { - Notification responsesElement = Notification.newBuilder().build(); - ListNotificationsResponse expectedResponse = - ListNotificationsResponse.newBuilder() + public void listNotificationConfigsTest2() throws Exception { + NotificationConfig responsesElement = NotificationConfig.newBuilder().build(); + ListNotificationConfigsResponse expectedResponse = + ListNotificationConfigsResponse.newBuilder() .setNextPageToken("") - .addAllNotifications(Arrays.asList(responsesElement)) + .addAllNotificationConfigs(Arrays.asList(responsesElement)) .build(); mockStorage.addResponse(expectedResponse); String parent = "parent-995424086"; - ListNotificationsPagedResponse pagedListResponse = client.listNotifications(parent); + ListNotificationConfigsPagedResponse pagedListResponse = client.listNotificationConfigs(parent); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getNotificationsList().get(0), resources.get(0)); + Assert.assertEquals(expectedResponse.getNotificationConfigsList().get(0), resources.get(0)); List actualRequests = mockStorage.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListNotificationsRequest actualRequest = ((ListNotificationsRequest) actualRequests.get(0)); + ListNotificationConfigsRequest actualRequest = + ((ListNotificationConfigsRequest) actualRequests.get(0)); Assert.assertEquals(parent, actualRequest.getParent()); Assert.assertTrue( @@ -1308,13 +1326,13 @@ public void listNotificationsTest2() throws Exception { } @Test - public void listNotificationsExceptionTest2() throws Exception { + public void listNotificationConfigsExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockStorage.addException(exception); try { String parent = "parent-995424086"; - client.listNotifications(parent); + client.listNotificationConfigs(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. diff --git a/google-cloud-storage-bom/pom.xml b/google-cloud-storage-bom/pom.xml index e81a46ccd1..d98f94ac52 100644 --- a/google-cloud-storage-bom/pom.xml +++ b/google-cloud-storage-bom/pom.xml @@ -19,7 +19,7 @@ 4.0.0 com.google.cloud google-cloud-storage-bom - 2.17.2-SNAPSHOT + 2.20.1 pom com.google.cloud @@ -69,22 +69,22 @@ com.google.cloud google-cloud-storage - 2.17.2-SNAPSHOT + 2.20.1 com.google.api.grpc gapic-google-cloud-storage-v2 - 2.17.2-alpha-SNAPSHOT + 2.20.1-alpha com.google.api.grpc grpc-google-cloud-storage-v2 - 2.17.2-alpha-SNAPSHOT + 2.20.1-alpha com.google.api.grpc proto-google-cloud-storage-v2 - 2.17.2-alpha-SNAPSHOT + 2.20.1-alpha diff --git a/google-cloud-storage/pom.xml b/google-cloud-storage/pom.xml index 5ee15401bb..3dc3c6c648 100644 --- a/google-cloud-storage/pom.xml +++ b/google-cloud-storage/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-storage - 2.17.2-SNAPSHOT + 2.20.1 jar Google Cloud Storage https://github.com/googleapis/java-storage @@ -12,11 +12,11 @@ com.google.cloud google-cloud-storage-parent - 2.17.2-SNAPSHOT + 2.20.1 google-cloud-storage - 1.105.0 + 1.105.4 5.9.2 @@ -168,13 +168,13 @@ com.google.api.grpc proto-google-cloud-kms-v1 - 0.102.0 + 0.105.0 test com.google.cloud google-cloud-kms - 2.11.0 + 2.14.0 test @@ -340,5 +340,15 @@ + + native + + + com.google.cloud.storage.it.StorageNativeCanary + + diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/BaseStorageReadChannel.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/BaseStorageReadChannel.java index 77a010752f..60ab4990d4 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/BaseStorageReadChannel.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/BaseStorageReadChannel.java @@ -88,7 +88,9 @@ public final synchronized int read(ByteBuffer dst) throws IOException { throw new ClosedChannelException(); } long diff = byteRangeSpec.length(); - if (diff <= 0) { + // the check on beginOffset >= 0 used to be a precondition on seek(long) + // move it here to preserve existing behavior while allowing new negative offsets + if (diff <= 0 && byteRangeSpec.beginOffset() >= 0) { return -1; } try { diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/ByteRangeSpec.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/ByteRangeSpec.java index 3b501eee48..96929b30a0 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/ByteRangeSpec.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/ByteRangeSpec.java @@ -472,6 +472,8 @@ public ReadObjectRequest.Builder seekReadObjectRequest(ReadObjectRequest.Builder protected String fmtAsHttpRangeHeader() throws ArithmeticException { if (beginOffset > 0) { return String.format("bytes=%d-", beginOffset); + } else if (beginOffset < 0) { + return String.format("bytes=%d", beginOffset); } else { return null; } @@ -510,7 +512,7 @@ long length() throws ArithmeticException { @Override ByteRangeSpec withNewBeginOffset(long beginOffset) { - if (beginOffset > 0) { + if (beginOffset != 0) { return new LeftClosedByteRangeSpec(beginOffset); } else { return this; 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 index d580f54830..a6b197902d 100644 --- 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 @@ -24,7 +24,9 @@ import com.google.common.collect.ImmutableSet; import com.google.gson.stream.MalformedJsonException; import java.io.IOException; +import java.net.SocketException; import java.util.Set; +import javax.net.ssl.SSLException; final class DefaultStorageRetryStrategy implements StorageRetryStrategy { @@ -102,7 +104,14 @@ private RetryResult shouldRetryIOException(IOException ioException) { return RetryResult.RETRY; } else if (ioException instanceof MalformedJsonException && idempotent) { // Gson return RetryResult.RETRY; - } else if (BaseServiceException.isRetryable(idempotent, ioException)) { + } else if (ioException instanceof SSLException && idempotent) { + Throwable cause = ioException.getCause(); + if (cause instanceof SocketException) { + SocketException se = (SocketException) cause; + return shouldRetryIOException(se); + } + } + if (BaseServiceException.isRetryable(idempotent, ioException)) { return RetryResult.RETRY; } else { return RetryResult.NO_RETRY; diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/GapicUnbufferedReadableByteChannel.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/GapicUnbufferedReadableByteChannel.java index 2e4f9b5796..4b19c3f998 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/GapicUnbufferedReadableByteChannel.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/GapicUnbufferedReadableByteChannel.java @@ -27,7 +27,6 @@ import com.google.cloud.storage.UnbufferedReadableByteChannelSession.UnbufferedReadableByteChannel; import com.google.storage.v2.ChecksummedData; import com.google.storage.v2.Object; -import com.google.storage.v2.ObjectChecksums; import com.google.storage.v2.ReadObjectRequest; import com.google.storage.v2.ReadObjectResponse; import java.io.Closeable; @@ -50,12 +49,9 @@ final class GapicUnbufferedReadableByteChannel private boolean open = true; private boolean complete = false; - private boolean ioExceptionAlreadyThrown = false; private long blobOffset; - private Crc32cLengthKnown cumulativeCrc32c; private Object metadata; - private ObjectChecksums objectChecksums; private ByteBuffer leftovers; @@ -110,18 +106,6 @@ public long read(ByteBuffer[] dsts, int offset, int length) throws IOException { result.set(metadata); } } - if (resp.hasObjectChecksums()) { - ObjectChecksums checksums = resp.getObjectChecksums(); - if (this.objectChecksums == null) { - this.objectChecksums = checksums; - } else if (!objectChecksums.equals(checksums)) { - throw closeWithError( - String.format( - "Mismatch checksums between subsequent reads. Expected %s but received %s", - Crc32cValue.fmtCrc32cValue(objectChecksums.getCrc32C()), - Crc32cValue.fmtCrc32cValue(checksums.getCrc32C()))); - } - } ChecksummedData checksummedData = resp.getChecksummedData(); ByteBuffer content = checksummedData.getContent().asReadOnlyByteBuffer(); // very important to know whether a crc32c value is set. Without checking, protobuf will @@ -129,11 +113,9 @@ public long read(ByteBuffer[] dsts, int offset, int length) throws IOException { if (checksummedData.hasCrc32C()) { Crc32cLengthKnown expected = Crc32cValue.of(checksummedData.getCrc32C(), checksummedData.getContent().size()); - cumulativeCrc32c = hasher.nullSafeConcat(cumulativeCrc32c, expected); try { hasher.validate(expected, content::duplicate); } catch (IOException e) { - ioExceptionAlreadyThrown = true; close(); throw e; } @@ -161,18 +143,6 @@ public boolean isOpen() { @Override public void close() throws IOException { - if (!ioExceptionAlreadyThrown - && cumulativeCrc32c != null - && objectChecksums != null - && objectChecksums.hasCrc32C()) { - Crc32cLengthKnown expected = Crc32cValue.of(objectChecksums.getCrc32C(), metadata.getSize()); - if (!expected.eqValue(cumulativeCrc32c)) { - throw new IOException( - String.format( - "Mismatch checksum value. Expected %s actual %s", - expected.debugString(), cumulativeCrc32c.debugString())); - } - } open = false; iter.close(); } @@ -187,7 +157,6 @@ private void copy(ReadCursor c, ByteBuffer content, ByteBuffer[] dsts, int offse } private IOException closeWithError(String message) throws IOException { - ioExceptionAlreadyThrown = true; close(); StorageException cause = new StorageException(HttpStatusCodes.STATUS_CODE_PRECONDITION_FAILED, message); @@ -204,7 +173,6 @@ private static final class ReadCursor { private final long limit; private ReadCursor(long beginning, long limit) { - checkArgument(0 <= beginning && beginning <= limit, "0 <= %d <= %d", beginning, limit); this.limit = limit; this.beginning = beginning; this.offset = beginning; diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcConversions.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcConversions.java index 702e90e8ae..43efe180b9 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcConversions.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcConversions.java @@ -96,8 +96,8 @@ final class GrpcConversions { Codec.of(this::blobIdEncode, this::blobIdDecode); private final Codec blobInfoCodec = Codec.of(this::blobInfoEncode, this::blobInfoDecode); - private final Codec notificationInfoCodec = - Codec.of(this::notificationEncode, this::notificationDecode); + private final Codec + notificationInfoCodec = Codec.of(this::notificationEncode, this::notificationDecode); private final Codec policyCodec = Codec.of(this::policyEncode, this::policyDecode); private final Codec bindingCodec = @@ -199,7 +199,7 @@ Codec blobInfo() { return blobInfoCodec; } - Codec notificationInfo() { + Codec notificationInfo() { return notificationInfoCodec; } @@ -917,11 +917,11 @@ private BlobInfo blobInfoDecode(Object from) { return toBuilder.build(); } - private com.google.storage.v2.Notification notificationEncode(NotificationInfo from) { + private com.google.storage.v2.NotificationConfig notificationEncode(NotificationInfo from) { return todo(); } - private NotificationInfo notificationDecode(com.google.storage.v2.Notification from) { + private NotificationInfo notificationDecode(com.google.storage.v2.NotificationConfig from) { return todo(); } diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcRetryAlgorithmManager.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcRetryAlgorithmManager.java index 892169ddf7..f55c2459cf 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcRetryAlgorithmManager.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcRetryAlgorithmManager.java @@ -23,19 +23,19 @@ import com.google.storage.v2.ComposeObjectRequest; import com.google.storage.v2.CreateBucketRequest; import com.google.storage.v2.CreateHmacKeyRequest; -import com.google.storage.v2.CreateNotificationRequest; +import com.google.storage.v2.CreateNotificationConfigRequest; import com.google.storage.v2.DeleteBucketRequest; import com.google.storage.v2.DeleteHmacKeyRequest; -import com.google.storage.v2.DeleteNotificationRequest; +import com.google.storage.v2.DeleteNotificationConfigRequest; 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.GetNotificationConfigRequest; import com.google.storage.v2.GetObjectRequest; import com.google.storage.v2.GetServiceAccountRequest; import com.google.storage.v2.ListBucketsRequest; import com.google.storage.v2.ListHmacKeysRequest; -import com.google.storage.v2.ListNotificationsRequest; +import com.google.storage.v2.ListNotificationConfigsRequest; import com.google.storage.v2.ListObjectsRequest; import com.google.storage.v2.LockBucketRetentionPolicyRequest; import com.google.storage.v2.QueryWriteStatusRequest; @@ -79,7 +79,7 @@ public ResultRetryAlgorithm getFor(CreateHmacKeyRequest req) { return retryStrategy.getNonidempotentHandler(); } - public ResultRetryAlgorithm getFor(CreateNotificationRequest req) { + public ResultRetryAlgorithm getFor(CreateNotificationConfigRequest req) { return retryStrategy.getNonidempotentHandler(); } @@ -91,7 +91,7 @@ public ResultRetryAlgorithm getFor(DeleteHmacKeyRequest req) { return retryStrategy.getNonidempotentHandler(); } - public ResultRetryAlgorithm getFor(DeleteNotificationRequest req) { + public ResultRetryAlgorithm getFor(DeleteNotificationConfigRequest req) { return retryStrategy.getNonidempotentHandler(); } @@ -111,7 +111,7 @@ public ResultRetryAlgorithm getFor(GetIamPolicyRequest req) { return retryStrategy.getIdempotentHandler(); } - public ResultRetryAlgorithm getFor(GetNotificationRequest req) { + public ResultRetryAlgorithm getFor(GetNotificationConfigRequest req) { return retryStrategy.getIdempotentHandler(); } @@ -131,7 +131,7 @@ public ResultRetryAlgorithm getFor(ListHmacKeysRequest req) { return retryStrategy.getIdempotentHandler(); } - public ResultRetryAlgorithm getFor(ListNotificationsRequest req) { + public ResultRetryAlgorithm getFor(ListNotificationConfigsRequest req) { return retryStrategy.getIdempotentHandler(); } diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageImpl.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageImpl.java index b67c5f3a2b..b623f2b97c 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageImpl.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageImpl.java @@ -67,6 +67,7 @@ import com.google.cloud.storage.UnifiedOpts.ObjectTargetOpt; import com.google.cloud.storage.UnifiedOpts.Opts; import com.google.cloud.storage.UnifiedOpts.ProjectId; +import com.google.cloud.storage.UnifiedOpts.UserProject; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; @@ -159,11 +160,15 @@ final class GrpcStorageImpl extends BaseService implements Stora final GrpcRetryAlgorithmManager retryAlgorithmManager; final SyntaxDecoders syntaxDecoders; + // workaround for https://github.com/googleapis/java-storage/issues/1736 + private final Opts defaultOpts; @Deprecated private final ProjectId defaultProjectId; - GrpcStorageImpl(GrpcStorageOptions options, StorageClient storageClient) { + GrpcStorageImpl( + GrpcStorageOptions options, StorageClient storageClient, Opts defaultOpts) { super(options); this.storageClient = storageClient; + this.defaultOpts = defaultOpts; this.codecs = Conversions.grpc(); this.retryAlgorithmManager = options.getRetryAlgorithmManager(); this.syntaxDecoders = new SyntaxDecoders(); @@ -182,7 +187,7 @@ public void close() throws Exception { @Override public Bucket create(BucketInfo bucketInfo, BucketTargetOption... options) { - Opts opts = Opts.unwrap(options).resolveFrom(bucketInfo); + Opts opts = Opts.unwrap(options).resolveFrom(bucketInfo).prepend(defaultOpts); GrpcCallContext grpcCallContext = opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault()); com.google.storage.v2.Bucket bucket = codecs.bucketInfo().encode(bucketInfo); @@ -215,7 +220,7 @@ public Blob create( BlobInfo blobInfo, byte[] content, int offset, int length, BlobTargetOption... options) { requireNonNull(blobInfo, "blobInfo must be non null"); requireNonNull(content, "content must be non null"); - Opts opts = Opts.unwrap(options).resolveFrom(blobInfo); + Opts opts = Opts.unwrap(options).resolveFrom(blobInfo).prepend(defaultOpts); GrpcCallContext grpcCallContext = opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault()); WriteObjectRequest req = getWriteObjectRequest(blobInfo, opts); @@ -267,7 +272,7 @@ public Blob createFrom(BlobInfo blobInfo, Path path, int bufferSize, BlobWriteOp throw new StorageException(0, path + " is a directory"); } - Opts opts = Opts.unwrap(options).resolveFrom(blobInfo); + Opts opts = Opts.unwrap(options).resolveFrom(blobInfo).prepend(defaultOpts); GrpcCallContext grpcCallContext = opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault()); WriteObjectRequest req = getWriteObjectRequest(blobInfo, opts); @@ -335,7 +340,7 @@ public Blob createFrom( throws IOException { requireNonNull(blobInfo, "blobInfo must be non null"); - Opts opts = Opts.unwrap(options).resolveFrom(blobInfo); + Opts opts = Opts.unwrap(options).resolveFrom(blobInfo).prepend(defaultOpts); GrpcCallContext grpcCallContext = opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault()); WriteObjectRequest req = getWriteObjectRequest(blobInfo, opts); @@ -369,7 +374,7 @@ public Blob createFrom( @Override public Bucket get(String bucket, BucketGetOption... options) { - Opts opts = Opts.unwrap(options); + Opts opts = Opts.unwrap(options).prepend(defaultOpts); GrpcCallContext grpcCallContext = opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault()); GetBucketRequest.Builder builder = @@ -384,7 +389,7 @@ public Bucket get(String bucket, BucketGetOption... options) { @Override public Bucket lockRetentionPolicy(BucketInfo bucket, BucketTargetOption... options) { - Opts opts = Opts.unwrap(options).resolveFrom(bucket); + Opts opts = Opts.unwrap(options).resolveFrom(bucket).prepend(defaultOpts); GrpcCallContext grpcCallContext = opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault()); LockBucketRetentionPolicyRequest.Builder builder = @@ -406,7 +411,7 @@ public Blob get(String bucket, String blob, BlobGetOption... options) { @Override public Blob get(BlobId blob, BlobGetOption... options) { - Opts opts = Opts.unwrap(options).resolveFrom(blob); + Opts opts = Opts.unwrap(options).resolveFrom(blob).prepend(defaultOpts); GrpcCallContext grpcCallContext = opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault()); GetObjectRequest.Builder builder = @@ -435,7 +440,7 @@ public Blob get(BlobId blob) { @Override public Page list(BucketListOption... options) { - Opts opts = Opts.unwrap(options); + Opts opts = Opts.unwrap(options).prepend(defaultOpts); GrpcCallContext grpcCallContext = opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault()); ListBucketsRequest request = @@ -462,7 +467,7 @@ public Page list(BucketListOption... options) { @Override public Page list(String bucket, BlobListOption... options) { - Opts opts = Opts.unwrap(options); + Opts opts = Opts.unwrap(options).prepend(defaultOpts); GrpcCallContext grpcCallContext = opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault()); ListObjectsRequest.Builder builder = @@ -481,7 +486,7 @@ public Page list(String bucket, BlobListOption... options) { @Override public Bucket update(BucketInfo bucketInfo, BucketTargetOption... options) { - Opts opts = Opts.unwrap(options).resolveFrom(bucketInfo); + Opts opts = Opts.unwrap(options).resolveFrom(bucketInfo).prepend(defaultOpts); GrpcCallContext grpcCallContext = opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault()); com.google.storage.v2.Bucket bucket = codecs.bucketInfo().encode(bucketInfo); @@ -503,7 +508,7 @@ public Bucket update(BucketInfo bucketInfo, BucketTargetOption... options) { @Override public Blob update(BlobInfo blobInfo, BlobTargetOption... options) { - Opts opts = Opts.unwrap(options).resolveFrom(blobInfo); + Opts opts = Opts.unwrap(options).resolveFrom(blobInfo).prepend(defaultOpts); GrpcCallContext grpcCallContext = opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault()); Object object = codecs.blobInfo().encode(blobInfo); @@ -530,7 +535,7 @@ public Blob update(BlobInfo blobInfo) { @Override public boolean delete(String bucket, BucketSourceOption... options) { - Opts opts = Opts.unwrap(options); + Opts opts = Opts.unwrap(options).prepend(defaultOpts); GrpcCallContext grpcCallContext = opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault()); DeleteBucketRequest.Builder builder = @@ -555,7 +560,7 @@ public boolean delete(String bucket, String blob, BlobSourceOption... options) { @Override public boolean delete(BlobId blob, BlobSourceOption... options) { - Opts opts = Opts.unwrap(options).resolveFrom(blob); + Opts opts = Opts.unwrap(options).resolveFrom(blob).prepend(defaultOpts); GrpcCallContext grpcCallContext = opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault()); DeleteObjectRequest.Builder builder = @@ -587,7 +592,9 @@ public boolean delete(BlobId blob) { @Override public Blob compose(ComposeRequest composeRequest) { Opts opts = - Opts.unwrap(composeRequest.getTargetOptions()).resolveFrom(composeRequest.getTarget()); + Opts.unwrap(composeRequest.getTargetOptions()) + .resolveFrom(composeRequest.getTarget()) + .prepend(defaultOpts); GrpcCallContext grpcCallContext = opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault()); ComposeObjectRequest.Builder builder = ComposeObjectRequest.newBuilder(); @@ -609,8 +616,12 @@ public CopyWriter copy(CopyRequest copyRequest) { BlobId src = copyRequest.getSource(); BlobInfo dst = copyRequest.getTarget(); Opts srcOpts = - Opts.unwrap(copyRequest.getSourceOptions()).projectAsSource().resolveFrom(src); - Opts dstOpts = Opts.unwrap(copyRequest.getTargetOptions()).resolveFrom(dst); + Opts.unwrap(copyRequest.getSourceOptions()) + .projectAsSource() + .resolveFrom(src) + .prepend(defaultOpts); + Opts dstOpts = + Opts.unwrap(copyRequest.getTargetOptions()).resolveFrom(dst).prepend(defaultOpts); Mapper mapper = srcOpts.rewriteObjectsRequest().andThen(dstOpts.rewriteObjectsRequest()); @@ -684,7 +695,7 @@ public GrpcBlobReadChannel reader(String bucket, String blob, BlobSourceOption.. @Override public GrpcBlobReadChannel reader(BlobId blob, BlobSourceOption... options) { - Opts opts = Opts.unwrap(options).resolveFrom(blob); + Opts opts = Opts.unwrap(options).resolveFrom(blob).prepend(defaultOpts); ReadObjectRequest request = getReadObjectRequest(blob, opts); Set codes = resultRetryAlgorithmToCodes(retryAlgorithmManager.getFor(request)); GrpcCallContext grpcCallContext = GrpcCallContext.createDefault().withRetryableCodes(codes); @@ -722,7 +733,7 @@ public void downloadTo(BlobId blob, OutputStream outputStream, BlobSourceOption. @Override public GrpcBlobWriteChannel writer(BlobInfo blobInfo, BlobWriteOption... options) { - Opts opts = Opts.unwrap(options).resolveFrom(blobInfo); + Opts opts = Opts.unwrap(options).resolveFrom(blobInfo).prepend(defaultOpts); GrpcCallContext grpcCallContext = opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault()); WriteObjectRequest req = getWriteObjectRequest(blobInfo, opts); @@ -844,7 +855,7 @@ public List delete(Iterable blobIds) { @Override public Acl getAcl(String bucket, Entity entity, BucketSourceOption... options) { try { - Opts opts = Opts.unwrap(options); + Opts opts = Opts.unwrap(options).prepend(defaultOpts); com.google.storage.v2.Bucket resp = getBucketWithAcls(bucket, opts); Predicate entityPredicate = @@ -874,7 +885,7 @@ public Acl getAcl(String bucket, Entity entity) { @Override public boolean deleteAcl(String bucket, Entity entity, BucketSourceOption... options) { try { - Opts opts = Opts.unwrap(options); + Opts opts = Opts.unwrap(options).prepend(defaultOpts); com.google.storage.v2.Bucket resp = getBucketWithAcls(bucket, opts); String encode = codecs.entity().encode(entity); @@ -928,7 +939,7 @@ public Acl createAcl(String bucket, Acl acl) { @Override public Acl updateAcl(String bucket, Acl acl, BucketSourceOption... options) { try { - Opts opts = Opts.unwrap(options); + Opts opts = Opts.unwrap(options).prepend(defaultOpts); com.google.storage.v2.Bucket resp = getBucketWithAcls(bucket, opts); BucketAccessControl encode = codecs.bucketAcl().encode(acl); String entity = encode.getEntity(); @@ -966,7 +977,7 @@ public Acl updateAcl(String bucket, Acl acl) { @Override public List listAcls(String bucket, BucketSourceOption... options) { try { - Opts opts = Opts.unwrap(options); + Opts opts = Opts.unwrap(options).prepend(defaultOpts); com.google.storage.v2.Bucket resp = getBucketWithAcls(bucket, opts); return resp.getAclList().stream() .map(codecs.bucketAcl()::decode) @@ -1211,7 +1222,7 @@ public List listAcls(BlobId blob) { @Override public HmacKey createHmacKey(ServiceAccount serviceAccount, CreateHmacKeyOption... options) { - Opts opts = Opts.unwrap(options); + Opts opts = Opts.unwrap(options).prepend(defaultOpts); GrpcCallContext grpcCallContext = opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault()); CreateHmacKeyRequest request = @@ -1236,7 +1247,7 @@ public HmacKey createHmacKey(ServiceAccount serviceAccount, CreateHmacKeyOption. @Override public Page listHmacKeys(ListHmacKeysOption... options) { - Opts opts = Opts.unwrap(options); + Opts opts = Opts.unwrap(options).prepend(defaultOpts); GrpcCallContext grpcCallContext = opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault()); @@ -1264,7 +1275,7 @@ public Page listHmacKeys(ListHmacKeysOption... options) { @Override public HmacKeyMetadata getHmacKey(String accessId, GetHmacKeyOption... options) { - Opts opts = Opts.unwrap(options); + Opts opts = Opts.unwrap(options).prepend(defaultOpts); GrpcCallContext grpcCallContext = opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault()); GetHmacKeyRequest request = @@ -1283,7 +1294,7 @@ public HmacKeyMetadata getHmacKey(String accessId, GetHmacKeyOption... options) @Override public void deleteHmacKey(HmacKeyMetadata hmacKeyMetadata, DeleteHmacKeyOption... options) { - Opts opts = Opts.unwrap(options); + Opts opts = Opts.unwrap(options).prepend(defaultOpts); GrpcCallContext grpcCallContext = opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault()); DeleteHmacKeyRequest req = @@ -1304,7 +1315,7 @@ public void deleteHmacKey(HmacKeyMetadata hmacKeyMetadata, DeleteHmacKeyOption.. @Override public HmacKeyMetadata updateHmacKeyState( HmacKeyMetadata hmacKeyMetadata, HmacKeyState state, UpdateHmacKeyOption... options) { - Opts opts = Opts.unwrap(options); + Opts opts = Opts.unwrap(options).prepend(defaultOpts); GrpcCallContext grpcCallContext = opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault()); com.google.storage.v2.HmacKeyMetadata encode = @@ -1323,7 +1334,7 @@ public HmacKeyMetadata updateHmacKeyState( @Override public Policy getIamPolicy(String bucket, BucketSourceOption... options) { - Opts opts = Opts.unwrap(options); + Opts opts = Opts.unwrap(options).prepend(defaultOpts); GrpcCallContext grpcCallContext = opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault()); GetIamPolicyRequest.Builder builder = @@ -1338,7 +1349,7 @@ public Policy getIamPolicy(String bucket, BucketSourceOption... options) { @Override public Policy setIamPolicy(String bucket, Policy policy, BucketSourceOption... options) { - Opts opts = Opts.unwrap(options); + Opts opts = Opts.unwrap(options).prepend(defaultOpts); GrpcCallContext grpcCallContext = opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault()); SetIamPolicyRequest req = @@ -1356,7 +1367,7 @@ public Policy setIamPolicy(String bucket, Policy policy, BucketSourceOption... o @Override public List testIamPermissions( String bucket, List permissions, BucketSourceOption... options) { - Opts opts = Opts.unwrap(options); + Opts opts = Opts.unwrap(options).prepend(defaultOpts); GrpcCallContext grpcCallContext = opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault()); TestIamPermissionsRequest req = @@ -1706,7 +1717,7 @@ private WriteObjectRequest getWriteObjectRequest(BlobInfo info, Opts unbufferedReadSession( BlobId blob, BlobSourceOption[] options) { - Opts opts = Opts.unwrap(options).resolveFrom(blob); + Opts opts = Opts.unwrap(options).resolveFrom(blob).prepend(defaultOpts); ReadObjectRequest readObjectRequest = getReadObjectRequest(blob, opts); Set codes = resultRetryAlgorithmToCodes(retryAlgorithmManager.getFor(readObjectRequest)); diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageOptions.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageOptions.java index d78eed0e6e..f001483eaf 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageOptions.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageOptions.java @@ -31,15 +31,19 @@ import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.NoHeaderProvider; import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.internal.QuotaProjectIdHidingCredentials; import com.google.auth.Credentials; import com.google.cloud.NoCredentials; import com.google.cloud.ServiceFactory; import com.google.cloud.ServiceOptions; import com.google.cloud.ServiceRpc; import com.google.cloud.TransportOptions; +import com.google.cloud.Tuple; import com.google.cloud.grpc.GrpcTransportOptions; import com.google.cloud.spi.ServiceRpcFactory; import com.google.cloud.storage.TransportCompatibility.Transport; +import com.google.cloud.storage.UnifiedOpts.Opts; +import com.google.cloud.storage.UnifiedOpts.UserProject; import com.google.cloud.storage.spi.StorageRpcFactory; import com.google.common.base.MoreObjects; import com.google.common.collect.ImmutableSet; @@ -50,6 +54,10 @@ import io.grpc.ManagedChannelBuilder; import java.io.IOException; import java.net.URI; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; @@ -99,6 +107,41 @@ Duration getTerminationAwaitDuration() { @InternalApi StorageSettings getStorageSettings() throws IOException { + return resolveSettingsAndOpts().x(); + } + + /** + * We have to perform several introspections and detections to cross-wire/support several features + * that are either gapic primitives, ServieOption primitives or GCS semantic requirements. + * + *

Requester Pays, {@code quota_project_id} and {@code userProject}

+ * + * When using the JSON Api operations destined for requester pays buckets can identify the project + * for billing and quota attribution by specifying either {@code userProject} query parameter or + * {@code x-goog-user-project} HTTP Header. + * + *

If the credentials being used contain the property {@code quota_project_id} this value will + * automatically be set to the {@code x-goog-user-project} header for both JSON and GAPIC. In the + * case of JSON this isn't an issue, as any {@code userProject} query parameter takes precedence. + * However, in gRPC/GAPIC there isn't a {@code userProject} query parameter, instead we are adding + * {@code x-goog-user-project} to the request context as metadata. If the credentials set the + * request metadata and we set the request metadata it results in two different entries in the + * request. This creates ambiguity for GCS which then rejects the request. + * + *

To account for this and to provide a similarly level of precedence we are introspecting the + * credentials and service options to save any {@code quota_project_id} into an {@link + * UserProject} which is then used by {@link GrpcStorageImpl} to resolve individual request + * metadata. + * + *

The precedence we want to provide is as follows

+ * + *
    + *
  1. Any "userProject" Option provided to an individual method + *
  2. Any Non-empty value for {@link #getQuotaProjectId()} + *
  3. Any {@code x-goog-user-project} provided by {@link #credentials} + *
+ */ + private Tuple> resolveSettingsAndOpts() throws IOException { String endpoint = getHost(); URI uri = URI.create(endpoint); String scheme = uri.getScheme(); @@ -114,11 +157,33 @@ StorageSettings getStorageSettings() throws IOException { break; } + Opts defaultOpts = Opts.empty(); CredentialsProvider credentialsProvider; if (credentials instanceof NoCredentials) { credentialsProvider = NoCredentialsProvider.create(); } else { - credentialsProvider = FixedCredentialsProvider.create(credentials); + boolean foundQuotaProject = false; + if (credentials.hasRequestMetadata()) { + Map> requestMetadata = credentials.getRequestMetadata(uri); + for (Entry> e : requestMetadata.entrySet()) { + String key = e.getKey(); + if ("x-goog-user-project".equals(key.trim().toLowerCase(Locale.ENGLISH))) { + List value = e.getValue(); + if (!value.isEmpty()) { + foundQuotaProject = true; + defaultOpts = Opts.from(UnifiedOpts.userProject(value.get(0))); + break; + } + } + } + } + if (foundQuotaProject) { + // fix for https://github.com/googleapis/java-storage/issues/1736 + credentialsProvider = + FixedCredentialsProvider.create(new QuotaProjectIdHidingCredentials(credentials)); + } else { + credentialsProvider = FixedCredentialsProvider.create(credentials); + } } HeaderProvider internalHeaderProvider = @@ -135,6 +200,12 @@ StorageSettings getStorageSettings() throws IOException { .setCredentialsProvider(credentialsProvider) .setClock(getClock()); + // this MUST come after credentials, service options set value has higher priority than creds + String quotaProjectId = this.getQuotaProjectId(); + if (quotaProjectId != null && !quotaProjectId.isEmpty()) { + defaultOpts = Opts.from(UnifiedOpts.userProject(quotaProjectId)); + } + builder.setHeaderProvider(this.getMergedHeaderProvider(new NoHeaderProvider())); InstantiatingGrpcChannelProvider.Builder channelProviderBuilder = @@ -192,7 +263,7 @@ StorageSettings getStorageSettings() throws IOException { // this is totally valid. instead we want to monitor if the stream is doing work and if not // timeout. .setIdleTimeout(totalTimeout); - return builder.build(); + return Tuple.of(builder.build(), defaultOpts); } /** @since 2.14.0 This new api is in preview and is subject to breaking changes. */ @@ -502,8 +573,11 @@ public Storage create(StorageOptions options) { if (options instanceof GrpcStorageOptions) { GrpcStorageOptions grpcStorageOptions = (GrpcStorageOptions) options; try { - StorageSettings storageSettings = grpcStorageOptions.getStorageSettings(); - return new GrpcStorageImpl(grpcStorageOptions, StorageClient.create(storageSettings)); + Tuple> t = grpcStorageOptions.resolveSettingsAndOpts(); + StorageSettings storageSettings = t.x(); + Opts defaultOpts = t.y(); + return new GrpcStorageImpl( + grpcStorageOptions, StorageClient.create(storageSettings), defaultOpts); } catch (IOException e) { throw new IllegalStateException( "Unable to instantiate gRPC com.google.cloud.storage.Storage client.", e); 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 bfc2cdb093..554611e985 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 @@ -776,6 +776,15 @@ public static BlobWriteOption generationMatch() { return new BlobWriteOption(UnifiedOpts.generationMatchExtractor()); } + /** + * 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 provided value. + */ + @TransportCompatibility({Transport.HTTP, Transport.GRPC}) + public static BlobWriteOption generationMatch(long generation) { + return new BlobWriteOption(UnifiedOpts.generationMatch(generation)); + } + /** * Returns an option for blob's data generation mismatch. If this option is used the request * will fail if generation matches. @@ -785,6 +794,15 @@ public static BlobWriteOption generationNotMatch() { return new BlobWriteOption(UnifiedOpts.generationNotMatchExtractor()); } + /** + * Returns an option for blob's data generation mismatch. If this option is used the request + * will fail if blob's generation does not match the provided value. + */ + @TransportCompatibility({Transport.HTTP, Transport.GRPC}) + public static BlobWriteOption generationNotMatch(long generation) { + return new BlobWriteOption(UnifiedOpts.generationNotMatch(generation)); + } + /** * Returns an option for blob's metageneration match. If this option is used the request will * fail if metageneration does not match. @@ -794,6 +812,15 @@ public static BlobWriteOption metagenerationMatch() { return new BlobWriteOption(UnifiedOpts.metagenerationMatchExtractor()); } + /** + * Returns an option for blob's metageneration match. If this option is used the request will + * fail if blob's generation does not match the provided value. + */ + @TransportCompatibility({Transport.HTTP, Transport.GRPC}) + public static BlobWriteOption metagenerationMatch(long metageneration) { + return new BlobWriteOption(UnifiedOpts.metagenerationMatch(metageneration)); + } + /** * Returns an option for blob's metageneration mismatch. If this option is used the request will * fail if metageneration matches. @@ -803,6 +830,15 @@ public static BlobWriteOption metagenerationNotMatch() { return new BlobWriteOption(UnifiedOpts.metagenerationNotMatchExtractor()); } + /** + * Returns an option for blob's metageneration mismatch. If this option is used the request will + * fail if blob's generation does not match the provided value. + */ + @TransportCompatibility({Transport.HTTP, Transport.GRPC}) + public static BlobWriteOption metagenerationNotMatch(long metageneration) { + return new BlobWriteOption(UnifiedOpts.metagenerationNotMatch(metageneration)); + } + /** * Returns an option for blob's data MD5 hash match. If this option is used the request will * fail if blobs' data MD5 hash does not match. diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageReadChannel.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageReadChannel.java index 18539da4d2..40630ad937 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageReadChannel.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageReadChannel.java @@ -41,7 +41,6 @@ default ByteRangeSpec getByteRangeSpec() { @SuppressWarnings("resource") @Override default void seek(long position) throws IOException { - checkArgument(position >= 0, "position must be >= 0"); try { setByteRangeSpec(getByteRangeSpec().withNewBeginOffset(position)); } catch (StorageException e) { diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/UnifiedOpts.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/UnifiedOpts.java index 6e78001b24..f632af9251 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/UnifiedOpts.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/UnifiedOpts.java @@ -2288,6 +2288,27 @@ Decoder clearBucketFields() { .orElse(Decoder.identity()); } + /** + * Create a new instance of Opts where {@code toPrepend} and {@code this}. If an {@link Opt} + * type ({@code Class}) is present in both {@code toPrepend} and {@code this}, the {@link + * Opt} from {@code this} will take priority when applied via one of the produced mappers. + */ + Opts prepend(Opts toPrepend) { + // inventory the Opt types already present in this + Set> existingOptTypes = + this.opts.stream().map(Opt::getClass).collect(Collectors.toSet()); + + ImmutableList list = + Stream.of( + toPrepend.opts.stream() + // exclude those opt types which are already present in this + .filter(o -> !existingOptTypes.contains(o.getClass())), + this.opts.stream()) + .flatMap(x -> x) + .collect(ImmutableList.toImmutableList()); + return new Opts<>(list); + } + private Mapper> rpcOptionMapper() { return fuseMappers(RpcOptVal.class, RpcOptVal::mapper); } @@ -2310,6 +2331,10 @@ static Opts from(T... ts) { return new Opts<>(ImmutableList.copyOf(ts)); } + static Opts empty() { + return new Opts<>(ImmutableList.of()); + } + /** * Given an array of OptionShim, extract the opt from each of them to construct a new instance * of {@link Opts} diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/ByteRangeSpecTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/ByteRangeSpecTest.java index dce7190d1a..abb5a9536b 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/ByteRangeSpecTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/ByteRangeSpecTest.java @@ -45,6 +45,20 @@ public final class ByteRangeSpecTest { public static final class Behavior { + @Test + public void negativeBeginOffset() throws Exception { + ByteRangeSpec rel = ByteRangeSpec.relativeLength(-5L, null); + ByteRangeSpec exO = ByteRangeSpec.explicit(-5L, null); + ByteRangeSpec exC = ByteRangeSpec.explicitClosed(-5L, null); + threeWayEqual(exO, exC, rel); + } + + @Test + public void negativeBeginOffset_fromNull() { + ByteRangeSpec spec = ByteRangeSpec.nullRange().withNewBeginOffset(-5L); + assertThat(spec.getHttpRangeHeader()).isEqualTo("bytes=-5"); + } + @Test public void beginNonNullZero_endNonNullNonInfinity() throws Exception { ByteRangeSpec rel = ByteRangeSpec.relativeLength(0L, 52L); 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 index 477594ddfe..e710143398 100644 --- 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 @@ -268,6 +268,7 @@ enum ThrowableCategory { SOCKET_EXCEPTION(C.SOCKET_EXCEPTION), SSL_EXCEPTION(C.SSL_EXCEPTION), SSL_EXCEPTION_CONNECTION_SHUTDOWN(C.SSL_EXCEPTION_CONNECTION_SHUTDOWN), + SSL_EXCEPTION_CONNECTION_RESET(C.SSL_EXCEPTION_CONNECTION_RESET), SSL_HANDSHAKE_EXCEPTION(C.SSL_HANDSHAKE_EXCEPTION), SSL_HANDSHAKE_EXCEPTION_CAUSED_BY_CERTIFICATE_EXCEPTION( C.SSL_HANDSHAKE_EXCEPTION_CERTIFICATE_EXCEPTION), @@ -305,6 +306,8 @@ enum ThrowableCategory { 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_EXCEPTION_CONNECTION_RESET( + new StorageException(C.SSL_EXCEPTION_CONNECTION_RESET)), 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)), @@ -361,6 +364,8 @@ private static final class C { 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 SSLException SSL_EXCEPTION_CONNECTION_RESET = + new SSLException("Connection reset", new SocketException("Connection reset")); private static final SSLHandshakeException SSL_HANDSHAKE_EXCEPTION = newSslHandshakeExceptionWithCause(new SSLProtocolException(DEFAULT_MESSAGE)); private static final SSLHandshakeException SSL_HANDSHAKE_EXCEPTION_CERTIFICATE_EXCEPTION = @@ -614,6 +619,16 @@ private static ImmutableList getAllCases() { HandlerCategory.NONIDEMPOTENT, ExpectRetry.NO, Behavior.SAME), + new Case( + ThrowableCategory.SSL_EXCEPTION_CONNECTION_RESET, + HandlerCategory.IDEMPOTENT, + ExpectRetry.YES, + Behavior.DEFAULT_MORE_PERMISSIBLE), + new Case( + ThrowableCategory.SSL_EXCEPTION_CONNECTION_RESET, + HandlerCategory.NONIDEMPOTENT, + ExpectRetry.NO, + Behavior.SAME), new Case( ThrowableCategory.SSL_HANDSHAKE_EXCEPTION, HandlerCategory.IDEMPOTENT, @@ -884,6 +899,16 @@ private static ImmutableList getAllCases() { HandlerCategory.NONIDEMPOTENT, ExpectRetry.NO, Behavior.DEFAULT_MORE_STRICT), + new Case( + ThrowableCategory.STORAGE_EXCEPTION_SSL_EXCEPTION_CONNECTION_RESET, + HandlerCategory.IDEMPOTENT, + ExpectRetry.YES, + Behavior.DEFAULT_MORE_PERMISSIBLE), + new Case( + ThrowableCategory.STORAGE_EXCEPTION_SSL_EXCEPTION_CONNECTION_RESET, + HandlerCategory.NONIDEMPOTENT, + ExpectRetry.NO, + Behavior.SAME), new Case( ThrowableCategory.STORAGE_EXCEPTION_SSL_HANDSHAKE_EXCEPTION, HandlerCategory.IDEMPOTENT, diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/GapicUnbufferedReadableByteChannelTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/GapicUnbufferedReadableByteChannelTest.java index 27603447cc..f399986214 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/GapicUnbufferedReadableByteChannelTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/GapicUnbufferedReadableByteChannelTest.java @@ -271,46 +271,6 @@ public void readObject( } } - @Test - public void ioException_if_crc32c_mismatch_cumulative() throws IOException, InterruptedException { - StorageGrpc.StorageImplBase fakeStorage = - new StorageGrpc.StorageImplBase() { - @Override - public void readObject( - ReadObjectRequest request, StreamObserver responseObserver) { - if (request.equals(req1)) { - responseObserver.onNext(resp1); - responseObserver.onCompleted(); - } else { - responseObserver.onError(apiException(Code.PERMISSION_DENIED)); - } - } - }; - try (FakeServer server = FakeServer.of(fakeStorage); - StorageClient storageClient = StorageClient.create(server.storageSettings())) { - - UnbufferedReadableByteChannelSession session = - new UnbufferedReadSession<>( - ApiFutures.immediateFuture(req1), - (start, resultFuture) -> - new GapicUnbufferedReadableByteChannel( - resultFuture, - storageClient - .readObjectCallable() - .withDefaultCallContext( - contextWithRetryForCodes(StatusCode.Code.DATA_LOSS)), - start, - Hasher.enabled())); - byte[] actualBytes = new byte[40]; - //noinspection resource - UnbufferedReadableByteChannel c = session.open(); - c.read(ByteBuffer.wrap(actualBytes)); - - IOException ioException = assertThrows(IOException.class, c::close); - assertThat(ioException).hasMessageThat().contains("Mismatch checksum"); - } - } - @Test public void overRead_handledProperly() throws IOException, InterruptedException { StorageGrpc.StorageImplBase fakeStorage = diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/TransportCompatibilityTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/TransportCompatibilityTest.java index 9b346aca26..d22b18294d 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/TransportCompatibilityTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/TransportCompatibilityTest.java @@ -22,6 +22,7 @@ import com.google.cloud.storage.PostPolicyV4.PostConditionsV4; import com.google.cloud.storage.PostPolicyV4.PostFieldsV4; import com.google.cloud.storage.TransportCompatibility.Transport; +import com.google.cloud.storage.UnifiedOpts.Opts; import com.google.common.collect.ImmutableList; import java.util.function.Supplier; import java.util.stream.Stream; @@ -37,7 +38,7 @@ public void verifyUnsupportedMethodsGenerateMeaningfulException() { .setCredentials(NoCredentials.getInstance()) .build(); @SuppressWarnings("resource") - Storage s = new GrpcStorageImpl(options, null); + Storage s = new GrpcStorageImpl(options, null, Opts.empty()); ImmutableList messages = Stream.>of( s::batch, diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITAccessTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITAccessTest.java index ab09709fcc..776aaa9dbd 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITAccessTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITAccessTest.java @@ -345,6 +345,7 @@ private void doTestUniformBucketLevelAccessAclImpact(IamConfiguration iamConfigu } @Test + @CrossRun.Ignore(transports = Transport.GRPC) // todo(b/270215524) public void testEnableAndDisableUniformBucketLevelAccessOnExistingBucket() throws Exception { String bpoBucket = generator.randomBucketName(); BucketInfo.IamConfiguration ublaDisabledIamConfiguration = @@ -492,6 +493,7 @@ public void testUnspecifiedPublicAccessPreventionOnBucket() throws Exception { } @Test + @CrossRun.Ignore(transports = Transport.GRPC) // todo(b/270215524) public void changingPAPDoesNotAffectUBLA() throws Exception { String bucketName = generator.randomBucketName(); try (TemporaryBucket tempB = @@ -534,6 +536,7 @@ public void changingPAPDoesNotAffectUBLA() throws Exception { } @Test + @CrossRun.Ignore(transports = Transport.GRPC) // todo(b/270215524) public void changingUBLADoesNotAffectPAP() throws Exception { String bucketName = generator.randomBucketName(); try (TemporaryBucket tempB = @@ -615,6 +618,7 @@ public void testRetentionPolicyNoLock() throws Exception { @Test @SuppressWarnings({"unchecked", "deprecation"}) + @CrossRun.Ignore(transports = Transport.GRPC) // todo(b/270215524) public void testEnableAndDisableBucketPolicyOnlyOnExistingBucket() throws Exception { String bpoBucket = generator.randomBucketName(); try (TemporaryBucket tempB = diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBlobReadChannelTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBlobReadChannelTest.java index ebbff00f41..bf4427096a 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBlobReadChannelTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBlobReadChannelTest.java @@ -459,6 +459,27 @@ public void readingLastByteReturnsOneByte_seekOnly() throws IOException { } } + @Test + public void readingLastByteReturnsOneByte_seekOnly_negativeOffset() throws IOException { + int length = 10; + byte[] bytes = DataGenerator.base64Characters().genBytes(length); + + BlobInfo info1 = BlobInfo.newBuilder(bucket, generator.randomObjectName()).build(); + Blob gen1 = storage.create(info1, bytes, BlobTargetOption.doesNotExist()); + + byte[] expected1 = Arrays.copyOfRange(bytes, 9, 10); + String xxdExpected1 = xxd(expected1); + try (ReadChannel reader = storage.reader(gen1.getBlobId()); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + WritableByteChannel writer = Channels.newChannel(baos)) { + reader.seek(-1); + ByteStreams.copy(reader, writer); + byte[] bytes1 = baos.toByteArray(); + String xxd1 = xxd(bytes1); + assertThat(xxd1).isEqualTo(xxdExpected1); + } + } + @Test public void readingLastByteReturnsOneByte_seekAndLimit() throws IOException { int length = 10; 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 index 0de35093cd..8713e8e8cb 100644 --- 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 @@ -34,7 +34,7 @@ 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.DataGenerator; import com.google.cloud.storage.HttpStorageOptions; import com.google.cloud.storage.PackagePrivateMethodWorkarounds; import com.google.cloud.storage.Storage; @@ -58,10 +58,8 @@ import java.io.IOException; import java.nio.ByteBuffer; import java.util.Optional; -import java.util.Random; import java.util.concurrent.atomic.AtomicBoolean; import java.util.logging.Logger; -import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.threeten.bp.Clock; @@ -89,8 +87,6 @@ public final class ITBlobWriteChannelTest { @Inject public Generator generator; - @Rule public final DataGeneration dataGeneration = new DataGeneration(new Random(1234567890)); - /** * Test for unexpected EOF at the beginning of trying to read the json response. * @@ -146,9 +142,9 @@ public void testWriteChannelExistingBlob() throws IOException { DateTimeFormatter formatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME.withZone(ZoneId.from(ZoneOffset.UTC)); String nowString = formatter.format(now); - BucketInfo bucketInfo = BucketInfo.of(dataGeneration.getBucketName()); + BucketInfo bucketInfo = BucketInfo.of(generator.randomBucketName()); String blobPath = String.format("%s/%s/blob", generator.randomObjectName(), nowString); - BlobId blobId = BlobId.of(dataGeneration.getBucketName(), blobPath); + BlobId blobId = BlobId.of(bucketInfo.getName(), blobPath); BlobInfo blobInfo = BlobInfo.newBuilder(blobId).build(); storage.create(bucketInfo); storage.create(blobInfo); @@ -164,7 +160,7 @@ public void testWriteChannelExistingBlob() throws IOException { private void doJsonUnexpectedEOFTest(int contentSize, int cappedByteCount) throws IOException { String blobPath = String.format("%s/%s/blob", generator.randomObjectName(), NOW_STRING); - BucketInfo bucketInfo = BucketInfo.of(dataGeneration.getBucketName()); + BucketInfo bucketInfo = BucketInfo.of(generator.randomBucketName()); BlobInfo blobInfoGen0 = BlobInfo.newBuilder(bucketInfo, blobPath, 0L).build(); RetryTestResource retryTestResource = @@ -225,7 +221,7 @@ private void doJsonUnexpectedEOFTest(int contentSize, int cappedByteCount) throw testStorage.create(bucketInfo); - ByteBuffer content = dataGeneration.randByteBuffer(contentSize); + ByteBuffer content = DataGenerator.base64Characters().genByteBuffer(contentSize); // create a duplicate to preserve the initial offset and limit for assertion later ByteBuffer expected = content.duplicate(); @@ -260,13 +256,13 @@ private void blobWriteChannel_handlesRecoveryOnLastChunkWhenGenerationIsPresent( DateTimeFormatter formatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME.withZone(ZoneId.from(ZoneOffset.UTC)); String nowString = formatter.format(now); - BucketInfo bucketInfo = BucketInfo.of(dataGeneration.getBucketName()); + BucketInfo bucketInfo = BucketInfo.of(generator.randomBucketName()); String blobPath = String.format("%s/%s/blob", generator.randomObjectName(), nowString); - BlobId blobId = BlobId.of(dataGeneration.getBucketName(), blobPath); + BlobId blobId = BlobId.of(bucketInfo.getName(), blobPath); BlobInfo blobInfo = BlobInfo.newBuilder(blobId).build(); - ByteBuffer contentGen1 = dataGeneration.randByteBuffer(contentSize); - ByteBuffer contentGen2 = dataGeneration.randByteBuffer(contentSize); + ByteBuffer contentGen1 = DataGenerator.base64Characters().genByteBuffer(contentSize); + ByteBuffer contentGen2 = DataGenerator.base64Characters().genByteBuffer(contentSize); ByteBuffer contentGen2Expected = contentGen2.duplicate(); HttpStorageOptions baseStorageOptions = StorageOptions.http() @@ -302,7 +298,6 @@ private void blobWriteChannel_handlesRecoveryOnLastChunkWhenGenerationIsPresent( * 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( diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBucketLifecycleRulesTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBucketLifecycleRulesTest.java index d7f14d8282..6c0ff8f727 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBucketLifecycleRulesTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBucketLifecycleRulesTest.java @@ -47,6 +47,7 @@ public final class ITBucketLifecycleRulesTest { @Inject public Storage storage; @Test + @CrossRun.Ignore(transports = Transport.GRPC) // todo(b/270215524) public void deleteRule_addingALabelToABucketWithASingleDeleteRuleOnlyModifiesTheLabels() throws Exception { LifecycleRule d1 = @@ -89,6 +90,7 @@ public void condition_ageDays_0_shouldWork() throws Exception { } @Test + @CrossRun.Ignore(transports = Transport.GRPC) // todo(b/270215524) public void deleteRule_modifyingLifecycleRulesMatchesLastOperation() throws Exception { BucketInfo info; { diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBucketLifecycleTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBucketLifecycleTest.java index 7ffbbbf156..0248753963 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBucketLifecycleTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBucketLifecycleTest.java @@ -126,6 +126,7 @@ public void testGetBucketAbortMPULifecycle() throws Exception { } @Test + @CrossRun.Ignore(transports = Transport.GRPC) // todo(b/270215524) public void testDeleteLifecycleRules() throws Exception { String bucketName = generator.randomBucketName(); BucketInfo bucketInfo = diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBucketTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBucketTest.java index b16e0c3b30..ad12ed5484 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBucketTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBucketTest.java @@ -25,6 +25,7 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import com.google.api.gax.paging.Page; import com.google.cloud.Policy; import com.google.cloud.storage.Blob; import com.google.cloud.storage.BlobInfo; @@ -38,10 +39,12 @@ import com.google.cloud.storage.Storage; import com.google.cloud.storage.Storage.BlobField; import com.google.cloud.storage.Storage.BucketField; +import com.google.cloud.storage.Storage.BucketListOption; import com.google.cloud.storage.Storage.BucketTargetOption; import com.google.cloud.storage.TransportCompatibility.Transport; import com.google.cloud.storage.it.runner.StorageITRunner; import com.google.cloud.storage.it.runner.annotations.Backend; +import com.google.cloud.storage.it.runner.annotations.BucketFixture; import com.google.cloud.storage.it.runner.annotations.BucketType; import com.google.cloud.storage.it.runner.annotations.CrossRun; import com.google.cloud.storage.it.runner.annotations.Inject; @@ -52,9 +55,9 @@ import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Collections; -import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.stream.StreamSupport; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -71,39 +74,26 @@ public class ITBucketTest { private static final Duration RETENTION_DURATION = Duration.ofSeconds(5); @Inject - @com.google.cloud.storage.it.runner.annotations.BucketFixture(BucketType.DEFAULT) + @BucketFixture(BucketType.DEFAULT) public BucketInfo bucket; @Inject - @com.google.cloud.storage.it.runner.annotations.BucketFixture(BucketType.REQUESTER_PAYS) + @BucketFixture(BucketType.REQUESTER_PAYS) public BucketInfo requesterPaysBucket; @Inject public Storage storage; @Inject public Generator generator; - @Test(timeout = 5000) - public void testListBuckets() throws InterruptedException { - Iterator bucketIterator = - storage - .list( - Storage.BucketListOption.prefix(bucket.getName()), - Storage.BucketListOption.fields()) - .iterateAll() - .iterator(); - while (!bucketIterator.hasNext()) { - Thread.sleep(500); - bucketIterator = - storage - .list( - Storage.BucketListOption.prefix(bucket.getName()), - Storage.BucketListOption.fields()) - .iterateAll() - .iterator(); - } - while (bucketIterator.hasNext()) { - Bucket remoteBucket = bucketIterator.next(); - assertTrue(remoteBucket.getName().startsWith(bucket.getName())); - } + @Test + public void testListBuckets() { + Page page = + storage.list( + BucketListOption.prefix(bucket.getName()), BucketListOption.fields(BucketField.NAME)); + ImmutableList bucketNames = + StreamSupport.stream(page.iterateAll().spliterator(), false) + .map(BucketInfo::getName) + .collect(ImmutableList.toImmutableList()); + assertThat(bucketNames).contains(bucket.getName()); } @Test @@ -158,6 +148,7 @@ public void testBucketCustomPlacmentConfigDualRegion() throws Exception { } @Test + @CrossRun.Ignore(transports = Transport.GRPC) // todo(b/270215524) public void testBucketLogging() throws Exception { String logsBucketName = generator.randomBucketName(); String loggingBucketName = generator.randomBucketName(); @@ -199,6 +190,7 @@ public void testBucketLogging() throws Exception { } @Test + @CrossRun.Ignore(transports = Transport.GRPC) // todo(b/270215524) public void testRemoveBucketCORS() { String bucketName = generator.randomBucketName(); List origins = ImmutableList.of(Cors.Origin.of("http://cloud.google.com")); @@ -247,6 +239,7 @@ public void testRemoveBucketCORS() { } @Test + @CrossRun.Ignore(transports = Transport.GRPC) // todo(b/270215524) public void testRpoConfig() { String rpoBucket = generator.randomBucketName(); try { @@ -269,6 +262,7 @@ public void testRetentionPolicyLock() { } @Test + @CrossRun.Ignore(transports = Transport.GRPC) // todo(b/270215524) public void testRetentionPolicyLockRequesterPays() { retentionPolicyLockRequesterPays(true); } @@ -396,6 +390,7 @@ public void testEnableDisableBucketDefaultEventBasedHold() { } @Test + @CrossRun.Ignore(transports = Transport.GRPC) // todo(b/270215524) public void testCreateBucketWithAutoclass() { String bucketName = generator.randomBucketName(); storage.create( diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITKmsTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITKmsTest.java index 5e325a1ae9..48f0304150 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITKmsTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITKmsTest.java @@ -31,7 +31,6 @@ import com.google.cloud.storage.Bucket; import com.google.cloud.storage.BucketInfo; import com.google.cloud.storage.CopyWriter; -import com.google.cloud.storage.DataGeneration; import com.google.cloud.storage.Storage; import com.google.cloud.storage.Storage.BlobField; import com.google.cloud.storage.StorageException; @@ -47,9 +46,7 @@ import java.io.IOException; import java.nio.ByteBuffer; import java.security.Key; -import java.util.Random; import javax.crypto.spec.SecretKeySpec; -import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @@ -59,9 +56,6 @@ backends = Backend.PROD) public class ITKmsTest { - private static final long seed = -7071346537822433445L; - @Rule public final DataGeneration dataGeneration = new DataGeneration(new Random(seed)); - private static final byte[] BLOB_BYTE_CONTENT = {0xD, 0xE, 0xA, 0xD}; private static final String BLOB_STRING_CONTENT = "Hello Google Cloud Storage!"; private static final String BASE64_KEY = "JVzfVl8NLD9FjedFuStegjRfES5ll5zc59CIXw572OA="; @@ -75,6 +69,7 @@ public class ITKmsTest { @Inject public KmsFixture kms; @Test + @CrossRun.Ignore(transports = Transport.GRPC) // todo(b/270215524) public void testClearBucketDefaultKmsKeyName() { String bucketName = generator.randomBucketName(); Bucket remoteBucket = @@ -93,6 +88,7 @@ public void testClearBucketDefaultKmsKeyName() { } @Test + @CrossRun.Ignore(transports = Transport.GRPC) // todo(b/270215524) public void testUpdateBucketDefaultKmsKeyName() { String bucketName = generator.randomBucketName(); Bucket remoteBucket = diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITNestedUpdateMaskTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITNestedUpdateMaskTest.java index 8e3b944d99..04a767ae6a 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITNestedUpdateMaskTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITNestedUpdateMaskTest.java @@ -113,6 +113,7 @@ public ImmutableList parameters() { } @Test + @CrossRun.Ignore(transports = Transport.GRPC) // todo(b/270215524) public void testBucketLabels() throws Exception { BucketInfo bucket = newBucketInfo(param.initial); try (TemporaryBucket tempB = @@ -125,6 +126,7 @@ public void testBucketLabels() throws Exception { } @Test + @CrossRun.Ignore(transports = Transport.GRPC) // todo(b/270215524) public void testBlobMetadata() { BlobInfo blob = newBlobInfo(param.initial); Blob gen1 = storage.create(blob, BlobTargetOption.doesNotExist()); diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITObjectTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITObjectTest.java index f2afbb2db8..b210427028 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITObjectTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITObjectTest.java @@ -571,6 +571,7 @@ public void testListBlobsMultiplePages() { } @Test + @CrossRun.Ignore(transports = Transport.GRPC) // todo(b/270215524) public void testUpdateBlob() { String blobName = "test-update-blob"; BlobInfo blob = BlobInfo.newBuilder(bucket, blobName).build(); @@ -584,6 +585,7 @@ public void testUpdateBlob() { } @Test + @CrossRun.Ignore(transports = Transport.GRPC) // todo(b/270215524) public void testUpdateBlobReplaceMetadata() { String blobName = "test-update-blob-replace-metadata"; ImmutableMap metadata = ImmutableMap.of("k1", "a"); @@ -605,6 +607,7 @@ public void testUpdateBlobReplaceMetadata() { } @Test + @CrossRun.Ignore(transports = Transport.GRPC) // todo(b/270215524) public void testUpdateBlobMergeMetadata() { String blobName = "test-update-blob-merge-metadata"; ImmutableMap metadata = ImmutableMap.of("k1", "a"); @@ -625,6 +628,7 @@ public void testUpdateBlobMergeMetadata() { } @Test + @CrossRun.Ignore(transports = Transport.GRPC) // todo(b/270215524) public void testUpdateBlobUnsetMetadata() { String blobName = "test-update-blob-unset-metadata"; @@ -1260,6 +1264,7 @@ public void testEnableDisableTemporaryHold() { } @Test + @CrossRun.Ignore(transports = Transport.GRPC) // todo(b/270215524) public void testAttemptObjectDeleteWithEventBasedHold() { String blobName = generator.randomObjectName(); BlobInfo blobInfo = BlobInfo.newBuilder(bucket, blobName).setEventBasedHold(true).build(); @@ -1276,6 +1281,7 @@ public void testAttemptObjectDeleteWithEventBasedHold() { } @Test + @CrossRun.Ignore(transports = Transport.GRPC) // todo(b/270215524) public void testAttemptDeletionObjectTemporaryHold() { String blobName = generator.randomObjectName(); BlobInfo blobInfo = BlobInfo.newBuilder(bucket, blobName).setTemporaryHold(true).build(); @@ -1404,6 +1410,7 @@ public void testAutoContentTypeWriter() throws IOException { } @Test + @CrossRun.Ignore(transports = Transport.GRPC) // todo(b/270215524) public void testBlobTimeStorageClassUpdated() { String blobName = generator.randomObjectName(); diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITQuotaProjectIdTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITQuotaProjectIdTest.java new file mode 100644 index 0000000000..9a1a9fc159 --- /dev/null +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITQuotaProjectIdTest.java @@ -0,0 +1,159 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.storage.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assume.assumeTrue; + +import com.google.api.gax.paging.Page; +import com.google.auth.oauth2.GoogleCredentials; +import com.google.cloud.storage.Blob; +import com.google.cloud.storage.BucketInfo; +import com.google.cloud.storage.Storage; +import com.google.cloud.storage.Storage.BlobListOption; +import com.google.cloud.storage.StorageOptions; +import com.google.cloud.storage.TransportCompatibility.Transport; +import com.google.cloud.storage.it.runner.StorageITRunner; +import com.google.cloud.storage.it.runner.annotations.Backend; +import com.google.cloud.storage.it.runner.annotations.BucketFixture; +import com.google.cloud.storage.it.runner.annotations.BucketType; +import com.google.cloud.storage.it.runner.annotations.CrossRun; +import com.google.cloud.storage.it.runner.annotations.Inject; +import com.google.cloud.storage.it.runner.registry.ObjectsFixture; +import java.util.stream.StreamSupport; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; + +@RunWith(StorageITRunner.class) +@CrossRun( + backends = Backend.PROD, + transports = {Transport.HTTP, Transport.GRPC}) +public final class ITQuotaProjectIdTest { + // a project number to a dev project which is not used for CI + // this value is the negative case, and points to a project which doesn't have access to the + // bucket used here. + private static final String BAD_PROJECT_ID = "954355001984"; + + @Inject public Storage storage; + + @Inject + @BucketFixture(BucketType.REQUESTER_PAYS) + public BucketInfo bucket; + + // make sure there is an object in the bucket to be listed + @Inject + @BucketFixture(BucketType.REQUESTER_PAYS) + public ObjectsFixture objectsFixture; + + private StorageOptions baseOptions; + private String projectId; + private GoogleCredentials credentials; + + @Before + public void setUp() throws Exception { + baseOptions = storage.getOptions(); + assumeTrue( + "These tests require GoogleCredentials", + baseOptions.getCredentials() instanceof GoogleCredentials); + credentials = (GoogleCredentials) baseOptions.getCredentials(); + projectId = baseOptions.getProjectId(); + } + + /* + * UserProject precedence + * 1. Method userProject Option + * 2. ServiceOptions.getQuotaProjectId() + * 3. Credentials.quota_project_id + */ + + @Test + public void fromCredentials() throws Exception { + StorageOptions build = + baseOptions + .toBuilder() + .setCredentials(credentialsWithQuotaProjectId(credentials, projectId)) + .build(); + + try (Storage s = build.getService()) { + Page page = s.list(bucket.getName()); + assertPage(page); + } + } + + @Test + public void methodOptionOverCredentials() throws Exception { + StorageOptions build = + baseOptions + .toBuilder() + .setCredentials(credentialsWithQuotaProjectId(credentials, BAD_PROJECT_ID)) + .build(); + + try (Storage s = build.getService()) { + Page page = s.list(bucket.getName(), BlobListOption.userProject(projectId)); + assertPage(page); + } + } + + @Test + public void fromServiceOptionParameter() throws Exception { + StorageOptions build = baseOptions.toBuilder().setQuotaProjectId(projectId).build(); + + try (Storage s = build.getService()) { + Page page = s.list(bucket.getName()); + assertPage(page); + } + } + + @Test + public void serviceOptionParameterOverCredentials() throws Exception { + StorageOptions build = + baseOptions + .toBuilder() + .setCredentials(credentialsWithQuotaProjectId(credentials, BAD_PROJECT_ID)) + .setQuotaProjectId(projectId) + .build(); + + try (Storage s = build.getService()) { + Page page = s.list(bucket.getName()); + assertPage(page); + } + } + + @Test + public void methodOptionOverServiceOptionParameter() throws Exception { + StorageOptions build = baseOptions.toBuilder().setQuotaProjectId(BAD_PROJECT_ID).build(); + + try (Storage s = build.getService()) { + Page page = s.list(bucket.getName(), BlobListOption.userProject(projectId)); + assertPage(page); + } + } + + private void assertPage(Page page) { + boolean info1InResults = + StreamSupport.stream(page.iterateAll().spliterator(), false) + .map(Blob::getName) + .anyMatch(objectsFixture.getInfo1().getName()::equals); + assertThat(info1InResults).isTrue(); + } + + private GoogleCredentials credentialsWithQuotaProjectId( + GoogleCredentials creds, String quotaProjectId) { + return creds.toBuilder().setQuotaProjectId(quotaProjectId).build(); + } +} diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/StorageNativeCanary.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/StorageNativeCanary.java new file mode 100644 index 0000000000..534764d9b1 --- /dev/null +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/StorageNativeCanary.java @@ -0,0 +1,182 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.storage.it; + +import static com.google.cloud.storage.TestUtils.assertAll; +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.gax.paging.Page; +import com.google.cloud.ReadChannel; +import com.google.cloud.WriteChannel; +import com.google.cloud.storage.Blob; +import com.google.cloud.storage.BlobId; +import com.google.cloud.storage.BlobInfo; +import com.google.cloud.storage.BucketInfo; +import com.google.cloud.storage.DataGenerator; +import com.google.cloud.storage.Storage; +import com.google.cloud.storage.Storage.BlobListOption; +import com.google.cloud.storage.Storage.BlobSourceOption; +import com.google.cloud.storage.Storage.BlobWriteOption; +import com.google.cloud.storage.StorageOptions; +import com.google.common.collect.ImmutableList; +import com.google.common.io.ByteStreams; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.channels.Channels; +import java.nio.channels.WritableByteChannel; +import java.util.List; +import java.util.UUID; +import org.junit.Test; + +// Intentionally avoid StorageITRunner here. It touches lots of code at a semi-static level making +// native-test have a hard time. +public final class StorageNativeCanary { + + private static final int _256KiB = 256 * 1024; + private static final byte[] bytes = DataGenerator.base64Characters().genBytes(512 * 1024); + + @Test + public void canary_happyPath_http() throws Exception { + assertBehaviorOfPrimaryStorageActions(StorageOptions.http().build().getService()); + } + + @Test + public void canary_happyPath_grpc() throws Exception { + assertBehaviorOfPrimaryStorageActions(StorageOptions.grpc().build().getService()); + } + + /** + * When testing on Native Image, we're primarily wanting to verify the primary code paths are + * properly detected by the native image compiler. + * + *

For Storage, we have a few "primary code paths" we want to ensure are validated: + * + *

    + *
  • Can a (Unary) Request Succeed? + *
  • Can a (ServerStream) Object Read Request Succeed? + *
  • Can a (ClientStream) Object Write Request Succeed? + *
  • Can a (Page over Unary) Paginated Request Succeed? + *
+ * + * To validate this, our happy path test is as follows: + * + *
    + *
  • Create a temporary bucket (Unary) + *
  • Insert two (2) objects (Unary, ServerStream) + *
  • List all objects, using a pageSize of 1 (Page over Unary) + *
  • Read all bytes of each object (ServerStream) + *
  • Delete each object (Unary) + *
  • Delete temporary bucket (Unary) + *
+ */ + private static void assertBehaviorOfPrimaryStorageActions(Storage storage) throws Exception { + // create a temporary bucket + try (TemporaryBucket temporaryBucket = + TemporaryBucket.newBuilder() + .setStorage(storage) + .setBucketInfo(BucketInfo.of("java-storage-grpc-" + UUID.randomUUID())) + .build()) { + String bucketName = temporaryBucket.getBucket().getName(); + String obj1Name = UUID.randomUUID().toString(); + String obj2Name = UUID.randomUUID().toString(); + + // insert 2 objects + BlobInfo info1 = BlobInfo.newBuilder(bucketName, obj1Name).build(); + BlobInfo info2 = BlobInfo.newBuilder(bucketName, obj2Name).build(); + uploadUsingWriter(storage, info1); + uploadUsingWriter(storage, info2); + + // list objects + Page page = storage.list(bucketName, BlobListOption.pageSize(1)); + List blobs = ImmutableList.copyOf(page.iterateAll()); + + // read all bytes of each object + List actual = + blobs.stream() + .map(info -> readAll(storage, info)) + .collect(ImmutableList.toImmutableList()); + + List deletes = + blobs.stream() + .map(b -> storage.delete(b.getBlobId(), BlobSourceOption.generationMatch())) + .collect(ImmutableList.toImmutableList()); + + assertAll( + () -> { + List actualNames = + actual.stream() + .map(BlobWithContent::getInfo) + .map(BlobInfo::getBlobId) + .map(BlobId::getName) + .collect(ImmutableList.toImmutableList()); + + assertThat(actualNames).containsExactly(info1.getName(), info2.getName()); + }, + () -> assertThat(actual.get(0).getContent()).isEqualTo(bytes), + () -> assertThat(actual.get(1).getContent()).isEqualTo(bytes), + () -> assertThat(deletes.get(0)).isTrue(), + () -> assertThat(deletes.get(1)).isTrue()); + } + } + + private static void uploadUsingWriter(Storage storage, BlobInfo info) throws IOException { + try (WriteChannel writeChannel = storage.writer(info, BlobWriteOption.doesNotExist())) { + // set our size to the smallest resumable size, so we can send multiple requests + writeChannel.setChunkSize(_256KiB); + ByteStreams.copy(Channels.newChannel(new ByteArrayInputStream(bytes)), writeChannel); + } + } + + private static BlobWithContent readAll(Storage storage, BlobInfo info) { + try (ReadChannel readChannel = + storage.reader(info.getBlobId(), BlobSourceOption.generationMatch()); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + WritableByteChannel writeChannel = Channels.newChannel(outputStream)) { + // only buffer up to half the object + readChannel.setChunkSize(_256KiB); + ByteStreams.copy(readChannel, writeChannel); + return new BlobWithContent(info, outputStream.toByteArray()); + } catch (IOException e) { + throw new RuntimeIOException(e); + } + } + + private static final class BlobWithContent { + private final BlobInfo info; + private final byte[] content; + + private BlobWithContent(BlobInfo info, byte[] content) { + this.info = info; + this.content = content; + } + + public BlobInfo getInfo() { + return info; + } + + public byte[] getContent() { + return content; + } + } + + private static final class RuntimeIOException extends RuntimeException { + private RuntimeIOException(IOException cause) { + super(cause); + } + } +} diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/BackendResources.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/BackendResources.java index 3f37bb3cdb..5f307c7616 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/BackendResources.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/BackendResources.java @@ -47,6 +47,7 @@ private BackendResources( TestRunScopedInstance bucket, TestRunScopedInstance bucketRequesterPays, TestRunScopedInstance objectsFixture, + TestRunScopedInstance objectsFixtureRequesterPays, TestRunScopedInstance kmsFixture) { this.backend = backend; this.protectedBucketNames = protectedBucketNames; @@ -63,8 +64,14 @@ private BackendResources( backendIs(backend).and(isRequesterPaysBucket())), RegistryEntry.of( 7, BucketInfo.class, bucket, backendIs(backend).and(isDefaultBucket())), - RegistryEntry.of(8, ObjectsFixture.class, objectsFixture, backendIs(backend)), - RegistryEntry.of(9, KmsFixture.class, kmsFixture, backendIs(backend))); + RegistryEntry.of( + 8, ObjectsFixture.class, objectsFixture, backendIs(backend).and(isDefaultBucket())), + RegistryEntry.of( + 9, + ObjectsFixture.class, + objectsFixtureRequesterPays, + backendIs(backend).and(isRequesterPaysBucket())), + RegistryEntry.of(10, KmsFixture.class, kmsFixture, backendIs(backend))); } public ImmutableList> getRegistryEntries() { @@ -141,6 +148,11 @@ static BackendResources of(Backend backend) { TestRunScopedInstance.of( "OBJECTS_FIXTURE_" + backend.name(), () -> new ObjectsFixture(storageJson.get().getStorage(), bucket.get().getBucketInfo())); + TestRunScopedInstance objectsFixtureRequesterPays = + TestRunScopedInstance.of( + "OBJECTS_FIXTURE_REQUESTER_PAYS_" + backend.name(), + () -> + new ObjectsFixture(storageJson.get().getStorage(), bucketRp.get().getBucketInfo())); TestRunScopedInstance kmsFixture = TestRunScopedInstance.of( "KMS_FIXTURE_" + backend.name(), () -> KmsFixture.of(storageJson.get().getStorage())); @@ -153,6 +165,7 @@ static BackendResources of(Backend backend) { bucket, bucketRp, objectsFixture, + objectsFixtureRequesterPays, kmsFixture); } } diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/ObjectsFixture.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/ObjectsFixture.java index 6ba70b09f0..ed9e4428b7 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/ObjectsFixture.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/ObjectsFixture.java @@ -22,6 +22,7 @@ import com.google.cloud.storage.BucketInfo; import com.google.cloud.storage.DataGenerator; import com.google.cloud.storage.Storage; +import com.google.cloud.storage.Storage.BlobGetOption; import com.google.cloud.storage.Storage.BlobTargetOption; import com.google.cloud.storage.Storage.ComposeRequest; import com.google.cloud.storage.it.ChecksummedTestContent; @@ -34,6 +35,9 @@ public final class ObjectsFixture implements ManagedLifecycle { private final Storage s; private final BucketInfo bucket; + private final BlobTargetOption[] blobTargetOptions; + private final BlobGetOption[] blobGetOptions; + private BlobInfo info1; private BlobInfo info2; private BlobInfo info3; @@ -43,6 +47,21 @@ public final class ObjectsFixture implements ManagedLifecycle { ObjectsFixture(Storage s, BucketInfo bucket) { this.s = s; this.bucket = bucket; + boolean isRequesterPays = Boolean.TRUE.equals(bucket.requesterPays()); + String projectId = s.getOptions().getProjectId(); + if (isRequesterPays) { + blobTargetOptions = + new BlobTargetOption[] { + BlobTargetOption.doesNotExist(), BlobTargetOption.userProject(projectId) + }; + } else { + blobTargetOptions = new BlobTargetOption[] {BlobTargetOption.doesNotExist()}; + } + if (isRequesterPays) { + blobGetOptions = new BlobGetOption[] {BlobGetOption.userProject(projectId)}; + } else { + blobGetOptions = new BlobGetOption[] {}; + } } @Override @@ -83,41 +102,38 @@ public void start() { BlobInfo info2 = BlobInfo.newBuilder(blobId2).setMetadata(ImmutableMap.of("pow", "2")).build(); BlobInfo info3 = BlobInfo.newBuilder(blobId3).setMetadata(ImmutableMap.of("pow", "3")).build(); BlobInfo info4 = BlobInfo.newBuilder(blobId4).setMetadata(ImmutableMap.of("pow", "4")).build(); - s.create(info1, "A".getBytes(StandardCharsets.UTF_8), BlobTargetOption.doesNotExist()); + s.create(info1, "A".getBytes(StandardCharsets.UTF_8), blobTargetOptions); ComposeRequest c2 = ComposeRequest.newBuilder() .addSource(blobId1.getName(), blobId1.getName()) .setTarget(info2) - .setTargetOptions(BlobTargetOption.doesNotExist()) + .setTargetOptions(blobTargetOptions) .build(); ComposeRequest c3 = ComposeRequest.newBuilder() .addSource(blobId2.getName(), blobId2.getName()) .setTarget(info3) - .setTargetOptions(BlobTargetOption.doesNotExist()) + .setTargetOptions(blobTargetOptions) .build(); ComposeRequest c4 = ComposeRequest.newBuilder() .addSource(blobId3.getName(), blobId3.getName()) .setTarget(info4) - .setTargetOptions(BlobTargetOption.doesNotExist()) + .setTargetOptions(blobTargetOptions) .build(); s.compose(c2); s.compose(c3); s.compose(c4); - this.info1 = s.get(blobId1).asBlobInfo(); - this.info2 = s.get(blobId2).asBlobInfo(); - this.info3 = s.get(blobId3).asBlobInfo(); - this.info4 = s.get(blobId4).asBlobInfo(); + this.info1 = s.get(blobId1, blobGetOptions).asBlobInfo(); + this.info2 = s.get(blobId2, blobGetOptions).asBlobInfo(); + this.info3 = s.get(blobId3, blobGetOptions).asBlobInfo(); + this.info4 = s.get(blobId4, blobGetOptions).asBlobInfo(); byte[] bytes = DataGenerator.base64Characters().genBytes(512 * 1024); Blob obj512KiB = - s.create( - BlobInfo.newBuilder(bucket, "obj512KiB").build(), - bytes, - BlobTargetOption.doesNotExist()); + s.create(BlobInfo.newBuilder(bucket, "obj512KiB").build(), bytes, blobTargetOptions); this.obj512KiB = new ObjectAndContent(obj512KiB.asBlobInfo(), ChecksummedTestContent.of(bytes)); } diff --git a/google-cloud-storage/src/test/resources/META-INF/native-image/com/google/cloud/storage/native-image.properties b/google-cloud-storage/src/test/resources/META-INF/native-image/com/google/cloud/storage/native-image.properties index 0bb3e83ecc..dd22e6513f 100644 --- a/google-cloud-storage/src/test/resources/META-INF/native-image/com/google/cloud/storage/native-image.properties +++ b/google-cloud-storage/src/test/resources/META-INF/native-image/com/google/cloud/storage/native-image.properties @@ -5,29 +5,4 @@ # build time. Initializing these classes explicitly at build time results in a # successful build. Args = \ - --initialize-at-build-time=com.google.cloud.conformance.storage.v1,\ - com.google.protobuf,\ - com.google.auth.oauth2,\ - com.google.cloud.storage.conformance.retry,\ - com.google.common.base.Charsets,\ - com.google.gson.stream.JsonReader,\ - com.google.api.client.util,\ - com.google.api.client.http.javanet.NetHttpTransport,\ - com.google.api.client.http.HttpTransport,\ - com.google.api.client.json.JsonParser$1,\ - com.google.api.client.json.gson.GsonParser$1,\ - com.google.common.io.BaseEncoding,\ - com.google.common.math.IntMath$1,\ - com.google.common.collect.Platform,\ - com.google.gson.Gson,\ - com.google.common.truth,\ - com.google.common.collect,\ - com.google.gson.internal.reflect,\ - com.google.gson.internal.bind,\ - com.google.gson.internal,\ - com.google.gson.internal.sql.SqlTypesSupport,\ - com.google.gson.FieldNamingPolicy$3,\ - com.google.gson.LongSerializationPolicy$2,\ - net.jqwik - - + --initialize-at-build-time=net.jqwik diff --git a/google-cloud-storage/src/test/resources/META-INF/native-image/com/google/cloud/storage/reflect-config.json b/google-cloud-storage/src/test/resources/META-INF/native-image/com/google/cloud/storage/reflect-config.json index 06d0837d78..3076bc85fe 100644 --- a/google-cloud-storage/src/test/resources/META-INF/native-image/com/google/cloud/storage/reflect-config.json +++ b/google-cloud-storage/src/test/resources/META-INF/native-image/com/google/cloud/storage/reflect-config.json @@ -14,9 +14,4 @@ "allDeclaredFields":true, "allDeclaredMethods":true, "methods":[{"name":"","parameterTypes":[] }]} -, -{ - "name":"com.google.cloud.storage.conformance.retry.TestBench$RetryTestResource", - "allDeclaredFields":true, - "methods":[{"name":"","parameterTypes":[] }]} ] diff --git a/grpc-google-cloud-storage-v2/clirr-ignored-differences.xml b/grpc-google-cloud-storage-v2/clirr-ignored-differences.xml new file mode 100644 index 0000000000..64d400bda1 --- /dev/null +++ b/grpc-google-cloud-storage-v2/clirr-ignored-differences.xml @@ -0,0 +1,10 @@ + + + + + + 7002 + com/google/storage/v2/* + * *Notification*(*) + + diff --git a/grpc-google-cloud-storage-v2/pom.xml b/grpc-google-cloud-storage-v2/pom.xml index 7f4524dba7..0ea53a8f5a 100644 --- a/grpc-google-cloud-storage-v2/pom.xml +++ b/grpc-google-cloud-storage-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-storage-v2 - 2.17.2-alpha-SNAPSHOT + 2.20.1-alpha grpc-google-cloud-storage-v2 GRPC library for grpc-google-cloud-storage-v2 com.google.cloud google-cloud-storage-parent - 2.17.2-SNAPSHOT + 2.20.1 diff --git a/grpc-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageGrpc.java b/grpc-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageGrpc.java index d55f766cdf..88d497aa4f 100644 --- a/grpc-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageGrpc.java +++ b/grpc-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageGrpc.java @@ -417,171 +417,194 @@ private StorageGrpc() {} } private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.DeleteNotificationRequest, com.google.protobuf.Empty> - getDeleteNotificationMethod; + com.google.storage.v2.DeleteNotificationConfigRequest, com.google.protobuf.Empty> + getDeleteNotificationConfigMethod; @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "DeleteNotification", - requestType = com.google.storage.v2.DeleteNotificationRequest.class, + fullMethodName = SERVICE_NAME + '/' + "DeleteNotificationConfig", + requestType = com.google.storage.v2.DeleteNotificationConfigRequest.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() { + com.google.storage.v2.DeleteNotificationConfigRequest, com.google.protobuf.Empty> + getDeleteNotificationConfigMethod() { io.grpc.MethodDescriptor< - com.google.storage.v2.DeleteNotificationRequest, com.google.protobuf.Empty> - getDeleteNotificationMethod; - if ((getDeleteNotificationMethod = StorageGrpc.getDeleteNotificationMethod) == null) { + com.google.storage.v2.DeleteNotificationConfigRequest, com.google.protobuf.Empty> + getDeleteNotificationConfigMethod; + if ((getDeleteNotificationConfigMethod = StorageGrpc.getDeleteNotificationConfigMethod) + == null) { synchronized (StorageGrpc.class) { - if ((getDeleteNotificationMethod = StorageGrpc.getDeleteNotificationMethod) == null) { - StorageGrpc.getDeleteNotificationMethod = - getDeleteNotificationMethod = + if ((getDeleteNotificationConfigMethod = StorageGrpc.getDeleteNotificationConfigMethod) + == null) { + StorageGrpc.getDeleteNotificationConfigMethod = + getDeleteNotificationConfigMethod = io.grpc.MethodDescriptor - . + . newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteNotification")) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteNotificationConfig")) .setSampledToLocalTracing(true) .setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.DeleteNotificationRequest.getDefaultInstance())) + com.google.storage.v2.DeleteNotificationConfigRequest + .getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( com.google.protobuf.Empty.getDefaultInstance())) .setSchemaDescriptor( - new StorageMethodDescriptorSupplier("DeleteNotification")) + new StorageMethodDescriptorSupplier("DeleteNotificationConfig")) .build(); } } } - return getDeleteNotificationMethod; + return getDeleteNotificationConfigMethod; } private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.GetNotificationRequest, com.google.storage.v2.Notification> - getGetNotificationMethod; + com.google.storage.v2.GetNotificationConfigRequest, + com.google.storage.v2.NotificationConfig> + getGetNotificationConfigMethod; @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetNotification", - requestType = com.google.storage.v2.GetNotificationRequest.class, - responseType = com.google.storage.v2.Notification.class, + fullMethodName = SERVICE_NAME + '/' + "GetNotificationConfig", + requestType = com.google.storage.v2.GetNotificationConfigRequest.class, + responseType = com.google.storage.v2.NotificationConfig.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor< - com.google.storage.v2.GetNotificationRequest, com.google.storage.v2.Notification> - getGetNotificationMethod() { + com.google.storage.v2.GetNotificationConfigRequest, + com.google.storage.v2.NotificationConfig> + getGetNotificationConfigMethod() { io.grpc.MethodDescriptor< - com.google.storage.v2.GetNotificationRequest, com.google.storage.v2.Notification> - getGetNotificationMethod; - if ((getGetNotificationMethod = StorageGrpc.getGetNotificationMethod) == null) { + com.google.storage.v2.GetNotificationConfigRequest, + com.google.storage.v2.NotificationConfig> + getGetNotificationConfigMethod; + if ((getGetNotificationConfigMethod = StorageGrpc.getGetNotificationConfigMethod) == null) { synchronized (StorageGrpc.class) { - if ((getGetNotificationMethod = StorageGrpc.getGetNotificationMethod) == null) { - StorageGrpc.getGetNotificationMethod = - getGetNotificationMethod = + if ((getGetNotificationConfigMethod = StorageGrpc.getGetNotificationConfigMethod) == null) { + StorageGrpc.getGetNotificationConfigMethod = + getGetNotificationConfigMethod = io.grpc.MethodDescriptor - . + . newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetNotification")) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetNotificationConfig")) .setSampledToLocalTracing(true) .setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.GetNotificationRequest.getDefaultInstance())) + com.google.storage.v2.GetNotificationConfigRequest + .getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.Notification.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("GetNotification")) + com.google.storage.v2.NotificationConfig.getDefaultInstance())) + .setSchemaDescriptor( + new StorageMethodDescriptorSupplier("GetNotificationConfig")) .build(); } } } - return getGetNotificationMethod; + return getGetNotificationConfigMethod; } private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.CreateNotificationRequest, com.google.storage.v2.Notification> - getCreateNotificationMethod; + com.google.storage.v2.CreateNotificationConfigRequest, + com.google.storage.v2.NotificationConfig> + getCreateNotificationConfigMethod; @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "CreateNotification", - requestType = com.google.storage.v2.CreateNotificationRequest.class, - responseType = com.google.storage.v2.Notification.class, + fullMethodName = SERVICE_NAME + '/' + "CreateNotificationConfig", + requestType = com.google.storage.v2.CreateNotificationConfigRequest.class, + responseType = com.google.storage.v2.NotificationConfig.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor< - com.google.storage.v2.CreateNotificationRequest, com.google.storage.v2.Notification> - getCreateNotificationMethod() { + com.google.storage.v2.CreateNotificationConfigRequest, + com.google.storage.v2.NotificationConfig> + getCreateNotificationConfigMethod() { io.grpc.MethodDescriptor< - com.google.storage.v2.CreateNotificationRequest, com.google.storage.v2.Notification> - getCreateNotificationMethod; - if ((getCreateNotificationMethod = StorageGrpc.getCreateNotificationMethod) == null) { + com.google.storage.v2.CreateNotificationConfigRequest, + com.google.storage.v2.NotificationConfig> + getCreateNotificationConfigMethod; + if ((getCreateNotificationConfigMethod = StorageGrpc.getCreateNotificationConfigMethod) + == null) { synchronized (StorageGrpc.class) { - if ((getCreateNotificationMethod = StorageGrpc.getCreateNotificationMethod) == null) { - StorageGrpc.getCreateNotificationMethod = - getCreateNotificationMethod = + if ((getCreateNotificationConfigMethod = StorageGrpc.getCreateNotificationConfigMethod) + == null) { + StorageGrpc.getCreateNotificationConfigMethod = + getCreateNotificationConfigMethod = io.grpc.MethodDescriptor - . + . newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateNotification")) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateNotificationConfig")) .setSampledToLocalTracing(true) .setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.CreateNotificationRequest.getDefaultInstance())) + com.google.storage.v2.CreateNotificationConfigRequest + .getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.Notification.getDefaultInstance())) + com.google.storage.v2.NotificationConfig.getDefaultInstance())) .setSchemaDescriptor( - new StorageMethodDescriptorSupplier("CreateNotification")) + new StorageMethodDescriptorSupplier("CreateNotificationConfig")) .build(); } } } - return getCreateNotificationMethod; + return getCreateNotificationConfigMethod; } private static volatile io.grpc.MethodDescriptor< - com.google.storage.v2.ListNotificationsRequest, - com.google.storage.v2.ListNotificationsResponse> - getListNotificationsMethod; + com.google.storage.v2.ListNotificationConfigsRequest, + com.google.storage.v2.ListNotificationConfigsResponse> + getListNotificationConfigsMethod; @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListNotifications", - requestType = com.google.storage.v2.ListNotificationsRequest.class, - responseType = com.google.storage.v2.ListNotificationsResponse.class, + fullMethodName = SERVICE_NAME + '/' + "ListNotificationConfigs", + requestType = com.google.storage.v2.ListNotificationConfigsRequest.class, + responseType = com.google.storage.v2.ListNotificationConfigsResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor< - com.google.storage.v2.ListNotificationsRequest, - com.google.storage.v2.ListNotificationsResponse> - getListNotificationsMethod() { + com.google.storage.v2.ListNotificationConfigsRequest, + com.google.storage.v2.ListNotificationConfigsResponse> + getListNotificationConfigsMethod() { io.grpc.MethodDescriptor< - com.google.storage.v2.ListNotificationsRequest, - com.google.storage.v2.ListNotificationsResponse> - getListNotificationsMethod; - if ((getListNotificationsMethod = StorageGrpc.getListNotificationsMethod) == null) { + com.google.storage.v2.ListNotificationConfigsRequest, + com.google.storage.v2.ListNotificationConfigsResponse> + getListNotificationConfigsMethod; + if ((getListNotificationConfigsMethod = StorageGrpc.getListNotificationConfigsMethod) == null) { synchronized (StorageGrpc.class) { - if ((getListNotificationsMethod = StorageGrpc.getListNotificationsMethod) == null) { - StorageGrpc.getListNotificationsMethod = - getListNotificationsMethod = + if ((getListNotificationConfigsMethod = StorageGrpc.getListNotificationConfigsMethod) + == null) { + StorageGrpc.getListNotificationConfigsMethod = + getListNotificationConfigsMethod = io.grpc.MethodDescriptor - . + . newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListNotifications")) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListNotificationConfigs")) .setSampledToLocalTracing(true) .setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.ListNotificationsRequest.getDefaultInstance())) + com.google.storage.v2.ListNotificationConfigsRequest + .getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( - com.google.storage.v2.ListNotificationsResponse.getDefaultInstance())) - .setSchemaDescriptor(new StorageMethodDescriptorSupplier("ListNotifications")) + com.google.storage.v2.ListNotificationConfigsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new StorageMethodDescriptorSupplier("ListNotificationConfigs")) .build(); } } } - return getListNotificationsMethod; + return getListNotificationConfigsMethod; } private static volatile io.grpc.MethodDescriptor< @@ -1496,60 +1519,60 @@ public void updateBucket( * * *
-     * Permanently deletes a notification subscription.
+     * Permanently deletes a NotificationConfig.
      * 
*/ - public void deleteNotification( - com.google.storage.v2.DeleteNotificationRequest request, + public void deleteNotificationConfig( + com.google.storage.v2.DeleteNotificationConfigRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getDeleteNotificationMethod(), responseObserver); + getDeleteNotificationConfigMethod(), responseObserver); } /** * * *
-     * View a notification config.
+     * View a NotificationConfig.
      * 
*/ - public void getNotification( - com.google.storage.v2.GetNotificationRequest request, - io.grpc.stub.StreamObserver responseObserver) { + public void getNotificationConfig( + com.google.storage.v2.GetNotificationConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getGetNotificationMethod(), responseObserver); + getGetNotificationConfigMethod(), 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.
+     * Creates a NotificationConfig for a given bucket.
+     * These NotificationConfigs, 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) { + public void createNotificationConfig( + com.google.storage.v2.CreateNotificationConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getCreateNotificationMethod(), responseObserver); + getCreateNotificationConfigMethod(), responseObserver); } /** * * *
-     * Retrieves a list of notification subscriptions for a given bucket.
+     * Retrieves a list of NotificationConfigs for a given bucket.
      * 
*/ - public void listNotifications( - com.google.storage.v2.ListNotificationsRequest request, - io.grpc.stub.StreamObserver + public void listNotificationConfigs( + com.google.storage.v2.ListNotificationConfigsRequest request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getListNotificationsMethod(), responseObserver); + getListNotificationConfigsMethod(), responseObserver); } /** @@ -1679,8 +1702,9 @@ public void updateObject( * returned `persisted_size`; in this case, the service will skip data at * offsets that were already persisted (without checking that it matches * the previously written data), and write only the data starting from the - * persisted offset. This behavior can make client-side handling simpler - * in some cases. + * persisted offset. Even though the data isn't written, it may still + * incur a performance cost over resuming at the correct write offset. + * This behavior can make client-side handling simpler in some cases. * 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 @@ -1911,30 +1935,32 @@ public final io.grpc.ServerServiceDefinition bindService() { com.google.storage.v2.UpdateBucketRequest, com.google.storage.v2.Bucket>( this, METHODID_UPDATE_BUCKET))) .addMethod( - getDeleteNotificationMethod(), + getDeleteNotificationConfigMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< - com.google.storage.v2.DeleteNotificationRequest, com.google.protobuf.Empty>( - this, METHODID_DELETE_NOTIFICATION))) + com.google.storage.v2.DeleteNotificationConfigRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_NOTIFICATION_CONFIG))) .addMethod( - getGetNotificationMethod(), + getGetNotificationConfigMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< - com.google.storage.v2.GetNotificationRequest, - com.google.storage.v2.Notification>(this, METHODID_GET_NOTIFICATION))) + com.google.storage.v2.GetNotificationConfigRequest, + com.google.storage.v2.NotificationConfig>( + this, METHODID_GET_NOTIFICATION_CONFIG))) .addMethod( - getCreateNotificationMethod(), + getCreateNotificationConfigMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< - com.google.storage.v2.CreateNotificationRequest, - com.google.storage.v2.Notification>(this, METHODID_CREATE_NOTIFICATION))) + com.google.storage.v2.CreateNotificationConfigRequest, + com.google.storage.v2.NotificationConfig>( + this, METHODID_CREATE_NOTIFICATION_CONFIG))) .addMethod( - getListNotificationsMethod(), + getListNotificationConfigsMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< - com.google.storage.v2.ListNotificationsRequest, - com.google.storage.v2.ListNotificationsResponse>( - this, METHODID_LIST_NOTIFICATIONS))) + com.google.storage.v2.ListNotificationConfigsRequest, + com.google.storage.v2.ListNotificationConfigsResponse>( + this, METHODID_LIST_NOTIFICATION_CONFIGS))) .addMethod( getComposeObjectMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -2235,14 +2261,14 @@ public void updateBucket( * * *
-     * Permanently deletes a notification subscription.
+     * Permanently deletes a NotificationConfig.
      * 
*/ - public void deleteNotification( - com.google.storage.v2.DeleteNotificationRequest request, + public void deleteNotificationConfig( + com.google.storage.v2.DeleteNotificationConfigRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeleteNotificationMethod(), getCallOptions()), + getChannel().newCall(getDeleteNotificationConfigMethod(), getCallOptions()), request, responseObserver); } @@ -2251,14 +2277,14 @@ public void deleteNotification( * * *
-     * View a notification config.
+     * View a NotificationConfig.
      * 
*/ - public void getNotification( - com.google.storage.v2.GetNotificationRequest request, - io.grpc.stub.StreamObserver responseObserver) { + public void getNotificationConfig( + com.google.storage.v2.GetNotificationConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetNotificationMethod(), getCallOptions()), + getChannel().newCall(getGetNotificationConfigMethod(), getCallOptions()), request, responseObserver); } @@ -2267,17 +2293,17 @@ public void getNotification( * * *
-     * 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.
+     * Creates a NotificationConfig for a given bucket.
+     * These NotificationConfigs, 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) { + public void createNotificationConfig( + com.google.storage.v2.CreateNotificationConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreateNotificationMethod(), getCallOptions()), + getChannel().newCall(getCreateNotificationConfigMethod(), getCallOptions()), request, responseObserver); } @@ -2286,15 +2312,15 @@ public void createNotification( * * *
-     * Retrieves a list of notification subscriptions for a given bucket.
+     * Retrieves a list of NotificationConfigs for a given bucket.
      * 
*/ - public void listNotifications( - com.google.storage.v2.ListNotificationsRequest request, - io.grpc.stub.StreamObserver + public void listNotificationConfigs( + com.google.storage.v2.ListNotificationConfigsRequest request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListNotificationsMethod(), getCallOptions()), + getChannel().newCall(getListNotificationConfigsMethod(), getCallOptions()), request, responseObserver); } @@ -2436,8 +2462,9 @@ public void updateObject( * returned `persisted_size`; in this case, the service will skip data at * offsets that were already persisted (without checking that it matches * the previously written data), and write only the data starting from the - * persisted offset. This behavior can make client-side handling simpler - * in some cases. + * persisted offset. Even though the data isn't written, it may still + * incur a performance cost over resuming at the correct write offset. + * This behavior can make client-side handling simpler in some cases. * 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 @@ -2792,55 +2819,55 @@ public com.google.storage.v2.Bucket updateBucket( * * *
-     * Permanently deletes a notification subscription.
+     * Permanently deletes a NotificationConfig.
      * 
*/ - public com.google.protobuf.Empty deleteNotification( - com.google.storage.v2.DeleteNotificationRequest request) { + public com.google.protobuf.Empty deleteNotificationConfig( + com.google.storage.v2.DeleteNotificationConfigRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeleteNotificationMethod(), getCallOptions(), request); + getChannel(), getDeleteNotificationConfigMethod(), getCallOptions(), request); } /** * * *
-     * View a notification config.
+     * View a NotificationConfig.
      * 
*/ - public com.google.storage.v2.Notification getNotification( - com.google.storage.v2.GetNotificationRequest request) { + public com.google.storage.v2.NotificationConfig getNotificationConfig( + com.google.storage.v2.GetNotificationConfigRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetNotificationMethod(), getCallOptions(), request); + getChannel(), getGetNotificationConfigMethod(), 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.
+     * Creates a NotificationConfig for a given bucket.
+     * These NotificationConfigs, 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) { + public com.google.storage.v2.NotificationConfig createNotificationConfig( + com.google.storage.v2.CreateNotificationConfigRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCreateNotificationMethod(), getCallOptions(), request); + getChannel(), getCreateNotificationConfigMethod(), getCallOptions(), request); } /** * * *
-     * Retrieves a list of notification subscriptions for a given bucket.
+     * Retrieves a list of NotificationConfigs for a given bucket.
      * 
*/ - public com.google.storage.v2.ListNotificationsResponse listNotifications( - com.google.storage.v2.ListNotificationsRequest request) { + public com.google.storage.v2.ListNotificationConfigsResponse listNotificationConfigs( + com.google.storage.v2.ListNotificationConfigsRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListNotificationsMethod(), getCallOptions(), request); + getChannel(), getListNotificationConfigsMethod(), getCallOptions(), request); } /** @@ -3235,56 +3262,58 @@ protected StorageFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c * * *
-     * Permanently deletes a notification subscription.
+     * Permanently deletes a NotificationConfig.
      * 
*/ public com.google.common.util.concurrent.ListenableFuture - deleteNotification(com.google.storage.v2.DeleteNotificationRequest request) { + deleteNotificationConfig(com.google.storage.v2.DeleteNotificationConfigRequest request) { return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDeleteNotificationMethod(), getCallOptions()), request); + getChannel().newCall(getDeleteNotificationConfigMethod(), getCallOptions()), request); } /** * * *
-     * View a notification config.
+     * View a NotificationConfig.
      * 
*/ - public com.google.common.util.concurrent.ListenableFuture - getNotification(com.google.storage.v2.GetNotificationRequest request) { + public com.google.common.util.concurrent.ListenableFuture< + com.google.storage.v2.NotificationConfig> + getNotificationConfig(com.google.storage.v2.GetNotificationConfigRequest request) { return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetNotificationMethod(), getCallOptions()), request); + getChannel().newCall(getGetNotificationConfigMethod(), 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.
+     * Creates a NotificationConfig for a given bucket.
+     * These NotificationConfigs, 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) { + public com.google.common.util.concurrent.ListenableFuture< + com.google.storage.v2.NotificationConfig> + createNotificationConfig(com.google.storage.v2.CreateNotificationConfigRequest request) { return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCreateNotificationMethod(), getCallOptions()), request); + getChannel().newCall(getCreateNotificationConfigMethod(), getCallOptions()), request); } /** * * *
-     * Retrieves a list of notification subscriptions for a given bucket.
+     * Retrieves a list of NotificationConfigs for a given bucket.
      * 
*/ public com.google.common.util.concurrent.ListenableFuture< - com.google.storage.v2.ListNotificationsResponse> - listNotifications(com.google.storage.v2.ListNotificationsRequest request) { + com.google.storage.v2.ListNotificationConfigsResponse> + listNotificationConfigs(com.google.storage.v2.ListNotificationConfigsRequest request) { return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListNotificationsMethod(), getCallOptions()), request); + getChannel().newCall(getListNotificationConfigsMethod(), getCallOptions()), request); } /** @@ -3514,10 +3543,10 @@ protected StorageFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c 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_DELETE_NOTIFICATION_CONFIG = 9; + private static final int METHODID_GET_NOTIFICATION_CONFIG = 10; + private static final int METHODID_CREATE_NOTIFICATION_CONFIG = 11; + private static final int METHODID_LIST_NOTIFICATION_CONFIGS = 12; private static final int METHODID_COMPOSE_OBJECT = 13; private static final int METHODID_DELETE_OBJECT = 14; private static final int METHODID_CANCEL_RESUMABLE_WRITE = 15; @@ -3600,25 +3629,27 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.storage.v2.UpdateBucketRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; - case METHODID_DELETE_NOTIFICATION: - serviceImpl.deleteNotification( - (com.google.storage.v2.DeleteNotificationRequest) request, + case METHODID_DELETE_NOTIFICATION_CONFIG: + serviceImpl.deleteNotificationConfig( + (com.google.storage.v2.DeleteNotificationConfigRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; - case METHODID_GET_NOTIFICATION: - serviceImpl.getNotification( - (com.google.storage.v2.GetNotificationRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); + case METHODID_GET_NOTIFICATION_CONFIG: + serviceImpl.getNotificationConfig( + (com.google.storage.v2.GetNotificationConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); break; - case METHODID_CREATE_NOTIFICATION: - serviceImpl.createNotification( - (com.google.storage.v2.CreateNotificationRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); + case METHODID_CREATE_NOTIFICATION_CONFIG: + serviceImpl.createNotificationConfig( + (com.google.storage.v2.CreateNotificationConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); break; - case METHODID_LIST_NOTIFICATIONS: - serviceImpl.listNotifications( - (com.google.storage.v2.ListNotificationsRequest) request, - (io.grpc.stub.StreamObserver) + case METHODID_LIST_NOTIFICATION_CONFIGS: + serviceImpl.listNotificationConfigs( + (com.google.storage.v2.ListNotificationConfigsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_COMPOSE_OBJECT: @@ -3787,10 +3818,10 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getSetIamPolicyMethod()) .addMethod(getTestIamPermissionsMethod()) .addMethod(getUpdateBucketMethod()) - .addMethod(getDeleteNotificationMethod()) - .addMethod(getGetNotificationMethod()) - .addMethod(getCreateNotificationMethod()) - .addMethod(getListNotificationsMethod()) + .addMethod(getDeleteNotificationConfigMethod()) + .addMethod(getGetNotificationConfigMethod()) + .addMethod(getCreateNotificationConfigMethod()) + .addMethod(getListNotificationConfigsMethod()) .addMethod(getComposeObjectMethod()) .addMethod(getDeleteObjectMethod()) .addMethod(getCancelResumableWriteMethod()) diff --git a/pom.xml b/pom.xml index 2b53714189..7307b6a826 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-storage-parent pom - 2.17.2-SNAPSHOT + 2.20.1 Storage Parent https://github.com/googleapis/java-storage @@ -54,7 +54,7 @@ UTF-8 github google-cloud-storage-parent - 3.1.2 + 3.4.0 @@ -70,7 +70,7 @@ com.google.cloud google-cloud-storage - 2.17.2-SNAPSHOT + 2.20.1 com.google.apis @@ -80,7 +80,7 @@ com.google.cloud google-cloud-pubsub - 1.123.0 + 1.123.4 test @@ -111,17 +111,17 @@ com.google.api.grpc proto-google-cloud-storage-v2 - 2.17.2-alpha-SNAPSHOT + 2.20.1-alpha com.google.api.grpc grpc-google-cloud-storage-v2 - 2.17.2-alpha-SNAPSHOT + 2.20.1-alpha com.google.api.grpc gapic-google-cloud-storage-v2 - 2.17.2-alpha-SNAPSHOT + 2.20.1-alpha com.google.cloud diff --git a/proto-google-cloud-storage-v2/clirr-ignored-differences.xml b/proto-google-cloud-storage-v2/clirr-ignored-differences.xml index 41c35b7976..a46a701fe4 100644 --- a/proto-google-cloud-storage-v2/clirr-ignored-differences.xml +++ b/proto-google-cloud-storage-v2/clirr-ignored-differences.xml @@ -14,4 +14,11 @@ * *ObjectChecksums*(*) + + + 8001 + com/google/storage/v2/*Notification* + + + diff --git a/proto-google-cloud-storage-v2/pom.xml b/proto-google-cloud-storage-v2/pom.xml index ac4742dc96..3b711263c0 100644 --- a/proto-google-cloud-storage-v2/pom.xml +++ b/proto-google-cloud-storage-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-storage-v2 - 2.17.2-alpha-SNAPSHOT + 2.20.1-alpha proto-google-cloud-storage-v2 PROTO library for proto-google-cloud-storage-v2 com.google.cloud google-cloud-storage-parent - 2.17.2-SNAPSHOT + 2.20.1 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/CreateNotificationConfigRequest.java similarity index 60% rename from proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateNotificationRequest.java rename to proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateNotificationConfigRequest.java index 4d6480e7be..27c92fdb30 100644 --- 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/CreateNotificationConfigRequest.java @@ -22,29 +22,30 @@ * * *
- * Request message for CreateNotification.
+ * Request message for CreateNotificationConfig.
  * 
* - * Protobuf type {@code google.storage.v2.CreateNotificationRequest} + * Protobuf type {@code google.storage.v2.CreateNotificationConfigRequest} */ -public final class CreateNotificationRequest extends com.google.protobuf.GeneratedMessageV3 +public final class CreateNotificationConfigRequest extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.storage.v2.CreateNotificationRequest) - CreateNotificationRequestOrBuilder { + // @@protoc_insertion_point(message_implements:google.storage.v2.CreateNotificationConfigRequest) + CreateNotificationConfigRequestOrBuilder { private static final long serialVersionUID = 0L; - // Use CreateNotificationRequest.newBuilder() to construct. - private CreateNotificationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use CreateNotificationConfigRequest.newBuilder() to construct. + private CreateNotificationConfigRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private CreateNotificationRequest() { + private CreateNotificationConfigRequest() { parent_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CreateNotificationRequest(); + return new CreateNotificationConfigRequest(); } @java.lang.Override @@ -54,17 +55,17 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateNotificationRequest_descriptor; + .internal_static_google_storage_v2_CreateNotificationConfigRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateNotificationRequest_fieldAccessorTable + .internal_static_google_storage_v2_CreateNotificationConfigRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.storage.v2.CreateNotificationRequest.class, - com.google.storage.v2.CreateNotificationRequest.Builder.class); + com.google.storage.v2.CreateNotificationConfigRequest.class, + com.google.storage.v2.CreateNotificationConfigRequest.Builder.class); } public static final int PARENT_FIELD_NUMBER = 1; @@ -75,7 +76,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The bucket to which this notification belongs.
+   * Required. The bucket to which this NotificationConfig belongs.
    * 
* * @@ -100,7 +101,7 @@ public java.lang.String getParent() { * * *
-   * Required. The bucket to which this notification belongs.
+   * Required. The bucket to which this NotificationConfig belongs.
    * 
* * @@ -122,60 +123,60 @@ public com.google.protobuf.ByteString getParentBytes() { } } - public static final int NOTIFICATION_FIELD_NUMBER = 2; - private com.google.storage.v2.Notification notification_; + public static final int NOTIFICATION_CONFIG_FIELD_NUMBER = 2; + private com.google.storage.v2.NotificationConfig notificationConfig_; /** * * *
-   * Required. Properties of the notification to be inserted.
+   * Required. Properties of the NotificationConfig to be inserted.
    * 
* * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.storage.v2.NotificationConfig notification_config = 2 [(.google.api.field_behavior) = REQUIRED]; * * - * @return Whether the notification field is set. + * @return Whether the notificationConfig field is set. */ @java.lang.Override - public boolean hasNotification() { - return notification_ != null; + public boolean hasNotificationConfig() { + return notificationConfig_ != null; } /** * * *
-   * Required. Properties of the notification to be inserted.
+   * Required. Properties of the NotificationConfig to be inserted.
    * 
* * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.storage.v2.NotificationConfig notification_config = 2 [(.google.api.field_behavior) = REQUIRED]; * * - * @return The notification. + * @return The notificationConfig. */ @java.lang.Override - public com.google.storage.v2.Notification getNotification() { - return notification_ == null - ? com.google.storage.v2.Notification.getDefaultInstance() - : notification_; + public com.google.storage.v2.NotificationConfig getNotificationConfig() { + return notificationConfig_ == null + ? com.google.storage.v2.NotificationConfig.getDefaultInstance() + : notificationConfig_; } /** * * *
-   * Required. Properties of the notification to be inserted.
+   * Required. Properties of the NotificationConfig to be inserted.
    * 
* * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.storage.v2.NotificationConfig notification_config = 2 [(.google.api.field_behavior) = REQUIRED]; * */ @java.lang.Override - public com.google.storage.v2.NotificationOrBuilder getNotificationOrBuilder() { - return notification_ == null - ? com.google.storage.v2.Notification.getDefaultInstance() - : notification_; + public com.google.storage.v2.NotificationConfigOrBuilder getNotificationConfigOrBuilder() { + return notificationConfig_ == null + ? com.google.storage.v2.NotificationConfig.getDefaultInstance() + : notificationConfig_; } private byte memoizedIsInitialized = -1; @@ -195,8 +196,8 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); } - if (notification_ != null) { - output.writeMessage(2, getNotification()); + if (notificationConfig_ != null) { + output.writeMessage(2, getNotificationConfig()); } getUnknownFields().writeTo(output); } @@ -210,8 +211,8 @@ public int getSerializedSize() { 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()); + if (notificationConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getNotificationConfig()); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -223,16 +224,16 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.google.storage.v2.CreateNotificationRequest)) { + if (!(obj instanceof com.google.storage.v2.CreateNotificationConfigRequest)) { return super.equals(obj); } - com.google.storage.v2.CreateNotificationRequest other = - (com.google.storage.v2.CreateNotificationRequest) obj; + com.google.storage.v2.CreateNotificationConfigRequest other = + (com.google.storage.v2.CreateNotificationConfigRequest) obj; if (!getParent().equals(other.getParent())) return false; - if (hasNotification() != other.hasNotification()) return false; - if (hasNotification()) { - if (!getNotification().equals(other.getNotification())) return false; + if (hasNotificationConfig() != other.hasNotificationConfig()) return false; + if (hasNotificationConfig()) { + if (!getNotificationConfig().equals(other.getNotificationConfig())) return false; } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; @@ -247,80 +248,80 @@ public int hashCode() { 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(); + if (hasNotificationConfig()) { + hash = (37 * hash) + NOTIFICATION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getNotificationConfig().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } - public static com.google.storage.v2.CreateNotificationRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.google.storage.v2.CreateNotificationConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.storage.v2.CreateNotificationRequest parseFrom( + public static com.google.storage.v2.CreateNotificationConfigRequest 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( + public static com.google.storage.v2.CreateNotificationConfigRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.storage.v2.CreateNotificationRequest parseFrom( + public static com.google.storage.v2.CreateNotificationConfigRequest 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) + public static com.google.storage.v2.CreateNotificationConfigRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.storage.v2.CreateNotificationRequest parseFrom( + public static com.google.storage.v2.CreateNotificationConfigRequest 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 { + public static com.google.storage.v2.CreateNotificationConfigRequest 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( + public static com.google.storage.v2.CreateNotificationConfigRequest 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( + public static com.google.storage.v2.CreateNotificationConfigRequest 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( + public static com.google.storage.v2.CreateNotificationConfigRequest 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( + public static com.google.storage.v2.CreateNotificationConfigRequest 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( + public static com.google.storage.v2.CreateNotificationConfigRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -337,7 +338,8 @@ public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.google.storage.v2.CreateNotificationRequest prototype) { + public static Builder newBuilder( + com.google.storage.v2.CreateNotificationConfigRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -355,31 +357,31 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Request message for CreateNotification.
+   * Request message for CreateNotificationConfig.
    * 
* - * Protobuf type {@code google.storage.v2.CreateNotificationRequest} + * Protobuf type {@code google.storage.v2.CreateNotificationConfigRequest} */ 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 { + // @@protoc_insertion_point(builder_implements:google.storage.v2.CreateNotificationConfigRequest) + com.google.storage.v2.CreateNotificationConfigRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateNotificationRequest_descriptor; + .internal_static_google_storage_v2_CreateNotificationConfigRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateNotificationRequest_fieldAccessorTable + .internal_static_google_storage_v2_CreateNotificationConfigRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.storage.v2.CreateNotificationRequest.class, - com.google.storage.v2.CreateNotificationRequest.Builder.class); + com.google.storage.v2.CreateNotificationConfigRequest.class, + com.google.storage.v2.CreateNotificationConfigRequest.Builder.class); } - // Construct using com.google.storage.v2.CreateNotificationRequest.newBuilder() + // Construct using com.google.storage.v2.CreateNotificationConfigRequest.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { @@ -391,10 +393,10 @@ public Builder clear() { super.clear(); bitField0_ = 0; parent_ = ""; - notification_ = null; - if (notificationBuilder_ != null) { - notificationBuilder_.dispose(); - notificationBuilder_ = null; + notificationConfig_ = null; + if (notificationConfigBuilder_ != null) { + notificationConfigBuilder_.dispose(); + notificationConfigBuilder_ = null; } return this; } @@ -402,17 +404,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_CreateNotificationRequest_descriptor; + .internal_static_google_storage_v2_CreateNotificationConfigRequest_descriptor; } @java.lang.Override - public com.google.storage.v2.CreateNotificationRequest getDefaultInstanceForType() { - return com.google.storage.v2.CreateNotificationRequest.getDefaultInstance(); + public com.google.storage.v2.CreateNotificationConfigRequest getDefaultInstanceForType() { + return com.google.storage.v2.CreateNotificationConfigRequest.getDefaultInstance(); } @java.lang.Override - public com.google.storage.v2.CreateNotificationRequest build() { - com.google.storage.v2.CreateNotificationRequest result = buildPartial(); + public com.google.storage.v2.CreateNotificationConfigRequest build() { + com.google.storage.v2.CreateNotificationConfigRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -420,9 +422,9 @@ public com.google.storage.v2.CreateNotificationRequest build() { } @java.lang.Override - public com.google.storage.v2.CreateNotificationRequest buildPartial() { - com.google.storage.v2.CreateNotificationRequest result = - new com.google.storage.v2.CreateNotificationRequest(this); + public com.google.storage.v2.CreateNotificationConfigRequest buildPartial() { + com.google.storage.v2.CreateNotificationConfigRequest result = + new com.google.storage.v2.CreateNotificationConfigRequest(this); if (bitField0_ != 0) { buildPartial0(result); } @@ -430,14 +432,16 @@ public com.google.storage.v2.CreateNotificationRequest buildPartial() { return result; } - private void buildPartial0(com.google.storage.v2.CreateNotificationRequest result) { + private void buildPartial0(com.google.storage.v2.CreateNotificationConfigRequest result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.parent_ = parent_; } if (((from_bitField0_ & 0x00000002) != 0)) { - result.notification_ = - notificationBuilder_ == null ? notification_ : notificationBuilder_.build(); + result.notificationConfig_ = + notificationConfigBuilder_ == null + ? notificationConfig_ + : notificationConfigBuilder_.build(); } } @@ -476,24 +480,24 @@ public Builder addRepeatedField( @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); + if (other instanceof com.google.storage.v2.CreateNotificationConfigRequest) { + return mergeFrom((com.google.storage.v2.CreateNotificationConfigRequest) other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.google.storage.v2.CreateNotificationRequest other) { - if (other == com.google.storage.v2.CreateNotificationRequest.getDefaultInstance()) + public Builder mergeFrom(com.google.storage.v2.CreateNotificationConfigRequest other) { + if (other == com.google.storage.v2.CreateNotificationConfigRequest.getDefaultInstance()) return this; if (!other.getParent().isEmpty()) { parent_ = other.parent_; bitField0_ |= 0x00000001; onChanged(); } - if (other.hasNotification()) { - mergeNotification(other.getNotification()); + if (other.hasNotificationConfig()) { + mergeNotificationConfig(other.getNotificationConfig()); } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); @@ -529,7 +533,8 @@ public Builder mergeFrom( } // case 10 case 18: { - input.readMessage(getNotificationFieldBuilder().getBuilder(), extensionRegistry); + input.readMessage( + getNotificationConfigFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000002; break; } // case 18 @@ -557,7 +562,7 @@ public Builder mergeFrom( * * *
-     * Required. The bucket to which this notification belongs.
+     * Required. The bucket to which this NotificationConfig belongs.
      * 
* * @@ -581,7 +586,7 @@ public java.lang.String getParent() { * * *
-     * Required. The bucket to which this notification belongs.
+     * Required. The bucket to which this NotificationConfig belongs.
      * 
* * @@ -605,7 +610,7 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-     * Required. The bucket to which this notification belongs.
+     * Required. The bucket to which this NotificationConfig belongs.
      * 
* * @@ -628,7 +633,7 @@ public Builder setParent(java.lang.String value) { * * *
-     * Required. The bucket to which this notification belongs.
+     * Required. The bucket to which this NotificationConfig belongs.
      * 
* * @@ -647,7 +652,7 @@ public Builder clearParent() { * * *
-     * Required. The bucket to which this notification belongs.
+     * Required. The bucket to which this NotificationConfig belongs.
      * 
* * @@ -668,69 +673,69 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { return this; } - private com.google.storage.v2.Notification notification_; + private com.google.storage.v2.NotificationConfig notificationConfig_; private com.google.protobuf.SingleFieldBuilderV3< - com.google.storage.v2.Notification, - com.google.storage.v2.Notification.Builder, - com.google.storage.v2.NotificationOrBuilder> - notificationBuilder_; + com.google.storage.v2.NotificationConfig, + com.google.storage.v2.NotificationConfig.Builder, + com.google.storage.v2.NotificationConfigOrBuilder> + notificationConfigBuilder_; /** * * *
-     * Required. Properties of the notification to be inserted.
+     * Required. Properties of the NotificationConfig to be inserted.
      * 
* * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.storage.v2.NotificationConfig notification_config = 2 [(.google.api.field_behavior) = REQUIRED]; * * - * @return Whether the notification field is set. + * @return Whether the notificationConfig field is set. */ - public boolean hasNotification() { + public boolean hasNotificationConfig() { return ((bitField0_ & 0x00000002) != 0); } /** * * *
-     * Required. Properties of the notification to be inserted.
+     * Required. Properties of the NotificationConfig to be inserted.
      * 
* * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.storage.v2.NotificationConfig notification_config = 2 [(.google.api.field_behavior) = REQUIRED]; * * - * @return The notification. + * @return The notificationConfig. */ - public com.google.storage.v2.Notification getNotification() { - if (notificationBuilder_ == null) { - return notification_ == null - ? com.google.storage.v2.Notification.getDefaultInstance() - : notification_; + public com.google.storage.v2.NotificationConfig getNotificationConfig() { + if (notificationConfigBuilder_ == null) { + return notificationConfig_ == null + ? com.google.storage.v2.NotificationConfig.getDefaultInstance() + : notificationConfig_; } else { - return notificationBuilder_.getMessage(); + return notificationConfigBuilder_.getMessage(); } } /** * * *
-     * Required. Properties of the notification to be inserted.
+     * Required. Properties of the NotificationConfig to be inserted.
      * 
* * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.storage.v2.NotificationConfig notification_config = 2 [(.google.api.field_behavior) = REQUIRED]; * */ - public Builder setNotification(com.google.storage.v2.Notification value) { - if (notificationBuilder_ == null) { + public Builder setNotificationConfig(com.google.storage.v2.NotificationConfig value) { + if (notificationConfigBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - notification_ = value; + notificationConfig_ = value; } else { - notificationBuilder_.setMessage(value); + notificationConfigBuilder_.setMessage(value); } bitField0_ |= 0x00000002; onChanged(); @@ -740,18 +745,19 @@ public Builder setNotification(com.google.storage.v2.Notification value) { * * *
-     * Required. Properties of the notification to be inserted.
+     * Required. Properties of the NotificationConfig to be inserted.
      * 
* * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.storage.v2.NotificationConfig notification_config = 2 [(.google.api.field_behavior) = REQUIRED]; * */ - public Builder setNotification(com.google.storage.v2.Notification.Builder builderForValue) { - if (notificationBuilder_ == null) { - notification_ = builderForValue.build(); + public Builder setNotificationConfig( + com.google.storage.v2.NotificationConfig.Builder builderForValue) { + if (notificationConfigBuilder_ == null) { + notificationConfig_ = builderForValue.build(); } else { - notificationBuilder_.setMessage(builderForValue.build()); + notificationConfigBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000002; onChanged(); @@ -761,24 +767,25 @@ public Builder setNotification(com.google.storage.v2.Notification.Builder builde * * *
-     * Required. Properties of the notification to be inserted.
+     * Required. Properties of the NotificationConfig to be inserted.
      * 
* * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.storage.v2.NotificationConfig notification_config = 2 [(.google.api.field_behavior) = REQUIRED]; * */ - public Builder mergeNotification(com.google.storage.v2.Notification value) { - if (notificationBuilder_ == null) { + public Builder mergeNotificationConfig(com.google.storage.v2.NotificationConfig value) { + if (notificationConfigBuilder_ == null) { if (((bitField0_ & 0x00000002) != 0) - && notification_ != null - && notification_ != com.google.storage.v2.Notification.getDefaultInstance()) { - getNotificationBuilder().mergeFrom(value); + && notificationConfig_ != null + && notificationConfig_ + != com.google.storage.v2.NotificationConfig.getDefaultInstance()) { + getNotificationConfigBuilder().mergeFrom(value); } else { - notification_ = value; + notificationConfig_ = value; } } else { - notificationBuilder_.mergeFrom(value); + notificationConfigBuilder_.mergeFrom(value); } bitField0_ |= 0x00000002; onChanged(); @@ -788,19 +795,19 @@ public Builder mergeNotification(com.google.storage.v2.Notification value) { * * *
-     * Required. Properties of the notification to be inserted.
+     * Required. Properties of the NotificationConfig to be inserted.
      * 
* * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.storage.v2.NotificationConfig notification_config = 2 [(.google.api.field_behavior) = REQUIRED]; * */ - public Builder clearNotification() { + public Builder clearNotificationConfig() { bitField0_ = (bitField0_ & ~0x00000002); - notification_ = null; - if (notificationBuilder_ != null) { - notificationBuilder_.dispose(); - notificationBuilder_ = null; + notificationConfig_ = null; + if (notificationConfigBuilder_ != null) { + notificationConfigBuilder_.dispose(); + notificationConfigBuilder_ = null; } onChanged(); return this; @@ -809,64 +816,64 @@ public Builder clearNotification() { * * *
-     * Required. Properties of the notification to be inserted.
+     * Required. Properties of the NotificationConfig to be inserted.
      * 
* * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.storage.v2.NotificationConfig notification_config = 2 [(.google.api.field_behavior) = REQUIRED]; * */ - public com.google.storage.v2.Notification.Builder getNotificationBuilder() { + public com.google.storage.v2.NotificationConfig.Builder getNotificationConfigBuilder() { bitField0_ |= 0x00000002; onChanged(); - return getNotificationFieldBuilder().getBuilder(); + return getNotificationConfigFieldBuilder().getBuilder(); } /** * * *
-     * Required. Properties of the notification to be inserted.
+     * Required. Properties of the NotificationConfig to be inserted.
      * 
* * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.storage.v2.NotificationConfig notification_config = 2 [(.google.api.field_behavior) = REQUIRED]; * */ - public com.google.storage.v2.NotificationOrBuilder getNotificationOrBuilder() { - if (notificationBuilder_ != null) { - return notificationBuilder_.getMessageOrBuilder(); + public com.google.storage.v2.NotificationConfigOrBuilder getNotificationConfigOrBuilder() { + if (notificationConfigBuilder_ != null) { + return notificationConfigBuilder_.getMessageOrBuilder(); } else { - return notification_ == null - ? com.google.storage.v2.Notification.getDefaultInstance() - : notification_; + return notificationConfig_ == null + ? com.google.storage.v2.NotificationConfig.getDefaultInstance() + : notificationConfig_; } } /** * * *
-     * Required. Properties of the notification to be inserted.
+     * Required. Properties of the NotificationConfig to be inserted.
      * 
* * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.storage.v2.NotificationConfig notification_config = 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_ = + com.google.storage.v2.NotificationConfig, + com.google.storage.v2.NotificationConfig.Builder, + com.google.storage.v2.NotificationConfigOrBuilder> + getNotificationConfigFieldBuilder() { + if (notificationConfigBuilder_ == null) { + notificationConfigBuilder_ = 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; + com.google.storage.v2.NotificationConfig, + com.google.storage.v2.NotificationConfig.Builder, + com.google.storage.v2.NotificationConfigOrBuilder>( + getNotificationConfig(), getParentForChildren(), isClean()); + notificationConfig_ = null; } - return notificationBuilder_; + return notificationConfigBuilder_; } @java.lang.Override @@ -880,24 +887,24 @@ public final Builder mergeUnknownFields( return super.mergeUnknownFields(unknownFields); } - // @@protoc_insertion_point(builder_scope:google.storage.v2.CreateNotificationRequest) + // @@protoc_insertion_point(builder_scope:google.storage.v2.CreateNotificationConfigRequest) } - // @@protoc_insertion_point(class_scope:google.storage.v2.CreateNotificationRequest) - private static final com.google.storage.v2.CreateNotificationRequest DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:google.storage.v2.CreateNotificationConfigRequest) + private static final com.google.storage.v2.CreateNotificationConfigRequest DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.google.storage.v2.CreateNotificationRequest(); + DEFAULT_INSTANCE = new com.google.storage.v2.CreateNotificationConfigRequest(); } - public static com.google.storage.v2.CreateNotificationRequest getDefaultInstance() { + public static com.google.storage.v2.CreateNotificationConfigRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { @java.lang.Override - public CreateNotificationRequest parsePartialFrom( + public CreateNotificationConfigRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -916,17 +923,17 @@ public CreateNotificationRequest parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.google.storage.v2.CreateNotificationRequest getDefaultInstanceForType() { + public com.google.storage.v2.CreateNotificationConfigRequest 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/CreateNotificationConfigRequestOrBuilder.java similarity index 60% rename from proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateNotificationRequestOrBuilder.java rename to proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CreateNotificationConfigRequestOrBuilder.java index 8c11f9d72f..73344ab699 100644 --- 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/CreateNotificationConfigRequestOrBuilder.java @@ -18,16 +18,16 @@ package com.google.storage.v2; -public interface CreateNotificationRequestOrBuilder +public interface CreateNotificationConfigRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.CreateNotificationRequest) + // @@protoc_insertion_point(interface_extends:google.storage.v2.CreateNotificationConfigRequest) com.google.protobuf.MessageOrBuilder { /** * * *
-   * Required. The bucket to which this notification belongs.
+   * Required. The bucket to which this NotificationConfig belongs.
    * 
* * @@ -41,7 +41,7 @@ public interface CreateNotificationRequestOrBuilder * * *
-   * Required. The bucket to which this notification belongs.
+   * Required. The bucket to which this NotificationConfig belongs.
    * 
* * @@ -56,40 +56,40 @@ public interface CreateNotificationRequestOrBuilder * * *
-   * Required. Properties of the notification to be inserted.
+   * Required. Properties of the NotificationConfig to be inserted.
    * 
* * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.storage.v2.NotificationConfig notification_config = 2 [(.google.api.field_behavior) = REQUIRED]; * * - * @return Whether the notification field is set. + * @return Whether the notificationConfig field is set. */ - boolean hasNotification(); + boolean hasNotificationConfig(); /** * * *
-   * Required. Properties of the notification to be inserted.
+   * Required. Properties of the NotificationConfig to be inserted.
    * 
* * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.storage.v2.NotificationConfig notification_config = 2 [(.google.api.field_behavior) = REQUIRED]; * * - * @return The notification. + * @return The notificationConfig. */ - com.google.storage.v2.Notification getNotification(); + com.google.storage.v2.NotificationConfig getNotificationConfig(); /** * * *
-   * Required. Properties of the notification to be inserted.
+   * Required. Properties of the NotificationConfig to be inserted.
    * 
* * - * .google.storage.v2.Notification notification = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.storage.v2.NotificationConfig notification_config = 2 [(.google.api.field_behavior) = REQUIRED]; * */ - com.google.storage.v2.NotificationOrBuilder getNotificationOrBuilder(); + com.google.storage.v2.NotificationConfigOrBuilder getNotificationConfigOrBuilder(); } 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/DeleteNotificationConfigRequest.java similarity index 76% rename from proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteNotificationRequest.java rename to proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteNotificationConfigRequest.java index 70ef41690b..4b5245c86e 100644 --- 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/DeleteNotificationConfigRequest.java @@ -22,29 +22,30 @@ * * *
- * Request message for DeleteNotification.
+ * Request message for DeleteNotificationConfig.
  * 
* - * Protobuf type {@code google.storage.v2.DeleteNotificationRequest} + * Protobuf type {@code google.storage.v2.DeleteNotificationConfigRequest} */ -public final class DeleteNotificationRequest extends com.google.protobuf.GeneratedMessageV3 +public final class DeleteNotificationConfigRequest extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.storage.v2.DeleteNotificationRequest) - DeleteNotificationRequestOrBuilder { + // @@protoc_insertion_point(message_implements:google.storage.v2.DeleteNotificationConfigRequest) + DeleteNotificationConfigRequestOrBuilder { private static final long serialVersionUID = 0L; - // Use DeleteNotificationRequest.newBuilder() to construct. - private DeleteNotificationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use DeleteNotificationConfigRequest.newBuilder() to construct. + private DeleteNotificationConfigRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private DeleteNotificationRequest() { + private DeleteNotificationConfigRequest() { name_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeleteNotificationRequest(); + return new DeleteNotificationConfigRequest(); } @java.lang.Override @@ -54,17 +55,17 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteNotificationRequest_descriptor; + .internal_static_google_storage_v2_DeleteNotificationConfigRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteNotificationRequest_fieldAccessorTable + .internal_static_google_storage_v2_DeleteNotificationConfigRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.storage.v2.DeleteNotificationRequest.class, - com.google.storage.v2.DeleteNotificationRequest.Builder.class); + com.google.storage.v2.DeleteNotificationConfigRequest.class, + com.google.storage.v2.DeleteNotificationConfigRequest.Builder.class); } public static final int NAME_FIELD_NUMBER = 1; @@ -75,7 +76,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The parent bucket of the notification.
+   * Required. The parent bucket of the NotificationConfig.
    * 
* * @@ -100,7 +101,7 @@ public java.lang.String getName() { * * *
-   * Required. The parent bucket of the notification.
+   * Required. The parent bucket of the NotificationConfig.
    * 
* * @@ -161,11 +162,11 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.google.storage.v2.DeleteNotificationRequest)) { + if (!(obj instanceof com.google.storage.v2.DeleteNotificationConfigRequest)) { return super.equals(obj); } - com.google.storage.v2.DeleteNotificationRequest other = - (com.google.storage.v2.DeleteNotificationRequest) obj; + com.google.storage.v2.DeleteNotificationConfigRequest other = + (com.google.storage.v2.DeleteNotificationConfigRequest) obj; if (!getName().equals(other.getName())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; @@ -186,71 +187,71 @@ public int hashCode() { return hash; } - public static com.google.storage.v2.DeleteNotificationRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.google.storage.v2.DeleteNotificationConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.storage.v2.DeleteNotificationRequest parseFrom( + public static com.google.storage.v2.DeleteNotificationConfigRequest 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( + public static com.google.storage.v2.DeleteNotificationConfigRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.storage.v2.DeleteNotificationRequest parseFrom( + public static com.google.storage.v2.DeleteNotificationConfigRequest 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) + public static com.google.storage.v2.DeleteNotificationConfigRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.storage.v2.DeleteNotificationRequest parseFrom( + public static com.google.storage.v2.DeleteNotificationConfigRequest 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 { + public static com.google.storage.v2.DeleteNotificationConfigRequest 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( + public static com.google.storage.v2.DeleteNotificationConfigRequest 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( + public static com.google.storage.v2.DeleteNotificationConfigRequest 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( + public static com.google.storage.v2.DeleteNotificationConfigRequest 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( + public static com.google.storage.v2.DeleteNotificationConfigRequest 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( + public static com.google.storage.v2.DeleteNotificationConfigRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -267,7 +268,8 @@ public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.google.storage.v2.DeleteNotificationRequest prototype) { + public static Builder newBuilder( + com.google.storage.v2.DeleteNotificationConfigRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -285,31 +287,31 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Request message for DeleteNotification.
+   * Request message for DeleteNotificationConfig.
    * 
* - * Protobuf type {@code google.storage.v2.DeleteNotificationRequest} + * Protobuf type {@code google.storage.v2.DeleteNotificationConfigRequest} */ 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 { + // @@protoc_insertion_point(builder_implements:google.storage.v2.DeleteNotificationConfigRequest) + com.google.storage.v2.DeleteNotificationConfigRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteNotificationRequest_descriptor; + .internal_static_google_storage_v2_DeleteNotificationConfigRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteNotificationRequest_fieldAccessorTable + .internal_static_google_storage_v2_DeleteNotificationConfigRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.storage.v2.DeleteNotificationRequest.class, - com.google.storage.v2.DeleteNotificationRequest.Builder.class); + com.google.storage.v2.DeleteNotificationConfigRequest.class, + com.google.storage.v2.DeleteNotificationConfigRequest.Builder.class); } - // Construct using com.google.storage.v2.DeleteNotificationRequest.newBuilder() + // Construct using com.google.storage.v2.DeleteNotificationConfigRequest.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { @@ -327,17 +329,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_DeleteNotificationRequest_descriptor; + .internal_static_google_storage_v2_DeleteNotificationConfigRequest_descriptor; } @java.lang.Override - public com.google.storage.v2.DeleteNotificationRequest getDefaultInstanceForType() { - return com.google.storage.v2.DeleteNotificationRequest.getDefaultInstance(); + public com.google.storage.v2.DeleteNotificationConfigRequest getDefaultInstanceForType() { + return com.google.storage.v2.DeleteNotificationConfigRequest.getDefaultInstance(); } @java.lang.Override - public com.google.storage.v2.DeleteNotificationRequest build() { - com.google.storage.v2.DeleteNotificationRequest result = buildPartial(); + public com.google.storage.v2.DeleteNotificationConfigRequest build() { + com.google.storage.v2.DeleteNotificationConfigRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -345,9 +347,9 @@ public com.google.storage.v2.DeleteNotificationRequest build() { } @java.lang.Override - public com.google.storage.v2.DeleteNotificationRequest buildPartial() { - com.google.storage.v2.DeleteNotificationRequest result = - new com.google.storage.v2.DeleteNotificationRequest(this); + public com.google.storage.v2.DeleteNotificationConfigRequest buildPartial() { + com.google.storage.v2.DeleteNotificationConfigRequest result = + new com.google.storage.v2.DeleteNotificationConfigRequest(this); if (bitField0_ != 0) { buildPartial0(result); } @@ -355,7 +357,7 @@ public com.google.storage.v2.DeleteNotificationRequest buildPartial() { return result; } - private void buildPartial0(com.google.storage.v2.DeleteNotificationRequest result) { + private void buildPartial0(com.google.storage.v2.DeleteNotificationConfigRequest result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.name_ = name_; @@ -397,16 +399,16 @@ public Builder addRepeatedField( @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); + if (other instanceof com.google.storage.v2.DeleteNotificationConfigRequest) { + return mergeFrom((com.google.storage.v2.DeleteNotificationConfigRequest) other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.google.storage.v2.DeleteNotificationRequest other) { - if (other == com.google.storage.v2.DeleteNotificationRequest.getDefaultInstance()) + public Builder mergeFrom(com.google.storage.v2.DeleteNotificationConfigRequest other) { + if (other == com.google.storage.v2.DeleteNotificationConfigRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; @@ -469,7 +471,7 @@ public Builder mergeFrom( * * *
-     * Required. The parent bucket of the notification.
+     * Required. The parent bucket of the NotificationConfig.
      * 
* * @@ -493,7 +495,7 @@ public java.lang.String getName() { * * *
-     * Required. The parent bucket of the notification.
+     * Required. The parent bucket of the NotificationConfig.
      * 
* * @@ -517,7 +519,7 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * Required. The parent bucket of the notification.
+     * Required. The parent bucket of the NotificationConfig.
      * 
* * @@ -540,7 +542,7 @@ public Builder setName(java.lang.String value) { * * *
-     * Required. The parent bucket of the notification.
+     * Required. The parent bucket of the NotificationConfig.
      * 
* * @@ -559,7 +561,7 @@ public Builder clearName() { * * *
-     * Required. The parent bucket of the notification.
+     * Required. The parent bucket of the NotificationConfig.
      * 
* * @@ -591,24 +593,24 @@ public final Builder mergeUnknownFields( return super.mergeUnknownFields(unknownFields); } - // @@protoc_insertion_point(builder_scope:google.storage.v2.DeleteNotificationRequest) + // @@protoc_insertion_point(builder_scope:google.storage.v2.DeleteNotificationConfigRequest) } - // @@protoc_insertion_point(class_scope:google.storage.v2.DeleteNotificationRequest) - private static final com.google.storage.v2.DeleteNotificationRequest DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:google.storage.v2.DeleteNotificationConfigRequest) + private static final com.google.storage.v2.DeleteNotificationConfigRequest DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.google.storage.v2.DeleteNotificationRequest(); + DEFAULT_INSTANCE = new com.google.storage.v2.DeleteNotificationConfigRequest(); } - public static com.google.storage.v2.DeleteNotificationRequest getDefaultInstance() { + public static com.google.storage.v2.DeleteNotificationConfigRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { @java.lang.Override - public DeleteNotificationRequest parsePartialFrom( + public DeleteNotificationConfigRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -627,17 +629,17 @@ public DeleteNotificationRequest parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.google.storage.v2.DeleteNotificationRequest getDefaultInstanceForType() { + public com.google.storage.v2.DeleteNotificationConfigRequest 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/DeleteNotificationConfigRequestOrBuilder.java similarity index 86% rename from proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteNotificationRequestOrBuilder.java rename to proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/DeleteNotificationConfigRequestOrBuilder.java index 3d4ec19d7e..6098d96ff3 100644 --- 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/DeleteNotificationConfigRequestOrBuilder.java @@ -18,16 +18,16 @@ package com.google.storage.v2; -public interface DeleteNotificationRequestOrBuilder +public interface DeleteNotificationConfigRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.DeleteNotificationRequest) + // @@protoc_insertion_point(interface_extends:google.storage.v2.DeleteNotificationConfigRequest) com.google.protobuf.MessageOrBuilder { /** * * *
-   * Required. The parent bucket of the notification.
+   * Required. The parent bucket of the NotificationConfig.
    * 
* * @@ -41,7 +41,7 @@ public interface DeleteNotificationRequestOrBuilder * * *
-   * Required. The parent bucket of the notification.
+   * Required. The parent bucket of the NotificationConfig.
    * 
* * 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/GetNotificationConfigRequest.java similarity index 76% rename from proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetNotificationRequest.java rename to proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetNotificationConfigRequest.java index dded8c2ae0..34b4b50272 100644 --- 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/GetNotificationConfigRequest.java @@ -22,29 +22,29 @@ * * *
- * Request message for GetNotification.
+ * Request message for GetNotificationConfig.
  * 
* - * Protobuf type {@code google.storage.v2.GetNotificationRequest} + * Protobuf type {@code google.storage.v2.GetNotificationConfigRequest} */ -public final class GetNotificationRequest extends com.google.protobuf.GeneratedMessageV3 +public final class GetNotificationConfigRequest extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.storage.v2.GetNotificationRequest) - GetNotificationRequestOrBuilder { + // @@protoc_insertion_point(message_implements:google.storage.v2.GetNotificationConfigRequest) + GetNotificationConfigRequestOrBuilder { private static final long serialVersionUID = 0L; - // Use GetNotificationRequest.newBuilder() to construct. - private GetNotificationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use GetNotificationConfigRequest.newBuilder() to construct. + private GetNotificationConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private GetNotificationRequest() { + private GetNotificationConfigRequest() { name_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new GetNotificationRequest(); + return new GetNotificationConfigRequest(); } @java.lang.Override @@ -54,17 +54,17 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetNotificationRequest_descriptor; + .internal_static_google_storage_v2_GetNotificationConfigRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetNotificationRequest_fieldAccessorTable + .internal_static_google_storage_v2_GetNotificationConfigRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.storage.v2.GetNotificationRequest.class, - com.google.storage.v2.GetNotificationRequest.Builder.class); + com.google.storage.v2.GetNotificationConfigRequest.class, + com.google.storage.v2.GetNotificationConfigRequest.Builder.class); } public static final int NAME_FIELD_NUMBER = 1; @@ -75,9 +75,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The parent bucket of the notification.
+   * Required. The parent bucket of the NotificationConfig.
    * Format:
-   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
+   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig}`
    * 
* * @@ -102,9 +102,9 @@ public java.lang.String getName() { * * *
-   * Required. The parent bucket of the notification.
+   * Required. The parent bucket of the NotificationConfig.
    * Format:
-   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
+   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig}`
    * 
* * @@ -165,11 +165,11 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.google.storage.v2.GetNotificationRequest)) { + if (!(obj instanceof com.google.storage.v2.GetNotificationConfigRequest)) { return super.equals(obj); } - com.google.storage.v2.GetNotificationRequest other = - (com.google.storage.v2.GetNotificationRequest) obj; + com.google.storage.v2.GetNotificationConfigRequest other = + (com.google.storage.v2.GetNotificationConfigRequest) obj; if (!getName().equals(other.getName())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; @@ -190,71 +190,71 @@ public int hashCode() { return hash; } - public static com.google.storage.v2.GetNotificationRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.google.storage.v2.GetNotificationConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.storage.v2.GetNotificationRequest parseFrom( + public static com.google.storage.v2.GetNotificationConfigRequest 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( + public static com.google.storage.v2.GetNotificationConfigRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.storage.v2.GetNotificationRequest parseFrom( + public static com.google.storage.v2.GetNotificationConfigRequest 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) + public static com.google.storage.v2.GetNotificationConfigRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.storage.v2.GetNotificationRequest parseFrom( + public static com.google.storage.v2.GetNotificationConfigRequest 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 { + public static com.google.storage.v2.GetNotificationConfigRequest 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( + public static com.google.storage.v2.GetNotificationConfigRequest 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( + public static com.google.storage.v2.GetNotificationConfigRequest 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( + public static com.google.storage.v2.GetNotificationConfigRequest 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( + public static com.google.storage.v2.GetNotificationConfigRequest 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( + public static com.google.storage.v2.GetNotificationConfigRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -271,7 +271,7 @@ public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.google.storage.v2.GetNotificationRequest prototype) { + public static Builder newBuilder(com.google.storage.v2.GetNotificationConfigRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -289,31 +289,31 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Request message for GetNotification.
+   * Request message for GetNotificationConfig.
    * 
* - * Protobuf type {@code google.storage.v2.GetNotificationRequest} + * Protobuf type {@code google.storage.v2.GetNotificationConfigRequest} */ 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 { + // @@protoc_insertion_point(builder_implements:google.storage.v2.GetNotificationConfigRequest) + com.google.storage.v2.GetNotificationConfigRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetNotificationRequest_descriptor; + .internal_static_google_storage_v2_GetNotificationConfigRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetNotificationRequest_fieldAccessorTable + .internal_static_google_storage_v2_GetNotificationConfigRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.storage.v2.GetNotificationRequest.class, - com.google.storage.v2.GetNotificationRequest.Builder.class); + com.google.storage.v2.GetNotificationConfigRequest.class, + com.google.storage.v2.GetNotificationConfigRequest.Builder.class); } - // Construct using com.google.storage.v2.GetNotificationRequest.newBuilder() + // Construct using com.google.storage.v2.GetNotificationConfigRequest.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { @@ -331,17 +331,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_GetNotificationRequest_descriptor; + .internal_static_google_storage_v2_GetNotificationConfigRequest_descriptor; } @java.lang.Override - public com.google.storage.v2.GetNotificationRequest getDefaultInstanceForType() { - return com.google.storage.v2.GetNotificationRequest.getDefaultInstance(); + public com.google.storage.v2.GetNotificationConfigRequest getDefaultInstanceForType() { + return com.google.storage.v2.GetNotificationConfigRequest.getDefaultInstance(); } @java.lang.Override - public com.google.storage.v2.GetNotificationRequest build() { - com.google.storage.v2.GetNotificationRequest result = buildPartial(); + public com.google.storage.v2.GetNotificationConfigRequest build() { + com.google.storage.v2.GetNotificationConfigRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -349,9 +349,9 @@ public com.google.storage.v2.GetNotificationRequest build() { } @java.lang.Override - public com.google.storage.v2.GetNotificationRequest buildPartial() { - com.google.storage.v2.GetNotificationRequest result = - new com.google.storage.v2.GetNotificationRequest(this); + public com.google.storage.v2.GetNotificationConfigRequest buildPartial() { + com.google.storage.v2.GetNotificationConfigRequest result = + new com.google.storage.v2.GetNotificationConfigRequest(this); if (bitField0_ != 0) { buildPartial0(result); } @@ -359,7 +359,7 @@ public com.google.storage.v2.GetNotificationRequest buildPartial() { return result; } - private void buildPartial0(com.google.storage.v2.GetNotificationRequest result) { + private void buildPartial0(com.google.storage.v2.GetNotificationConfigRequest result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.name_ = name_; @@ -401,16 +401,17 @@ public Builder addRepeatedField( @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); + if (other instanceof com.google.storage.v2.GetNotificationConfigRequest) { + return mergeFrom((com.google.storage.v2.GetNotificationConfigRequest) 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; + public Builder mergeFrom(com.google.storage.v2.GetNotificationConfigRequest other) { + if (other == com.google.storage.v2.GetNotificationConfigRequest.getDefaultInstance()) + return this; if (!other.getName().isEmpty()) { name_ = other.name_; bitField0_ |= 0x00000001; @@ -472,9 +473,9 @@ public Builder mergeFrom( * * *
-     * Required. The parent bucket of the notification.
+     * Required. The parent bucket of the NotificationConfig.
      * Format:
-     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
+     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig}`
      * 
* * @@ -498,9 +499,9 @@ public java.lang.String getName() { * * *
-     * Required. The parent bucket of the notification.
+     * Required. The parent bucket of the NotificationConfig.
      * Format:
-     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
+     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig}`
      * 
* * @@ -524,9 +525,9 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * Required. The parent bucket of the notification.
+     * Required. The parent bucket of the NotificationConfig.
      * Format:
-     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
+     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig}`
      * 
* * @@ -549,9 +550,9 @@ public Builder setName(java.lang.String value) { * * *
-     * Required. The parent bucket of the notification.
+     * Required. The parent bucket of the NotificationConfig.
      * Format:
-     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
+     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig}`
      * 
* * @@ -570,9 +571,9 @@ public Builder clearName() { * * *
-     * Required. The parent bucket of the notification.
+     * Required. The parent bucket of the NotificationConfig.
      * Format:
-     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
+     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig}`
      * 
* * @@ -604,24 +605,24 @@ public final Builder mergeUnknownFields( return super.mergeUnknownFields(unknownFields); } - // @@protoc_insertion_point(builder_scope:google.storage.v2.GetNotificationRequest) + // @@protoc_insertion_point(builder_scope:google.storage.v2.GetNotificationConfigRequest) } - // @@protoc_insertion_point(class_scope:google.storage.v2.GetNotificationRequest) - private static final com.google.storage.v2.GetNotificationRequest DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:google.storage.v2.GetNotificationConfigRequest) + private static final com.google.storage.v2.GetNotificationConfigRequest DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.google.storage.v2.GetNotificationRequest(); + DEFAULT_INSTANCE = new com.google.storage.v2.GetNotificationConfigRequest(); } - public static com.google.storage.v2.GetNotificationRequest getDefaultInstance() { + public static com.google.storage.v2.GetNotificationConfigRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { @java.lang.Override - public GetNotificationRequest parsePartialFrom( + public GetNotificationConfigRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -640,17 +641,17 @@ public GetNotificationRequest parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.google.storage.v2.GetNotificationRequest getDefaultInstanceForType() { + public com.google.storage.v2.GetNotificationConfigRequest 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/GetNotificationConfigRequestOrBuilder.java similarity index 85% rename from proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetNotificationRequestOrBuilder.java rename to proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/GetNotificationConfigRequestOrBuilder.java index 1eeafdbd59..9a2f81896b 100644 --- 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/GetNotificationConfigRequestOrBuilder.java @@ -18,18 +18,18 @@ package com.google.storage.v2; -public interface GetNotificationRequestOrBuilder +public interface GetNotificationConfigRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.GetNotificationRequest) + // @@protoc_insertion_point(interface_extends:google.storage.v2.GetNotificationConfigRequest) com.google.protobuf.MessageOrBuilder { /** * * *
-   * Required. The parent bucket of the notification.
+   * Required. The parent bucket of the NotificationConfig.
    * Format:
-   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
+   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig}`
    * 
* * @@ -43,9 +43,9 @@ public interface GetNotificationRequestOrBuilder * * *
-   * Required. The parent bucket of the notification.
+   * Required. The parent bucket of the NotificationConfig.
    * Format:
-   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
+   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig}`
    * 
* * 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/ListNotificationConfigsRequest.java similarity index 79% rename from proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationsRequest.java rename to proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationConfigsRequest.java index 4d80e9d5c8..1b0faf28de 100644 --- 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/ListNotificationConfigsRequest.java @@ -25,19 +25,20 @@ * Request message for ListNotifications. * * - * Protobuf type {@code google.storage.v2.ListNotificationsRequest} + * Protobuf type {@code google.storage.v2.ListNotificationConfigsRequest} */ -public final class ListNotificationsRequest extends com.google.protobuf.GeneratedMessageV3 +public final class ListNotificationConfigsRequest extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.storage.v2.ListNotificationsRequest) - ListNotificationsRequestOrBuilder { + // @@protoc_insertion_point(message_implements:google.storage.v2.ListNotificationConfigsRequest) + ListNotificationConfigsRequestOrBuilder { private static final long serialVersionUID = 0L; - // Use ListNotificationsRequest.newBuilder() to construct. - private ListNotificationsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ListNotificationConfigsRequest.newBuilder() to construct. + private ListNotificationConfigsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ListNotificationsRequest() { + private ListNotificationConfigsRequest() { parent_ = ""; pageToken_ = ""; } @@ -45,7 +46,7 @@ private ListNotificationsRequest() { @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListNotificationsRequest(); + return new ListNotificationConfigsRequest(); } @java.lang.Override @@ -55,17 +56,17 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListNotificationsRequest_descriptor; + .internal_static_google_storage_v2_ListNotificationConfigsRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListNotificationsRequest_fieldAccessorTable + .internal_static_google_storage_v2_ListNotificationConfigsRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.storage.v2.ListNotificationsRequest.class, - com.google.storage.v2.ListNotificationsRequest.Builder.class); + com.google.storage.v2.ListNotificationConfigsRequest.class, + com.google.storage.v2.ListNotificationConfigsRequest.Builder.class); } public static final int PARENT_FIELD_NUMBER = 1; @@ -129,10 +130,9 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-   * The maximum number of notifications to return. The service may return fewer
-   * than this value.
-   * The default value is 100. Specifying a value above 100 will result in a
-   * page_size of 100.
+   * The maximum number of NotificationConfigs to return. The service may
+   * return fewer than this value. The default value is 100. Specifying a value
+   * above 100 will result in a page_size of 100.
    * 
* * int32 page_size = 2; @@ -152,10 +152,10 @@ public int getPageSize() { * * *
-   * A page token, received from a previous `ListNotifications` call.
+   * A page token, received from a previous `ListNotificationConfigs` 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.
+   * When paginating, all other parameters provided to `ListNotificationConfigs`
+   * must match the call that provided the page token.
    * 
* * string page_token = 3; @@ -178,10 +178,10 @@ public java.lang.String getPageToken() { * * *
-   * A page token, received from a previous `ListNotifications` call.
+   * A page token, received from a previous `ListNotificationConfigs` 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.
+   * When paginating, all other parameters provided to `ListNotificationConfigs`
+   * must match the call that provided the page token.
    * 
* * string page_token = 3; @@ -252,11 +252,11 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.google.storage.v2.ListNotificationsRequest)) { + if (!(obj instanceof com.google.storage.v2.ListNotificationConfigsRequest)) { return super.equals(obj); } - com.google.storage.v2.ListNotificationsRequest other = - (com.google.storage.v2.ListNotificationsRequest) obj; + com.google.storage.v2.ListNotificationConfigsRequest other = + (com.google.storage.v2.ListNotificationConfigsRequest) obj; if (!getParent().equals(other.getParent())) return false; if (getPageSize() != other.getPageSize()) return false; @@ -283,71 +283,71 @@ public int hashCode() { return hash; } - public static com.google.storage.v2.ListNotificationsRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.google.storage.v2.ListNotificationConfigsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.storage.v2.ListNotificationsRequest parseFrom( + public static com.google.storage.v2.ListNotificationConfigsRequest 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( + public static com.google.storage.v2.ListNotificationConfigsRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.storage.v2.ListNotificationsRequest parseFrom( + public static com.google.storage.v2.ListNotificationConfigsRequest 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) + public static com.google.storage.v2.ListNotificationConfigsRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.storage.v2.ListNotificationsRequest parseFrom( + public static com.google.storage.v2.ListNotificationConfigsRequest 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 { + public static com.google.storage.v2.ListNotificationConfigsRequest 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( + public static com.google.storage.v2.ListNotificationConfigsRequest 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( + public static com.google.storage.v2.ListNotificationConfigsRequest 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( + public static com.google.storage.v2.ListNotificationConfigsRequest 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( + public static com.google.storage.v2.ListNotificationConfigsRequest 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( + public static com.google.storage.v2.ListNotificationConfigsRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -364,7 +364,7 @@ public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.google.storage.v2.ListNotificationsRequest prototype) { + public static Builder newBuilder(com.google.storage.v2.ListNotificationConfigsRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -385,28 +385,28 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * Request message for ListNotifications. * * - * Protobuf type {@code google.storage.v2.ListNotificationsRequest} + * Protobuf type {@code google.storage.v2.ListNotificationConfigsRequest} */ 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 { + // @@protoc_insertion_point(builder_implements:google.storage.v2.ListNotificationConfigsRequest) + com.google.storage.v2.ListNotificationConfigsRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListNotificationsRequest_descriptor; + .internal_static_google_storage_v2_ListNotificationConfigsRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListNotificationsRequest_fieldAccessorTable + .internal_static_google_storage_v2_ListNotificationConfigsRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.storage.v2.ListNotificationsRequest.class, - com.google.storage.v2.ListNotificationsRequest.Builder.class); + com.google.storage.v2.ListNotificationConfigsRequest.class, + com.google.storage.v2.ListNotificationConfigsRequest.Builder.class); } - // Construct using com.google.storage.v2.ListNotificationsRequest.newBuilder() + // Construct using com.google.storage.v2.ListNotificationConfigsRequest.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { @@ -426,17 +426,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListNotificationsRequest_descriptor; + .internal_static_google_storage_v2_ListNotificationConfigsRequest_descriptor; } @java.lang.Override - public com.google.storage.v2.ListNotificationsRequest getDefaultInstanceForType() { - return com.google.storage.v2.ListNotificationsRequest.getDefaultInstance(); + public com.google.storage.v2.ListNotificationConfigsRequest getDefaultInstanceForType() { + return com.google.storage.v2.ListNotificationConfigsRequest.getDefaultInstance(); } @java.lang.Override - public com.google.storage.v2.ListNotificationsRequest build() { - com.google.storage.v2.ListNotificationsRequest result = buildPartial(); + public com.google.storage.v2.ListNotificationConfigsRequest build() { + com.google.storage.v2.ListNotificationConfigsRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -444,9 +444,9 @@ public com.google.storage.v2.ListNotificationsRequest build() { } @java.lang.Override - public com.google.storage.v2.ListNotificationsRequest buildPartial() { - com.google.storage.v2.ListNotificationsRequest result = - new com.google.storage.v2.ListNotificationsRequest(this); + public com.google.storage.v2.ListNotificationConfigsRequest buildPartial() { + com.google.storage.v2.ListNotificationConfigsRequest result = + new com.google.storage.v2.ListNotificationConfigsRequest(this); if (bitField0_ != 0) { buildPartial0(result); } @@ -454,7 +454,7 @@ public com.google.storage.v2.ListNotificationsRequest buildPartial() { return result; } - private void buildPartial0(com.google.storage.v2.ListNotificationsRequest result) { + private void buildPartial0(com.google.storage.v2.ListNotificationConfigsRequest result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.parent_ = parent_; @@ -502,16 +502,17 @@ public Builder addRepeatedField( @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); + if (other instanceof com.google.storage.v2.ListNotificationConfigsRequest) { + return mergeFrom((com.google.storage.v2.ListNotificationConfigsRequest) 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; + public Builder mergeFrom(com.google.storage.v2.ListNotificationConfigsRequest other) { + if (other == com.google.storage.v2.ListNotificationConfigsRequest.getDefaultInstance()) + return this; if (!other.getParent().isEmpty()) { parent_ = other.parent_; bitField0_ |= 0x00000001; @@ -709,10 +710,9 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * * *
-     * The maximum number of notifications to return. The service may return fewer
-     * than this value.
-     * The default value is 100. Specifying a value above 100 will result in a
-     * page_size of 100.
+     * The maximum number of NotificationConfigs to return. The service may
+     * return fewer than this value. The default value is 100. Specifying a value
+     * above 100 will result in a page_size of 100.
      * 
* * int32 page_size = 2; @@ -727,10 +727,9 @@ public int getPageSize() { * * *
-     * The maximum number of notifications to return. The service may return fewer
-     * than this value.
-     * The default value is 100. Specifying a value above 100 will result in a
-     * page_size of 100.
+     * The maximum number of NotificationConfigs to return. The service may
+     * return fewer than this value. The default value is 100. Specifying a value
+     * above 100 will result in a page_size of 100.
      * 
* * int32 page_size = 2; @@ -749,10 +748,9 @@ public Builder setPageSize(int value) { * * *
-     * The maximum number of notifications to return. The service may return fewer
-     * than this value.
-     * The default value is 100. Specifying a value above 100 will result in a
-     * page_size of 100.
+     * The maximum number of NotificationConfigs to return. The service may
+     * return fewer than this value. The default value is 100. Specifying a value
+     * above 100 will result in a page_size of 100.
      * 
* * int32 page_size = 2; @@ -771,10 +769,10 @@ public Builder clearPageSize() { * * *
-     * A page token, received from a previous `ListNotifications` call.
+     * A page token, received from a previous `ListNotificationConfigs` 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.
+     * When paginating, all other parameters provided to `ListNotificationConfigs`
+     * must match the call that provided the page token.
      * 
* * string page_token = 3; @@ -796,10 +794,10 @@ public java.lang.String getPageToken() { * * *
-     * A page token, received from a previous `ListNotifications` call.
+     * A page token, received from a previous `ListNotificationConfigs` 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.
+     * When paginating, all other parameters provided to `ListNotificationConfigs`
+     * must match the call that provided the page token.
      * 
* * string page_token = 3; @@ -821,10 +819,10 @@ public com.google.protobuf.ByteString getPageTokenBytes() { * * *
-     * A page token, received from a previous `ListNotifications` call.
+     * A page token, received from a previous `ListNotificationConfigs` 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.
+     * When paginating, all other parameters provided to `ListNotificationConfigs`
+     * must match the call that provided the page token.
      * 
* * string page_token = 3; @@ -845,10 +843,10 @@ public Builder setPageToken(java.lang.String value) { * * *
-     * A page token, received from a previous `ListNotifications` call.
+     * A page token, received from a previous `ListNotificationConfigs` 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.
+     * When paginating, all other parameters provided to `ListNotificationConfigs`
+     * must match the call that provided the page token.
      * 
* * string page_token = 3; @@ -865,10 +863,10 @@ public Builder clearPageToken() { * * *
-     * A page token, received from a previous `ListNotifications` call.
+     * A page token, received from a previous `ListNotificationConfigs` 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.
+     * When paginating, all other parameters provided to `ListNotificationConfigs`
+     * must match the call that provided the page token.
      * 
* * string page_token = 3; @@ -898,24 +896,24 @@ public final Builder mergeUnknownFields( return super.mergeUnknownFields(unknownFields); } - // @@protoc_insertion_point(builder_scope:google.storage.v2.ListNotificationsRequest) + // @@protoc_insertion_point(builder_scope:google.storage.v2.ListNotificationConfigsRequest) } - // @@protoc_insertion_point(class_scope:google.storage.v2.ListNotificationsRequest) - private static final com.google.storage.v2.ListNotificationsRequest DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:google.storage.v2.ListNotificationConfigsRequest) + private static final com.google.storage.v2.ListNotificationConfigsRequest DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.google.storage.v2.ListNotificationsRequest(); + DEFAULT_INSTANCE = new com.google.storage.v2.ListNotificationConfigsRequest(); } - public static com.google.storage.v2.ListNotificationsRequest getDefaultInstance() { + public static com.google.storage.v2.ListNotificationConfigsRequest getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { @java.lang.Override - public ListNotificationsRequest parsePartialFrom( + public ListNotificationConfigsRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -934,17 +932,17 @@ public ListNotificationsRequest parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.google.storage.v2.ListNotificationsRequest getDefaultInstanceForType() { + public com.google.storage.v2.ListNotificationConfigsRequest 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/ListNotificationConfigsRequestOrBuilder.java similarity index 78% rename from proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationsRequestOrBuilder.java rename to proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationConfigsRequestOrBuilder.java index af80ec7637..dff69f1092 100644 --- 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/ListNotificationConfigsRequestOrBuilder.java @@ -18,9 +18,9 @@ package com.google.storage.v2; -public interface ListNotificationsRequestOrBuilder +public interface ListNotificationConfigsRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.ListNotificationsRequest) + // @@protoc_insertion_point(interface_extends:google.storage.v2.ListNotificationConfigsRequest) com.google.protobuf.MessageOrBuilder { /** @@ -56,10 +56,9 @@ public interface ListNotificationsRequestOrBuilder * * *
-   * The maximum number of notifications to return. The service may return fewer
-   * than this value.
-   * The default value is 100. Specifying a value above 100 will result in a
-   * page_size of 100.
+   * The maximum number of NotificationConfigs to return. The service may
+   * return fewer than this value. The default value is 100. Specifying a value
+   * above 100 will result in a page_size of 100.
    * 
* * int32 page_size = 2; @@ -72,10 +71,10 @@ public interface ListNotificationsRequestOrBuilder * * *
-   * A page token, received from a previous `ListNotifications` call.
+   * A page token, received from a previous `ListNotificationConfigs` 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.
+   * When paginating, all other parameters provided to `ListNotificationConfigs`
+   * must match the call that provided the page token.
    * 
* * string page_token = 3; @@ -87,10 +86,10 @@ public interface ListNotificationsRequestOrBuilder * * *
-   * A page token, received from a previous `ListNotifications` call.
+   * A page token, received from a previous `ListNotificationConfigs` 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.
+   * When paginating, all other parameters provided to `ListNotificationConfigs`
+   * must match the call that provided the page token.
    * 
* * string page_token = 3; 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/ListNotificationConfigsResponse.java similarity index 58% rename from proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationsResponse.java rename to proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationConfigsResponse.java index fa239f4a30..eeedd2a45f 100644 --- 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/ListNotificationConfigsResponse.java @@ -22,30 +22,31 @@ * * *
- * The result of a call to Notifications.ListNotifications
+ * The result of a call to ListNotificationConfigs
  * 
* - * Protobuf type {@code google.storage.v2.ListNotificationsResponse} + * Protobuf type {@code google.storage.v2.ListNotificationConfigsResponse} */ -public final class ListNotificationsResponse extends com.google.protobuf.GeneratedMessageV3 +public final class ListNotificationConfigsResponse extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.storage.v2.ListNotificationsResponse) - ListNotificationsResponseOrBuilder { + // @@protoc_insertion_point(message_implements:google.storage.v2.ListNotificationConfigsResponse) + ListNotificationConfigsResponseOrBuilder { private static final long serialVersionUID = 0L; - // Use ListNotificationsResponse.newBuilder() to construct. - private ListNotificationsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ListNotificationConfigsResponse.newBuilder() to construct. + private ListNotificationConfigsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ListNotificationsResponse() { - notifications_ = java.util.Collections.emptyList(); + private ListNotificationConfigsResponse() { + notificationConfigs_ = java.util.Collections.emptyList(); nextPageToken_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListNotificationsResponse(); + return new ListNotificationConfigsResponse(); } @java.lang.Override @@ -55,23 +56,23 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListNotificationsResponse_descriptor; + .internal_static_google_storage_v2_ListNotificationConfigsResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListNotificationsResponse_fieldAccessorTable + .internal_static_google_storage_v2_ListNotificationConfigsResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.storage.v2.ListNotificationsResponse.class, - com.google.storage.v2.ListNotificationsResponse.Builder.class); + com.google.storage.v2.ListNotificationConfigsResponse.class, + com.google.storage.v2.ListNotificationConfigsResponse.Builder.class); } - public static final int NOTIFICATIONS_FIELD_NUMBER = 1; + public static final int NOTIFICATION_CONFIGS_FIELD_NUMBER = 1; @SuppressWarnings("serial") - private java.util.List notifications_; + private java.util.List notificationConfigs_; /** * * @@ -79,11 +80,11 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ @java.lang.Override - public java.util.List getNotificationsList() { - return notifications_; + public java.util.List getNotificationConfigsList() { + return notificationConfigs_; } /** * @@ -92,12 +93,12 @@ public java.util.List getNotificationsList() * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ @java.lang.Override - public java.util.List - getNotificationsOrBuilderList() { - return notifications_; + public java.util.List + getNotificationConfigsOrBuilderList() { + return notificationConfigs_; } /** * @@ -106,11 +107,11 @@ public java.util.List getNotificationsList() * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ @java.lang.Override - public int getNotificationsCount() { - return notifications_.size(); + public int getNotificationConfigsCount() { + return notificationConfigs_.size(); } /** * @@ -119,11 +120,11 @@ public int getNotificationsCount() { * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ @java.lang.Override - public com.google.storage.v2.Notification getNotifications(int index) { - return notifications_.get(index); + public com.google.storage.v2.NotificationConfig getNotificationConfigs(int index) { + return notificationConfigs_.get(index); } /** * @@ -132,11 +133,12 @@ public com.google.storage.v2.Notification getNotifications(int index) { * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ @java.lang.Override - public com.google.storage.v2.NotificationOrBuilder getNotificationsOrBuilder(int index) { - return notifications_.get(index); + public com.google.storage.v2.NotificationConfigOrBuilder getNotificationConfigsOrBuilder( + int index) { + return notificationConfigs_.get(index); } public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; @@ -206,8 +208,8 @@ public final boolean isInitialized() { @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)); + for (int i = 0; i < notificationConfigs_.size(); i++) { + output.writeMessage(1, notificationConfigs_.get(i)); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); @@ -221,8 +223,9 @@ public int getSerializedSize() { 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)); + for (int i = 0; i < notificationConfigs_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, notificationConfigs_.get(i)); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); @@ -237,13 +240,13 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.google.storage.v2.ListNotificationsResponse)) { + if (!(obj instanceof com.google.storage.v2.ListNotificationConfigsResponse)) { return super.equals(obj); } - com.google.storage.v2.ListNotificationsResponse other = - (com.google.storage.v2.ListNotificationsResponse) obj; + com.google.storage.v2.ListNotificationConfigsResponse other = + (com.google.storage.v2.ListNotificationConfigsResponse) obj; - if (!getNotificationsList().equals(other.getNotificationsList())) return false; + if (!getNotificationConfigsList().equals(other.getNotificationConfigsList())) return false; if (!getNextPageToken().equals(other.getNextPageToken())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; @@ -256,9 +259,9 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getNotificationsCount() > 0) { - hash = (37 * hash) + NOTIFICATIONS_FIELD_NUMBER; - hash = (53 * hash) + getNotificationsList().hashCode(); + if (getNotificationConfigsCount() > 0) { + hash = (37 * hash) + NOTIFICATION_CONFIGS_FIELD_NUMBER; + hash = (53 * hash) + getNotificationConfigsList().hashCode(); } hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getNextPageToken().hashCode(); @@ -267,71 +270,71 @@ public int hashCode() { return hash; } - public static com.google.storage.v2.ListNotificationsResponse parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.google.storage.v2.ListNotificationConfigsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.storage.v2.ListNotificationsResponse parseFrom( + public static com.google.storage.v2.ListNotificationConfigsResponse 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( + public static com.google.storage.v2.ListNotificationConfigsResponse parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.storage.v2.ListNotificationsResponse parseFrom( + public static com.google.storage.v2.ListNotificationConfigsResponse 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) + public static com.google.storage.v2.ListNotificationConfigsResponse parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.storage.v2.ListNotificationsResponse parseFrom( + public static com.google.storage.v2.ListNotificationConfigsResponse 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 { + public static com.google.storage.v2.ListNotificationConfigsResponse 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( + public static com.google.storage.v2.ListNotificationConfigsResponse 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( + public static com.google.storage.v2.ListNotificationConfigsResponse 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( + public static com.google.storage.v2.ListNotificationConfigsResponse 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( + public static com.google.storage.v2.ListNotificationConfigsResponse 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( + public static com.google.storage.v2.ListNotificationConfigsResponse parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -348,7 +351,8 @@ public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.google.storage.v2.ListNotificationsResponse prototype) { + public static Builder newBuilder( + com.google.storage.v2.ListNotificationConfigsResponse prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -366,31 +370,31 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * The result of a call to Notifications.ListNotifications
+   * The result of a call to ListNotificationConfigs
    * 
* - * Protobuf type {@code google.storage.v2.ListNotificationsResponse} + * Protobuf type {@code google.storage.v2.ListNotificationConfigsResponse} */ 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 { + // @@protoc_insertion_point(builder_implements:google.storage.v2.ListNotificationConfigsResponse) + com.google.storage.v2.ListNotificationConfigsResponseOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListNotificationsResponse_descriptor; + .internal_static_google_storage_v2_ListNotificationConfigsResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListNotificationsResponse_fieldAccessorTable + .internal_static_google_storage_v2_ListNotificationConfigsResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.storage.v2.ListNotificationsResponse.class, - com.google.storage.v2.ListNotificationsResponse.Builder.class); + com.google.storage.v2.ListNotificationConfigsResponse.class, + com.google.storage.v2.ListNotificationConfigsResponse.Builder.class); } - // Construct using com.google.storage.v2.ListNotificationsResponse.newBuilder() + // Construct using com.google.storage.v2.ListNotificationConfigsResponse.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { @@ -401,11 +405,11 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { public Builder clear() { super.clear(); bitField0_ = 0; - if (notificationsBuilder_ == null) { - notifications_ = java.util.Collections.emptyList(); + if (notificationConfigsBuilder_ == null) { + notificationConfigs_ = java.util.Collections.emptyList(); } else { - notifications_ = null; - notificationsBuilder_.clear(); + notificationConfigs_ = null; + notificationConfigsBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000001); nextPageToken_ = ""; @@ -415,17 +419,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_ListNotificationsResponse_descriptor; + .internal_static_google_storage_v2_ListNotificationConfigsResponse_descriptor; } @java.lang.Override - public com.google.storage.v2.ListNotificationsResponse getDefaultInstanceForType() { - return com.google.storage.v2.ListNotificationsResponse.getDefaultInstance(); + public com.google.storage.v2.ListNotificationConfigsResponse getDefaultInstanceForType() { + return com.google.storage.v2.ListNotificationConfigsResponse.getDefaultInstance(); } @java.lang.Override - public com.google.storage.v2.ListNotificationsResponse build() { - com.google.storage.v2.ListNotificationsResponse result = buildPartial(); + public com.google.storage.v2.ListNotificationConfigsResponse build() { + com.google.storage.v2.ListNotificationConfigsResponse result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -433,9 +437,9 @@ public com.google.storage.v2.ListNotificationsResponse build() { } @java.lang.Override - public com.google.storage.v2.ListNotificationsResponse buildPartial() { - com.google.storage.v2.ListNotificationsResponse result = - new com.google.storage.v2.ListNotificationsResponse(this); + public com.google.storage.v2.ListNotificationConfigsResponse buildPartial() { + com.google.storage.v2.ListNotificationConfigsResponse result = + new com.google.storage.v2.ListNotificationConfigsResponse(this); buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); @@ -445,19 +449,19 @@ public com.google.storage.v2.ListNotificationsResponse buildPartial() { } private void buildPartialRepeatedFields( - com.google.storage.v2.ListNotificationsResponse result) { - if (notificationsBuilder_ == null) { + com.google.storage.v2.ListNotificationConfigsResponse result) { + if (notificationConfigsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { - notifications_ = java.util.Collections.unmodifiableList(notifications_); + notificationConfigs_ = java.util.Collections.unmodifiableList(notificationConfigs_); bitField0_ = (bitField0_ & ~0x00000001); } - result.notifications_ = notifications_; + result.notificationConfigs_ = notificationConfigs_; } else { - result.notifications_ = notificationsBuilder_.build(); + result.notificationConfigs_ = notificationConfigsBuilder_.build(); } } - private void buildPartial0(com.google.storage.v2.ListNotificationsResponse result) { + private void buildPartial0(com.google.storage.v2.ListNotificationConfigsResponse result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000002) != 0)) { result.nextPageToken_ = nextPageToken_; @@ -499,41 +503,41 @@ public Builder addRepeatedField( @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); + if (other instanceof com.google.storage.v2.ListNotificationConfigsResponse) { + return mergeFrom((com.google.storage.v2.ListNotificationConfigsResponse) other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.google.storage.v2.ListNotificationsResponse other) { - if (other == com.google.storage.v2.ListNotificationsResponse.getDefaultInstance()) + public Builder mergeFrom(com.google.storage.v2.ListNotificationConfigsResponse other) { + if (other == com.google.storage.v2.ListNotificationConfigsResponse.getDefaultInstance()) return this; - if (notificationsBuilder_ == null) { - if (!other.notifications_.isEmpty()) { - if (notifications_.isEmpty()) { - notifications_ = other.notifications_; + if (notificationConfigsBuilder_ == null) { + if (!other.notificationConfigs_.isEmpty()) { + if (notificationConfigs_.isEmpty()) { + notificationConfigs_ = other.notificationConfigs_; bitField0_ = (bitField0_ & ~0x00000001); } else { - ensureNotificationsIsMutable(); - notifications_.addAll(other.notifications_); + ensureNotificationConfigsIsMutable(); + notificationConfigs_.addAll(other.notificationConfigs_); } onChanged(); } } else { - if (!other.notifications_.isEmpty()) { - if (notificationsBuilder_.isEmpty()) { - notificationsBuilder_.dispose(); - notificationsBuilder_ = null; - notifications_ = other.notifications_; + if (!other.notificationConfigs_.isEmpty()) { + if (notificationConfigsBuilder_.isEmpty()) { + notificationConfigsBuilder_.dispose(); + notificationConfigsBuilder_ = null; + notificationConfigs_ = other.notificationConfigs_; bitField0_ = (bitField0_ & ~0x00000001); - notificationsBuilder_ = + notificationConfigsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getNotificationsFieldBuilder() + ? getNotificationConfigsFieldBuilder() : null; } else { - notificationsBuilder_.addAllMessages(other.notifications_); + notificationConfigsBuilder_.addAllMessages(other.notificationConfigs_); } } } @@ -570,14 +574,14 @@ public Builder mergeFrom( break; case 10: { - com.google.storage.v2.Notification m = + com.google.storage.v2.NotificationConfig m = input.readMessage( - com.google.storage.v2.Notification.parser(), extensionRegistry); - if (notificationsBuilder_ == null) { - ensureNotificationsIsMutable(); - notifications_.add(m); + com.google.storage.v2.NotificationConfig.parser(), extensionRegistry); + if (notificationConfigsBuilder_ == null) { + ensureNotificationConfigsIsMutable(); + notificationConfigs_.add(m); } else { - notificationsBuilder_.addMessage(m); + notificationConfigsBuilder_.addMessage(m); } break; } // case 10 @@ -606,22 +610,22 @@ public Builder mergeFrom( private int bitField0_; - private java.util.List notifications_ = + private java.util.List notificationConfigs_ = java.util.Collections.emptyList(); - private void ensureNotificationsIsMutable() { + private void ensureNotificationConfigsIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - notifications_ = - new java.util.ArrayList(notifications_); + notificationConfigs_ = + new java.util.ArrayList(notificationConfigs_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.Notification, - com.google.storage.v2.Notification.Builder, - com.google.storage.v2.NotificationOrBuilder> - notificationsBuilder_; + com.google.storage.v2.NotificationConfig, + com.google.storage.v2.NotificationConfig.Builder, + com.google.storage.v2.NotificationConfigOrBuilder> + notificationConfigsBuilder_; /** * @@ -630,13 +634,13 @@ private void ensureNotificationsIsMutable() { * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ - public java.util.List getNotificationsList() { - if (notificationsBuilder_ == null) { - return java.util.Collections.unmodifiableList(notifications_); + public java.util.List getNotificationConfigsList() { + if (notificationConfigsBuilder_ == null) { + return java.util.Collections.unmodifiableList(notificationConfigs_); } else { - return notificationsBuilder_.getMessageList(); + return notificationConfigsBuilder_.getMessageList(); } } /** @@ -646,13 +650,13 @@ public java.util.List getNotificationsList() * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ - public int getNotificationsCount() { - if (notificationsBuilder_ == null) { - return notifications_.size(); + public int getNotificationConfigsCount() { + if (notificationConfigsBuilder_ == null) { + return notificationConfigs_.size(); } else { - return notificationsBuilder_.getCount(); + return notificationConfigsBuilder_.getCount(); } } /** @@ -662,13 +666,13 @@ public int getNotificationsCount() { * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ - public com.google.storage.v2.Notification getNotifications(int index) { - if (notificationsBuilder_ == null) { - return notifications_.get(index); + public com.google.storage.v2.NotificationConfig getNotificationConfigs(int index) { + if (notificationConfigsBuilder_ == null) { + return notificationConfigs_.get(index); } else { - return notificationsBuilder_.getMessage(index); + return notificationConfigsBuilder_.getMessage(index); } } /** @@ -678,18 +682,19 @@ public com.google.storage.v2.Notification getNotifications(int index) { * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ - public Builder setNotifications(int index, com.google.storage.v2.Notification value) { - if (notificationsBuilder_ == null) { + public Builder setNotificationConfigs( + int index, com.google.storage.v2.NotificationConfig value) { + if (notificationConfigsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureNotificationsIsMutable(); - notifications_.set(index, value); + ensureNotificationConfigsIsMutable(); + notificationConfigs_.set(index, value); onChanged(); } else { - notificationsBuilder_.setMessage(index, value); + notificationConfigsBuilder_.setMessage(index, value); } return this; } @@ -700,16 +705,16 @@ public Builder setNotifications(int index, com.google.storage.v2.Notification va * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ - public Builder setNotifications( - int index, com.google.storage.v2.Notification.Builder builderForValue) { - if (notificationsBuilder_ == null) { - ensureNotificationsIsMutable(); - notifications_.set(index, builderForValue.build()); + public Builder setNotificationConfigs( + int index, com.google.storage.v2.NotificationConfig.Builder builderForValue) { + if (notificationConfigsBuilder_ == null) { + ensureNotificationConfigsIsMutable(); + notificationConfigs_.set(index, builderForValue.build()); onChanged(); } else { - notificationsBuilder_.setMessage(index, builderForValue.build()); + notificationConfigsBuilder_.setMessage(index, builderForValue.build()); } return this; } @@ -720,18 +725,18 @@ public Builder setNotifications( * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ - public Builder addNotifications(com.google.storage.v2.Notification value) { - if (notificationsBuilder_ == null) { + public Builder addNotificationConfigs(com.google.storage.v2.NotificationConfig value) { + if (notificationConfigsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureNotificationsIsMutable(); - notifications_.add(value); + ensureNotificationConfigsIsMutable(); + notificationConfigs_.add(value); onChanged(); } else { - notificationsBuilder_.addMessage(value); + notificationConfigsBuilder_.addMessage(value); } return this; } @@ -742,18 +747,19 @@ public Builder addNotifications(com.google.storage.v2.Notification value) { * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ - public Builder addNotifications(int index, com.google.storage.v2.Notification value) { - if (notificationsBuilder_ == null) { + public Builder addNotificationConfigs( + int index, com.google.storage.v2.NotificationConfig value) { + if (notificationConfigsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureNotificationsIsMutable(); - notifications_.add(index, value); + ensureNotificationConfigsIsMutable(); + notificationConfigs_.add(index, value); onChanged(); } else { - notificationsBuilder_.addMessage(index, value); + notificationConfigsBuilder_.addMessage(index, value); } return this; } @@ -764,15 +770,16 @@ public Builder addNotifications(int index, com.google.storage.v2.Notification va * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ - public Builder addNotifications(com.google.storage.v2.Notification.Builder builderForValue) { - if (notificationsBuilder_ == null) { - ensureNotificationsIsMutable(); - notifications_.add(builderForValue.build()); + public Builder addNotificationConfigs( + com.google.storage.v2.NotificationConfig.Builder builderForValue) { + if (notificationConfigsBuilder_ == null) { + ensureNotificationConfigsIsMutable(); + notificationConfigs_.add(builderForValue.build()); onChanged(); } else { - notificationsBuilder_.addMessage(builderForValue.build()); + notificationConfigsBuilder_.addMessage(builderForValue.build()); } return this; } @@ -783,16 +790,16 @@ public Builder addNotifications(com.google.storage.v2.Notification.Builder build * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ - public Builder addNotifications( - int index, com.google.storage.v2.Notification.Builder builderForValue) { - if (notificationsBuilder_ == null) { - ensureNotificationsIsMutable(); - notifications_.add(index, builderForValue.build()); + public Builder addNotificationConfigs( + int index, com.google.storage.v2.NotificationConfig.Builder builderForValue) { + if (notificationConfigsBuilder_ == null) { + ensureNotificationConfigsIsMutable(); + notificationConfigs_.add(index, builderForValue.build()); onChanged(); } else { - notificationsBuilder_.addMessage(index, builderForValue.build()); + notificationConfigsBuilder_.addMessage(index, builderForValue.build()); } return this; } @@ -803,16 +810,16 @@ public Builder addNotifications( * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ - public Builder addAllNotifications( - java.lang.Iterable values) { - if (notificationsBuilder_ == null) { - ensureNotificationsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, notifications_); + public Builder addAllNotificationConfigs( + java.lang.Iterable values) { + if (notificationConfigsBuilder_ == null) { + ensureNotificationConfigsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, notificationConfigs_); onChanged(); } else { - notificationsBuilder_.addAllMessages(values); + notificationConfigsBuilder_.addAllMessages(values); } return this; } @@ -823,15 +830,15 @@ public Builder addAllNotifications( * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ - public Builder clearNotifications() { - if (notificationsBuilder_ == null) { - notifications_ = java.util.Collections.emptyList(); + public Builder clearNotificationConfigs() { + if (notificationConfigsBuilder_ == null) { + notificationConfigs_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - notificationsBuilder_.clear(); + notificationConfigsBuilder_.clear(); } return this; } @@ -842,15 +849,15 @@ public Builder clearNotifications() { * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ - public Builder removeNotifications(int index) { - if (notificationsBuilder_ == null) { - ensureNotificationsIsMutable(); - notifications_.remove(index); + public Builder removeNotificationConfigs(int index) { + if (notificationConfigsBuilder_ == null) { + ensureNotificationConfigsIsMutable(); + notificationConfigs_.remove(index); onChanged(); } else { - notificationsBuilder_.remove(index); + notificationConfigsBuilder_.remove(index); } return this; } @@ -861,10 +868,11 @@ public Builder removeNotifications(int index) { * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ - public com.google.storage.v2.Notification.Builder getNotificationsBuilder(int index) { - return getNotificationsFieldBuilder().getBuilder(index); + public com.google.storage.v2.NotificationConfig.Builder getNotificationConfigsBuilder( + int index) { + return getNotificationConfigsFieldBuilder().getBuilder(index); } /** * @@ -873,13 +881,14 @@ public com.google.storage.v2.Notification.Builder getNotificationsBuilder(int in * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ - public com.google.storage.v2.NotificationOrBuilder getNotificationsOrBuilder(int index) { - if (notificationsBuilder_ == null) { - return notifications_.get(index); + public com.google.storage.v2.NotificationConfigOrBuilder getNotificationConfigsOrBuilder( + int index) { + if (notificationConfigsBuilder_ == null) { + return notificationConfigs_.get(index); } else { - return notificationsBuilder_.getMessageOrBuilder(index); + return notificationConfigsBuilder_.getMessageOrBuilder(index); } } /** @@ -889,14 +898,14 @@ public com.google.storage.v2.NotificationOrBuilder getNotificationsOrBuilder(int * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ - public java.util.List - getNotificationsOrBuilderList() { - if (notificationsBuilder_ != null) { - return notificationsBuilder_.getMessageOrBuilderList(); + public java.util.List + getNotificationConfigsOrBuilderList() { + if (notificationConfigsBuilder_ != null) { + return notificationConfigsBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(notifications_); + return java.util.Collections.unmodifiableList(notificationConfigs_); } } /** @@ -906,11 +915,11 @@ public com.google.storage.v2.NotificationOrBuilder getNotificationsOrBuilder(int * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ - public com.google.storage.v2.Notification.Builder addNotificationsBuilder() { - return getNotificationsFieldBuilder() - .addBuilder(com.google.storage.v2.Notification.getDefaultInstance()); + public com.google.storage.v2.NotificationConfig.Builder addNotificationConfigsBuilder() { + return getNotificationConfigsFieldBuilder() + .addBuilder(com.google.storage.v2.NotificationConfig.getDefaultInstance()); } /** * @@ -919,11 +928,12 @@ public com.google.storage.v2.Notification.Builder addNotificationsBuilder() { * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ - public com.google.storage.v2.Notification.Builder addNotificationsBuilder(int index) { - return getNotificationsFieldBuilder() - .addBuilder(index, com.google.storage.v2.Notification.getDefaultInstance()); + public com.google.storage.v2.NotificationConfig.Builder addNotificationConfigsBuilder( + int index) { + return getNotificationConfigsFieldBuilder() + .addBuilder(index, com.google.storage.v2.NotificationConfig.getDefaultInstance()); } /** * @@ -932,31 +942,31 @@ public com.google.storage.v2.Notification.Builder addNotificationsBuilder(int in * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ - public java.util.List - getNotificationsBuilderList() { - return getNotificationsFieldBuilder().getBuilderList(); + public java.util.List + getNotificationConfigsBuilderList() { + return getNotificationConfigsFieldBuilder().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_ = + com.google.storage.v2.NotificationConfig, + com.google.storage.v2.NotificationConfig.Builder, + com.google.storage.v2.NotificationConfigOrBuilder> + getNotificationConfigsFieldBuilder() { + if (notificationConfigsBuilder_ == null) { + notificationConfigsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.storage.v2.Notification, - com.google.storage.v2.Notification.Builder, - com.google.storage.v2.NotificationOrBuilder>( - notifications_, + com.google.storage.v2.NotificationConfig, + com.google.storage.v2.NotificationConfig.Builder, + com.google.storage.v2.NotificationConfigOrBuilder>( + notificationConfigs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - notifications_ = null; + notificationConfigs_ = null; } - return notificationsBuilder_; + return notificationConfigsBuilder_; } private java.lang.Object nextPageToken_ = ""; @@ -1081,24 +1091,24 @@ public final Builder mergeUnknownFields( return super.mergeUnknownFields(unknownFields); } - // @@protoc_insertion_point(builder_scope:google.storage.v2.ListNotificationsResponse) + // @@protoc_insertion_point(builder_scope:google.storage.v2.ListNotificationConfigsResponse) } - // @@protoc_insertion_point(class_scope:google.storage.v2.ListNotificationsResponse) - private static final com.google.storage.v2.ListNotificationsResponse DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:google.storage.v2.ListNotificationConfigsResponse) + private static final com.google.storage.v2.ListNotificationConfigsResponse DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.google.storage.v2.ListNotificationsResponse(); + DEFAULT_INSTANCE = new com.google.storage.v2.ListNotificationConfigsResponse(); } - public static com.google.storage.v2.ListNotificationsResponse getDefaultInstance() { + public static com.google.storage.v2.ListNotificationConfigsResponse getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { @java.lang.Override - public ListNotificationsResponse parsePartialFrom( + public ListNotificationConfigsResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -1117,17 +1127,17 @@ public ListNotificationsResponse parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.google.storage.v2.ListNotificationsResponse getDefaultInstanceForType() { + public com.google.storage.v2.ListNotificationConfigsResponse 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/ListNotificationConfigsResponseOrBuilder.java similarity index 65% rename from proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationsResponseOrBuilder.java rename to proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ListNotificationConfigsResponseOrBuilder.java index 3abe122daa..f1fe02eeff 100644 --- 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/ListNotificationConfigsResponseOrBuilder.java @@ -18,9 +18,9 @@ package com.google.storage.v2; -public interface ListNotificationsResponseOrBuilder +public interface ListNotificationConfigsResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.ListNotificationsResponse) + // @@protoc_insertion_point(interface_extends:google.storage.v2.ListNotificationConfigsResponse) com.google.protobuf.MessageOrBuilder { /** @@ -30,9 +30,9 @@ public interface ListNotificationsResponseOrBuilder * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ - java.util.List getNotificationsList(); + java.util.List getNotificationConfigsList(); /** * * @@ -40,9 +40,9 @@ public interface ListNotificationsResponseOrBuilder * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ - com.google.storage.v2.Notification getNotifications(int index); + com.google.storage.v2.NotificationConfig getNotificationConfigs(int index); /** * * @@ -50,9 +50,9 @@ public interface ListNotificationsResponseOrBuilder * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ - int getNotificationsCount(); + int getNotificationConfigsCount(); /** * * @@ -60,10 +60,10 @@ public interface ListNotificationsResponseOrBuilder * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ - java.util.List - getNotificationsOrBuilderList(); + java.util.List + getNotificationConfigsOrBuilderList(); /** * * @@ -71,9 +71,9 @@ public interface ListNotificationsResponseOrBuilder * The list of items. * * - * repeated .google.storage.v2.Notification notifications = 1; + * repeated .google.storage.v2.NotificationConfig notification_configs = 1; */ - com.google.storage.v2.NotificationOrBuilder getNotificationsOrBuilder(int index); + com.google.storage.v2.NotificationConfigOrBuilder getNotificationConfigsOrBuilder(int index); /** * 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/NotificationConfig.java similarity index 87% rename from proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Notification.java rename to proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/NotificationConfig.java index d17224002e..5ca707b839 100644 --- 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/NotificationConfig.java @@ -25,19 +25,19 @@ * A directive to publish Pub/Sub notifications upon changes to a bucket. * * - * Protobuf type {@code google.storage.v2.Notification} + * Protobuf type {@code google.storage.v2.NotificationConfig} */ -public final class Notification extends com.google.protobuf.GeneratedMessageV3 +public final class NotificationConfig extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.storage.v2.Notification) - NotificationOrBuilder { + // @@protoc_insertion_point(message_implements:google.storage.v2.NotificationConfig) + NotificationConfigOrBuilder { private static final long serialVersionUID = 0L; - // Use Notification.newBuilder() to construct. - private Notification(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use NotificationConfig.newBuilder() to construct. + private NotificationConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private Notification() { + private NotificationConfig() { name_ = ""; topic_ = ""; etag_ = ""; @@ -49,7 +49,7 @@ private Notification() { @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Notification(); + return new NotificationConfig(); } @java.lang.Override @@ -59,7 +59,7 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Notification_descriptor; + .internal_static_google_storage_v2_NotificationConfig_descriptor; } @SuppressWarnings({"rawtypes"}) @@ -77,10 +77,10 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Notification_fieldAccessorTable + .internal_static_google_storage_v2_NotificationConfig_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.storage.v2.Notification.class, - com.google.storage.v2.Notification.Builder.class); + com.google.storage.v2.NotificationConfig.class, + com.google.storage.v2.NotificationConfig.Builder.class); } public static final int NAME_FIELD_NUMBER = 1; @@ -91,9 +91,9 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { * * *
-   * Required. The resource name of this notification.
+   * Required. The resource name of this NotificationConfig.
    * Format:
-   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
+   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig}`
    * The `{project}` portion may be `_` for globally unique buckets.
    * 
* @@ -117,9 +117,9 @@ public java.lang.String getName() { * * *
-   * Required. The resource name of this notification.
+   * Required. The resource name of this NotificationConfig.
    * Format:
-   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
+   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig}`
    * The `{project}` portion may be `_` for globally unique buckets.
    * 
* @@ -203,9 +203,9 @@ public com.google.protobuf.ByteString getTopicBytes() { * * *
-   * The etag of the Notification.
-   * If included in the metadata of GetNotificationRequest, the operation will
-   * only be performed if the etag matches that of the Notification.
+   * The etag of the NotificationConfig.
+   * If included in the metadata of GetNotificationConfigRequest, the operation
+   * will only be performed if the etag matches that of the NotificationConfig.
    * 
* * string etag = 7; @@ -228,9 +228,9 @@ public java.lang.String getEtag() { * * *
-   * The etag of the Notification.
-   * If included in the metadata of GetNotificationRequest, the operation will
-   * only be performed if the etag matches that of the Notification.
+   * The etag of the NotificationConfig.
+   * If included in the metadata of GetNotificationConfigRequest, the operation
+   * will only be performed if the etag matches that of the NotificationConfig.
    * 
* * string etag = 7; @@ -258,8 +258,8 @@ public com.google.protobuf.ByteString getEtagBytes() { * * *
-   * If present, only send notifications about listed event types. If empty,
-   * sent notifications for all event types.
+   * If present, only send notifications about listed event types. If
+   * empty, sent notifications for all event types.
    * 
* * repeated string event_types = 3; @@ -273,8 +273,8 @@ public com.google.protobuf.ProtocolStringList getEventTypesList() { * * *
-   * If present, only send notifications about listed event types. If empty,
-   * sent notifications for all event types.
+   * If present, only send notifications about listed event types. If
+   * empty, sent notifications for all event types.
    * 
* * repeated string event_types = 3; @@ -288,8 +288,8 @@ public int getEventTypesCount() { * * *
-   * If present, only send notifications about listed event types. If empty,
-   * sent notifications for all event types.
+   * If present, only send notifications about listed event types. If
+   * empty, sent notifications for all event types.
    * 
* * repeated string event_types = 3; @@ -304,8 +304,8 @@ public java.lang.String getEventTypes(int index) { * * *
-   * If present, only send notifications about listed event types. If empty,
-   * sent notifications for all event types.
+   * If present, only send notifications about listed event types. If
+   * empty, sent notifications for all event types.
    * 
* * repeated string event_types = 3; @@ -323,7 +323,7 @@ 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, + .internal_static_google_storage_v2_NotificationConfig_CustomAttributesEntry_descriptor, com.google.protobuf.WireFormat.FieldType.STRING, "", com.google.protobuf.WireFormat.FieldType.STRING, @@ -350,7 +350,7 @@ public int getCustomAttributesCount() { * *
    * A list of additional attributes to attach to each Pub/Sub
-   * message published for this notification subscription.
+   * message published for this NotificationConfig.
    * 
* * map<string, string> custom_attributes = 4; @@ -373,7 +373,7 @@ public java.util.Map getCustomAttributes() { * *
    * A list of additional attributes to attach to each Pub/Sub
-   * message published for this notification subscription.
+   * message published for this NotificationConfig.
    * 
* * map<string, string> custom_attributes = 4; @@ -387,7 +387,7 @@ public java.util.Map getCustomAttributesMap( * *
    * A list of additional attributes to attach to each Pub/Sub
-   * message published for this notification subscription.
+   * message published for this NotificationConfig.
    * 
* * map<string, string> custom_attributes = 4; @@ -408,7 +408,7 @@ public java.util.Map getCustomAttributesMap( * *
    * A list of additional attributes to attach to each Pub/Sub
-   * message published for this notification subscription.
+   * message published for this NotificationConfig.
    * 
* * map<string, string> custom_attributes = 4; @@ -433,7 +433,7 @@ public java.lang.String getCustomAttributesOrThrow(java.lang.String key) { * * *
-   * If present, only apply this notification config to object names that
+   * If present, only apply this NotificationConfig to object names that
    * begin with this prefix.
    * 
* @@ -457,7 +457,7 @@ public java.lang.String getObjectNamePrefix() { * * *
-   * If present, only apply this notification config to object names that
+   * If present, only apply this NotificationConfig to object names that
    * begin with this prefix.
    * 
* @@ -615,10 +615,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.google.storage.v2.Notification)) { + if (!(obj instanceof com.google.storage.v2.NotificationConfig)) { return super.equals(obj); } - com.google.storage.v2.Notification other = (com.google.storage.v2.Notification) obj; + com.google.storage.v2.NotificationConfig other = (com.google.storage.v2.NotificationConfig) obj; if (!getName().equals(other.getName())) return false; if (!getTopic().equals(other.getTopic())) return false; @@ -661,70 +661,71 @@ public int hashCode() { return hash; } - public static com.google.storage.v2.Notification parseFrom(java.nio.ByteBuffer data) + public static com.google.storage.v2.NotificationConfig parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.storage.v2.Notification parseFrom( + public static com.google.storage.v2.NotificationConfig 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) + public static com.google.storage.v2.NotificationConfig parseFrom( + com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.storage.v2.Notification parseFrom( + public static com.google.storage.v2.NotificationConfig 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) + public static com.google.storage.v2.NotificationConfig parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.storage.v2.Notification parseFrom( + public static com.google.storage.v2.NotificationConfig 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) + public static com.google.storage.v2.NotificationConfig 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( + public static com.google.storage.v2.NotificationConfig 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 { + public static com.google.storage.v2.NotificationConfig 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( + public static com.google.storage.v2.NotificationConfig 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( + public static com.google.storage.v2.NotificationConfig 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( + public static com.google.storage.v2.NotificationConfig parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -741,7 +742,7 @@ public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.google.storage.v2.Notification prototype) { + public static Builder newBuilder(com.google.storage.v2.NotificationConfig prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -762,15 +763,15 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * A directive to publish Pub/Sub notifications upon changes to a bucket. * * - * Protobuf type {@code google.storage.v2.Notification} + * Protobuf type {@code google.storage.v2.NotificationConfig} */ 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 { + // @@protoc_insertion_point(builder_implements:google.storage.v2.NotificationConfig) + com.google.storage.v2.NotificationConfigOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Notification_descriptor; + .internal_static_google_storage_v2_NotificationConfig_descriptor; } @SuppressWarnings({"rawtypes"}) @@ -797,13 +798,13 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Notification_fieldAccessorTable + .internal_static_google_storage_v2_NotificationConfig_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.storage.v2.Notification.class, - com.google.storage.v2.Notification.Builder.class); + com.google.storage.v2.NotificationConfig.class, + com.google.storage.v2.NotificationConfig.Builder.class); } - // Construct using com.google.storage.v2.Notification.newBuilder() + // Construct using com.google.storage.v2.NotificationConfig.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { @@ -828,17 +829,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.storage.v2.StorageProto - .internal_static_google_storage_v2_Notification_descriptor; + .internal_static_google_storage_v2_NotificationConfig_descriptor; } @java.lang.Override - public com.google.storage.v2.Notification getDefaultInstanceForType() { - return com.google.storage.v2.Notification.getDefaultInstance(); + public com.google.storage.v2.NotificationConfig getDefaultInstanceForType() { + return com.google.storage.v2.NotificationConfig.getDefaultInstance(); } @java.lang.Override - public com.google.storage.v2.Notification build() { - com.google.storage.v2.Notification result = buildPartial(); + public com.google.storage.v2.NotificationConfig build() { + com.google.storage.v2.NotificationConfig result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -846,8 +847,9 @@ public com.google.storage.v2.Notification build() { } @java.lang.Override - public com.google.storage.v2.Notification buildPartial() { - com.google.storage.v2.Notification result = new com.google.storage.v2.Notification(this); + public com.google.storage.v2.NotificationConfig buildPartial() { + com.google.storage.v2.NotificationConfig result = + new com.google.storage.v2.NotificationConfig(this); buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); @@ -856,7 +858,7 @@ public com.google.storage.v2.Notification buildPartial() { return result; } - private void buildPartialRepeatedFields(com.google.storage.v2.Notification result) { + private void buildPartialRepeatedFields(com.google.storage.v2.NotificationConfig result) { if (((bitField0_ & 0x00000008) != 0)) { eventTypes_ = eventTypes_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000008); @@ -864,7 +866,7 @@ private void buildPartialRepeatedFields(com.google.storage.v2.Notification resul result.eventTypes_ = eventTypes_; } - private void buildPartial0(com.google.storage.v2.Notification result) { + private void buildPartial0(com.google.storage.v2.NotificationConfig result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.name_ = name_; @@ -922,16 +924,16 @@ public Builder addRepeatedField( @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); + if (other instanceof com.google.storage.v2.NotificationConfig) { + return mergeFrom((com.google.storage.v2.NotificationConfig) 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; + public Builder mergeFrom(com.google.storage.v2.NotificationConfig other) { + if (other == com.google.storage.v2.NotificationConfig.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; bitField0_ |= 0x00000001; @@ -1069,9 +1071,9 @@ public Builder mergeFrom( * * *
-     * Required. The resource name of this notification.
+     * Required. The resource name of this NotificationConfig.
      * Format:
-     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
+     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig}`
      * The `{project}` portion may be `_` for globally unique buckets.
      * 
* @@ -1094,9 +1096,9 @@ public java.lang.String getName() { * * *
-     * Required. The resource name of this notification.
+     * Required. The resource name of this NotificationConfig.
      * Format:
-     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
+     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig}`
      * The `{project}` portion may be `_` for globally unique buckets.
      * 
* @@ -1119,9 +1121,9 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * Required. The resource name of this notification.
+     * Required. The resource name of this NotificationConfig.
      * Format:
-     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
+     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig}`
      * The `{project}` portion may be `_` for globally unique buckets.
      * 
* @@ -1143,9 +1145,9 @@ public Builder setName(java.lang.String value) { * * *
-     * Required. The resource name of this notification.
+     * Required. The resource name of this NotificationConfig.
      * Format:
-     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
+     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig}`
      * The `{project}` portion may be `_` for globally unique buckets.
      * 
* @@ -1163,9 +1165,9 @@ public Builder clearName() { * * *
-     * Required. The resource name of this notification.
+     * Required. The resource name of this NotificationConfig.
      * Format:
-     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
+     * `projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig}`
      * The `{project}` portion may be `_` for globally unique buckets.
      * 
* @@ -1306,9 +1308,9 @@ public Builder setTopicBytes(com.google.protobuf.ByteString value) { * * *
-     * The etag of the Notification.
-     * If included in the metadata of GetNotificationRequest, the operation will
-     * only be performed if the etag matches that of the Notification.
+     * The etag of the NotificationConfig.
+     * If included in the metadata of GetNotificationConfigRequest, the operation
+     * will only be performed if the etag matches that of the NotificationConfig.
      * 
* * string etag = 7; @@ -1330,9 +1332,9 @@ public java.lang.String getEtag() { * * *
-     * The etag of the Notification.
-     * If included in the metadata of GetNotificationRequest, the operation will
-     * only be performed if the etag matches that of the Notification.
+     * The etag of the NotificationConfig.
+     * If included in the metadata of GetNotificationConfigRequest, the operation
+     * will only be performed if the etag matches that of the NotificationConfig.
      * 
* * string etag = 7; @@ -1354,9 +1356,9 @@ public com.google.protobuf.ByteString getEtagBytes() { * * *
-     * The etag of the Notification.
-     * If included in the metadata of GetNotificationRequest, the operation will
-     * only be performed if the etag matches that of the Notification.
+     * The etag of the NotificationConfig.
+     * If included in the metadata of GetNotificationConfigRequest, the operation
+     * will only be performed if the etag matches that of the NotificationConfig.
      * 
* * string etag = 7; @@ -1377,9 +1379,9 @@ public Builder setEtag(java.lang.String value) { * * *
-     * The etag of the Notification.
-     * If included in the metadata of GetNotificationRequest, the operation will
-     * only be performed if the etag matches that of the Notification.
+     * The etag of the NotificationConfig.
+     * If included in the metadata of GetNotificationConfigRequest, the operation
+     * will only be performed if the etag matches that of the NotificationConfig.
      * 
* * string etag = 7; @@ -1396,9 +1398,9 @@ public Builder clearEtag() { * * *
-     * The etag of the Notification.
-     * If included in the metadata of GetNotificationRequest, the operation will
-     * only be performed if the etag matches that of the Notification.
+     * The etag of the NotificationConfig.
+     * If included in the metadata of GetNotificationConfigRequest, the operation
+     * will only be performed if the etag matches that of the NotificationConfig.
      * 
* * string etag = 7; @@ -1430,8 +1432,8 @@ private void ensureEventTypesIsMutable() { * * *
-     * If present, only send notifications about listed event types. If empty,
-     * sent notifications for all event types.
+     * If present, only send notifications about listed event types. If
+     * empty, sent notifications for all event types.
      * 
* * repeated string event_types = 3; @@ -1445,8 +1447,8 @@ public com.google.protobuf.ProtocolStringList getEventTypesList() { * * *
-     * If present, only send notifications about listed event types. If empty,
-     * sent notifications for all event types.
+     * If present, only send notifications about listed event types. If
+     * empty, sent notifications for all event types.
      * 
* * repeated string event_types = 3; @@ -1460,8 +1462,8 @@ public int getEventTypesCount() { * * *
-     * If present, only send notifications about listed event types. If empty,
-     * sent notifications for all event types.
+     * If present, only send notifications about listed event types. If
+     * empty, sent notifications for all event types.
      * 
* * repeated string event_types = 3; @@ -1476,8 +1478,8 @@ public java.lang.String getEventTypes(int index) { * * *
-     * If present, only send notifications about listed event types. If empty,
-     * sent notifications for all event types.
+     * If present, only send notifications about listed event types. If
+     * empty, sent notifications for all event types.
      * 
* * repeated string event_types = 3; @@ -1492,8 +1494,8 @@ public com.google.protobuf.ByteString getEventTypesBytes(int index) { * * *
-     * If present, only send notifications about listed event types. If empty,
-     * sent notifications for all event types.
+     * If present, only send notifications about listed event types. If
+     * empty, sent notifications for all event types.
      * 
* * repeated string event_types = 3; @@ -1515,8 +1517,8 @@ public Builder setEventTypes(int index, java.lang.String value) { * * *
-     * If present, only send notifications about listed event types. If empty,
-     * sent notifications for all event types.
+     * If present, only send notifications about listed event types. If
+     * empty, sent notifications for all event types.
      * 
* * repeated string event_types = 3; @@ -1537,8 +1539,8 @@ public Builder addEventTypes(java.lang.String value) { * * *
-     * If present, only send notifications about listed event types. If empty,
-     * sent notifications for all event types.
+     * If present, only send notifications about listed event types. If
+     * empty, sent notifications for all event types.
      * 
* * repeated string event_types = 3; @@ -1556,8 +1558,8 @@ public Builder addAllEventTypes(java.lang.Iterable values) { * * *
-     * If present, only send notifications about listed event types. If empty,
-     * sent notifications for all event types.
+     * If present, only send notifications about listed event types. If
+     * empty, sent notifications for all event types.
      * 
* * repeated string event_types = 3; @@ -1574,8 +1576,8 @@ public Builder clearEventTypes() { * * *
-     * If present, only send notifications about listed event types. If empty,
-     * sent notifications for all event types.
+     * If present, only send notifications about listed event types. If
+     * empty, sent notifications for all event types.
      * 
* * repeated string event_types = 3; @@ -1628,7 +1630,7 @@ public int getCustomAttributesCount() { * *
      * A list of additional attributes to attach to each Pub/Sub
-     * message published for this notification subscription.
+     * message published for this NotificationConfig.
      * 
* * map<string, string> custom_attributes = 4; @@ -1651,7 +1653,7 @@ public java.util.Map getCustomAttributes() { * *
      * A list of additional attributes to attach to each Pub/Sub
-     * message published for this notification subscription.
+     * message published for this NotificationConfig.
      * 
* * map<string, string> custom_attributes = 4; @@ -1665,7 +1667,7 @@ public java.util.Map getCustomAttributesMap( * *
      * A list of additional attributes to attach to each Pub/Sub
-     * message published for this notification subscription.
+     * message published for this NotificationConfig.
      * 
* * map<string, string> custom_attributes = 4; @@ -1687,7 +1689,7 @@ public java.util.Map getCustomAttributesMap( * *
      * A list of additional attributes to attach to each Pub/Sub
-     * message published for this notification subscription.
+     * message published for this NotificationConfig.
      * 
* * map<string, string> custom_attributes = 4; @@ -1715,7 +1717,7 @@ public Builder clearCustomAttributes() { * *
      * A list of additional attributes to attach to each Pub/Sub
-     * message published for this notification subscription.
+     * message published for this NotificationConfig.
      * 
* * map<string, string> custom_attributes = 4; @@ -1738,7 +1740,7 @@ public java.util.Map getMutableCustomAttribu * *
      * A list of additional attributes to attach to each Pub/Sub
-     * message published for this notification subscription.
+     * message published for this NotificationConfig.
      * 
* * map<string, string> custom_attributes = 4; @@ -1759,7 +1761,7 @@ public Builder putCustomAttributes(java.lang.String key, java.lang.String value) * *
      * A list of additional attributes to attach to each Pub/Sub
-     * message published for this notification subscription.
+     * message published for this NotificationConfig.
      * 
* * map<string, string> custom_attributes = 4; @@ -1776,7 +1778,7 @@ public Builder putAllCustomAttributes( * * *
-     * If present, only apply this notification config to object names that
+     * If present, only apply this NotificationConfig to object names that
      * begin with this prefix.
      * 
* @@ -1799,7 +1801,7 @@ public java.lang.String getObjectNamePrefix() { * * *
-     * If present, only apply this notification config to object names that
+     * If present, only apply this NotificationConfig to object names that
      * begin with this prefix.
      * 
* @@ -1822,7 +1824,7 @@ public com.google.protobuf.ByteString getObjectNamePrefixBytes() { * * *
-     * If present, only apply this notification config to object names that
+     * If present, only apply this NotificationConfig to object names that
      * begin with this prefix.
      * 
* @@ -1844,7 +1846,7 @@ public Builder setObjectNamePrefix(java.lang.String value) { * * *
-     * If present, only apply this notification config to object names that
+     * If present, only apply this NotificationConfig to object names that
      * begin with this prefix.
      * 
* @@ -1862,7 +1864,7 @@ public Builder clearObjectNamePrefix() { * * *
-     * If present, only apply this notification config to object names that
+     * If present, only apply this NotificationConfig to object names that
      * begin with this prefix.
      * 
* @@ -1999,24 +2001,24 @@ public final Builder mergeUnknownFields( return super.mergeUnknownFields(unknownFields); } - // @@protoc_insertion_point(builder_scope:google.storage.v2.Notification) + // @@protoc_insertion_point(builder_scope:google.storage.v2.NotificationConfig) } - // @@protoc_insertion_point(class_scope:google.storage.v2.Notification) - private static final com.google.storage.v2.Notification DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:google.storage.v2.NotificationConfig) + private static final com.google.storage.v2.NotificationConfig DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.google.storage.v2.Notification(); + DEFAULT_INSTANCE = new com.google.storage.v2.NotificationConfig(); } - public static com.google.storage.v2.Notification getDefaultInstance() { + public static com.google.storage.v2.NotificationConfig getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { @java.lang.Override - public Notification parsePartialFrom( + public NotificationConfig parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -2035,17 +2037,17 @@ public Notification parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.google.storage.v2.Notification getDefaultInstanceForType() { + public com.google.storage.v2.NotificationConfig 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/NotificationConfigName.java similarity index 62% rename from proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/NotificationName.java rename to proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/NotificationConfigName.java index 0476d45605..c0f775b0df 100644 --- 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/NotificationConfigName.java @@ -28,26 +28,26 @@ // AUTO-GENERATED DOCUMENTATION AND CLASS. @Generated("by gapic-generator-java") -public class NotificationName implements ResourceName { - private static final PathTemplate PROJECT_BUCKET_NOTIFICATION = +public class NotificationConfigName implements ResourceName { + private static final PathTemplate PROJECT_BUCKET_NOTIFICATION_CONFIG = PathTemplate.createWithoutUrlEncoding( - "projects/{project}/buckets/{bucket}/notificationConfigs/{notification}"); + "projects/{project}/buckets/{bucket}/notificationConfigs/{notification_config}"); private volatile Map fieldValuesMap; private final String project; private final String bucket; - private final String notification; + private final String notificationConfig; @Deprecated - protected NotificationName() { + protected NotificationConfigName() { project = null; bucket = null; - notification = null; + notificationConfig = null; } - private NotificationName(Builder builder) { + private NotificationConfigName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); bucket = Preconditions.checkNotNull(builder.getBucket()); - notification = Preconditions.checkNotNull(builder.getNotification()); + notificationConfig = Preconditions.checkNotNull(builder.getNotificationConfig()); } public String getProject() { @@ -58,8 +58,8 @@ public String getBucket() { return bucket; } - public String getNotification() { - return notification; + public String getNotificationConfig() { + return notificationConfig; } public static Builder newBuilder() { @@ -70,40 +70,45 @@ 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 NotificationConfigName of( + String project, String bucket, String notificationConfig) { + return newBuilder() + .setProject(project) + .setBucket(bucket) + .setNotificationConfig(notificationConfig) + .build(); } - public static String format(String project, String bucket, String notification) { + public static String format(String project, String bucket, String notificationConfig) { return newBuilder() .setProject(project) .setBucket(bucket) - .setNotification(notification) + .setNotificationConfig(notificationConfig) .build() .toString(); } - public static NotificationName parse(String formattedString) { + public static NotificationConfigName 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")); + PROJECT_BUCKET_NOTIFICATION_CONFIG.validatedMatch( + formattedString, "NotificationConfigName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("bucket"), matchMap.get("notification_config")); } - public static List parseList(List formattedStrings) { - List list = new ArrayList<>(formattedStrings.size()); + 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) { + public static List toStringList(List values) { List list = new ArrayList<>(values.size()); - for (NotificationName value : values) { + for (NotificationConfigName value : values) { if (value == null) { list.add(""); } else { @@ -114,7 +119,7 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PROJECT_BUCKET_NOTIFICATION.matches(formattedString); + return PROJECT_BUCKET_NOTIFICATION_CONFIG.matches(formattedString); } @Override @@ -129,8 +134,8 @@ public Map getFieldValuesMap() { if (bucket != null) { fieldMapBuilder.put("bucket", bucket); } - if (notification != null) { - fieldMapBuilder.put("notification", notification); + if (notificationConfig != null) { + fieldMapBuilder.put("notification_config", notificationConfig); } fieldValuesMap = fieldMapBuilder.build(); } @@ -145,8 +150,8 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PROJECT_BUCKET_NOTIFICATION.instantiate( - "project", project, "bucket", bucket, "notification", notification); + return PROJECT_BUCKET_NOTIFICATION_CONFIG.instantiate( + "project", project, "bucket", bucket, "notification_config", notificationConfig); } @Override @@ -155,10 +160,10 @@ public boolean equals(java.lang.Object o) { return true; } if (o != null || getClass() == o.getClass()) { - NotificationName that = ((NotificationName) o); + NotificationConfigName that = ((NotificationConfigName) o); return Objects.equals(this.project, that.project) && Objects.equals(this.bucket, that.bucket) - && Objects.equals(this.notification, that.notification); + && Objects.equals(this.notificationConfig, that.notificationConfig); } return false; } @@ -171,15 +176,15 @@ public int hashCode() { h *= 1000003; h ^= Objects.hashCode(bucket); h *= 1000003; - h ^= Objects.hashCode(notification); + h ^= Objects.hashCode(notificationConfig); return h; } - /** Builder for projects/{project}/buckets/{bucket}/notificationConfigs/{notification}. */ + /** Builder for projects/{project}/buckets/{bucket}/notificationConfigs/{notification_config}. */ public static class Builder { private String project; private String bucket; - private String notification; + private String notificationConfig; protected Builder() {} @@ -191,8 +196,8 @@ public String getBucket() { return bucket; } - public String getNotification() { - return notification; + public String getNotificationConfig() { + return notificationConfig; } public Builder setProject(String project) { @@ -205,19 +210,19 @@ public Builder setBucket(String bucket) { return this; } - public Builder setNotification(String notification) { - this.notification = notification; + public Builder setNotificationConfig(String notificationConfig) { + this.notificationConfig = notificationConfig; return this; } - private Builder(NotificationName notificationName) { - this.project = notificationName.project; - this.bucket = notificationName.bucket; - this.notification = notificationName.notification; + private Builder(NotificationConfigName notificationConfigName) { + this.project = notificationConfigName.project; + this.bucket = notificationConfigName.bucket; + this.notificationConfig = notificationConfigName.notificationConfig; } - public NotificationName build() { - return new NotificationName(this); + public NotificationConfigName build() { + return new NotificationConfigName(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/NotificationConfigOrBuilder.java similarity index 83% rename from proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/NotificationOrBuilder.java rename to proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/NotificationConfigOrBuilder.java index 7d932c6f76..8a65871053 100644 --- 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/NotificationConfigOrBuilder.java @@ -18,18 +18,18 @@ package com.google.storage.v2; -public interface NotificationOrBuilder +public interface NotificationConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.storage.v2.Notification) + // @@protoc_insertion_point(interface_extends:google.storage.v2.NotificationConfig) com.google.protobuf.MessageOrBuilder { /** * * *
-   * Required. The resource name of this notification.
+   * Required. The resource name of this NotificationConfig.
    * Format:
-   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
+   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig}`
    * The `{project}` portion may be `_` for globally unique buckets.
    * 
* @@ -42,9 +42,9 @@ public interface NotificationOrBuilder * * *
-   * Required. The resource name of this notification.
+   * Required. The resource name of this NotificationConfig.
    * Format:
-   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
+   * `projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig}`
    * The `{project}` portion may be `_` for globally unique buckets.
    * 
* @@ -87,9 +87,9 @@ public interface NotificationOrBuilder * * *
-   * The etag of the Notification.
-   * If included in the metadata of GetNotificationRequest, the operation will
-   * only be performed if the etag matches that of the Notification.
+   * The etag of the NotificationConfig.
+   * If included in the metadata of GetNotificationConfigRequest, the operation
+   * will only be performed if the etag matches that of the NotificationConfig.
    * 
* * string etag = 7; @@ -101,9 +101,9 @@ public interface NotificationOrBuilder * * *
-   * The etag of the Notification.
-   * If included in the metadata of GetNotificationRequest, the operation will
-   * only be performed if the etag matches that of the Notification.
+   * The etag of the NotificationConfig.
+   * If included in the metadata of GetNotificationConfigRequest, the operation
+   * will only be performed if the etag matches that of the NotificationConfig.
    * 
* * string etag = 7; @@ -116,8 +116,8 @@ public interface NotificationOrBuilder * * *
-   * If present, only send notifications about listed event types. If empty,
-   * sent notifications for all event types.
+   * If present, only send notifications about listed event types. If
+   * empty, sent notifications for all event types.
    * 
* * repeated string event_types = 3; @@ -129,8 +129,8 @@ public interface NotificationOrBuilder * * *
-   * If present, only send notifications about listed event types. If empty,
-   * sent notifications for all event types.
+   * If present, only send notifications about listed event types. If
+   * empty, sent notifications for all event types.
    * 
* * repeated string event_types = 3; @@ -142,8 +142,8 @@ public interface NotificationOrBuilder * * *
-   * If present, only send notifications about listed event types. If empty,
-   * sent notifications for all event types.
+   * If present, only send notifications about listed event types. If
+   * empty, sent notifications for all event types.
    * 
* * repeated string event_types = 3; @@ -156,8 +156,8 @@ public interface NotificationOrBuilder * * *
-   * If present, only send notifications about listed event types. If empty,
-   * sent notifications for all event types.
+   * If present, only send notifications about listed event types. If
+   * empty, sent notifications for all event types.
    * 
* * repeated string event_types = 3; @@ -172,7 +172,7 @@ public interface NotificationOrBuilder * *
    * A list of additional attributes to attach to each Pub/Sub
-   * message published for this notification subscription.
+   * message published for this NotificationConfig.
    * 
* * map<string, string> custom_attributes = 4; @@ -183,7 +183,7 @@ public interface NotificationOrBuilder * *
    * A list of additional attributes to attach to each Pub/Sub
-   * message published for this notification subscription.
+   * message published for this NotificationConfig.
    * 
* * map<string, string> custom_attributes = 4; @@ -197,7 +197,7 @@ public interface NotificationOrBuilder * *
    * A list of additional attributes to attach to each Pub/Sub
-   * message published for this notification subscription.
+   * message published for this NotificationConfig.
    * 
* * map<string, string> custom_attributes = 4; @@ -208,7 +208,7 @@ public interface NotificationOrBuilder * *
    * A list of additional attributes to attach to each Pub/Sub
-   * message published for this notification subscription.
+   * message published for this NotificationConfig.
    * 
* * map<string, string> custom_attributes = 4; @@ -223,7 +223,7 @@ java.lang.String getCustomAttributesOrDefault( * *
    * A list of additional attributes to attach to each Pub/Sub
-   * message published for this notification subscription.
+   * message published for this NotificationConfig.
    * 
* * map<string, string> custom_attributes = 4; @@ -234,7 +234,7 @@ java.lang.String getCustomAttributesOrDefault( * * *
-   * If present, only apply this notification config to object names that
+   * If present, only apply this NotificationConfig to object names that
    * begin with this prefix.
    * 
* @@ -247,7 +247,7 @@ java.lang.String getCustomAttributesOrDefault( * * *
-   * If present, only apply this notification config to object names that
+   * If present, only apply this NotificationConfig to object names that
    * begin with this prefix.
    * 
* diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageProto.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageProto.java index 6c9b1a3787..2b7e581dca 100644 --- a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageProto.java +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageProto.java @@ -56,25 +56,25 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r 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; + internal_static_google_storage_v2_DeleteNotificationConfigRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_DeleteNotificationRequest_fieldAccessorTable; + internal_static_google_storage_v2_DeleteNotificationConfigRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_GetNotificationRequest_descriptor; + internal_static_google_storage_v2_GetNotificationConfigRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_GetNotificationRequest_fieldAccessorTable; + internal_static_google_storage_v2_GetNotificationConfigRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_CreateNotificationRequest_descriptor; + internal_static_google_storage_v2_CreateNotificationConfigRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_CreateNotificationRequest_fieldAccessorTable; + internal_static_google_storage_v2_CreateNotificationConfigRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_ListNotificationsRequest_descriptor; + internal_static_google_storage_v2_ListNotificationConfigsRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_ListNotificationsRequest_fieldAccessorTable; + internal_static_google_storage_v2_ListNotificationConfigsRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_ListNotificationsResponse_descriptor; + internal_static_google_storage_v2_ListNotificationConfigsResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_ListNotificationsResponse_fieldAccessorTable; + internal_static_google_storage_v2_ListNotificationConfigsResponse_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_storage_v2_ComposeObjectRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -280,13 +280,13 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r 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; + internal_static_google_storage_v2_NotificationConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_Notification_fieldAccessorTable; + internal_static_google_storage_v2_NotificationConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_storage_v2_Notification_CustomAttributesEntry_descriptor; + internal_static_google_storage_v2_NotificationConfig_CustomAttributesEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_storage_v2_Notification_CustomAttributesEntry_fieldAccessorTable; + internal_static_google_storage_v2_NotificationConfig_CustomAttributesEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_storage_v2_CustomerEncryption_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -378,497 +378,501 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "default_object_acl\030\t \001(\t\0224\n\013update_mask\030" + "\006 \001(\0132\032.google.protobuf.FieldMaskB\003\340A\002B\032" + "\n\030_if_metageneration_matchB\036\n\034_if_metage" - + "neration_not_match\"V\n\031DeleteNotification" - + "Request\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#storage.g" - + "oogleapis.com/Notification\"M\n\026GetNotific" - + "ationRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035stor" - + "age.googleapis.com/Bucket\"\216\001\n\031CreateNoti" - + "ficationRequest\0225\n\006parent\030\001 \001(\tB%\340A\002\372A\037\022" - + "\035storage.googleapis.com/Bucket\022:\n\014notifi" - + "cation\030\002 \001(\0132\037.google.storage.v2.Notific" - + "ationB\003\340A\002\"x\n\030ListNotificationsRequest\0225" - + "\n\006parent\030\001 \001(\tB%\340A\002\372A\037\022\035storage.googleap" - + "is.com/Bucket\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage" - + "_token\030\003 \001(\t\"l\n\031ListNotificationsRespons" - + "e\0226\n\rnotifications\030\001 \003(\0132\037.google.storag" - + "e.v2.Notification\022\027\n\017next_page_token\030\002 \001" - + "(\t\"\365\005\n\024ComposeObjectRequest\0223\n\013destinati" - + "on\030\001 \001(\0132\031.google.storage.v2.ObjectB\003\340A\002" - + "\022L\n\016source_objects\030\002 \003(\01324.google.storag" - + "e.v2.ComposeObjectRequest.SourceObject\022\"" - + "\n\032destination_predefined_acl\030\t \001(\t\022 \n\023if" - + "_generation_match\030\004 \001(\003H\000\210\001\001\022$\n\027if_metag" - + "eneration_match\030\005 \001(\003H\001\210\001\001\0227\n\007kms_key\030\006 " - + "\001(\tB&\372A#\n!cloudkms.googleapis.com/Crypto" - + "Key\022R\n\034common_object_request_params\030\007 \001(" - + "\0132,.google.storage.v2.CommonObjectReques" - + "tParams\022<\n\020object_checksums\030\n \001(\0132\".goog" - + "le.storage.v2.ObjectChecksums\032\356\001\n\014Source" - + "Object\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\022\n\ngeneration\030" - + "\002 \001(\003\022f\n\024object_preconditions\030\003 \001(\0132H.go" - + "ogle.storage.v2.ComposeObjectRequest.Sou" - + "rceObject.ObjectPreconditions\032O\n\023ObjectP" - + "reconditions\022 \n\023if_generation_match\030\001 \001(" - + "\003H\000\210\001\001B\026\n\024_if_generation_matchB\026\n\024_if_ge" - + "neration_matchB\032\n\030_if_metageneration_mat" - + "ch\"\257\003\n\023DeleteObjectRequest\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\ngenerati" - + "on\030\004 \001(\003\022 \n\023if_generation_match\030\005 \001(\003H\000\210" - + "\001\001\022$\n\027if_generation_not_match\030\006 \001(\003H\001\210\001\001" - + "\022$\n\027if_metageneration_match\030\007 \001(\003H\002\210\001\001\022(" - + "\n\033if_metageneration_not_match\030\010 \001(\003H\003\210\001\001" - + "\022R\n\034common_object_request_params\030\n \001(\0132," - + ".google.storage.v2.CommonObjectRequestPa" - + "ramsB\026\n\024_if_generation_matchB\032\n\030_if_gene" - + "ration_not_matchB\032\n\030_if_metageneration_m" - + "atchB\036\n\034_if_metageneration_not_match\"5\n\033" - + "CancelResumableWriteRequest\022\026\n\tupload_id" - + "\030\001 \001(\tB\003\340A\002\"\036\n\034CancelResumableWriteRespo" - + "nse\"\230\004\n\021ReadObjectRequest\022\023\n\006bucket\030\001 \001(" + + "neration_not_match\"b\n\037DeleteNotification" + + "ConfigRequest\022?\n\004name\030\001 \001(\tB1\340A\002\372A+\n)sto" + + "rage.googleapis.com/NotificationConfig\"S" + + "\n\034GetNotificationConfigRequest\0223\n\004name\030\001" + + " \001(\tB%\340A\002\372A\037\n\035storage.googleapis.com/Buc" + + "ket\"\241\001\n\037CreateNotificationConfigRequest\022" + + "5\n\006parent\030\001 \001(\tB%\340A\002\372A\037\022\035storage.googlea" + + "pis.com/Bucket\022G\n\023notification_config\030\002 " + + "\001(\0132%.google.storage.v2.NotificationConf" + + "igB\003\340A\002\"~\n\036ListNotificationConfigsReques" + + "t\0225\n\006parent\030\001 \001(\tB%\340A\002\372A\037\022\035storage.googl" + + "eapis.com/Bucket\022\021\n\tpage_size\030\002 \001(\005\022\022\n\np" + + "age_token\030\003 \001(\t\"\177\n\037ListNotificationConfi" + + "gsResponse\022C\n\024notification_configs\030\001 \003(\013" + + "2%.google.storage.v2.NotificationConfig\022" + + "\027\n\017next_page_token\030\002 \001(\t\"\365\005\n\024ComposeObje" + + "ctRequest\0223\n\013destination\030\001 \001(\0132\031.google." + + "storage.v2.ObjectB\003\340A\002\022L\n\016source_objects" + + "\030\002 \003(\01324.google.storage.v2.ComposeObject" + + "Request.SourceObject\022\"\n\032destination_pred" + + "efined_acl\030\t \001(\t\022 \n\023if_generation_match\030" + + "\004 \001(\003H\000\210\001\001\022$\n\027if_metageneration_match\030\005 " + + "\001(\003H\001\210\001\001\0227\n\007kms_key\030\006 \001(\tB&\372A#\n!cloudkms" + + ".googleapis.com/CryptoKey\022R\n\034common_obje" + + "ct_request_params\030\007 \001(\0132,.google.storage" + + ".v2.CommonObjectRequestParams\022<\n\020object_" + + "checksums\030\n \001(\0132\".google.storage.v2.Obje" + + "ctChecksums\032\356\001\n\014SourceObject\022\021\n\004name\030\001 \001" + + "(\tB\003\340A\002\022\022\n\ngeneration\030\002 \001(\003\022f\n\024object_pr" + + "econditions\030\003 \001(\0132H.google.storage.v2.Co" + + "mposeObjectRequest.SourceObject.ObjectPr" + + "econditions\032O\n\023ObjectPreconditions\022 \n\023if" + + "_generation_match\030\001 \001(\003H\000\210\001\001B\026\n\024_if_gene" + + "ration_matchB\026\n\024_if_generation_matchB\032\n\030" + + "_if_metageneration_match\"\257\003\n\023DeleteObjec" + + "tRequest\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\004 \001(\003\022 \n\023if_gen" + + "eration_match\030\005 \001(\003H\000\210\001\001\022$\n\027if_generatio" + + "n_not_match\030\006 \001(\003H\001\210\001\001\022$\n\027if_metagenerat" + + "ion_match\030\007 \001(\003H\002\210\001\001\022(\n\033if_metageneratio" + + "n_not_match\030\010 \001(\003H\003\210\001\001\022R\n\034common_object_" + + "request_params\030\n \001(\0132,.google.storage.v2" + + ".CommonObjectRequestParamsB\026\n\024_if_genera" + + "tion_matchB\032\n\030_if_generation_not_matchB\032" + + "\n\030_if_metageneration_matchB\036\n\034_if_metage" + + "neration_not_match\"5\n\033CancelResumableWri" + + "teRequest\022\026\n\tupload_id\030\001 \001(\tB\003\340A\002\"\036\n\034Can" + + "celResumableWriteResponse\"\230\004\n\021ReadObject" + + "Request\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\023\n\013read_of" + + "fset\030\004 \001(\003\022\022\n\nread_limit\030\005 \001(\003\022 \n\023if_gen" + + "eration_match\030\006 \001(\003H\000\210\001\001\022$\n\027if_generatio" + + "n_not_match\030\007 \001(\003H\001\210\001\001\022$\n\027if_metagenerat" + + "ion_match\030\010 \001(\003H\002\210\001\001\022(\n\033if_metageneratio" + + "n_not_match\030\t \001(\003H\003\210\001\001\022R\n\034common_object_" + + "request_params\030\n \001(\0132,.google.storage.v2" + + ".CommonObjectRequestParams\0222\n\tread_mask\030" + + "\014 \001(\0132\032.google.protobuf.FieldMaskH\004\210\001\001B\026" + + "\n\024_if_generation_matchB\032\n\030_if_generation" + + "_not_matchB\032\n\030_if_metageneration_matchB\036" + + "\n\034_if_metageneration_not_matchB\014\n\n_read_" + + "mask\"\356\003\n\020GetObjectRequest\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\ngeneratio" - + "n\030\003 \001(\003\022\023\n\013read_offset\030\004 \001(\003\022\022\n\nread_lim" - + "it\030\005 \001(\003\022 \n\023if_generation_match\030\006 \001(\003H\000\210" - + "\001\001\022$\n\027if_generation_not_match\030\007 \001(\003H\001\210\001\001" - + "\022$\n\027if_metageneration_match\030\010 \001(\003H\002\210\001\001\022(" - + "\n\033if_metageneration_not_match\030\t \001(\003H\003\210\001\001" - + "\022R\n\034common_object_request_params\030\n \001(\0132," - + ".google.storage.v2.CommonObjectRequestPa" - + "rams\0222\n\tread_mask\030\014 \001(\0132\032.google.protobu" - + "f.FieldMaskH\004\210\001\001B\026\n\024_if_generation_match" - + "B\032\n\030_if_generation_not_matchB\032\n\030_if_meta" - + "generation_matchB\036\n\034_if_metageneration_n" - + "ot_matchB\014\n\n_read_mask\"\356\003\n\020GetObjectRequ" - + "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\022\n\ngeneration\030\003 \001(\003\022 \n\023if_generati" - + "on_match\030\004 \001(\003H\000\210\001\001\022$\n\027if_generation_not" - + "_match\030\005 \001(\003H\001\210\001\001\022$\n\027if_metageneration_m" - + "atch\030\006 \001(\003H\002\210\001\001\022(\n\033if_metageneration_not" - + "_match\030\007 \001(\003H\003\210\001\001\022R\n\034common_object_reque" - + "st_params\030\010 \001(\0132,.google.storage.v2.Comm" - + "onObjectRequestParams\0222\n\tread_mask\030\n \001(\013" - + "2\032.google.protobuf.FieldMaskH\004\210\001\001B\026\n\024_if" - + "_generation_matchB\032\n\030_if_generation_not_" - + "matchB\032\n\030_if_metageneration_matchB\036\n\034_if" - + "_metageneration_not_matchB\014\n\n_read_mask\"" - + "\365\001\n\022ReadObjectResponse\022<\n\020checksummed_da" - + "ta\030\001 \001(\0132\".google.storage.v2.Checksummed" - + "Data\022<\n\020object_checksums\030\002 \001(\0132\".google." - + "storage.v2.ObjectChecksums\0226\n\rcontent_ra" - + "nge\030\003 \001(\0132\037.google.storage.v2.ContentRan" - + "ge\022+\n\010metadata\030\004 \001(\0132\031.google.storage.v2" - + ".Object\"\215\003\n\017WriteObjectSpec\0220\n\010resource\030" - + "\001 \001(\0132\031.google.storage.v2.ObjectB\003\340A\002\022\026\n" - + "\016predefined_acl\030\007 \001(\t\022 \n\023if_generation_m" - + "atch\030\003 \001(\003H\000\210\001\001\022$\n\027if_generation_not_mat" - + "ch\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_mat" - + "ch\030\006 \001(\003H\003\210\001\001\022\030\n\013object_size\030\010 \001(\003H\004\210\001\001B" - + "\026\n\024_if_generation_matchB\032\n\030_if_generatio" - + "n_not_matchB\032\n\030_if_metageneration_matchB" - + "\036\n\034_if_metageneration_not_matchB\016\n\014_obje" - + "ct_size\"\206\003\n\022WriteObjectRequest\022\023\n\tupload" - + "_id\030\001 \001(\tH\000\022?\n\021write_object_spec\030\002 \001(\0132\"" - + ".google.storage.v2.WriteObjectSpecH\000\022\031\n\014" - + "write_offset\030\003 \001(\003B\003\340A\002\022>\n\020checksummed_d" - + "ata\030\004 \001(\0132\".google.storage.v2.Checksumme" - + "dDataH\001\022<\n\020object_checksums\030\006 \001(\0132\".goog" - + "le.storage.v2.ObjectChecksums\022\024\n\014finish_" - + "write\030\007 \001(\010\022R\n\034common_object_request_par" - + "ams\030\010 \001(\0132,.google.storage.v2.CommonObje" - + "ctRequestParamsB\017\n\rfirst_messageB\006\n\004data" - + "\"n\n\023WriteObjectResponse\022\030\n\016persisted_siz" - + "e\030\001 \001(\003H\000\022-\n\010resource\030\002 \001(\0132\031.google.sto" - + "rage.v2.ObjectH\000B\016\n\014write_status\"\317\002\n\022Lis" - + "tObjectsRequest\0225\n\006parent\030\001 \001(\tB%\340A\002\372A\037\022" - + "\035storage.googleapis.com/Bucket\022\021\n\tpage_s" - + "ize\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\021\n\tdelimit" - + "er\030\004 \001(\t\022\"\n\032include_trailing_delimiter\030\005" - + " \001(\010\022\016\n\006prefix\030\006 \001(\t\022\020\n\010versions\030\007 \001(\010\0222" - + "\n\tread_mask\030\010 \001(\0132\032.google.protobuf.Fiel" - + "dMaskH\000\210\001\001\022 \n\023lexicographic_start\030\n \001(\tB" - + "\003\340A\001\022\036\n\021lexicographic_end\030\013 \001(\tB\003\340A\001B\014\n\n" - + "_read_mask\"\205\001\n\027QueryWriteStatusRequest\022\026" - + "\n\tupload_id\030\001 \001(\tB\003\340A\002\022R\n\034common_object_" - + "request_params\030\002 \001(\0132,.google.storage.v2" - + ".CommonObjectRequestParams\"s\n\030QueryWrite" - + "StatusResponse\022\030\n\016persisted_size\030\001 \001(\003H\000" - + "\022-\n\010resource\030\002 \001(\0132\031.google.storage.v2.O" - + "bjectH\000B\016\n\014write_status\"\206\n\n\024RewriteObjec" - + "tRequest\022 \n\020destination_name\030\030 \001(\tB\006\340A\002\340" - + "A\005\022D\n\022destination_bucket\030\031 \001(\tB(\340A\002\340A\005\372A" - + "\037\n\035storage.googleapis.com/Bucket\022C\n\023dest" - + "ination_kms_key\030\033 \001(\tB&\372A#\n!cloudkms.goo" - + "gleapis.com/CryptoKey\022.\n\013destination\030\001 \001" - + "(\0132\031.google.storage.v2.Object\022\032\n\rsource_" - + "bucket\030\002 \001(\tB\003\340A\002\022\032\n\rsource_object\030\003 \001(\t" - + "B\003\340A\002\022\031\n\021source_generation\030\004 \001(\003\022\025\n\rrewr" - + "ite_token\030\005 \001(\t\022\"\n\032destination_predefine" - + "d_acl\030\034 \001(\t\022 \n\023if_generation_match\030\007 \001(\003" - + "H\000\210\001\001\022$\n\027if_generation_not_match\030\010 \001(\003H\001" - + "\210\001\001\022$\n\027if_metageneration_match\030\t \001(\003H\002\210\001" - + "\001\022(\n\033if_metageneration_not_match\030\n \001(\003H\003" - + "\210\001\001\022\'\n\032if_source_generation_match\030\013 \001(\003H" - + "\004\210\001\001\022+\n\036if_source_generation_not_match\030\014" - + " \001(\003H\005\210\001\001\022+\n\036if_source_metageneration_ma" - + "tch\030\r \001(\003H\006\210\001\001\022/\n\"if_source_metagenerati" - + "on_not_match\030\016 \001(\003H\007\210\001\001\022$\n\034max_bytes_rew" - + "ritten_per_call\030\017 \001(\003\022(\n copy_source_enc" - + "ryption_algorithm\030\020 \001(\t\022(\n copy_source_e" - + "ncryption_key_bytes\030\025 \001(\014\022/\n\'copy_source" - + "_encryption_key_sha256_bytes\030\026 \001(\014\022R\n\034co" - + "mmon_object_request_params\030\023 \001(\0132,.googl" - + "e.storage.v2.CommonObjectRequestParams\022<" - + "\n\020object_checksums\030\035 \001(\0132\".google.storag" - + "e.v2.ObjectChecksumsB\026\n\024_if_generation_m" - + "atchB\032\n\030_if_generation_not_matchB\032\n\030_if_" - + "metageneration_matchB\036\n\034_if_metagenerati" - + "on_not_matchB\035\n\033_if_source_generation_ma" - + "tchB!\n\037_if_source_generation_not_matchB!" - + "\n\037_if_source_metageneration_matchB%\n#_if" - + "_source_metageneration_not_match\"\227\001\n\017Rew" - + "riteResponse\022\035\n\025total_bytes_rewritten\030\001 " - + "\001(\003\022\023\n\013object_size\030\002 \001(\003\022\014\n\004done\030\003 \001(\010\022\025" - + "\n\rrewrite_token\030\004 \001(\t\022+\n\010resource\030\005 \001(\0132" - + "\031.google.storage.v2.Object\"\362\001\n\032StartResu" - + "mableWriteRequest\022B\n\021write_object_spec\030\001" - + " \001(\0132\".google.storage.v2.WriteObjectSpec" - + "B\003\340A\002\022R\n\034common_object_request_params\030\003 " + + "n\030\003 \001(\003\022 \n\023if_generation_match\030\004 \001(\003H\000\210\001" + + "\001\022$\n\027if_generation_not_match\030\005 \001(\003H\001\210\001\001\022" + + "$\n\027if_metageneration_match\030\006 \001(\003H\002\210\001\001\022(\n" + + "\033if_metageneration_not_match\030\007 \001(\003H\003\210\001\001\022" + + "R\n\034common_object_request_params\030\010 \001(\0132,." + + "google.storage.v2.CommonObjectRequestPar" + + "ams\0222\n\tread_mask\030\n \001(\0132\032.google.protobuf" + + ".FieldMaskH\004\210\001\001B\026\n\024_if_generation_matchB" + + "\032\n\030_if_generation_not_matchB\032\n\030_if_metag" + + "eneration_matchB\036\n\034_if_metageneration_no" + + "t_matchB\014\n\n_read_mask\"\365\001\n\022ReadObjectResp" + + "onse\022<\n\020checksummed_data\030\001 \001(\0132\".google." + + "storage.v2.ChecksummedData\022<\n\020object_che" + + "cksums\030\002 \001(\0132\".google.storage.v2.ObjectC" + + "hecksums\0226\n\rcontent_range\030\003 \001(\0132\037.google" + + ".storage.v2.ContentRange\022+\n\010metadata\030\004 \001" + + "(\0132\031.google.storage.v2.Object\"\215\003\n\017WriteO" + + "bjectSpec\0220\n\010resource\030\001 \001(\0132\031.google.sto" + + "rage.v2.ObjectB\003\340A\002\022\026\n\016predefined_acl\030\007 " + + "\001(\t\022 \n\023if_generation_match\030\003 \001(\003H\000\210\001\001\022$\n" + + "\027if_generation_not_match\030\004 \001(\003H\001\210\001\001\022$\n\027i" + + "f_metageneration_match\030\005 \001(\003H\002\210\001\001\022(\n\033if_" + + "metageneration_not_match\030\006 \001(\003H\003\210\001\001\022\030\n\013o" + + "bject_size\030\010 \001(\003H\004\210\001\001B\026\n\024_if_generation_" + + "matchB\032\n\030_if_generation_not_matchB\032\n\030_if" + + "_metageneration_matchB\036\n\034_if_metagenerat" + + "ion_not_matchB\016\n\014_object_size\"\206\003\n\022WriteO" + + "bjectRequest\022\023\n\tupload_id\030\001 \001(\tH\000\022?\n\021wri" + + "te_object_spec\030\002 \001(\0132\".google.storage.v2" + + ".WriteObjectSpecH\000\022\031\n\014write_offset\030\003 \001(\003" + + "B\003\340A\002\022>\n\020checksummed_data\030\004 \001(\0132\".google" + + ".storage.v2.ChecksummedDataH\001\022<\n\020object_" + + "checksums\030\006 \001(\0132\".google.storage.v2.Obje" + + "ctChecksums\022\024\n\014finish_write\030\007 \001(\010\022R\n\034com" + + "mon_object_request_params\030\010 \001(\0132,.google" + + ".storage.v2.CommonObjectRequestParamsB\017\n" + + "\rfirst_messageB\006\n\004data\"n\n\023WriteObjectRes" + + "ponse\022\030\n\016persisted_size\030\001 \001(\003H\000\022-\n\010resou" + + "rce\030\002 \001(\0132\031.google.storage.v2.ObjectH\000B\016" + + "\n\014write_status\"\317\002\n\022ListObjectsRequest\0225\n" + + "\006parent\030\001 \001(\tB%\340A\002\372A\037\022\035storage.googleapi" + + "s.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\032includ" + + "e_trailing_delimiter\030\005 \001(\010\022\016\n\006prefix\030\006 \001" + + "(\t\022\020\n\010versions\030\007 \001(\010\0222\n\tread_mask\030\010 \001(\0132" + + "\032.google.protobuf.FieldMaskH\000\210\001\001\022 \n\023lexi" + + "cographic_start\030\n \001(\tB\003\340A\001\022\036\n\021lexicograp" + + "hic_end\030\013 \001(\tB\003\340A\001B\014\n\n_read_mask\"\205\001\n\027Que" + + "ryWriteStatusRequest\022\026\n\tupload_id\030\001 \001(\tB" + + "\003\340A\002\022R\n\034common_object_request_params\030\002 \001" + + "(\0132,.google.storage.v2.CommonObjectReque" + + "stParams\"s\n\030QueryWriteStatusResponse\022\030\n\016" + + "persisted_size\030\001 \001(\003H\000\022-\n\010resource\030\002 \001(\013" + + "2\031.google.storage.v2.ObjectH\000B\016\n\014write_s" + + "tatus\"\206\n\n\024RewriteObjectRequest\022 \n\020destin" + + "ation_name\030\030 \001(\tB\006\340A\002\340A\005\022D\n\022destination_" + + "bucket\030\031 \001(\tB(\340A\002\340A\005\372A\037\n\035storage.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\022\"\n" + + "\032destination_predefined_acl\030\034 \001(\t\022 \n\023if_" + + "generation_match\030\007 \001(\003H\000\210\001\001\022$\n\027if_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\022<\n\020object_checksums" + + "\030\035 \001(\0132\".google.storage.v2.ObjectChecksu" + + "msB\026\n\024_if_generation_matchB\032\n\030_if_genera" + + "tion_not_matchB\032\n\030_if_metageneration_mat" + + "chB\036\n\034_if_metageneration_not_matchB\035\n\033_i" + + "f_source_generation_matchB!\n\037_if_source_" + + "generation_not_matchB!\n\037_if_source_metag" + + "eneration_matchB%\n#_if_source_metagenera" + + "tion_not_match\"\227\001\n\017RewriteResponse\022\035\n\025to" + + "tal_bytes_rewritten\030\001 \001(\003\022\023\n\013object_size" + + "\030\002 \001(\003\022\014\n\004done\030\003 \001(\010\022\025\n\rrewrite_token\030\004 " + + "\001(\t\022+\n\010resource\030\005 \001(\0132\031.google.storage.v" + + "2.Object\"\362\001\n\032StartResumableWriteRequest\022" + + "B\n\021write_object_spec\030\001 \001(\0132\".google.stor" + + "age.v2.WriteObjectSpecB\003\340A\002\022R\n\034common_ob" + + "ject_request_params\030\003 \001(\0132,.google.stora" + + "ge.v2.CommonObjectRequestParams\022<\n\020objec" + + "t_checksums\030\005 \001(\0132\".google.storage.v2.Ob" + + "jectChecksums\"0\n\033StartResumableWriteResp" + + "onse\022\021\n\tupload_id\030\001 \001(\t\"\357\003\n\023UpdateObject" + + "Request\022.\n\006object\030\001 \001(\0132\031.google.storage" + + ".v2.ObjectB\003\340A\002\022 \n\023if_generation_match\030\002" + + " \001(\003H\000\210\001\001\022$\n\027if_generation_not_match\030\003 \001" + + "(\003H\001\210\001\001\022$\n\027if_metageneration_match\030\004 \001(\003" + + "H\002\210\001\001\022(\n\033if_metageneration_not_match\030\005 \001" + + "(\003H\003\210\001\001\022\026\n\016predefined_acl\030\n \001(\t\0224\n\013updat" + + "e_mask\030\007 \001(\0132\032.google.protobuf.FieldMask" + + "B\003\340A\002\022R\n\034common_object_request_params\030\010 " + "\001(\0132,.google.storage.v2.CommonObjectRequ" - + "estParams\022<\n\020object_checksums\030\005 \001(\0132\".go" - + "ogle.storage.v2.ObjectChecksums\"0\n\033Start" - + "ResumableWriteResponse\022\021\n\tupload_id\030\001 \001(" - + "\t\"\357\003\n\023UpdateObjectRequest\022.\n\006object\030\001 \001(" - + "\0132\031.google.storage.v2.ObjectB\003\340A\002\022 \n\023if_" - + "generation_match\030\002 \001(\003H\000\210\001\001\022$\n\027if_genera" - + "tion_not_match\030\003 \001(\003H\001\210\001\001\022$\n\027if_metagene" - + "ration_match\030\004 \001(\003H\002\210\001\001\022(\n\033if_metagenera" - + "tion_not_match\030\005 \001(\003H\003\210\001\001\022\026\n\016predefined_" - + "acl\030\n \001(\t\0224\n\013update_mask\030\007 \001(\0132\032.google." - + "protobuf.FieldMaskB\003\340A\002\022R\n\034common_object" - + "_request_params\030\010 \001(\0132,.google.storage.v" - + "2.CommonObjectRequestParamsB\026\n\024_if_gener" - + "ation_matchB\032\n\030_if_generation_not_matchB" - + "\032\n\030_if_metageneration_matchB\036\n\034_if_metag" - + "eneration_not_match\"`\n\030GetServiceAccount" - + "Request\022D\n\007project\030\001 \001(\tB3\340A\002\372A-\n+cloudr" - + "esourcemanager.googleapis.com/Project\"\200\001" - + "\n\024CreateHmacKeyRequest\022D\n\007project\030\001 \001(\tB" - + "3\340A\002\372A-\n+cloudresourcemanager.googleapis" - + ".com/Project\022\"\n\025service_account_email\030\002 " - + "\001(\tB\003\340A\002\"g\n\025CreateHmacKeyResponse\0224\n\010met" - + "adata\030\001 \001(\0132\".google.storage.v2.HmacKeyM" - + "etadata\022\030\n\020secret_key_bytes\030\003 \001(\014\"t\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\"q\n\021GetHm" - + "acKeyRequest\022\026\n\taccess_id\030\001 \001(\tB\003\340A\002\022D\n\007" - + "project\030\002 \001(\tB3\340A\002\372A-\n+cloudresourcemana" - + "ger.googleapis.com/Project\"\274\001\n\023ListHmacK" - + "eysRequest\022D\n\007project\030\001 \001(\tB3\340A\002\372A-\n+clo" - + "udresourcemanager.googleapis.com/Project" - + "\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022" - + "\035\n\025service_account_email\030\004 \001(\t\022\031\n\021show_d" - + "eleted_keys\030\005 \001(\010\"f\n\024ListHmacKeysRespons" - + "e\0225\n\thmac_keys\030\001 \003(\0132\".google.storage.v2" - + ".HmacKeyMetadata\022\027\n\017next_page_token\030\002 \001(" - + "\t\"\202\001\n\024UpdateHmacKeyRequest\0229\n\010hmac_key\030\001" - + " \001(\0132\".google.storage.v2.HmacKeyMetadata" - + "B\003\340A\002\022/\n\013update_mask\030\003 \001(\0132\032.google.prot" - + "obuf.FieldMask\"|\n\031CommonObjectRequestPar" - + "ams\022\034\n\024encryption_algorithm\030\001 \001(\t\022\034\n\024enc" - + "ryption_key_bytes\030\004 \001(\014\022#\n\033encryption_ke" - + "y_sha256_bytes\030\005 \001(\014\"\312\005\n\020ServiceConstant" - + "s\"\265\005\n\006Values\022\026\n\022VALUES_UNSPECIFIED\020\000\022\033\n\024" - + "MAX_READ_CHUNK_BYTES\020\200\200\200\001\022\034\n\025MAX_WRITE_C" - + "HUNK_BYTES\020\200\200\200\001\022\031\n\022MAX_OBJECT_SIZE_MB\020\200\200" - + "\300\002\022)\n$MAX_CUSTOM_METADATA_FIELD_NAME_BYT" - + "ES\020\200\010\022*\n%MAX_CUSTOM_METADATA_FIELD_VALUE" - + "_BYTES\020\200 \022)\n$MAX_CUSTOM_METADATA_TOTAL_S" - + "IZE_BYTES\020\200@\022*\n$MAX_BUCKET_METADATA_TOTA" - + "L_SIZE_BYTES\020\200\240\001\022\'\n#MAX_NOTIFICATION_CON" - + "FIGS_PER_BUCKET\020d\022\"\n\036MAX_LIFECYCLE_RULES" - + "_PER_BUCKET\020d\022&\n\"MAX_NOTIFICATION_CUSTOM" - + "_ATTRIBUTES\020\005\0221\n,MAX_NOTIFICATION_CUSTOM" - + "_ATTRIBUTE_KEY_LENGTH\020\200\002\0223\n.MAX_NOTIFICA" - + "TION_CUSTOM_ATTRIBUTE_VALUE_LENGTH\020\200\010\022\034\n" - + "\030MAX_LABELS_ENTRIES_COUNT\020@\022\037\n\033MAX_LABEL" - + "S_KEY_VALUE_LENGTH\020?\022\037\n\032MAX_LABELS_KEY_V" - + "ALUE_BYTES\020\200\001\022.\n)MAX_OBJECT_IDS_PER_DELE" - + "TE_OBJECTS_REQUEST\020\350\007\022\036\n\032SPLIT_TOKEN_MAX" - + "_VALID_DAYS\020\016\032\002\020\001\"\206\030\n\006Bucket\022\021\n\004name\030\001 \001" - + "(\tB\003\340A\005\022\026\n\tbucket_id\030\002 \001(\tB\003\340A\003\022\014\n\004etag\030" - + "\035 \001(\t\022D\n\007project\030\003 \001(\tB3\340A\005\372A-\n+cloudres" - + "ourcemanager.googleapis.com/Project\022\033\n\016m" - + "etageneration\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\rs" - + "torage_class\030\007 \001(\t\022\013\n\003rpo\030\033 \001(\t\0223\n\003acl\030\010" - + " \003(\0132&.google.storage.v2.BucketAccessCon" - + "trol\022B\n\022default_object_acl\030\t \003(\0132&.googl" - + "e.storage.v2.ObjectAccessControl\0226\n\tlife" - + "cycle\030\n \001(\0132#.google.storage.v2.Bucket.L" - + "ifecycle\0224\n\013create_time\030\013 \001(\0132\032.google.p" - + "rotobuf.TimestampB\003\340A\003\022,\n\004cors\030\014 \003(\0132\036.g" - + "oogle.storage.v2.Bucket.Cors\0224\n\013update_t" - + "ime\030\r \001(\0132\032.google.protobuf.TimestampB\003\340" - + "A\003\022 \n\030default_event_based_hold\030\016 \001(\010\0225\n\006" - + "labels\030\017 \003(\0132%.google.storage.v2.Bucket." - + "LabelsEntry\0222\n\007website\030\020 \001(\0132!.google.st" - + "orage.v2.Bucket.Website\0228\n\nversioning\030\021 " - + "\001(\0132$.google.storage.v2.Bucket.Versionin" - + "g\0222\n\007logging\030\022 \001(\0132!.google.storage.v2.B" - + "ucket.Logging\022,\n\005owner\030\023 \001(\0132\030.google.st" - + "orage.v2.OwnerB\003\340A\003\0228\n\nencryption\030\024 \001(\0132" - + "$.google.storage.v2.Bucket.Encryption\0222\n" - + "\007billing\030\025 \001(\0132!.google.storage.v2.Bucke" - + "t.Billing\022C\n\020retention_policy\030\026 \001(\0132).go" - + "ogle.storage.v2.Bucket.RetentionPolicy\0227" - + "\n\niam_config\030\027 \001(\0132#.google.storage.v2.B" - + "ucket.IamConfig\022\025\n\rsatisfies_pzs\030\031 \001(\010\022P" - + "\n\027custom_placement_config\030\032 \001(\0132/.google" - + ".storage.v2.Bucket.CustomPlacementConfig" - + "\0226\n\tautoclass\030\034 \001(\0132#.google.storage.v2." - + "Bucket.Autoclass\032!\n\007Billing\022\026\n\016requester" - + "_pays\030\001 \001(\010\032X\n\004Cors\022\016\n\006origin\030\001 \003(\t\022\016\n\006m" - + "ethod\030\002 \003(\t\022\027\n\017response_header\030\003 \003(\t\022\027\n\017" - + "max_age_seconds\030\004 \001(\005\032M\n\nEncryption\022?\n\017d" - + "efault_kms_key\030\001 \001(\tB&\372A#\n!cloudkms.goog" - + "leapis.com/CryptoKey\032\354\001\n\tIamConfig\022a\n\033un" - + "iform_bucket_level_access\030\001 \001(\0132<.google" - + ".storage.v2.Bucket.IamConfig.UniformBuck" - + "etLevelAccess\022 \n\030public_access_preventio" - + "n\030\003 \001(\t\032Z\n\030UniformBucketLevelAccess\022\017\n\007e" - + "nabled\030\001 \001(\010\022-\n\tlock_time\030\002 \001(\0132\032.google" - + ".protobuf.Timestamp\032\363\005\n\tLifecycle\0226\n\004rul" - + "e\030\001 \003(\0132(.google.storage.v2.Bucket.Lifec" - + "ycle.Rule\032\255\005\n\004Rule\022?\n\006action\030\001 \001(\0132/.goo" - + "gle.storage.v2.Bucket.Lifecycle.Rule.Act" - + "ion\022E\n\tcondition\030\002 \001(\01322.google.storage." - + "v2.Bucket.Lifecycle.Rule.Condition\032-\n\006Ac" - + "tion\022\014\n\004type\030\001 \001(\t\022\025\n\rstorage_class\030\002 \001(" - + "\t\032\355\003\n\tCondition\022\025\n\010age_days\030\001 \001(\005H\000\210\001\001\022)" - + "\n\016created_before\030\002 \001(\0132\021.google.type.Dat" - + "e\022\024\n\007is_live\030\003 \001(\010H\001\210\001\001\022\037\n\022num_newer_ver" - + "sions\030\004 \001(\005H\002\210\001\001\022\035\n\025matches_storage_clas" - + "s\030\005 \003(\t\022#\n\026days_since_custom_time\030\007 \001(\005H" - + "\003\210\001\001\022-\n\022custom_time_before\030\010 \001(\0132\021.googl" - + "e.type.Date\022\'\n\032days_since_noncurrent_tim" - + "e\030\t \001(\005H\004\210\001\001\0221\n\026noncurrent_time_before\030\n" - + " \001(\0132\021.google.type.Date\022\026\n\016matches_prefi" - + "x\030\013 \003(\t\022\026\n\016matches_suffix\030\014 \003(\tB\013\n\t_age_" - + "daysB\n\n\010_is_liveB\025\n\023_num_newer_versionsB" - + "\031\n\027_days_since_custom_timeB\035\n\033_days_sinc" - + "e_noncurrent_time\0328\n\007Logging\022\022\n\nlog_buck" - + "et\030\001 \001(\t\022\031\n\021log_object_prefix\030\002 \001(\t\032\303\001\n\017" - + "RetentionPolicy\0222\n\016effective_time\030\001 \001(\0132" - + "\032.google.protobuf.Timestamp\022\021\n\tis_locked" - + "\030\002 \001(\010\022\035\n\020retention_period\030\003 \001(\003H\000\210\001\001\0225\n" - + "\022retention_duration\030\004 \001(\0132\031.google.proto" - + "buf.DurationB\023\n\021_retention_period\032\035\n\nVer" - + "sioning\022\017\n\007enabled\030\001 \001(\010\032;\n\007Website\022\030\n\020m" - + "ain_page_suffix\030\001 \001(\t\022\026\n\016not_found_page\030" - + "\002 \001(\t\032/\n\025CustomPlacementConfig\022\026\n\016data_l" - + "ocations\030\001 \003(\t\032R\n\tAutoclass\022\017\n\007enabled\030\001" - + " \001(\010\0224\n\013toggle_time\030\002 \001(\0132\032.google.proto" - + "buf.TimestampB\003\340A\003\032-\n\013LabelsEntry\022\013\n\003key" - + "\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:G\352AD\n\035storage." - + "googleapis.com/Bucket\022#projects/{project" - + "}/buckets/{bucket}\"\316\001\n\023BucketAccessContr" - + "ol\022\014\n\004role\030\001 \001(\t\022\n\n\002id\030\002 \001(\t\022\016\n\006entity\030\003" - + " \001(\t\022\027\n\nentity_alt\030\t \001(\tB\003\340A\003\022\021\n\tentity_" - + "id\030\004 \001(\t\022\014\n\004etag\030\010 \001(\t\022\r\n\005email\030\005 \001(\t\022\016\n" - + "\006domain\030\006 \001(\t\0224\n\014project_team\030\007 \001(\0132\036.go" - + "ogle.storage.v2.ProjectTeam\"B\n\017Checksumm" - + "edData\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\006cr" - + "c32c\030\001 \001(\007H\000\210\001\001\022\020\n\010md5_hash\030\002 \001(\014B\t\n\007_cr" - + "c32c\"\255\002\n\017HmacKeyMetadata\022\017\n\002id\030\001 \001(\tB\003\340A" - + "\005\022\026\n\taccess_id\030\002 \001(\tB\003\340A\005\022D\n\007project\030\003 \001" - + "(\tB3\340A\005\372A-\n+cloudresourcemanager.googlea" - + "pis.com/Project\022\"\n\025service_account_email" - + "\030\004 \001(\tB\003\340A\003\022\r\n\005state\030\005 \001(\t\0224\n\013create_tim" - + "e\030\006 \001(\0132\032.google.protobuf.TimestampB\003\340A\003" - + "\0224\n\013update_time\030\007 \001(\0132\032.google.protobuf." - + "TimestampB\003\340A\003\022\014\n\004etag\030\010 \001(\t\"\216\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\014\n\004etag\030\007 \001(\t\022\023\n\013event_types\030\003 \003(\t\022" - + "P\n\021custom_attributes\030\004 \003(\01325.google.stor" - + "age.v2.Notification.CustomAttributesEntr" - + "y\022\032\n\022object_name_prefix\030\005 \001(\t\022\033\n\016payload" - + "_format\030\006 \001(\tB\003\340A\002\0327\n\025CustomAttributesEn" - + "try\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:p\352Am" - + "\n#storage.googleapis.com/Notification\022Fp" + + "estParamsB\026\n\024_if_generation_matchB\032\n\030_if" + + "_generation_not_matchB\032\n\030_if_metagenerat" + + "ion_matchB\036\n\034_if_metageneration_not_matc" + + "h\"`\n\030GetServiceAccountRequest\022D\n\007project" + + "\030\001 \001(\tB3\340A\002\372A-\n+cloudresourcemanager.goo" + + "gleapis.com/Project\"\200\001\n\024CreateHmacKeyReq" + + "uest\022D\n\007project\030\001 \001(\tB3\340A\002\372A-\n+cloudreso" + + "urcemanager.googleapis.com/Project\022\"\n\025se" + + "rvice_account_email\030\002 \001(\tB\003\340A\002\"g\n\025Create" + + "HmacKeyResponse\0224\n\010metadata\030\001 \001(\0132\".goog" + + "le.storage.v2.HmacKeyMetadata\022\030\n\020secret_" + + "key_bytes\030\003 \001(\014\"t\n\024DeleteHmacKeyRequest\022" + + "\026\n\taccess_id\030\001 \001(\tB\003\340A\002\022D\n\007project\030\002 \001(\t" + + "B3\340A\002\372A-\n+cloudresourcemanager.googleapi" + + "s.com/Project\"q\n\021GetHmacKeyRequest\022\026\n\tac" + + "cess_id\030\001 \001(\tB\003\340A\002\022D\n\007project\030\002 \001(\tB3\340A\002" + + "\372A-\n+cloudresourcemanager.googleapis.com" + + "/Project\"\274\001\n\023ListHmacKeysRequest\022D\n\007proj" + + "ect\030\001 \001(\tB3\340A\002\372A-\n+cloudresourcemanager." + + "googleapis.com/Project\022\021\n\tpage_size\030\002 \001(" + + "\005\022\022\n\npage_token\030\003 \001(\t\022\035\n\025service_account" + + "_email\030\004 \001(\t\022\031\n\021show_deleted_keys\030\005 \001(\010\"" + + "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\"\202\001\n\024UpdateHmacKe" + + "yRequest\0229\n\010hmac_key\030\001 \001(\0132\".google.stor" + + "age.v2.HmacKeyMetadataB\003\340A\002\022/\n\013update_ma" + + "sk\030\003 \001(\0132\032.google.protobuf.FieldMask\"|\n\031" + + "CommonObjectRequestParams\022\034\n\024encryption_" + + "algorithm\030\001 \001(\t\022\034\n\024encryption_key_bytes\030" + + "\004 \001(\014\022#\n\033encryption_key_sha256_bytes\030\005 \001" + + "(\014\"\312\005\n\020ServiceConstants\"\265\005\n\006Values\022\026\n\022VA" + + "LUES_UNSPECIFIED\020\000\022\033\n\024MAX_READ_CHUNK_BYT" + + "ES\020\200\200\200\001\022\034\n\025MAX_WRITE_CHUNK_BYTES\020\200\200\200\001\022\031\n" + + "\022MAX_OBJECT_SIZE_MB\020\200\200\300\002\022)\n$MAX_CUSTOM_M" + + "ETADATA_FIELD_NAME_BYTES\020\200\010\022*\n%MAX_CUSTO" + + "M_METADATA_FIELD_VALUE_BYTES\020\200 \022)\n$MAX_C" + + "USTOM_METADATA_TOTAL_SIZE_BYTES\020\200@\022*\n$MA" + + "X_BUCKET_METADATA_TOTAL_SIZE_BYTES\020\200\240\001\022\'" + + "\n#MAX_NOTIFICATION_CONFIGS_PER_BUCKET\020d\022" + + "\"\n\036MAX_LIFECYCLE_RULES_PER_BUCKET\020d\022&\n\"M" + + "AX_NOTIFICATION_CUSTOM_ATTRIBUTES\020\005\0221\n,M" + + "AX_NOTIFICATION_CUSTOM_ATTRIBUTE_KEY_LEN" + + "GTH\020\200\002\0223\n.MAX_NOTIFICATION_CUSTOM_ATTRIB" + + "UTE_VALUE_LENGTH\020\200\010\022\034\n\030MAX_LABELS_ENTRIE" + + "S_COUNT\020@\022\037\n\033MAX_LABELS_KEY_VALUE_LENGTH" + + "\020?\022\037\n\032MAX_LABELS_KEY_VALUE_BYTES\020\200\001\022.\n)M" + + "AX_OBJECT_IDS_PER_DELETE_OBJECTS_REQUEST" + + "\020\350\007\022\036\n\032SPLIT_TOKEN_MAX_VALID_DAYS\020\016\032\002\020\001\"" + + "\206\030\n\006Bucket\022\021\n\004name\030\001 \001(\tB\003\340A\005\022\026\n\tbucket_" + + "id\030\002 \001(\tB\003\340A\003\022\014\n\004etag\030\035 \001(\t\022D\n\007project\030\003" + + " \001(\tB3\340A\005\372A-\n+cloudresourcemanager.googl" + + "eapis.com/Project\022\033\n\016metageneration\030\004 \001(" + + "\003B\003\340A\003\022\025\n\010location\030\005 \001(\tB\003\340A\005\022\032\n\rlocatio" + + "n_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.stor" + + "age.v2.BucketAccessControl\022B\n\022default_ob" + + "ject_acl\030\t \003(\0132&.google.storage.v2.Objec" + + "tAccessControl\0226\n\tlifecycle\030\n \001(\0132#.goog" + + "le.storage.v2.Bucket.Lifecycle\0224\n\013create" + + "_time\030\013 \001(\0132\032.google.protobuf.TimestampB" + + "\003\340A\003\022,\n\004cors\030\014 \003(\0132\036.google.storage.v2.B" + + "ucket.Cors\0224\n\013update_time\030\r \001(\0132\032.google" + + ".protobuf.TimestampB\003\340A\003\022 \n\030default_even" + + "t_based_hold\030\016 \001(\010\0225\n\006labels\030\017 \003(\0132%.goo" + + "gle.storage.v2.Bucket.LabelsEntry\0222\n\007web" + + "site\030\020 \001(\0132!.google.storage.v2.Bucket.We" + + "bsite\0228\n\nversioning\030\021 \001(\0132$.google.stora" + + "ge.v2.Bucket.Versioning\0222\n\007logging\030\022 \001(\013" + + "2!.google.storage.v2.Bucket.Logging\022,\n\005o" + + "wner\030\023 \001(\0132\030.google.storage.v2.OwnerB\003\340A" + + "\003\0228\n\nencryption\030\024 \001(\0132$.google.storage.v" + + "2.Bucket.Encryption\0222\n\007billing\030\025 \001(\0132!.g" + + "oogle.storage.v2.Bucket.Billing\022C\n\020reten" + + "tion_policy\030\026 \001(\0132).google.storage.v2.Bu" + + "cket.RetentionPolicy\0227\n\niam_config\030\027 \001(\013" + + "2#.google.storage.v2.Bucket.IamConfig\022\025\n" + + "\rsatisfies_pzs\030\031 \001(\010\022P\n\027custom_placement" + + "_config\030\032 \001(\0132/.google.storage.v2.Bucket" + + ".CustomPlacementConfig\0226\n\tautoclass\030\034 \001(" + + "\0132#.google.storage.v2.Bucket.Autoclass\032!" + + "\n\007Billing\022\026\n\016requester_pays\030\001 \001(\010\032X\n\004Cor" + + "s\022\016\n\006origin\030\001 \003(\t\022\016\n\006method\030\002 \003(\t\022\027\n\017res" + + "ponse_header\030\003 \003(\t\022\027\n\017max_age_seconds\030\004 " + + "\001(\005\032M\n\nEncryption\022?\n\017default_kms_key\030\001 \001" + + "(\tB&\372A#\n!cloudkms.googleapis.com/CryptoK" + + "ey\032\354\001\n\tIamConfig\022a\n\033uniform_bucket_level" + + "_access\030\001 \001(\0132<.google.storage.v2.Bucket" + + ".IamConfig.UniformBucketLevelAccess\022 \n\030p" + + "ublic_access_prevention\030\003 \001(\t\032Z\n\030Uniform" + + "BucketLevelAccess\022\017\n\007enabled\030\001 \001(\010\022-\n\tlo" + + "ck_time\030\002 \001(\0132\032.google.protobuf.Timestam" + + "p\032\363\005\n\tLifecycle\0226\n\004rule\030\001 \003(\0132(.google.s" + + "torage.v2.Bucket.Lifecycle.Rule\032\255\005\n\004Rule" + + "\022?\n\006action\030\001 \001(\0132/.google.storage.v2.Buc" + + "ket.Lifecycle.Rule.Action\022E\n\tcondition\030\002" + + " \001(\01322.google.storage.v2.Bucket.Lifecycl" + + "e.Rule.Condition\032-\n\006Action\022\014\n\004type\030\001 \001(\t" + + "\022\025\n\rstorage_class\030\002 \001(\t\032\355\003\n\tCondition\022\025\n" + + "\010age_days\030\001 \001(\005H\000\210\001\001\022)\n\016created_before\030\002" + + " \001(\0132\021.google.type.Date\022\024\n\007is_live\030\003 \001(\010" + + "H\001\210\001\001\022\037\n\022num_newer_versions\030\004 \001(\005H\002\210\001\001\022\035" + + "\n\025matches_storage_class\030\005 \003(\t\022#\n\026days_si" + + "nce_custom_time\030\007 \001(\005H\003\210\001\001\022-\n\022custom_tim" + + "e_before\030\010 \001(\0132\021.google.type.Date\022\'\n\032day" + + "s_since_noncurrent_time\030\t \001(\005H\004\210\001\001\0221\n\026no" + + "ncurrent_time_before\030\n \001(\0132\021.google.type" + + ".Date\022\026\n\016matches_prefix\030\013 \003(\t\022\026\n\016matches" + + "_suffix\030\014 \003(\tB\013\n\t_age_daysB\n\n\010_is_liveB\025" + + "\n\023_num_newer_versionsB\031\n\027_days_since_cus" + + "tom_timeB\035\n\033_days_since_noncurrent_time\032" + + "8\n\007Logging\022\022\n\nlog_bucket\030\001 \001(\t\022\031\n\021log_ob" + + "ject_prefix\030\002 \001(\t\032\303\001\n\017RetentionPolicy\0222\n" + + "\016effective_time\030\001 \001(\0132\032.google.protobuf." + + "Timestamp\022\021\n\tis_locked\030\002 \001(\010\022\035\n\020retentio" + + "n_period\030\003 \001(\003H\000\210\001\001\0225\n\022retention_duratio" + + "n\030\004 \001(\0132\031.google.protobuf.DurationB\023\n\021_r" + + "etention_period\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\025CustomPla" + + "cementConfig\022\026\n\016data_locations\030\001 \003(\t\032R\n\t" + + "Autoclass\022\017\n\007enabled\030\001 \001(\010\0224\n\013toggle_tim" + + "e\030\002 \001(\0132\032.google.protobuf.TimestampB\003\340A\003" + + "\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 " + + "\001(\t:\0028\001:G\352AD\n\035storage.googleapis.com/Buc" + + "ket\022#projects/{project}/buckets/{bucket}" + + "\"\316\001\n\023BucketAccessControl\022\014\n\004role\030\001 \001(\t\022\n" + + "\n\002id\030\002 \001(\t\022\016\n\006entity\030\003 \001(\t\022\027\n\nentity_alt" + + "\030\t \001(\tB\003\340A\003\022\021\n\tentity_id\030\004 \001(\t\022\014\n\004etag\030\010" + + " \001(\t\022\r\n\005email\030\005 \001(\t\022\016\n\006domain\030\006 \001(\t\0224\n\014p" + + "roject_team\030\007 \001(\0132\036.google.storage.v2.Pr" + + "ojectTeam\"B\n\017ChecksummedData\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\006crc32c\030\001 \001(\007H\000\210\001\001\022\020\n" + + "\010md5_hash\030\002 \001(\014B\t\n\007_crc32c\"\255\002\n\017HmacKeyMe" + + "tadata\022\017\n\002id\030\001 \001(\tB\003\340A\005\022\026\n\taccess_id\030\002 \001" + + "(\tB\003\340A\005\022D\n\007project\030\003 \001(\tB3\340A\005\372A-\n+cloudr" + + "esourcemanager.googleapis.com/Project\022\"\n" + + "\025service_account_email\030\004 \001(\tB\003\340A\003\022\r\n\005sta" + + "te\030\005 \001(\t\0224\n\013create_time\030\006 \001(\0132\032.google.p" + + "rotobuf.TimestampB\003\340A\003\0224\n\013update_time\030\007 " + + "\001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\014\n\004" + + "etag\030\010 \001(\t\"\247\003\n\022NotificationConfig\022\021\n\004nam" + + "e\030\001 \001(\tB\003\340A\002\022\022\n\005topic\030\002 \001(\tB\003\340A\002\022\014\n\004etag" + + "\030\007 \001(\t\022\023\n\013event_types\030\003 \003(\t\022V\n\021custom_at" + + "tributes\030\004 \003(\0132;.google.storage.v2.Notif" + + "icationConfig.CustomAttributesEntry\022\032\n\022o" + + "bject_name_prefix\030\005 \001(\t\022\033\n\016payload_forma" + + "t\030\006 \001(\tB\003\340A\002\0327\n\025CustomAttributesEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:}\352Az\n)stor" + + "age.googleapis.com/NotificationConfig\022Mp" + "rojects/{project}/buckets/{bucket}/notif" - + "icationConfigs/{notification}\"L\n\022Custome" - + "rEncryption\022\034\n\024encryption_algorithm\030\001 \001(" - + "\t\022\030\n\020key_sha256_bytes\030\003 \001(\014\"\202\t\n\006Object\022\021" - + "\n\004name\030\001 \001(\tB\003\340A\005\0225\n\006bucket\030\002 \001(\tB%\340A\005\372A" - + "\037\n\035storage.googleapis.com/Bucket\022\014\n\004etag" - + "\030\033 \001(\t\022\027\n\ngeneration\030\003 \001(\003B\003\340A\005\022\033\n\016metag" - + "eneration\030\004 \001(\003B\003\340A\003\022\025\n\rstorage_class\030\005 " - + "\001(\t\022\021\n\004size\030\006 \001(\003B\003\340A\003\022\030\n\020content_encodi" - + "ng\030\007 \001(\t\022\033\n\023content_disposition\030\010 \001(\t\022\025\n" - + "\rcache_control\030\t \001(\t\0223\n\003acl\030\n \003(\0132&.goog" - + "le.storage.v2.ObjectAccessControl\022\030\n\020con" - + "tent_language\030\013 \001(\t\0224\n\013delete_time\030\014 \001(\013" - + "2\032.google.protobuf.TimestampB\003\340A\003\022\024\n\014con" - + "tent_type\030\r \001(\t\0224\n\013create_time\030\016 \001(\0132\032.g" - + "oogle.protobuf.TimestampB\003\340A\003\022\034\n\017compone" - + "nt_count\030\017 \001(\005B\003\340A\003\022:\n\tchecksums\030\020 \001(\0132\"" - + ".google.storage.v2.ObjectChecksumsB\003\340A\003\022" - + "4\n\013update_time\030\021 \001(\0132\032.google.protobuf.T" - + "imestampB\003\340A\003\0227\n\007kms_key\030\022 \001(\tB&\372A#\n!clo" - + "udkms.googleapis.com/CryptoKey\022B\n\031update" - + "_storage_class_time\030\023 \001(\0132\032.google.proto" - + "buf.TimestampB\003\340A\003\022\026\n\016temporary_hold\030\024 \001" - + "(\010\0229\n\025retention_expire_time\030\025 \001(\0132\032.goog" - + "le.protobuf.Timestamp\0229\n\010metadata\030\026 \003(\0132" - + "\'.google.storage.v2.Object.MetadataEntry" - + "\022\035\n\020event_based_hold\030\027 \001(\010H\000\210\001\001\022,\n\005owner" - + "\030\030 \001(\0132\030.google.storage.v2.OwnerB\003\340A\003\022B\n" - + "\023customer_encryption\030\031 \001(\0132%.google.stor" - + "age.v2.CustomerEncryption\022/\n\013custom_time" - + "\030\032 \001(\0132\032.google.protobuf.Timestamp\032/\n\rMe" - + "tadataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:" - + "\0028\001B\023\n\021_event_based_hold\"\316\001\n\023ObjectAcces" - + "sControl\022\014\n\004role\030\001 \001(\t\022\n\n\002id\030\002 \001(\t\022\016\n\006en" - + "tity\030\003 \001(\t\022\027\n\nentity_alt\030\t \001(\tB\003\340A\003\022\021\n\te", - "ntity_id\030\004 \001(\t\022\014\n\004etag\030\010 \001(\t\022\r\n\005email\030\005 " - + "\001(\t\022\016\n\006domain\030\006 \001(\t\0224\n\014project_team\030\007 \001(" - + "\0132\036.google.storage.v2.ProjectTeam\"l\n\023Lis" - + "tObjectsResponse\022*\n\007objects\030\001 \003(\0132\031.goog" - + "le.storage.v2.Object\022\020\n\010prefixes\030\002 \003(\t\022\027" - + "\n\017next_page_token\030\003 \001(\t\"3\n\013ProjectTeam\022\026" - + "\n\016project_number\030\001 \001(\t\022\014\n\004team\030\002 \001(\t\"\'\n\016" - + "ServiceAccount\022\025\n\remail_address\030\001 \001(\t\"*\n" - + "\005Owner\022\016\n\006entity\030\001 \001(\t\022\021\n\tentity_id\030\002 \001(" - + "\t\"C\n\014ContentRange\022\r\n\005start\030\001 \001(\003\022\013\n\003end\030" - + "\002 \001(\003\022\027\n\017complete_length\030\003 \001(\0032\257%\n\007Stora" - + "ge\022r\n\014DeleteBucket\022&.google.storage.v2.D" - + "eleteBucketRequest\032\026.google.protobuf.Emp" - + "ty\"\"\212\323\344\223\002\025\022\023\n\004name\022\013{bucket=**}\332A\004name\022o" - + "\n\tGetBucket\022#.google.storage.v2.GetBucke" - + "tRequest\032\031.google.storage.v2.Bucket\"\"\212\323\344" - + "\223\002\025\022\023\n\004name\022\013{bucket=**}\332A\004name\022\213\001\n\014Crea" - + "teBucket\022&.google.storage.v2.CreateBucke" - + "tRequest\032\031.google.storage.v2.Bucket\"8\212\323\344" - + "\223\002\030\022\026\n\006parent\022\014{project=**}\332A\027parent,buc" - + "ket,bucket_id\022\205\001\n\013ListBuckets\022%.google.s" - + "torage.v2.ListBucketsRequest\032&.google.st" - + "orage.v2.ListBucketsResponse\"\'\212\323\344\223\002\030\022\026\n\006" - + "parent\022\014{project=**}\332A\006parent\022\223\001\n\031LockBu" - + "cketRetentionPolicy\0223.google.storage.v2." - + "LockBucketRetentionPolicyRequest\032\031.googl" - + "e.storage.v2.Bucket\"&\212\323\344\223\002\027\022\025\n\006bucket\022\013{" - + "bucket=**}\332A\006bucket\022\253\001\n\014GetIamPolicy\022\".g" - + "oogle.iam.v1.GetIamPolicyRequest\032\025.googl" - + "e.iam.v1.Policy\"`\212\323\344\223\002O\022\027\n\010resource\022\013{bu" - + "cket=**}\0224\n\010resource\022({bucket=projects/*" - + "/buckets/*}/objects/**\332A\010resource\022\262\001\n\014Se" - + "tIamPolicy\022\".google.iam.v1.SetIamPolicyR" - + "equest\032\025.google.iam.v1.Policy\"g\212\323\344\223\002O\022\027\n" - + "\010resource\022\013{bucket=**}\0224\n\010resource\022({buc" - + "ket=projects/*/buckets/*}/objects/**\332A\017r" - + "esource,policy\022\327\001\n\022TestIamPermissions\022(." - + "google.iam.v1.TestIamPermissionsRequest\032" - + ").google.iam.v1.TestIamPermissionsRespon" - + "se\"l\212\323\344\223\002O\022\027\n\010resource\022\013{bucket=**}\0224\n\010r" - + "esource\022({bucket=projects/*/buckets/*}/o" - + "bjects/**\332A\024resource,permissions\022\212\001\n\014Upd" - + "ateBucket\022&.google.storage.v2.UpdateBuck" - + "etRequest\032\031.google.storage.v2.Bucket\"7\212\323" - + "\344\223\002\034\022\032\n\013bucket.name\022\013{bucket=**}\332A\022bucke" - + "t,update_mask\022\223\001\n\022DeleteNotification\022,.g" - + "oogle.storage.v2.DeleteNotificationReque" - + "st\032\026.google.protobuf.Empty\"7\212\323\344\223\002*\022(\n\004na" - + "me\022 {bucket=projects/*/buckets/*}/**\332A\004n" - + "ame\022\226\001\n\017GetNotification\022).google.storage" - + ".v2.GetNotificationRequest\032\037.google.stor" - + "age.v2.Notification\"7\212\323\344\223\002*\022(\n\004name\022 {bu" - + "cket=projects/*/buckets/*}/**\332A\004name\022\230\001\n" - + "\022CreateNotification\022,.google.storage.v2." - + "CreateNotificationRequest\032\037.google.stora" - + "ge.v2.Notification\"3\212\323\344\223\002\027\022\025\n\006parent\022\013{b" - + "ucket=**}\332A\023parent,notification\022\226\001\n\021List" - + "Notifications\022+.google.storage.v2.ListNo" - + "tificationsRequest\032,.google.storage.v2.L" - + "istNotificationsResponse\"&\212\323\344\223\002\027\022\025\n\006pare" - + "nt\022\013{bucket=**}\332A\006parent\022~\n\rComposeObjec" - + "t\022\'.google.storage.v2.ComposeObjectReque" - + "st\032\031.google.storage.v2.Object\")\212\323\344\223\002#\022!\n" - + "\022destination.bucket\022\013{bucket=**}\022\230\001\n\014Del" - + "eteObject\022&.google.storage.v2.DeleteObje" - + "ctRequest\032\026.google.protobuf.Empty\"H\212\323\344\223\002" - + "\027\022\025\n\006bucket\022\013{bucket=**}\332A\rbucket,object" - + "\332A\030bucket,object,generation\022\272\001\n\024CancelRe" - + "sumableWrite\022..google.storage.v2.CancelR" - + "esumableWriteRequest\032/.google.storage.v2" - + ".CancelResumableWriteResponse\"A\212\323\344\223\002/\022-\n" - + "\tupload_id\022 {bucket=projects/*/buckets/*" - + "}/**\332A\tupload_id\022\225\001\n\tGetObject\022#.google." - + "storage.v2.GetObjectRequest\032\031.google.sto" - + "rage.v2.Object\"H\212\323\344\223\002\027\022\025\n\006bucket\022\013{bucke" - + "t=**}\332A\rbucket,object\332A\030bucket,object,ge" - + "neration\022\245\001\n\nReadObject\022$.google.storage" - + ".v2.ReadObjectRequest\032%.google.storage.v" - + "2.ReadObjectResponse\"H\212\323\344\223\002\027\022\025\n\006bucket\022\013" - + "{bucket=**}\332A\rbucket,object\332A\030bucket,obj" - + "ect,generation0\001\022\214\001\n\014UpdateObject\022&.goog" - + "le.storage.v2.UpdateObjectRequest\032\031.goog" - + "le.storage.v2.Object\"9\212\323\344\223\002\036\022\034\n\robject.b" - + "ucket\022\013{bucket=**}\332A\022object,update_mask\022" - + "`\n\013WriteObject\022%.google.storage.v2.Write" - + "ObjectRequest\032&.google.storage.v2.WriteO" - + "bjectResponse\"\000(\001\022\204\001\n\013ListObjects\022%.goog" - + "le.storage.v2.ListObjectsRequest\032&.googl" - + "e.storage.v2.ListObjectsResponse\"&\212\323\344\223\002\027" - + "\022\025\n\006parent\022\013{bucket=**}\332A\006parent\022\230\001\n\rRew" - + "riteObject\022\'.google.storage.v2.RewriteOb" - + "jectRequest\032\".google.storage.v2.RewriteR" - + "esponse\":\212\323\344\223\0024\022\017\n\rsource_bucket\022!\n\022dest" - + "ination_bucket\022\013{bucket=**}\022\256\001\n\023StartRes" - + "umableWrite\022-.google.storage.v2.StartRes" - + "umableWriteRequest\032..google.storage.v2.S" - + "tartResumableWriteResponse\"8\212\323\344\223\0022\0220\n!wr" - + "ite_object_spec.resource.bucket\022\013{bucket" - + "=**}\022\256\001\n\020QueryWriteStatus\022*.google.stora" - + "ge.v2.QueryWriteStatusRequest\032+.google.s" - + "torage.v2.QueryWriteStatusResponse\"A\212\323\344\223" - + "\002/\022-\n\tupload_id\022 {bucket=projects/*/buck" - + "ets/*}/**\332A\tupload_id\022\200\001\n\021GetServiceAcco" - + "unt\022+.google.storage.v2.GetServiceAccoun" - + "tRequest\032!.google.storage.v2.ServiceAcco" - + "unt\"\033\212\323\344\223\002\013\022\t\n\007project\332A\007project\022\225\001\n\rCre" - + "ateHmacKey\022\'.google.storage.v2.CreateHma" - + "cKeyRequest\032(.google.storage.v2.CreateHm" - + "acKeyResponse\"1\212\323\344\223\002\013\022\t\n\007project\332A\035proje" - + "ct,service_account_email\022w\n\rDeleteHmacKe" - + "y\022\'.google.storage.v2.DeleteHmacKeyReque" - + "st\032\026.google.protobuf.Empty\"%\212\323\344\223\002\013\022\t\n\007pr" - + "oject\332A\021access_id,project\022}\n\nGetHmacKey\022" - + "$.google.storage.v2.GetHmacKeyRequest\032\"." - + "google.storage.v2.HmacKeyMetadata\"%\212\323\344\223\002" - + "\013\022\t\n\007project\332A\021access_id,project\022|\n\014List" - + "HmacKeys\022&.google.storage.v2.ListHmacKey" - + "sRequest\032\'.google.storage.v2.ListHmacKey" - + "sResponse\"\033\212\323\344\223\002\013\022\t\n\007project\332A\007project\022\235" - + "\001\n\rUpdateHmacKey\022\'.google.storage.v2.Upd" - + "ateHmacKeyRequest\032\".google.storage.v2.Hm" - + "acKeyMetadata\"?\212\323\344\223\002\"\022 \n\020hmac_key.projec" - + "t\022\014{project=**}\332A\024hmac_key,update_mask\032\247" - + "\002\312A\026storage.googleapis.com\322A\212\002https://ww" - + "w.googleapis.com/auth/cloud-platform,htt" - + "ps://www.googleapis.com/auth/cloud-platf" - + "orm.read-only,https://www.googleapis.com" - + "/auth/devstorage.full_control,https://ww" - + "w.googleapis.com/auth/devstorage.read_on" - + "ly,https://www.googleapis.com/auth/devst" - + "orage.read_writeB\334\001\n\025com.google.storage." - + "v2B\014StorageProtoP\001Z8google.golang.org/ge" - + "nproto/googleapis/storage/v2;storage\352Ax\n" - + "!cloudkms.googleapis.com/CryptoKey\022Sproj" - + "ects/{project}/locations/{location}/keyR" - + "ings/{key_ring}/cryptoKeys/{crypto_key}b" - + "\006proto3" + + "icationConfigs/{notification_config}\"L\n\022" + + "CustomerEncryption\022\034\n\024encryption_algorit" + + "hm\030\001 \001(\t\022\030\n\020key_sha256_bytes\030\003 \001(\014\"\202\t\n\006O" + + "bject\022\021\n\004name\030\001 \001(\tB\003\340A\005\0225\n\006bucket\030\002 \001(\t" + + "B%\340A\005\372A\037\n\035storage.googleapis.com/Bucket\022" + + "\014\n\004etag\030\033 \001(\t\022\027\n\ngeneration\030\003 \001(\003B\003\340A\005\022\033" + + "\n\016metageneration\030\004 \001(\003B\003\340A\003\022\025\n\rstorage_c" + + "lass\030\005 \001(\t\022\021\n\004size\030\006 \001(\003B\003\340A\003\022\030\n\020content" + + "_encoding\030\007 \001(\t\022\033\n\023content_disposition\030\010" + + " \001(\t\022\025\n\rcache_control\030\t \001(\t\0223\n\003acl\030\n \003(\013" + + "2&.google.storage.v2.ObjectAccessControl" + + "\022\030\n\020content_language\030\013 \001(\t\0224\n\013delete_tim" + + "e\030\014 \001(\0132\032.google.protobuf.TimestampB\003\340A\003" + + "\022\024\n\014content_type\030\r \001(\t\0224\n\013create_time\030\016 " + + "\001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\034\n\017" + + "component_count\030\017 \001(\005B\003\340A\003\022:\n\tchecksums\030" + + "\020 \001(\0132\".google.storage.v2.ObjectChecksum" + + "sB\003\340A\003\0224\n\013update_time\030\021 \001(\0132\032.google.pro" + + "tobuf.TimestampB\003\340A\003\0227\n\007kms_key\030\022 \001(\tB&\372" + + "A#\n!cloudkms.googleapis.com/CryptoKey\022B\n" + + "\031update_storage_class_time\030\023 \001(\0132\032.googl" + + "e.protobuf.TimestampB\003\340A\003\022\026\n\016temporary_h" + + "old\030\024 \001(\010\0229\n\025retention_expire_time\030\025 \001(\013" + + "2\032.google.protobuf.Timestamp\0229\n\010metadata" + + "\030\026 \003(\0132\'.google.storage.v2.Object.Metada" + + "taEntry\022\035\n\020event_based_hold\030\027 \001(\010H\000\210\001\001\022," + + "\n\005owner\030\030 \001(\0132\030.google.storage.v2.OwnerB" + + "\003\340A\003\022B\n\023customer_encryption\030\031 \001(\0132%.goog" + + "le.storage.v2.CustomerEncryption\022/\n\013cust" + + "om_time\030\032 \001(\0132\032.google.protobuf.Timestam" + + "p\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\"\316\001\n\023Obje", + "ctAccessControl\022\014\n\004role\030\001 \001(\t\022\n\n\002id\030\002 \001(" + + "\t\022\016\n\006entity\030\003 \001(\t\022\027\n\nentity_alt\030\t \001(\tB\003\340" + + "A\003\022\021\n\tentity_id\030\004 \001(\t\022\014\n\004etag\030\010 \001(\t\022\r\n\005e" + + "mail\030\005 \001(\t\022\016\n\006domain\030\006 \001(\t\0224\n\014project_te" + + "am\030\007 \001(\0132\036.google.storage.v2.ProjectTeam" + + "\"l\n\023ListObjectsResponse\022*\n\007objects\030\001 \003(\013" + + "2\031.google.storage.v2.Object\022\020\n\010prefixes\030" + + "\002 \003(\t\022\027\n\017next_page_token\030\003 \001(\t\"3\n\013Projec" + + "tTeam\022\026\n\016project_number\030\001 \001(\t\022\014\n\004team\030\002 " + + "\001(\t\"\'\n\016ServiceAccount\022\025\n\remail_address\030\001" + + " \001(\t\"*\n\005Owner\022\016\n\006entity\030\001 \001(\t\022\021\n\tentity_" + + "id\030\002 \001(\t\"C\n\014ContentRange\022\r\n\005start\030\001 \001(\003\022" + + "\013\n\003end\030\002 \001(\003\022\027\n\017complete_length\030\003 \001(\0032\230&" + + "\n\007Storage\022r\n\014DeleteBucket\022&.google.stora" + + "ge.v2.DeleteBucketRequest\032\026.google.proto" + + "buf.Empty\"\"\212\323\344\223\002\025\022\023\n\004name\022\013{bucket=**}\332A" + + "\004name\022o\n\tGetBucket\022#.google.storage.v2.G" + + "etBucketRequest\032\031.google.storage.v2.Buck" + + "et\"\"\212\323\344\223\002\025\022\023\n\004name\022\013{bucket=**}\332A\004name\022\253" + + "\001\n\014CreateBucket\022&.google.storage.v2.Crea" + + "teBucketRequest\032\031.google.storage.v2.Buck" + + "et\"X\212\323\344\223\0028\022\026\n\006parent\022\014{project=**}\022\036\n\016bu" + + "cket.project\022\014{project=**}\332A\027parent,buck" + + "et,bucket_id\022\205\001\n\013ListBuckets\022%.google.st" + + "orage.v2.ListBucketsRequest\032&.google.sto" + + "rage.v2.ListBucketsResponse\"\'\212\323\344\223\002\030\022\026\n\006p" + + "arent\022\014{project=**}\332A\006parent\022\223\001\n\031LockBuc" + + "ketRetentionPolicy\0223.google.storage.v2.L" + + "ockBucketRetentionPolicyRequest\032\031.google" + + ".storage.v2.Bucket\"&\212\323\344\223\002\027\022\025\n\006bucket\022\013{b" + + "ucket=**}\332A\006bucket\022\253\001\n\014GetIamPolicy\022\".go" + + "ogle.iam.v1.GetIamPolicyRequest\032\025.google" + + ".iam.v1.Policy\"`\212\323\344\223\002O\022\027\n\010resource\022\013{buc" + + "ket=**}\0224\n\010resource\022({bucket=projects/*/" + + "buckets/*}/objects/**\332A\010resource\022\262\001\n\014Set" + + "IamPolicy\022\".google.iam.v1.SetIamPolicyRe" + + "quest\032\025.google.iam.v1.Policy\"g\212\323\344\223\002O\022\027\n\010" + + "resource\022\013{bucket=**}\0224\n\010resource\022({buck" + + "et=projects/*/buckets/*}/objects/**\332A\017re" + + "source,policy\022\327\001\n\022TestIamPermissions\022(.g" + + "oogle.iam.v1.TestIamPermissionsRequest\032)" + + ".google.iam.v1.TestIamPermissionsRespons" + + "e\"l\212\323\344\223\002O\022\027\n\010resource\022\013{bucket=**}\0224\n\010re" + + "source\022({bucket=projects/*/buckets/*}/ob" + + "jects/**\332A\024resource,permissions\022\212\001\n\014Upda" + + "teBucket\022&.google.storage.v2.UpdateBucke" + + "tRequest\032\031.google.storage.v2.Bucket\"7\212\323\344" + + "\223\002\034\022\032\n\013bucket.name\022\013{bucket=**}\332A\022bucket" + + ",update_mask\022\237\001\n\030DeleteNotificationConfi" + + "g\0222.google.storage.v2.DeleteNotification" + + "ConfigRequest\032\026.google.protobuf.Empty\"7\212" + + "\323\344\223\002*\022(\n\004name\022 {bucket=projects/*/bucket" + + "s/*}/**\332A\004name\022\250\001\n\025GetNotificationConfig" + + "\022/.google.storage.v2.GetNotificationConf" + + "igRequest\032%.google.storage.v2.Notificati" + + "onConfig\"7\212\323\344\223\002*\022(\n\004name\022 {bucket=projec" + + "ts/*/buckets/*}/**\332A\004name\022\261\001\n\030CreateNoti" + + "ficationConfig\0222.google.storage.v2.Creat" + + "eNotificationConfigRequest\032%.google.stor" + + "age.v2.NotificationConfig\":\212\323\344\223\002\027\022\025\n\006par" + + "ent\022\013{bucket=**}\332A\032parent,notification_c" + + "onfig\022\250\001\n\027ListNotificationConfigs\0221.goog" + + "le.storage.v2.ListNotificationConfigsReq" + + "uest\0322.google.storage.v2.ListNotificatio" + + "nConfigsResponse\"&\212\323\344\223\002\027\022\025\n\006parent\022\013{buc" + + "ket=**}\332A\006parent\022~\n\rComposeObject\022\'.goog" + + "le.storage.v2.ComposeObjectRequest\032\031.goo" + + "gle.storage.v2.Object\")\212\323\344\223\002#\022!\n\022destina" + + "tion.bucket\022\013{bucket=**}\022\230\001\n\014DeleteObjec" + + "t\022&.google.storage.v2.DeleteObjectReques" + + "t\032\026.google.protobuf.Empty\"H\212\323\344\223\002\027\022\025\n\006buc" + + "ket\022\013{bucket=**}\332A\rbucket,object\332A\030bucke" + + "t,object,generation\022\272\001\n\024CancelResumableW" + + "rite\022..google.storage.v2.CancelResumable" + + "WriteRequest\032/.google.storage.v2.CancelR" + + "esumableWriteResponse\"A\212\323\344\223\002/\022-\n\tupload_" + + "id\022 {bucket=projects/*/buckets/*}/**\332A\tu" + + "pload_id\022\225\001\n\tGetObject\022#.google.storage." + + "v2.GetObjectRequest\032\031.google.storage.v2." + + "Object\"H\212\323\344\223\002\027\022\025\n\006bucket\022\013{bucket=**}\332A\r" + + "bucket,object\332A\030bucket,object,generation" + + "\022\245\001\n\nReadObject\022$.google.storage.v2.Read" + + "ObjectRequest\032%.google.storage.v2.ReadOb" + + "jectResponse\"H\212\323\344\223\002\027\022\025\n\006bucket\022\013{bucket=" + + "**}\332A\rbucket,object\332A\030bucket,object,gene" + + "ration0\001\022\214\001\n\014UpdateObject\022&.google.stora" + + "ge.v2.UpdateObjectRequest\032\031.google.stora" + + "ge.v2.Object\"9\212\323\344\223\002\036\022\034\n\robject.bucket\022\013{" + + "bucket=**}\332A\022object,update_mask\022`\n\013Write" + + "Object\022%.google.storage.v2.WriteObjectRe" + + "quest\032&.google.storage.v2.WriteObjectRes" + + "ponse\"\000(\001\022\204\001\n\013ListObjects\022%.google.stora" + + "ge.v2.ListObjectsRequest\032&.google.storag" + + "e.v2.ListObjectsResponse\"&\212\323\344\223\002\027\022\025\n\006pare" + + "nt\022\013{bucket=**}\332A\006parent\022\230\001\n\rRewriteObje" + + "ct\022\'.google.storage.v2.RewriteObjectRequ" + + "est\032\".google.storage.v2.RewriteResponse\"" + + ":\212\323\344\223\0024\022\017\n\rsource_bucket\022!\n\022destination_" + + "bucket\022\013{bucket=**}\022\256\001\n\023StartResumableWr" + + "ite\022-.google.storage.v2.StartResumableWr" + + "iteRequest\032..google.storage.v2.StartResu" + + "mableWriteResponse\"8\212\323\344\223\0022\0220\n!write_obje" + + "ct_spec.resource.bucket\022\013{bucket=**}\022\256\001\n" + + "\020QueryWriteStatus\022*.google.storage.v2.Qu" + + "eryWriteStatusRequest\032+.google.storage.v" + + "2.QueryWriteStatusResponse\"A\212\323\344\223\002/\022-\n\tup" + + "load_id\022 {bucket=projects/*/buckets/*}/*" + + "*\332A\tupload_id\022\200\001\n\021GetServiceAccount\022+.go" + + "ogle.storage.v2.GetServiceAccountRequest" + + "\032!.google.storage.v2.ServiceAccount\"\033\212\323\344" + + "\223\002\013\022\t\n\007project\332A\007project\022\225\001\n\rCreateHmacK" + + "ey\022\'.google.storage.v2.CreateHmacKeyRequ" + + "est\032(.google.storage.v2.CreateHmacKeyRes" + + "ponse\"1\212\323\344\223\002\013\022\t\n\007project\332A\035project,servi" + + "ce_account_email\022w\n\rDeleteHmacKey\022\'.goog" + + "le.storage.v2.DeleteHmacKeyRequest\032\026.goo" + + "gle.protobuf.Empty\"%\212\323\344\223\002\013\022\t\n\007project\332A\021" + + "access_id,project\022}\n\nGetHmacKey\022$.google" + + ".storage.v2.GetHmacKeyRequest\032\".google.s" + + "torage.v2.HmacKeyMetadata\"%\212\323\344\223\002\013\022\t\n\007pro" + + "ject\332A\021access_id,project\022|\n\014ListHmacKeys" + + "\022&.google.storage.v2.ListHmacKeysRequest" + + "\032\'.google.storage.v2.ListHmacKeysRespons" + + "e\"\033\212\323\344\223\002\013\022\t\n\007project\332A\007project\022\235\001\n\rUpdat" + + "eHmacKey\022\'.google.storage.v2.UpdateHmacK" + + "eyRequest\032\".google.storage.v2.HmacKeyMet" + + "adata\"?\212\323\344\223\002\"\022 \n\020hmac_key.project\022\014{proj" + + "ect=**}\332A\024hmac_key,update_mask\032\247\002\312A\026stor" + + "age.googleapis.com\322A\212\002https://www.google" + + "apis.com/auth/cloud-platform,https://www" + + ".googleapis.com/auth/cloud-platform.read" + + "-only,https://www.googleapis.com/auth/de" + + "vstorage.full_control,https://www.google" + + "apis.com/auth/devstorage.read_only,https" + + "://www.googleapis.com/auth/devstorage.re" + + "ad_writeB\334\001\n\025com.google.storage.v2B\014Stor" + + "ageProtoP\001Z8google.golang.org/genproto/g" + + "oogleapis/storage/v2;storage\352Ax\n!cloudkm" + + "s.googleapis.com/CryptoKey\022Sprojects/{pr" + + "oject}/locations/{location}/keyRings/{ke" + + "y_ring}/cryptoKeys/{crypto_key}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -959,45 +963,45 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "IfMetagenerationMatch", "IfMetagenerationNotMatch", }); - internal_static_google_storage_v2_DeleteNotificationRequest_descriptor = + internal_static_google_storage_v2_DeleteNotificationConfigRequest_descriptor = getDescriptor().getMessageTypes().get(7); - internal_static_google_storage_v2_DeleteNotificationRequest_fieldAccessorTable = + internal_static_google_storage_v2_DeleteNotificationConfigRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_DeleteNotificationRequest_descriptor, + internal_static_google_storage_v2_DeleteNotificationConfigRequest_descriptor, new java.lang.String[] { "Name", }); - internal_static_google_storage_v2_GetNotificationRequest_descriptor = + internal_static_google_storage_v2_GetNotificationConfigRequest_descriptor = getDescriptor().getMessageTypes().get(8); - internal_static_google_storage_v2_GetNotificationRequest_fieldAccessorTable = + internal_static_google_storage_v2_GetNotificationConfigRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_GetNotificationRequest_descriptor, + internal_static_google_storage_v2_GetNotificationConfigRequest_descriptor, new java.lang.String[] { "Name", }); - internal_static_google_storage_v2_CreateNotificationRequest_descriptor = + internal_static_google_storage_v2_CreateNotificationConfigRequest_descriptor = getDescriptor().getMessageTypes().get(9); - internal_static_google_storage_v2_CreateNotificationRequest_fieldAccessorTable = + internal_static_google_storage_v2_CreateNotificationConfigRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_CreateNotificationRequest_descriptor, + internal_static_google_storage_v2_CreateNotificationConfigRequest_descriptor, new java.lang.String[] { - "Parent", "Notification", + "Parent", "NotificationConfig", }); - internal_static_google_storage_v2_ListNotificationsRequest_descriptor = + internal_static_google_storage_v2_ListNotificationConfigsRequest_descriptor = getDescriptor().getMessageTypes().get(10); - internal_static_google_storage_v2_ListNotificationsRequest_fieldAccessorTable = + internal_static_google_storage_v2_ListNotificationConfigsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_ListNotificationsRequest_descriptor, + internal_static_google_storage_v2_ListNotificationConfigsRequest_descriptor, new java.lang.String[] { "Parent", "PageSize", "PageToken", }); - internal_static_google_storage_v2_ListNotificationsResponse_descriptor = + internal_static_google_storage_v2_ListNotificationConfigsResponse_descriptor = getDescriptor().getMessageTypes().get(11); - internal_static_google_storage_v2_ListNotificationsResponse_fieldAccessorTable = + internal_static_google_storage_v2_ListNotificationConfigsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_ListNotificationsResponse_descriptor, + internal_static_google_storage_v2_ListNotificationConfigsResponse_descriptor, new java.lang.String[] { - "Notifications", "NextPageToken", + "NotificationConfigs", "NextPageToken", }); internal_static_google_storage_v2_ComposeObjectRequest_descriptor = getDescriptor().getMessageTypes().get(12); @@ -1583,11 +1587,11 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "UpdateTime", "Etag", }); - internal_static_google_storage_v2_Notification_descriptor = + internal_static_google_storage_v2_NotificationConfig_descriptor = getDescriptor().getMessageTypes().get(45); - internal_static_google_storage_v2_Notification_fieldAccessorTable = + internal_static_google_storage_v2_NotificationConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_Notification_descriptor, + internal_static_google_storage_v2_NotificationConfig_descriptor, new java.lang.String[] { "Name", "Topic", @@ -1597,11 +1601,11 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "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 = + internal_static_google_storage_v2_NotificationConfig_CustomAttributesEntry_descriptor = + internal_static_google_storage_v2_NotificationConfig_descriptor.getNestedTypes().get(0); + internal_static_google_storage_v2_NotificationConfig_CustomAttributesEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_storage_v2_Notification_CustomAttributesEntry_descriptor, + internal_static_google_storage_v2_NotificationConfig_CustomAttributesEntry_descriptor, new java.lang.String[] { "Key", "Value", }); diff --git a/proto-google-cloud-storage-v2/src/main/proto/google/storage/v2/storage.proto b/proto-google-cloud-storage-v2/src/main/proto/google/storage/v2/storage.proto index 7dc2b5f02d..1c1551cf38 100644 --- a/proto-google-cloud-storage-v2/src/main/proto/google/storage/v2/storage.proto +++ b/proto-google-cloud-storage-v2/src/main/proto/google/storage/v2/storage.proto @@ -87,6 +87,10 @@ service Storage { rpc CreateBucket(CreateBucketRequest) returns (Bucket) { option (google.api.routing) = { routing_parameters { field: "parent" path_template: "{project=**}" } + routing_parameters { + field: "bucket.project" + path_template: "{project=**}" + } }; option (google.api.method_signature) = "parent,bucket,bucket_id"; } @@ -165,8 +169,8 @@ service Storage { option (google.api.method_signature) = "bucket,update_mask"; } - // Permanently deletes a notification subscription. - rpc DeleteNotification(DeleteNotificationRequest) + // Permanently deletes a NotificationConfig. + rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) returns (google.protobuf.Empty) { option (google.api.routing) = { routing_parameters { @@ -177,8 +181,9 @@ service Storage { option (google.api.method_signature) = "name"; } - // View a notification config. - rpc GetNotification(GetNotificationRequest) returns (Notification) { + // View a NotificationConfig. + rpc GetNotificationConfig(GetNotificationConfigRequest) + returns (NotificationConfig) { option (google.api.routing) = { routing_parameters { field: "name" @@ -188,20 +193,21 @@ service Storage { 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) { + // Creates a NotificationConfig for a given bucket. + // These NotificationConfigs, when triggered, publish messages to the + // specified Pub/Sub topics. See + // https://cloud.google.com/storage/docs/pubsub-notifications. + rpc CreateNotificationConfig(CreateNotificationConfigRequest) + returns (NotificationConfig) { option (google.api.routing) = { routing_parameters { field: "parent" path_template: "{bucket=**}" } }; - option (google.api.method_signature) = "parent,notification"; + option (google.api.method_signature) = "parent,notification_config"; } - // Retrieves a list of notification subscriptions for a given bucket. - rpc ListNotifications(ListNotificationsRequest) - returns (ListNotificationsResponse) { + // Retrieves a list of NotificationConfigs for a given bucket. + rpc ListNotificationConfigs(ListNotificationConfigsRequest) + returns (ListNotificationConfigsResponse) { option (google.api.routing) = { routing_parameters { field: "parent" path_template: "{bucket=**}" } }; @@ -307,8 +313,9 @@ service Storage { // returned `persisted_size`; in this case, the service will skip data at // offsets that were already persisted (without checking that it matches // the previously written data), and write only the data starting from the - // persisted offset. This behavior can make client-side handling simpler - // in some cases. + // persisted offset. Even though the data isn't written, it may still + // incur a performance cost over resuming at the correct write offset. + // This behavior can make client-side handling simpler in some cases. // // The service will not view the object as complete until the client has // sent a `WriteObjectRequest` with `finish_write` set to `true`. Sending any @@ -592,31 +599,31 @@ message UpdateBucketRequest { [(google.api.field_behavior) = REQUIRED]; } -// Request message for DeleteNotification. -message DeleteNotificationRequest { - // Required. The parent bucket of the notification. +// Request message for DeleteNotificationConfig. +message DeleteNotificationConfigRequest { + // Required. The parent bucket of the NotificationConfig. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "storage.googleapis.com/Notification" + type: "storage.googleapis.com/NotificationConfig" } ]; } -// Request message for GetNotification. -message GetNotificationRequest { - // Required. The parent bucket of the notification. +// Request message for GetNotificationConfig. +message GetNotificationConfigRequest { + // Required. The parent bucket of the NotificationConfig. // Format: - // `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}` + // `projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig}` 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. +// Request message for CreateNotificationConfig. +message CreateNotificationConfigRequest { + // Required. The bucket to which this NotificationConfig belongs. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -624,12 +631,13 @@ message CreateNotificationRequest { } ]; - // Required. Properties of the notification to be inserted. - Notification notification = 2 [(google.api.field_behavior) = REQUIRED]; + // Required. Properties of the NotificationConfig to be inserted. + NotificationConfig notification_config = 2 + [(google.api.field_behavior) = REQUIRED]; } // Request message for ListNotifications. -message ListNotificationsRequest { +message ListNotificationConfigsRequest { // Required. Name of a Google Cloud Storage bucket. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -638,24 +646,23 @@ message ListNotificationsRequest { } ]; - // The maximum number of notifications to return. The service may return fewer - // than this value. - // The default value is 100. Specifying a value above 100 will result in a - // page_size of 100. + // The maximum number of NotificationConfigs to return. The service may + // return fewer than this value. The default value is 100. Specifying a value + // above 100 will result in a page_size of 100. int32 page_size = 2; - // A page token, received from a previous `ListNotifications` call. + // A page token, received from a previous `ListNotificationConfigs` 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. + // When paginating, all other parameters provided to `ListNotificationConfigs` + // must match the call that provided the page token. string page_token = 3; } -// The result of a call to Notifications.ListNotifications -message ListNotificationsResponse { +// The result of a call to ListNotificationConfigs +message ListNotificationConfigsResponse { // The list of items. - repeated Notification notifications = 1; + repeated NotificationConfig notification_configs = 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. @@ -2056,15 +2063,15 @@ message HmacKeyMetadata { } // A directive to publish Pub/Sub notifications upon changes to a bucket. -message Notification { +message NotificationConfig { option (google.api.resource) = { - type: "storage.googleapis.com/Notification" - pattern: "projects/{project}/buckets/{bucket}/notificationConfigs/{notification}" + type: "storage.googleapis.com/NotificationConfig" + pattern: "projects/{project}/buckets/{bucket}/notificationConfigs/{notification_config}" }; - // Required. The resource name of this notification. + // Required. The resource name of this NotificationConfig. // Format: - // `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}` + // `projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig}` // The `{project}` portion may be `_` for globally unique buckets. string name = 1 [(google.api.field_behavior) = REQUIRED]; @@ -2073,20 +2080,20 @@ message Notification { // '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}' string topic = 2 [(google.api.field_behavior) = REQUIRED]; - // The etag of the Notification. - // If included in the metadata of GetNotificationRequest, the operation will - // only be performed if the etag matches that of the Notification. + // The etag of the NotificationConfig. + // If included in the metadata of GetNotificationConfigRequest, the operation + // will only be performed if the etag matches that of the NotificationConfig. string etag = 7; - // If present, only send notifications about listed event types. If empty, - // sent notifications for all event types. + // If present, only send notifications about listed event types. If + // empty, sent notifications for all event types. repeated string event_types = 3; // A list of additional attributes to attach to each Pub/Sub - // message published for this notification subscription. + // message published for this NotificationConfig. map custom_attributes = 4; - // If present, only apply this notification config to object names that + // If present, only apply this NotificationConfig to object names that // begin with this prefix. string object_name_prefix = 5; diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 65898c4662..ce26e7f675 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -30,7 +30,7 @@ com.google.cloud google-cloud-storage - 2.17.1 + 2.19.0 @@ -61,7 +61,7 @@ com.google.cloud google-cloud-pubsub - 1.123.0 + 1.123.4 test
diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index b6d519c447..7405fb48ea 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -29,7 +29,7 @@ com.google.cloud libraries-bom - 26.4.0 + 26.9.0 pom import @@ -61,7 +61,7 @@ com.google.cloud google-cloud-pubsub - 1.123.0 + 1.123.4 test
@@ -124,7 +124,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M8 + 3.0.0-M9 **/*IT @@ -134,7 +134,7 @@ org.graalvm.buildtools native-maven-plugin - 0.9.19 + 0.9.20 true com.example.storage.NativeImageStorageSample diff --git a/samples/pom.xml b/samples/pom.xml index fbb675d441..26c5d11cbd 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -40,7 +40,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.0.0 + 3.1.0 true diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 78d2a59f4a..2cd3523c8e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-storage - 2.17.2-SNAPSHOT + 2.20.1 @@ -52,7 +52,7 @@ com.google.cloud google-cloud-pubsub - 1.123.0 + 1.123.4 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 6b4767125f..9bfef478c8 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -31,7 +31,7 @@ com.google.cloud libraries-bom - 26.4.0 + 26.9.0 pom import @@ -72,7 +72,7 @@ com.google.cloud google-cloud-pubsub - 1.123.0 + 1.123.4 test 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 index 6472edeb80..6fa796d62f 100644 --- a/samples/snippets/src/main/java/com/example/storage/object/UploadObject.java +++ b/samples/snippets/src/main/java/com/example/storage/object/UploadObject.java @@ -23,7 +23,6 @@ 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 { @@ -48,20 +47,20 @@ public static void uploadObject( // Optional: set a generation-match precondition to avoid potential race // conditions and data corruptions. The request returns a 412 error if the // preconditions are not met. - Storage.BlobTargetOption precondition; + Storage.BlobWriteOption precondition; if (storage.get(bucketName, objectName) == null) { // For a target object that does not yet exist, set the DoesNotExist precondition. // This will cause the request to fail if the object is created before the request runs. - precondition = Storage.BlobTargetOption.doesNotExist(); + precondition = Storage.BlobWriteOption.doesNotExist(); } else { // If the destination already exists in your bucket, instead set a generation-match // precondition. This will cause the request to fail if the existing object's generation // changes before the request runs. precondition = - Storage.BlobTargetOption.generationMatch( + Storage.BlobWriteOption.generationMatch( storage.get(bucketName, objectName).getGeneration()); } - storage.create(blobInfo, Files.readAllBytes(Paths.get(filePath)), precondition); + storage.createFrom(blobInfo, Paths.get(filePath), precondition); System.out.println( "File " + filePath + " uploaded to bucket " + bucketName + " as " + objectName); diff --git a/versions.txt b/versions.txt index 3f5ede9ce9..ea092b9028 100644 --- a/versions.txt +++ b/versions.txt @@ -1,7 +1,7 @@ # Format: # module:released-version:current-version -google-cloud-storage:2.17.1:2.17.2-SNAPSHOT -gapic-google-cloud-storage-v2:2.17.1-alpha:2.17.2-alpha-SNAPSHOT -grpc-google-cloud-storage-v2:2.17.1-alpha:2.17.2-alpha-SNAPSHOT -proto-google-cloud-storage-v2:2.17.1-alpha:2.17.2-alpha-SNAPSHOT +google-cloud-storage:2.20.1:2.20.1 +gapic-google-cloud-storage-v2:2.20.1-alpha:2.20.1-alpha +grpc-google-cloud-storage-v2:2.20.1-alpha:2.20.1-alpha +proto-google-cloud-storage-v2:2.20.1-alpha:2.20.1-alpha