Class: AWSCDK::CodeBuild::FilterGroup

Inherits:
Jsii::Object
  • Object
show all
Defined in:
code_build/filter_group.rb

Overview

An object that represents a group of filter conditions for a webhook.

Every condition in a given FilterGroup must be true in order for the whole group to be true. You construct instances of it by calling the #inEventOf static factory method, and then calling various and_xyz instance methods to create modified instances of it (this class is immutable).

You pass instances of this class to the webhook_filters property when constructing a source.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ FilterGroup

Returns a new instance of FilterGroup.

Raises:

  • (NoMethodError)


15
16
17
# File 'code_build/filter_group.rb', line 15

def initialize(*args)
  raise NoMethodError, "aws-cdk-lib.aws_codebuild.FilterGroup does not have a visible constructor; use the provided factory methods"
end

Class Method Details

.in_event_of(*actions) ⇒ AWSCDK::CodeBuild::FilterGroup

Creates a new event FilterGroup that triggers on any of the provided actions.

Parameters:

Returns:

  • (AWSCDK::CodeBuild::FilterGroup)


46
47
48
49
50
51
# File 'code_build/filter_group.rb', line 46

def self.in_event_of(*actions)
  actions.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLkV2ZW50QWN0aW9uIn0=")), "actions[#{index}]")
  end
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_codebuild.FilterGroup", "inEventOf", [*actions])
end

.jsii_overridable_methodsObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'code_build/filter_group.rb', line 19

def self.jsii_overridable_methods
  {
    :and_actor_account_is => { kind: :method, name: "andActorAccountIs", is_optional: false },
    :and_actor_account_is_not => { kind: :method, name: "andActorAccountIsNot", is_optional: false },
    :and_base_branch_is => { kind: :method, name: "andBaseBranchIs", is_optional: false },
    :and_base_branch_is_not => { kind: :method, name: "andBaseBranchIsNot", is_optional: false },
    :and_base_ref_is => { kind: :method, name: "andBaseRefIs", is_optional: false },
    :and_base_ref_is_not => { kind: :method, name: "andBaseRefIsNot", is_optional: false },
    :and_branch_is => { kind: :method, name: "andBranchIs", is_optional: false },
    :and_branch_is_not => { kind: :method, name: "andBranchIsNot", is_optional: false },
    :and_commit_message_is => { kind: :method, name: "andCommitMessageIs", is_optional: false },
    :and_commit_message_is_not => { kind: :method, name: "andCommitMessageIsNot", is_optional: false },
    :and_file_path_is => { kind: :method, name: "andFilePathIs", is_optional: false },
    :and_file_path_is_not => { kind: :method, name: "andFilePathIsNot", is_optional: false },
    :and_head_ref_is => { kind: :method, name: "andHeadRefIs", is_optional: false },
    :and_head_ref_is_not => { kind: :method, name: "andHeadRefIsNot", is_optional: false },
    :and_repository_name_is => { kind: :method, name: "andRepositoryNameIs", is_optional: false },
    :and_repository_name_is_not => { kind: :method, name: "andRepositoryNameIsNot", is_optional: false },
    :and_tag_is => { kind: :method, name: "andTagIs", is_optional: false },
    :and_tag_is_not => { kind: :method, name: "andTagIsNot", is_optional: false },
  }
end

Instance Method Details

#and_actor_account_is(pattern) ⇒ AWSCDK::CodeBuild::FilterGroup

Create a new FilterGroup with an added condition: the account ID of the actor initiating the event must match the given pattern.

Parameters:

  • pattern (String)

    a regular expression.

Returns:

  • (AWSCDK::CodeBuild::FilterGroup)


57
58
59
60
# File 'code_build/filter_group.rb', line 57

def (pattern)
  Jsii::Type.check_type(pattern, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "pattern")
  jsii_call_method("andActorAccountIs", [pattern])
end

#and_actor_account_is_not(pattern) ⇒ AWSCDK::CodeBuild::FilterGroup

Create a new FilterGroup with an added condition: the account ID of the actor initiating the event must not match the given pattern.

Parameters:

  • pattern (String)

    a regular expression.

Returns:

  • (AWSCDK::CodeBuild::FilterGroup)


66
67
68
69
# File 'code_build/filter_group.rb', line 66

def (pattern)
  Jsii::Type.check_type(pattern, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "pattern")
  jsii_call_method("andActorAccountIsNot", [pattern])
end

#and_base_branch_is(branch_name) ⇒ AWSCDK::CodeBuild::FilterGroup

Create a new FilterGroup with an added condition: the Pull Request that is the source of the event must target the given base branch.

Note that you cannot use this method if this Group contains the PUSH event action.

Parameters:

  • branch_name (String)

    the name of the branch (can be a regular expression).

Returns:

  • (AWSCDK::CodeBuild::FilterGroup)


77
78
79
80
# File 'code_build/filter_group.rb', line 77

def and_base_branch_is(branch_name)
  Jsii::Type.check_type(branch_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "branchName")
  jsii_call_method("andBaseBranchIs", [branch_name])
end

#and_base_branch_is_not(branch_name) ⇒ AWSCDK::CodeBuild::FilterGroup

Create a new FilterGroup with an added condition: the Pull Request that is the source of the event must not target the given base branch.

Note that you cannot use this method if this Group contains the PUSH event action.

Parameters:

  • branch_name (String)

    the name of the branch (can be a regular expression).

Returns:

  • (AWSCDK::CodeBuild::FilterGroup)


88
89
90
91
# File 'code_build/filter_group.rb', line 88

def and_base_branch_is_not(branch_name)
  Jsii::Type.check_type(branch_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "branchName")
  jsii_call_method("andBaseBranchIsNot", [branch_name])
end

#and_base_ref_is(pattern) ⇒ AWSCDK::CodeBuild::FilterGroup

Create a new FilterGroup with an added condition: the Pull Request that is the source of the event must target the given Git reference.

Note that you cannot use this method if this Group contains the PUSH event action.

Parameters:

  • pattern (String)

    a regular expression.

Returns:

  • (AWSCDK::CodeBuild::FilterGroup)


99
100
101
102
# File 'code_build/filter_group.rb', line 99

def and_base_ref_is(pattern)
  Jsii::Type.check_type(pattern, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "pattern")
  jsii_call_method("andBaseRefIs", [pattern])
end

#and_base_ref_is_not(pattern) ⇒ AWSCDK::CodeBuild::FilterGroup

Create a new FilterGroup with an added condition: the Pull Request that is the source of the event must not target the given Git reference.

Note that you cannot use this method if this Group contains the PUSH event action.

Parameters:

  • pattern (String)

    a regular expression.

Returns:

  • (AWSCDK::CodeBuild::FilterGroup)


110
111
112
113
# File 'code_build/filter_group.rb', line 110

def and_base_ref_is_not(pattern)
  Jsii::Type.check_type(pattern, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "pattern")
  jsii_call_method("andBaseRefIsNot", [pattern])
end

#and_branch_is(branch_name) ⇒ AWSCDK::CodeBuild::FilterGroup

Create a new FilterGroup with an added condition: the event must affect the given branch.

Parameters:

  • branch_name (String)

    the name of the branch (can be a regular expression).

Returns:

  • (AWSCDK::CodeBuild::FilterGroup)


119
120
121
122
# File 'code_build/filter_group.rb', line 119

def and_branch_is(branch_name)
  Jsii::Type.check_type(branch_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "branchName")
  jsii_call_method("andBranchIs", [branch_name])
end

#and_branch_is_not(branch_name) ⇒ AWSCDK::CodeBuild::FilterGroup

Create a new FilterGroup with an added condition: the event must not affect the given branch.

Parameters:

  • branch_name (String)

    the name of the branch (can be a regular expression).

Returns:

  • (AWSCDK::CodeBuild::FilterGroup)


128
129
130
131
# File 'code_build/filter_group.rb', line 128

def and_branch_is_not(branch_name)
  Jsii::Type.check_type(branch_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "branchName")
  jsii_call_method("andBranchIsNot", [branch_name])
end

#and_commit_message_is(commit_message) ⇒ AWSCDK::CodeBuild::FilterGroup

Create a new FilterGroup with an added condition: the event must affect a head commit with the given message.

Parameters:

  • commit_message (String)

    the commit message (can be a regular expression).

Returns:

  • (AWSCDK::CodeBuild::FilterGroup)


137
138
139
140
# File 'code_build/filter_group.rb', line 137

def and_commit_message_is(commit_message)
  Jsii::Type.check_type(commit_message, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "commitMessage")
  jsii_call_method("andCommitMessageIs", [commit_message])
end

#and_commit_message_is_not(commit_message) ⇒ AWSCDK::CodeBuild::FilterGroup

Create a new FilterGroup with an added condition: the event must not affect a head commit with the given message.

Parameters:

  • commit_message (String)

    the commit message (can be a regular expression).

Returns:

  • (AWSCDK::CodeBuild::FilterGroup)


146
147
148
149
# File 'code_build/filter_group.rb', line 146

def and_commit_message_is_not(commit_message)
  Jsii::Type.check_type(commit_message, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "commitMessage")
  jsii_call_method("andCommitMessageIsNot", [commit_message])
end

#and_file_path_is(pattern) ⇒ AWSCDK::CodeBuild::FilterGroup

Create a new FilterGroup with an added condition: the push that is the source of the event must affect a file that matches the given pattern.

Note that you can only use this method if this Group contains only the PUSH event action, and only for GitHub, Bitbucket and GitHubEnterprise sources.

Parameters:

  • pattern (String)

    a regular expression.

Returns:

  • (AWSCDK::CodeBuild::FilterGroup)


158
159
160
161
# File 'code_build/filter_group.rb', line 158

def and_file_path_is(pattern)
  Jsii::Type.check_type(pattern, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "pattern")
  jsii_call_method("andFilePathIs", [pattern])
end

#and_file_path_is_not(pattern) ⇒ AWSCDK::CodeBuild::FilterGroup

Create a new FilterGroup with an added condition: the push that is the source of the event must not affect a file that matches the given pattern.

Note that you can only use this method if this Group contains only the PUSH event action, and only for GitHub, Bitbucket and GitHubEnterprise sources.

Parameters:

  • pattern (String)

    a regular expression.

Returns:

  • (AWSCDK::CodeBuild::FilterGroup)


170
171
172
173
# File 'code_build/filter_group.rb', line 170

def and_file_path_is_not(pattern)
  Jsii::Type.check_type(pattern, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "pattern")
  jsii_call_method("andFilePathIsNot", [pattern])
end

#and_head_ref_is(pattern) ⇒ AWSCDK::CodeBuild::FilterGroup

Create a new FilterGroup with an added condition: the event must affect a Git reference (ie., a branch or a tag) that matches the given pattern.

Parameters:

  • pattern (String)

    a regular expression.

Returns:

  • (AWSCDK::CodeBuild::FilterGroup)


179
180
181
182
# File 'code_build/filter_group.rb', line 179

def and_head_ref_is(pattern)
  Jsii::Type.check_type(pattern, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "pattern")
  jsii_call_method("andHeadRefIs", [pattern])
end

#and_head_ref_is_not(pattern) ⇒ AWSCDK::CodeBuild::FilterGroup

Create a new FilterGroup with an added condition: the event must not affect a Git reference (ie., a branch or a tag) that matches the given pattern.

Parameters:

  • pattern (String)

    a regular expression.

Returns:

  • (AWSCDK::CodeBuild::FilterGroup)


188
189
190
191
# File 'code_build/filter_group.rb', line 188

def and_head_ref_is_not(pattern)
  Jsii::Type.check_type(pattern, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "pattern")
  jsii_call_method("andHeadRefIsNot", [pattern])
end

#and_repository_name_is(pattern) ⇒ AWSCDK::CodeBuild::FilterGroup

Create a new FilterGroup with an added condition: the push that is the source of the event affect only a repository name that matches the given pattern.

Note that you can only use this method if this Group contains only the WORKFLOW_JOB_QUEUED event action, only for GitHub sources and only for organization webhook.

Parameters:

  • pattern (String)

    a regular expression.

Returns:

  • (AWSCDK::CodeBuild::FilterGroup)


200
201
202
203
# File 'code_build/filter_group.rb', line 200

def and_repository_name_is(pattern)
  Jsii::Type.check_type(pattern, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "pattern")
  jsii_call_method("andRepositoryNameIs", [pattern])
end

#and_repository_name_is_not(pattern) ⇒ AWSCDK::CodeBuild::FilterGroup

Create a new FilterGroup with an added condition: the push that is the source of the event must not affect a repository name that matches the given pattern.

Note that you can only use this method if this Group contains only the WORKFLOW_JOB_QUEUED event action, only for GitHub sources and only for organization webhook.

Parameters:

  • pattern (String)

    a regular expression.

Returns:

  • (AWSCDK::CodeBuild::FilterGroup)


212
213
214
215
# File 'code_build/filter_group.rb', line 212

def and_repository_name_is_not(pattern)
  Jsii::Type.check_type(pattern, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "pattern")
  jsii_call_method("andRepositoryNameIsNot", [pattern])
end

#and_tag_is(tag_name) ⇒ AWSCDK::CodeBuild::FilterGroup

Create a new FilterGroup with an added condition: the event must affect the given tag.

Parameters:

  • tag_name (String)

    the name of the tag (can be a regular expression).

Returns:

  • (AWSCDK::CodeBuild::FilterGroup)


221
222
223
224
# File 'code_build/filter_group.rb', line 221

def and_tag_is(tag_name)
  Jsii::Type.check_type(tag_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "tagName")
  jsii_call_method("andTagIs", [tag_name])
end

#and_tag_is_not(tag_name) ⇒ AWSCDK::CodeBuild::FilterGroup

Create a new FilterGroup with an added condition: the event must not affect the given tag.

Parameters:

  • tag_name (String)

    the name of the tag (can be a regular expression).

Returns:

  • (AWSCDK::CodeBuild::FilterGroup)


230
231
232
233
# File 'code_build/filter_group.rb', line 230

def and_tag_is_not(tag_name)
  Jsii::Type.check_type(tag_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "tagName")
  jsii_call_method("andTagIsNot", [tag_name])
end