in src/stepfunctions/steps/states.py [0:0]
def to_dict(self):
result = super(State, self).to_dict()
# Next step
if self.next_step is not None:
result[Field.Next.name] = self.next_step.state_id
elif self.state_type not in ('Succeed', 'Fail', 'Choice'):
result[Field.End.name] = True
# Retry and catch
if self.retries and self.is_field_allowed(Field.Retry.value):
result[Field.Retry.name] = [retry.to_dict() for retry in self.retries]
if self.catches and self.is_field_allowed(Field.Catch.value):
result[Field.Catch.name] = [catch.to_dict() for catch in self.catches]
return result