choice_rules

Rules for defining the branching logic in Choice states.

See Step Functions docs for more details.

class rhodes.choice_rules.VariablePath(path)[source]

Bases: rhodes.structures.JsonPath

JsonPath variant with overloading helper methods to generate choice rules.

class rhodes.choice_rules.ChoiceRule[source]

Bases: object

Base class for all choice rules.

member_of = None
to_dict()[source]

Serialize state as a dictionary.

then(state)[source]
class rhodes.choice_rules.StringEquals(*, Variable=None, Next=None, Value=None)[source]

Bases: rhodes.choice_rules.ChoiceRule

Parameters:
  • Variable (VariablePath) – Path to value in state input that will be evaluated
  • Next – The state to which to continue if this rule evaluates as true
  • Value (str) – The value to which to compare Variable
to_dict(suppress_next=False)
class rhodes.choice_rules.StringLessThan(*, Variable=None, Next=None, Value=None)[source]

Bases: rhodes.choice_rules.ChoiceRule

Parameters:
  • Variable (VariablePath) – Path to value in state input that will be evaluated
  • Next – The state to which to continue if this rule evaluates as true
  • Value (str) – The value to which to compare Variable
to_dict(suppress_next=False)
class rhodes.choice_rules.StringGreaterThan(*, Variable=None, Next=None, Value=None)[source]

Bases: rhodes.choice_rules.ChoiceRule

Parameters:
  • Variable (VariablePath) – Path to value in state input that will be evaluated
  • Next – The state to which to continue if this rule evaluates as true
  • Value (str) – The value to which to compare Variable
to_dict(suppress_next=False)
class rhodes.choice_rules.StringLessThanEquals(*, Variable=None, Next=None, Value=None)[source]

Bases: rhodes.choice_rules.ChoiceRule

Parameters:
  • Variable (VariablePath) – Path to value in state input that will be evaluated
  • Next – The state to which to continue if this rule evaluates as true
  • Value (str) – The value to which to compare Variable
to_dict(suppress_next=False)
class rhodes.choice_rules.StringGreaterThanEquals(*, Variable=None, Next=None, Value=None)[source]

Bases: rhodes.choice_rules.ChoiceRule

Parameters:
  • Variable (VariablePath) – Path to value in state input that will be evaluated
  • Next – The state to which to continue if this rule evaluates as true
  • Value (str) – The value to which to compare Variable
to_dict(suppress_next=False)
class rhodes.choice_rules.NumericEquals(*, Variable=None, Next=None, Value=None)[source]

Bases: rhodes.choice_rules.ChoiceRule

Parameters:
  • Variable (VariablePath) – Path to value in state input that will be evaluated
  • Next – The state to which to continue if this rule evaluates as true
  • Value – The value to which to compare Variable
to_dict(suppress_next=False)
class rhodes.choice_rules.NumericLessThan(*, Variable=None, Next=None, Value=None)[source]

Bases: rhodes.choice_rules.ChoiceRule

Parameters:
  • Variable (VariablePath) – Path to value in state input that will be evaluated
  • Next – The state to which to continue if this rule evaluates as true
  • Value – The value to which to compare Variable
to_dict(suppress_next=False)
class rhodes.choice_rules.NumericGreaterThan(*, Variable=None, Next=None, Value=None)[source]

Bases: rhodes.choice_rules.ChoiceRule

Parameters:
  • Variable (VariablePath) – Path to value in state input that will be evaluated
  • Next – The state to which to continue if this rule evaluates as true
  • Value – The value to which to compare Variable
to_dict(suppress_next=False)
class rhodes.choice_rules.NumericLessThanEquals(*, Variable=None, Next=None, Value=None)[source]

Bases: rhodes.choice_rules.ChoiceRule

Parameters:
  • Variable (VariablePath) – Path to value in state input that will be evaluated
  • Next – The state to which to continue if this rule evaluates as true
  • Value – The value to which to compare Variable
to_dict(suppress_next=False)
class rhodes.choice_rules.NumericGreaterThanEquals(*, Variable=None, Next=None, Value=None)[source]

Bases: rhodes.choice_rules.ChoiceRule

Parameters:
  • Variable (VariablePath) – Path to value in state input that will be evaluated
  • Next – The state to which to continue if this rule evaluates as true
  • Value – The value to which to compare Variable
to_dict(suppress_next=False)
class rhodes.choice_rules.BooleanEquals(*, Variable=None, Next=None, Value=None)[source]

Bases: rhodes.choice_rules.ChoiceRule

Parameters:
  • Variable (VariablePath) – Path to value in state input that will be evaluated
  • Next – The state to which to continue if this rule evaluates as true
  • Value (bool) – The value to which to compare Variable
to_dict(suppress_next=False)
class rhodes.choice_rules.TimestampEquals(*, Variable=None, Next=None, Value=None)[source]

Bases: rhodes.choice_rules.ChoiceRule

Parameters:
  • Variable (VariablePath) – Path to value in state input that will be evaluated
  • Next – The state to which to continue if this rule evaluates as true
  • Value (datetime) – The value to which to compare Variable
to_dict(suppress_next=False)
class rhodes.choice_rules.TimestampLessThan(*, Variable=None, Next=None, Value=None)[source]

Bases: rhodes.choice_rules.ChoiceRule

Parameters:
  • Variable (VariablePath) – Path to value in state input that will be evaluated
  • Next – The state to which to continue if this rule evaluates as true
  • Value (datetime) – The value to which to compare Variable
to_dict(suppress_next=False)
class rhodes.choice_rules.TimestampGreaterThan(*, Variable=None, Next=None, Value=None)[source]

Bases: rhodes.choice_rules.ChoiceRule

Parameters:
  • Variable (VariablePath) – Path to value in state input that will be evaluated
  • Next – The state to which to continue if this rule evaluates as true
  • Value (datetime) – The value to which to compare Variable
to_dict(suppress_next=False)
class rhodes.choice_rules.TimestampLessThanEquals(*, Variable=None, Next=None, Value=None)[source]

Bases: rhodes.choice_rules.ChoiceRule

Parameters:
  • Variable (VariablePath) – Path to value in state input that will be evaluated
  • Next – The state to which to continue if this rule evaluates as true
  • Value (datetime) – The value to which to compare Variable
to_dict(suppress_next=False)
class rhodes.choice_rules.TimestampGreaterThanEquals(*, Variable=None, Next=None, Value=None)[source]

Bases: rhodes.choice_rules.ChoiceRule

Parameters:
  • Variable (VariablePath) – Path to value in state input that will be evaluated
  • Next – The state to which to continue if this rule evaluates as true
  • Value (datetime) – The value to which to compare Variable
to_dict(suppress_next=False)
class rhodes.choice_rules.And(*, Rules=None, Next=None)[source]

Bases: rhodes.choice_rules.ChoiceRule

Matches only if all of the provided rules are true. :param Rules: One or more ChoiceRule to evaluate for this rule :param Next: The state to which to continue if this rule evaluates as true

to_dict(suppress_next=False)
class rhodes.choice_rules.Or(*, Rules=None, Next=None)[source]

Bases: rhodes.choice_rules.ChoiceRule

Matches if any of the provided rules are true. :param Rules: One or more ChoiceRule to evaluate for this rule :param Next: The state to which to continue if this rule evaluates as true

to_dict(suppress_next=False)
class rhodes.choice_rules.Not(*, Rule=None, Next=None)[source]

Bases: rhodes.choice_rules.ChoiceRule

Matches only if the provided rule is false.

Parameters:
  • Rule (ChoiceRule) – Rule that must evaluate as false
  • Next – The state to which to continue if this rule evaluates as true
to_dict(suppress_next=False)[source]

Serialize state as a dictionary.

rhodes.choice_rules.all_(*rules)[source]

Helper to assemble several rules into an And rule.

Return type:And
rhodes.choice_rules.any_(*rules)[source]

Helper to assemble several rules into an Or rule.

Return type:Or