Class: AWSCDK::StepFunctions::JsonPath
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::StepFunctions::JsonPath
- Defined in:
- step_functions/json_path.rb
Overview
Extract a field from the State Machine data or context that gets passed around between states.
Class Method Summary collapse
-
.array(*values) ⇒ String
Make an intrinsic States.Array expression.
-
.array_contains(array, value) ⇒ String
Make an intrinsic States.ArrayContains expression.
-
.array_get_item(array, index) ⇒ String
Make an intrinsic States.ArrayGetItem expression.
-
.array_length(array) ⇒ String
Make an intrinsic States.ArrayLength expression.
-
.array_partition(array, chunk_size) ⇒ String
Make an intrinsic States.ArrayPartition expression.
-
.array_range(start, _end, step) ⇒ String
Make an intrinsic States.ArrayRange expression.
-
.array_unique(array) ⇒ String
Make an intrinsic States.ArrayUnique expression.
-
.base64_decode(base64) ⇒ String
Make an intrinsic States.Base64Decode expression.
-
.base64_encode(input) ⇒ String
Make an intrinsic States.Base64Encode expression.
-
.DISCARD ⇒ String
Special string value to discard state input, output or result.
-
.entire_context ⇒ String
Use the entire context data structure.
-
.entire_payload ⇒ String
Use the entire data structure.
-
.execution_id ⇒ String
Return the Execution Id field from the context object.
-
.execution_input ⇒ String
Return the Execution Input field from the context object.
-
.execution_name ⇒ String
Return the Execution Name field from the context object.
-
.execution_role_arn ⇒ String
Return the Execution RoleArn field from the context object.
-
.execution_start_time ⇒ String
Return the Execution StartTime field from the context object.
-
.format(format_string, *values) ⇒ String
Make an intrinsic States.Format expression.
-
.hash(data, algorithm) ⇒ String
Make an intrinsic States.Hash expression.
-
.is_encoded_json_path(value) ⇒ Boolean
Determines if the indicated string is an encoded JSON path.
- .jsii_overridable_methods ⇒ Object
-
.json_merge(value1, value2) ⇒ String
Make an intrinsic States.JsonMerge expression.
-
.json_to_string(value) ⇒ String
Make an intrinsic States.JsonToString expression.
-
.list_at(path) ⇒ Array<String>
Instead of using a literal string list, get the value from a JSON path.
-
.math_add(num1, num2) ⇒ String
Make an intrinsic States.MathAdd expression.
-
.math_random(start, _end) ⇒ String
Make an intrinsic States.MathRandom expression.
-
.number_at(path) ⇒ Numeric
Instead of using a literal number, get the value from a JSON path.
-
.object_at(path) ⇒ AWSCDK::IResolvable
Reference a complete (complex) object in a JSON path location.
-
.state_entered_time ⇒ String
Return the State EnteredTime field from the context object.
-
.state_machine_id ⇒ String
Return the StateMachine Id field from the context object.
-
.state_machine_name ⇒ String
Return the StateMachine Name field from the context object.
-
.state_name ⇒ String
Return the State Name field from the context object.
-
.state_retry_count ⇒ String
Return the State RetryCount field from the context object.
-
.string_at(path) ⇒ String
Instead of using a literal string, get the value from a JSON path.
-
.string_split(input_string, splitter) ⇒ String
Make an intrinsic States.StringSplit expression.
-
.string_to_json(json_string) ⇒ AWSCDK::IResolvable
Make an intrinsic States.StringToJson expression.
-
.task_token ⇒ String
Return the Task Token field from the context object.
-
.uuid ⇒ String
Make an intrinsic States.UUID expression.
Instance Method Summary collapse
-
#initialize(*args) ⇒ JsonPath
constructor
A new instance of JsonPath.
Constructor Details
#initialize(*args) ⇒ JsonPath
Returns a new instance of JsonPath.
10 11 12 |
# File 'step_functions/json_path.rb', line 10 def initialize(*args) raise NoMethodError, "aws-cdk-lib.aws_stepfunctions.JsonPath does not have a visible constructor; use the provided factory methods" end |
Class Method Details
.array(*values) ⇒ String
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.
32 33 34 35 36 37 |
# File 'step_functions/json_path.rb', line 32 def self.array(*values) values.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "values[#{index}]") end Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "array", [*values]) end |
.array_contains(array, value) ⇒ String
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.
47 48 49 50 51 |
# File 'step_functions/json_path.rb', line 47 def self.array_contains(array, value) Jsii::Type.check_type(array, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "array") Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "value") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "arrayContains", [array, value]) end |
.array_get_item(array, index) ⇒ String
Make an intrinsic States.ArrayGetItem expression.
Use this function to get a specified index's value in an array.
61 62 63 64 65 |
# File 'step_functions/json_path.rb', line 61 def self.array_get_item(array, index) Jsii::Type.check_type(array, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "array") Jsii::Type.check_type(index, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "index") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "arrayGetItem", [array, index]) end |
.array_length(array) ⇒ String
Make an intrinsic States.ArrayLength expression.
Use this function to get the length of an array.
74 75 76 77 |
# File 'step_functions/json_path.rb', line 74 def self.array_length(array) Jsii::Type.check_type(array, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "array") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "arrayLength", [array]) end |
.array_partition(array, chunk_size) ⇒ String
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.
87 88 89 90 91 |
# File 'step_functions/json_path.rb', line 87 def self.array_partition(array, chunk_size) Jsii::Type.check_type(array, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "array") Jsii::Type.check_type(chunk_size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "chunkSize") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "arrayPartition", [array, chunk_size]) end |
.array_range(start, _end, step) ⇒ String
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.
102 103 104 105 106 107 |
# File 'step_functions/json_path.rb', line 102 def self.array_range(start, _end, step) Jsii::Type.check_type(start, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "start") Jsii::Type.check_type(_end, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "end") Jsii::Type.check_type(step, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "step") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "arrayRange", [start, _end, step]) end |
.array_unique(array) ⇒ String
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.
117 118 119 120 |
# File 'step_functions/json_path.rb', line 117 def self.array_unique(array) Jsii::Type.check_type(array, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "array") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "arrayUnique", [array]) end |
.base64_decode(base64) ⇒ String
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.
129 130 131 132 |
# File 'step_functions/json_path.rb', line 129 def self.base64_decode(base64) Jsii::Type.check_type(base64, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "base64") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "base64Decode", [base64]) end |
.base64_encode(input) ⇒ String
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.
141 142 143 144 |
# File 'step_functions/json_path.rb', line 141 def self.base64_encode(input) Jsii::Type.check_type(input, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "input") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "base64Encode", [input]) end |
.DISCARD ⇒ String
Special string value to discard state input, output or result.
334 335 336 |
# File 'step_functions/json_path.rb', line 334 def self.DISCARD() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "DISCARD") end |
.entire_context ⇒ String
Use the entire context data structure.
Will be an object at invocation time, but is represented in the CDK application as a string.
344 345 346 |
# File 'step_functions/json_path.rb', line 344 def self.entire_context() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "entireContext") end |
.entire_payload ⇒ String
Use the entire data structure.
Will be an object at invocation time, but is represented in the CDK application as a string.
354 355 356 |
# File 'step_functions/json_path.rb', line 354 def self.entire_payload() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "entirePayload") end |
.execution_id ⇒ String
Return the Execution Id field from the context object.
361 362 363 |
# File 'step_functions/json_path.rb', line 361 def self.execution_id() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "executionId") end |
.execution_input ⇒ String
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.
371 372 373 |
# File 'step_functions/json_path.rb', line 371 def self.execution_input() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "executionInput") end |
.execution_name ⇒ String
Return the Execution Name field from the context object.
378 379 380 |
# File 'step_functions/json_path.rb', line 378 def self.execution_name() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "executionName") end |
.execution_role_arn ⇒ String
Return the Execution RoleArn field from the context object.
385 386 387 |
# File 'step_functions/json_path.rb', line 385 def self.execution_role_arn() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "executionRoleArn") end |
.execution_start_time ⇒ String
Return the Execution StartTime field from the context object.
392 393 394 |
# File 'step_functions/json_path.rb', line 392 def self.execution_start_time() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "executionStartTime") end |
.format(format_string, *values) ⇒ String
Make an intrinsic States.Format expression.
This can be used to embed JSON Path variables inside a format string.
For example:
AWSCDK::StepFunctions::JsonPath.format("Hello, my name is {}.", AWSCDK::StepFunctions::JsonPath.string_at("$.name"))
160 161 162 163 164 165 166 |
# File 'step_functions/json_path.rb', line 160 def self.format(format_string, *values) Jsii::Type.check_type(format_string, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "formatString") values.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "values[#{index}]") end Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "format", [format_string, *values]) end |
.hash(data, algorithm) ⇒ String
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.
176 177 178 179 180 |
# File 'step_functions/json_path.rb', line 176 def self.hash(data, algorithm) Jsii::Type.check_type(data, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "data") Jsii::Type.check_type(algorithm, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "algorithm") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "hash", [data, algorithm]) end |
.is_encoded_json_path(value) ⇒ Boolean
Determines if the indicated string is an encoded JSON path.
186 187 188 189 |
# File 'step_functions/json_path.rb', line 186 def self.is_encoded_json_path(value) Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "value") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "isEncodedJsonPath", [value]) end |
.jsii_overridable_methods ⇒ Object
14 15 16 17 |
# File 'step_functions/json_path.rb', line 14 def self.jsii_overridable_methods { } end |
.json_merge(value1, value2) ⇒ String
Make an intrinsic States.JsonMerge expression.
Use this function to merge two JSON objects into a single object.
199 200 201 202 203 |
# File 'step_functions/json_path.rb', line 199 def self.json_merge(value1, value2) Jsii::Type.check_type(value1, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "value1") Jsii::Type.check_type(value2, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "value2") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "jsonMerge", [value1, value2]) end |
.json_to_string(value) ⇒ String
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:
AWSCDK::StepFunctions::JsonPath.json_to_string(AWSCDK::StepFunctions::JsonPath.object_at("$.someObject"))
219 220 221 222 |
# File 'step_functions/json_path.rb', line 219 def self.json_to_string(value) Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "value") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "jsonToString", [value]) end |
.list_at(path) ⇒ Array<String>
Instead of using a literal string list, get the value from a JSON path.
228 229 230 231 |
# File 'step_functions/json_path.rb', line 228 def self.list_at(path) Jsii::Type.check_type(path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "listAt", [path]) end |
.math_add(num1, num2) ⇒ String
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.
241 242 243 244 245 |
# File 'step_functions/json_path.rb', line 241 def self.math_add(num1, num2) Jsii::Type.check_type(num1, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "num1") Jsii::Type.check_type(num2, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "num2") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "mathAdd", [num1, num2]) end |
.math_random(start, _end) ⇒ String
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.
255 256 257 258 259 |
# File 'step_functions/json_path.rb', line 255 def self.math_random(start, _end) Jsii::Type.check_type(start, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "start") Jsii::Type.check_type(_end, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "end") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "mathRandom", [start, _end]) end |
.number_at(path) ⇒ Numeric
Instead of using a literal number, get the value from a JSON path.
265 266 267 268 |
# File 'step_functions/json_path.rb', line 265 def self.number_at(path) Jsii::Type.check_type(path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "numberAt", [path]) end |
.object_at(path) ⇒ AWSCDK::IResolvable
Reference a complete (complex) object in a JSON path location.
274 275 276 277 |
# File 'step_functions/json_path.rb', line 274 def self.object_at(path) Jsii::Type.check_type(path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "objectAt", [path]) end |
.state_entered_time ⇒ String
Return the State EnteredTime field from the context object.
399 400 401 |
# File 'step_functions/json_path.rb', line 399 def self.state_entered_time() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "stateEnteredTime") end |
.state_machine_id ⇒ String
Return the StateMachine Id field from the context object.
406 407 408 |
# File 'step_functions/json_path.rb', line 406 def self.state_machine_id() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "stateMachineId") end |
.state_machine_name ⇒ String
Return the StateMachine Name field from the context object.
413 414 415 |
# File 'step_functions/json_path.rb', line 413 def self.state_machine_name() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "stateMachineName") end |
.state_name ⇒ String
Return the State Name field from the context object.
420 421 422 |
# File 'step_functions/json_path.rb', line 420 def self.state_name() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "stateName") end |
.state_retry_count ⇒ String
Return the State RetryCount field from the context object.
427 428 429 |
# File 'step_functions/json_path.rb', line 427 def self.state_retry_count() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "stateRetryCount") end |
.string_at(path) ⇒ String
Instead of using a literal string, get the value from a JSON path.
283 284 285 286 |
# File 'step_functions/json_path.rb', line 283 def self.string_at(path) Jsii::Type.check_type(path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "stringAt", [path]) end |
.string_split(input_string, splitter) ⇒ String
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.
296 297 298 299 300 |
# File 'step_functions/json_path.rb', line 296 def self.string_split(input_string, splitter) Jsii::Type.check_type(input_string, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "inputString") Jsii::Type.check_type(splitter, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "splitter") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "stringSplit", [input_string, splitter]) end |
.string_to_json(json_string) ⇒ AWSCDK::IResolvable
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:
AWSCDK::StepFunctions::JsonPath.string_to_json(AWSCDK::StepFunctions::JsonPath.string_at("$.someJsonBody"))
316 317 318 319 |
# File 'step_functions/json_path.rb', line 316 def self.string_to_json(json_string) Jsii::Type.check_type(json_string, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "jsonString") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "stringToJson", [json_string]) end |
.task_token ⇒ String
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 or SendTaskFailure
calls.
438 439 440 |
# File 'step_functions/json_path.rb', line 438 def self.task_token() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "taskToken") end |
.uuid ⇒ String
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.
327 328 329 |
# File 'step_functions/json_path.rb', line 327 def self.uuid() Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions.JsonPath", "uuid", []) end |