Expression

class aws_cdk.aws_iotevents.Expression

Bases: object

(experimental) Expression for events in Detector Model state.

See

https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-expressions.html

Stability

experimental

ExampleMetadata

infused

Example:

# Example automatically generated from non-compiling source. May contain errors.
import aws_cdk.aws_iotevents as iotevents
import aws_cdk.aws_iotevents_actions as actions

# input: iotevents.IInput

state = iotevents.State(
    state_name="MyState",
    on_enter=[iotevents.Event(
        event_name="test-event",
        condition=iotevents.Expression.current_input(input),
        actions=[actions, [
            actions.SetVariableAction("MyVariable",
                iotevents.Expression.input_attribute(input, "payload.temperature"))
        ]
        ]
    )]
)
Stability

experimental

Methods

abstract evaluate(parent_priority=None)

(experimental) This is called to evaluate the expression.

Parameters

parent_priority (Union[int, float, None]) – priority of the parent of this expression, used for determining whether or not to add parenthesis around the expression. This is intended to be set according to MDN rules, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#table for details

Stability

experimental

Return type

str

Static Methods

classmethod and_(left, right)

(experimental) Create a expression for the AND operator.

Parameters
Stability

experimental

Return type

Expression

classmethod current_input(input)

(experimental) Create a expression for function currentInput().

It is evaluated to true if the specified input message was received.

Parameters

input (IInput) –

Stability

experimental

Return type

Expression

classmethod eq(left, right)

(experimental) Create a expression for the Equal operator.

Parameters
Stability

experimental

Return type

Expression

classmethod from_string(value)

(experimental) Create a expression from the given string.

Parameters

value (str) –

Stability

experimental

Return type

Expression

classmethod gt(left, right)

(experimental) Create a expression for the Greater Than operator.

Parameters
Stability

experimental

Return type

Expression

classmethod gte(left, right)

(experimental) Create a expression for the Greater Than Or Equal operator.

Parameters
Stability

experimental

Return type

Expression

classmethod input_attribute(input, path)

(experimental) Create a expression for get an input attribute as $input.TemperatureInput.temperatures[2].

Parameters
  • input (IInput) –

  • path (str) –

Stability

experimental

Return type

Expression

classmethod lt(left, right)

(experimental) Create a expression for the Less Than operator.

Parameters
Stability

experimental

Return type

Expression

classmethod lte(left, right)

(experimental) Create a expression for the Less Than Or Equal operator.

Parameters
Stability

experimental

Return type

Expression

classmethod neq(left, right)

(experimental) Create a expression for the Not Equal operator.

Parameters
Stability

experimental

Return type

Expression

classmethod or_(left, right)

(experimental) Create a expression for the OR operator.

Parameters
Stability

experimental

Return type

Expression