Class Target
- java.lang.Object
-
- com.amazonaws.services.cloudwatchevents.model.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 Summary
Constructors Constructor Description Target()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Target
clone()
boolean
equals(Object obj)
String
getArn()
The Amazon Resource Name (ARN) associated of the target.String
getId()
The unique target assignment ID.String
getInput()
Valid JSON text passed to the target.String
getInputPath()
The value of the JSONPath that is used for extracting part of the matched event when passing it to the target.int
hashCode()
void
setArn(String arn)
The Amazon Resource Name (ARN) associated of the target.void
setId(String id)
The unique target assignment ID.void
setInput(String input)
Valid JSON text passed to the target.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.String
toString()
Returns a string representation of this object; useful for testing and debugging.Target
withArn(String arn)
The Amazon Resource Name (ARN) associated of the target.Target
withId(String id)
The unique target assignment ID.Target
withInput(String input)
Valid JSON text passed to the target.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.
-
-
-
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.
-
setInput
public void setInput(String input)
Valid JSON text passed to the target. For more information about JSON text, see The JavaScript Object Notation (JSON) Data Interchange Format.
- Parameters:
input
- Valid JSON text passed to the target. For more information about JSON text, see The JavaScript Object Notation (JSON) Data Interchange Format.
-
getInput
public String getInput()
Valid JSON text passed to the target. For more information about JSON text, see The JavaScript Object Notation (JSON) Data Interchange Format.
- Returns:
- Valid JSON text passed to the target. For more information about JSON text, see The JavaScript Object Notation (JSON) Data Interchange Format.
-
withInput
public Target withInput(String input)
Valid JSON text passed to the target. For more information about JSON text, see The JavaScript Object Notation (JSON) Data Interchange Format.
- Parameters:
input
- Valid JSON text passed to the target. For more information about JSON text, see The JavaScript Object Notation (JSON) Data Interchange Format.- 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 classObject
- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
-