Class FilterGroup
An object that represents a group of filter conditions for a webhook.
Inheritance
Namespace: Amazon.CDK.AWS.CodeBuild
Assembly: Amazon.CDK.AWS.CodeBuild.dll
Syntax (csharp)
public class FilterGroup : DeputyBase
Syntax (vb)
Public Class FilterGroup
Inherits DeputyBase
Remarks
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 {@link #inEventOf} static factory method,
and then calling various andXyz
instance methods to create modified instances of it
(this class is immutable).
You pass instances of this class to the webhookFilters
property when constructing a source.
ExampleMetadata: infused
Examples
var gitHubSource = Source.GitHub(new GitHubSourceProps {
Owner = "awslabs",
Repo = "aws-cdk",
Webhook = true, // optional, default: true if `webhookFilters` were provided, false otherwise
WebhookTriggersBatchBuild = true, // optional, default is false
WebhookFilters = new [] { FilterGroup.InEventOf(EventAction.PUSH).AndBranchIs("master").AndCommitMessageIs("the commit message") }
});
Synopsis
Constructors
FilterGroup(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
FilterGroup(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
AndActorAccountIs(String) | Create a new FilterGroup with an added condition: the account ID of the actor initiating the event must match the given pattern. |
AndActorAccountIsNot(String) | Create a new FilterGroup with an added condition: the account ID of the actor initiating the event must not match the given pattern. |
AndBaseBranchIs(String) | Create a new FilterGroup with an added condition: the Pull Request that is the source of the event must target the given base branch. |
AndBaseBranchIsNot(String) | 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. |
AndBaseRefIs(String) | Create a new FilterGroup with an added condition: the Pull Request that is the source of the event must target the given Git reference. |
AndBaseRefIsNot(String) | 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. |
AndBranchIs(String) | Create a new FilterGroup with an added condition: the event must affect the given branch. |
AndBranchIsNot(String) | Create a new FilterGroup with an added condition: the event must not affect the given branch. |
AndCommitMessageIs(String) | Create a new FilterGroup with an added condition: the event must affect a head commit with the given message. |
AndCommitMessageIsNot(String) | Create a new FilterGroup with an added condition: the event must not affect a head commit with the given message. |
AndFilePathIs(String) | 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. |
AndFilePathIsNot(String) | 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. |
AndHeadRefIs(String) | 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. |
AndHeadRefIsNot(String) | 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. |
AndTagIs(String) | Create a new FilterGroup with an added condition: the event must affect the given tag. |
AndTagIsNot(String) | Create a new FilterGroup with an added condition: the event must not affect the given tag. |
InEventOf(EventAction[]) | Creates a new event FilterGroup that triggers on any of the provided actions. |
Constructors
FilterGroup(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected FilterGroup(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
FilterGroup(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected FilterGroup(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
AndActorAccountIs(String)
Create a new FilterGroup with an added condition: the account ID of the actor initiating the event must match the given pattern.
public virtual FilterGroup AndActorAccountIs(string pattern)
Parameters
- pattern System.String
a regular expression.
Returns
AndActorAccountIsNot(String)
Create a new FilterGroup with an added condition: the account ID of the actor initiating the event must not match the given pattern.
public virtual FilterGroup AndActorAccountIsNot(string pattern)
Parameters
- pattern System.String
a regular expression.
Returns
AndBaseBranchIs(String)
Create a new FilterGroup with an added condition: the Pull Request that is the source of the event must target the given base branch.
public virtual FilterGroup AndBaseBranchIs(string branchName)
Parameters
- branchName System.String
the name of the branch (can be a regular expression).
Returns
Remarks
Note that you cannot use this method if this Group contains the PUSH
event action.
AndBaseBranchIsNot(String)
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.
public virtual FilterGroup AndBaseBranchIsNot(string branchName)
Parameters
- branchName System.String
the name of the branch (can be a regular expression).
Returns
Remarks
Note that you cannot use this method if this Group contains the PUSH
event action.
AndBaseRefIs(String)
Create a new FilterGroup with an added condition: the Pull Request that is the source of the event must target the given Git reference.
public virtual FilterGroup AndBaseRefIs(string pattern)
Parameters
- pattern System.String
a regular expression.
Returns
Remarks
Note that you cannot use this method if this Group contains the PUSH
event action.
AndBaseRefIsNot(String)
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.
public virtual FilterGroup AndBaseRefIsNot(string pattern)
Parameters
- pattern System.String
a regular expression.
Returns
Remarks
Note that you cannot use this method if this Group contains the PUSH
event action.
AndBranchIs(String)
Create a new FilterGroup with an added condition: the event must affect the given branch.
public virtual FilterGroup AndBranchIs(string branchName)
Parameters
- branchName System.String
the name of the branch (can be a regular expression).
Returns
AndBranchIsNot(String)
Create a new FilterGroup with an added condition: the event must not affect the given branch.
public virtual FilterGroup AndBranchIsNot(string branchName)
Parameters
- branchName System.String
the name of the branch (can be a regular expression).
Returns
AndCommitMessageIs(String)
Create a new FilterGroup with an added condition: the event must affect a head commit with the given message.
public virtual FilterGroup AndCommitMessageIs(string commitMessage)
Parameters
- commitMessage System.String
the commit message (can be a regular expression).
Returns
AndCommitMessageIsNot(String)
Create a new FilterGroup with an added condition: the event must not affect a head commit with the given message.
public virtual FilterGroup AndCommitMessageIsNot(string commitMessage)
Parameters
- commitMessage System.String
the commit message (can be a regular expression).
Returns
AndFilePathIs(String)
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.
public virtual FilterGroup AndFilePathIs(string pattern)
Parameters
- pattern System.String
a regular expression.
Returns
Remarks
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.
AndFilePathIsNot(String)
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.
public virtual FilterGroup AndFilePathIsNot(string pattern)
Parameters
- pattern System.String
a regular expression.
Returns
Remarks
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.
AndHeadRefIs(String)
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.
public virtual FilterGroup AndHeadRefIs(string pattern)
Parameters
- pattern System.String
a regular expression.
Returns
AndHeadRefIsNot(String)
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.
public virtual FilterGroup AndHeadRefIsNot(string pattern)
Parameters
- pattern System.String
a regular expression.
Returns
AndTagIs(String)
Create a new FilterGroup with an added condition: the event must affect the given tag.
public virtual FilterGroup AndTagIs(string tagName)
Parameters
- tagName System.String
the name of the tag (can be a regular expression).
Returns
AndTagIsNot(String)
Create a new FilterGroup with an added condition: the event must not affect the given tag.
public virtual FilterGroup AndTagIsNot(string tagName)
Parameters
- tagName System.String
the name of the tag (can be a regular expression).
Returns
InEventOf(EventAction[])
Creates a new event FilterGroup that triggers on any of the provided actions.
public static FilterGroup InEventOf(params EventAction[] actions)
Parameters
- actions EventAction[]
the actions to trigger the webhook on.
Returns