hatchet-sdk 0.40.0a9__py3-none-any.whl → 0.42.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.

Potentially problematic release.


This version of hatchet-sdk might be problematic. Click here for more details.

Files changed (152) hide show
  1. hatchet_sdk/clients/admin.py +129 -59
  2. hatchet_sdk/clients/dispatcher/action_listener.py +25 -2
  3. hatchet_sdk/clients/events.py +91 -52
  4. hatchet_sdk/clients/rest/__init__.py +21 -0
  5. hatchet_sdk/clients/rest/api/api_token_api.py +12 -9
  6. hatchet_sdk/clients/rest/api/default_api.py +24 -18
  7. hatchet_sdk/clients/rest/api/event_api.py +32 -24
  8. hatchet_sdk/clients/rest/api/github_api.py +4 -3
  9. hatchet_sdk/clients/rest/api/log_api.py +4 -3
  10. hatchet_sdk/clients/rest/api/metadata_api.py +12 -9
  11. hatchet_sdk/clients/rest/api/rate_limits_api.py +7 -4
  12. hatchet_sdk/clients/rest/api/slack_api.py +8 -6
  13. hatchet_sdk/clients/rest/api/sns_api.py +12 -9
  14. hatchet_sdk/clients/rest/api/step_run_api.py +28 -21
  15. hatchet_sdk/clients/rest/api/tenant_api.py +67 -49
  16. hatchet_sdk/clients/rest/api/user_api.py +24 -18
  17. hatchet_sdk/clients/rest/api/worker_api.py +12 -9
  18. hatchet_sdk/clients/rest/api/workflow_api.py +3073 -936
  19. hatchet_sdk/clients/rest/api/workflow_run_api.py +669 -21
  20. hatchet_sdk/clients/rest/api_client.py +34 -11
  21. hatchet_sdk/clients/rest/configuration.py +161 -36
  22. hatchet_sdk/clients/rest/models/__init__.py +21 -0
  23. hatchet_sdk/clients/rest/models/api_errors.py +3 -3
  24. hatchet_sdk/clients/rest/models/bulk_create_event_request.py +3 -3
  25. hatchet_sdk/clients/rest/models/bulk_create_event_response.py +3 -3
  26. hatchet_sdk/clients/{cloud_rest/models/managed_worker_create_request_build_config_steps_inner.py → rest/models/create_cron_workflow_trigger_request.py} +18 -14
  27. hatchet_sdk/clients/{cloud_rest/models/github_app_list_installations200_response_rows_inner.py → rest/models/cron_workflows.py} +54 -21
  28. hatchet_sdk/clients/{cloud_rest/models/log_list200_response.py → rest/models/cron_workflows_list.py} +13 -22
  29. hatchet_sdk/clients/rest/models/cron_workflows_order_by_field.py +37 -0
  30. hatchet_sdk/clients/rest/models/event_list.py +3 -3
  31. hatchet_sdk/clients/rest/models/get_step_run_diff_response.py +3 -3
  32. hatchet_sdk/clients/rest/models/job.py +3 -3
  33. hatchet_sdk/clients/rest/models/job_run.py +3 -3
  34. hatchet_sdk/clients/rest/models/list_api_tokens_response.py +3 -3
  35. hatchet_sdk/clients/rest/models/list_pull_requests_response.py +3 -3
  36. hatchet_sdk/clients/rest/models/list_slack_webhooks.py +3 -3
  37. hatchet_sdk/clients/rest/models/list_sns_integrations.py +3 -3
  38. hatchet_sdk/clients/rest/models/log_line_list.py +3 -3
  39. hatchet_sdk/clients/rest/models/rate_limit_list.py +3 -3
  40. hatchet_sdk/clients/rest/models/replay_workflow_runs_response.py +3 -3
  41. hatchet_sdk/clients/{cloud_rest/models/log_list200_response_rows_inner.py → rest/models/schedule_workflow_run_request.py} +12 -12
  42. hatchet_sdk/clients/rest/models/scheduled_run_status.py +42 -0
  43. hatchet_sdk/clients/rest/models/scheduled_workflows.py +153 -0
  44. hatchet_sdk/clients/{cloud_rest/models/managed_worker_list200_response.py → rest/models/scheduled_workflows_list.py} +13 -22
  45. hatchet_sdk/clients/rest/models/scheduled_workflows_order_by_field.py +37 -0
  46. hatchet_sdk/clients/rest/models/step_run_archive_list.py +3 -3
  47. hatchet_sdk/clients/rest/models/step_run_event_list.py +3 -3
  48. hatchet_sdk/clients/rest/models/tenant_alert_email_group_list.py +3 -3
  49. hatchet_sdk/clients/rest/models/tenant_invite_list.py +3 -3
  50. hatchet_sdk/clients/rest/models/tenant_list.py +3 -3
  51. hatchet_sdk/clients/rest/models/tenant_member_list.py +3 -3
  52. hatchet_sdk/clients/rest/models/tenant_queue_metrics.py +16 -0
  53. hatchet_sdk/clients/rest/models/tenant_resource_policy.py +3 -3
  54. hatchet_sdk/clients/rest/models/tenant_step_run_queue_metrics.py +1 -1
  55. hatchet_sdk/clients/rest/models/user_tenant_memberships_list.py +3 -3
  56. hatchet_sdk/clients/rest/models/webhook_worker_list_response.py +3 -3
  57. hatchet_sdk/clients/rest/models/webhook_worker_request_list_response.py +3 -3
  58. hatchet_sdk/clients/rest/models/worker.py +20 -9
  59. hatchet_sdk/clients/rest/models/worker_list.py +3 -3
  60. hatchet_sdk/clients/{cloud_rest/models/tenant_billing_state_get200_response_payment_methods_inner.py → rest/models/worker_runtime_info.py} +23 -19
  61. hatchet_sdk/clients/rest/models/worker_runtime_sdks.py +38 -0
  62. hatchet_sdk/clients/rest/models/workflow.py +9 -9
  63. hatchet_sdk/clients/rest/models/workflow_list.py +3 -3
  64. hatchet_sdk/clients/rest/models/workflow_run.py +3 -3
  65. hatchet_sdk/clients/rest/models/workflow_run_list.py +3 -3
  66. hatchet_sdk/clients/rest/models/workflow_run_shape.py +3 -3
  67. hatchet_sdk/clients/rest/models/workflow_runs_metrics.py +1 -5
  68. hatchet_sdk/clients/rest/models/workflow_triggers.py +6 -6
  69. hatchet_sdk/clients/rest/models/workflow_version.py +3 -3
  70. hatchet_sdk/clients/rest/rest.py +3 -3
  71. hatchet_sdk/clients/rest_client.py +200 -21
  72. hatchet_sdk/contracts/dispatcher_pb2.py +71 -67
  73. hatchet_sdk/contracts/dispatcher_pb2.pyi +31 -2
  74. hatchet_sdk/contracts/events_pb2.pyi +2 -0
  75. hatchet_sdk/contracts/workflows_pb2.py +42 -40
  76. hatchet_sdk/contracts/workflows_pb2.pyi +24 -6
  77. hatchet_sdk/features/cron.py +286 -0
  78. hatchet_sdk/features/scheduled.py +248 -0
  79. hatchet_sdk/hatchet.py +80 -79
  80. hatchet_sdk/loader.py +37 -14
  81. hatchet_sdk/utils/serialization.py +15 -0
  82. hatchet_sdk/utils/tracing.py +67 -0
  83. hatchet_sdk/worker/runner/runner.py +158 -112
  84. hatchet_sdk/worker/worker.py +1 -17
  85. hatchet_sdk/workflow.py +4 -0
  86. {hatchet_sdk-0.40.0a9.dist-info → hatchet_sdk-0.42.0.dist-info}/METADATA +8 -2
  87. {hatchet_sdk-0.40.0a9.dist-info → hatchet_sdk-0.42.0.dist-info}/RECORD +89 -143
  88. {hatchet_sdk-0.40.0a9.dist-info → hatchet_sdk-0.42.0.dist-info}/entry_points.txt +1 -1
  89. hatchet_sdk/clients/cloud_rest/__init__.py +0 -186
  90. hatchet_sdk/clients/cloud_rest/api/__init__.py +0 -14
  91. hatchet_sdk/clients/cloud_rest/api/billing_api.py +0 -819
  92. hatchet_sdk/clients/cloud_rest/api/build_api.py +0 -298
  93. hatchet_sdk/clients/cloud_rest/api/feature_flags_api.py +0 -295
  94. hatchet_sdk/clients/cloud_rest/api/github_api.py +0 -1347
  95. hatchet_sdk/clients/cloud_rest/api/log_api.py +0 -971
  96. hatchet_sdk/clients/cloud_rest/api/managed_worker_api.py +0 -2546
  97. hatchet_sdk/clients/cloud_rest/api/metadata_api.py +0 -265
  98. hatchet_sdk/clients/cloud_rest/api/metrics_api.py +0 -1026
  99. hatchet_sdk/clients/cloud_rest/api/tenant_api.py +0 -301
  100. hatchet_sdk/clients/cloud_rest/api/user_api.py +0 -473
  101. hatchet_sdk/clients/cloud_rest/api/workflow_api.py +0 -369
  102. hatchet_sdk/clients/cloud_rest/api_client.py +0 -727
  103. hatchet_sdk/clients/cloud_rest/api_response.py +0 -22
  104. hatchet_sdk/clients/cloud_rest/configuration.py +0 -488
  105. hatchet_sdk/clients/cloud_rest/exceptions.py +0 -200
  106. hatchet_sdk/clients/cloud_rest/models/__init__.py +0 -157
  107. hatchet_sdk/clients/cloud_rest/models/billing_portal_link_get200_response.py +0 -85
  108. hatchet_sdk/clients/cloud_rest/models/build_get200_response.py +0 -121
  109. hatchet_sdk/clients/cloud_rest/models/github_app_list_branches200_response_inner.py +0 -86
  110. hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response.py +0 -119
  111. hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_pagination.py +0 -95
  112. hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_rows_inner_metadata.py +0 -98
  113. hatchet_sdk/clients/cloud_rest/models/github_app_list_repos200_response_inner.py +0 -86
  114. hatchet_sdk/clients/cloud_rest/models/infra_as_code_create_request.py +0 -107
  115. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner.py +0 -136
  116. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_event.py +0 -83
  117. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly.py +0 -100
  118. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly_app.py +0 -86
  119. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_log.py +0 -83
  120. hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request.py +0 -128
  121. hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_build_config.py +0 -121
  122. hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_runtime_config.py +0 -166
  123. hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response.py +0 -119
  124. hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response_rows_inner.py +0 -117
  125. hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response.py +0 -119
  126. hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response_rows_inner.py +0 -113
  127. hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner.py +0 -154
  128. hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config.py +0 -151
  129. hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config_steps_inner.py +0 -109
  130. hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_runtime_configs_inner.py +0 -171
  131. hatchet_sdk/clients/cloud_rest/models/managed_worker_update_request.py +0 -131
  132. hatchet_sdk/clients/cloud_rest/models/metadata_get200_response.py +0 -101
  133. hatchet_sdk/clients/cloud_rest/models/metadata_get400_response.py +0 -105
  134. hatchet_sdk/clients/cloud_rest/models/metadata_get400_response_errors_inner.py +0 -102
  135. hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner.py +0 -108
  136. hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner.py +0 -102
  137. hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram.py +0 -113
  138. hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram_buckets_inner.py +0 -93
  139. hatchet_sdk/clients/cloud_rest/models/runtime_config_list_actions200_response.py +0 -83
  140. hatchet_sdk/clients/cloud_rest/models/subscription_upsert200_response.py +0 -114
  141. hatchet_sdk/clients/cloud_rest/models/subscription_upsert_request.py +0 -88
  142. hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response.py +0 -170
  143. hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_coupons_inner.py +0 -137
  144. hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_plans_inner.py +0 -103
  145. hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_subscription.py +0 -114
  146. hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response.py +0 -107
  147. hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response_results_inner.py +0 -105
  148. hatchet_sdk/clients/cloud_rest/rest.py +0 -182
  149. hatchet_sdk/compute/__init__.py +0 -0
  150. hatchet_sdk/compute/configs.py +0 -34
  151. hatchet_sdk/compute/managed_compute.py +0 -111
  152. {hatchet_sdk-0.40.0a9.dist-info → hatchet_sdk-0.42.0.dist-info}/WHEEL +0 -0
@@ -1,83 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Hatchet API
5
-
6
- The Hatchet API
7
-
8
- The version of the OpenAPI document: 1.0.0
9
- Generated by OpenAPI Generator (https://openapi-generator.tech)
10
-
11
- Do not edit the class manually.
12
- """ # noqa: E501
13
-
14
-
15
- from __future__ import annotations
16
-
17
- import json
18
- import pprint
19
- import re # noqa: F401
20
- from typing import Any, ClassVar, Dict, List, Optional, Set
21
-
22
- from pydantic import BaseModel, ConfigDict, StrictStr
23
- from typing_extensions import Self
24
-
25
-
26
- class LogCreateRequestInnerLog(BaseModel):
27
- """
28
- LogCreateRequestInnerLog
29
- """ # noqa: E501
30
-
31
- level: Optional[StrictStr] = None
32
- __properties: ClassVar[List[str]] = ["level"]
33
-
34
- model_config = ConfigDict(
35
- populate_by_name=True,
36
- validate_assignment=True,
37
- protected_namespaces=(),
38
- )
39
-
40
- def to_str(self) -> str:
41
- """Returns the string representation of the model using alias"""
42
- return pprint.pformat(self.model_dump(by_alias=True))
43
-
44
- def to_json(self) -> str:
45
- """Returns the JSON representation of the model using alias"""
46
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
- return json.dumps(self.to_dict())
48
-
49
- @classmethod
50
- def from_json(cls, json_str: str) -> Optional[Self]:
51
- """Create an instance of LogCreateRequestInnerLog from a JSON string"""
52
- return cls.from_dict(json.loads(json_str))
53
-
54
- def to_dict(self) -> Dict[str, Any]:
55
- """Return the dictionary representation of the model using alias.
56
-
57
- This has the following differences from calling pydantic's
58
- `self.model_dump(by_alias=True)`:
59
-
60
- * `None` is only added to the output dict for nullable fields that
61
- were set at model initialization. Other fields with value `None`
62
- are ignored.
63
- """
64
- excluded_fields: Set[str] = set([])
65
-
66
- _dict = self.model_dump(
67
- by_alias=True,
68
- exclude=excluded_fields,
69
- exclude_none=True,
70
- )
71
- return _dict
72
-
73
- @classmethod
74
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
- """Create an instance of LogCreateRequestInnerLog from a dict"""
76
- if obj is None:
77
- return None
78
-
79
- if not isinstance(obj, dict):
80
- return cls.model_validate(obj)
81
-
82
- _obj = cls.model_validate({"level": obj.get("level")})
83
- return _obj
@@ -1,128 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Hatchet API
5
-
6
- The Hatchet API
7
-
8
- The version of the OpenAPI document: 1.0.0
9
- Generated by OpenAPI Generator (https://openapi-generator.tech)
10
-
11
- Do not edit the class manually.
12
- """ # noqa: E501
13
-
14
-
15
- from __future__ import annotations
16
-
17
- import json
18
- import pprint
19
- import re # noqa: F401
20
- from typing import Any, ClassVar, Dict, List, Optional, Set
21
-
22
- from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
23
- from typing_extensions import Self
24
-
25
- from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_build_config import (
26
- ManagedWorkerCreateRequestBuildConfig,
27
- )
28
- from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_runtime_config import (
29
- ManagedWorkerCreateRequestRuntimeConfig,
30
- )
31
-
32
-
33
- class ManagedWorkerCreateRequest(BaseModel):
34
- """
35
- ManagedWorkerCreateRequest
36
- """ # noqa: E501
37
-
38
- name: StrictStr
39
- build_config: ManagedWorkerCreateRequestBuildConfig = Field(alias="buildConfig")
40
- env_vars: Dict[str, StrictStr] = Field(
41
- description="A map of environment variables to set for the worker",
42
- alias="envVars",
43
- )
44
- is_iac: StrictBool = Field(alias="isIac")
45
- runtime_config: Optional[ManagedWorkerCreateRequestRuntimeConfig] = Field(
46
- default=None, alias="runtimeConfig"
47
- )
48
- __properties: ClassVar[List[str]] = [
49
- "name",
50
- "buildConfig",
51
- "envVars",
52
- "isIac",
53
- "runtimeConfig",
54
- ]
55
-
56
- model_config = ConfigDict(
57
- populate_by_name=True,
58
- validate_assignment=True,
59
- protected_namespaces=(),
60
- )
61
-
62
- def to_str(self) -> str:
63
- """Returns the string representation of the model using alias"""
64
- return pprint.pformat(self.model_dump(by_alias=True))
65
-
66
- def to_json(self) -> str:
67
- """Returns the JSON representation of the model using alias"""
68
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
69
- return json.dumps(self.to_dict())
70
-
71
- @classmethod
72
- def from_json(cls, json_str: str) -> Optional[Self]:
73
- """Create an instance of ManagedWorkerCreateRequest from a JSON string"""
74
- return cls.from_dict(json.loads(json_str))
75
-
76
- def to_dict(self) -> Dict[str, Any]:
77
- """Return the dictionary representation of the model using alias.
78
-
79
- This has the following differences from calling pydantic's
80
- `self.model_dump(by_alias=True)`:
81
-
82
- * `None` is only added to the output dict for nullable fields that
83
- were set at model initialization. Other fields with value `None`
84
- are ignored.
85
- """
86
- excluded_fields: Set[str] = set([])
87
-
88
- _dict = self.model_dump(
89
- by_alias=True,
90
- exclude=excluded_fields,
91
- exclude_none=True,
92
- )
93
- # override the default output from pydantic by calling `to_dict()` of build_config
94
- if self.build_config:
95
- _dict["buildConfig"] = self.build_config.to_dict()
96
- # override the default output from pydantic by calling `to_dict()` of runtime_config
97
- if self.runtime_config:
98
- _dict["runtimeConfig"] = self.runtime_config.to_dict()
99
- return _dict
100
-
101
- @classmethod
102
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
103
- """Create an instance of ManagedWorkerCreateRequest from a dict"""
104
- if obj is None:
105
- return None
106
-
107
- if not isinstance(obj, dict):
108
- return cls.model_validate(obj)
109
-
110
- _obj = cls.model_validate(
111
- {
112
- "name": obj.get("name"),
113
- "buildConfig": (
114
- ManagedWorkerCreateRequestBuildConfig.from_dict(obj["buildConfig"])
115
- if obj.get("buildConfig") is not None
116
- else None
117
- ),
118
- "isIac": obj.get("isIac"),
119
- "runtimeConfig": (
120
- ManagedWorkerCreateRequestRuntimeConfig.from_dict(
121
- obj["runtimeConfig"]
122
- )
123
- if obj.get("runtimeConfig") is not None
124
- else None
125
- ),
126
- }
127
- )
128
- return _obj
@@ -1,121 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Hatchet API
5
-
6
- The Hatchet API
7
-
8
- The version of the OpenAPI document: 1.0.0
9
- Generated by OpenAPI Generator (https://openapi-generator.tech)
10
-
11
- Do not edit the class manually.
12
- """ # noqa: E501
13
-
14
-
15
- from __future__ import annotations
16
-
17
- import json
18
- import pprint
19
- import re # noqa: F401
20
- from typing import Any, ClassVar, Dict, List, Optional, Set
21
-
22
- from pydantic import BaseModel, ConfigDict, Field, StrictStr
23
- from typing_extensions import Annotated, Self
24
-
25
- from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_build_config_steps_inner import (
26
- ManagedWorkerCreateRequestBuildConfigStepsInner,
27
- )
28
-
29
-
30
- class ManagedWorkerCreateRequestBuildConfig(BaseModel):
31
- """
32
- ManagedWorkerCreateRequestBuildConfig
33
- """ # noqa: E501
34
-
35
- github_installation_id: Annotated[
36
- str, Field(min_length=36, strict=True, max_length=36)
37
- ] = Field(alias="githubInstallationId")
38
- github_repository_owner: StrictStr = Field(alias="githubRepositoryOwner")
39
- github_repository_name: StrictStr = Field(alias="githubRepositoryName")
40
- github_repository_branch: StrictStr = Field(alias="githubRepositoryBranch")
41
- steps: List[ManagedWorkerCreateRequestBuildConfigStepsInner]
42
- __properties: ClassVar[List[str]] = [
43
- "githubInstallationId",
44
- "githubRepositoryOwner",
45
- "githubRepositoryName",
46
- "githubRepositoryBranch",
47
- "steps",
48
- ]
49
-
50
- model_config = ConfigDict(
51
- populate_by_name=True,
52
- validate_assignment=True,
53
- protected_namespaces=(),
54
- )
55
-
56
- def to_str(self) -> str:
57
- """Returns the string representation of the model using alias"""
58
- return pprint.pformat(self.model_dump(by_alias=True))
59
-
60
- def to_json(self) -> str:
61
- """Returns the JSON representation of the model using alias"""
62
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
63
- return json.dumps(self.to_dict())
64
-
65
- @classmethod
66
- def from_json(cls, json_str: str) -> Optional[Self]:
67
- """Create an instance of ManagedWorkerCreateRequestBuildConfig from a JSON string"""
68
- return cls.from_dict(json.loads(json_str))
69
-
70
- def to_dict(self) -> Dict[str, Any]:
71
- """Return the dictionary representation of the model using alias.
72
-
73
- This has the following differences from calling pydantic's
74
- `self.model_dump(by_alias=True)`:
75
-
76
- * `None` is only added to the output dict for nullable fields that
77
- were set at model initialization. Other fields with value `None`
78
- are ignored.
79
- """
80
- excluded_fields: Set[str] = set([])
81
-
82
- _dict = self.model_dump(
83
- by_alias=True,
84
- exclude=excluded_fields,
85
- exclude_none=True,
86
- )
87
- # override the default output from pydantic by calling `to_dict()` of each item in steps (list)
88
- _items = []
89
- if self.steps:
90
- for _item in self.steps:
91
- if _item:
92
- _items.append(_item.to_dict())
93
- _dict["steps"] = _items
94
- return _dict
95
-
96
- @classmethod
97
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
98
- """Create an instance of ManagedWorkerCreateRequestBuildConfig from a dict"""
99
- if obj is None:
100
- return None
101
-
102
- if not isinstance(obj, dict):
103
- return cls.model_validate(obj)
104
-
105
- _obj = cls.model_validate(
106
- {
107
- "githubInstallationId": obj.get("githubInstallationId"),
108
- "githubRepositoryOwner": obj.get("githubRepositoryOwner"),
109
- "githubRepositoryName": obj.get("githubRepositoryName"),
110
- "githubRepositoryBranch": obj.get("githubRepositoryBranch"),
111
- "steps": (
112
- [
113
- ManagedWorkerCreateRequestBuildConfigStepsInner.from_dict(_item)
114
- for _item in obj["steps"]
115
- ]
116
- if obj.get("steps") is not None
117
- else None
118
- ),
119
- }
120
- )
121
- return _obj
@@ -1,166 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Hatchet API
5
-
6
- The Hatchet API
7
-
8
- The version of the OpenAPI document: 1.0.0
9
- Generated by OpenAPI Generator (https://openapi-generator.tech)
10
-
11
- Do not edit the class manually.
12
- """ # noqa: E501
13
-
14
-
15
- from __future__ import annotations
16
-
17
- import json
18
- import pprint
19
- import re # noqa: F401
20
- from typing import Any, ClassVar, Dict, List, Optional, Set
21
-
22
- from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
23
- from typing_extensions import Annotated, Self
24
-
25
-
26
- class ManagedWorkerCreateRequestRuntimeConfig(BaseModel):
27
- """
28
- ManagedWorkerCreateRequestRuntimeConfig
29
- """ # noqa: E501
30
-
31
- num_replicas: Annotated[int, Field(le=1000, strict=True, ge=0)] = Field(
32
- alias="numReplicas"
33
- )
34
- regions: Optional[List[StrictStr]] = Field(
35
- default=None, description="The region to deploy the worker to"
36
- )
37
- cpu_kind: StrictStr = Field(
38
- description="The kind of CPU to use for the worker", alias="cpuKind"
39
- )
40
- cpus: Annotated[int, Field(le=64, strict=True, ge=1)] = Field(
41
- description="The number of CPUs to use for the worker"
42
- )
43
- memory_mb: Annotated[int, Field(le=65536, strict=True, ge=1024)] = Field(
44
- description="The amount of memory in MB to use for the worker", alias="memoryMb"
45
- )
46
- actions: Optional[List[StrictStr]] = None
47
- slots: Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]] = None
48
- __properties: ClassVar[List[str]] = [
49
- "numReplicas",
50
- "regions",
51
- "cpuKind",
52
- "cpus",
53
- "memoryMb",
54
- "actions",
55
- "slots",
56
- ]
57
-
58
- @field_validator("regions")
59
- def regions_validate_enum(cls, value):
60
- """Validates the enum"""
61
- if value is None:
62
- return value
63
-
64
- for i in value:
65
- if i not in set(
66
- [
67
- "ams",
68
- "arn",
69
- "atl",
70
- "bog",
71
- "bos",
72
- "cdg",
73
- "den",
74
- "dfw",
75
- "ewr",
76
- "eze",
77
- "gdl",
78
- "gig",
79
- "gru",
80
- "hkg",
81
- "iad",
82
- "jnb",
83
- "lax",
84
- "lhr",
85
- "mad",
86
- "mia",
87
- "nrt",
88
- "ord",
89
- "otp",
90
- "phx",
91
- "qro",
92
- "scl",
93
- "sea",
94
- "sin",
95
- "sjc",
96
- "syd",
97
- "waw",
98
- "yul",
99
- "yyz",
100
- ]
101
- ):
102
- raise ValueError(
103
- "each list item must be one of ('ams', 'arn', 'atl', 'bog', 'bos', 'cdg', 'den', 'dfw', 'ewr', 'eze', 'gdl', 'gig', 'gru', 'hkg', 'iad', 'jnb', 'lax', 'lhr', 'mad', 'mia', 'nrt', 'ord', 'otp', 'phx', 'qro', 'scl', 'sea', 'sin', 'sjc', 'syd', 'waw', 'yul', 'yyz')"
104
- )
105
- return value
106
-
107
- model_config = ConfigDict(
108
- populate_by_name=True,
109
- validate_assignment=True,
110
- protected_namespaces=(),
111
- )
112
-
113
- def to_str(self) -> str:
114
- """Returns the string representation of the model using alias"""
115
- return pprint.pformat(self.model_dump(by_alias=True))
116
-
117
- def to_json(self) -> str:
118
- """Returns the JSON representation of the model using alias"""
119
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
120
- return json.dumps(self.to_dict())
121
-
122
- @classmethod
123
- def from_json(cls, json_str: str) -> Optional[Self]:
124
- """Create an instance of ManagedWorkerCreateRequestRuntimeConfig from a JSON string"""
125
- return cls.from_dict(json.loads(json_str))
126
-
127
- def to_dict(self) -> Dict[str, Any]:
128
- """Return the dictionary representation of the model using alias.
129
-
130
- This has the following differences from calling pydantic's
131
- `self.model_dump(by_alias=True)`:
132
-
133
- * `None` is only added to the output dict for nullable fields that
134
- were set at model initialization. Other fields with value `None`
135
- are ignored.
136
- """
137
- excluded_fields: Set[str] = set([])
138
-
139
- _dict = self.model_dump(
140
- by_alias=True,
141
- exclude=excluded_fields,
142
- exclude_none=True,
143
- )
144
- return _dict
145
-
146
- @classmethod
147
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
148
- """Create an instance of ManagedWorkerCreateRequestRuntimeConfig from a dict"""
149
- if obj is None:
150
- return None
151
-
152
- if not isinstance(obj, dict):
153
- return cls.model_validate(obj)
154
-
155
- _obj = cls.model_validate(
156
- {
157
- "numReplicas": obj.get("numReplicas"),
158
- "regions": obj.get("regions"),
159
- "cpuKind": obj.get("cpuKind"),
160
- "cpus": obj.get("cpus"),
161
- "memoryMb": obj.get("memoryMb"),
162
- "actions": obj.get("actions"),
163
- "slots": obj.get("slots"),
164
- }
165
- )
166
- return _obj
@@ -1,119 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Hatchet API
5
-
6
- The Hatchet API
7
-
8
- The version of the OpenAPI document: 1.0.0
9
- Generated by OpenAPI Generator (https://openapi-generator.tech)
10
-
11
- Do not edit the class manually.
12
- """ # noqa: E501
13
-
14
-
15
- from __future__ import annotations
16
-
17
- import json
18
- import pprint
19
- import re # noqa: F401
20
- from typing import Any, ClassVar, Dict, List, Optional, Set
21
-
22
- from pydantic import BaseModel, ConfigDict
23
- from typing_extensions import Self
24
-
25
- from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_pagination import (
26
- GithubAppListInstallations200ResponsePagination,
27
- )
28
- from hatchet_sdk.clients.cloud_rest.models.managed_worker_events_list200_response_rows_inner import (
29
- ManagedWorkerEventsList200ResponseRowsInner,
30
- )
31
-
32
-
33
- class ManagedWorkerEventsList200Response(BaseModel):
34
- """
35
- ManagedWorkerEventsList200Response
36
- """ # noqa: E501
37
-
38
- pagination: Optional[GithubAppListInstallations200ResponsePagination] = None
39
- rows: Optional[List[ManagedWorkerEventsList200ResponseRowsInner]] = None
40
- __properties: ClassVar[List[str]] = ["pagination", "rows"]
41
-
42
- model_config = ConfigDict(
43
- populate_by_name=True,
44
- validate_assignment=True,
45
- protected_namespaces=(),
46
- )
47
-
48
- def to_str(self) -> str:
49
- """Returns the string representation of the model using alias"""
50
- return pprint.pformat(self.model_dump(by_alias=True))
51
-
52
- def to_json(self) -> str:
53
- """Returns the JSON representation of the model using alias"""
54
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
55
- return json.dumps(self.to_dict())
56
-
57
- @classmethod
58
- def from_json(cls, json_str: str) -> Optional[Self]:
59
- """Create an instance of ManagedWorkerEventsList200Response from a JSON string"""
60
- return cls.from_dict(json.loads(json_str))
61
-
62
- def to_dict(self) -> Dict[str, Any]:
63
- """Return the dictionary representation of the model using alias.
64
-
65
- This has the following differences from calling pydantic's
66
- `self.model_dump(by_alias=True)`:
67
-
68
- * `None` is only added to the output dict for nullable fields that
69
- were set at model initialization. Other fields with value `None`
70
- are ignored.
71
- """
72
- excluded_fields: Set[str] = set([])
73
-
74
- _dict = self.model_dump(
75
- by_alias=True,
76
- exclude=excluded_fields,
77
- exclude_none=True,
78
- )
79
- # override the default output from pydantic by calling `to_dict()` of pagination
80
- if self.pagination:
81
- _dict["pagination"] = self.pagination.to_dict()
82
- # override the default output from pydantic by calling `to_dict()` of each item in rows (list)
83
- _items = []
84
- if self.rows:
85
- for _item in self.rows:
86
- if _item:
87
- _items.append(_item.to_dict())
88
- _dict["rows"] = _items
89
- return _dict
90
-
91
- @classmethod
92
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
93
- """Create an instance of ManagedWorkerEventsList200Response from a dict"""
94
- if obj is None:
95
- return None
96
-
97
- if not isinstance(obj, dict):
98
- return cls.model_validate(obj)
99
-
100
- _obj = cls.model_validate(
101
- {
102
- "pagination": (
103
- GithubAppListInstallations200ResponsePagination.from_dict(
104
- obj["pagination"]
105
- )
106
- if obj.get("pagination") is not None
107
- else None
108
- ),
109
- "rows": (
110
- [
111
- ManagedWorkerEventsList200ResponseRowsInner.from_dict(_item)
112
- for _item in obj["rows"]
113
- ]
114
- if obj.get("rows") is not None
115
- else None
116
- ),
117
- }
118
- )
119
- return _obj