Class: Google::Apis::SecuresourcemanagerV1::BranchRule
- Inherits:
-
Object
- Object
- Google::Apis::SecuresourcemanagerV1::BranchRule
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/securesourcemanager_v1/classes.rb,
lib/google/apis/securesourcemanager_v1/representations.rb,
lib/google/apis/securesourcemanager_v1/representations.rb
Overview
Metadata of a BranchRule. BranchRule is the protection rule to enforce pre- defined rules on designated branches within a repository.
Instance Attribute Summary collapse
-
#allow_stale_reviews ⇒ Boolean
(also: #allow_stale_reviews?)
Optional.
-
#annotations ⇒ Hash<String,String>
Optional.
-
#create_time ⇒ String
Output only.
-
#disabled ⇒ Boolean
(also: #disabled?)
Optional.
-
#etag ⇒ String
Optional.
-
#include_pattern ⇒ String
Optional.
-
#minimum_approvals_count ⇒ Fixnum
Optional.
-
#minimum_reviews_count ⇒ Fixnum
Optional.
-
#name ⇒ String
Optional.
-
#require_comments_resolved ⇒ Boolean
(also: #require_comments_resolved?)
Optional.
-
#require_linear_history ⇒ Boolean
(also: #require_linear_history?)
Optional.
-
#require_pull_request ⇒ Boolean
(also: #require_pull_request?)
Optional.
-
#required_status_checks ⇒ Array<Google::Apis::SecuresourcemanagerV1::Check>
Optional.
-
#uid ⇒ String
Output only.
-
#update_time ⇒ String
Output only.
Instance Method Summary collapse
-
#initialize(**args) ⇒ BranchRule
constructor
A new instance of BranchRule.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ BranchRule
Returns a new instance of BranchRule.
340 341 342 |
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 340 def initialize(**args) update!(**args) end |
Instance Attribute Details
#allow_stale_reviews ⇒ Boolean Also known as: allow_stale_reviews?
Optional. Determines if allow stale reviews or approvals before merging to the
branch.
Corresponds to the JSON property allowStaleReviews
253 254 255 |
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 253 def allow_stale_reviews @allow_stale_reviews end |
#annotations ⇒ Hash<String,String>
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.
Corresponds to the JSON property annotations
261 262 263 |
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 261 def annotations @annotations end |
#create_time ⇒ String
Output only. Create timestamp.
Corresponds to the JSON property createTime
266 267 268 |
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 266 def create_time @create_time end |
#disabled ⇒ Boolean Also known as: disabled?
Optional. Determines if the branch rule is disabled or not.
Corresponds to the JSON property disabled
271 272 273 |
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 271 def disabled @disabled end |
#etag ⇒ String
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.
Corresponds to the JSON property etag
279 280 281 |
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 279 def etag @etag end |
#include_pattern ⇒ String
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.
Corresponds to the JSON propertyincludePattern`
286 287 288 |
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 286 def include_pattern @include_pattern end |
#minimum_approvals_count ⇒ Fixnum
Optional. The minimum number of approvals required for the branch rule to be
matched.
Corresponds to the JSON property minimumApprovalsCount
292 293 294 |
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 292 def minimum_approvals_count @minimum_approvals_count end |
#minimum_reviews_count ⇒ Fixnum
Optional. The minimum number of reviews required for the branch rule to be
matched.
Corresponds to the JSON property minimumReviewsCount
298 299 300 |
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 298 def minimum_reviews_count @minimum_reviews_count end |
#name ⇒ String
Optional. A unique identifier for a BranchRule. The name should be of the
format: projects/project/locations/location/repositories/repository/
branchRules/branch_rule`
Corresponds to the JSON propertyname`
305 306 307 |
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 305 def name @name end |
#require_comments_resolved ⇒ Boolean Also known as: require_comments_resolved?
Optional. Determines if require comments resolved before merging to the branch.
Corresponds to the JSON property requireCommentsResolved
310 311 312 |
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 310 def require_comments_resolved @require_comments_resolved end |
#require_linear_history ⇒ Boolean Also known as: require_linear_history?
Optional. Determines if require linear history before merging to the branch.
Corresponds to the JSON property requireLinearHistory
316 317 318 |
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 316 def require_linear_history @require_linear_history end |
#require_pull_request ⇒ Boolean Also known as: require_pull_request?
Optional. Determines if the branch rule requires a pull request or not.
Corresponds to the JSON property requirePullRequest
322 323 324 |
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 322 def require_pull_request @require_pull_request end |
#required_status_checks ⇒ Array<Google::Apis::SecuresourcemanagerV1::Check>
Optional. List of required status checks before merging to the branch.
Corresponds to the JSON property requiredStatusChecks
328 329 330 |
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 328 def required_status_checks @required_status_checks end |
#uid ⇒ String
Output only. Unique identifier of the repository.
Corresponds to the JSON property uid
333 334 335 |
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 333 def uid @uid end |
#update_time ⇒ String
Output only. Update timestamp.
Corresponds to the JSON property updateTime
338 339 340 |
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 338 def update_time @update_time end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 |
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 345 def update!(**args) @allow_stale_reviews = args[:allow_stale_reviews] if args.key?(:allow_stale_reviews) @annotations = args[:annotations] if args.key?(:annotations) @create_time = args[:create_time] if args.key?(:create_time) @disabled = args[:disabled] if args.key?(:disabled) @etag = args[:etag] if args.key?(:etag) @include_pattern = args[:include_pattern] if args.key?(:include_pattern) @minimum_approvals_count = args[:minimum_approvals_count] if args.key?(:minimum_approvals_count) @minimum_reviews_count = args[:minimum_reviews_count] if args.key?(:minimum_reviews_count) @name = args[:name] if args.key?(:name) @require_comments_resolved = args[:require_comments_resolved] if args.key?(:require_comments_resolved) @require_linear_history = args[:require_linear_history] if args.key?(:require_linear_history) @require_pull_request = args[:require_pull_request] if args.key?(:require_pull_request) @required_status_checks = args[:required_status_checks] if args.key?(:required_status_checks) @uid = args[:uid] if args.key?(:uid) @update_time = args[:update_time] if args.key?(:update_time) end |