Class JsonPath
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
Example:
Function fn; LambdaInvoke.Builder.create(this, "Invoke Handler") .lambdaFunction(fn) .resultSelector(Map.of( "lambdaOutput", JsonPath.stringAt("$.Payload"), "invokeRequestId", JsonPath.stringAt("$.SdkResponseMetadata.RequestId"), "staticValue", Map.of( "foo", "bar"), "stateName", JsonPath.stringAt("$.State.Name"))) .build();
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Make an intrinsic States.Array expression.static String
Make an intrinsic States.Format expression.static String
Use the entire context data structure.static String
Use the entire data structure.static String
Return the Task Token field.static Boolean
isEncodedJsonPath
(String value) Determines if the indicated string is an encoded JSON path.static String
jsonToString
(Object value) Make an intrinsic States.JsonToString expression.Instead of using a literal string list, get the value from a JSON path.static Number
Instead of using a literal number, get the value from a JSON path.static IResolvable
Reference a complete (complex) object in a JSON path location.static String
Instead of using a literal string, get the value from a JSON path.static IResolvable
stringToJson
(String jsonString) Make an intrinsic States.StringToJson expression.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
-
Field Details
-
DISCARD
Special string value to discard state input, output or result.
-
-
Constructor Details
-
JsonPath
protected JsonPath(software.amazon.jsii.JsiiObjectRef objRef) -
JsonPath
protected JsonPath(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
-
Method Details
-
array
Make an intrinsic States.Array expression.Combine any number of string literals or JsonPath expressions into an array.
Use this function if the value of an array element directly has to come from a JSON Path expression (either the State object or the Context object).
If the array contains object literals whose values come from a JSON path expression, you do not need to use this function.
- Parameters:
values
- This parameter is required.- See Also:
-
format
@Stability(Stable) @NotNull public static String format(@NotNull String formatString, @NotNull @NotNull String... values) Make an intrinsic States.Format expression.This can be used to embed JSON Path variables inside a format string.
For example:
JsonPath.format("Hello, my name is {}.", JsonPath.stringAt("$.name"));
- Parameters:
formatString
- This parameter is required.values
- This parameter is required.- See Also:
-
isEncodedJsonPath
Determines if the indicated string is an encoded JSON path.- Parameters:
value
- string to be evaluated. This parameter is required.
-
jsonToString
Make an intrinsic States.JsonToString expression.During the execution of the Step Functions state machine, encode the given object into a JSON string.
For example:
JsonPath.jsonToString(JsonPath.objectAt("$.someObject"));
- Parameters:
value
- This parameter is required.- See Also:
-
listAt
Instead of using a literal string list, get the value from a JSON path.- Parameters:
path
- This parameter is required.
-
numberAt
Instead of using a literal number, get the value from a JSON path.- Parameters:
path
- This parameter is required.
-
objectAt
Reference a complete (complex) object in a JSON path location.- Parameters:
path
- This parameter is required.
-
stringAt
Instead of using a literal string, get the value from a JSON path.- Parameters:
path
- This parameter is required.
-
stringToJson
Make an intrinsic States.StringToJson expression.During the execution of the Step Functions state machine, parse the given argument as JSON into its object form.
For example:
JsonPath.stringToJson(JsonPath.stringAt("$.someJsonBody"));
- Parameters:
jsonString
- This parameter is required.- See Also:
-
getEntireContext
Use the entire context data structure.Will be an object at invocation time, but is represented in the CDK application as a string.
-
getEntirePayload
Use the entire data structure.Will be an object at invocation time, but is represented in the CDK application as a string.
-
getTaskToken
Return the Task Token field.External actions will need this token to report step completion back to StepFunctions using the
SendTaskSuccess
orSendTaskFailure
calls.
-