Class: Google::Apis::SecuresourcemanagerV1::BranchRule

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_reviewsBoolean 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

Returns:

  • (Boolean)


253
254
255
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 253

def allow_stale_reviews
  @allow_stale_reviews
end

#annotationsHash<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

Returns:

  • (Hash<String,String>)


261
262
263
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 261

def annotations
  @annotations
end

#create_timeString

Output only. Create timestamp. Corresponds to the JSON property createTime

Returns:

  • (String)


266
267
268
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 266

def create_time
  @create_time
end

#disabledBoolean Also known as: disabled?

Optional. Determines if the branch rule is disabled or not. Corresponds to the JSON property disabled

Returns:

  • (Boolean)


271
272
273
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 271

def disabled
  @disabled
end

#etagString

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

Returns:

  • (String)


279
280
281
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 279

def etag
  @etag
end

#include_patternString

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`

Returns:

  • (String)


286
287
288
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 286

def include_pattern
  @include_pattern
end

#minimum_approvals_countFixnum

Optional. The minimum number of approvals required for the branch rule to be matched. Corresponds to the JSON property minimumApprovalsCount

Returns:

  • (Fixnum)


292
293
294
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 292

def minimum_approvals_count
  @minimum_approvals_count
end

#minimum_reviews_countFixnum

Optional. The minimum number of reviews required for the branch rule to be matched. Corresponds to the JSON property minimumReviewsCount

Returns:

  • (Fixnum)


298
299
300
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 298

def minimum_reviews_count
  @minimum_reviews_count
end

#nameString

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`

Returns:

  • (String)


305
306
307
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 305

def name
  @name
end

#require_comments_resolvedBoolean Also known as: require_comments_resolved?

Optional. Determines if require comments resolved before merging to the branch. Corresponds to the JSON property requireCommentsResolved

Returns:

  • (Boolean)


310
311
312
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 310

def require_comments_resolved
  @require_comments_resolved
end

#require_linear_historyBoolean Also known as: require_linear_history?

Optional. Determines if require linear history before merging to the branch. Corresponds to the JSON property requireLinearHistory

Returns:

  • (Boolean)


316
317
318
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 316

def require_linear_history
  @require_linear_history
end

#require_pull_requestBoolean Also known as: require_pull_request?

Optional. Determines if the branch rule requires a pull request or not. Corresponds to the JSON property requirePullRequest

Returns:

  • (Boolean)


322
323
324
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 322

def require_pull_request
  @require_pull_request
end

#required_status_checksArray<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

#uidString

Output only. Unique identifier of the repository. Corresponds to the JSON property uid

Returns:

  • (String)


333
334
335
# File 'lib/google/apis/securesourcemanager_v1/classes.rb', line 333

def uid
  @uid
end

#update_timeString

Output only. Update timestamp. Corresponds to the JSON property updateTime

Returns:

  • (String)


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