From 29d1eb102184d9fd6ea000ac13c8e5a098fb7e0a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 7 Jul 2023 14:36:43 -0400 Subject: [PATCH] feat: [run] Adds support for custom audiences (#9618) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Adds support for custom audiences Custom Audiences * The new field is found in https://cloud.google.com/run/docs/reference/rest/v2/projects.locations.services. * For more information, see https://cloud.google.com/run/docs/configuring/custom-audiences. PiperOrigin-RevId: 546032394 Source-Link: https://github.com/googleapis/googleapis/commit/96f0194ca97a1c633b5acba991fbfa355ef41f64 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f95d5cafc5730dd1c6e30aa2395e1b37c4122ad8 Copy-Tag: eyJwIjoiamF2YS1ydW4vLk93bEJvdC55YW1sIiwiaCI6ImY5NWQ1Y2FmYzU3MzBkZDFjNmUzMGFhMjM5NWUxYjM3YzQxMjJhZDgifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- java-run/README.md | 4 +- .../run/v2/ServicesClientHttpJsonTest.java | 9 + .../cloud/run/v2/ServicesClientTest.java | 7 + .../java/com/google/cloud/run/v2/Service.java | 355 +++++++++++++++++- .../google/cloud/run/v2/ServiceOrBuilder.java | 67 ++++ .../com/google/cloud/run/v2/ServiceProto.java | 110 +++--- .../proto/google/cloud/run/v2/service.proto | 7 + 7 files changed, 490 insertions(+), 69 deletions(-) diff --git a/java-run/README.md b/java-run/README.md index 25322e1a924d..577effd7ddbb 100644 --- a/java-run/README.md +++ b/java-run/README.md @@ -23,7 +23,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.16.0 + 26.18.0 pom import @@ -201,7 +201,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html [stability-image]: https://img.shields.io/badge/stability-preview-yellow [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-run.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-run/0.19.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-run/0.20.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/java-run/google-cloud-run/src/test/java/com/google/cloud/run/v2/ServicesClientHttpJsonTest.java b/java-run/google-cloud-run/src/test/java/com/google/cloud/run/v2/ServicesClientHttpJsonTest.java index dbab29ae2a4f..c074d73cab93 100644 --- a/java-run/google-cloud-run/src/test/java/com/google/cloud/run/v2/ServicesClientHttpJsonTest.java +++ b/java-run/google-cloud-run/src/test/java/com/google/cloud/run/v2/ServicesClientHttpJsonTest.java @@ -123,6 +123,7 @@ public void createServiceTest() throws Exception { RevisionName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[REVISION]").toString()) .addAllTrafficStatuses(new ArrayList()) .setUri("uri116076") + .addAllCustomAudiences(new ArrayList()) .setSatisfiesPzs(true) .setReconciling(true) .setEtag("etag3123477") @@ -206,6 +207,7 @@ public void createServiceTest2() throws Exception { RevisionName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[REVISION]").toString()) .addAllTrafficStatuses(new ArrayList()) .setUri("uri116076") + .addAllCustomAudiences(new ArrayList()) .setSatisfiesPzs(true) .setReconciling(true) .setEtag("etag3123477") @@ -289,6 +291,7 @@ public void getServiceTest() throws Exception { RevisionName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[REVISION]").toString()) .addAllTrafficStatuses(new ArrayList()) .setUri("uri116076") + .addAllCustomAudiences(new ArrayList()) .setSatisfiesPzs(true) .setReconciling(true) .setEtag("etag3123477") @@ -363,6 +366,7 @@ public void getServiceTest2() throws Exception { RevisionName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[REVISION]").toString()) .addAllTrafficStatuses(new ArrayList()) .setUri("uri116076") + .addAllCustomAudiences(new ArrayList()) .setSatisfiesPzs(true) .setReconciling(true) .setEtag("etag3123477") @@ -537,6 +541,7 @@ public void updateServiceTest() throws Exception { RevisionName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[REVISION]").toString()) .addAllTrafficStatuses(new ArrayList()) .setUri("uri116076") + .addAllCustomAudiences(new ArrayList()) .setSatisfiesPzs(true) .setReconciling(true) .setEtag("etag3123477") @@ -579,6 +584,7 @@ public void updateServiceTest() throws Exception { RevisionName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[REVISION]").toString()) .addAllTrafficStatuses(new ArrayList()) .setUri("uri116076") + .addAllCustomAudiences(new ArrayList()) .setSatisfiesPzs(true) .setReconciling(true) .setEtag("etag3123477") @@ -640,6 +646,7 @@ public void updateServiceExceptionTest() throws Exception { RevisionName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[REVISION]").toString()) .addAllTrafficStatuses(new ArrayList()) .setUri("uri116076") + .addAllCustomAudiences(new ArrayList()) .setSatisfiesPzs(true) .setReconciling(true) .setEtag("etag3123477") @@ -682,6 +689,7 @@ public void deleteServiceTest() throws Exception { RevisionName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[REVISION]").toString()) .addAllTrafficStatuses(new ArrayList()) .setUri("uri116076") + .addAllCustomAudiences(new ArrayList()) .setSatisfiesPzs(true) .setReconciling(true) .setEtag("etag3123477") @@ -761,6 +769,7 @@ public void deleteServiceTest2() throws Exception { RevisionName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[REVISION]").toString()) .addAllTrafficStatuses(new ArrayList()) .setUri("uri116076") + .addAllCustomAudiences(new ArrayList()) .setSatisfiesPzs(true) .setReconciling(true) .setEtag("etag3123477") diff --git a/java-run/google-cloud-run/src/test/java/com/google/cloud/run/v2/ServicesClientTest.java b/java-run/google-cloud-run/src/test/java/com/google/cloud/run/v2/ServicesClientTest.java index 0f76be5cb2fd..5b5723fd8b2c 100644 --- a/java-run/google-cloud-run/src/test/java/com/google/cloud/run/v2/ServicesClientTest.java +++ b/java-run/google-cloud-run/src/test/java/com/google/cloud/run/v2/ServicesClientTest.java @@ -131,6 +131,7 @@ public void createServiceTest() throws Exception { RevisionName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[REVISION]").toString()) .addAllTrafficStatuses(new ArrayList()) .setUri("uri116076") + .addAllCustomAudiences(new ArrayList()) .setSatisfiesPzs(true) .setReconciling(true) .setEtag("etag3123477") @@ -213,6 +214,7 @@ public void createServiceTest2() throws Exception { RevisionName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[REVISION]").toString()) .addAllTrafficStatuses(new ArrayList()) .setUri("uri116076") + .addAllCustomAudiences(new ArrayList()) .setSatisfiesPzs(true) .setReconciling(true) .setEtag("etag3123477") @@ -295,6 +297,7 @@ public void getServiceTest() throws Exception { RevisionName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[REVISION]").toString()) .addAllTrafficStatuses(new ArrayList()) .setUri("uri116076") + .addAllCustomAudiences(new ArrayList()) .setSatisfiesPzs(true) .setReconciling(true) .setEtag("etag3123477") @@ -363,6 +366,7 @@ public void getServiceTest2() throws Exception { RevisionName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[REVISION]").toString()) .addAllTrafficStatuses(new ArrayList()) .setUri("uri116076") + .addAllCustomAudiences(new ArrayList()) .setSatisfiesPzs(true) .setReconciling(true) .setEtag("etag3123477") @@ -519,6 +523,7 @@ public void updateServiceTest() throws Exception { RevisionName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[REVISION]").toString()) .addAllTrafficStatuses(new ArrayList()) .setUri("uri116076") + .addAllCustomAudiences(new ArrayList()) .setSatisfiesPzs(true) .setReconciling(true) .setEtag("etag3123477") @@ -595,6 +600,7 @@ public void deleteServiceTest() throws Exception { RevisionName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[REVISION]").toString()) .addAllTrafficStatuses(new ArrayList()) .setUri("uri116076") + .addAllCustomAudiences(new ArrayList()) .setSatisfiesPzs(true) .setReconciling(true) .setEtag("etag3123477") @@ -671,6 +677,7 @@ public void deleteServiceTest2() throws Exception { RevisionName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[REVISION]").toString()) .addAllTrafficStatuses(new ArrayList()) .setUri("uri116076") + .addAllCustomAudiences(new ArrayList()) .setSatisfiesPzs(true) .setReconciling(true) .setEtag("etag3123477") diff --git a/java-run/proto-google-cloud-run-v2/src/main/java/com/google/cloud/run/v2/Service.java b/java-run/proto-google-cloud-run-v2/src/main/java/com/google/cloud/run/v2/Service.java index 5404a5054ad5..3dd376f3ae6d 100644 --- a/java-run/proto-google-cloud-run-v2/src/main/java/com/google/cloud/run/v2/Service.java +++ b/java-run/proto-google-cloud-run-v2/src/main/java/com/google/cloud/run/v2/Service.java @@ -57,6 +57,7 @@ private Service() { latestCreatedRevision_ = ""; trafficStatuses_ = java.util.Collections.emptyList(); uri_ = ""; + customAudiences_ = com.google.protobuf.LazyStringArrayList.emptyList(); etag_ = ""; } @@ -1697,6 +1698,86 @@ public com.google.protobuf.ByteString getUriBytes() { } } + public static final int CUSTOM_AUDIENCES_FIELD_NUMBER = 37; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList customAudiences_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * One or more custom audiences that you want this service to support. Specify
+   * each custom audience as the full URL in a string. The custom audiences are
+   * encoded in the token and used to authenticate requests. For more
+   * information, see
+   * https://cloud.google.com/run/docs/configuring/custom-audiences.
+   * 
+ * + * repeated string custom_audiences = 37; + * + * @return A list containing the customAudiences. + */ + public com.google.protobuf.ProtocolStringList getCustomAudiencesList() { + return customAudiences_; + } + /** + * + * + *
+   * One or more custom audiences that you want this service to support. Specify
+   * each custom audience as the full URL in a string. The custom audiences are
+   * encoded in the token and used to authenticate requests. For more
+   * information, see
+   * https://cloud.google.com/run/docs/configuring/custom-audiences.
+   * 
+ * + * repeated string custom_audiences = 37; + * + * @return The count of customAudiences. + */ + public int getCustomAudiencesCount() { + return customAudiences_.size(); + } + /** + * + * + *
+   * One or more custom audiences that you want this service to support. Specify
+   * each custom audience as the full URL in a string. The custom audiences are
+   * encoded in the token and used to authenticate requests. For more
+   * information, see
+   * https://cloud.google.com/run/docs/configuring/custom-audiences.
+   * 
+ * + * repeated string custom_audiences = 37; + * + * @param index The index of the element to return. + * @return The customAudiences at the given index. + */ + public java.lang.String getCustomAudiences(int index) { + return customAudiences_.get(index); + } + /** + * + * + *
+   * One or more custom audiences that you want this service to support. Specify
+   * each custom audience as the full URL in a string. The custom audiences are
+   * encoded in the token and used to authenticate requests. For more
+   * information, see
+   * https://cloud.google.com/run/docs/configuring/custom-audiences.
+   * 
+ * + * repeated string custom_audiences = 37; + * + * @param index The index of the value to return. + * @return The bytes of the customAudiences at the given index. + */ + public com.google.protobuf.ByteString getCustomAudiencesBytes(int index) { + return customAudiences_.getByteString(index); + } + public static final int SATISFIES_PZS_FIELD_NUMBER = 38; private boolean satisfiesPzs_ = false; /** @@ -1898,6 +1979,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 36, uri_); } + for (int i = 0; i < customAudiences_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 37, customAudiences_.getRaw(i)); + } if (satisfiesPzs_ != false) { output.writeBool(38, satisfiesPzs_); } @@ -2010,6 +2094,14 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(36, uri_); } + { + int dataSize = 0; + for (int i = 0; i < customAudiences_.size(); i++) { + dataSize += computeStringSizeNoTag(customAudiences_.getRaw(i)); + } + size += dataSize; + size += 2 * getCustomAudiencesList().size(); + } if (satisfiesPzs_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(38, satisfiesPzs_); } @@ -2081,6 +2173,7 @@ public boolean equals(final java.lang.Object obj) { if (!getLatestCreatedRevision().equals(other.getLatestCreatedRevision())) return false; if (!getTrafficStatusesList().equals(other.getTrafficStatusesList())) return false; if (!getUri().equals(other.getUri())) return false; + if (!getCustomAudiencesList().equals(other.getCustomAudiencesList())) return false; if (getSatisfiesPzs() != other.getSatisfiesPzs()) return false; if (getReconciling() != other.getReconciling()) return false; if (!getEtag().equals(other.getEtag())) return false; @@ -2171,6 +2264,10 @@ public int hashCode() { } hash = (37 * hash) + URI_FIELD_NUMBER; hash = (53 * hash) + getUri().hashCode(); + if (getCustomAudiencesCount() > 0) { + hash = (37 * hash) + CUSTOM_AUDIENCES_FIELD_NUMBER; + hash = (53 * hash) + getCustomAudiencesList().hashCode(); + } hash = (37 * hash) + SATISFIES_PZS_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSatisfiesPzs()); hash = (37 * hash) + RECONCILING_FIELD_NUMBER; @@ -2414,6 +2511,7 @@ public Builder clear() { } bitField0_ = (bitField0_ & ~0x01000000); uri_ = ""; + customAudiences_ = com.google.protobuf.LazyStringArrayList.emptyList(); satisfiesPzs_ = false; reconciling_ = false; etag_ = ""; @@ -2561,12 +2659,16 @@ private void buildPartial0(com.google.cloud.run.v2.Service result) { result.uri_ = uri_; } if (((from_bitField0_ & 0x04000000) != 0)) { - result.satisfiesPzs_ = satisfiesPzs_; + customAudiences_.makeImmutable(); + result.customAudiences_ = customAudiences_; } if (((from_bitField0_ & 0x08000000) != 0)) { - result.reconciling_ = reconciling_; + result.satisfiesPzs_ = satisfiesPzs_; } if (((from_bitField0_ & 0x10000000) != 0)) { + result.reconciling_ = reconciling_; + } + if (((from_bitField0_ & 0x20000000) != 0)) { result.etag_ = etag_; } } @@ -2784,6 +2886,16 @@ public Builder mergeFrom(com.google.cloud.run.v2.Service other) { bitField0_ |= 0x02000000; onChanged(); } + if (!other.customAudiences_.isEmpty()) { + if (customAudiences_.isEmpty()) { + customAudiences_ = other.customAudiences_; + bitField0_ |= 0x04000000; + } else { + ensureCustomAudiencesIsMutable(); + customAudiences_.addAll(other.customAudiences_); + } + onChanged(); + } if (other.getSatisfiesPzs() != false) { setSatisfiesPzs(other.getSatisfiesPzs()); } @@ -2792,7 +2904,7 @@ public Builder mergeFrom(com.google.cloud.run.v2.Service other) { } if (!other.getEtag().isEmpty()) { etag_ = other.etag_; - bitField0_ |= 0x10000000; + bitField0_ |= 0x20000000; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -3012,22 +3124,29 @@ public Builder mergeFrom( bitField0_ |= 0x02000000; break; } // case 290 + case 298: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureCustomAudiencesIsMutable(); + customAudiences_.add(s); + break; + } // case 298 case 304: { satisfiesPzs_ = input.readBool(); - bitField0_ |= 0x04000000; + bitField0_ |= 0x08000000; break; } // case 304 case 784: { reconciling_ = input.readBool(); - bitField0_ |= 0x08000000; + bitField0_ |= 0x10000000; break; } // case 784 case 794: { etag_ = input.readStringRequireUtf8(); - bitField0_ |= 0x10000000; + bitField0_ |= 0x20000000; break; } // case 794 default: @@ -7706,6 +7825,216 @@ public Builder setUriBytes(com.google.protobuf.ByteString value) { return this; } + private com.google.protobuf.LazyStringArrayList customAudiences_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureCustomAudiencesIsMutable() { + if (!customAudiences_.isModifiable()) { + customAudiences_ = new com.google.protobuf.LazyStringArrayList(customAudiences_); + } + bitField0_ |= 0x04000000; + } + /** + * + * + *
+     * One or more custom audiences that you want this service to support. Specify
+     * each custom audience as the full URL in a string. The custom audiences are
+     * encoded in the token and used to authenticate requests. For more
+     * information, see
+     * https://cloud.google.com/run/docs/configuring/custom-audiences.
+     * 
+ * + * repeated string custom_audiences = 37; + * + * @return A list containing the customAudiences. + */ + public com.google.protobuf.ProtocolStringList getCustomAudiencesList() { + customAudiences_.makeImmutable(); + return customAudiences_; + } + /** + * + * + *
+     * One or more custom audiences that you want this service to support. Specify
+     * each custom audience as the full URL in a string. The custom audiences are
+     * encoded in the token and used to authenticate requests. For more
+     * information, see
+     * https://cloud.google.com/run/docs/configuring/custom-audiences.
+     * 
+ * + * repeated string custom_audiences = 37; + * + * @return The count of customAudiences. + */ + public int getCustomAudiencesCount() { + return customAudiences_.size(); + } + /** + * + * + *
+     * One or more custom audiences that you want this service to support. Specify
+     * each custom audience as the full URL in a string. The custom audiences are
+     * encoded in the token and used to authenticate requests. For more
+     * information, see
+     * https://cloud.google.com/run/docs/configuring/custom-audiences.
+     * 
+ * + * repeated string custom_audiences = 37; + * + * @param index The index of the element to return. + * @return The customAudiences at the given index. + */ + public java.lang.String getCustomAudiences(int index) { + return customAudiences_.get(index); + } + /** + * + * + *
+     * One or more custom audiences that you want this service to support. Specify
+     * each custom audience as the full URL in a string. The custom audiences are
+     * encoded in the token and used to authenticate requests. For more
+     * information, see
+     * https://cloud.google.com/run/docs/configuring/custom-audiences.
+     * 
+ * + * repeated string custom_audiences = 37; + * + * @param index The index of the value to return. + * @return The bytes of the customAudiences at the given index. + */ + public com.google.protobuf.ByteString getCustomAudiencesBytes(int index) { + return customAudiences_.getByteString(index); + } + /** + * + * + *
+     * One or more custom audiences that you want this service to support. Specify
+     * each custom audience as the full URL in a string. The custom audiences are
+     * encoded in the token and used to authenticate requests. For more
+     * information, see
+     * https://cloud.google.com/run/docs/configuring/custom-audiences.
+     * 
+ * + * repeated string custom_audiences = 37; + * + * @param index The index to set the value at. + * @param value The customAudiences to set. + * @return This builder for chaining. + */ + public Builder setCustomAudiences(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomAudiencesIsMutable(); + customAudiences_.set(index, value); + bitField0_ |= 0x04000000; + onChanged(); + return this; + } + /** + * + * + *
+     * One or more custom audiences that you want this service to support. Specify
+     * each custom audience as the full URL in a string. The custom audiences are
+     * encoded in the token and used to authenticate requests. For more
+     * information, see
+     * https://cloud.google.com/run/docs/configuring/custom-audiences.
+     * 
+ * + * repeated string custom_audiences = 37; + * + * @param value The customAudiences to add. + * @return This builder for chaining. + */ + public Builder addCustomAudiences(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomAudiencesIsMutable(); + customAudiences_.add(value); + bitField0_ |= 0x04000000; + onChanged(); + return this; + } + /** + * + * + *
+     * One or more custom audiences that you want this service to support. Specify
+     * each custom audience as the full URL in a string. The custom audiences are
+     * encoded in the token and used to authenticate requests. For more
+     * information, see
+     * https://cloud.google.com/run/docs/configuring/custom-audiences.
+     * 
+ * + * repeated string custom_audiences = 37; + * + * @param values The customAudiences to add. + * @return This builder for chaining. + */ + public Builder addAllCustomAudiences(java.lang.Iterable values) { + ensureCustomAudiencesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, customAudiences_); + bitField0_ |= 0x04000000; + onChanged(); + return this; + } + /** + * + * + *
+     * One or more custom audiences that you want this service to support. Specify
+     * each custom audience as the full URL in a string. The custom audiences are
+     * encoded in the token and used to authenticate requests. For more
+     * information, see
+     * https://cloud.google.com/run/docs/configuring/custom-audiences.
+     * 
+ * + * repeated string custom_audiences = 37; + * + * @return This builder for chaining. + */ + public Builder clearCustomAudiences() { + customAudiences_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x04000000); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * One or more custom audiences that you want this service to support. Specify
+     * each custom audience as the full URL in a string. The custom audiences are
+     * encoded in the token and used to authenticate requests. For more
+     * information, see
+     * https://cloud.google.com/run/docs/configuring/custom-audiences.
+     * 
+ * + * repeated string custom_audiences = 37; + * + * @param value The bytes of the customAudiences to add. + * @return This builder for chaining. + */ + public Builder addCustomAudiencesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCustomAudiencesIsMutable(); + customAudiences_.add(value); + bitField0_ |= 0x04000000; + onChanged(); + return this; + } + private boolean satisfiesPzs_; /** * @@ -7737,7 +8066,7 @@ public boolean getSatisfiesPzs() { public Builder setSatisfiesPzs(boolean value) { satisfiesPzs_ = value; - bitField0_ |= 0x04000000; + bitField0_ |= 0x08000000; onChanged(); return this; } @@ -7753,7 +8082,7 @@ public Builder setSatisfiesPzs(boolean value) { * @return This builder for chaining. */ public Builder clearSatisfiesPzs() { - bitField0_ = (bitField0_ & ~0x04000000); + bitField0_ = (bitField0_ & ~0x08000000); satisfiesPzs_ = false; onChanged(); return this; @@ -7832,7 +8161,7 @@ public boolean getReconciling() { public Builder setReconciling(boolean value) { reconciling_ = value; - bitField0_ |= 0x08000000; + bitField0_ |= 0x10000000; onChanged(); return this; } @@ -7869,7 +8198,7 @@ public Builder setReconciling(boolean value) { * @return This builder for chaining. */ public Builder clearReconciling() { - bitField0_ = (bitField0_ & ~0x08000000); + bitField0_ = (bitField0_ & ~0x10000000); reconciling_ = false; onChanged(); return this; @@ -7940,7 +8269,7 @@ public Builder setEtag(java.lang.String value) { throw new NullPointerException(); } etag_ = value; - bitField0_ |= 0x10000000; + bitField0_ |= 0x20000000; onChanged(); return this; } @@ -7958,7 +8287,7 @@ public Builder setEtag(java.lang.String value) { */ public Builder clearEtag() { etag_ = getDefaultInstance().getEtag(); - bitField0_ = (bitField0_ & ~0x10000000); + bitField0_ = (bitField0_ & ~0x20000000); onChanged(); return this; } @@ -7981,7 +8310,7 @@ public Builder setEtagBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); etag_ = value; - bitField0_ |= 0x10000000; + bitField0_ |= 0x20000000; onChanged(); return this; } diff --git a/java-run/proto-google-cloud-run-v2/src/main/java/com/google/cloud/run/v2/ServiceOrBuilder.java b/java-run/proto-google-cloud-run-v2/src/main/java/com/google/cloud/run/v2/ServiceOrBuilder.java index 4d2272169c4e..f13a14b576c5 100644 --- a/java-run/proto-google-cloud-run-v2/src/main/java/com/google/cloud/run/v2/ServiceOrBuilder.java +++ b/java-run/proto-google-cloud-run-v2/src/main/java/com/google/cloud/run/v2/ServiceOrBuilder.java @@ -1122,6 +1122,73 @@ java.lang.String getAnnotationsOrDefault( */ com.google.protobuf.ByteString getUriBytes(); + /** + * + * + *
+   * One or more custom audiences that you want this service to support. Specify
+   * each custom audience as the full URL in a string. The custom audiences are
+   * encoded in the token and used to authenticate requests. For more
+   * information, see
+   * https://cloud.google.com/run/docs/configuring/custom-audiences.
+   * 
+ * + * repeated string custom_audiences = 37; + * + * @return A list containing the customAudiences. + */ + java.util.List getCustomAudiencesList(); + /** + * + * + *
+   * One or more custom audiences that you want this service to support. Specify
+   * each custom audience as the full URL in a string. The custom audiences are
+   * encoded in the token and used to authenticate requests. For more
+   * information, see
+   * https://cloud.google.com/run/docs/configuring/custom-audiences.
+   * 
+ * + * repeated string custom_audiences = 37; + * + * @return The count of customAudiences. + */ + int getCustomAudiencesCount(); + /** + * + * + *
+   * One or more custom audiences that you want this service to support. Specify
+   * each custom audience as the full URL in a string. The custom audiences are
+   * encoded in the token and used to authenticate requests. For more
+   * information, see
+   * https://cloud.google.com/run/docs/configuring/custom-audiences.
+   * 
+ * + * repeated string custom_audiences = 37; + * + * @param index The index of the element to return. + * @return The customAudiences at the given index. + */ + java.lang.String getCustomAudiences(int index); + /** + * + * + *
+   * One or more custom audiences that you want this service to support. Specify
+   * each custom audience as the full URL in a string. The custom audiences are
+   * encoded in the token and used to authenticate requests. For more
+   * information, see
+   * https://cloud.google.com/run/docs/configuring/custom-audiences.
+   * 
+ * + * repeated string custom_audiences = 37; + * + * @param index The index of the value to return. + * @return The bytes of the customAudiences at the given index. + */ + com.google.protobuf.ByteString getCustomAudiencesBytes(int index); + /** * * diff --git a/java-run/proto-google-cloud-run-v2/src/main/java/com/google/cloud/run/v2/ServiceProto.java b/java-run/proto-google-cloud-run-v2/src/main/java/com/google/cloud/run/v2/ServiceProto.java index 1da074949649..602738381051 100644 --- a/java-run/proto-google-cloud-run-v2/src/main/java/com/google/cloud/run/v2/ServiceProto.java +++ b/java-run/proto-google-cloud-run-v2/src/main/java/com/google/cloud/run/v2/ServiceProto.java @@ -103,7 +103,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "pis.com/Service\"n\n\024DeleteServiceRequest\022" + "1\n\004name\030\001 \001(\tB#\342A\001\002\372A\034\n\032run.googleapis.c" + "om/Service\022\025\n\rvalidate_only\030\002 \001(\010\022\014\n\004eta" - + "g\030\003 \001(\t\"\307\013\n\007Service\022\014\n\004name\030\001 \001(\t\022\023\n\013des" + + "g\030\003 \001(\t\"\341\013\n\007Service\022\014\n\004name\030\001 \001(\t\022\023\n\013des" + "cription\030\002 \001(\t\022\021\n\003uid\030\003 \001(\tB\004\342A\001\003\022\030\n\ngen" + "eration\030\004 \001(\003B\004\342A\001\003\0228\n\006labels\030\005 \003(\0132(.go" + "ogle.cloud.run.v2.Service.LabelsEntry\022B\n" @@ -133,59 +133,60 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "n\030\" \001(\tB$\342A\001\003\372A\035\n\033run.googleapis.com/Rev" + "ision\022H\n\020traffic_statuses\030# \003(\0132(.google" + ".cloud.run.v2.TrafficTargetStatusB\004\342A\001\003\022" - + "\021\n\003uri\030$ \001(\tB\004\342A\001\003\022\033\n\rsatisfies_pzs\030& \001(" - + "\010B\004\342A\001\003\022\031\n\013reconciling\030b \001(\010B\004\342A\001\003\022\022\n\004et" - + "ag\030c \001(\tB\004\342A\001\003\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001" - + "(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0322\n\020AnnotationsEntr" - + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:^\352A[\n\032" - + "run.googleapis.com/Service\022:projects/{pr" - + "oject}/locations/{location}/services/{se" - + "rvice}R\001\0012\267\r\n\010Services\022\375\001\n\rCreateService" - + "\022).google.cloud.run.v2.CreateServiceRequ" - + "est\032\035.google.longrunning.Operation\"\241\001\312A\022" - + "\n\007Service\022\007Service\332A\031parent,service,serv" - + "ice_id\202\323\344\223\0027\",/v2/{parent=projects/*/loc" - + "ations/*}/services:\007service\212\323\344\223\002-\022+\n\006par" - + "ent\022!projects/*/locations/{location=*}\022\303" - + "\001\n\nGetService\022&.google.cloud.run.v2.GetS" - + "erviceRequest\032\034.google.cloud.run.v2.Serv" - + "ice\"o\332A\004name\202\323\344\223\002.\022,/v2/{name=projects/*" - + "/locations/*/services/*}\212\323\344\223\002.\022,\n\004name\022$" - + "projects/*/locations/{location=*}/**\022\325\001\n" - + "\014ListServices\022(.google.cloud.run.v2.List" - + "ServicesRequest\032).google.cloud.run.v2.Li" - + "stServicesResponse\"p\332A\006parent\202\323\344\223\002.\022,/v2" - + "/{parent=projects/*/locations/*}/service" - + "s\212\323\344\223\002-\022+\n\006parent\022!projects/*/locations/" - + "{location=*}\022\374\001\n\rUpdateService\022).google." - + "cloud.run.v2.UpdateServiceRequest\032\035.goog" - + "le.longrunning.Operation\"\240\001\312A\022\n\007Service\022" - + "\007Service\332A\007service\202\323\344\223\002?24/v2/{service.n" - + "ame=projects/*/locations/*/services/*}:\007" - + "service\212\323\344\223\0026\0224\n\014service.name\022$projects/" - + "*/locations/{location=*}/**\022\340\001\n\rDeleteSe" - + "rvice\022).google.cloud.run.v2.DeleteServic" - + "eRequest\032\035.google.longrunning.Operation\"" - + "\204\001\312A\022\n\007Service\022\007Service\332A\004name\202\323\344\223\002.*,/v" - + "2/{name=projects/*/locations/*/services/" - + "*}\212\323\344\223\002.\022,\n\004name\022$projects/*/locations/{" - + "location=*}/**\022\220\001\n\014GetIamPolicy\022\".google" - + ".iam.v1.GetIamPolicyRequest\032\025.google.iam" - + ".v1.Policy\"E\202\323\344\223\002?\022=/v2/{resource=projec" - + "ts/*/locations/*/services/*}:getIamPolic" - + "y\022\223\001\n\014SetIamPolicy\022\".google.iam.v1.SetIa" - + "mPolicyRequest\032\025.google.iam.v1.Policy\"H\202" - + "\323\344\223\002B\"=/v2/{resource=projects/*/location" - + "s/*/services/*}:setIamPolicy:\001*\022\271\001\n\022Test" - + "IamPermissions\022(.google.iam.v1.TestIamPe" - + "rmissionsRequest\032).google.iam.v1.TestIam" - + "PermissionsResponse\"N\202\323\344\223\002H\"C/v2/{resour" - + "ce=projects/*/locations/*/services/*}:te" - + "stIamPermissions:\001*\032F\312A\022run.googleapis.c" - + "om\322A.https://www.googleapis.com/auth/clo" - + "ud-platformBT\n\027com.google.cloud.run.v2B\014" - + "ServiceProtoP\001Z)cloud.google.com/go/run/" - + "apiv2/runpb;runpbb\006proto3" + + "\021\n\003uri\030$ \001(\tB\004\342A\001\003\022\030\n\020custom_audiences\030%" + + " \003(\t\022\033\n\rsatisfies_pzs\030& \001(\010B\004\342A\001\003\022\031\n\013rec" + + "onciling\030b \001(\010B\004\342A\001\003\022\022\n\004etag\030c \001(\tB\004\342A\001\003" + + "\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 " + + "\001(\t:\0028\001\0322\n\020AnnotationsEntry\022\013\n\003key\030\001 \001(\t" + + "\022\r\n\005value\030\002 \001(\t:\0028\001:^\352A[\n\032run.googleapis" + + ".com/Service\022:projects/{project}/locatio" + + "ns/{location}/services/{service}R\001\0012\267\r\n\010" + + "Services\022\375\001\n\rCreateService\022).google.clou" + + "d.run.v2.CreateServiceRequest\032\035.google.l" + + "ongrunning.Operation\"\241\001\312A\022\n\007Service\022\007Ser" + + "vice\332A\031parent,service,service_id\202\323\344\223\0027\"," + + "/v2/{parent=projects/*/locations/*}/serv" + + "ices:\007service\212\323\344\223\002-\022+\n\006parent\022!projects/" + + "*/locations/{location=*}\022\303\001\n\nGetService\022" + + "&.google.cloud.run.v2.GetServiceRequest\032" + + "\034.google.cloud.run.v2.Service\"o\332A\004name\202\323" + + "\344\223\002.\022,/v2/{name=projects/*/locations/*/s" + + "ervices/*}\212\323\344\223\002.\022,\n\004name\022$projects/*/loc" + + "ations/{location=*}/**\022\325\001\n\014ListServices\022" + + "(.google.cloud.run.v2.ListServicesReques" + + "t\032).google.cloud.run.v2.ListServicesResp" + + "onse\"p\332A\006parent\202\323\344\223\002.\022,/v2/{parent=proje" + + "cts/*/locations/*}/services\212\323\344\223\002-\022+\n\006par" + + "ent\022!projects/*/locations/{location=*}\022\374" + + "\001\n\rUpdateService\022).google.cloud.run.v2.U" + + "pdateServiceRequest\032\035.google.longrunning" + + ".Operation\"\240\001\312A\022\n\007Service\022\007Service\332A\007ser" + + "vice\202\323\344\223\002?24/v2/{service.name=projects/*" + + "/locations/*/services/*}:\007service\212\323\344\223\0026\022" + + "4\n\014service.name\022$projects/*/locations/{l" + + "ocation=*}/**\022\340\001\n\rDeleteService\022).google" + + ".cloud.run.v2.DeleteServiceRequest\032\035.goo" + + "gle.longrunning.Operation\"\204\001\312A\022\n\007Service" + + "\022\007Service\332A\004name\202\323\344\223\002.*,/v2/{name=projec" + + "ts/*/locations/*/services/*}\212\323\344\223\002.\022,\n\004na" + + "me\022$projects/*/locations/{location=*}/**" + + "\022\220\001\n\014GetIamPolicy\022\".google.iam.v1.GetIam" + + "PolicyRequest\032\025.google.iam.v1.Policy\"E\202\323" + + "\344\223\002?\022=/v2/{resource=projects/*/locations" + + "/*/services/*}:getIamPolicy\022\223\001\n\014SetIamPo" + + "licy\022\".google.iam.v1.SetIamPolicyRequest" + + "\032\025.google.iam.v1.Policy\"H\202\323\344\223\002B\"=/v2/{re" + + "source=projects/*/locations/*/services/*" + + "}:setIamPolicy:\001*\022\271\001\n\022TestIamPermissions" + + "\022(.google.iam.v1.TestIamPermissionsReque" + + "st\032).google.iam.v1.TestIamPermissionsRes" + + "ponse\"N\202\323\344\223\002H\"C/v2/{resource=projects/*/" + + "locations/*/services/*}:testIamPermissio" + + "ns:\001*\032F\312A\022run.googleapis.com\322A.https://w" + + "ww.googleapis.com/auth/cloud-platformBT\n" + + "\027com.google.cloud.run.v2B\014ServiceProtoP\001" + + "Z)cloud.google.com/go/run/apiv2/runpb;ru" + + "npbb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -286,6 +287,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "LatestCreatedRevision", "TrafficStatuses", "Uri", + "CustomAudiences", "SatisfiesPzs", "Reconciling", "Etag", diff --git a/java-run/proto-google-cloud-run-v2/src/main/proto/google/cloud/run/v2/service.proto b/java-run/proto-google-cloud-run-v2/src/main/proto/google/cloud/run/v2/service.proto index 3fee68d2bb71..8ce51cb2bebd 100644 --- a/java-run/proto-google-cloud-run-v2/src/main/proto/google/cloud/run/v2/service.proto +++ b/java-run/proto-google-cloud-run-v2/src/main/proto/google/cloud/run/v2/service.proto @@ -430,6 +430,13 @@ message Service { // Output only. The main URI in which this Service is serving traffic. string uri = 36 [(google.api.field_behavior) = OUTPUT_ONLY]; + // One or more custom audiences that you want this service to support. Specify + // each custom audience as the full URL in a string. The custom audiences are + // encoded in the token and used to authenticate requests. For more + // information, see + // https://cloud.google.com/run/docs/configuring/custom-audiences. + repeated string custom_audiences = 37; + // Output only. Reserved for future use. bool satisfies_pzs = 38 [(google.api.field_behavior) = OUTPUT_ONLY];