diff --git a/src/swf_typed/_activities.py b/src/swf_typed/_activities.py index 0995033..70b4041 100644 --- a/src/swf_typed/_activities.py +++ b/src/swf_typed/_activities.py @@ -43,10 +43,10 @@ class ActivityInfo(_common.Deserialisable): created: datetime.datetime """Creation date.""" - description: str = None + description: t.Union[str, None] = None """Activity description.""" - deprecated: datetime.datetime = None + deprecated: t.Union[datetime.datetime, None] = None """Deprecation date.""" @classmethod @@ -105,7 +105,7 @@ def get_api_args(self): def delete_activity( activity: ActivityId, domain: str, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> None: """Delete a (deprecated/inactive) activity type. @@ -122,7 +122,7 @@ def delete_activity( def deprecate_activity( activity: ActivityId, domain: str, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> None: """Deprecate (deactivate) an activity type. @@ -139,7 +139,7 @@ def deprecate_activity( def describe_activity( activity: ActivityId, domain: str, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> ActivityDetails: """Describe an activity type. @@ -162,9 +162,9 @@ def describe_activity( def list_activities( domain: str, deprecated: bool = False, - activity_filter: ActivityIdFilter = None, + activity_filter: t.Union[ActivityIdFilter, None] = None, reverse: bool = False, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> t.Generator[ActivityInfo, None, None]: """List activity types; retrieved semi-lazily. @@ -197,9 +197,9 @@ def list_activities( def register_activity( activity: ActivityId, domain: str, - description: str = None, - default_task_configuration: DefaultTaskConfiguration = None, - client: "botocore.client.BaseClient" = None, + description: t.Union[str, None] = None, + default_task_configuration: t.Union[DefaultTaskConfiguration, None] = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> None: """Register a new activity type. @@ -230,7 +230,7 @@ def register_activity( def undeprecate_activity( activity: ActivityId, domain: str, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> None: """Undeprecate (reactivate) an activity type. diff --git a/src/swf_typed/_common.py b/src/swf_typed/_common.py index ebfc38a..3183a1d 100644 --- a/src/swf_typed/_common.py +++ b/src/swf_typed/_common.py @@ -62,7 +62,7 @@ def get_api_args(self) -> t.Dict[str, t.Any]: def ensure_client( - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> "botocore.client.BaseClient": """Return or create SWF client.""" if client: diff --git a/src/swf_typed/_decisions.py b/src/swf_typed/_decisions.py index e920e88..2e4b032 100644 --- a/src/swf_typed/_decisions.py +++ b/src/swf_typed/_decisions.py @@ -52,7 +52,7 @@ class CancelWorkflowExecutionDecision(Decision): type: t.ClassVar[str] = "CancelWorkflowExecution" - details: str = None + details: t.Union[str, None] = None """Execution cancellation details, usually for explanation.""" def to_api(self): @@ -70,7 +70,7 @@ class CompleteWorkflowExecutionDecision(Decision): type: t.ClassVar[str] = "CompleteWorkflowExecution" - execution_result: str = None + execution_result: t.Union[str, None] = None """Execution result.""" def to_api(self): @@ -88,16 +88,19 @@ class ContinueAsNewWorkflowExecutionDecision(Decision): type: t.ClassVar[str] = "ContinueAsNewWorkflowExecution" - execution_input: str = None + execution_input: t.Union[str, None] = None """Continuing execution input.""" - workflow_version: str = None + workflow_version: t.Union[str, None] = None """Continuing execution workflow version.""" - execution_configuration: "_executions.PartialExecutionConfiguration" = None + execution_configuration: t.Union[ + "_executions.PartialExecutionConfiguration", + None, + ] = None """Continuing execution configuration overrides.""" - tags: t.List[str] = None + tags: t.Union[t.List[str], None] = None """Continuing execution tags.""" def to_api(self): @@ -126,10 +129,10 @@ class FailWorkflowExecutionDecision(Decision): type: t.ClassVar[str] = "FailWorkflowExecution" - reason: str = None + reason: t.Union[str, None] = None """Execution failure reason, usually for classification.""" - details: str = None + details: t.Union[str, None] = None """Execution failure details, usually for explanation.""" def to_api(self): @@ -154,7 +157,7 @@ class RecordMarkerDecision(Decision): marker_name: str """Marker name.""" - details: str = None + details: t.Union[str, None] = None """Attached marker data.""" def to_api(self): @@ -191,7 +194,7 @@ class RequestCancelExternalWorkflowExecutionDecision(Decision): execution: t.Union["_executions.ExecutionId", "_executions.CurrentExecutionId"] """ID of execution to cancel.""" - control: str = None + control: t.Union[str, None] = None """Message for future deciders.""" def to_api(self): @@ -215,13 +218,13 @@ class ScheduleActivityTaskDecision(Decision): task_id: str """Task ID.""" - task_input: str = None + task_input: t.Union[str, None] = None """Task input.""" - task_configuration: "_tasks.PartialTaskConfiguration" = None + task_configuration: t.Union["_tasks.PartialTaskConfiguration", None] = None """Task configuration overrides.""" - control: str = None + control: t.Union[str, None] = None """Message for future deciders.""" def to_api(self): @@ -256,13 +259,13 @@ class ScheduleLambdaFunctionDecision(Decision): task_id: str """Task ID.""" - task_input: str = None + task_input: t.Union[str, None] = None """Lambda function input.""" task_timeout: datetime.timedelta = _common.unset """Lambda function invocation timeout.""" - control: str = None + control: t.Union[str, None] = None """Message for future deciders.""" def to_api(self): @@ -298,10 +301,10 @@ class SignalExternalWorkflowExecutionDecision(Decision): signal: str """Signal name.""" - signal_input: str = None + signal_input: t.Union[str, None] = None """Signal input.""" - control: str = None + control: t.Union[str, None] = None """Message for future deciders.""" def to_api(self): @@ -328,16 +331,19 @@ class StartChildWorkflowExecutionDecision(Decision): execution: "_executions.CurrentExecutionId" """Child execution workflow-ID.""" - execution_input: str = None + execution_input: t.Union[str, None] = None """Child execution input.""" - execution_configuration: "_executions.PartialExecutionConfiguration" = None + execution_configuration: t.Union[ + "_executions.PartialExecutionConfiguration", + None, + ] = None """Child execution configuration overrides.""" - tags: t.List[str] = None + tags: t.Union[t.List[str], None] = None """Child execution tags""" - control: str = None + control: t.Union[str, None] = None """Message for future deciders.""" def to_api(self): @@ -374,7 +380,7 @@ class StartTimerDecision(Decision): timer_duration: datetime.timedelta """Timer duration.""" - control: str = None + control: t.Union[str, None] = None """Message for future deciders.""" def to_api(self): @@ -406,7 +412,7 @@ class DecisionTask(_common.Deserialisable): decision_task_started_execution_history_event_id: int """History event ID for decision-task start.""" - previous_decision_task_started_execution_history_event_id: int = None + previous_decision_task_started_execution_history_event_id: t.Union[int, None] = None """History event ID for previous decision-task start.""" _execution_history_list: t.List["_history.Event"] = dataclasses.field(init=False) @@ -416,7 +422,9 @@ def __post_init__(self): @classmethod def from_api( - cls, data, execution_history_iter: t.Iterable["_history.Event"] = None + cls, + data, + execution_history_iter: t.Union[t.Iterable["_history.Event"], None] = None, ) -> "DecisionTask": """Deserialise decision task from SWF API response data. @@ -464,7 +472,7 @@ def execution_history(self) -> t.List["_history.Event"]: def get_number_of_pending_decision_tasks( task_list: str, domain: str, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> int: """Get the number of pending decision tasks. @@ -491,9 +499,9 @@ def get_number_of_pending_decision_tasks( def request_decision_task( task_list: str, domain: str, - decider_identity: str = None, - no_tasks_callback: t.Callable[[], None] = None, - client: "botocore.client.BaseClient" = None, + decider_identity: t.Union[str, None] = None, + no_tasks_callback: t.Union[t.Callable[[], None], None] = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> DecisionTask: """Request (poll for) a decision task; blocks until task is received. @@ -543,8 +551,8 @@ def iter_history() -> t.Generator["_history.Event", None, None]: def send_decisions( token: str, decisions: t.List[Decision], - context: str = None, - client: "botocore.client.BaseClient" = None, + context: t.Union[str, None] = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> None: """Make decisions for a workflow execution, completing decision task. diff --git a/src/swf_typed/_domains.py b/src/swf_typed/_domains.py index d0a491d..feb2392 100644 --- a/src/swf_typed/_domains.py +++ b/src/swf_typed/_domains.py @@ -24,7 +24,7 @@ class DomainInfo(_common.Deserialisable): arn: str """Domain ARN.""" - description: str = None + description: t.Union[str, None] = None """Domain description.""" @classmethod @@ -72,7 +72,7 @@ def from_api(cls, data) -> "DomainDetails": def deprecate_domain( domain: str, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> None: """Deprecate (deactivate) a domain. @@ -87,7 +87,7 @@ def deprecate_domain( def describe_domain( domain: str, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> DomainDetails: """Describe a domain. @@ -107,7 +107,7 @@ def describe_domain( def list_domains( deprecated: bool = False, reverse: bool = False, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> t.Generator[DomainInfo, None, None]: """List domains; retrieved semi-lazily. @@ -131,7 +131,7 @@ def list_domains( def get_domain_tags( domain_arn: str, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> t.Dict[str, str]: """Get a domain's tags. @@ -151,9 +151,9 @@ def get_domain_tags( def register_domain( domain: str, configuration: DomainConfiguration, - description: str = None, - tags: t.Dict[str, str] = None, - client: "botocore.client.BaseClient" = None, + description: t.Union[str, None] = None, + tags: t.Union[t.Dict[str, str], None] = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> None: """Register a new domain. @@ -182,7 +182,7 @@ def register_domain( def tag_domain( domain_arn: str, tags: t.Dict[str, str], - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> None: """Add tags to domain. @@ -199,7 +199,7 @@ def tag_domain( def undeprecate_domain( domain: str, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> None: """Undeprecate (reactivate) a domain. @@ -215,7 +215,7 @@ def undeprecate_domain( def untag_domain( domain_arn: str, tags: t.List[str], - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> None: """Remove tags from a domain. diff --git a/src/swf_typed/_executions.py b/src/swf_typed/_executions.py index 3fac67b..447710b 100644 --- a/src/swf_typed/_executions.py +++ b/src/swf_typed/_executions.py @@ -96,13 +96,13 @@ class ExecutionInfo(_common.Deserialisable): cancel_requested: bool """Execution cancellation has been requested.""" - closed: datetime.datetime = None + closed: t.Union[datetime.datetime, None] = None """Execution end-date.""" - parent: ExecutionId = None + parent: t.Union[ExecutionId, None] = None """Parent execution ID.""" - tags: t.List[str] = None + tags: t.Union[t.List[str], None] = None """Execution tags.""" @classmethod @@ -153,10 +153,10 @@ class ExecutionConfiguration(_common.Deserialisable): child_execution_policy_on_termination: ChildExecutionTerminationPolicy """Child workflow execution ending policy on termination.""" - decision_task_priority: int = None + decision_task_priority: t.Union[int, None] = None """Decision task priority.""" - lambda_iam_role_arn: str = None + lambda_iam_role_arn: t.Union[str, None] = None """Execution IAM role ARN for Lambda invocations.""" @classmethod @@ -183,9 +183,12 @@ class PartialExecutionConfiguration( timeout: t.Union[datetime.timedelta, None] = _common.unset decision_task_timeout: t.Union[datetime.timedelta, None] = _common.unset - decision_task_list: str = None - decision_task_priority: int = None - child_execution_policy_on_termination: ChildExecutionTerminationPolicy = None + decision_task_list: t.Union[str, None] = None + decision_task_priority: t.Union[int, None] = None + child_execution_policy_on_termination: t.Union[ + ChildExecutionTerminationPolicy, + None, + ] = None @classmethod def from_api(cls, data) -> "PartialExecutionConfiguration": @@ -258,7 +261,7 @@ class ExecutionOpenCounts: child_executions: int """Number of started child executions.""" - lambda_tasks: int = None + lambda_tasks: t.Union[int, None] = None """Number of scheduled/started Lambda invocations.""" @classmethod @@ -279,16 +282,16 @@ class ExecutionDetails: info: ExecutionInfo """Execution details.""" - configuration: ExecutionConfiguration = None + configuration: t.Union[ExecutionConfiguration, None] = None """Execution configuration.""" - n_open: ExecutionOpenCounts = None + n_open: t.Union[ExecutionOpenCounts, None] = None """Counts of open tasks/timers/children in execution.""" - latest_activity_task_scheduled: datetime.datetime = None + latest_activity_task_scheduled: t.Union[datetime.datetime, None] = None """Most recent activity task's scheduled's date.""" - latest_context: str = None + latest_context: t.Union[str, None] = None """Most recent decision's execution context.""" @classmethod @@ -319,7 +322,7 @@ class DateTimeFilter(_common.Serialisable): earliest: datetime.datetime """Earliest date.""" - latest: datetime.datetime = None + latest: t.Union[datetime.datetime, None] = None """Latest date.""" def to_api(self): @@ -422,14 +425,19 @@ def _get_number_of_executions( def get_number_of_closed_executions( domain: str, - time_filter: t.Union[StartTimeExecutionFilter, CloseTimeExecutionFilter] = None, + time_filter: t.Union[ + StartTimeExecutionFilter, + CloseTimeExecutionFilter, + None, + ] = None, property_filter: t.Union[ IdExecutionFilter, WorkflowTypeExecutionFilter, TagExecutionFilter, CloseStatusExecutionFilter, + None, ] = None, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> int: """Get the number of closed workflow executions. @@ -457,13 +465,14 @@ def get_number_of_closed_executions( def get_number_of_open_executions( domain: str, - started_filter: StartTimeExecutionFilter = None, + started_filter: t.Union[StartTimeExecutionFilter, None] = None, property_filter: t.Union[ IdExecutionFilter, WorkflowTypeExecutionFilter, TagExecutionFilter, + None, ] = None, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> int: """Get the number of open workflow executions. @@ -491,7 +500,7 @@ def get_number_of_open_executions( def describe_execution( execution: ExecutionId, domain: str, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> ExecutionDetails: """Describe a workflow execution. @@ -513,15 +522,20 @@ def describe_execution( def list_closed_executions( domain: str, - time_filter: t.Union[StartTimeExecutionFilter, CloseTimeExecutionFilter] = None, + time_filter: t.Union[ + StartTimeExecutionFilter, + CloseTimeExecutionFilter, + None, + ] = None, property_filter: t.Union[ IdExecutionFilter, WorkflowTypeExecutionFilter, TagExecutionFilter, CloseStatusExecutionFilter, + None, ] = None, reverse: bool = False, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> t.Generator[ExecutionInfo, None, None]: """List closed workflow executions; retrieved semi-lazily. @@ -554,14 +568,15 @@ def list_closed_executions( def list_open_executions( domain: str, - started_filter: StartTimeExecutionFilter = None, + started_filter: t.Union[StartTimeExecutionFilter, None] = None, property_filter: t.Union[ IdExecutionFilter, WorkflowTypeExecutionFilter, TagExecutionFilter, + None, ] = None, reverse: bool = False, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> t.Generator[ExecutionInfo, None, None]: """List open workflow executions; retrieved semi-lazily. @@ -595,7 +610,7 @@ def list_open_executions( def request_cancel_execution( execution: t.Union[CurrentExecutionId, ExecutionId], domain: str, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> None: """Request the cancellation of a workflow execution. @@ -618,8 +633,8 @@ def signal_execution( execution: t.Union[CurrentExecutionId, ExecutionId], signal: str, domain: str, - input_: str = None, - client: "botocore.client.BaseClient" = None, + input_: t.Union[str, None] = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> None: """Send a signal to a workflow execution. @@ -649,10 +664,10 @@ def start_execution( workflow: "_workflows.WorkflowId", execution: CurrentExecutionId, domain: str, - input: str = None, - configuration: PartialExecutionConfiguration = None, - tags: t.List[str] = None, - client: "botocore.client.BaseClient" = None, + input: t.Union[str, None] = None, + configuration: t.Union[PartialExecutionConfiguration, None] = None, + tags: t.Union[t.List[str], None] = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> ExecutionId: """Start a workflow execution. @@ -689,10 +704,10 @@ def start_execution( def terminate_execution( execution: t.Union[CurrentExecutionId, ExecutionId], domain: str, - reason: str = None, - details: str = None, - child_execution_policy: ChildExecutionTerminationPolicy = None, - client: "botocore.client.BaseClient" = None, + reason: t.Union[str, None] = None, + details: t.Union[str, None] = None, + child_execution_policy: t.Union[ChildExecutionTerminationPolicy, None] = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> None: """Terminate (immediately close) a workflow execution. diff --git a/src/swf_typed/_history.py b/src/swf_typed/_history.py index 8f15da8..0f741c9 100644 --- a/src/swf_typed/_history.py +++ b/src/swf_typed/_history.py @@ -203,10 +203,10 @@ class ActivityTaskCancelledEvent(Event): task_started_event_id: int """Task start event ID.""" - task_cancel_requested_event_id: int = None + task_cancel_requested_event_id: t.Union[int, None] = None """Task cancellation request event ID.""" - details: str = None + details: t.Union[str, None] = None """Cancellation details, usually for explanation.""" @classmethod @@ -234,7 +234,7 @@ class ActivityTaskCompletedEvent(Event): task_started_event_id: int """Task start event ID.""" - task_result: str = None + task_result: t.Union[str, None] = None """Task result.""" @classmethod @@ -261,10 +261,10 @@ class ActivityTaskFailedEvent(Event): task_started_event_id: int """Task start event ID.""" - reason: str = None + reason: t.Union[str, None] = None """Failure reason, usually for classification.""" - details: str = None + details: t.Union[str, None] = None """Failure details, usually for explanation.""" @classmethod @@ -298,10 +298,10 @@ class ActivityTaskScheduledEvent(Event): decision_event_id: int """Task schedule decision event ID.""" - task_input: str = None + task_input: t.Union[str, None] = None """Task input.""" - control: str = None + control: t.Union[str, None] = None """Message from task scheduling decider.""" @classmethod @@ -331,7 +331,7 @@ class ActivityTaskStartedEvent(Event): task_scheduled_event_id: int """Task schedule event ID.""" - worker_identity: str = None + worker_identity: t.Union[str, None] = None """Identity of worker which acquired task.""" @classmethod @@ -360,7 +360,7 @@ class ActivityTaskTimedOutEvent(Event): task_started_event_id: int """Task start event ID.""" - details: str = None + details: t.Union[str, None] = None """Most recent progress message from worker (see ``send_heartbeat``).""" @classmethod @@ -446,7 +446,7 @@ class ChildWorkflowExecutionCancelledEvent(Event): execution_started_event_id: int """Child execution start event ID.""" - details: str = None + details: t.Union[str, None] = None """Cancellation details, usually for explanation.""" @classmethod @@ -484,7 +484,7 @@ class ChildWorkflowExecutionCompletedEvent(Event): execution_started_event_id: int """Child execution start event ID.""" - execution_result: str = None + execution_result: t.Union[str, None] = None """Child execution result.""" @classmethod @@ -522,10 +522,10 @@ class ChildWorkflowExecutionFailedEvent(Event): execution_started_event_id: int """Child execution start event ID.""" - reason: str = None + reason: t.Union[str, None] = None """Failure reason, usually for classification.""" - details: str = None + details: t.Union[str, None] = None """Failure details, usually for explanation.""" @classmethod @@ -710,7 +710,7 @@ class DecisionTaskCompletedEvent(Event): decision_task_started_event_id: int """Decision task start event ID.""" - decision_context: str = None + decision_context: t.Union[str, None] = None """Context provided by decider, accessible when describing execution.""" @classmethod @@ -737,7 +737,7 @@ class DecisionTaskScheduledEvent(Event): decision_task_timeout: t.Union[datetime.timedelta, None] = _common.unset """Decision runtime timeout.""" - decision_task_priority: int = None + decision_task_priority: t.Union[int, None] = None """Decision task priority.""" @classmethod @@ -764,7 +764,7 @@ class DecisionTaskStartedEvent(Event): decision_task_scheduled_event_id: int """Decision task schedule event ID.""" - decider_identity: str = None + decider_identity: t.Union[str, None] = None """Identity of decider which acquired task.""" @classmethod @@ -894,7 +894,7 @@ class MarkerRecordedEvent(Event): decision_event_id: int """Marker record decision event ID.""" - details: str = None + details: t.Union[str, None] = None """Attached marker data.""" @classmethod @@ -924,13 +924,13 @@ class LambdaFunctionScheduledEvent(Event): decision_event_id: int """Task schedule event ID.""" - task_input: str = None + task_input: t.Union[str, None] = None """Lambda function input.""" task_timeout: datetime.timedelta = _common.unset """Lambda function invocation timeout.""" - control: str = None + control: t.Union[str, None] = None """Message from task scheduling decider.""" @classmethod @@ -981,7 +981,7 @@ class LambdaFunctionCompletedEvent(Event): task_started_event_id: int """Task start event ID.""" - task_result: str = None + task_result: t.Union[str, None] = None """Lambda function invocation result.""" @classmethod @@ -1008,10 +1008,10 @@ class LambdaFunctionFailedEvent(Event): task_started_event_id: int """Task start event ID.""" - reason: str = None + reason: t.Union[str, None] = None """Failure reason, usually for classification.""" - details: str = None + details: t.Union[str, None] = None """Failure details, usually for explanation.""" @classmethod @@ -1134,7 +1134,7 @@ class RequestCancelExternalWorkflowExecutionFailedEvent(Event): decision_event_id: int """Cancellation request decision event ID.""" - control: str = None + control: t.Union[str, None] = None """Message from cancellation requesting decider.""" @classmethod @@ -1165,7 +1165,7 @@ class RequestCancelExternalWorkflowExecutionInitiatedEvent(Event): decision_event_id: int """Cancellation request decision event ID.""" - control: str = None + control: t.Union[str, None] = None """Message from cancellation requesting decider.""" @classmethod @@ -1264,7 +1264,7 @@ class SignalExternalWorkflowExecutionFailedEvent(Event): decision_event_id: int """External workflow signal decision event ID.""" - control: str = None + control: t.Union[str, None] = None """Message from signalling decider.""" @classmethod @@ -1298,10 +1298,10 @@ class SignalExternalWorkflowExecutionInitiatedEvent(Event): decision_event_id: int """External workflow signal decision event ID.""" - signal_input: str = None + signal_input: t.Union[str, None] = None """Attached signal data.""" - control: str = None + control: t.Union[str, None] = None """Message from signalling decider.""" @classmethod @@ -1324,13 +1324,13 @@ class StartActivityTaskFailedEvent(Event): type: t.ClassVar[str] = "StartActivityTaskFailed" - task_id: str = None + task_id: t.Union[str, None] = None """ID of task to be started.""" - cause: str = None + cause: t.Union[str, None] = None """Failure cause.""" - task_scheduled_event_id: int = None + task_scheduled_event_id: t.Union[int, None] = None """Task schedule decision event ID.""" @classmethod @@ -1352,13 +1352,13 @@ class StartLambdaFunctionFailedEvent(Event): type: t.ClassVar[str] = "StartLambdaFunctionFailed" - cause: StartLambdaFailureCause = None + cause: t.Union[StartLambdaFailureCause, None] = None """Failure cause.""" - message: str = None + message: t.Union[str, None] = None """Failure explanation.""" - task_scheduled_event_id: int = None + task_scheduled_event_id: t.Union[int, None] = None """Task schedule decision event ID.""" @classmethod @@ -1396,7 +1396,7 @@ class StartChildWorkflowExecutionFailedEvent(Event): decision_event_id: int """Child workflow start decision event ID.""" - control: str = None + control: t.Union[str, None] = None """Message from child execution starting decider.""" @classmethod @@ -1439,13 +1439,13 @@ class StartChildWorkflowExecutionInitiatedEvent(Event): decision_event_id: int """Child execution start decision event ID.""" - execution_input: str = None + execution_input: t.Union[str, None] = None """Child execution input.""" - execution_tags: t.List[str] = None + execution_tags: t.Union[t.List[str], None] = None """Child execution tags.""" - control: str = None + control: t.Union[str, None] = None """Message from child execution starting decider.""" @classmethod @@ -1560,7 +1560,7 @@ class TimerStartedEvent(Event): decision_event_id: int """Timer start decision event ID.""" - control: str = None + control: t.Union[str, None] = None """Message from timer starting decider.""" @classmethod @@ -1584,13 +1584,13 @@ class WorkflowExecutionCancelRequestedEvent(Event): type: t.ClassVar[str] = "WorkflowExecutionCancelRequested" - cause: ExecutionTerminationCause = None + cause: t.Union[ExecutionTerminationCause, None] = None """Cancellation request cause.""" - cancelling_execution: "_executions.ExecutionId" = None + cancelling_execution: t.Union["_executions.ExecutionId", None] = None """Execution which requested the cancellation.""" - cancel_decision_event_id: int = None + cancel_decision_event_id: t.Union[int, None] = None """Cancellation request decision event ID in execution which requested the cancellation. """ @@ -1622,7 +1622,7 @@ class WorkflowExecutionCancelledEvent(Event): decision_event_id: int """Execution cancel decision event ID.""" - details: str = None + details: t.Union[str, None] = None """Execution cancellation details, usually for explanation.""" @classmethod @@ -1645,7 +1645,7 @@ class WorkflowExecutionCompletedEvent(Event): decision_event_id: int """Execution complete decision event ID.""" - execution_result: str = None + execution_result: t.Union[str, None] = None """Execution result.""" @classmethod @@ -1679,10 +1679,10 @@ class WorkflowExecutionContinuedAsNewEvent(Event): decision_event_id: int """Continue as new execution decision event ID.""" - execution_input: str = None + execution_input: t.Union[str, None] = None """New execution input.""" - execution_tags: t.List[str] = None + execution_tags: t.Union[t.List[str], None] = None """New execution tags.""" @classmethod @@ -1713,10 +1713,10 @@ class WorkflowExecutionFailedEvent(Event): decision_event_id: int """Execution fail decision event ID.""" - reason: str = None + reason: t.Union[str, None] = None """Failure reason, usually for classification.""" - details: str = None + details: t.Union[str, None] = None """Failure details, usually for explanation.""" @classmethod @@ -1740,13 +1740,13 @@ class WorkflowExecutionSignaledEvent(Event): signal_name: str """Signal name.""" - signal_input: str = None + signal_input: t.Union[str, None] = None """Attached signal data.""" - signalling_execution: "_executions.ExecutionId" = None + signalling_execution: t.Union["_executions.ExecutionId", None] = None """Execution which sent the signal.""" - signal_decision_event_id: int = None + signal_decision_event_id: t.Union[int, None] = None """Signal decision event ID in execution which sent the signal.""" @classmethod @@ -1779,19 +1779,19 @@ class WorkflowExecutionStartedEvent(Event): guaranteed). """ - execution_input: str = None + execution_input: t.Union[str, None] = None """Execution input.""" - execution_tags: t.List[str] = None + execution_tags: t.Union[t.List[str], None] = None """Execution tags.""" - continued_execution_run_id: str = None + continued_execution_run_id: t.Union[str, None] = None """Run ID of execution which this execution continues from.""" - parent_execution: "_executions.ExecutionId" = None + parent_execution: t.Union["_executions.ExecutionId", None] = None """Parent execution (which started this execution).""" - parent_initiated_event_id: int = None + parent_initiated_event_id: t.Union[int, None] = None """ID of event in parent execution which begins the starting of this execution.""" @@ -1827,13 +1827,13 @@ class WorkflowExecutionTerminatedEvent(Event): child_execution_policy: "_executions.ChildExecutionTerminationPolicy" """Child execution policy (how open child executions were handled).""" - cause: ExecutionTerminationCause = None + cause: t.Union[ExecutionTerminationCause, None] = None """Failure cause.""" - reason: str = None + reason: t.Union[str, None] = None """Termination reason, usually for classification.""" - details: str = None + details: t.Union[str, None] = None """Termination details, usually for explanation.""" @classmethod @@ -1898,7 +1898,7 @@ def get_execution_history( execution: "_executions.ExecutionId", domain: str, reverse: bool = False, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> t.Generator[Event, None, None]: """Get workflow execution history; retrieved semi-lazily. @@ -1925,7 +1925,7 @@ def get_execution_history( def get_last_execution_history_event( execution: "_executions.ExecutionId", domain: str, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> Event: """Get last workflow execution history event. diff --git a/src/swf_typed/_state.py b/src/swf_typed/_state.py index 252a09a..54c1a96 100644 --- a/src/swf_typed/_state.py +++ b/src/swf_typed/_state.py @@ -78,34 +78,34 @@ class TaskState: scheduled: datetime.datetime """Task scheduled date.""" - started: datetime.datetime = None + started: t.Union[datetime.datetime, None] = None """Task start date.""" - ended: datetime.datetime = None + ended: t.Union[datetime.datetime, None] = None """Task end date.""" - input: str = None + input: t.Union[str, None] = None """Task input.""" - worker_identity: str = None + worker_identity: t.Union[str, None] = None """Identity of worker which acquired task.""" cancel_requested: bool = False """Task cancellation has been requested.""" - result: str = None + result: t.Union[str, None] = None """Task result.""" - timeout_type: "_history.TimeoutType" = None + timeout_type: t.Union["_history.TimeoutType", None] = None """Task timeout type.""" - failure_reason: str = None + failure_reason: t.Union[str, None] = None """Task failure reason.""" - stop_details: str = None + stop_details: t.Union[str, None] = None """Task ended details.""" - decider_control: str = None + decider_control: t.Union[str, None] = None """Message from decider attached to task.""" @property @@ -130,28 +130,28 @@ class LambdaTaskState: scheduled: datetime.datetime """Task schedule date.""" - started: datetime.datetime = None + started: t.Union[datetime.datetime, None] = None """Lambda function invocation date.""" - ended: datetime.datetime = None + ended: t.Union[datetime.datetime, None] = None """Lambda function invocation end date.""" - timeout: datetime.timedelta = None + timeout: t.Union[datetime.timedelta, None] = None """Lambda function invocation timeout.""" - input: str = None + input: t.Union[str, None] = None """Lambda function input.""" - result: str = None + result: t.Union[str, None] = None """Lambda function result.""" - failure_reason: str = None + failure_reason: t.Union[str, None] = None """Lambda function error reason.""" - stop_details: str = None + stop_details: t.Union[str, None] = None """Lambda function ended details.""" - decider_control: str = None + decider_control: t.Union[str, None] = None """Message from decider attached to task.""" @property @@ -179,25 +179,25 @@ class ChildExecutionState: started: datetime.datetime """Child execution start date.""" - ended: datetime.datetime = None + ended: t.Union[datetime.datetime, None] = None """Child execution end date.""" - input: str = None + input: t.Union[str, None] = None """Child execution input.""" - result: str = None + result: t.Union[str, None] = None """Child execution result.""" - timeout_type: "_history.TimeoutType" = None + timeout_type: t.Union["_history.TimeoutType", None] = None """Child execution timeout type.""" - failure_reason: str = None + failure_reason: t.Union[str, None] = None """Child execution failure reason.""" - stop_details: str = None + stop_details: t.Union[str, None] = None """Child execution ended details.""" - decider_control: str = None + decider_control: t.Union[str, None] = None """Message from decider attached to child execution.""" @@ -217,13 +217,13 @@ class TimerState: started: datetime.datetime """Timer start date.""" - ended: datetime.datetime = None + ended: t.Union[datetime.datetime, None] = None """Timer finish date.""" - input: str = None + input: t.Union[str, None] = None """Timer input.""" - decider_control: str = None + decider_control: t.Union[str, None] = None """Message from decider attached to timer.""" @@ -237,7 +237,7 @@ class SignalState: received: datetime.datetime """Signal date.""" - input: str = None + input: t.Union[str, None] = None """Signal input.""" is_new: bool = True @@ -254,7 +254,7 @@ class MarkerState: recorded: datetime.datetime """Marker record date.""" - details: str = None + details: t.Union[str, None] = None """Marker details.""" is_new: bool = True @@ -277,7 +277,7 @@ class ExecutionState: started: datetime.datetime """Execution start date.""" - ended: datetime.datetime = None + ended: t.Union[datetime.datetime, None] = None """Execution end date.""" tasks: t.List[t.Union[TaskState, LambdaTaskState]] = dataclasses.field( @@ -302,22 +302,22 @@ class ExecutionState: decision_failures: t.List[DecisionFailure] = dataclasses.field(default_factory=list) """Execution decision failures.""" - input: str = None + input: t.Union[str, None] = None """Execution input.""" cancel_requested: bool = False """Execution cancellation has been requested.""" - result: str = None + result: t.Union[str, None] = None """Execution result.""" - failure_reason: str = None + failure_reason: t.Union[str, None] = None """Execution failure reason.""" - stop_details: str = None + stop_details: t.Union[str, None] = None """Execution ended details.""" - continuing_execution_run_id: str = None + continuing_execution_run_id: t.Union[str, None] = None """ID of execution continuing this execution.""" diff --git a/src/swf_typed/_tasks.py b/src/swf_typed/_tasks.py index 10480a4..3849c0a 100644 --- a/src/swf_typed/_tasks.py +++ b/src/swf_typed/_tasks.py @@ -125,7 +125,7 @@ class WorkerTask(_common.Deserialisable): task_started_execution_history_event_id: int """History event ID for task start.""" - input: str = None + input: t.Union[str, None] = None """Task input.""" @classmethod @@ -146,7 +146,7 @@ def from_api(cls, data) -> "WorkerTask": def get_number_of_pending_tasks( task_list: str, domain: str, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> int: """Get the number of pending activity tasks. @@ -173,9 +173,9 @@ def get_number_of_pending_tasks( def request_task( task_list: str, domain: str, - worker_identity: str = None, - no_tasks_callback: t.Callable[[], None] = None, - client: "botocore.client.BaseClient" = None, + worker_identity: t.Union[str, None] = None, + no_tasks_callback: t.Union[t.Callable[[], None], None] = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> WorkerTask: """Request (poll for) an activity task; blocks until task is received. @@ -208,8 +208,8 @@ def request_task( def send_heartbeat( token: str, - details: str = None, - client: "botocore.client.BaseClient" = None, + details: t.Union[str, None] = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> None: """Send a heartbeat to SWF for the current activity task. @@ -233,8 +233,8 @@ def send_heartbeat( def cancel_task( token: str, - details: str = None, - client: "botocore.client.BaseClient" = None, + details: t.Union[str, None] = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> None: """Cancel the current activity task. @@ -255,8 +255,8 @@ def cancel_task( def complete_task( token: str, - result: str = None, - client: "botocore.client.BaseClient" = None, + result: t.Union[str, None] = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> None: """Complete the current activity task. @@ -277,9 +277,9 @@ def complete_task( def fail_task( token: str, - reason: str = None, - details: str = None, - client: "botocore.client.BaseClient" = None, + reason: t.Union[str, None] = None, + details: t.Union[str, None] = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> None: """Fail the current activity task. diff --git a/src/swf_typed/_workflows.py b/src/swf_typed/_workflows.py index edef6c1..9ec1734 100644 --- a/src/swf_typed/_workflows.py +++ b/src/swf_typed/_workflows.py @@ -43,10 +43,10 @@ class WorkflowInfo(_common.Deserialisable): created: datetime.datetime """Creation date.""" - description: str = None + description: t.Union[str, None] = None """Workflow description.""" - deprecated: datetime.datetime = None + deprecated: t.Union[datetime.datetime, None] = None """Deprecation date.""" @classmethod @@ -109,7 +109,7 @@ def get_api_args(self): def delete_workflow( workflow: WorkflowId, domain: str, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> None: """Delete a (deprecated/inactive) workflow type. @@ -126,7 +126,7 @@ def delete_workflow( def deprecate_workflow( workflow: WorkflowId, domain: str, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> None: """Deprecate (deactivate) a workflow type. @@ -143,7 +143,7 @@ def deprecate_workflow( def describe_workflow( workflow: WorkflowId, domain: str, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> WorkflowDetails: """Describe a workflow type. @@ -166,9 +166,9 @@ def describe_workflow( def list_workflows( domain: str, deprecated: bool = False, - workflow_filter: WorkflowIdFilter = None, + workflow_filter: t.Union[WorkflowIdFilter, None] = None, reverse: bool = False, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> t.Generator[WorkflowInfo, None, None]: """List workflow types; retrieved semi-lazily. @@ -201,9 +201,9 @@ def list_workflows( def register_workflow( workflow: WorkflowId, domain: str, - description: str = None, - default_execution_configuration: DefaultExecutionConfiguration = None, - client: "botocore.client.BaseClient" = None, + description: t.Union[str, None] = None, + default_execution_configuration: t.Union[DefaultExecutionConfiguration, None] = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> None: """Register a new workflow type. @@ -234,7 +234,7 @@ def register_workflow( def undeprecate_workflow( workflow: WorkflowId, domain: str, - client: "botocore.client.BaseClient" = None, + client: t.Union["botocore.client.BaseClient", None] = None, ) -> None: """Undeprecate (reactivate) a workflow type.