hatchet-sdk 0.47.0__py3-none-any.whl → 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hatchet_sdk/__init__.py +25 -16
- hatchet_sdk/client.py +14 -39
- hatchet_sdk/clients/admin.py +203 -362
- hatchet_sdk/clients/dispatcher/action_listener.py +106 -84
- hatchet_sdk/clients/dispatcher/dispatcher.py +21 -21
- hatchet_sdk/clients/event_ts.py +23 -10
- hatchet_sdk/clients/events.py +96 -99
- hatchet_sdk/clients/rest/__init__.py +24 -0
- hatchet_sdk/clients/rest/api/__init__.py +2 -0
- hatchet_sdk/clients/rest/api/task_api.py +2174 -0
- hatchet_sdk/clients/rest/api/workflow_runs_api.py +638 -106
- hatchet_sdk/clients/rest/api_client.py +1 -1
- hatchet_sdk/clients/rest/configuration.py +8 -1
- hatchet_sdk/clients/rest/exceptions.py +21 -0
- hatchet_sdk/clients/rest/models/__init__.py +22 -0
- hatchet_sdk/clients/rest/models/tenant.py +4 -0
- hatchet_sdk/clients/rest/models/tenant_version.py +37 -0
- hatchet_sdk/clients/rest/models/update_tenant_request.py +7 -0
- hatchet_sdk/clients/rest/models/v1_cancel_task_request.py +104 -0
- hatchet_sdk/clients/rest/models/v1_dag_children.py +102 -0
- hatchet_sdk/clients/rest/models/v1_replay_task_request.py +104 -0
- hatchet_sdk/clients/rest/models/v1_task.py +174 -0
- hatchet_sdk/clients/rest/models/v1_task_event.py +118 -0
- hatchet_sdk/clients/rest/models/v1_task_event_list.py +110 -0
- hatchet_sdk/clients/rest/models/v1_task_event_type.py +55 -0
- hatchet_sdk/clients/rest/models/v1_task_filter.py +106 -0
- hatchet_sdk/clients/rest/models/v1_task_point_metric.py +92 -0
- hatchet_sdk/clients/rest/models/v1_task_point_metrics.py +100 -0
- hatchet_sdk/clients/rest/models/v1_task_run_metric.py +88 -0
- hatchet_sdk/clients/rest/models/v1_task_run_status.py +40 -0
- hatchet_sdk/clients/rest/models/v1_task_status.py +40 -0
- hatchet_sdk/clients/rest/models/v1_task_summary.py +212 -0
- hatchet_sdk/clients/rest/models/v1_task_summary_list.py +110 -0
- hatchet_sdk/clients/rest/models/v1_workflow_run.py +171 -0
- hatchet_sdk/clients/rest/models/v1_workflow_run_details.py +145 -0
- hatchet_sdk/clients/rest/models/v1_workflow_type.py +37 -0
- hatchet_sdk/clients/rest/models/workflow_run_shape_item_for_workflow_run_details.py +99 -0
- hatchet_sdk/clients/rest/rest.py +37 -26
- hatchet_sdk/clients/rest/tenacity_utils.py +1 -1
- hatchet_sdk/clients/rest_client.py +141 -116
- hatchet_sdk/clients/run_event_listener.py +66 -60
- hatchet_sdk/clients/workflow_listener.py +75 -66
- hatchet_sdk/config.py +117 -0
- hatchet_sdk/connection.py +27 -13
- hatchet_sdk/context/__init__.py +0 -1
- hatchet_sdk/context/context.py +118 -218
- hatchet_sdk/features/cron.py +43 -57
- hatchet_sdk/features/scheduled.py +60 -74
- hatchet_sdk/hatchet.py +192 -195
- hatchet_sdk/labels.py +4 -6
- hatchet_sdk/metadata.py +1 -1
- hatchet_sdk/opentelemetry/instrumentor.py +9 -5
- hatchet_sdk/rate_limit.py +9 -18
- hatchet_sdk/token.py +13 -9
- hatchet_sdk/utils/aio_utils.py +0 -40
- hatchet_sdk/utils/proto_enums.py +54 -0
- hatchet_sdk/utils/typing.py +9 -1
- hatchet_sdk/v0/__init__.py +251 -0
- hatchet_sdk/v0/client.py +119 -0
- hatchet_sdk/v0/clients/admin.py +541 -0
- hatchet_sdk/v0/clients/dispatcher/action_listener.py +422 -0
- hatchet_sdk/v0/clients/dispatcher/dispatcher.py +204 -0
- hatchet_sdk/v0/clients/event_ts.py +28 -0
- hatchet_sdk/v0/clients/events.py +182 -0
- hatchet_sdk/v0/clients/rest/__init__.py +307 -0
- hatchet_sdk/v0/clients/rest/api/__init__.py +19 -0
- hatchet_sdk/v0/clients/rest/api/api_token_api.py +858 -0
- hatchet_sdk/v0/clients/rest/api/default_api.py +2259 -0
- hatchet_sdk/v0/clients/rest/api/event_api.py +2548 -0
- hatchet_sdk/v0/clients/rest/api/github_api.py +331 -0
- hatchet_sdk/v0/clients/rest/api/healthcheck_api.py +483 -0
- hatchet_sdk/v0/clients/rest/api/log_api.py +449 -0
- hatchet_sdk/v0/clients/rest/api/metadata_api.py +728 -0
- hatchet_sdk/v0/clients/rest/api/rate_limits_api.py +423 -0
- hatchet_sdk/v0/clients/rest/api/slack_api.py +577 -0
- hatchet_sdk/v0/clients/rest/api/sns_api.py +872 -0
- hatchet_sdk/v0/clients/rest/api/step_run_api.py +2202 -0
- hatchet_sdk/v0/clients/rest/api/tenant_api.py +4430 -0
- hatchet_sdk/v0/clients/rest/api/user_api.py +2888 -0
- hatchet_sdk/v0/clients/rest/api/worker_api.py +858 -0
- hatchet_sdk/v0/clients/rest/api/workflow_api.py +6312 -0
- hatchet_sdk/v0/clients/rest/api/workflow_run_api.py +1932 -0
- hatchet_sdk/v0/clients/rest/api/workflow_runs_api.py +610 -0
- hatchet_sdk/v0/clients/rest/api_client.py +759 -0
- hatchet_sdk/v0/clients/rest/api_response.py +22 -0
- hatchet_sdk/v0/clients/rest/configuration.py +611 -0
- hatchet_sdk/v0/clients/rest/exceptions.py +200 -0
- hatchet_sdk/v0/clients/rest/models/__init__.py +274 -0
- hatchet_sdk/v0/clients/rest/models/accept_invite_request.py +83 -0
- hatchet_sdk/v0/clients/rest/models/api_error.py +102 -0
- hatchet_sdk/v0/clients/rest/models/api_errors.py +100 -0
- hatchet_sdk/v0/clients/rest/models/api_meta.py +144 -0
- hatchet_sdk/v0/clients/rest/models/api_meta_auth.py +85 -0
- hatchet_sdk/v0/clients/rest/models/api_meta_integration.py +88 -0
- hatchet_sdk/v0/clients/rest/models/api_meta_posthog.py +90 -0
- hatchet_sdk/v0/clients/rest/models/api_resource_meta.py +98 -0
- hatchet_sdk/v0/clients/rest/models/api_token.py +105 -0
- hatchet_sdk/v0/clients/rest/models/bulk_create_event_request.py +100 -0
- hatchet_sdk/v0/clients/rest/models/bulk_create_event_response.py +110 -0
- hatchet_sdk/v0/clients/rest/models/cancel_event_request.py +85 -0
- hatchet_sdk/v0/clients/rest/models/cancel_step_run_request.py +83 -0
- hatchet_sdk/v0/clients/rest/models/concurrency_limit_strategy.py +39 -0
- hatchet_sdk/v0/clients/rest/models/create_api_token_request.py +92 -0
- hatchet_sdk/v0/clients/rest/models/create_api_token_response.py +83 -0
- hatchet_sdk/v0/clients/rest/models/create_cron_workflow_trigger_request.py +98 -0
- hatchet_sdk/v0/clients/rest/models/create_event_request.py +95 -0
- hatchet_sdk/v0/clients/rest/models/create_pull_request_from_step_run.py +83 -0
- hatchet_sdk/v0/clients/rest/models/create_sns_integration_request.py +85 -0
- hatchet_sdk/v0/clients/rest/models/create_tenant_alert_email_group_request.py +83 -0
- hatchet_sdk/v0/clients/rest/models/create_tenant_invite_request.py +86 -0
- hatchet_sdk/v0/clients/rest/models/create_tenant_request.py +84 -0
- hatchet_sdk/v0/clients/rest/models/cron_workflows.py +131 -0
- hatchet_sdk/v0/clients/rest/models/cron_workflows_list.py +110 -0
- hatchet_sdk/v0/clients/rest/models/cron_workflows_method.py +37 -0
- hatchet_sdk/v0/clients/rest/models/cron_workflows_order_by_field.py +37 -0
- hatchet_sdk/v0/clients/rest/models/event.py +143 -0
- hatchet_sdk/v0/clients/rest/models/event_data.py +83 -0
- hatchet_sdk/v0/clients/rest/models/event_key_list.py +98 -0
- hatchet_sdk/v0/clients/rest/models/event_list.py +110 -0
- hatchet_sdk/v0/clients/rest/models/event_order_by_direction.py +37 -0
- hatchet_sdk/v0/clients/rest/models/event_order_by_field.py +36 -0
- hatchet_sdk/v0/clients/rest/models/event_update_cancel200_response.py +85 -0
- hatchet_sdk/v0/clients/rest/models/event_workflow_run_summary.py +116 -0
- hatchet_sdk/v0/clients/rest/models/events.py +110 -0
- hatchet_sdk/v0/clients/rest/models/get_step_run_diff_response.py +100 -0
- hatchet_sdk/v0/clients/rest/models/github_app_installation.py +107 -0
- hatchet_sdk/v0/clients/rest/models/github_branch.py +86 -0
- hatchet_sdk/v0/clients/rest/models/github_repo.py +86 -0
- hatchet_sdk/v0/clients/rest/models/info_get_version200_response.py +83 -0
- hatchet_sdk/v0/clients/rest/models/job.py +132 -0
- hatchet_sdk/v0/clients/rest/models/job_run.py +176 -0
- hatchet_sdk/v0/clients/rest/models/job_run_status.py +41 -0
- hatchet_sdk/v0/clients/rest/models/link_github_repository_request.py +106 -0
- hatchet_sdk/v0/clients/rest/models/list_api_tokens_response.py +110 -0
- hatchet_sdk/v0/clients/rest/models/list_github_app_installations_response.py +112 -0
- hatchet_sdk/v0/clients/rest/models/list_pull_requests_response.py +100 -0
- hatchet_sdk/v0/clients/rest/models/list_slack_webhooks.py +110 -0
- hatchet_sdk/v0/clients/rest/models/list_sns_integrations.py +110 -0
- hatchet_sdk/v0/clients/rest/models/log_line.py +94 -0
- hatchet_sdk/v0/clients/rest/models/log_line_level.py +39 -0
- hatchet_sdk/v0/clients/rest/models/log_line_list.py +110 -0
- hatchet_sdk/v0/clients/rest/models/log_line_order_by_direction.py +37 -0
- hatchet_sdk/v0/clients/rest/models/log_line_order_by_field.py +36 -0
- hatchet_sdk/v0/clients/rest/models/pagination_response.py +95 -0
- hatchet_sdk/v0/clients/rest/models/pull_request.py +112 -0
- hatchet_sdk/v0/clients/rest/models/pull_request_state.py +37 -0
- hatchet_sdk/v0/clients/rest/models/queue_metrics.py +97 -0
- hatchet_sdk/v0/clients/rest/models/rate_limit.py +117 -0
- hatchet_sdk/v0/clients/rest/models/rate_limit_list.py +110 -0
- hatchet_sdk/v0/clients/rest/models/rate_limit_order_by_direction.py +37 -0
- hatchet_sdk/v0/clients/rest/models/rate_limit_order_by_field.py +38 -0
- hatchet_sdk/v0/clients/rest/models/recent_step_runs.py +118 -0
- hatchet_sdk/v0/clients/rest/models/reject_invite_request.py +83 -0
- hatchet_sdk/v0/clients/rest/models/replay_event_request.py +85 -0
- hatchet_sdk/v0/clients/rest/models/replay_workflow_runs_request.py +85 -0
- hatchet_sdk/v0/clients/rest/models/replay_workflow_runs_response.py +100 -0
- hatchet_sdk/v0/clients/rest/models/rerun_step_run_request.py +83 -0
- hatchet_sdk/v0/clients/rest/models/schedule_workflow_run_request.py +92 -0
- hatchet_sdk/v0/clients/rest/models/scheduled_run_status.py +42 -0
- hatchet_sdk/v0/clients/rest/models/scheduled_workflows.py +149 -0
- hatchet_sdk/v0/clients/rest/models/scheduled_workflows_list.py +110 -0
- hatchet_sdk/v0/clients/rest/models/scheduled_workflows_method.py +37 -0
- hatchet_sdk/v0/clients/rest/models/scheduled_workflows_order_by_field.py +37 -0
- hatchet_sdk/v0/clients/rest/models/semaphore_slots.py +113 -0
- hatchet_sdk/v0/clients/rest/models/slack_webhook.py +127 -0
- hatchet_sdk/v0/clients/rest/models/sns_integration.py +114 -0
- hatchet_sdk/v0/clients/rest/models/step.py +123 -0
- hatchet_sdk/v0/clients/rest/models/step_run.py +202 -0
- hatchet_sdk/v0/clients/rest/models/step_run_archive.py +142 -0
- hatchet_sdk/v0/clients/rest/models/step_run_archive_list.py +110 -0
- hatchet_sdk/v0/clients/rest/models/step_run_diff.py +91 -0
- hatchet_sdk/v0/clients/rest/models/step_run_event.py +122 -0
- hatchet_sdk/v0/clients/rest/models/step_run_event_list.py +110 -0
- hatchet_sdk/v0/clients/rest/models/step_run_event_reason.py +52 -0
- hatchet_sdk/v0/clients/rest/models/step_run_event_severity.py +38 -0
- hatchet_sdk/v0/clients/rest/models/step_run_status.py +44 -0
- hatchet_sdk/v0/clients/rest/models/tenant.py +118 -0
- hatchet_sdk/v0/clients/rest/models/tenant_alert_email_group.py +98 -0
- hatchet_sdk/v0/clients/rest/models/tenant_alert_email_group_list.py +112 -0
- hatchet_sdk/v0/clients/rest/models/tenant_alerting_settings.py +143 -0
- hatchet_sdk/v0/clients/rest/models/tenant_invite.py +120 -0
- hatchet_sdk/v0/clients/rest/models/tenant_invite_list.py +110 -0
- hatchet_sdk/v0/clients/rest/models/tenant_list.py +110 -0
- hatchet_sdk/v0/clients/rest/models/tenant_member.py +123 -0
- hatchet_sdk/v0/clients/rest/models/tenant_member_list.py +110 -0
- hatchet_sdk/v0/clients/rest/models/tenant_member_role.py +38 -0
- hatchet_sdk/v0/clients/rest/models/tenant_queue_metrics.py +116 -0
- hatchet_sdk/v0/clients/rest/models/tenant_resource.py +40 -0
- hatchet_sdk/v0/clients/rest/models/tenant_resource_limit.py +135 -0
- hatchet_sdk/v0/clients/rest/models/tenant_resource_policy.py +102 -0
- hatchet_sdk/v0/clients/rest/models/tenant_step_run_queue_metrics.py +83 -0
- hatchet_sdk/v0/clients/rest/models/trigger_workflow_run_request.py +91 -0
- hatchet_sdk/v0/clients/rest/models/update_tenant_alert_email_group_request.py +83 -0
- hatchet_sdk/v0/clients/rest/models/update_tenant_invite_request.py +85 -0
- hatchet_sdk/v0/clients/rest/models/update_tenant_request.py +137 -0
- hatchet_sdk/v0/clients/rest/models/update_worker_request.py +87 -0
- hatchet_sdk/v0/clients/rest/models/user.py +126 -0
- hatchet_sdk/v0/clients/rest/models/user_change_password_request.py +88 -0
- hatchet_sdk/v0/clients/rest/models/user_login_request.py +86 -0
- hatchet_sdk/v0/clients/rest/models/user_register_request.py +91 -0
- hatchet_sdk/v0/clients/rest/models/user_tenant_memberships_list.py +110 -0
- hatchet_sdk/v0/clients/rest/models/user_tenant_public.py +86 -0
- hatchet_sdk/v0/clients/rest/models/webhook_worker.py +100 -0
- hatchet_sdk/v0/clients/rest/models/webhook_worker_create_request.py +94 -0
- hatchet_sdk/v0/clients/rest/models/webhook_worker_create_response.py +98 -0
- hatchet_sdk/v0/clients/rest/models/webhook_worker_created.py +102 -0
- hatchet_sdk/v0/clients/rest/models/webhook_worker_list_response.py +110 -0
- hatchet_sdk/v0/clients/rest/models/webhook_worker_request.py +102 -0
- hatchet_sdk/v0/clients/rest/models/webhook_worker_request_list_response.py +104 -0
- hatchet_sdk/v0/clients/rest/models/webhook_worker_request_method.py +38 -0
- hatchet_sdk/v0/clients/rest/models/worker.py +239 -0
- hatchet_sdk/v0/clients/rest/models/worker_label.py +102 -0
- hatchet_sdk/v0/clients/rest/models/worker_list.py +110 -0
- hatchet_sdk/v0/clients/rest/models/worker_runtime_info.py +103 -0
- hatchet_sdk/v0/clients/rest/models/worker_runtime_sdks.py +38 -0
- hatchet_sdk/v0/clients/rest/models/worker_type.py +38 -0
- hatchet_sdk/v0/clients/rest/models/workflow.py +165 -0
- hatchet_sdk/v0/clients/rest/models/workflow_concurrency.py +107 -0
- hatchet_sdk/v0/clients/rest/models/workflow_deployment_config.py +136 -0
- hatchet_sdk/v0/clients/rest/models/workflow_kind.py +38 -0
- hatchet_sdk/v0/clients/rest/models/workflow_list.py +120 -0
- hatchet_sdk/v0/clients/rest/models/workflow_metrics.py +97 -0
- hatchet_sdk/v0/clients/rest/models/workflow_run.py +188 -0
- hatchet_sdk/v0/clients/rest/models/workflow_run_cancel200_response.py +85 -0
- hatchet_sdk/v0/clients/rest/models/workflow_run_list.py +110 -0
- hatchet_sdk/v0/clients/rest/models/workflow_run_order_by_direction.py +37 -0
- hatchet_sdk/v0/clients/rest/models/workflow_run_order_by_field.py +39 -0
- hatchet_sdk/v0/clients/rest/models/workflow_run_shape.py +186 -0
- hatchet_sdk/v0/clients/rest/models/workflow_run_status.py +42 -0
- hatchet_sdk/v0/clients/rest/models/workflow_run_triggered_by.py +112 -0
- hatchet_sdk/v0/clients/rest/models/workflow_runs_cancel_request.py +85 -0
- hatchet_sdk/v0/clients/rest/models/workflow_runs_metrics.py +94 -0
- hatchet_sdk/v0/clients/rest/models/workflow_runs_metrics_counts.py +104 -0
- hatchet_sdk/v0/clients/rest/models/workflow_tag.py +84 -0
- hatchet_sdk/v0/clients/rest/models/workflow_trigger_cron_ref.py +86 -0
- hatchet_sdk/v0/clients/rest/models/workflow_trigger_event_ref.py +86 -0
- hatchet_sdk/v0/clients/rest/models/workflow_triggers.py +141 -0
- hatchet_sdk/v0/clients/rest/models/workflow_update_request.py +85 -0
- hatchet_sdk/v0/clients/rest/models/workflow_version.py +170 -0
- hatchet_sdk/v0/clients/rest/models/workflow_version_concurrency.py +114 -0
- hatchet_sdk/v0/clients/rest/models/workflow_version_definition.py +85 -0
- hatchet_sdk/v0/clients/rest/models/workflow_version_meta.py +123 -0
- hatchet_sdk/v0/clients/rest/models/workflow_workers_count.py +95 -0
- hatchet_sdk/v0/clients/rest/rest.py +187 -0
- hatchet_sdk/v0/clients/rest/tenacity_utils.py +39 -0
- hatchet_sdk/v0/clients/rest_client.py +613 -0
- hatchet_sdk/v0/clients/run_event_listener.py +260 -0
- hatchet_sdk/v0/clients/workflow_listener.py +277 -0
- hatchet_sdk/v0/connection.py +63 -0
- hatchet_sdk/v0/context/__init__.py +1 -0
- hatchet_sdk/v0/context/context.py +446 -0
- hatchet_sdk/v0/context/worker_context.py +28 -0
- hatchet_sdk/v0/contracts/dispatcher_pb2.py +102 -0
- hatchet_sdk/v0/contracts/dispatcher_pb2.pyi +387 -0
- hatchet_sdk/v0/contracts/dispatcher_pb2_grpc.py +621 -0
- hatchet_sdk/v0/contracts/events_pb2.py +46 -0
- hatchet_sdk/v0/contracts/events_pb2.pyi +87 -0
- hatchet_sdk/v0/contracts/events_pb2_grpc.py +274 -0
- hatchet_sdk/v0/contracts/workflows_pb2.py +80 -0
- hatchet_sdk/v0/contracts/workflows_pb2.pyi +312 -0
- hatchet_sdk/v0/contracts/workflows_pb2_grpc.py +277 -0
- hatchet_sdk/v0/features/cron.py +286 -0
- hatchet_sdk/v0/features/scheduled.py +248 -0
- hatchet_sdk/v0/hatchet.py +310 -0
- hatchet_sdk/v0/labels.py +10 -0
- hatchet_sdk/v0/logger.py +13 -0
- hatchet_sdk/v0/metadata.py +2 -0
- hatchet_sdk/v0/opentelemetry/instrumentor.py +396 -0
- hatchet_sdk/v0/rate_limit.py +126 -0
- hatchet_sdk/v0/semver.py +30 -0
- hatchet_sdk/v0/token.py +27 -0
- hatchet_sdk/v0/utils/aio_utils.py +137 -0
- hatchet_sdk/v0/utils/backoff.py +9 -0
- hatchet_sdk/v0/utils/typing.py +12 -0
- hatchet_sdk/{v2 → v0/v2}/callable.py +8 -8
- hatchet_sdk/{v2 → v0/v2}/concurrency.py +2 -2
- hatchet_sdk/{v2 → v0/v2}/hatchet.py +10 -10
- hatchet_sdk/v0/worker/__init__.py +1 -0
- hatchet_sdk/v0/worker/action_listener_process.py +278 -0
- hatchet_sdk/v0/worker/runner/run_loop_manager.py +112 -0
- hatchet_sdk/v0/worker/runner/runner.py +460 -0
- hatchet_sdk/v0/worker/runner/utils/capture_logs.py +81 -0
- hatchet_sdk/v0/worker/runner/utils/error_with_traceback.py +6 -0
- hatchet_sdk/v0/worker/worker.py +391 -0
- hatchet_sdk/v0/workflow.py +261 -0
- hatchet_sdk/v0/workflow_run.py +59 -0
- hatchet_sdk/worker/__init__.py +0 -1
- hatchet_sdk/worker/action_listener_process.py +36 -33
- hatchet_sdk/worker/runner/run_loop_manager.py +18 -16
- hatchet_sdk/worker/runner/runner.py +32 -60
- hatchet_sdk/worker/runner/utils/capture_logs.py +25 -14
- hatchet_sdk/worker/runner/utils/error_with_traceback.py +1 -1
- hatchet_sdk/worker/worker.py +61 -75
- hatchet_sdk/workflow.py +473 -207
- hatchet_sdk/workflow_run.py +5 -18
- {hatchet_sdk-0.47.0.dist-info → hatchet_sdk-1.0.0.dist-info}/METADATA +2 -1
- hatchet_sdk-1.0.0.dist-info/RECORD +485 -0
- hatchet_sdk/utils/serialization.py +0 -18
- hatchet_sdk-0.47.0.dist-info/RECORD +0 -237
- /hatchet_sdk/{loader.py → v0/loader.py} +0 -0
- /hatchet_sdk/{utils → v0/utils}/types.py +0 -0
- {hatchet_sdk-0.47.0.dist-info → hatchet_sdk-1.0.0.dist-info}/WHEEL +0 -0
- {hatchet_sdk-0.47.0.dist-info → hatchet_sdk-1.0.0.dist-info}/entry_points.txt +0 -0
|
@@ -2,7 +2,7 @@ import asyncio
|
|
|
2
2
|
import atexit
|
|
3
3
|
import datetime
|
|
4
4
|
import threading
|
|
5
|
-
from typing import
|
|
5
|
+
from typing import Coroutine, TypeVar
|
|
6
6
|
|
|
7
7
|
from pydantic import StrictInt
|
|
8
8
|
|
|
@@ -11,14 +11,13 @@ from hatchet_sdk.clients.rest.api.log_api import LogApi
|
|
|
11
11
|
from hatchet_sdk.clients.rest.api.step_run_api import StepRunApi
|
|
12
12
|
from hatchet_sdk.clients.rest.api.workflow_api import WorkflowApi
|
|
13
13
|
from hatchet_sdk.clients.rest.api.workflow_run_api import WorkflowRunApi
|
|
14
|
-
from hatchet_sdk.clients.rest.api.workflow_runs_api import WorkflowRunsApi
|
|
15
14
|
from hatchet_sdk.clients.rest.api_client import ApiClient
|
|
16
15
|
from hatchet_sdk.clients.rest.configuration import Configuration
|
|
17
|
-
from hatchet_sdk.clients.rest.models import TriggerWorkflowRunRequest
|
|
18
16
|
from hatchet_sdk.clients.rest.models.create_cron_workflow_trigger_request import (
|
|
19
17
|
CreateCronWorkflowTriggerRequest,
|
|
20
18
|
)
|
|
21
19
|
from hatchet_sdk.clients.rest.models.cron_workflows import CronWorkflows
|
|
20
|
+
from hatchet_sdk.clients.rest.models.cron_workflows_list import CronWorkflowsList
|
|
22
21
|
from hatchet_sdk.clients.rest.models.cron_workflows_order_by_field import (
|
|
23
22
|
CronWorkflowsOrderByField,
|
|
24
23
|
)
|
|
@@ -27,6 +26,9 @@ from hatchet_sdk.clients.rest.models.event_order_by_direction import (
|
|
|
27
26
|
EventOrderByDirection,
|
|
28
27
|
)
|
|
29
28
|
from hatchet_sdk.clients.rest.models.event_order_by_field import EventOrderByField
|
|
29
|
+
from hatchet_sdk.clients.rest.models.event_update_cancel200_response import (
|
|
30
|
+
EventUpdateCancel200Response,
|
|
31
|
+
)
|
|
30
32
|
from hatchet_sdk.clients.rest.models.log_line_level import LogLineLevel
|
|
31
33
|
from hatchet_sdk.clients.rest.models.log_line_list import LogLineList
|
|
32
34
|
from hatchet_sdk.clients.rest.models.log_line_order_by_direction import (
|
|
@@ -44,16 +46,19 @@ from hatchet_sdk.clients.rest.models.schedule_workflow_run_request import (
|
|
|
44
46
|
ScheduleWorkflowRunRequest,
|
|
45
47
|
)
|
|
46
48
|
from hatchet_sdk.clients.rest.models.scheduled_workflows import ScheduledWorkflows
|
|
49
|
+
from hatchet_sdk.clients.rest.models.scheduled_workflows_list import (
|
|
50
|
+
ScheduledWorkflowsList,
|
|
51
|
+
)
|
|
47
52
|
from hatchet_sdk.clients.rest.models.scheduled_workflows_order_by_field import (
|
|
48
53
|
ScheduledWorkflowsOrderByField,
|
|
49
54
|
)
|
|
55
|
+
from hatchet_sdk.clients.rest.models.trigger_workflow_run_request import (
|
|
56
|
+
TriggerWorkflowRunRequest,
|
|
57
|
+
)
|
|
50
58
|
from hatchet_sdk.clients.rest.models.workflow import Workflow
|
|
51
59
|
from hatchet_sdk.clients.rest.models.workflow_kind import WorkflowKind
|
|
52
60
|
from hatchet_sdk.clients.rest.models.workflow_list import WorkflowList
|
|
53
61
|
from hatchet_sdk.clients.rest.models.workflow_run import WorkflowRun
|
|
54
|
-
from hatchet_sdk.clients.rest.models.workflow_run_cancel200_response import (
|
|
55
|
-
WorkflowRunCancel200Response,
|
|
56
|
-
)
|
|
57
62
|
from hatchet_sdk.clients.rest.models.workflow_run_list import WorkflowRunList
|
|
58
63
|
from hatchet_sdk.clients.rest.models.workflow_run_order_by_direction import (
|
|
59
64
|
WorkflowRunOrderByDirection,
|
|
@@ -66,9 +71,21 @@ from hatchet_sdk.clients.rest.models.workflow_runs_cancel_request import (
|
|
|
66
71
|
WorkflowRunsCancelRequest,
|
|
67
72
|
)
|
|
68
73
|
from hatchet_sdk.clients.rest.models.workflow_version import WorkflowVersion
|
|
74
|
+
from hatchet_sdk.utils.typing import JSONSerializableMapping
|
|
75
|
+
|
|
76
|
+
## Type variables to use with coroutines.
|
|
77
|
+
## See https://stackoverflow.com/questions/73240620/the-right-way-to-type-hint-a-coroutine-function
|
|
78
|
+
## Return type
|
|
79
|
+
R = TypeVar("R")
|
|
69
80
|
|
|
81
|
+
## Yield type
|
|
82
|
+
Y = TypeVar("Y")
|
|
70
83
|
|
|
71
|
-
|
|
84
|
+
## Send type
|
|
85
|
+
S = TypeVar("S")
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
class RestApi:
|
|
72
89
|
def __init__(self, host: str, api_key: str, tenant_id: str):
|
|
73
90
|
self.tenant_id = tenant_id
|
|
74
91
|
|
|
@@ -77,65 +94,85 @@ class AsyncRestApi:
|
|
|
77
94
|
access_token=api_key,
|
|
78
95
|
)
|
|
79
96
|
|
|
80
|
-
self.
|
|
81
|
-
self.
|
|
82
|
-
self.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
self.
|
|
97
|
+
self._loop = asyncio.new_event_loop()
|
|
98
|
+
self._thread = threading.Thread(target=self._run_event_loop, daemon=True)
|
|
99
|
+
self._thread.start()
|
|
100
|
+
|
|
101
|
+
# Register the cleanup method to be called on exit
|
|
102
|
+
atexit.register(self._cleanup)
|
|
103
|
+
|
|
104
|
+
## IMPORTANT: These clients need to be instantiated lazily because they rely on
|
|
105
|
+
## an event loop to be running, which may not be the case when the `Hatchet` client is instantiated.
|
|
106
|
+
self._api_client: ApiClient | None = None
|
|
107
|
+
self._workflow_api: WorkflowApi | None = None
|
|
108
|
+
self._workflow_run_api: WorkflowRunApi | None = None
|
|
109
|
+
self._step_run_api: StepRunApi | None = None
|
|
110
|
+
self._event_api: EventApi | None = None
|
|
111
|
+
self._log_api: LogApi | None = None
|
|
86
112
|
|
|
87
113
|
@property
|
|
88
|
-
def api_client(self):
|
|
114
|
+
def api_client(self) -> ApiClient:
|
|
115
|
+
## IMPORTANT: This client needs to be instantiated lazily because it relies on an event
|
|
116
|
+
## loop to be running, which may not be the case when the `Hatchet` client is instantiated.
|
|
89
117
|
if self._api_client is None:
|
|
90
118
|
self._api_client = ApiClient(configuration=self.config)
|
|
91
119
|
return self._api_client
|
|
92
120
|
|
|
93
121
|
@property
|
|
94
|
-
def workflow_api(self):
|
|
122
|
+
def workflow_api(self) -> WorkflowApi:
|
|
123
|
+
## IMPORTANT: This client needs to be instantiated lazily because it relies on an event
|
|
124
|
+
## loop to be running, which may not be the case when the `Hatchet` client is instantiated.
|
|
95
125
|
if self._workflow_api is None:
|
|
96
126
|
self._workflow_api = WorkflowApi(self.api_client)
|
|
97
127
|
return self._workflow_api
|
|
98
128
|
|
|
99
129
|
@property
|
|
100
|
-
def workflow_run_api(self):
|
|
130
|
+
def workflow_run_api(self) -> WorkflowRunApi:
|
|
131
|
+
## IMPORTANT: This client needs to be instantiated lazily because it relies on an event
|
|
132
|
+
## loop to be running, which may not be the case when the `Hatchet` client is instantiated.
|
|
101
133
|
if self._workflow_run_api is None:
|
|
102
134
|
self._workflow_run_api = WorkflowRunApi(self.api_client)
|
|
103
135
|
return self._workflow_run_api
|
|
104
136
|
|
|
105
137
|
@property
|
|
106
|
-
def step_run_api(self):
|
|
138
|
+
def step_run_api(self) -> StepRunApi:
|
|
139
|
+
## IMPORTANT: This client needs to be instantiated lazily because it relies on an event
|
|
140
|
+
## loop to be running, which may not be the case when the `Hatchet` client is instantiated.
|
|
107
141
|
if self._step_run_api is None:
|
|
108
142
|
self._step_run_api = StepRunApi(self.api_client)
|
|
109
143
|
return self._step_run_api
|
|
110
144
|
|
|
111
145
|
@property
|
|
112
|
-
def event_api(self):
|
|
146
|
+
def event_api(self) -> EventApi:
|
|
147
|
+
## IMPORTANT: This client needs to be instantiated lazily because it relies on an event
|
|
148
|
+
## loop to be running, which may not be the case when the `Hatchet` client is instantiated.
|
|
113
149
|
if self._event_api is None:
|
|
114
150
|
self._event_api = EventApi(self.api_client)
|
|
115
151
|
return self._event_api
|
|
116
152
|
|
|
117
153
|
@property
|
|
118
|
-
def log_api(self):
|
|
154
|
+
def log_api(self) -> LogApi:
|
|
155
|
+
## IMPORTANT: This client needs to be instantiated lazily because it relies on an event
|
|
156
|
+
## loop to be running, which may not be the case when the `Hatchet` client is instantiated.
|
|
119
157
|
if self._log_api is None:
|
|
120
158
|
self._log_api = LogApi(self.api_client)
|
|
121
159
|
return self._log_api
|
|
122
160
|
|
|
123
|
-
async def close(self):
|
|
161
|
+
async def close(self) -> None:
|
|
124
162
|
# Ensure the aiohttp client session is closed
|
|
125
|
-
|
|
126
|
-
await self._api_client.close()
|
|
163
|
+
await self.api_client.close() # type: ignore[no-untyped-call]
|
|
127
164
|
|
|
128
|
-
async def
|
|
165
|
+
async def aio_list_workflows(self) -> WorkflowList:
|
|
129
166
|
return await self.workflow_api.workflow_list(
|
|
130
167
|
tenant=self.tenant_id,
|
|
131
168
|
)
|
|
132
169
|
|
|
133
|
-
async def
|
|
170
|
+
async def aio_get_workflow(self, workflow_id: str) -> Workflow:
|
|
134
171
|
return await self.workflow_api.workflow_get(
|
|
135
172
|
workflow=workflow_id,
|
|
136
173
|
)
|
|
137
174
|
|
|
138
|
-
async def
|
|
175
|
+
async def aio_get_workflow_version(
|
|
139
176
|
self, workflow_id: str, version: str | None = None
|
|
140
177
|
) -> WorkflowVersion:
|
|
141
178
|
return await self.workflow_api.workflow_version_get(
|
|
@@ -143,7 +180,7 @@ class AsyncRestApi:
|
|
|
143
180
|
version=version,
|
|
144
181
|
)
|
|
145
182
|
|
|
146
|
-
async def
|
|
183
|
+
async def aio_list_workflow_runs(
|
|
147
184
|
self,
|
|
148
185
|
workflow_id: str | None = None,
|
|
149
186
|
offset: int | None = None,
|
|
@@ -172,25 +209,25 @@ class AsyncRestApi:
|
|
|
172
209
|
order_by_direction=order_by_direction,
|
|
173
210
|
)
|
|
174
211
|
|
|
175
|
-
async def
|
|
212
|
+
async def aio_get_workflow_run(self, workflow_run_id: str) -> WorkflowRun:
|
|
176
213
|
return await self.workflow_api.workflow_run_get(
|
|
177
214
|
tenant=self.tenant_id,
|
|
178
215
|
workflow_run=workflow_run_id,
|
|
179
216
|
)
|
|
180
217
|
|
|
181
|
-
async def
|
|
218
|
+
async def aio_replay_workflow_run(
|
|
182
219
|
self, workflow_run_ids: list[str]
|
|
183
220
|
) -> ReplayWorkflowRunsResponse:
|
|
184
221
|
return await self.workflow_run_api.workflow_run_update_replay(
|
|
185
222
|
tenant=self.tenant_id,
|
|
186
223
|
replay_workflow_runs_request=ReplayWorkflowRunsRequest(
|
|
187
|
-
|
|
224
|
+
workflowRunIds=workflow_run_ids,
|
|
188
225
|
),
|
|
189
226
|
)
|
|
190
227
|
|
|
191
|
-
async def
|
|
228
|
+
async def aio_cancel_workflow_run(
|
|
192
229
|
self, workflow_run_id: str
|
|
193
|
-
) ->
|
|
230
|
+
) -> EventUpdateCancel200Response:
|
|
194
231
|
return await self.workflow_run_api.workflow_run_cancel(
|
|
195
232
|
tenant=self.tenant_id,
|
|
196
233
|
workflow_runs_cancel_request=WorkflowRunsCancelRequest(
|
|
@@ -198,9 +235,9 @@ class AsyncRestApi:
|
|
|
198
235
|
),
|
|
199
236
|
)
|
|
200
237
|
|
|
201
|
-
async def
|
|
238
|
+
async def aio_bulk_cancel_workflow_runs(
|
|
202
239
|
self, workflow_run_ids: list[str]
|
|
203
|
-
) ->
|
|
240
|
+
) -> EventUpdateCancel200Response:
|
|
204
241
|
return await self.workflow_run_api.workflow_run_cancel(
|
|
205
242
|
tenant=self.tenant_id,
|
|
206
243
|
workflow_runs_cancel_request=WorkflowRunsCancelRequest(
|
|
@@ -208,48 +245,48 @@ class AsyncRestApi:
|
|
|
208
245
|
),
|
|
209
246
|
)
|
|
210
247
|
|
|
211
|
-
async def
|
|
248
|
+
async def aio_create_workflow_run(
|
|
212
249
|
self,
|
|
213
250
|
workflow_id: str,
|
|
214
|
-
input:
|
|
251
|
+
input: JSONSerializableMapping,
|
|
215
252
|
version: str | None = None,
|
|
216
|
-
additional_metadata:
|
|
253
|
+
additional_metadata: JSONSerializableMapping = {},
|
|
217
254
|
) -> WorkflowRun:
|
|
218
255
|
return await self.workflow_run_api.workflow_run_create(
|
|
219
256
|
workflow=workflow_id,
|
|
220
257
|
version=version,
|
|
221
258
|
trigger_workflow_run_request=TriggerWorkflowRunRequest(
|
|
222
|
-
input=input,
|
|
223
|
-
|
|
259
|
+
input=dict(input),
|
|
260
|
+
additionalMetadata=dict(additional_metadata),
|
|
224
261
|
),
|
|
225
262
|
)
|
|
226
263
|
|
|
227
|
-
async def
|
|
264
|
+
async def aio_create_cron(
|
|
228
265
|
self,
|
|
229
266
|
workflow_name: str,
|
|
230
267
|
cron_name: str,
|
|
231
268
|
expression: str,
|
|
232
|
-
input:
|
|
233
|
-
additional_metadata:
|
|
234
|
-
):
|
|
269
|
+
input: JSONSerializableMapping,
|
|
270
|
+
additional_metadata: JSONSerializableMapping,
|
|
271
|
+
) -> CronWorkflows:
|
|
235
272
|
return await self.workflow_run_api.cron_workflow_trigger_create(
|
|
236
273
|
tenant=self.tenant_id,
|
|
237
274
|
workflow=workflow_name,
|
|
238
275
|
create_cron_workflow_trigger_request=CreateCronWorkflowTriggerRequest(
|
|
239
276
|
cronName=cron_name,
|
|
240
277
|
cronExpression=expression,
|
|
241
|
-
input=input,
|
|
242
|
-
|
|
278
|
+
input=dict(input),
|
|
279
|
+
additionalMetadata=dict(additional_metadata),
|
|
243
280
|
),
|
|
244
281
|
)
|
|
245
282
|
|
|
246
|
-
async def
|
|
247
|
-
|
|
283
|
+
async def aio_delete_cron(self, cron_trigger_id: str) -> None:
|
|
284
|
+
await self.workflow_api.workflow_cron_delete(
|
|
248
285
|
tenant=self.tenant_id,
|
|
249
286
|
cron_workflow=cron_trigger_id,
|
|
250
287
|
)
|
|
251
288
|
|
|
252
|
-
async def
|
|
289
|
+
async def aio_list_crons(
|
|
253
290
|
self,
|
|
254
291
|
offset: StrictInt | None = None,
|
|
255
292
|
limit: StrictInt | None = None,
|
|
@@ -257,7 +294,7 @@ class AsyncRestApi:
|
|
|
257
294
|
additional_metadata: list[str] | None = None,
|
|
258
295
|
order_by_field: CronWorkflowsOrderByField | None = None,
|
|
259
296
|
order_by_direction: WorkflowRunOrderByDirection | None = None,
|
|
260
|
-
):
|
|
297
|
+
) -> CronWorkflowsList:
|
|
261
298
|
return await self.workflow_api.cron_workflow_list(
|
|
262
299
|
tenant=self.tenant_id,
|
|
263
300
|
offset=offset,
|
|
@@ -268,36 +305,36 @@ class AsyncRestApi:
|
|
|
268
305
|
order_by_direction=order_by_direction,
|
|
269
306
|
)
|
|
270
307
|
|
|
271
|
-
async def
|
|
308
|
+
async def aio_get_cron(self, cron_trigger_id: str) -> CronWorkflows:
|
|
272
309
|
return await self.workflow_api.workflow_cron_get(
|
|
273
310
|
tenant=self.tenant_id,
|
|
274
311
|
cron_workflow=cron_trigger_id,
|
|
275
312
|
)
|
|
276
313
|
|
|
277
|
-
async def
|
|
314
|
+
async def aio_create_schedule(
|
|
278
315
|
self,
|
|
279
316
|
name: str,
|
|
280
317
|
trigger_at: datetime.datetime,
|
|
281
|
-
input:
|
|
282
|
-
additional_metadata:
|
|
283
|
-
):
|
|
318
|
+
input: JSONSerializableMapping,
|
|
319
|
+
additional_metadata: JSONSerializableMapping,
|
|
320
|
+
) -> ScheduledWorkflows:
|
|
284
321
|
return await self.workflow_run_api.scheduled_workflow_run_create(
|
|
285
322
|
tenant=self.tenant_id,
|
|
286
323
|
workflow=name,
|
|
287
324
|
schedule_workflow_run_request=ScheduleWorkflowRunRequest(
|
|
288
325
|
triggerAt=trigger_at,
|
|
289
|
-
input=input,
|
|
290
|
-
|
|
326
|
+
input=dict(input),
|
|
327
|
+
additionalMetadata=dict(additional_metadata),
|
|
291
328
|
),
|
|
292
329
|
)
|
|
293
330
|
|
|
294
|
-
async def
|
|
295
|
-
|
|
331
|
+
async def aio_delete_schedule(self, scheduled_trigger_id: str) -> None:
|
|
332
|
+
await self.workflow_api.workflow_scheduled_delete(
|
|
296
333
|
tenant=self.tenant_id,
|
|
297
334
|
scheduled_workflow_run=scheduled_trigger_id,
|
|
298
335
|
)
|
|
299
336
|
|
|
300
|
-
async def
|
|
337
|
+
async def aio_list_schedule(
|
|
301
338
|
self,
|
|
302
339
|
offset: StrictInt | None = None,
|
|
303
340
|
limit: StrictInt | None = None,
|
|
@@ -307,7 +344,7 @@ class AsyncRestApi:
|
|
|
307
344
|
parent_step_run_id: str | None = None,
|
|
308
345
|
order_by_field: ScheduledWorkflowsOrderByField | None = None,
|
|
309
346
|
order_by_direction: WorkflowRunOrderByDirection | None = None,
|
|
310
|
-
):
|
|
347
|
+
) -> ScheduledWorkflowsList:
|
|
311
348
|
return await self.workflow_api.workflow_scheduled_list(
|
|
312
349
|
tenant=self.tenant_id,
|
|
313
350
|
offset=offset,
|
|
@@ -320,13 +357,13 @@ class AsyncRestApi:
|
|
|
320
357
|
order_by_direction=order_by_direction,
|
|
321
358
|
)
|
|
322
359
|
|
|
323
|
-
async def
|
|
360
|
+
async def aio_get_schedule(self, scheduled_trigger_id: str) -> ScheduledWorkflows:
|
|
324
361
|
return await self.workflow_api.workflow_scheduled_get(
|
|
325
362
|
tenant=self.tenant_id,
|
|
326
363
|
scheduled_workflow_run=scheduled_trigger_id,
|
|
327
364
|
)
|
|
328
365
|
|
|
329
|
-
async def
|
|
366
|
+
async def aio_list_logs(
|
|
330
367
|
self,
|
|
331
368
|
step_run_id: str,
|
|
332
369
|
offset: int | None = None,
|
|
@@ -346,7 +383,7 @@ class AsyncRestApi:
|
|
|
346
383
|
order_by_direction=order_by_direction,
|
|
347
384
|
)
|
|
348
385
|
|
|
349
|
-
async def
|
|
386
|
+
async def aio_list_events(
|
|
350
387
|
self,
|
|
351
388
|
offset: int | None = None,
|
|
352
389
|
limit: int | None = None,
|
|
@@ -371,44 +408,32 @@ class AsyncRestApi:
|
|
|
371
408
|
additional_metadata=additional_metadata,
|
|
372
409
|
)
|
|
373
410
|
|
|
374
|
-
async def
|
|
411
|
+
async def aio_replay_events(self, event_ids: list[str] | EventList) -> EventList:
|
|
375
412
|
if isinstance(event_ids, EventList):
|
|
376
|
-
|
|
413
|
+
rows = event_ids.rows or []
|
|
414
|
+
event_ids = [r.metadata.id for r in rows]
|
|
377
415
|
|
|
378
|
-
return self.event_api.event_update_replay(
|
|
416
|
+
return await self.event_api.event_update_replay(
|
|
379
417
|
tenant=self.tenant_id,
|
|
380
418
|
replay_event_request=ReplayEventRequest(eventIds=event_ids),
|
|
381
419
|
)
|
|
382
420
|
|
|
383
|
-
|
|
384
|
-
class RestApi:
|
|
385
|
-
def __init__(self, host: str, api_key: str, tenant_id: str):
|
|
386
|
-
self._loop = asyncio.new_event_loop()
|
|
387
|
-
self._thread = threading.Thread(target=self._run_event_loop, daemon=True)
|
|
388
|
-
self._thread.start()
|
|
389
|
-
|
|
390
|
-
# Initialize AsyncRestApi inside the event loop to ensure an active loop
|
|
391
|
-
self.aio = AsyncRestApi(host, api_key, tenant_id)
|
|
392
|
-
|
|
393
|
-
# Register the cleanup method to be called on exit
|
|
394
|
-
atexit.register(self._cleanup)
|
|
395
|
-
|
|
396
|
-
def _cleanup(self):
|
|
421
|
+
def _cleanup(self) -> None:
|
|
397
422
|
"""
|
|
398
423
|
Stop the running thread and clean up the event loop.
|
|
399
424
|
"""
|
|
400
|
-
self._run_coroutine(self.
|
|
425
|
+
self._run_coroutine(self.close())
|
|
401
426
|
self._loop.call_soon_threadsafe(self._loop.stop)
|
|
402
427
|
self._thread.join()
|
|
403
428
|
|
|
404
|
-
def _run_event_loop(self):
|
|
429
|
+
def _run_event_loop(self) -> None:
|
|
405
430
|
"""
|
|
406
431
|
Run the asyncio event loop in a separate thread.
|
|
407
432
|
"""
|
|
408
433
|
asyncio.set_event_loop(self._loop)
|
|
409
434
|
self._loop.run_forever()
|
|
410
435
|
|
|
411
|
-
def _run_coroutine(self, coro) ->
|
|
436
|
+
def _run_coroutine(self, coro: Coroutine[Y, S, R]) -> R:
|
|
412
437
|
"""
|
|
413
438
|
Execute a coroutine in the event loop and return the result.
|
|
414
439
|
"""
|
|
@@ -416,15 +441,15 @@ class RestApi:
|
|
|
416
441
|
return future.result()
|
|
417
442
|
|
|
418
443
|
def workflow_list(self) -> WorkflowList:
|
|
419
|
-
return self._run_coroutine(self.
|
|
444
|
+
return self._run_coroutine(self.aio_list_workflows())
|
|
420
445
|
|
|
421
446
|
def workflow_get(self, workflow_id: str) -> Workflow:
|
|
422
|
-
return self._run_coroutine(self.
|
|
447
|
+
return self._run_coroutine(self.aio_get_workflow(workflow_id))
|
|
423
448
|
|
|
424
449
|
def workflow_version_get(
|
|
425
450
|
self, workflow_id: str, version: str | None = None
|
|
426
451
|
) -> WorkflowVersion:
|
|
427
|
-
return self._run_coroutine(self.
|
|
452
|
+
return self._run_coroutine(self.aio_get_workflow_version(workflow_id, version))
|
|
428
453
|
|
|
429
454
|
def workflow_run_list(
|
|
430
455
|
self,
|
|
@@ -441,7 +466,7 @@ class RestApi:
|
|
|
441
466
|
order_by_direction: WorkflowRunOrderByDirection | None = None,
|
|
442
467
|
) -> WorkflowRunList:
|
|
443
468
|
return self._run_coroutine(
|
|
444
|
-
self.
|
|
469
|
+
self.aio_list_workflow_runs(
|
|
445
470
|
workflow_id=workflow_id,
|
|
446
471
|
offset=offset,
|
|
447
472
|
limit=limit,
|
|
@@ -457,25 +482,25 @@ class RestApi:
|
|
|
457
482
|
)
|
|
458
483
|
|
|
459
484
|
def workflow_run_get(self, workflow_run_id: str) -> WorkflowRun:
|
|
460
|
-
return self._run_coroutine(self.
|
|
485
|
+
return self._run_coroutine(self.aio_get_workflow_run(workflow_run_id))
|
|
461
486
|
|
|
462
|
-
def workflow_run_cancel(self, workflow_run_id: str) ->
|
|
463
|
-
return self._run_coroutine(self.
|
|
487
|
+
def workflow_run_cancel(self, workflow_run_id: str) -> EventUpdateCancel200Response:
|
|
488
|
+
return self._run_coroutine(self.aio_cancel_workflow_run(workflow_run_id))
|
|
464
489
|
|
|
465
490
|
def workflow_run_bulk_cancel(
|
|
466
491
|
self, workflow_run_ids: list[str]
|
|
467
|
-
) ->
|
|
468
|
-
return self._run_coroutine(self.
|
|
492
|
+
) -> EventUpdateCancel200Response:
|
|
493
|
+
return self._run_coroutine(self.aio_bulk_cancel_workflow_runs(workflow_run_ids))
|
|
469
494
|
|
|
470
495
|
def workflow_run_create(
|
|
471
496
|
self,
|
|
472
497
|
workflow_id: str,
|
|
473
|
-
input:
|
|
498
|
+
input: JSONSerializableMapping,
|
|
474
499
|
version: str | None = None,
|
|
475
|
-
additional_metadata:
|
|
500
|
+
additional_metadata: JSONSerializableMapping = {},
|
|
476
501
|
) -> WorkflowRun:
|
|
477
502
|
return self._run_coroutine(
|
|
478
|
-
self.
|
|
503
|
+
self.aio_create_workflow_run(
|
|
479
504
|
workflow_id, input, version, additional_metadata
|
|
480
505
|
)
|
|
481
506
|
)
|
|
@@ -485,17 +510,17 @@ class RestApi:
|
|
|
485
510
|
workflow_name: str,
|
|
486
511
|
cron_name: str,
|
|
487
512
|
expression: str,
|
|
488
|
-
input:
|
|
489
|
-
additional_metadata:
|
|
513
|
+
input: JSONSerializableMapping,
|
|
514
|
+
additional_metadata: JSONSerializableMapping,
|
|
490
515
|
) -> CronWorkflows:
|
|
491
516
|
return self._run_coroutine(
|
|
492
|
-
self.
|
|
517
|
+
self.aio_create_cron(
|
|
493
518
|
workflow_name, cron_name, expression, input, additional_metadata
|
|
494
519
|
)
|
|
495
520
|
)
|
|
496
521
|
|
|
497
|
-
def cron_delete(self, cron_trigger_id: str):
|
|
498
|
-
|
|
522
|
+
def cron_delete(self, cron_trigger_id: str) -> None:
|
|
523
|
+
self._run_coroutine(self.aio_delete_cron(cron_trigger_id))
|
|
499
524
|
|
|
500
525
|
def cron_list(
|
|
501
526
|
self,
|
|
@@ -505,9 +530,9 @@ class RestApi:
|
|
|
505
530
|
additional_metadata: list[str] | None = None,
|
|
506
531
|
order_by_field: CronWorkflowsOrderByField | None = None,
|
|
507
532
|
order_by_direction: WorkflowRunOrderByDirection | None = None,
|
|
508
|
-
):
|
|
533
|
+
) -> CronWorkflowsList:
|
|
509
534
|
return self._run_coroutine(
|
|
510
|
-
self.
|
|
535
|
+
self.aio_list_crons(
|
|
511
536
|
offset,
|
|
512
537
|
limit,
|
|
513
538
|
workflow_id,
|
|
@@ -517,24 +542,24 @@ class RestApi:
|
|
|
517
542
|
)
|
|
518
543
|
)
|
|
519
544
|
|
|
520
|
-
def cron_get(self, cron_trigger_id: str):
|
|
521
|
-
return self._run_coroutine(self.
|
|
545
|
+
def cron_get(self, cron_trigger_id: str) -> CronWorkflows:
|
|
546
|
+
return self._run_coroutine(self.aio_get_cron(cron_trigger_id))
|
|
522
547
|
|
|
523
548
|
def schedule_create(
|
|
524
549
|
self,
|
|
525
550
|
workflow_name: str,
|
|
526
551
|
trigger_at: datetime.datetime,
|
|
527
|
-
input:
|
|
528
|
-
additional_metadata:
|
|
529
|
-
):
|
|
552
|
+
input: JSONSerializableMapping,
|
|
553
|
+
additional_metadata: JSONSerializableMapping,
|
|
554
|
+
) -> ScheduledWorkflows:
|
|
530
555
|
return self._run_coroutine(
|
|
531
|
-
self.
|
|
556
|
+
self.aio_create_schedule(
|
|
532
557
|
workflow_name, trigger_at, input, additional_metadata
|
|
533
558
|
)
|
|
534
559
|
)
|
|
535
560
|
|
|
536
|
-
def schedule_delete(self, scheduled_trigger_id: str):
|
|
537
|
-
|
|
561
|
+
def schedule_delete(self, scheduled_trigger_id: str) -> None:
|
|
562
|
+
self._run_coroutine(self.aio_delete_schedule(scheduled_trigger_id))
|
|
538
563
|
|
|
539
564
|
def schedule_list(
|
|
540
565
|
self,
|
|
@@ -544,9 +569,9 @@ class RestApi:
|
|
|
544
569
|
additional_metadata: list[str] | None = None,
|
|
545
570
|
order_by_field: CronWorkflowsOrderByField | None = None,
|
|
546
571
|
order_by_direction: WorkflowRunOrderByDirection | None = None,
|
|
547
|
-
):
|
|
572
|
+
) -> ScheduledWorkflowsList:
|
|
548
573
|
return self._run_coroutine(
|
|
549
|
-
self.
|
|
574
|
+
self.aio_list_schedule(
|
|
550
575
|
offset,
|
|
551
576
|
limit,
|
|
552
577
|
workflow_id,
|
|
@@ -556,8 +581,8 @@ class RestApi:
|
|
|
556
581
|
)
|
|
557
582
|
)
|
|
558
583
|
|
|
559
|
-
def schedule_get(self, scheduled_trigger_id: str):
|
|
560
|
-
return self._run_coroutine(self.
|
|
584
|
+
def schedule_get(self, scheduled_trigger_id: str) -> ScheduledWorkflows:
|
|
585
|
+
return self._run_coroutine(self.aio_get_schedule(scheduled_trigger_id))
|
|
561
586
|
|
|
562
587
|
def list_logs(
|
|
563
588
|
self,
|
|
@@ -570,7 +595,7 @@ class RestApi:
|
|
|
570
595
|
order_by_direction: LogLineOrderByDirection | None = None,
|
|
571
596
|
) -> LogLineList:
|
|
572
597
|
return self._run_coroutine(
|
|
573
|
-
self.
|
|
598
|
+
self.aio_list_logs(
|
|
574
599
|
step_run_id=step_run_id,
|
|
575
600
|
offset=offset,
|
|
576
601
|
limit=limit,
|
|
@@ -594,7 +619,7 @@ class RestApi:
|
|
|
594
619
|
additional_metadata: list[str] | None = None,
|
|
595
620
|
) -> EventList:
|
|
596
621
|
return self._run_coroutine(
|
|
597
|
-
self.
|
|
622
|
+
self.aio_list_events(
|
|
598
623
|
offset=offset,
|
|
599
624
|
limit=limit,
|
|
600
625
|
keys=keys,
|
|
@@ -608,4 +633,4 @@ class RestApi:
|
|
|
608
633
|
)
|
|
609
634
|
|
|
610
635
|
def events_replay(self, event_ids: list[str] | EventList) -> EventList:
|
|
611
|
-
return self._run_coroutine(self.
|
|
636
|
+
return self._run_coroutine(self.aio_replay_events(event_ids))
|