Class: AWSCDK::Codecommit::Repository

Inherits:
Resource
  • Object
show all
Includes:
IRepository
Defined in:
codecommit/repository.rb

Overview

Provides a CodeCommit Repository.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope, id, props) ⇒ Repository

Returns a new instance of Repository.

Parameters:



12
13
14
15
16
17
18
# File 'codecommit/repository.rb', line 12

def initialize(scope, id, props)
  props = props.is_a?(Hash) ? ::AWSCDK::Codecommit::RepositoryProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWNvbW1pdC5SZXBvc2l0b3J5UHJvcHMifQ==")), "props")
  Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props)
end

Class Method Details

.from_repository_arn(scope, id, repository_arn) ⇒ AWSCDK::Codecommit::IRepository

Imports a codecommit repository.

Parameters:

  • scope (Constructs::Construct)
  • id (String)
  • repository_arn (String)

    (e.g. arn:aws:codecommit:us-east-1:123456789012:MyDemoRepo).

Returns:



73
74
75
76
77
78
# File 'codecommit/repository.rb', line 73

def self.from_repository_arn(scope, id, repository_arn)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(repository_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "repositoryArn")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_codecommit.Repository", "fromRepositoryArn", [scope, id, repository_arn])
end

.from_repository_name(scope, id, repository_name) ⇒ AWSCDK::Codecommit::IRepository

Parameters:

  • scope (Constructs::Construct)
  • id (String)
  • repository_name (String)

Returns:



84
85
86
87
88
89
# File 'codecommit/repository.rb', line 84

def self.from_repository_name(scope, id, repository_name)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(repository_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "repositoryName")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_codecommit.Repository", "fromRepositoryName", [scope, id, repository_name])
end

.jsii_overridable_methodsObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'codecommit/repository.rb', line 20

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :env => { kind: :property, name: "env", is_optional: false },
    :physical_name => { kind: :property, name: "physicalName", is_optional: false },
    :stack => { kind: :property, name: "stack", is_optional: false },
    :grants => { kind: :property, name: "grants", is_optional: false },
    :repository_arn => { kind: :property, name: "repositoryArn", is_optional: false },
    :repository_clone_url_grc => { kind: :property, name: "repositoryCloneUrlGrc", is_optional: false },
    :repository_clone_url_http => { kind: :property, name: "repositoryCloneUrlHttp", is_optional: false },
    :repository_clone_url_ssh => { kind: :property, name: "repositoryCloneUrlSsh", is_optional: false },
    :repository_name => { kind: :property, name: "repositoryName", is_optional: false },
    :repository_ref => { kind: :property, name: "repositoryRef", is_optional: false },
    :to_string => { kind: :method, name: "toString", is_optional: false },
    :with => { kind: :method, name: "with", is_optional: false },
    :apply_cross_stack_reference_strength => { kind: :method, name: "applyCrossStackReferenceStrength", is_optional: false },
    :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false },
    :generate_physical_name => { kind: :method, name: "generatePhysicalName", is_optional: false },
    :get_resource_arn_attribute => { kind: :method, name: "getResourceArnAttribute", is_optional: false },
    :get_resource_name_attribute => { kind: :method, name: "getResourceNameAttribute", is_optional: false },
    :bind_as_notification_rule_source => { kind: :method, name: "bindAsNotificationRuleSource", is_optional: false },
    :grant => { kind: :method, name: "grant", is_optional: false },
    :grant_pull => { kind: :method, name: "grantPull", is_optional: false },
    :grant_pull_push => { kind: :method, name: "grantPullPush", is_optional: false },
    :grant_read => { kind: :method, name: "grantRead", is_optional: false },
    :notifiy_on_pull_request_merged => { kind: :method, name: "notifiyOnPullRequestMerged", is_optional: false },
    :notify => { kind: :method, name: "notify", is_optional: false },
    :notify_on => { kind: :method, name: "notifyOn", is_optional: false },
    :notify_on_approval_rule_overridden => { kind: :method, name: "notifyOnApprovalRuleOverridden", is_optional: false },
    :notify_on_approval_status_changed => { kind: :method, name: "notifyOnApprovalStatusChanged", is_optional: false },
    :notify_on_branch_or_tag_created => { kind: :method, name: "notifyOnBranchOrTagCreated", is_optional: false },
    :notify_on_branch_or_tag_deleted => { kind: :method, name: "notifyOnBranchOrTagDeleted", is_optional: false },
    :notify_on_pull_request_comment => { kind: :method, name: "notifyOnPullRequestComment", is_optional: false },
    :notify_on_pull_request_created => { kind: :method, name: "notifyOnPullRequestCreated", is_optional: false },
    :notify_on_pull_request_merged => { kind: :method, name: "notifyOnPullRequestMerged", is_optional: false },
    :on_comment_on_commit => { kind: :method, name: "onCommentOnCommit", is_optional: false },
    :on_comment_on_pull_request => { kind: :method, name: "onCommentOnPullRequest", is_optional: false },
    :on_commit => { kind: :method, name: "onCommit", is_optional: false },
    :on_event => { kind: :method, name: "onEvent", is_optional: false },
    :on_pull_request_state_change => { kind: :method, name: "onPullRequestStateChange", is_optional: false },
    :on_reference_created => { kind: :method, name: "onReferenceCreated", is_optional: false },
    :on_reference_deleted => { kind: :method, name: "onReferenceDeleted", is_optional: false },
    :on_reference_updated => { kind: :method, name: "onReferenceUpdated", is_optional: false },
    :on_state_change => { kind: :method, name: "onStateChange", is_optional: false },
  }
end

.PROPERTY_INJECTION_IDString

Uniquely identifies this class.

Returns:

  • (String)


137
138
139
# File 'codecommit/repository.rb', line 137

def self.PROPERTY_INJECTION_ID()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_codecommit.Repository", "PROPERTY_INJECTION_ID")
end

Instance Method Details

#apply_cross_stack_reference_strength(strength) ⇒ void

This method returns an undefined value.

Override the cross-stack reference strength for this resource.

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.

Parameters:



228
229
230
231
# File 'codecommit/repository.rb', line 228

def apply_cross_stack_reference_strength(strength)
  Jsii::Type.check_type(strength, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZWZlcmVuY2VTdHJlbmd0aCJ9")), "strength")
  jsii_call_method("applyCrossStackReferenceStrength", [strength])
end

#apply_removal_policy(policy) ⇒ void

This method returns an undefined value.

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters:



245
246
247
248
# File 'codecommit/repository.rb', line 245

def apply_removal_policy(policy)
  Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy")
  jsii_call_method("applyRemovalPolicy", [policy])
end

#bind_as_notification_rule_source(_scope) ⇒ AWSCDK::CodeStarNotifications::NotificationRuleSourceConfig

Returns a source configuration for notification rule.

Parameters:

  • _scope (Constructs::Construct)

Returns:



289
290
291
292
# File 'codecommit/repository.rb', line 289

def bind_as_notification_rule_source(_scope)
  Jsii::Type.check_type(_scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "_scope")
  jsii_call_method("bindAsNotificationRuleSource", [_scope])
end

#envAWSCDK::Interfaces::ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.



109
110
111
# File 'codecommit/repository.rb', line 109

def env()
  jsii_get_property("env")
end

#generate_physical_nameString

Returns:

  • (String)


251
252
253
# File 'codecommit/repository.rb', line 251

def generate_physical_name()
  jsii_call_method("generatePhysicalName", [])
end

#get_resource_arn_attribute(arn_attr, arn_components) ⇒ String

Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. bucket.bucketArn).

Normally, this token will resolve to arn_attr, but if the resource is referenced across environments, arn_components will be used to synthesize a concrete ARN with the resource's physical name. Make sure to reference this.physicalName in arn_components.

Parameters:

  • arn_attr (String)

    The CFN attribute which resolves to the ARN of the resource.

  • arn_components (AWSCDK::ARNComponents)

    The format of the ARN of this resource.

Returns:

  • (String)


265
266
267
268
269
270
# File 'codecommit/repository.rb', line 265

def get_resource_arn_attribute(arn_attr, arn_components)
  Jsii::Type.check_type(arn_attr, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "arnAttr")
  arn_components = arn_components.is_a?(Hash) ? ::AWSCDK::ARNComponents.new(**arn_components.transform_keys(&:to_sym)) : arn_components
  Jsii::Type.check_type(arn_components, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5Bcm5Db21wb25lbnRzIn0=")), "arnComponents")
  jsii_call_method("getResourceArnAttribute", [arn_attr, arn_components])
end

#get_resource_name_attribute(name_attr) ⇒ String

Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. bucket.bucketName).

Normally, this token will resolve to name_attr, but if the resource is referenced across environments, it will be resolved to this.physicalName, which will be a concrete name.

Parameters:

  • name_attr (String)

    The CFN attribute which resolves to the resource's name.

Returns:

  • (String)


280
281
282
283
# File 'codecommit/repository.rb', line 280

def get_resource_name_attribute(name_attr)
  Jsii::Type.check_type(name_attr, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "nameAttr")
  jsii_call_method("getResourceNameAttribute", [name_attr])
end

#grant(grantee, *actions) ⇒ AWSCDK::IAM::Grant

[disable-awslint:no-grants].

Parameters:

Returns:



299
300
301
302
303
304
305
# File 'codecommit/repository.rb', line 299

def grant(grantee, *actions)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  actions.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "actions[#{index}]")
  end
  jsii_call_method("grant", [grantee, *actions])
end

#grant_pull(grantee) ⇒ AWSCDK::IAM::Grant

The use of this method is discouraged. Please use grants.pull() instead.

[disable-awslint:no-grants]

Parameters:

Returns:



313
314
315
316
# File 'codecommit/repository.rb', line 313

def grant_pull(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantPull", [grantee])
end

#grant_pull_push(grantee) ⇒ AWSCDK::IAM::Grant

The use of this method is discouraged. Please use grants.pullPush() instead.

[disable-awslint:no-grants]

Parameters:

Returns:



324
325
326
327
# File 'codecommit/repository.rb', line 324

def grant_pull_push(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantPullPush", [grantee])
end

#grant_read(grantee) ⇒ AWSCDK::IAM::Grant

The use of this method is discouraged. Please use grants.read() instead.

[disable-awslint:no-grants]

Parameters:

Returns:



335
336
337
338
# File 'codecommit/repository.rb', line 335

def grant_read(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantRead", [grantee])
end

#grantsAWSCDK::Codecommit::RepositoryGrants

Collection of grant methods for a Repository.



144
145
146
# File 'codecommit/repository.rb', line 144

def grants()
  jsii_get_property("grants")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


94
95
96
# File 'codecommit/repository.rb', line 94

def node()
  jsii_get_property("node")
end

#notifiy_on_pull_request_merged(id, target, options = nil) ⇒ AWSCDK::CodeStarNotifications::INotificationRule

Defines a CodeStar Notification rule which triggers when a pull request is merged.



346
347
348
349
350
351
352
# File 'codecommit/repository.rb', line 346

def notifiy_on_pull_request_merged(id, target, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLklOb3RpZmljYXRpb25SdWxlVGFyZ2V0In0=")), "target")
  options = options.is_a?(Hash) ? ::AWSCDK::CodeStarNotifications::NotificationRuleOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLk5vdGlmaWNhdGlvblJ1bGVPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("notifiyOnPullRequestMerged", [id, target, options])
end

#notify(arn, options = nil) ⇒ AWSCDK::Codecommit::Repository

Create a trigger to notify another service to run actions on repository events.

Parameters:

Returns:

  • (AWSCDK::Codecommit::Repository)


359
360
361
362
363
364
# File 'codecommit/repository.rb', line 359

def notify(arn, options = nil)
  Jsii::Type.check_type(arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "arn")
  options = options.is_a?(Hash) ? ::AWSCDK::Codecommit::RepositoryTriggerOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWNvbW1pdC5SZXBvc2l0b3J5VHJpZ2dlck9wdGlvbnMifQ==")), "options") unless options.nil?
  jsii_call_method("notify", [arn, options])
end

#notify_on(id, target, options) ⇒ AWSCDK::CodeStarNotifications::INotificationRule

Defines a CodeStar Notification rule triggered when the project events specified by you are emitted. Similar to onEvent API.

You can also use the methods to define rules for the specific event emitted. e.g. notify_on_pull_request_created.



375
376
377
378
379
380
381
# File 'codecommit/repository.rb', line 375

def notify_on(id, target, options)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLklOb3RpZmljYXRpb25SdWxlVGFyZ2V0In0=")), "target")
  options = options.is_a?(Hash) ? ::AWSCDK::Codecommit::RepositoryNotifyOnOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWNvbW1pdC5SZXBvc2l0b3J5Tm90aWZ5T25PcHRpb25zIn0=")), "options")
  jsii_call_method("notifyOn", [id, target, options])
end

#notify_on_approval_rule_overridden(id, target, options = nil) ⇒ AWSCDK::CodeStarNotifications::INotificationRule

Defines a CodeStar Notification rule which triggers when an approval rule is overridden.



389
390
391
392
393
394
395
# File 'codecommit/repository.rb', line 389

def notify_on_approval_rule_overridden(id, target, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLklOb3RpZmljYXRpb25SdWxlVGFyZ2V0In0=")), "target")
  options = options.is_a?(Hash) ? ::AWSCDK::CodeStarNotifications::NotificationRuleOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLk5vdGlmaWNhdGlvblJ1bGVPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("notifyOnApprovalRuleOverridden", [id, target, options])
end

#notify_on_approval_status_changed(id, target, options = nil) ⇒ AWSCDK::CodeStarNotifications::INotificationRule

Defines a CodeStar Notification rule which triggers when an approval status is changed.



403
404
405
406
407
408
409
# File 'codecommit/repository.rb', line 403

def notify_on_approval_status_changed(id, target, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLklOb3RpZmljYXRpb25SdWxlVGFyZ2V0In0=")), "target")
  options = options.is_a?(Hash) ? ::AWSCDK::CodeStarNotifications::NotificationRuleOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLk5vdGlmaWNhdGlvblJ1bGVPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("notifyOnApprovalStatusChanged", [id, target, options])
end

#notify_on_branch_or_tag_created(id, target, options = nil) ⇒ AWSCDK::CodeStarNotifications::INotificationRule

Defines a CodeStar Notification rule which triggers when a new branch or tag is created.



417
418
419
420
421
422
423
# File 'codecommit/repository.rb', line 417

def notify_on_branch_or_tag_created(id, target, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLklOb3RpZmljYXRpb25SdWxlVGFyZ2V0In0=")), "target")
  options = options.is_a?(Hash) ? ::AWSCDK::CodeStarNotifications::NotificationRuleOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLk5vdGlmaWNhdGlvblJ1bGVPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("notifyOnBranchOrTagCreated", [id, target, options])
end

#notify_on_branch_or_tag_deleted(id, target, options = nil) ⇒ AWSCDK::CodeStarNotifications::INotificationRule

Defines a CodeStar Notification rule which triggers when a branch or tag is deleted.



431
432
433
434
435
436
437
# File 'codecommit/repository.rb', line 431

def notify_on_branch_or_tag_deleted(id, target, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLklOb3RpZmljYXRpb25SdWxlVGFyZ2V0In0=")), "target")
  options = options.is_a?(Hash) ? ::AWSCDK::CodeStarNotifications::NotificationRuleOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLk5vdGlmaWNhdGlvblJ1bGVPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("notifyOnBranchOrTagDeleted", [id, target, options])
end

#notify_on_pull_request_comment(id, target, options = nil) ⇒ AWSCDK::CodeStarNotifications::INotificationRule

Defines a CodeStar Notification rule which triggers when a comment is made on a pull request.



445
446
447
448
449
450
451
# File 'codecommit/repository.rb', line 445

def notify_on_pull_request_comment(id, target, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLklOb3RpZmljYXRpb25SdWxlVGFyZ2V0In0=")), "target")
  options = options.is_a?(Hash) ? ::AWSCDK::CodeStarNotifications::NotificationRuleOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLk5vdGlmaWNhdGlvblJ1bGVPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("notifyOnPullRequestComment", [id, target, options])
end

#notify_on_pull_request_created(id, target, options = nil) ⇒ AWSCDK::CodeStarNotifications::INotificationRule

Defines a CodeStar Notification rule which triggers when a pull request is created.



459
460
461
462
463
464
465
# File 'codecommit/repository.rb', line 459

def notify_on_pull_request_created(id, target, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLklOb3RpZmljYXRpb25SdWxlVGFyZ2V0In0=")), "target")
  options = options.is_a?(Hash) ? ::AWSCDK::CodeStarNotifications::NotificationRuleOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLk5vdGlmaWNhdGlvblJ1bGVPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("notifyOnPullRequestCreated", [id, target, options])
end

#notify_on_pull_request_merged(id, target, options = nil) ⇒ AWSCDK::CodeStarNotifications::INotificationRule

Defines a CodeStar Notification rule which triggers when a pull request is merged.



473
474
475
476
477
478
479
# File 'codecommit/repository.rb', line 473

def notify_on_pull_request_merged(id, target, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLklOb3RpZmljYXRpb25SdWxlVGFyZ2V0In0=")), "target")
  options = options.is_a?(Hash) ? ::AWSCDK::CodeStarNotifications::NotificationRuleOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXN0YXJub3RpZmljYXRpb25zLk5vdGlmaWNhdGlvblJ1bGVPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("notifyOnPullRequestMerged", [id, target, options])
end

#on_comment_on_commit(id, options = nil) ⇒ AWSCDK::Events::Rule

Defines a CloudWatch event rule which triggers when a comment is made on a commit.

Parameters:

Returns:



486
487
488
489
490
491
# File 'codecommit/repository.rb', line 486

def on_comment_on_commit(id, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::Events::OnEventOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLk9uRXZlbnRPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("onCommentOnCommit", [id, options])
end

#on_comment_on_pull_request(id, options = nil) ⇒ AWSCDK::Events::Rule

Defines a CloudWatch event rule which triggers when a comment is made on a pull request.

Parameters:

Returns:



498
499
500
501
502
503
# File 'codecommit/repository.rb', line 498

def on_comment_on_pull_request(id, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::Events::OnEventOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLk9uRXZlbnRPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("onCommentOnPullRequest", [id, options])
end

#on_commit(id, options = nil) ⇒ AWSCDK::Events::Rule

Defines a CloudWatch event rule which triggers when a commit is pushed to a branch.

Parameters:

Returns:



510
511
512
513
514
515
# File 'codecommit/repository.rb', line 510

def on_commit(id, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::Codecommit::OnCommitOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWNvbW1pdC5PbkNvbW1pdE9wdGlvbnMifQ==")), "options") unless options.nil?
  jsii_call_method("onCommit", [id, options])
end

#on_event(id, options = nil) ⇒ AWSCDK::Events::Rule

Defines a CloudWatch event rule which triggers for repository events.

Use rule.addEventPattern(pattern) to specify a filter.

Parameters:

Returns:



525
526
527
528
529
530
# File 'codecommit/repository.rb', line 525

def on_event(id, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::Events::OnEventOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLk9uRXZlbnRPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("onEvent", [id, options])
end

#on_pull_request_state_change(id, options = nil) ⇒ AWSCDK::Events::Rule

Defines a CloudWatch event rule which triggers when a pull request state is changed.

Parameters:

Returns:



537
538
539
540
541
542
# File 'codecommit/repository.rb', line 537

def on_pull_request_state_change(id, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::Events::OnEventOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLk9uRXZlbnRPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("onPullRequestStateChange", [id, options])
end

#on_reference_created(id, options = nil) ⇒ AWSCDK::Events::Rule

Defines a CloudWatch event rule which triggers when a reference is created (i.e. a new branch/tag is created) to the repository.

Parameters:

Returns:



549
550
551
552
553
554
# File 'codecommit/repository.rb', line 549

def on_reference_created(id, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::Events::OnEventOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLk9uRXZlbnRPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("onReferenceCreated", [id, options])
end

#on_reference_deleted(id, options = nil) ⇒ AWSCDK::Events::Rule

Defines a CloudWatch event rule which triggers when a reference is delete (i.e. a branch/tag is deleted) from the repository.

Parameters:

Returns:



561
562
563
564
565
566
# File 'codecommit/repository.rb', line 561

def on_reference_deleted(id, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::Events::OnEventOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLk9uRXZlbnRPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("onReferenceDeleted", [id, options])
end

#on_reference_updated(id, options = nil) ⇒ AWSCDK::Events::Rule

Defines a CloudWatch event rule which triggers when a reference is updated (i.e. a commit is pushed to an existing or new branch) from the repository.

Parameters:

Returns:



573
574
575
576
577
578
# File 'codecommit/repository.rb', line 573

def on_reference_updated(id, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::Events::OnEventOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLk9uRXZlbnRPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("onReferenceUpdated", [id, options])
end

#on_state_change(id, options = nil) ⇒ AWSCDK::Events::Rule

Defines a CloudWatch event rule which triggers when a "CodeCommit Repository State Change" event occurs.

Parameters:

Returns:



585
586
587
588
589
590
# File 'codecommit/repository.rb', line 585

def on_state_change(id, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::Events::OnEventOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLk9uRXZlbnRPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("onStateChange", [id, options])
end

#physical_nameString

Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.

This value will resolve to one of the following:

  • a concrete value (e.g. "my-awesome-bucket")
  • undefined, when a name should be generated by CloudFormation
  • a concrete name generated automatically during synthesis, in cross-environment scenarios.

Returns:

  • (String)


123
124
125
# File 'codecommit/repository.rb', line 123

def physical_name()
  jsii_get_property("physicalName")
end

#repository_arnString

The ARN of this Repository.

Returns:

  • (String)


151
152
153
# File 'codecommit/repository.rb', line 151

def repository_arn()
  jsii_get_property("repositoryArn")
end

#repository_clone_url_grcString

The HTTPS (GRC) clone URL.

HTTPS (GRC) is the protocol to use with git-remote-codecommit (GRC).

It is the recommended method for supporting connections made with federated access, identity providers, and temporary credentials.

Returns:

  • (String)


163
164
165
# File 'codecommit/repository.rb', line 163

def repository_clone_url_grc()
  jsii_get_property("repositoryCloneUrlGrc")
end

#repository_clone_url_httpString

The HTTP clone URL.

Returns:

  • (String)


170
171
172
# File 'codecommit/repository.rb', line 170

def repository_clone_url_http()
  jsii_get_property("repositoryCloneUrlHttp")
end

#repository_clone_url_sshString

The SSH clone URL.

Returns:

  • (String)


177
178
179
# File 'codecommit/repository.rb', line 177

def repository_clone_url_ssh()
  jsii_get_property("repositoryCloneUrlSsh")
end

#repository_nameString

The human-visible name of this Repository.

Returns:

  • (String)


184
185
186
# File 'codecommit/repository.rb', line 184

def repository_name()
  jsii_get_property("repositoryName")
end

#repository_refAWSCDK::Interfaces::AWSCodecommit::RepositoryReference

A reference to a Repository resource.



191
192
193
# File 'codecommit/repository.rb', line 191

def repository_ref()
  jsii_get_property("repositoryRef")
end

#stackAWSCDK::Stack

The stack in which this resource is defined.

Returns:



130
131
132
# File 'codecommit/repository.rb', line 130

def stack()
  jsii_get_property("stack")
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


198
199
200
# File 'codecommit/repository.rb', line 198

def to_string()
  jsii_call_method("toString", [])
end

#with(*mixins) ⇒ Constructs::IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

Parameters:

  • mixins (Array<Constructs::IMixin>)

Returns:

  • (Constructs::IConstruct)


211
212
213
214
215
216
# File 'codecommit/repository.rb', line 211

def with(*mixins)
  mixins.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]")
  end
  jsii_call_method("with", [*mixins])
end