diff --git a/google-cloud-build/src/test/java/com/google/cloud/devtools/cloudbuild/v1/CloudBuildClientTest.java b/google-cloud-build/src/test/java/com/google/cloud/devtools/cloudbuild/v1/CloudBuildClientTest.java index 2353fc5e..0c6789ba 100644 --- a/google-cloud-build/src/test/java/com/google/cloud/devtools/cloudbuild/v1/CloudBuildClientTest.java +++ b/google-cloud-build/src/test/java/com/google/cloud/devtools/cloudbuild/v1/CloudBuildClientTest.java @@ -51,6 +51,7 @@ import com.google.cloudbuild.v1.ListBuildsResponse; import com.google.cloudbuild.v1.ListWorkerPoolsRequest; import com.google.cloudbuild.v1.ListWorkerPoolsResponse; +import com.google.cloudbuild.v1.PubsubConfig; import com.google.cloudbuild.v1.ReceiveTriggerWebhookRequest; import com.google.cloudbuild.v1.ReceiveTriggerWebhookResponse; import com.google.cloudbuild.v1.RepoSource; @@ -461,11 +462,13 @@ public void createBuildTriggerTest() throws Exception { .addAllTags(new ArrayList()) .setTriggerTemplate(RepoSource.newBuilder().build()) .setGithub(GitHubEventsConfig.newBuilder().build()) + .setPubsubConfig(PubsubConfig.newBuilder().build()) .setCreateTime(Timestamp.newBuilder().build()) .setDisabled(true) .putAllSubstitutions(new HashMap()) .addAllIgnoredFiles(new ArrayList()) .addAllIncludedFiles(new ArrayList()) + .setFilter("filter-1274492040") .build(); mockCloudBuild.addResponse(expectedResponse); @@ -512,11 +515,13 @@ public void getBuildTriggerTest() throws Exception { .addAllTags(new ArrayList()) .setTriggerTemplate(RepoSource.newBuilder().build()) .setGithub(GitHubEventsConfig.newBuilder().build()) + .setPubsubConfig(PubsubConfig.newBuilder().build()) .setCreateTime(Timestamp.newBuilder().build()) .setDisabled(true) .putAllSubstitutions(new HashMap()) .addAllIgnoredFiles(new ArrayList()) .addAllIncludedFiles(new ArrayList()) + .setFilter("filter-1274492040") .build(); mockCloudBuild.addResponse(expectedResponse); @@ -644,11 +649,13 @@ public void updateBuildTriggerTest() throws Exception { .addAllTags(new ArrayList()) .setTriggerTemplate(RepoSource.newBuilder().build()) .setGithub(GitHubEventsConfig.newBuilder().build()) + .setPubsubConfig(PubsubConfig.newBuilder().build()) .setCreateTime(Timestamp.newBuilder().build()) .setDisabled(true) .putAllSubstitutions(new HashMap()) .addAllIgnoredFiles(new ArrayList()) .addAllIncludedFiles(new ArrayList()) + .setFilter("filter-1274492040") .build(); mockCloudBuild.addResponse(expectedResponse); diff --git a/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildTrigger.java b/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildTrigger.java index ff581721..779f6e19 100644 --- a/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildTrigger.java +++ b/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildTrigger.java @@ -45,6 +45,7 @@ private BuildTrigger() { tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; ignoredFiles_ = com.google.protobuf.LazyStringArrayList.EMPTY; includedFiles_ = com.google.protobuf.LazyStringArrayList.EMPTY; + filter_ = ""; } @java.lang.Override @@ -219,6 +220,29 @@ private BuildTrigger( name_ = s; break; } + case 234: + { + com.google.cloudbuild.v1.PubsubConfig.Builder subBuilder = null; + if (pubsubConfig_ != null) { + subBuilder = pubsubConfig_.toBuilder(); + } + pubsubConfig_ = + input.readMessage( + com.google.cloudbuild.v1.PubsubConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(pubsubConfig_); + pubsubConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 242: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -650,6 +674,63 @@ public com.google.cloudbuild.v1.GitHubEventsConfigOrBuilder getGithubOrBuilder() return getGithub(); } + public static final int PUBSUB_CONFIG_FIELD_NUMBER = 29; + private com.google.cloudbuild.v1.PubsubConfig pubsubConfig_; + /** + * + * + *
+   * Optional. PubsubConfig describes the configuration of a trigger that
+   * creates a build whenever a Pub/Sub message is published.
+   * 
+ * + * + * .google.devtools.cloudbuild.v1.PubsubConfig pubsub_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the pubsubConfig field is set. + */ + @java.lang.Override + public boolean hasPubsubConfig() { + return pubsubConfig_ != null; + } + /** + * + * + *
+   * Optional. PubsubConfig describes the configuration of a trigger that
+   * creates a build whenever a Pub/Sub message is published.
+   * 
+ * + * + * .google.devtools.cloudbuild.v1.PubsubConfig pubsub_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The pubsubConfig. + */ + @java.lang.Override + public com.google.cloudbuild.v1.PubsubConfig getPubsubConfig() { + return pubsubConfig_ == null + ? com.google.cloudbuild.v1.PubsubConfig.getDefaultInstance() + : pubsubConfig_; + } + /** + * + * + *
+   * Optional. PubsubConfig describes the configuration of a trigger that
+   * creates a build whenever a Pub/Sub message is published.
+   * 
+ * + * + * .google.devtools.cloudbuild.v1.PubsubConfig pubsub_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloudbuild.v1.PubsubConfigOrBuilder getPubsubConfigOrBuilder() { + return getPubsubConfig(); + } + public static final int BUILD_FIELD_NUMBER = 4; /** * @@ -1116,6 +1197,55 @@ public com.google.protobuf.ByteString getIncludedFilesBytes(int index) { return includedFiles_.getByteString(index); } + public static final int FILTER_FIELD_NUMBER = 30; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Optional. A Common Expression Language string.
+   * 
+ * + * string filter = 30 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A Common Expression Language string.
+   * 
+ * + * string filter = 30 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -1168,6 +1298,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 21, name_); } + if (pubsubConfig_ != null) { + output.writeMessage(29, getPubsubConfig()); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 30, filter_); + } unknownFields.writeTo(output); } @@ -1240,6 +1376,12 @@ public int getSerializedSize() { if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(21, name_); } + if (pubsubConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(29, getPubsubConfig()); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(30, filter_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -1267,6 +1409,10 @@ public boolean equals(final java.lang.Object obj) { if (hasGithub()) { if (!getGithub().equals(other.getGithub())) return false; } + if (hasPubsubConfig() != other.hasPubsubConfig()) return false; + if (hasPubsubConfig()) { + if (!getPubsubConfig().equals(other.getPubsubConfig())) return false; + } if (hasCreateTime() != other.hasCreateTime()) return false; if (hasCreateTime()) { if (!getCreateTime().equals(other.getCreateTime())) return false; @@ -1275,6 +1421,7 @@ public boolean equals(final java.lang.Object obj) { if (!internalGetSubstitutions().equals(other.internalGetSubstitutions())) return false; if (!getIgnoredFilesList().equals(other.getIgnoredFilesList())) return false; if (!getIncludedFilesList().equals(other.getIncludedFilesList())) return false; + if (!getFilter().equals(other.getFilter())) return false; if (!getBuildTemplateCase().equals(other.getBuildTemplateCase())) return false; switch (buildTemplateCase_) { case 4: @@ -1315,6 +1462,10 @@ public int hashCode() { hash = (37 * hash) + GITHUB_FIELD_NUMBER; hash = (53 * hash) + getGithub().hashCode(); } + if (hasPubsubConfig()) { + hash = (37 * hash) + PUBSUB_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getPubsubConfig().hashCode(); + } if (hasCreateTime()) { hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; hash = (53 * hash) + getCreateTime().hashCode(); @@ -1333,6 +1484,8 @@ public int hashCode() { hash = (37 * hash) + INCLUDED_FILES_FIELD_NUMBER; hash = (53 * hash) + getIncludedFilesList().hashCode(); } + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); switch (buildTemplateCase_) { case 4: hash = (37 * hash) + BUILD_FIELD_NUMBER; @@ -1530,6 +1683,12 @@ public Builder clear() { github_ = null; githubBuilder_ = null; } + if (pubsubConfigBuilder_ == null) { + pubsubConfig_ = null; + } else { + pubsubConfig_ = null; + pubsubConfigBuilder_ = null; + } if (createTimeBuilder_ == null) { createTime_ = null; } else { @@ -1543,6 +1702,8 @@ public Builder clear() { bitField0_ = (bitField0_ & ~0x00000004); includedFiles_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000008); + filter_ = ""; + buildTemplateCase_ = 0; buildTemplate_ = null; return this; @@ -1591,6 +1752,11 @@ public com.google.cloudbuild.v1.BuildTrigger buildPartial() { } else { result.github_ = githubBuilder_.build(); } + if (pubsubConfigBuilder_ == null) { + result.pubsubConfig_ = pubsubConfig_; + } else { + result.pubsubConfig_ = pubsubConfigBuilder_.build(); + } if (buildTemplateCase_ == 4) { if (buildBuilder_ == null) { result.buildTemplate_ = buildTemplate_; @@ -1619,6 +1785,7 @@ public com.google.cloudbuild.v1.BuildTrigger buildPartial() { bitField0_ = (bitField0_ & ~0x00000008); } result.includedFiles_ = includedFiles_; + result.filter_ = filter_; result.buildTemplateCase_ = buildTemplateCase_; onBuilt(); return result; @@ -1697,6 +1864,9 @@ public Builder mergeFrom(com.google.cloudbuild.v1.BuildTrigger other) { if (other.hasGithub()) { mergeGithub(other.getGithub()); } + if (other.hasPubsubConfig()) { + mergePubsubConfig(other.getPubsubConfig()); + } if (other.hasCreateTime()) { mergeCreateTime(other.getCreateTime()); } @@ -1724,6 +1894,10 @@ public Builder mergeFrom(com.google.cloudbuild.v1.BuildTrigger other) { } onChanged(); } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } switch (other.getBuildTemplateCase()) { case BUILD: { @@ -2717,6 +2891,218 @@ public com.google.cloudbuild.v1.GitHubEventsConfigOrBuilder getGithubOrBuilder() return githubBuilder_; } + private com.google.cloudbuild.v1.PubsubConfig pubsubConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloudbuild.v1.PubsubConfig, + com.google.cloudbuild.v1.PubsubConfig.Builder, + com.google.cloudbuild.v1.PubsubConfigOrBuilder> + pubsubConfigBuilder_; + /** + * + * + *
+     * Optional. PubsubConfig describes the configuration of a trigger that
+     * creates a build whenever a Pub/Sub message is published.
+     * 
+ * + * + * .google.devtools.cloudbuild.v1.PubsubConfig pubsub_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the pubsubConfig field is set. + */ + public boolean hasPubsubConfig() { + return pubsubConfigBuilder_ != null || pubsubConfig_ != null; + } + /** + * + * + *
+     * Optional. PubsubConfig describes the configuration of a trigger that
+     * creates a build whenever a Pub/Sub message is published.
+     * 
+ * + * + * .google.devtools.cloudbuild.v1.PubsubConfig pubsub_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The pubsubConfig. + */ + public com.google.cloudbuild.v1.PubsubConfig getPubsubConfig() { + if (pubsubConfigBuilder_ == null) { + return pubsubConfig_ == null + ? com.google.cloudbuild.v1.PubsubConfig.getDefaultInstance() + : pubsubConfig_; + } else { + return pubsubConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. PubsubConfig describes the configuration of a trigger that
+     * creates a build whenever a Pub/Sub message is published.
+     * 
+ * + * + * .google.devtools.cloudbuild.v1.PubsubConfig pubsub_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPubsubConfig(com.google.cloudbuild.v1.PubsubConfig value) { + if (pubsubConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pubsubConfig_ = value; + onChanged(); + } else { + pubsubConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. PubsubConfig describes the configuration of a trigger that
+     * creates a build whenever a Pub/Sub message is published.
+     * 
+ * + * + * .google.devtools.cloudbuild.v1.PubsubConfig pubsub_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPubsubConfig(com.google.cloudbuild.v1.PubsubConfig.Builder builderForValue) { + if (pubsubConfigBuilder_ == null) { + pubsubConfig_ = builderForValue.build(); + onChanged(); + } else { + pubsubConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. PubsubConfig describes the configuration of a trigger that
+     * creates a build whenever a Pub/Sub message is published.
+     * 
+ * + * + * .google.devtools.cloudbuild.v1.PubsubConfig pubsub_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergePubsubConfig(com.google.cloudbuild.v1.PubsubConfig value) { + if (pubsubConfigBuilder_ == null) { + if (pubsubConfig_ != null) { + pubsubConfig_ = + com.google.cloudbuild.v1.PubsubConfig.newBuilder(pubsubConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + pubsubConfig_ = value; + } + onChanged(); + } else { + pubsubConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. PubsubConfig describes the configuration of a trigger that
+     * creates a build whenever a Pub/Sub message is published.
+     * 
+ * + * + * .google.devtools.cloudbuild.v1.PubsubConfig pubsub_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearPubsubConfig() { + if (pubsubConfigBuilder_ == null) { + pubsubConfig_ = null; + onChanged(); + } else { + pubsubConfig_ = null; + pubsubConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. PubsubConfig describes the configuration of a trigger that
+     * creates a build whenever a Pub/Sub message is published.
+     * 
+ * + * + * .google.devtools.cloudbuild.v1.PubsubConfig pubsub_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloudbuild.v1.PubsubConfig.Builder getPubsubConfigBuilder() { + + onChanged(); + return getPubsubConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. PubsubConfig describes the configuration of a trigger that
+     * creates a build whenever a Pub/Sub message is published.
+     * 
+ * + * + * .google.devtools.cloudbuild.v1.PubsubConfig pubsub_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloudbuild.v1.PubsubConfigOrBuilder getPubsubConfigOrBuilder() { + if (pubsubConfigBuilder_ != null) { + return pubsubConfigBuilder_.getMessageOrBuilder(); + } else { + return pubsubConfig_ == null + ? com.google.cloudbuild.v1.PubsubConfig.getDefaultInstance() + : pubsubConfig_; + } + } + /** + * + * + *
+     * Optional. PubsubConfig describes the configuration of a trigger that
+     * creates a build whenever a Pub/Sub message is published.
+     * 
+ * + * + * .google.devtools.cloudbuild.v1.PubsubConfig pubsub_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloudbuild.v1.PubsubConfig, + com.google.cloudbuild.v1.PubsubConfig.Builder, + com.google.cloudbuild.v1.PubsubConfigOrBuilder> + getPubsubConfigFieldBuilder() { + if (pubsubConfigBuilder_ == null) { + pubsubConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloudbuild.v1.PubsubConfig, + com.google.cloudbuild.v1.PubsubConfig.Builder, + com.google.cloudbuild.v1.PubsubConfigOrBuilder>( + getPubsubConfig(), getParentForChildren(), isClean()); + pubsubConfig_ = null; + } + return pubsubConfigBuilder_; + } + private com.google.protobuf.SingleFieldBuilderV3< com.google.cloudbuild.v1.Build, com.google.cloudbuild.v1.Build.Builder, @@ -3927,6 +4313,112 @@ public Builder addIncludedFilesBytes(com.google.protobuf.ByteString value) { return this; } + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. A Common Expression Language string.
+     * 
+ * + * string filter = 30 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A Common Expression Language string.
+     * 
+ * + * string filter = 30 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A Common Expression Language string.
+     * 
+ * + * string filter = 30 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A Common Expression Language string.
+     * 
+ * + * string filter = 30 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A Common Expression Language string.
+     * 
+ * + * string filter = 30 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildTriggerOrBuilder.java b/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildTriggerOrBuilder.java index b03fa82c..2ce1e156 100644 --- a/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildTriggerOrBuilder.java +++ b/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildTriggerOrBuilder.java @@ -245,6 +245,50 @@ public interface BuildTriggerOrBuilder */ com.google.cloudbuild.v1.GitHubEventsConfigOrBuilder getGithubOrBuilder(); + /** + * + * + *
+   * Optional. PubsubConfig describes the configuration of a trigger that
+   * creates a build whenever a Pub/Sub message is published.
+   * 
+ * + * + * .google.devtools.cloudbuild.v1.PubsubConfig pubsub_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the pubsubConfig field is set. + */ + boolean hasPubsubConfig(); + /** + * + * + *
+   * Optional. PubsubConfig describes the configuration of a trigger that
+   * creates a build whenever a Pub/Sub message is published.
+   * 
+ * + * + * .google.devtools.cloudbuild.v1.PubsubConfig pubsub_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The pubsubConfig. + */ + com.google.cloudbuild.v1.PubsubConfig getPubsubConfig(); + /** + * + * + *
+   * Optional. PubsubConfig describes the configuration of a trigger that
+   * creates a build whenever a Pub/Sub message is published.
+   * 
+ * + * + * .google.devtools.cloudbuild.v1.PubsubConfig pubsub_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloudbuild.v1.PubsubConfigOrBuilder getPubsubConfigOrBuilder(); + /** * * @@ -580,5 +624,30 @@ public interface BuildTriggerOrBuilder */ com.google.protobuf.ByteString getIncludedFilesBytes(int index); + /** + * + * + *
+   * Optional. A Common Expression Language string.
+   * 
+ * + * string filter = 30 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. A Common Expression Language string.
+   * 
+ * + * string filter = 30 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + public com.google.cloudbuild.v1.BuildTrigger.BuildTemplateCase getBuildTemplateCase(); } diff --git a/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/Cloudbuild.java b/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/Cloudbuild.java index 156cefe9..fd1b2a7c 100644 --- a/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/Cloudbuild.java +++ b/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/Cloudbuild.java @@ -171,6 +171,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_devtools_cloudbuild_v1_GitHubEventsConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_devtools_cloudbuild_v1_GitHubEventsConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v1_PubsubConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v1_PubsubConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_devtools_cloudbuild_v1_PullRequestFilter_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -409,28 +413,40 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + " \001(\t\"r\n\022CancelBuildRequest\0222\n\004name\030\004 \001(\t" + "B$\372A!\n\037cloudbuild.googleapis.com/Build\022\027" + "\n\nproject_id\030\001 \001(\tB\003\340A\002\022\017\n\002id\030\002 \001(\tB\003\340A\002" - + "\"\215\005\n\014BuildTrigger\022\017\n\002id\030\001 \001(\tB\003\340A\003\022\023\n\013de" + + "\"\353\005\n\014BuildTrigger\022\017\n\002id\030\001 \001(\tB\003\340A\003\022\023\n\013de" + "scription\030\n \001(\t\022\014\n\004name\030\025 \001(\t\022\014\n\004tags\030\023 " + "\003(\t\022C\n\020trigger_template\030\007 \001(\0132).google.d" + "evtools.cloudbuild.v1.RepoSource\022A\n\006gith" + "ub\030\r \001(\01321.google.devtools.cloudbuild.v1" - + ".GitHubEventsConfig\0225\n\005build\030\004 \001(\0132$.goo" - + "gle.devtools.cloudbuild.v1.BuildH\000\022\022\n\010fi" - + "lename\030\010 \001(\tH\000\0224\n\013create_time\030\005 \001(\0132\032.go" - + "ogle.protobuf.TimestampB\003\340A\003\022\020\n\010disabled" - + "\030\t \001(\010\022U\n\rsubstitutions\030\013 \003(\0132>.google.d" - + "evtools.cloudbuild.v1.BuildTrigger.Subst" - + "itutionsEntry\022\025\n\rignored_files\030\017 \003(\t\022\026\n\016" - + "included_files\030\020 \003(\t\0324\n\022SubstitutionsEnt" - + "ry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:R\352AO\n" - + "&cloudbuild.googleapis.com/BuildTrigger\022" - + "%projects/{project}/triggers/{trigger}B\020" - + "\n\016build_template\"\334\001\n\022GitHubEventsConfig\022" - + "\033\n\017installation_id\030\001 \001(\003B\002\030\001\022\r\n\005owner\030\006 " - + "\001(\t\022\014\n\004name\030\007 \001(\t\022H\n\014pull_request\030\004 \001(\0132" - + "0.google.devtools.cloudbuild.v1.PullRequ" - + "estFilterH\000\0229\n\004push\030\005 \001(\0132).google.devto" - + "ols.cloudbuild.v1.PushFilterH\000B\007\n\005event\"" + + ".GitHubEventsConfig\022G\n\rpubsub_config\030\035 \001" + + "(\0132+.google.devtools.cloudbuild.v1.Pubsu" + + "bConfigB\003\340A\001\0225\n\005build\030\004 \001(\0132$.google.dev" + + "tools.cloudbuild.v1.BuildH\000\022\022\n\010filename\030" + + "\010 \001(\tH\000\0224\n\013create_time\030\005 \001(\0132\032.google.pr" + + "otobuf.TimestampB\003\340A\003\022\020\n\010disabled\030\t \001(\010\022" + + "U\n\rsubstitutions\030\013 \003(\0132>.google.devtools" + + ".cloudbuild.v1.BuildTrigger.Substitution" + + "sEntry\022\025\n\rignored_files\030\017 \003(\t\022\026\n\016include" + + "d_files\030\020 \003(\t\022\023\n\006filter\030\036 \001(\tB\003\340A\001\0324\n\022Su" + + "bstitutionsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002" + + " \001(\t:\0028\001:R\352AO\n&cloudbuild.googleapis.com" + + "/BuildTrigger\022%projects/{project}/trigge" + + "rs/{trigger}B\020\n\016build_template\"\334\001\n\022GitHu" + + "bEventsConfig\022\033\n\017installation_id\030\001 \001(\003B\002" + + "\030\001\022\r\n\005owner\030\006 \001(\t\022\014\n\004name\030\007 \001(\t\022H\n\014pull_" + + "request\030\004 \001(\01320.google.devtools.cloudbui" + + "ld.v1.PullRequestFilterH\000\0229\n\004push\030\005 \001(\0132" + + ").google.devtools.cloudbuild.v1.PushFilt" + + "erH\000B\007\n\005event\"\377\002\n\014PubsubConfig\022@\n\014subscr" + + "iption\030\001 \001(\tB*\340A\003\372A$\n\"pubsub.googleapis." + + "com/Subscription\022/\n\005topic\030\002 \001(\tB \372A\035\n\033pu" + + "bsub.googleapis.com/Topic\022E\n\025service_acc" + + "ount_email\030\003 \001(\tB&\372A#\n!iam.googleapis.co" + + "m/ServiceAccount\022@\n\005state\030\004 \001(\01621.google" + + ".devtools.cloudbuild.v1.PubsubConfig.Sta" + + "te\"s\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\006\n\002OK" + + "\020\001\022\030\n\024SUBSCRIPTION_DELETED\020\002\022\021\n\rTOPIC_DE" + + "LETED\020\003\022\036\n\032SUBSCRIPTION_MISCONFIGURED\020\004\"" + "\224\002\n\021PullRequestFilter\022\020\n\006branch\030\002 \001(\tH\000\022" + "X\n\017comment_control\030\005 \001(\0162?.google.devtoo" + "ls.cloudbuild.v1.PullRequestFilter.Comme" @@ -601,7 +617,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "equest\0326.google.devtools.cloudbuild.v1.L" + "istWorkerPoolsResponse\"\000\032M\312A\031cloudbuild." + "googleapis.com\322A.https://www.googleapis." - + "com/auth/cloud-platformB\367\004\n\030com.google.c" + + "com/auth/cloud-platformB\222\006\n\030com.google.c" + "loudbuild.v1P\001ZGgoogle.golang.org/genpro" + "to/googleapis/devtools/cloudbuild/v1;clo" + "udbuild\242\002\003GCB\252\002\032Google.Cloud.CloudBuild." @@ -617,7 +633,11 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "et}/versions/{version}\352Ap\n!cloudkms.goog" + "leapis.com/CryptoKey\022Kprojects/{project}" + "/locations/{location}/keyRings/{keyring}" - + "/cryptoKeys/{key}b\006proto3" + + "/cryptoKeys/{key}\352AU\n\"pubsub.googleapis." + + "com/Subscription\022/projects/{project}/sub" + + "scriptions/{subscription}\352A@\n\033pubsub.goo" + + "gleapis.com/Topic\022!projects/{project}/to" + + "pics/{topic}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -964,6 +984,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Tags", "TriggerTemplate", "Github", + "PubsubConfig", "Build", "Filename", "CreateTime", @@ -971,6 +992,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Substitutions", "IgnoredFiles", "IncludedFiles", + "Filter", "BuildTemplate", }); internal_static_google_devtools_cloudbuild_v1_BuildTrigger_SubstitutionsEntry_descriptor = @@ -991,8 +1013,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "InstallationId", "Owner", "Name", "PullRequest", "Push", "Event", }); - internal_static_google_devtools_cloudbuild_v1_PullRequestFilter_descriptor = + internal_static_google_devtools_cloudbuild_v1_PubsubConfig_descriptor = getDescriptor().getMessageTypes().get(28); + internal_static_google_devtools_cloudbuild_v1_PubsubConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v1_PubsubConfig_descriptor, + new java.lang.String[] { + "Subscription", "Topic", "ServiceAccountEmail", "State", + }); + internal_static_google_devtools_cloudbuild_v1_PullRequestFilter_descriptor = + getDescriptor().getMessageTypes().get(29); internal_static_google_devtools_cloudbuild_v1_PullRequestFilter_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_devtools_cloudbuild_v1_PullRequestFilter_descriptor, @@ -1000,7 +1030,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Branch", "CommentControl", "InvertRegex", "GitRef", }); internal_static_google_devtools_cloudbuild_v1_PushFilter_descriptor = - getDescriptor().getMessageTypes().get(29); + getDescriptor().getMessageTypes().get(30); internal_static_google_devtools_cloudbuild_v1_PushFilter_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_devtools_cloudbuild_v1_PushFilter_descriptor, @@ -1008,7 +1038,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Branch", "Tag", "InvertRegex", "GitRef", }); internal_static_google_devtools_cloudbuild_v1_CreateBuildTriggerRequest_descriptor = - getDescriptor().getMessageTypes().get(30); + getDescriptor().getMessageTypes().get(31); internal_static_google_devtools_cloudbuild_v1_CreateBuildTriggerRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_devtools_cloudbuild_v1_CreateBuildTriggerRequest_descriptor, @@ -1016,7 +1046,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ProjectId", "Trigger", }); internal_static_google_devtools_cloudbuild_v1_GetBuildTriggerRequest_descriptor = - getDescriptor().getMessageTypes().get(31); + getDescriptor().getMessageTypes().get(32); internal_static_google_devtools_cloudbuild_v1_GetBuildTriggerRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_devtools_cloudbuild_v1_GetBuildTriggerRequest_descriptor, @@ -1024,7 +1054,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ProjectId", "TriggerId", }); internal_static_google_devtools_cloudbuild_v1_ListBuildTriggersRequest_descriptor = - getDescriptor().getMessageTypes().get(32); + getDescriptor().getMessageTypes().get(33); internal_static_google_devtools_cloudbuild_v1_ListBuildTriggersRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_devtools_cloudbuild_v1_ListBuildTriggersRequest_descriptor, @@ -1032,7 +1062,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ProjectId", "PageSize", "PageToken", }); internal_static_google_devtools_cloudbuild_v1_ListBuildTriggersResponse_descriptor = - getDescriptor().getMessageTypes().get(33); + getDescriptor().getMessageTypes().get(34); internal_static_google_devtools_cloudbuild_v1_ListBuildTriggersResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_devtools_cloudbuild_v1_ListBuildTriggersResponse_descriptor, @@ -1040,7 +1070,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Triggers", "NextPageToken", }); internal_static_google_devtools_cloudbuild_v1_DeleteBuildTriggerRequest_descriptor = - getDescriptor().getMessageTypes().get(34); + getDescriptor().getMessageTypes().get(35); internal_static_google_devtools_cloudbuild_v1_DeleteBuildTriggerRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_devtools_cloudbuild_v1_DeleteBuildTriggerRequest_descriptor, @@ -1048,7 +1078,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ProjectId", "TriggerId", }); internal_static_google_devtools_cloudbuild_v1_UpdateBuildTriggerRequest_descriptor = - getDescriptor().getMessageTypes().get(35); + getDescriptor().getMessageTypes().get(36); internal_static_google_devtools_cloudbuild_v1_UpdateBuildTriggerRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_devtools_cloudbuild_v1_UpdateBuildTriggerRequest_descriptor, @@ -1056,7 +1086,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ProjectId", "TriggerId", "Trigger", }); internal_static_google_devtools_cloudbuild_v1_BuildOptions_descriptor = - getDescriptor().getMessageTypes().get(36); + getDescriptor().getMessageTypes().get(37); internal_static_google_devtools_cloudbuild_v1_BuildOptions_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_devtools_cloudbuild_v1_BuildOptions_descriptor, @@ -1075,7 +1105,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Volumes", }); internal_static_google_devtools_cloudbuild_v1_ReceiveTriggerWebhookRequest_descriptor = - getDescriptor().getMessageTypes().get(37); + getDescriptor().getMessageTypes().get(38); internal_static_google_devtools_cloudbuild_v1_ReceiveTriggerWebhookRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_devtools_cloudbuild_v1_ReceiveTriggerWebhookRequest_descriptor, @@ -1083,13 +1113,13 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Body", "ProjectId", "Trigger", "Secret", }); internal_static_google_devtools_cloudbuild_v1_ReceiveTriggerWebhookResponse_descriptor = - getDescriptor().getMessageTypes().get(38); + getDescriptor().getMessageTypes().get(39); internal_static_google_devtools_cloudbuild_v1_ReceiveTriggerWebhookResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_devtools_cloudbuild_v1_ReceiveTriggerWebhookResponse_descriptor, new java.lang.String[] {}); internal_static_google_devtools_cloudbuild_v1_WorkerPool_descriptor = - getDescriptor().getMessageTypes().get(39); + getDescriptor().getMessageTypes().get(40); internal_static_google_devtools_cloudbuild_v1_WorkerPool_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_devtools_cloudbuild_v1_WorkerPool_descriptor, @@ -1106,7 +1136,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Status", }); internal_static_google_devtools_cloudbuild_v1_WorkerConfig_descriptor = - getDescriptor().getMessageTypes().get(40); + getDescriptor().getMessageTypes().get(41); internal_static_google_devtools_cloudbuild_v1_WorkerConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_devtools_cloudbuild_v1_WorkerConfig_descriptor, @@ -1114,7 +1144,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "MachineType", "DiskSizeGb", "Network", "Tag", }); internal_static_google_devtools_cloudbuild_v1_Network_descriptor = - getDescriptor().getMessageTypes().get(41); + getDescriptor().getMessageTypes().get(42); internal_static_google_devtools_cloudbuild_v1_Network_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_devtools_cloudbuild_v1_Network_descriptor, @@ -1122,7 +1152,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ProjectId", "Network", "Subnetwork", }); internal_static_google_devtools_cloudbuild_v1_CreateWorkerPoolRequest_descriptor = - getDescriptor().getMessageTypes().get(42); + getDescriptor().getMessageTypes().get(43); internal_static_google_devtools_cloudbuild_v1_CreateWorkerPoolRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_devtools_cloudbuild_v1_CreateWorkerPoolRequest_descriptor, @@ -1130,7 +1160,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "WorkerPool", }); internal_static_google_devtools_cloudbuild_v1_GetWorkerPoolRequest_descriptor = - getDescriptor().getMessageTypes().get(43); + getDescriptor().getMessageTypes().get(44); internal_static_google_devtools_cloudbuild_v1_GetWorkerPoolRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_devtools_cloudbuild_v1_GetWorkerPoolRequest_descriptor, @@ -1138,7 +1168,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_devtools_cloudbuild_v1_DeleteWorkerPoolRequest_descriptor = - getDescriptor().getMessageTypes().get(44); + getDescriptor().getMessageTypes().get(45); internal_static_google_devtools_cloudbuild_v1_DeleteWorkerPoolRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_devtools_cloudbuild_v1_DeleteWorkerPoolRequest_descriptor, @@ -1146,7 +1176,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_devtools_cloudbuild_v1_UpdateWorkerPoolRequest_descriptor = - getDescriptor().getMessageTypes().get(45); + getDescriptor().getMessageTypes().get(46); internal_static_google_devtools_cloudbuild_v1_UpdateWorkerPoolRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_devtools_cloudbuild_v1_UpdateWorkerPoolRequest_descriptor, @@ -1154,7 +1184,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "WorkerPool", }); internal_static_google_devtools_cloudbuild_v1_ListWorkerPoolsRequest_descriptor = - getDescriptor().getMessageTypes().get(46); + getDescriptor().getMessageTypes().get(47); internal_static_google_devtools_cloudbuild_v1_ListWorkerPoolsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_devtools_cloudbuild_v1_ListWorkerPoolsRequest_descriptor, @@ -1162,7 +1192,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", }); internal_static_google_devtools_cloudbuild_v1_ListWorkerPoolsResponse_descriptor = - getDescriptor().getMessageTypes().get(47); + getDescriptor().getMessageTypes().get(48); internal_static_google_devtools_cloudbuild_v1_ListWorkerPoolsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_devtools_cloudbuild_v1_ListWorkerPoolsResponse_descriptor, diff --git a/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/PubsubConfig.java b/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/PubsubConfig.java new file mode 100644 index 00000000..e849231f --- /dev/null +++ b/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/PubsubConfig.java @@ -0,0 +1,1379 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/cloudbuild/v1/cloudbuild.proto + +package com.google.cloudbuild.v1; + +/** + * + * + *
+ * PubsubConfig describes the configuration of a trigger that
+ * creates a build whenever a Pub/Sub message is published.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v1.PubsubConfig} + */ +public final class PubsubConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v1.PubsubConfig) + PubsubConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use PubsubConfig.newBuilder() to construct. + private PubsubConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PubsubConfig() { + subscription_ = ""; + topic_ = ""; + serviceAccountEmail_ = ""; + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PubsubConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PubsubConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + subscription_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + topic_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceAccountEmail_ = s; + break; + } + case 32: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloudbuild.v1.Cloudbuild + .internal_static_google_devtools_cloudbuild_v1_PubsubConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloudbuild.v1.Cloudbuild + .internal_static_google_devtools_cloudbuild_v1_PubsubConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloudbuild.v1.PubsubConfig.class, + com.google.cloudbuild.v1.PubsubConfig.Builder.class); + } + + /** + * + * + *
+   * Enumerates potential issues with the underlying Pub/Sub subscription
+   * configuration.
+   * 
+ * + * Protobuf enum {@code google.devtools.cloudbuild.v1.PubsubConfig.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The subscription configuration has not been checked.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The Pub/Sub subscription is properly configured.
+     * 
+ * + * OK = 1; + */ + OK(1), + /** + * + * + *
+     * The subscription has been deleted.
+     * 
+ * + * SUBSCRIPTION_DELETED = 2; + */ + SUBSCRIPTION_DELETED(2), + /** + * + * + *
+     * The topic has been deleted.
+     * 
+ * + * TOPIC_DELETED = 3; + */ + TOPIC_DELETED(3), + /** + * + * + *
+     * Some of the subscription's field are misconfigured.
+     * 
+ * + * SUBSCRIPTION_MISCONFIGURED = 4; + */ + SUBSCRIPTION_MISCONFIGURED(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The subscription configuration has not been checked.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The Pub/Sub subscription is properly configured.
+     * 
+ * + * OK = 1; + */ + public static final int OK_VALUE = 1; + /** + * + * + *
+     * The subscription has been deleted.
+     * 
+ * + * SUBSCRIPTION_DELETED = 2; + */ + public static final int SUBSCRIPTION_DELETED_VALUE = 2; + /** + * + * + *
+     * The topic has been deleted.
+     * 
+ * + * TOPIC_DELETED = 3; + */ + public static final int TOPIC_DELETED_VALUE = 3; + /** + * + * + *
+     * Some of the subscription's field are misconfigured.
+     * 
+ * + * SUBSCRIPTION_MISCONFIGURED = 4; + */ + public static final int SUBSCRIPTION_MISCONFIGURED_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return OK; + case 2: + return SUBSCRIPTION_DELETED; + case 3: + return TOPIC_DELETED; + case 4: + return SUBSCRIPTION_MISCONFIGURED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloudbuild.v1.PubsubConfig.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.devtools.cloudbuild.v1.PubsubConfig.State) + } + + public static final int SUBSCRIPTION_FIELD_NUMBER = 1; + private volatile java.lang.Object subscription_; + /** + * + * + *
+   * Output only. Name of the subscription. Format is
+   * `projects/{project}/subscriptions/{subscription}`.
+   * 
+ * + * + * string subscription = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The subscription. + */ + @java.lang.Override + public java.lang.String getSubscription() { + java.lang.Object ref = subscription_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subscription_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the subscription. Format is
+   * `projects/{project}/subscriptions/{subscription}`.
+   * 
+ * + * + * string subscription = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for subscription. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSubscriptionBytes() { + java.lang.Object ref = subscription_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + subscription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TOPIC_FIELD_NUMBER = 2; + private volatile java.lang.Object topic_; + /** + * + * + *
+   * The name of the topic from which this subscription is receiving messages.
+   * Format is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string topic = 2 [(.google.api.resource_reference) = { ... } + * + * @return The topic. + */ + @java.lang.Override + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topic_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the topic from which this subscription is receiving messages.
+   * Format is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string topic = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for topic. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTopicBytes() { + java.lang.Object ref = topic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + topic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER = 3; + private volatile java.lang.Object serviceAccountEmail_; + /** + * + * + *
+   * Service account that will make the push request.
+   * 
+ * + * string service_account_email = 3 [(.google.api.resource_reference) = { ... } + * + * @return The serviceAccountEmail. + */ + @java.lang.Override + public java.lang.String getServiceAccountEmail() { + java.lang.Object ref = serviceAccountEmail_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccountEmail_ = s; + return s; + } + } + /** + * + * + *
+   * Service account that will make the push request.
+   * 
+ * + * string service_account_email = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for serviceAccountEmail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceAccountEmailBytes() { + java.lang.Object ref = serviceAccountEmail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccountEmail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 4; + private int state_; + /** + * + * + *
+   * Potential issues with the underlying Pub/Sub subscription configuration.
+   * Only populated on get requests.
+   * 
+ * + * .google.devtools.cloudbuild.v1.PubsubConfig.State state = 4; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Potential issues with the underlying Pub/Sub subscription configuration.
+   * Only populated on get requests.
+   * 
+ * + * .google.devtools.cloudbuild.v1.PubsubConfig.State state = 4; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloudbuild.v1.PubsubConfig.State getState() { + @SuppressWarnings("deprecation") + com.google.cloudbuild.v1.PubsubConfig.State result = + com.google.cloudbuild.v1.PubsubConfig.State.valueOf(state_); + return result == null ? com.google.cloudbuild.v1.PubsubConfig.State.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getSubscriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subscription_); + } + if (!getTopicBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, topic_); + } + if (!getServiceAccountEmailBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, serviceAccountEmail_); + } + if (state_ != com.google.cloudbuild.v1.PubsubConfig.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, state_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSubscriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subscription_); + } + if (!getTopicBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, topic_); + } + if (!getServiceAccountEmailBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, serviceAccountEmail_); + } + if (state_ != com.google.cloudbuild.v1.PubsubConfig.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloudbuild.v1.PubsubConfig)) { + return super.equals(obj); + } + com.google.cloudbuild.v1.PubsubConfig other = (com.google.cloudbuild.v1.PubsubConfig) obj; + + if (!getSubscription().equals(other.getSubscription())) return false; + if (!getTopic().equals(other.getTopic())) return false; + if (!getServiceAccountEmail().equals(other.getServiceAccountEmail())) return false; + if (state_ != other.state_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SUBSCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getSubscription().hashCode(); + hash = (37 * hash) + TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getTopic().hashCode(); + hash = (37 * hash) + SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER; + hash = (53 * hash) + getServiceAccountEmail().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloudbuild.v1.PubsubConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloudbuild.v1.PubsubConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloudbuild.v1.PubsubConfig parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloudbuild.v1.PubsubConfig 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.cloudbuild.v1.PubsubConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloudbuild.v1.PubsubConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloudbuild.v1.PubsubConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloudbuild.v1.PubsubConfig 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.cloudbuild.v1.PubsubConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloudbuild.v1.PubsubConfig 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.cloudbuild.v1.PubsubConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloudbuild.v1.PubsubConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloudbuild.v1.PubsubConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * PubsubConfig describes the configuration of a trigger that
+   * creates a build whenever a Pub/Sub message is published.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v1.PubsubConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v1.PubsubConfig) + com.google.cloudbuild.v1.PubsubConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloudbuild.v1.Cloudbuild + .internal_static_google_devtools_cloudbuild_v1_PubsubConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloudbuild.v1.Cloudbuild + .internal_static_google_devtools_cloudbuild_v1_PubsubConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloudbuild.v1.PubsubConfig.class, + com.google.cloudbuild.v1.PubsubConfig.Builder.class); + } + + // Construct using com.google.cloudbuild.v1.PubsubConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + subscription_ = ""; + + topic_ = ""; + + serviceAccountEmail_ = ""; + + state_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloudbuild.v1.Cloudbuild + .internal_static_google_devtools_cloudbuild_v1_PubsubConfig_descriptor; + } + + @java.lang.Override + public com.google.cloudbuild.v1.PubsubConfig getDefaultInstanceForType() { + return com.google.cloudbuild.v1.PubsubConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloudbuild.v1.PubsubConfig build() { + com.google.cloudbuild.v1.PubsubConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloudbuild.v1.PubsubConfig buildPartial() { + com.google.cloudbuild.v1.PubsubConfig result = + new com.google.cloudbuild.v1.PubsubConfig(this); + result.subscription_ = subscription_; + result.topic_ = topic_; + result.serviceAccountEmail_ = serviceAccountEmail_; + result.state_ = state_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloudbuild.v1.PubsubConfig) { + return mergeFrom((com.google.cloudbuild.v1.PubsubConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloudbuild.v1.PubsubConfig other) { + if (other == com.google.cloudbuild.v1.PubsubConfig.getDefaultInstance()) return this; + if (!other.getSubscription().isEmpty()) { + subscription_ = other.subscription_; + onChanged(); + } + if (!other.getTopic().isEmpty()) { + topic_ = other.topic_; + onChanged(); + } + if (!other.getServiceAccountEmail().isEmpty()) { + serviceAccountEmail_ = other.serviceAccountEmail_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloudbuild.v1.PubsubConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloudbuild.v1.PubsubConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object subscription_ = ""; + /** + * + * + *
+     * Output only. Name of the subscription. Format is
+     * `projects/{project}/subscriptions/{subscription}`.
+     * 
+ * + * + * string subscription = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The subscription. + */ + public java.lang.String getSubscription() { + java.lang.Object ref = subscription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subscription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the subscription. Format is
+     * `projects/{project}/subscriptions/{subscription}`.
+     * 
+ * + * + * string subscription = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for subscription. + */ + public com.google.protobuf.ByteString getSubscriptionBytes() { + java.lang.Object ref = subscription_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + subscription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the subscription. Format is
+     * `projects/{project}/subscriptions/{subscription}`.
+     * 
+ * + * + * string subscription = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The subscription to set. + * @return This builder for chaining. + */ + public Builder setSubscription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + subscription_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the subscription. Format is
+     * `projects/{project}/subscriptions/{subscription}`.
+     * 
+ * + * + * string subscription = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearSubscription() { + + subscription_ = getDefaultInstance().getSubscription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the subscription. Format is
+     * `projects/{project}/subscriptions/{subscription}`.
+     * 
+ * + * + * string subscription = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for subscription to set. + * @return This builder for chaining. + */ + public Builder setSubscriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + subscription_ = value; + onChanged(); + return this; + } + + private java.lang.Object topic_ = ""; + /** + * + * + *
+     * The name of the topic from which this subscription is receiving messages.
+     * Format is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string topic = 2 [(.google.api.resource_reference) = { ... } + * + * @return The topic. + */ + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the topic from which this subscription is receiving messages.
+     * Format is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string topic = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for topic. + */ + public com.google.protobuf.ByteString getTopicBytes() { + java.lang.Object ref = topic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + topic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the topic from which this subscription is receiving messages.
+     * Format is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string topic = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The topic to set. + * @return This builder for chaining. + */ + public Builder setTopic(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + topic_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the topic from which this subscription is receiving messages.
+     * Format is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string topic = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearTopic() { + + topic_ = getDefaultInstance().getTopic(); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the topic from which this subscription is receiving messages.
+     * Format is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string topic = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for topic to set. + * @return This builder for chaining. + */ + public Builder setTopicBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + topic_ = value; + onChanged(); + return this; + } + + private java.lang.Object serviceAccountEmail_ = ""; + /** + * + * + *
+     * Service account that will make the push request.
+     * 
+ * + * string service_account_email = 3 [(.google.api.resource_reference) = { ... } + * + * @return The serviceAccountEmail. + */ + public java.lang.String getServiceAccountEmail() { + java.lang.Object ref = serviceAccountEmail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccountEmail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Service account that will make the push request.
+     * 
+ * + * string service_account_email = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for serviceAccountEmail. + */ + public com.google.protobuf.ByteString getServiceAccountEmailBytes() { + java.lang.Object ref = serviceAccountEmail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccountEmail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Service account that will make the push request.
+     * 
+ * + * string service_account_email = 3 [(.google.api.resource_reference) = { ... } + * + * @param value The serviceAccountEmail to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountEmail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceAccountEmail_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Service account that will make the push request.
+     * 
+ * + * string service_account_email = 3 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearServiceAccountEmail() { + + serviceAccountEmail_ = getDefaultInstance().getServiceAccountEmail(); + onChanged(); + return this; + } + /** + * + * + *
+     * Service account that will make the push request.
+     * 
+ * + * string service_account_email = 3 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for serviceAccountEmail to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountEmailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceAccountEmail_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Potential issues with the underlying Pub/Sub subscription configuration.
+     * Only populated on get requests.
+     * 
+ * + * .google.devtools.cloudbuild.v1.PubsubConfig.State state = 4; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Potential issues with the underlying Pub/Sub subscription configuration.
+     * Only populated on get requests.
+     * 
+ * + * .google.devtools.cloudbuild.v1.PubsubConfig.State state = 4; + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Potential issues with the underlying Pub/Sub subscription configuration.
+     * Only populated on get requests.
+     * 
+ * + * .google.devtools.cloudbuild.v1.PubsubConfig.State state = 4; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloudbuild.v1.PubsubConfig.State getState() { + @SuppressWarnings("deprecation") + com.google.cloudbuild.v1.PubsubConfig.State result = + com.google.cloudbuild.v1.PubsubConfig.State.valueOf(state_); + return result == null ? com.google.cloudbuild.v1.PubsubConfig.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Potential issues with the underlying Pub/Sub subscription configuration.
+     * Only populated on get requests.
+     * 
+ * + * .google.devtools.cloudbuild.v1.PubsubConfig.State state = 4; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloudbuild.v1.PubsubConfig.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Potential issues with the underlying Pub/Sub subscription configuration.
+     * Only populated on get requests.
+     * 
+ * + * .google.devtools.cloudbuild.v1.PubsubConfig.State state = 4; + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.devtools.cloudbuild.v1.PubsubConfig) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.PubsubConfig) + private static final com.google.cloudbuild.v1.PubsubConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloudbuild.v1.PubsubConfig(); + } + + public static com.google.cloudbuild.v1.PubsubConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PubsubConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PubsubConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloudbuild.v1.PubsubConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/PubsubConfigOrBuilder.java b/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/PubsubConfigOrBuilder.java new file mode 100644 index 00000000..b26e2062 --- /dev/null +++ b/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/PubsubConfigOrBuilder.java @@ -0,0 +1,135 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/cloudbuild/v1/cloudbuild.proto + +package com.google.cloudbuild.v1; + +public interface PubsubConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v1.PubsubConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Name of the subscription. Format is
+   * `projects/{project}/subscriptions/{subscription}`.
+   * 
+ * + * + * string subscription = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The subscription. + */ + java.lang.String getSubscription(); + /** + * + * + *
+   * Output only. Name of the subscription. Format is
+   * `projects/{project}/subscriptions/{subscription}`.
+   * 
+ * + * + * string subscription = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for subscription. + */ + com.google.protobuf.ByteString getSubscriptionBytes(); + + /** + * + * + *
+   * The name of the topic from which this subscription is receiving messages.
+   * Format is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string topic = 2 [(.google.api.resource_reference) = { ... } + * + * @return The topic. + */ + java.lang.String getTopic(); + /** + * + * + *
+   * The name of the topic from which this subscription is receiving messages.
+   * Format is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string topic = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for topic. + */ + com.google.protobuf.ByteString getTopicBytes(); + + /** + * + * + *
+   * Service account that will make the push request.
+   * 
+ * + * string service_account_email = 3 [(.google.api.resource_reference) = { ... } + * + * @return The serviceAccountEmail. + */ + java.lang.String getServiceAccountEmail(); + /** + * + * + *
+   * Service account that will make the push request.
+   * 
+ * + * string service_account_email = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for serviceAccountEmail. + */ + com.google.protobuf.ByteString getServiceAccountEmailBytes(); + + /** + * + * + *
+   * Potential issues with the underlying Pub/Sub subscription configuration.
+   * Only populated on get requests.
+   * 
+ * + * .google.devtools.cloudbuild.v1.PubsubConfig.State state = 4; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Potential issues with the underlying Pub/Sub subscription configuration.
+   * Only populated on get requests.
+   * 
+ * + * .google.devtools.cloudbuild.v1.PubsubConfig.State state = 4; + * + * @return The state. + */ + com.google.cloudbuild.v1.PubsubConfig.State getState(); +} diff --git a/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/SubscriptionName.java b/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/SubscriptionName.java new file mode 100644 index 00000000..39dfb38d --- /dev/null +++ b/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/SubscriptionName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloudbuild.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class SubscriptionName implements ResourceName { + private static final PathTemplate PROJECT_SUBSCRIPTION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/subscriptions/{subscription}"); + private volatile Map fieldValuesMap; + private final String project; + private final String subscription; + + @Deprecated + protected SubscriptionName() { + project = null; + subscription = null; + } + + private SubscriptionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + subscription = Preconditions.checkNotNull(builder.getSubscription()); + } + + public String getProject() { + return project; + } + + public String getSubscription() { + return subscription; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SubscriptionName of(String project, String subscription) { + return newBuilder().setProject(project).setSubscription(subscription).build(); + } + + public static String format(String project, String subscription) { + return newBuilder().setProject(project).setSubscription(subscription).build().toString(); + } + + public static SubscriptionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_SUBSCRIPTION.validatedMatch( + formattedString, "SubscriptionName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("subscription")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (SubscriptionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_SUBSCRIPTION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (subscription != null) { + fieldMapBuilder.put("subscription", subscription); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_SUBSCRIPTION.instantiate("project", project, "subscription", subscription); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + SubscriptionName that = ((SubscriptionName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.subscription, that.subscription); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(subscription); + return h; + } + + /** Builder for projects/{project}/subscriptions/{subscription}. */ + public static class Builder { + private String project; + private String subscription; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getSubscription() { + return subscription; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setSubscription(String subscription) { + this.subscription = subscription; + return this; + } + + private Builder(SubscriptionName subscriptionName) { + project = subscriptionName.project; + subscription = subscriptionName.subscription; + } + + public SubscriptionName build() { + return new SubscriptionName(this); + } + } +} diff --git a/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/TopicName.java b/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/TopicName.java new file mode 100644 index 00000000..03ac582f --- /dev/null +++ b/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/TopicName.java @@ -0,0 +1,191 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloudbuild.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class TopicName implements ResourceName { + private static final PathTemplate PROJECT_TOPIC = + PathTemplate.createWithoutUrlEncoding("projects/{project}/topics/{topic}"); + private volatile Map fieldValuesMap; + private final String project; + private final String topic; + + @Deprecated + protected TopicName() { + project = null; + topic = null; + } + + private TopicName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + topic = Preconditions.checkNotNull(builder.getTopic()); + } + + public String getProject() { + return project; + } + + public String getTopic() { + return topic; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static TopicName of(String project, String topic) { + return newBuilder().setProject(project).setTopic(topic).build(); + } + + public static String format(String project, String topic) { + return newBuilder().setProject(project).setTopic(topic).build().toString(); + } + + public static TopicName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_TOPIC.validatedMatch( + formattedString, "TopicName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("topic")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (TopicName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_TOPIC.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (topic != null) { + fieldMapBuilder.put("topic", topic); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_TOPIC.instantiate("project", project, "topic", topic); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + TopicName that = ((TopicName) o); + return Objects.equals(this.project, that.project) && Objects.equals(this.topic, that.topic); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(topic); + return h; + } + + /** Builder for projects/{project}/topics/{topic}. */ + public static class Builder { + private String project; + private String topic; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getTopic() { + return topic; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setTopic(String topic) { + this.topic = topic; + return this; + } + + private Builder(TopicName topicName) { + project = topicName.project; + topic = topicName.topic; + } + + public TopicName build() { + return new TopicName(this); + } + } +} diff --git a/proto-google-cloud-build-v1/src/main/proto/google/devtools/cloudbuild/v1/cloudbuild.proto b/proto-google-cloud-build-v1/src/main/proto/google/devtools/cloudbuild/v1/cloudbuild.proto index b5a3c09d..938e37e9 100644 --- a/proto-google-cloud-build-v1/src/main/proto/google/devtools/cloudbuild/v1/cloudbuild.proto +++ b/proto-google-cloud-build-v1/src/main/proto/google/devtools/cloudbuild/v1/cloudbuild.proto @@ -53,6 +53,14 @@ option (google.api.resource_definition) = { type: "cloudkms.googleapis.com/CryptoKey" pattern: "projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}" }; +option (google.api.resource_definition) = { + type: "pubsub.googleapis.com/Subscription" + pattern: "projects/{project}/subscriptions/{subscription}" +}; +option (google.api.resource_definition) = { + type: "pubsub.googleapis.com/Topic" + pattern: "projects/{project}/topics/{topic}" +}; // Creates and manages builds on Google Cloud Platform. // @@ -1021,6 +1029,10 @@ message BuildTrigger { // Mutually exclusive with `trigger_template`. GitHubEventsConfig github = 13; + // Optional. PubsubConfig describes the configuration of a trigger that + // creates a build whenever a Pub/Sub message is published. + PubsubConfig pubsub_config = 29 [(google.api.field_behavior) = OPTIONAL]; + // Template describing the Build request to make when the trigger is matched. oneof build_template { // Contents of the build template. @@ -1062,6 +1074,9 @@ message BuildTrigger { // least one of those files matches a included_files glob. If not, // then we do not trigger a build. repeated string included_files = 16; + + // Optional. A Common Expression Language string. + string filter = 30 [(google.api.field_behavior) = OPTIONAL]; } // GitHubEventsConfig describes the configuration of a trigger that creates a @@ -1092,6 +1107,53 @@ message GitHubEventsConfig { } } +// PubsubConfig describes the configuration of a trigger that +// creates a build whenever a Pub/Sub message is published. +message PubsubConfig { + // Enumerates potential issues with the underlying Pub/Sub subscription + // configuration. + enum State { + // The subscription configuration has not been checked. + STATE_UNSPECIFIED = 0; + + // The Pub/Sub subscription is properly configured. + OK = 1; + + // The subscription has been deleted. + SUBSCRIPTION_DELETED = 2; + + // The topic has been deleted. + TOPIC_DELETED = 3; + + // Some of the subscription's field are misconfigured. + SUBSCRIPTION_MISCONFIGURED = 4; + } + + // Output only. Name of the subscription. Format is + // `projects/{project}/subscriptions/{subscription}`. + string subscription = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; + + // The name of the topic from which this subscription is receiving messages. + // Format is `projects/{project}/topics/{topic}`. + string topic = 2 [ + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + + // Service account that will make the push request. + string service_account_email = 3 [(google.api.resource_reference) = { + type: "iam.googleapis.com/ServiceAccount" + }]; + + // Potential issues with the underlying Pub/Sub subscription configuration. + // Only populated on get requests. + State state = 4; +} + // PullRequestFilter contains filter properties for matching GitHub Pull // Requests. message PullRequestFilter { diff --git a/synth.metadata b/synth.metadata index 9f97c5b2..5a287c21 100644 --- a/synth.metadata +++ b/synth.metadata @@ -18,8 +18,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "913f5553d5ff5940cddd8245313136449b2a3571", - "internalRef": "363244566" + "sha": "9a9e29627a715077cd8e33c0d2bd549437039bd0", + "internalRef": "368533270" } }, { @@ -185,6 +185,8 @@ "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/Network.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/NetworkOrBuilder.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/ProjectName.java", + "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/PubsubConfig.java", + "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/PubsubConfigOrBuilder.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/PullRequestFilter.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/PullRequestFilterOrBuilder.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/PushFilter.java", @@ -215,8 +217,10 @@ "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/SourceProvenanceOrBuilder.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/StorageSource.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/StorageSourceOrBuilder.java", + "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/SubscriptionName.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/TimeSpan.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/TimeSpanOrBuilder.java", + "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/TopicName.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/UpdateBuildTriggerRequest.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/UpdateBuildTriggerRequestOrBuilder.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/UpdateWorkerPoolRequest.java",