Class BranchRule (0.24.0)

public final class BranchRule extends GeneratedMessageV3 implements BranchRuleOrBuilder

Metadata of a BranchRule. BranchRule is the protection rule to enforce pre-defined rules on desginated branches within a repository.

Protobuf type google.cloud.securesourcemanager.v1.BranchRule

Implements

BranchRuleOrBuilder

Static Fields

ALLOW_STALE_REVIEWS_FIELD_NUMBER

public static final int ALLOW_STALE_REVIEWS_FIELD_NUMBER
Field Value
Type Description
int

ANNOTATIONS_FIELD_NUMBER

public static final int ANNOTATIONS_FIELD_NUMBER
Field Value
Type Description
int

CREATE_TIME_FIELD_NUMBER

public static final int CREATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

DISABLED_FIELD_NUMBER

public static final int DISABLED_FIELD_NUMBER
Field Value
Type Description
int

ETAG_FIELD_NUMBER

public static final int ETAG_FIELD_NUMBER
Field Value
Type Description
int

INCLUDE_PATTERN_FIELD_NUMBER

public static final int INCLUDE_PATTERN_FIELD_NUMBER
Field Value
Type Description
int

MINIMUM_APPROVALS_COUNT_FIELD_NUMBER

public static final int MINIMUM_APPROVALS_COUNT_FIELD_NUMBER
Field Value
Type Description
int

MINIMUM_REVIEWS_COUNT_FIELD_NUMBER

public static final int MINIMUM_REVIEWS_COUNT_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

REQUIRED_STATUS_CHECKS_FIELD_NUMBER

public static final int REQUIRED_STATUS_CHECKS_FIELD_NUMBER
Field Value
Type Description
int

REQUIRE_COMMENTS_RESOLVED_FIELD_NUMBER

public static final int REQUIRE_COMMENTS_RESOLVED_FIELD_NUMBER
Field Value
Type Description
int

REQUIRE_LINEAR_HISTORY_FIELD_NUMBER

public static final int REQUIRE_LINEAR_HISTORY_FIELD_NUMBER
Field Value
Type Description
int

REQUIRE_PULL_REQUEST_FIELD_NUMBER

public static final int REQUIRE_PULL_REQUEST_FIELD_NUMBER
Field Value
Type Description
int

UID_FIELD_NUMBER

public static final int UID_FIELD_NUMBER
Field Value
Type Description
int

UPDATE_TIME_FIELD_NUMBER

public static final int UPDATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static BranchRule getDefaultInstance()
Returns
Type Description
BranchRule

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static BranchRule.Builder newBuilder()
Returns
Type Description
BranchRule.Builder

newBuilder(BranchRule prototype)

public static BranchRule.Builder newBuilder(BranchRule prototype)
Parameter
Name Description
prototype BranchRule
Returns
Type Description
BranchRule.Builder

parseDelimitedFrom(InputStream input)

public static BranchRule parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
BranchRule
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static BranchRule parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
BranchRule
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static BranchRule parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
BranchRule
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static BranchRule parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
BranchRule
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static BranchRule parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
BranchRule
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static BranchRule parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
BranchRule
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static BranchRule parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
BranchRule
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static BranchRule parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
BranchRule
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static BranchRule parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
BranchRule
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static BranchRule parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
BranchRule
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static BranchRule parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
BranchRule
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static BranchRule parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
BranchRule
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<BranchRule> parser()
Returns
Type Description
Parser<BranchRule>

Methods

containsAnnotations(String key)

public boolean containsAnnotations(String key)

Optional. User annotations. These attributes can only be set and used by the user. See https://google.aip.dev/128#annotations for more details such as format and size limitations.

map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
key String
Returns
Type Description
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getAllowStaleReviews()

public boolean getAllowStaleReviews()

Optional. Determines if allow stale reviews or approvals before merging to the branch.

bool allow_stale_reviews = 15 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

The allowStaleReviews.

getAnnotations() (deprecated)

public Map<String,String> getAnnotations()

Use #getAnnotationsMap() instead.

Returns
Type Description
Map<String,String>

getAnnotationsCount()

public int getAnnotationsCount()

Optional. User annotations. These attributes can only be set and used by the user. See https://google.aip.dev/128#annotations for more details such as format and size limitations.

map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getAnnotationsMap()

public Map<String,String> getAnnotationsMap()

Optional. User annotations. These attributes can only be set and used by the user. See https://google.aip.dev/128#annotations for more details such as format and size limitations.

map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Map<String,String>

getAnnotationsOrDefault(String key, String defaultValue)

public String getAnnotationsOrDefault(String key, String defaultValue)

Optional. User annotations. These attributes can only be set and used by the user. See https://google.aip.dev/128#annotations for more details such as format and size limitations.

map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getAnnotationsOrThrow(String key)

public String getAnnotationsOrThrow(String key)

Optional. User annotations. These attributes can only be set and used by the user. See https://google.aip.dev/128#annotations for more details such as format and size limitations.

map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
key String
Returns
Type Description
String

getCreateTime()

public Timestamp getCreateTime()

Output only. Create timestamp.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The createTime.

getCreateTimeOrBuilder()

public TimestampOrBuilder getCreateTimeOrBuilder()

Output only. Create timestamp.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getDefaultInstanceForType()

public BranchRule getDefaultInstanceForType()
Returns
Type Description
BranchRule

getDisabled()

public boolean getDisabled()

Optional. Determines if the branch rule is disabled or not.

bool disabled = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

The disabled.

getEtag()

public String getEtag()

Optional. This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.

string etag = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The etag.

getEtagBytes()

public ByteString getEtagBytes()

Optional. This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.

string etag = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for etag.

getIncludePattern()

public String getIncludePattern()

Optional. The pattern of the branch that can match to this BranchRule. Specified as regex. .* for all branches. Examples: main, (main|release.). Current MVP phase only support . for wildcard.

string include_pattern = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The includePattern.

getIncludePatternBytes()

public ByteString getIncludePatternBytes()

Optional. The pattern of the branch that can match to this BranchRule. Specified as regex. .* for all branches. Examples: main, (main|release.). Current MVP phase only support . for wildcard.

string include_pattern = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for includePattern.

getMinimumApprovalsCount()

public int getMinimumApprovalsCount()

Optional. The minimum number of approvals required for the branch rule to be matched.

int32 minimum_approvals_count = 11 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The minimumApprovalsCount.

getMinimumReviewsCount()

public int getMinimumReviewsCount()

Optional. The minimum number of reviews required for the branch rule to be matched.

int32 minimum_reviews_count = 10 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The minimumReviewsCount.

getName()

public String getName()

Optional. A unique identifier for a BranchRule. The name should be of the format: projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}

string name = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Optional. A unique identifier for a BranchRule. The name should be of the format: projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}

string name = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for name.

getParserForType()

public Parser<BranchRule> getParserForType()
Returns
Type Description
Parser<BranchRule>
Overrides

getRequireCommentsResolved()

public boolean getRequireCommentsResolved()

Optional. Determines if require comments resolved before merging to the branch.

bool require_comments_resolved = 12 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

The requireCommentsResolved.

getRequireLinearHistory()

public boolean getRequireLinearHistory()

Optional. Determines if require linear history before merging to the branch.

bool require_linear_history = 13 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

The requireLinearHistory.

getRequirePullRequest()

public boolean getRequirePullRequest()

Optional. Determines if the branch rule requires a pull request or not.

bool require_pull_request = 9 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

The requirePullRequest.

getRequiredStatusChecks(int index)

public BranchRule.Check getRequiredStatusChecks(int index)

Optional. List of required status checks before merging to the branch.

repeated .google.cloud.securesourcemanager.v1.BranchRule.Check required_status_checks = 14 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
BranchRule.Check

getRequiredStatusChecksCount()

public int getRequiredStatusChecksCount()

Optional. List of required status checks before merging to the branch.

repeated .google.cloud.securesourcemanager.v1.BranchRule.Check required_status_checks = 14 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getRequiredStatusChecksList()

public List<BranchRule.Check> getRequiredStatusChecksList()

Optional. List of required status checks before merging to the branch.

repeated .google.cloud.securesourcemanager.v1.BranchRule.Check required_status_checks = 14 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<Check>

getRequiredStatusChecksOrBuilder(int index)

public BranchRule.CheckOrBuilder getRequiredStatusChecksOrBuilder(int index)

Optional. List of required status checks before merging to the branch.

repeated .google.cloud.securesourcemanager.v1.BranchRule.Check required_status_checks = 14 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
BranchRule.CheckOrBuilder

getRequiredStatusChecksOrBuilderList()

public List<? extends BranchRule.CheckOrBuilder> getRequiredStatusChecksOrBuilderList()

Optional. List of required status checks before merging to the branch.

repeated .google.cloud.securesourcemanager.v1.BranchRule.Check required_status_checks = 14 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<? extends com.google.cloud.securesourcemanager.v1.BranchRule.CheckOrBuilder>

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getUid()

public String getUid()

Output only. Unique identifier of the repository.

string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The uid.

getUidBytes()

public ByteString getUidBytes()

Output only. Unique identifier of the repository.

string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for uid.

getUpdateTime()

public Timestamp getUpdateTime()

Output only. Update timestamp.

.google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The updateTime.

getUpdateTimeOrBuilder()

public TimestampOrBuilder getUpdateTimeOrBuilder()

Output only. Update timestamp.

.google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

hasCreateTime()

public boolean hasCreateTime()

Output only. Create timestamp.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the createTime field is set.

hasUpdateTime()

public boolean hasUpdateTime()

Output only. Update timestamp.

.google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the updateTime field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public BranchRule.Builder newBuilderForType()
Returns
Type Description
BranchRule.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected BranchRule.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
BranchRule.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public BranchRule.Builder toBuilder()
Returns
Type Description
BranchRule.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException