Class Target

  • All Implemented Interfaces:
    Serializable, Cloneable

    public class Target
    extends Object
    implements Serializable, Cloneable

    Targets are the resources that can be invoked when a rule is triggered. For example, AWS Lambda functions, Amazon Kinesis streams, and built-in targets.

    Input and InputPath are mutually-exclusive and optional parameters of a target. When a rule is triggered due to a matched event, if for a target:

    • Neither Input nor InputPath is specified, then the entire event is passed to the target in JSON form.
    • InputPath is specified in the form of JSONPath (e.g. $.detail), then only the part of the event specified in the path is passed to the target (e.g. only the detail part of the event is passed).
    • Input is specified in the form of a valid JSON, then the matched event is overridden with this constant.
    See Also:
    Serialized Form
    • Constructor Detail

      • Target

        public Target()
    • Method Detail

      • setId

        public void setId​(String id)

        The unique target assignment ID.

        Parameters:
        id - The unique target assignment ID.
      • getId

        public String getId()

        The unique target assignment ID.

        Returns:
        The unique target assignment ID.
      • withId

        public Target withId​(String id)

        The unique target assignment ID.

        Parameters:
        id - The unique target assignment ID.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • setArn

        public void setArn​(String arn)

        The Amazon Resource Name (ARN) associated of the target.

        Parameters:
        arn - The Amazon Resource Name (ARN) associated of the target.
      • getArn

        public String getArn()

        The Amazon Resource Name (ARN) associated of the target.

        Returns:
        The Amazon Resource Name (ARN) associated of the target.
      • withArn

        public Target withArn​(String arn)

        The Amazon Resource Name (ARN) associated of the target.

        Parameters:
        arn - The Amazon Resource Name (ARN) associated of the target.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • setInputPath

        public void setInputPath​(String inputPath)

        The value of the JSONPath that is used for extracting part of the matched event when passing it to the target. For more information about JSON paths, see JSONPath.

        Parameters:
        inputPath - The value of the JSONPath that is used for extracting part of the matched event when passing it to the target. For more information about JSON paths, see JSONPath.
      • getInputPath

        public String getInputPath()

        The value of the JSONPath that is used for extracting part of the matched event when passing it to the target. For more information about JSON paths, see JSONPath.

        Returns:
        The value of the JSONPath that is used for extracting part of the matched event when passing it to the target. For more information about JSON paths, see JSONPath.
      • withInputPath

        public Target withInputPath​(String inputPath)

        The value of the JSONPath that is used for extracting part of the matched event when passing it to the target. For more information about JSON paths, see JSONPath.

        Parameters:
        inputPath - The value of the JSONPath that is used for extracting part of the matched event when passing it to the target. For more information about JSON paths, see JSONPath.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • toString

        public String toString()
        Returns a string representation of this object; useful for testing and debugging.
        Overrides:
        toString in class Object
        Returns:
        A string representation of this object.
        See Also:
        Object.toString()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object