Class FilterGroup

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.codebuild.FilterGroup
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:14.080Z") @Stability(Stable) public class FilterGroup extends software.amazon.jsii.JsiiObject
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 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.

Example:

 ISource gitHubSource = Source.gitHub(GitHubSourceProps.builder()
         .owner("awslabs")
         .repo("aws-cdk")
         .webhook(true) // optional, default: true if `webhookFilters` were provided, false otherwise
         .webhookTriggersBatchBuild(true) // optional, default is false
         .webhookFilters(List.of(FilterGroup.inEventOf(EventAction.PUSH).andBranchIs("main").andCommitMessageIs("the commit message")))
         .build());
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    FilterGroup(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    FilterGroup(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Create a new FilterGroup with an added condition: the account ID of the actor initiating the event must match the given pattern.
    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 branchName)
    Create a new FilterGroup with an added condition: the Pull Request that is the source of the event must target the given base branch.
    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.
    Create a new FilterGroup with an added condition: the Pull Request that is the source of the event must target the given Git reference.
    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 branchName)
    Create a new FilterGroup with an added condition: the event must affect the given branch.
    andBranchIsNot(String branchName)
    Create a new FilterGroup with an added condition: the event must not affect the given branch.
    andCommitMessageIs(String commitMessage)
    Create a new FilterGroup with an added condition: the event must affect a head commit with the given message.
    Create a new FilterGroup with an added condition: the event must not affect a head commit with the given message.
    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.
    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.
    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.
    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 tagName)
    Create a new FilterGroup with an added condition: the event must affect the given tag.
    Create a new FilterGroup with an added condition: the event must not affect the given tag.
    inEventOf(@NotNull EventAction... actions)
    Creates a new event FilterGroup that triggers on any of the provided actions.

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • FilterGroup

      protected FilterGroup(software.amazon.jsii.JsiiObjectRef objRef)
    • FilterGroup

      protected FilterGroup(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
  • Method Details

    • inEventOf

      @Stability(Stable) @NotNull public static FilterGroup inEventOf(@NotNull @NotNull EventAction... actions)
      Creates a new event FilterGroup that triggers on any of the provided actions.

      Parameters:
      actions - the actions to trigger the webhook on. This parameter is required.
    • andActorAccountIs

      @Stability(Stable) @NotNull public FilterGroup andActorAccountIs(@NotNull String pattern)
      Create a new FilterGroup with an added condition: the account ID of the actor initiating the event must match the given pattern.

      Parameters:
      pattern - a regular expression. This parameter is required.
    • andActorAccountIsNot

      @Stability(Stable) @NotNull public FilterGroup andActorAccountIsNot(@NotNull String pattern)
      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 - a regular expression. This parameter is required.
    • andBaseBranchIs

      @Stability(Stable) @NotNull public FilterGroup andBaseBranchIs(@NotNull String branchName)
      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:
      branchName - the name of the branch (can be a regular expression). This parameter is required.
    • andBaseBranchIsNot

      @Stability(Stable) @NotNull public FilterGroup andBaseBranchIsNot(@NotNull String branchName)
      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:
      branchName - the name of the branch (can be a regular expression). This parameter is required.
    • andBaseRefIs

      @Stability(Stable) @NotNull public FilterGroup andBaseRefIs(@NotNull String pattern)
      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 - a regular expression. This parameter is required.
    • andBaseRefIsNot

      @Stability(Stable) @NotNull public FilterGroup andBaseRefIsNot(@NotNull String pattern)
      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 - a regular expression. This parameter is required.
    • andBranchIs

      @Stability(Stable) @NotNull public FilterGroup andBranchIs(@NotNull String branchName)
      Create a new FilterGroup with an added condition: the event must affect the given branch.

      Parameters:
      branchName - the name of the branch (can be a regular expression). This parameter is required.
    • andBranchIsNot

      @Stability(Stable) @NotNull public FilterGroup andBranchIsNot(@NotNull String branchName)
      Create a new FilterGroup with an added condition: the event must not affect the given branch.

      Parameters:
      branchName - the name of the branch (can be a regular expression). This parameter is required.
    • andCommitMessageIs

      @Stability(Stable) @NotNull public FilterGroup andCommitMessageIs(@NotNull String commitMessage)
      Create a new FilterGroup with an added condition: the event must affect a head commit with the given message.

      Parameters:
      commitMessage - the commit message (can be a regular expression). This parameter is required.
    • andCommitMessageIsNot

      @Stability(Stable) @NotNull public FilterGroup andCommitMessageIsNot(@NotNull String commitMessage)
      Create a new FilterGroup with an added condition: the event must not affect a head commit with the given message.

      Parameters:
      commitMessage - the commit message (can be a regular expression). This parameter is required.
    • andFilePathIs

      @Stability(Stable) @NotNull public FilterGroup andFilePathIs(@NotNull String pattern)
      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 - a regular expression. This parameter is required.
    • andFilePathIsNot

      @Stability(Stable) @NotNull public FilterGroup andFilePathIsNot(@NotNull String pattern)
      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 - a regular expression. This parameter is required.
    • andHeadRefIs

      @Stability(Stable) @NotNull public FilterGroup andHeadRefIs(@NotNull String pattern)
      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 - a regular expression. This parameter is required.
    • andHeadRefIsNot

      @Stability(Stable) @NotNull public FilterGroup andHeadRefIsNot(@NotNull String pattern)
      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 - a regular expression. This parameter is required.
    • andTagIs

      @Stability(Stable) @NotNull public FilterGroup andTagIs(@NotNull String tagName)
      Create a new FilterGroup with an added condition: the event must affect the given tag.

      Parameters:
      tagName - the name of the tag (can be a regular expression). This parameter is required.
    • andTagIsNot

      @Stability(Stable) @NotNull public FilterGroup andTagIsNot(@NotNull String tagName)
      Create a new FilterGroup with an added condition: the event must not affect the given tag.

      Parameters:
      tagName - the name of the tag (can be a regular expression). This parameter is required.