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
10,011 changes: 0 additions & 10,011 deletions temporalio/client.py

This file was deleted.

330 changes: 330 additions & 0 deletions temporalio/client/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,330 @@
"""Client for accessing Temporal."""

from __future__ import annotations

from temporalio.activity import ActivityCancellationDetails
from temporalio.converter import (
ActivitySerializationContext,
DataConverter,
SerializationContext,
StorageDriverActivityInfo,
StorageDriverStoreContext,
StorageDriverWorkflowInfo,
WithSerializationContext,
WorkflowSerializationContext,
)
from temporalio.service import (
ConnectConfig,
DnsLoadBalancingConfig,
HttpConnectProxyConfig,
KeepAliveConfig,
RetryConfig,
RPCError,
RPCStatusCode,
ServiceClient,
TLSConfig,
)

from ..common import HeaderCodecBehavior
from ..types import (
AnyType,
CallableAsyncNoParam,
CallableAsyncSingleParam,
CallableSyncNoParam,
CallableSyncSingleParam,
LocalReturnType,
MethodAsyncNoParam,
MethodAsyncSingleParam,
MethodSyncOrAsyncNoParam,
MethodSyncOrAsyncSingleParam,
MultiParamSpec,
ParamType,
ReturnType,
SelfType,
)
from ._activity import (
ActivityExecution,
ActivityExecutionAsyncIterator,
ActivityExecutionCount,
ActivityExecutionCountAggregationGroup,
ActivityExecutionDescription,
ActivityExecutionStatus,
ActivityHandle,
AsyncActivityHandle,
AsyncActivityIDReference,
PendingActivityState,
)
from ._callback import (
Callback,
)
from ._client import (
Client,
ClientConfig,
ClientConnectConfig,
)
from ._cloud import (
CloudOperationsClient,
)
from ._exceptions import (
ActivityFailureError,
AsyncActivityCancelledError,
RPCTimeoutOrCancelledError,
ScheduleAlreadyRunningError,
WorkflowContinuedAsNewError,
WorkflowFailureError,
WorkflowQueryFailedError,
WorkflowQueryRejectedError,
WorkflowUpdateFailedError,
WorkflowUpdateRPCTimeoutOrCancelledError,
)
from ._helpers import _history_from_json
from ._interceptor import (
BackfillScheduleInput,
CancelActivityInput,
CancelWorkflowInput,
CompleteAsyncActivityInput,
CountActivitiesInput,
CountWorkflowsInput,
CreateScheduleInput,
DeleteScheduleInput,
DescribeActivityInput,
DescribeScheduleInput,
DescribeWorkflowInput,
FailAsyncActivityInput,
FetchWorkflowHistoryEventsInput,
GetWorkerBuildIdCompatibilityInput,
GetWorkerTaskReachabilityInput,
HeartbeatAsyncActivityInput,
Interceptor,
ListActivitiesInput,
ListSchedulesInput,
ListWorkflowsInput,
OutboundInterceptor,
PauseScheduleInput,
QueryWorkflowInput,
ReportCancellationAsyncActivityInput,
SignalWorkflowInput,
StartActivityInput,
StartWorkflowInput,
StartWorkflowUpdateInput,
StartWorkflowUpdateWithStartInput,
TerminateActivityInput,
TerminateWorkflowInput,
TriggerScheduleInput,
UnpauseScheduleInput,
UpdateScheduleInput,
UpdateWithStartStartWorkflowInput,
UpdateWithStartUpdateWorkflowInput,
UpdateWorkerBuildIdCompatibilityInput,
)
from ._plugin import (
Plugin,
)
from ._schedule import (
Schedule,
ScheduleAction,
ScheduleActionExecution,
ScheduleActionExecutionStartWorkflow,
ScheduleActionResult,
ScheduleActionStartWorkflow,
ScheduleAsyncIterator,
ScheduleBackfill,
ScheduleCalendarSpec,
ScheduleDescription,
ScheduleHandle,
ScheduleInfo,
ScheduleIntervalSpec,
ScheduleListAction,
ScheduleListActionStartWorkflow,
ScheduleListDescription,
ScheduleListInfo,
ScheduleListSchedule,
ScheduleListState,
ScheduleOverlapPolicy,
SchedulePolicy,
ScheduleRange,
ScheduleSpec,
ScheduleState,
ScheduleUpdate,
ScheduleUpdateInput,
)
from ._worker_versioning import (
BuildIdOp,
BuildIdOpAddNewCompatible,
BuildIdOpAddNewDefault,
BuildIdOpMergeSets,
BuildIdOpPromoteBuildIdWithinSet,
BuildIdOpPromoteSetByBuildId,
BuildIdReachability,
BuildIdVersionSet,
TaskReachabilityType,
WorkerBuildIdVersionSets,
WorkerTaskReachability,
)
from ._workflow import (
WithStartWorkflowOperation,
WorkflowExecution,
WorkflowExecutionAsyncIterator,
WorkflowExecutionCount,
WorkflowExecutionCountAggregationGroup,
WorkflowExecutionDescription,
WorkflowExecutionStatus,
WorkflowHandle,
WorkflowHistory,
WorkflowHistoryEventAsyncIterator,
WorkflowHistoryEventFilterType,
WorkflowUpdateHandle,
WorkflowUpdateStage,
)

__all__ = [
"Client",
"ClientConnectConfig",
"ClientConfig",
"WorkflowHistoryEventFilterType",
"WorkflowHandle",
"WithStartWorkflowOperation",
"WorkflowExecution",
"WorkflowExecutionDescription",
"WorkflowExecutionStatus",
"WorkflowExecutionCount",
"WorkflowExecutionCountAggregationGroup",
"WorkflowExecutionAsyncIterator",
"WorkflowHistory",
"WorkflowHistoryEventAsyncIterator",
"WorkflowUpdateHandle",
"WorkflowUpdateStage",
"ActivityExecutionAsyncIterator",
"ActivityExecution",
"ActivityExecutionDescription",
"ActivityExecutionStatus",
"PendingActivityState",
"ActivityExecutionCount",
"ActivityExecutionCountAggregationGroup",
"AsyncActivityIDReference",
"AsyncActivityHandle",
"ActivityHandle",
"ScheduleHandle",
"ScheduleSpec",
"ScheduleRange",
"ScheduleCalendarSpec",
"ScheduleIntervalSpec",
"ScheduleAction",
"ScheduleActionStartWorkflow",
"ScheduleOverlapPolicy",
"ScheduleBackfill",
"SchedulePolicy",
"ScheduleState",
"Schedule",
"ScheduleDescription",
"ScheduleInfo",
"ScheduleActionExecution",
"ScheduleActionExecutionStartWorkflow",
"ScheduleActionResult",
"ScheduleUpdateInput",
"ScheduleUpdate",
"ScheduleListDescription",
"ScheduleListSchedule",
"ScheduleListAction",
"ScheduleListActionStartWorkflow",
"ScheduleListInfo",
"ScheduleListState",
"ScheduleAsyncIterator",
"WorkflowFailureError",
"WorkflowContinuedAsNewError",
"WorkflowQueryRejectedError",
"WorkflowQueryFailedError",
"WorkflowUpdateFailedError",
"RPCTimeoutOrCancelledError",
"WorkflowUpdateRPCTimeoutOrCancelledError",
"ActivityFailureError",
"AsyncActivityCancelledError",
"ScheduleAlreadyRunningError",
"StartWorkflowInput",
"CancelWorkflowInput",
"DescribeWorkflowInput",
"FetchWorkflowHistoryEventsInput",
"ListWorkflowsInput",
"CountWorkflowsInput",
"QueryWorkflowInput",
"SignalWorkflowInput",
"TerminateWorkflowInput",
"StartActivityInput",
"CancelActivityInput",
"TerminateActivityInput",
"DescribeActivityInput",
"ListActivitiesInput",
"CountActivitiesInput",
"StartWorkflowUpdateInput",
"UpdateWithStartUpdateWorkflowInput",
"UpdateWithStartStartWorkflowInput",
"StartWorkflowUpdateWithStartInput",
"HeartbeatAsyncActivityInput",
"CompleteAsyncActivityInput",
"FailAsyncActivityInput",
"ReportCancellationAsyncActivityInput",
"CreateScheduleInput",
"ListSchedulesInput",
"BackfillScheduleInput",
"DeleteScheduleInput",
"DescribeScheduleInput",
"PauseScheduleInput",
"TriggerScheduleInput",
"UnpauseScheduleInput",
"UpdateScheduleInput",
"UpdateWorkerBuildIdCompatibilityInput",
"GetWorkerBuildIdCompatibilityInput",
"GetWorkerTaskReachabilityInput",
"Interceptor",
"OutboundInterceptor",
"WorkerBuildIdVersionSets",
"BuildIdVersionSet",
"BuildIdOp",
"BuildIdOpAddNewDefault",
"BuildIdOpAddNewCompatible",
"BuildIdOpPromoteSetByBuildId",
"BuildIdOpPromoteBuildIdWithinSet",
"BuildIdOpMergeSets",
"WorkerTaskReachability",
"BuildIdReachability",
"TaskReachabilityType",
"CloudOperationsClient",
"Plugin",
"Callback",
"_history_from_json",
# Re-export Temporal-owned names that old temporalio/client.py imported at
# module scope so explicit imports from temporalio.client keep working.
"ActivityCancellationDetails",
"ActivitySerializationContext",
"DataConverter",
"SerializationContext",
"StorageDriverActivityInfo",
"StorageDriverStoreContext",
"StorageDriverWorkflowInfo",
"WithSerializationContext",
"WorkflowSerializationContext",
"ConnectConfig",
"DnsLoadBalancingConfig",
"HttpConnectProxyConfig",
"KeepAliveConfig",
"RetryConfig",
"RPCError",
"RPCStatusCode",
"ServiceClient",
"TLSConfig",
"HeaderCodecBehavior",
"AnyType",
"CallableAsyncNoParam",
"CallableAsyncSingleParam",
"CallableSyncNoParam",
"CallableSyncSingleParam",
"LocalReturnType",
"MethodAsyncNoParam",
"MethodAsyncSingleParam",
"MethodSyncOrAsyncNoParam",
"MethodSyncOrAsyncSingleParam",
"MultiParamSpec",
"ParamType",
"ReturnType",
"SelfType",
]
Loading
Loading