Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/swf_typed/_activities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand All @@ -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.

Expand All @@ -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.

Expand All @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion src/swf_typed/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
68 changes: 38 additions & 30 deletions src/swf_typed/_decisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand All @@ -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):
Expand Down Expand Up @@ -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):
Expand All @@ -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):
Expand Down Expand Up @@ -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):
Expand All @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand All @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand All @@ -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.

Expand Down Expand Up @@ -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.

Expand All @@ -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.

Expand Down Expand Up @@ -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.

Expand Down
22 changes: 11 additions & 11 deletions src/swf_typed/_domains.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class DomainInfo(_common.Deserialisable):
arn: str
"""Domain ARN."""

description: str = None
description: t.Union[str, None] = None
"""Domain description."""

@classmethod
Expand Down Expand Up @@ -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.

Expand All @@ -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.

Expand All @@ -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.

Expand All @@ -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.

Expand All @@ -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.

Expand Down Expand Up @@ -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.

Expand All @@ -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.

Expand All @@ -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.

Expand Down
Loading
Loading