All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.cloudbuild.v1.GitRepoSource Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     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

// Protobuf Java Version: 3.25.4
package com.google.cloudbuild.v1;

/**
 *
 *
 * 
 * GitRepoSource describes a repo and ref of a code repository.
 * 
* * Protobuf type {@code google.devtools.cloudbuild.v1.GitRepoSource} */ public final class GitRepoSource extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v1.GitRepoSource) GitRepoSourceOrBuilder { private static final long serialVersionUID = 0L; // Use GitRepoSource.newBuilder() to construct. private GitRepoSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private GitRepoSource() { uri_ = ""; ref_ = ""; repoType_ = 0; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new GitRepoSource(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloudbuild.v1.Cloudbuild .internal_static_google_devtools_cloudbuild_v1_GitRepoSource_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloudbuild.v1.Cloudbuild .internal_static_google_devtools_cloudbuild_v1_GitRepoSource_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloudbuild.v1.GitRepoSource.class, com.google.cloudbuild.v1.GitRepoSource.Builder.class); } private int sourceCase_ = 0; @SuppressWarnings("serial") private java.lang.Object source_; public enum SourceCase implements com.google.protobuf.Internal.EnumLite, com.google.protobuf.AbstractMessage.InternalOneOfEnum { REPOSITORY(6), SOURCE_NOT_SET(0); private final int value; private SourceCase(int value) { this.value = value; } /** * @param value The number of the enum to look for. * @return The enum associated with the given number. * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static SourceCase valueOf(int value) { return forNumber(value); } public static SourceCase forNumber(int value) { switch (value) { case 6: return REPOSITORY; case 0: return SOURCE_NOT_SET; default: return null; } } public int getNumber() { return this.value; } }; public SourceCase getSourceCase() { return SourceCase.forNumber(sourceCase_); } private int enterpriseConfigCase_ = 0; @SuppressWarnings("serial") private java.lang.Object enterpriseConfig_; public enum EnterpriseConfigCase implements com.google.protobuf.Internal.EnumLite, com.google.protobuf.AbstractMessage.InternalOneOfEnum { GITHUB_ENTERPRISE_CONFIG(4), ENTERPRISECONFIG_NOT_SET(0); private final int value; private EnterpriseConfigCase(int value) { this.value = value; } /** * @param value The number of the enum to look for. * @return The enum associated with the given number. * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static EnterpriseConfigCase valueOf(int value) { return forNumber(value); } public static EnterpriseConfigCase forNumber(int value) { switch (value) { case 4: return GITHUB_ENTERPRISE_CONFIG; case 0: return ENTERPRISECONFIG_NOT_SET; default: return null; } } public int getNumber() { return this.value; } }; public EnterpriseConfigCase getEnterpriseConfigCase() { return EnterpriseConfigCase.forNumber(enterpriseConfigCase_); } public static final int URI_FIELD_NUMBER = 1; @SuppressWarnings("serial") private volatile java.lang.Object uri_ = ""; /** * * *
   * The URI of the repo (e.g. https://github.com/user/repo.git).
   * Either `uri` or `repository` can be specified and is required.
   * 
* * string uri = 1; * * @return The uri. */ @java.lang.Override public java.lang.String getUri() { java.lang.Object ref = uri_; 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(); uri_ = s; return s; } } /** * * *
   * The URI of the repo (e.g. https://github.com/user/repo.git).
   * Either `uri` or `repository` can be specified and is required.
   * 
* * string uri = 1; * * @return The bytes for uri. */ @java.lang.Override public com.google.protobuf.ByteString getUriBytes() { java.lang.Object ref = uri_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); uri_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int REPOSITORY_FIELD_NUMBER = 6; /** * * *
   * The connected repository resource name, in the format
   * `projects/*/locations/*/connections/*/repositories/*`. Either `uri` or
   * `repository` can be specified and is required.
   * 
* * string repository = 6 [(.google.api.resource_reference) = { ... } * * @return Whether the repository field is set. */ public boolean hasRepository() { return sourceCase_ == 6; } /** * * *
   * The connected repository resource name, in the format
   * `projects/*/locations/*/connections/*/repositories/*`. Either `uri` or
   * `repository` can be specified and is required.
   * 
* * string repository = 6 [(.google.api.resource_reference) = { ... } * * @return The repository. */ public java.lang.String getRepository() { java.lang.Object ref = ""; if (sourceCase_ == 6) { ref = source_; } if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (sourceCase_ == 6) { source_ = s; } return s; } } /** * * *
   * The connected repository resource name, in the format
   * `projects/*/locations/*/connections/*/repositories/*`. Either `uri` or
   * `repository` can be specified and is required.
   * 
* * string repository = 6 [(.google.api.resource_reference) = { ... } * * @return The bytes for repository. */ public com.google.protobuf.ByteString getRepositoryBytes() { java.lang.Object ref = ""; if (sourceCase_ == 6) { ref = source_; } if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); if (sourceCase_ == 6) { source_ = b; } return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int REF_FIELD_NUMBER = 2; @SuppressWarnings("serial") private volatile java.lang.Object ref_ = ""; /** * * *
   * The branch or tag to use. Must start with "refs/" (required).
   * 
* * string ref = 2; * * @return The ref. */ @java.lang.Override public java.lang.String getRef() { java.lang.Object ref = ref_; 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(); ref_ = s; return s; } } /** * * *
   * The branch or tag to use. Must start with "refs/" (required).
   * 
* * string ref = 2; * * @return The bytes for ref. */ @java.lang.Override public com.google.protobuf.ByteString getRefBytes() { java.lang.Object ref = ref_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); ref_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int REPO_TYPE_FIELD_NUMBER = 3; private int repoType_ = 0; /** * * *
   * See RepoType below.
   * 
* * .google.devtools.cloudbuild.v1.GitFileSource.RepoType repo_type = 3; * * @return The enum numeric value on the wire for repoType. */ @java.lang.Override public int getRepoTypeValue() { return repoType_; } /** * * *
   * See RepoType below.
   * 
* * .google.devtools.cloudbuild.v1.GitFileSource.RepoType repo_type = 3; * * @return The repoType. */ @java.lang.Override public com.google.cloudbuild.v1.GitFileSource.RepoType getRepoType() { com.google.cloudbuild.v1.GitFileSource.RepoType result = com.google.cloudbuild.v1.GitFileSource.RepoType.forNumber(repoType_); return result == null ? com.google.cloudbuild.v1.GitFileSource.RepoType.UNRECOGNIZED : result; } public static final int GITHUB_ENTERPRISE_CONFIG_FIELD_NUMBER = 4; /** * * *
   * The full resource name of the github enterprise config.
   * Format:
   * `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`.
   * `projects/{project}/githubEnterpriseConfigs/{id}`.
   * 
* * string github_enterprise_config = 4 [(.google.api.resource_reference) = { ... } * * @return Whether the githubEnterpriseConfig field is set. */ public boolean hasGithubEnterpriseConfig() { return enterpriseConfigCase_ == 4; } /** * * *
   * The full resource name of the github enterprise config.
   * Format:
   * `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`.
   * `projects/{project}/githubEnterpriseConfigs/{id}`.
   * 
* * string github_enterprise_config = 4 [(.google.api.resource_reference) = { ... } * * @return The githubEnterpriseConfig. */ public java.lang.String getGithubEnterpriseConfig() { java.lang.Object ref = ""; if (enterpriseConfigCase_ == 4) { ref = enterpriseConfig_; } if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (enterpriseConfigCase_ == 4) { enterpriseConfig_ = s; } return s; } } /** * * *
   * The full resource name of the github enterprise config.
   * Format:
   * `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`.
   * `projects/{project}/githubEnterpriseConfigs/{id}`.
   * 
* * string github_enterprise_config = 4 [(.google.api.resource_reference) = { ... } * * @return The bytes for githubEnterpriseConfig. */ public com.google.protobuf.ByteString getGithubEnterpriseConfigBytes() { java.lang.Object ref = ""; if (enterpriseConfigCase_ == 4) { ref = enterpriseConfig_; } if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); if (enterpriseConfigCase_ == 4) { enterpriseConfig_ = b; } return b; } else { return (com.google.protobuf.ByteString) ref; } } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ref_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ref_); } if (repoType_ != com.google.cloudbuild.v1.GitFileSource.RepoType.UNKNOWN.getNumber()) { output.writeEnum(3, repoType_); } if (enterpriseConfigCase_ == 4) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, enterpriseConfig_); } if (sourceCase_ == 6) { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, source_); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uri_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ref_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, ref_); } if (repoType_ != com.google.cloudbuild.v1.GitFileSource.RepoType.UNKNOWN.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, repoType_); } if (enterpriseConfigCase_ == 4) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, enterpriseConfig_); } if (sourceCase_ == 6) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, source_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloudbuild.v1.GitRepoSource)) { return super.equals(obj); } com.google.cloudbuild.v1.GitRepoSource other = (com.google.cloudbuild.v1.GitRepoSource) obj; if (!getUri().equals(other.getUri())) return false; if (!getRef().equals(other.getRef())) return false; if (repoType_ != other.repoType_) return false; if (!getSourceCase().equals(other.getSourceCase())) return false; switch (sourceCase_) { case 6: if (!getRepository().equals(other.getRepository())) return false; break; case 0: default: } if (!getEnterpriseConfigCase().equals(other.getEnterpriseConfigCase())) return false; switch (enterpriseConfigCase_) { case 4: if (!getGithubEnterpriseConfig().equals(other.getGithubEnterpriseConfig())) return false; break; case 0: default: } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + URI_FIELD_NUMBER; hash = (53 * hash) + getUri().hashCode(); hash = (37 * hash) + REF_FIELD_NUMBER; hash = (53 * hash) + getRef().hashCode(); hash = (37 * hash) + REPO_TYPE_FIELD_NUMBER; hash = (53 * hash) + repoType_; switch (sourceCase_) { case 6: hash = (37 * hash) + REPOSITORY_FIELD_NUMBER; hash = (53 * hash) + getRepository().hashCode(); break; case 0: default: } switch (enterpriseConfigCase_) { case 4: hash = (37 * hash) + GITHUB_ENTERPRISE_CONFIG_FIELD_NUMBER; hash = (53 * hash) + getGithubEnterpriseConfig().hashCode(); break; case 0: default: } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.google.cloudbuild.v1.GitRepoSource parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloudbuild.v1.GitRepoSource 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.GitRepoSource parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloudbuild.v1.GitRepoSource 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.GitRepoSource parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloudbuild.v1.GitRepoSource parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloudbuild.v1.GitRepoSource parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloudbuild.v1.GitRepoSource 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.GitRepoSource parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloudbuild.v1.GitRepoSource 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.GitRepoSource parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloudbuild.v1.GitRepoSource 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.GitRepoSource 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; } /** * * *
   * GitRepoSource describes a repo and ref of a code repository.
   * 
* * Protobuf type {@code google.devtools.cloudbuild.v1.GitRepoSource} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v1.GitRepoSource) com.google.cloudbuild.v1.GitRepoSourceOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloudbuild.v1.Cloudbuild .internal_static_google_devtools_cloudbuild_v1_GitRepoSource_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloudbuild.v1.Cloudbuild .internal_static_google_devtools_cloudbuild_v1_GitRepoSource_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloudbuild.v1.GitRepoSource.class, com.google.cloudbuild.v1.GitRepoSource.Builder.class); } // Construct using com.google.cloudbuild.v1.GitRepoSource.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; uri_ = ""; ref_ = ""; repoType_ = 0; sourceCase_ = 0; source_ = null; enterpriseConfigCase_ = 0; enterpriseConfig_ = null; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloudbuild.v1.Cloudbuild .internal_static_google_devtools_cloudbuild_v1_GitRepoSource_descriptor; } @java.lang.Override public com.google.cloudbuild.v1.GitRepoSource getDefaultInstanceForType() { return com.google.cloudbuild.v1.GitRepoSource.getDefaultInstance(); } @java.lang.Override public com.google.cloudbuild.v1.GitRepoSource build() { com.google.cloudbuild.v1.GitRepoSource result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.cloudbuild.v1.GitRepoSource buildPartial() { com.google.cloudbuild.v1.GitRepoSource result = new com.google.cloudbuild.v1.GitRepoSource(this); if (bitField0_ != 0) { buildPartial0(result); } buildPartialOneofs(result); onBuilt(); return result; } private void buildPartial0(com.google.cloudbuild.v1.GitRepoSource result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.uri_ = uri_; } if (((from_bitField0_ & 0x00000004) != 0)) { result.ref_ = ref_; } if (((from_bitField0_ & 0x00000008) != 0)) { result.repoType_ = repoType_; } } private void buildPartialOneofs(com.google.cloudbuild.v1.GitRepoSource result) { result.sourceCase_ = sourceCase_; result.source_ = this.source_; result.enterpriseConfigCase_ = enterpriseConfigCase_; result.enterpriseConfig_ = this.enterpriseConfig_; } @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.GitRepoSource) { return mergeFrom((com.google.cloudbuild.v1.GitRepoSource) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.cloudbuild.v1.GitRepoSource other) { if (other == com.google.cloudbuild.v1.GitRepoSource.getDefaultInstance()) return this; if (!other.getUri().isEmpty()) { uri_ = other.uri_; bitField0_ |= 0x00000001; onChanged(); } if (!other.getRef().isEmpty()) { ref_ = other.ref_; bitField0_ |= 0x00000004; onChanged(); } if (other.repoType_ != 0) { setRepoTypeValue(other.getRepoTypeValue()); } switch (other.getSourceCase()) { case REPOSITORY: { sourceCase_ = 6; source_ = other.source_; onChanged(); break; } case SOURCE_NOT_SET: { break; } } switch (other.getEnterpriseConfigCase()) { case GITHUB_ENTERPRISE_CONFIG: { enterpriseConfigCase_ = 4; enterpriseConfig_ = other.enterpriseConfig_; onChanged(); break; } case ENTERPRISECONFIG_NOT_SET: { break; } } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { uri_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000001; break; } // case 10 case 18: { ref_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000004; break; } // case 18 case 24: { repoType_ = input.readEnum(); bitField0_ |= 0x00000008; break; } // case 24 case 34: { java.lang.String s = input.readStringRequireUtf8(); enterpriseConfigCase_ = 4; enterpriseConfig_ = s; break; } // case 34 case 50: { java.lang.String s = input.readStringRequireUtf8(); sourceCase_ = 6; source_ = s; break; } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag } break; } // default: } // switch (tag) } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.unwrapIOException(); } finally { onChanged(); } // finally return this; } private int sourceCase_ = 0; private java.lang.Object source_; public SourceCase getSourceCase() { return SourceCase.forNumber(sourceCase_); } public Builder clearSource() { sourceCase_ = 0; source_ = null; onChanged(); return this; } private int enterpriseConfigCase_ = 0; private java.lang.Object enterpriseConfig_; public EnterpriseConfigCase getEnterpriseConfigCase() { return EnterpriseConfigCase.forNumber(enterpriseConfigCase_); } public Builder clearEnterpriseConfig() { enterpriseConfigCase_ = 0; enterpriseConfig_ = null; onChanged(); return this; } private int bitField0_; private java.lang.Object uri_ = ""; /** * * *
     * The URI of the repo (e.g. https://github.com/user/repo.git).
     * Either `uri` or `repository` can be specified and is required.
     * 
* * string uri = 1; * * @return The uri. */ public java.lang.String getUri() { java.lang.Object ref = uri_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); uri_ = s; return s; } else { return (java.lang.String) ref; } } /** * * *
     * The URI of the repo (e.g. https://github.com/user/repo.git).
     * Either `uri` or `repository` can be specified and is required.
     * 
* * string uri = 1; * * @return The bytes for uri. */ public com.google.protobuf.ByteString getUriBytes() { java.lang.Object ref = uri_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); uri_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
     * The URI of the repo (e.g. https://github.com/user/repo.git).
     * Either `uri` or `repository` can be specified and is required.
     * 
* * string uri = 1; * * @param value The uri to set. * @return This builder for chaining. */ public Builder setUri(java.lang.String value) { if (value == null) { throw new NullPointerException(); } uri_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } /** * * *
     * The URI of the repo (e.g. https://github.com/user/repo.git).
     * Either `uri` or `repository` can be specified and is required.
     * 
* * string uri = 1; * * @return This builder for chaining. */ public Builder clearUri() { uri_ = getDefaultInstance().getUri(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** * * *
     * The URI of the repo (e.g. https://github.com/user/repo.git).
     * Either `uri` or `repository` can be specified and is required.
     * 
* * string uri = 1; * * @param value The bytes for uri to set. * @return This builder for chaining. */ public Builder setUriBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); uri_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } /** * * *
     * The connected repository resource name, in the format
     * `projects/*/locations/*/connections/*/repositories/*`. Either `uri` or
     * `repository` can be specified and is required.
     * 
* * string repository = 6 [(.google.api.resource_reference) = { ... } * * @return Whether the repository field is set. */ @java.lang.Override public boolean hasRepository() { return sourceCase_ == 6; } /** * * *
     * The connected repository resource name, in the format
     * `projects/*/locations/*/connections/*/repositories/*`. Either `uri` or
     * `repository` can be specified and is required.
     * 
* * string repository = 6 [(.google.api.resource_reference) = { ... } * * @return The repository. */ @java.lang.Override public java.lang.String getRepository() { java.lang.Object ref = ""; if (sourceCase_ == 6) { ref = source_; } if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (sourceCase_ == 6) { source_ = s; } return s; } else { return (java.lang.String) ref; } } /** * * *
     * The connected repository resource name, in the format
     * `projects/*/locations/*/connections/*/repositories/*`. Either `uri` or
     * `repository` can be specified and is required.
     * 
* * string repository = 6 [(.google.api.resource_reference) = { ... } * * @return The bytes for repository. */ @java.lang.Override public com.google.protobuf.ByteString getRepositoryBytes() { java.lang.Object ref = ""; if (sourceCase_ == 6) { ref = source_; } if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); if (sourceCase_ == 6) { source_ = b; } return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
     * The connected repository resource name, in the format
     * `projects/*/locations/*/connections/*/repositories/*`. Either `uri` or
     * `repository` can be specified and is required.
     * 
* * string repository = 6 [(.google.api.resource_reference) = { ... } * * @param value The repository to set. * @return This builder for chaining. */ public Builder setRepository(java.lang.String value) { if (value == null) { throw new NullPointerException(); } sourceCase_ = 6; source_ = value; onChanged(); return this; } /** * * *
     * The connected repository resource name, in the format
     * `projects/*/locations/*/connections/*/repositories/*`. Either `uri` or
     * `repository` can be specified and is required.
     * 
* * string repository = 6 [(.google.api.resource_reference) = { ... } * * @return This builder for chaining. */ public Builder clearRepository() { if (sourceCase_ == 6) { sourceCase_ = 0; source_ = null; onChanged(); } return this; } /** * * *
     * The connected repository resource name, in the format
     * `projects/*/locations/*/connections/*/repositories/*`. Either `uri` or
     * `repository` can be specified and is required.
     * 
* * string repository = 6 [(.google.api.resource_reference) = { ... } * * @param value The bytes for repository to set. * @return This builder for chaining. */ public Builder setRepositoryBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); sourceCase_ = 6; source_ = value; onChanged(); return this; } private java.lang.Object ref_ = ""; /** * * *
     * The branch or tag to use. Must start with "refs/" (required).
     * 
* * string ref = 2; * * @return The ref. */ public java.lang.String getRef() { java.lang.Object ref = ref_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); ref_ = s; return s; } else { return (java.lang.String) ref; } } /** * * *
     * The branch or tag to use. Must start with "refs/" (required).
     * 
* * string ref = 2; * * @return The bytes for ref. */ public com.google.protobuf.ByteString getRefBytes() { java.lang.Object ref = ref_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); ref_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
     * The branch or tag to use. Must start with "refs/" (required).
     * 
* * string ref = 2; * * @param value The ref to set. * @return This builder for chaining. */ public Builder setRef(java.lang.String value) { if (value == null) { throw new NullPointerException(); } ref_ = value; bitField0_ |= 0x00000004; onChanged(); return this; } /** * * *
     * The branch or tag to use. Must start with "refs/" (required).
     * 
* * string ref = 2; * * @return This builder for chaining. */ public Builder clearRef() { ref_ = getDefaultInstance().getRef(); bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } /** * * *
     * The branch or tag to use. Must start with "refs/" (required).
     * 
* * string ref = 2; * * @param value The bytes for ref to set. * @return This builder for chaining. */ public Builder setRefBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); ref_ = value; bitField0_ |= 0x00000004; onChanged(); return this; } private int repoType_ = 0; /** * * *
     * See RepoType below.
     * 
* * .google.devtools.cloudbuild.v1.GitFileSource.RepoType repo_type = 3; * * @return The enum numeric value on the wire for repoType. */ @java.lang.Override public int getRepoTypeValue() { return repoType_; } /** * * *
     * See RepoType below.
     * 
* * .google.devtools.cloudbuild.v1.GitFileSource.RepoType repo_type = 3; * * @param value The enum numeric value on the wire for repoType to set. * @return This builder for chaining. */ public Builder setRepoTypeValue(int value) { repoType_ = value; bitField0_ |= 0x00000008; onChanged(); return this; } /** * * *
     * See RepoType below.
     * 
* * .google.devtools.cloudbuild.v1.GitFileSource.RepoType repo_type = 3; * * @return The repoType. */ @java.lang.Override public com.google.cloudbuild.v1.GitFileSource.RepoType getRepoType() { com.google.cloudbuild.v1.GitFileSource.RepoType result = com.google.cloudbuild.v1.GitFileSource.RepoType.forNumber(repoType_); return result == null ? com.google.cloudbuild.v1.GitFileSource.RepoType.UNRECOGNIZED : result; } /** * * *
     * See RepoType below.
     * 
* * .google.devtools.cloudbuild.v1.GitFileSource.RepoType repo_type = 3; * * @param value The repoType to set. * @return This builder for chaining. */ public Builder setRepoType(com.google.cloudbuild.v1.GitFileSource.RepoType value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000008; repoType_ = value.getNumber(); onChanged(); return this; } /** * * *
     * See RepoType below.
     * 
* * .google.devtools.cloudbuild.v1.GitFileSource.RepoType repo_type = 3; * * @return This builder for chaining. */ public Builder clearRepoType() { bitField0_ = (bitField0_ & ~0x00000008); repoType_ = 0; onChanged(); return this; } /** * * *
     * The full resource name of the github enterprise config.
     * Format:
     * `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`.
     * `projects/{project}/githubEnterpriseConfigs/{id}`.
     * 
* * string github_enterprise_config = 4 [(.google.api.resource_reference) = { ... } * * @return Whether the githubEnterpriseConfig field is set. */ @java.lang.Override public boolean hasGithubEnterpriseConfig() { return enterpriseConfigCase_ == 4; } /** * * *
     * The full resource name of the github enterprise config.
     * Format:
     * `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`.
     * `projects/{project}/githubEnterpriseConfigs/{id}`.
     * 
* * string github_enterprise_config = 4 [(.google.api.resource_reference) = { ... } * * @return The githubEnterpriseConfig. */ @java.lang.Override public java.lang.String getGithubEnterpriseConfig() { java.lang.Object ref = ""; if (enterpriseConfigCase_ == 4) { ref = enterpriseConfig_; } if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (enterpriseConfigCase_ == 4) { enterpriseConfig_ = s; } return s; } else { return (java.lang.String) ref; } } /** * * *
     * The full resource name of the github enterprise config.
     * Format:
     * `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`.
     * `projects/{project}/githubEnterpriseConfigs/{id}`.
     * 
* * string github_enterprise_config = 4 [(.google.api.resource_reference) = { ... } * * @return The bytes for githubEnterpriseConfig. */ @java.lang.Override public com.google.protobuf.ByteString getGithubEnterpriseConfigBytes() { java.lang.Object ref = ""; if (enterpriseConfigCase_ == 4) { ref = enterpriseConfig_; } if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); if (enterpriseConfigCase_ == 4) { enterpriseConfig_ = b; } return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
     * The full resource name of the github enterprise config.
     * Format:
     * `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`.
     * `projects/{project}/githubEnterpriseConfigs/{id}`.
     * 
* * string github_enterprise_config = 4 [(.google.api.resource_reference) = { ... } * * @param value The githubEnterpriseConfig to set. * @return This builder for chaining. */ public Builder setGithubEnterpriseConfig(java.lang.String value) { if (value == null) { throw new NullPointerException(); } enterpriseConfigCase_ = 4; enterpriseConfig_ = value; onChanged(); return this; } /** * * *
     * The full resource name of the github enterprise config.
     * Format:
     * `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`.
     * `projects/{project}/githubEnterpriseConfigs/{id}`.
     * 
* * string github_enterprise_config = 4 [(.google.api.resource_reference) = { ... } * * @return This builder for chaining. */ public Builder clearGithubEnterpriseConfig() { if (enterpriseConfigCase_ == 4) { enterpriseConfigCase_ = 0; enterpriseConfig_ = null; onChanged(); } return this; } /** * * *
     * The full resource name of the github enterprise config.
     * Format:
     * `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`.
     * `projects/{project}/githubEnterpriseConfigs/{id}`.
     * 
* * string github_enterprise_config = 4 [(.google.api.resource_reference) = { ... } * * @param value The bytes for githubEnterpriseConfig to set. * @return This builder for chaining. */ public Builder setGithubEnterpriseConfigBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); enterpriseConfigCase_ = 4; enterpriseConfig_ = value; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:google.devtools.cloudbuild.v1.GitRepoSource) } // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.GitRepoSource) private static final com.google.cloudbuild.v1.GitRepoSource DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.cloudbuild.v1.GitRepoSource(); } public static com.google.cloudbuild.v1.GitRepoSource getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public GitRepoSource parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { Builder builder = newBuilder(); try { builder.mergeFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(builder.buildPartial()); } catch (com.google.protobuf.UninitializedMessageException e) { throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e) .setUnfinishedMessage(builder.buildPartial()); } return builder.buildPartial(); } }; public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override public com.google.cloudbuild.v1.GitRepoSource getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy