|
1 | 1 | import asyncio |
2 | 2 | import logging |
3 | | -from enum import Enum |
4 | | -from typing import ( |
5 | | - TYPE_CHECKING, |
6 | | - Any, |
7 | | - Callable, |
8 | | - Generic, |
9 | | - Optional, |
10 | | - ParamSpec, |
11 | | - Type, |
12 | | - TypeVar, |
13 | | - Union, |
14 | | -) |
15 | | - |
16 | | -from pydantic import BaseModel, ConfigDict |
| 3 | +from typing import TYPE_CHECKING, Any, Callable, Optional, TypeVar |
| 4 | + |
17 | 5 | from typing_extensions import deprecated |
18 | 6 |
|
19 | 7 | from hatchet_sdk.clients.rest_client import RestApi |
20 | 8 | from hatchet_sdk.context.context import Context |
21 | | -from hatchet_sdk.contracts.workflows_pb2 import ( |
22 | | - ConcurrencyLimitStrategy, |
23 | | - CreateStepRateLimit, |
24 | | - CreateWorkflowJobOpts, |
25 | | - CreateWorkflowStepOpts, |
26 | | - CreateWorkflowVersionOpts, |
27 | | - DesiredWorkerLabels, |
28 | | - StickyStrategy, |
29 | | - WorkflowConcurrencyOpts, |
30 | | - WorkflowKind, |
31 | | -) |
| 9 | +from hatchet_sdk.contracts.workflows_pb2 import DesiredWorkerLabels |
32 | 10 | from hatchet_sdk.features.cron import CronClient |
33 | 11 | from hatchet_sdk.features.scheduled import ScheduledClient |
34 | 12 | from hatchet_sdk.labels import DesiredWorkerLabel |
|
48 | 26 | R = TypeVar("R") |
49 | 27 |
|
50 | 28 |
|
51 | | -class HatchetRest: |
52 | | - """ |
53 | | - Main client for interacting with the Hatchet API. |
54 | | -
|
55 | | - This class provides access to various client interfaces and utility methods |
56 | | - for working with Hatchet via the REST API, |
57 | | -
|
58 | | - Attributes: |
59 | | - rest (RestApi): Interface for REST API operations. |
60 | | - """ |
61 | | - |
62 | | - def __init__(self, config: ClientConfig = ClientConfig()): |
63 | | - self.rest = RestApi(config.server_url, config.token, config.tenant_id) |
64 | | - |
65 | | - |
66 | 29 | def transform_desired_worker_label(d: DesiredWorkerLabel) -> DesiredWorkerLabels: |
67 | 30 | value = d.value |
68 | 31 | return DesiredWorkerLabels( |
|
0 commit comments