Class RuleTargetInput
The input to send to the event target.
Inheritance
Namespace: Amazon.CDK.AWS.Events
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public abstract class RuleTargetInput : DeputyBase
Syntax (vb)
Public MustInherit Class RuleTargetInput
Inherits DeputyBase
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.AppSync;
var api = new GraphqlApi(this, "api", new GraphqlApiProps {
Name = "api",
Definition = Definition.FromFile("schema.graphql"),
AuthorizationConfig = new AuthorizationConfig {
DefaultAuthorization = new AuthorizationMode { AuthorizationType = AuthorizationType.IAM }
}
});
var rule = new Rule(this, "Rule", new RuleProps {
Schedule = Schedule.Rate(Duration.Hours(1))
});
rule.AddTarget(new AppSync(api, new AppSyncGraphQLApiProps {
GraphQLOperation = "mutation Publish($message: String!){ publish(message: $message) { message } }",
Variables = RuleTargetInput.FromObject(new Dictionary<string, string> {
{ "message", "hello world" }
})
}));
Synopsis
Constructors
RuleTargetInput() | |
RuleTargetInput(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
RuleTargetInput(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
Bind(IRule) | Return the input properties for this input object. |
FromEventPath(String) | Take the event target input from a path in the event JSON. |
FromMultilineText(String) | Pass text to the event target, splitting on newlines. |
FromObject(Object) | Pass a JSON object to the event target. |
FromText(String) | Pass text to the event target. |
Constructors
RuleTargetInput()
protected RuleTargetInput()
RuleTargetInput(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected RuleTargetInput(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
RuleTargetInput(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected RuleTargetInput(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
Bind(IRule)
Return the input properties for this input object.
public abstract IRuleTargetInputProperties Bind(IRule rule)
Parameters
- rule IRule
Returns
FromEventPath(String)
Take the event target input from a path in the event JSON.
public static RuleTargetInput FromEventPath(string path)
Parameters
- path System.String
Returns
FromMultilineText(String)
Pass text to the event target, splitting on newlines.
public static RuleTargetInput FromMultilineText(string text)
Parameters
- text System.String
Returns
Remarks
This is only useful when passing to a target that does not take a single argument.
May contain strings returned by EventField.from()
to substitute in parts
of the matched event.
FromObject(Object)
Pass a JSON object to the event target.
public static RuleTargetInput FromObject(object obj)
Parameters
- obj System.Object
Returns
Remarks
May contain strings returned by EventField.from()
to substitute in parts of the
matched event.
FromText(String)
Pass text to the event target.
public static RuleTargetInput FromText(string text)
Parameters
- text System.String
Returns
Remarks
May contain strings returned by EventField.from()
to substitute in parts of the
matched event.
The Rule Target input value will be a single string: the string you pass
here. Do not use this method to pass a complex value like a JSON object to
a Rule Target. Use RuleTargetInput.fromObject()
instead.