TaskInput Class
Type union for task classes that accept multiple types of payload.
Example
ts
import * as apigateway from 'aws-cdk-lib/aws-apigateway';
declare const api: apigateway.RestApi;
tasks.CallApiGatewayRestApiEndpoint.jsonata(this, 'Endpoint', {
api,
stageName: 'Stage',
method: tasks.HttpMethod.PUT,
integrationPattern: sfn.IntegrationPattern.WAIT_FOR_TASK_TOKEN,
headers: sfn.TaskInput.fromObject({
TaskToken: '{% States.Array($states.context.taskToken) %}',
}),
});
Properties
Methods
fromJsonPathAt(path: string): TaskInput // chainable@staticmethod def from_json_path_at(path: str) -> TaskInputpublic static TaskInput fromJsonPathAt(String path)public static TaskInput FromJsonPathAt(string path)func FromJsonPathAt(Path *string) TaskInputstatic#Use a part of the execution data or task context as task input.
Use this when you want to use a subobject or string from the current state machine execution or the current task context as complete payload to a task.
fromObject(obj: { [key: string]: any }): TaskInput // chainable@staticmethod def from_object(obj: typing.Mapping[str, Any]) -> TaskInputpublic static TaskInput fromObject(Map<String, Object> obj)public static TaskInput FromObject(IDictionary<string, object> obj)func FromObject(Obj *map[string]interface{}) TaskInputstatic#Use an object as task input.
This object may contain JSON path fields as object values, if desired.
Use sfn.JsonPath.DISCARD in place of null for languages that do not support null (i.e. Python).
fromText(text: string): TaskInput // chainable@staticmethod def from_text(text: str) -> TaskInputpublic static TaskInput fromText(String text)public static TaskInput FromText(string text)func FromText(Text *string) TaskInputstatic#Use a literal string as task input.
This might be a JSON-encoded object, or just a text.