Class JsonPath
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
Example:
/** * JSON state input: * { * "bucketName": "my-bucket", * "prefix": "item" * } */ DistributedMap distributedMap = DistributedMap.Builder.create(this, "DistributedMap") .itemReader(S3ObjectsItemReader.Builder.create() .bucketNamePath(JsonPath.stringAt("$.bucketName")) .prefix(JsonPath.stringAt("$.prefix")) .build()) .build(); distributedMap.itemProcessor(new Pass(this, "Pass"));
- 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
arrayContains
(Object array, Object value) Make an intrinsic States.ArrayContains expression.static String
arrayGetItem
(Object array, Number index) Make an intrinsic States.ArrayGetItem expression.static String
arrayLength
(Object array) Make an intrinsic States.ArrayLength expression.static String
arrayPartition
(Object array, Number chunkSize) Make an intrinsic States.ArrayPartition expression.static String
arrayRange
(Number start, Number end, Number step) Make an intrinsic States.ArrayRange expression.static String
arrayUnique
(Object array) Make an intrinsic States.ArrayUnique expression.static String
base64Decode
(String base64) Make an intrinsic States.Base64Decode expression.static String
base64Encode
(String input) Make an intrinsic States.Base64Encode 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 Execution Id field from the context object.static String
Return the Execution Input field from the context object.static String
Return the Execution Name field from the context object.static String
Return the Execution RoleArn field from the context object.static String
Return the Execution StartTime field from the context object.static String
Return the State EnteredTime field from the context object.static String
Return the StateMachine Id field from the context object.static String
Return the StateMachine Name field from the context object.static String
Return the State Name field from the context object.static String
Return the State RetryCount field from the context object.static String
Return the Task Token field from the context object.static String
Make an intrinsic States.Hash expression.static Boolean
isEncodedJsonPath
(String value) Determines if the indicated string is an encoded JSON path.static String
Make an intrinsic States.JsonMerge expression.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 String
Make an intrinsic States.MathAdd expression.static String
mathRandom
(Number start, Number end) Make an intrinsic States.MathRandom expression.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 String
stringSplit
(String inputString, String splitter) Make an intrinsic States.StringSplit expression.static IResolvable
stringToJson
(String jsonString) Make an intrinsic States.StringToJson expression.static String
uuid()
Make an intrinsic States.UUID 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:
-
arrayContains
@Stability(Stable) @NotNull public static String arrayContains(@NotNull Object array, @NotNull Object value) Make an intrinsic States.ArrayContains expression.Use this function to determine if a specific value is present in an array. For example, you can use this function to detect if there was an error in a Map state iteration.
- Parameters:
array
- This parameter is required.value
- This parameter is required.- See Also:
-
arrayGetItem
@Stability(Stable) @NotNull public static String arrayGetItem(@NotNull Object array, @NotNull Number index) Make an intrinsic States.ArrayGetItem expression.Use this function to get a specified index's value in an array.
- Parameters:
array
- This parameter is required.index
- This parameter is required.- See Also:
-
arrayLength
Make an intrinsic States.ArrayLength expression.Use this function to get the length of an array.
- Parameters:
array
- This parameter is required.- See Also:
-
arrayPartition
@Stability(Stable) @NotNull public static String arrayPartition(@NotNull Object array, @NotNull Number chunkSize) Make an intrinsic States.ArrayPartition expression.Use this function to partition a large array. You can also use this intrinsic to slice the data and then send the payload in smaller chunks.
- Parameters:
array
- This parameter is required.chunkSize
- This parameter is required.- See Also:
-
arrayRange
@Stability(Stable) @NotNull public static String arrayRange(@NotNull Number start, @NotNull Number end, @NotNull Number step) Make an intrinsic States.ArrayRange expression.Use this function to create a new array containing a specific range of elements. The new array can contain up to 1000 elements.
- Parameters:
start
- This parameter is required.end
- This parameter is required.step
- This parameter is required.- See Also:
-
arrayUnique
Make an intrinsic States.ArrayUnique expression.Use this function to get the length of an array. Use this function to remove duplicate values from an array and returns an array containing only unique elements. This function takes an array, which can be unsorted, as its sole argument.
- Parameters:
array
- This parameter is required.- See Also:
-
base64Decode
Make an intrinsic States.Base64Decode expression.Use this function to decode data based on MIME Base64 decoding scheme. You can use this function to pass data to other AWS services without using a Lambda function.
- Parameters:
base64
- This parameter is required.- See Also:
-
base64Encode
Make an intrinsic States.Base64Encode expression.Use this function to encode data based on MIME Base64 encoding scheme. You can use this function to pass data to other AWS services without using an AWS Lambda function.
- Parameters:
input
- 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:
-
hash
@Stability(Stable) @NotNull public static String hash(@NotNull Object data, @NotNull String algorithm) Make an intrinsic States.Hash expression.Use this function to calculate the hash value of a given input. You can use this function to pass data to other AWS services without using a Lambda function.
- Parameters:
data
- This parameter is required.algorithm
- 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.
-
jsonMerge
@Stability(Stable) @NotNull public static String jsonMerge(@NotNull Object value1, @NotNull Object value2) Make an intrinsic States.JsonMerge expression.Use this function to merge two JSON objects into a single object.
- Parameters:
value1
- This parameter is required.value2
- This parameter is required.- See Also:
-
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.
-
mathAdd
@Stability(Stable) @NotNull public static String mathAdd(@NotNull Number num1, @NotNull Number num2) Make an intrinsic States.MathAdd expression.Use this function to return the sum of two numbers. For example, you can use this function to increment values inside a loop without invoking a Lambda function.
- Parameters:
num1
- This parameter is required.num2
- This parameter is required.- See Also:
-
mathRandom
@Stability(Stable) @NotNull public static String mathRandom(@NotNull Number start, @NotNull Number end) Make an intrinsic States.MathRandom expression.Use this function to return a random number between the specified start and end number. For example, you can use this function to distribute a specific task between two or more resources.
- Parameters:
start
- This parameter is required.end
- This parameter is required.- See Also:
-
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.
-
stringSplit
@Stability(Stable) @NotNull public static String stringSplit(@NotNull String inputString, @NotNull String splitter) Make an intrinsic States.StringSplit expression.Use this function to split a string into an array of values. This function takes two arguments.The first argument is a string and the second argument is the delimiting character that the function will use to divide the string.
- Parameters:
inputString
- This parameter is required.splitter
- This parameter is required.- See Also:
-
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:
-
uuid
Make an intrinsic States.UUID expression.Use this function to return a version 4 universally unique identifier (v4 UUID) generated using random numbers. For example, you can use this function to call other AWS services or resources that need a UUID parameter or insert items in a DynamoDB table.
- 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.
-
getExecutionId
Return the Execution Id field from the context object. -
getExecutionInput
Return the Execution Input field from the context object.- Will be an object at invocation time, but is represented in the CDK application as a string.
-
getExecutionName
Return the Execution Name field from the context object. -
getExecutionRoleArn
Return the Execution RoleArn field from the context object. -
getExecutionStartTime
Return the Execution StartTime field from the context object. -
getStateEnteredTime
Return the State EnteredTime field from the context object. -
getStateMachineId
Return the StateMachine Id field from the context object. -
getStateMachineName
Return the StateMachine Name field from the context object. -
getStateName
Return the State Name field from the context object. -
getStateRetryCount
Return the State RetryCount field from the context object. -
getTaskToken
Return the Task Token field from the context object.External actions will need this token to report step completion back to StepFunctions using the
SendTaskSuccess
orSendTaskFailure
calls.
-