hatchet-sdk 0.40.0a8__py3-none-any.whl → 0.41.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 (149) 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.pyi +2 -0
  73. hatchet_sdk/contracts/events_pb2.pyi +2 -0
  74. hatchet_sdk/contracts/workflows_pb2.pyi +2 -0
  75. hatchet_sdk/features/cron.py +286 -0
  76. hatchet_sdk/features/scheduled.py +248 -0
  77. hatchet_sdk/hatchet.py +71 -79
  78. hatchet_sdk/loader.py +37 -14
  79. hatchet_sdk/utils/serialization.py +15 -0
  80. hatchet_sdk/utils/tracing.py +67 -0
  81. hatchet_sdk/worker/runner/runner.py +158 -112
  82. hatchet_sdk/worker/worker.py +1 -17
  83. {hatchet_sdk-0.40.0a8.dist-info → hatchet_sdk-0.41.0.dist-info}/METADATA +8 -2
  84. {hatchet_sdk-0.40.0a8.dist-info → hatchet_sdk-0.41.0.dist-info}/RECORD +86 -140
  85. {hatchet_sdk-0.40.0a8.dist-info → hatchet_sdk-0.41.0.dist-info}/entry_points.txt +0 -1
  86. hatchet_sdk/clients/cloud_rest/__init__.py +0 -186
  87. hatchet_sdk/clients/cloud_rest/api/__init__.py +0 -14
  88. hatchet_sdk/clients/cloud_rest/api/billing_api.py +0 -819
  89. hatchet_sdk/clients/cloud_rest/api/build_api.py +0 -298
  90. hatchet_sdk/clients/cloud_rest/api/feature_flags_api.py +0 -295
  91. hatchet_sdk/clients/cloud_rest/api/github_api.py +0 -1347
  92. hatchet_sdk/clients/cloud_rest/api/log_api.py +0 -971
  93. hatchet_sdk/clients/cloud_rest/api/managed_worker_api.py +0 -2546
  94. hatchet_sdk/clients/cloud_rest/api/metadata_api.py +0 -265
  95. hatchet_sdk/clients/cloud_rest/api/metrics_api.py +0 -1026
  96. hatchet_sdk/clients/cloud_rest/api/tenant_api.py +0 -301
  97. hatchet_sdk/clients/cloud_rest/api/user_api.py +0 -473
  98. hatchet_sdk/clients/cloud_rest/api/workflow_api.py +0 -369
  99. hatchet_sdk/clients/cloud_rest/api_client.py +0 -727
  100. hatchet_sdk/clients/cloud_rest/api_response.py +0 -22
  101. hatchet_sdk/clients/cloud_rest/configuration.py +0 -488
  102. hatchet_sdk/clients/cloud_rest/exceptions.py +0 -200
  103. hatchet_sdk/clients/cloud_rest/models/__init__.py +0 -157
  104. hatchet_sdk/clients/cloud_rest/models/billing_portal_link_get200_response.py +0 -85
  105. hatchet_sdk/clients/cloud_rest/models/build_get200_response.py +0 -121
  106. hatchet_sdk/clients/cloud_rest/models/github_app_list_branches200_response_inner.py +0 -86
  107. hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response.py +0 -119
  108. hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_pagination.py +0 -95
  109. hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_rows_inner_metadata.py +0 -98
  110. hatchet_sdk/clients/cloud_rest/models/github_app_list_repos200_response_inner.py +0 -86
  111. hatchet_sdk/clients/cloud_rest/models/infra_as_code_create_request.py +0 -107
  112. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner.py +0 -136
  113. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_event.py +0 -83
  114. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly.py +0 -100
  115. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly_app.py +0 -86
  116. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_log.py +0 -83
  117. hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request.py +0 -128
  118. hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_build_config.py +0 -121
  119. hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_runtime_config.py +0 -166
  120. hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response.py +0 -119
  121. hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response_rows_inner.py +0 -117
  122. hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response.py +0 -119
  123. hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response_rows_inner.py +0 -113
  124. hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner.py +0 -154
  125. hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config.py +0 -151
  126. hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config_steps_inner.py +0 -109
  127. hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_runtime_configs_inner.py +0 -171
  128. hatchet_sdk/clients/cloud_rest/models/managed_worker_update_request.py +0 -131
  129. hatchet_sdk/clients/cloud_rest/models/metadata_get200_response.py +0 -101
  130. hatchet_sdk/clients/cloud_rest/models/metadata_get400_response.py +0 -105
  131. hatchet_sdk/clients/cloud_rest/models/metadata_get400_response_errors_inner.py +0 -102
  132. hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner.py +0 -108
  133. hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner.py +0 -102
  134. hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram.py +0 -113
  135. hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram_buckets_inner.py +0 -93
  136. hatchet_sdk/clients/cloud_rest/models/runtime_config_list_actions200_response.py +0 -83
  137. hatchet_sdk/clients/cloud_rest/models/subscription_upsert200_response.py +0 -114
  138. hatchet_sdk/clients/cloud_rest/models/subscription_upsert_request.py +0 -88
  139. hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response.py +0 -170
  140. hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_coupons_inner.py +0 -137
  141. hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_plans_inner.py +0 -103
  142. hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_subscription.py +0 -114
  143. hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response.py +0 -107
  144. hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response_results_inner.py +0 -105
  145. hatchet_sdk/clients/cloud_rest/rest.py +0 -182
  146. hatchet_sdk/compute/__init__.py +0 -0
  147. hatchet_sdk/compute/configs.py +0 -34
  148. hatchet_sdk/compute/managed_compute.py +0 -111
  149. {hatchet_sdk-0.40.0a8.dist-info → hatchet_sdk-0.41.0.dist-info}/WHEEL +0 -0
@@ -1,109 +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 Self
24
-
25
- from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner_metadata import (
26
- GithubAppListInstallations200ResponseRowsInnerMetadata,
27
- )
28
-
29
-
30
- class ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner(BaseModel):
31
- """
32
- ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner
33
- """ # noqa: E501
34
-
35
- metadata: GithubAppListInstallations200ResponseRowsInnerMetadata
36
- build_dir: StrictStr = Field(
37
- description="The relative path to the build directory", alias="buildDir"
38
- )
39
- dockerfile_path: StrictStr = Field(
40
- description="The relative path from the build dir to the Dockerfile",
41
- alias="dockerfilePath",
42
- )
43
- __properties: ClassVar[List[str]] = ["metadata", "buildDir", "dockerfilePath"]
44
-
45
- model_config = ConfigDict(
46
- populate_by_name=True,
47
- validate_assignment=True,
48
- protected_namespaces=(),
49
- )
50
-
51
- def to_str(self) -> str:
52
- """Returns the string representation of the model using alias"""
53
- return pprint.pformat(self.model_dump(by_alias=True))
54
-
55
- def to_json(self) -> str:
56
- """Returns the JSON representation of the model using alias"""
57
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
58
- return json.dumps(self.to_dict())
59
-
60
- @classmethod
61
- def from_json(cls, json_str: str) -> Optional[Self]:
62
- """Create an instance of ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner from a JSON string"""
63
- return cls.from_dict(json.loads(json_str))
64
-
65
- def to_dict(self) -> Dict[str, Any]:
66
- """Return the dictionary representation of the model using alias.
67
-
68
- This has the following differences from calling pydantic's
69
- `self.model_dump(by_alias=True)`:
70
-
71
- * `None` is only added to the output dict for nullable fields that
72
- were set at model initialization. Other fields with value `None`
73
- are ignored.
74
- """
75
- excluded_fields: Set[str] = set([])
76
-
77
- _dict = self.model_dump(
78
- by_alias=True,
79
- exclude=excluded_fields,
80
- exclude_none=True,
81
- )
82
- # override the default output from pydantic by calling `to_dict()` of metadata
83
- if self.metadata:
84
- _dict["metadata"] = self.metadata.to_dict()
85
- return _dict
86
-
87
- @classmethod
88
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
- """Create an instance of ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner from a dict"""
90
- if obj is None:
91
- return None
92
-
93
- if not isinstance(obj, dict):
94
- return cls.model_validate(obj)
95
-
96
- _obj = cls.model_validate(
97
- {
98
- "metadata": (
99
- GithubAppListInstallations200ResponseRowsInnerMetadata.from_dict(
100
- obj["metadata"]
101
- )
102
- if obj.get("metadata") is not None
103
- else None
104
- ),
105
- "buildDir": obj.get("buildDir"),
106
- "dockerfilePath": obj.get("dockerfilePath"),
107
- }
108
- )
109
- return _obj
@@ -1,171 +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, StrictInt, StrictStr, field_validator
23
- from typing_extensions import Self
24
-
25
- from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner_metadata import (
26
- GithubAppListInstallations200ResponseRowsInnerMetadata,
27
- )
28
-
29
-
30
- class ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner(BaseModel):
31
- """
32
- ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner
33
- """ # noqa: E501
34
-
35
- metadata: GithubAppListInstallations200ResponseRowsInnerMetadata
36
- num_replicas: StrictInt = Field(alias="numReplicas")
37
- cpu_kind: StrictStr = Field(
38
- description="The kind of CPU to use for the worker", alias="cpuKind"
39
- )
40
- cpus: StrictInt = Field(description="The number of CPUs to use for the worker")
41
- memory_mb: StrictInt = Field(
42
- description="The amount of memory in MB to use for the worker", alias="memoryMb"
43
- )
44
- region: StrictStr = Field(description="The region that the worker is deployed to")
45
- actions: Optional[List[StrictStr]] = Field(
46
- default=None, description="A list of actions this runtime config corresponds to"
47
- )
48
- __properties: ClassVar[List[str]] = [
49
- "metadata",
50
- "numReplicas",
51
- "cpuKind",
52
- "cpus",
53
- "memoryMb",
54
- "region",
55
- "actions",
56
- ]
57
-
58
- @field_validator("region")
59
- def region_validate_enum(cls, value):
60
- """Validates the enum"""
61
- if value not in set(
62
- [
63
- "ams",
64
- "arn",
65
- "atl",
66
- "bog",
67
- "bos",
68
- "cdg",
69
- "den",
70
- "dfw",
71
- "ewr",
72
- "eze",
73
- "gdl",
74
- "gig",
75
- "gru",
76
- "hkg",
77
- "iad",
78
- "jnb",
79
- "lax",
80
- "lhr",
81
- "mad",
82
- "mia",
83
- "nrt",
84
- "ord",
85
- "otp",
86
- "phx",
87
- "qro",
88
- "scl",
89
- "sea",
90
- "sin",
91
- "sjc",
92
- "syd",
93
- "waw",
94
- "yul",
95
- "yyz",
96
- ]
97
- ):
98
- raise ValueError(
99
- "must be one of enum values ('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')"
100
- )
101
- return value
102
-
103
- model_config = ConfigDict(
104
- populate_by_name=True,
105
- validate_assignment=True,
106
- protected_namespaces=(),
107
- )
108
-
109
- def to_str(self) -> str:
110
- """Returns the string representation of the model using alias"""
111
- return pprint.pformat(self.model_dump(by_alias=True))
112
-
113
- def to_json(self) -> str:
114
- """Returns the JSON representation of the model using alias"""
115
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
116
- return json.dumps(self.to_dict())
117
-
118
- @classmethod
119
- def from_json(cls, json_str: str) -> Optional[Self]:
120
- """Create an instance of ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner from a JSON string"""
121
- return cls.from_dict(json.loads(json_str))
122
-
123
- def to_dict(self) -> Dict[str, Any]:
124
- """Return the dictionary representation of the model using alias.
125
-
126
- This has the following differences from calling pydantic's
127
- `self.model_dump(by_alias=True)`:
128
-
129
- * `None` is only added to the output dict for nullable fields that
130
- were set at model initialization. Other fields with value `None`
131
- are ignored.
132
- """
133
- excluded_fields: Set[str] = set([])
134
-
135
- _dict = self.model_dump(
136
- by_alias=True,
137
- exclude=excluded_fields,
138
- exclude_none=True,
139
- )
140
- # override the default output from pydantic by calling `to_dict()` of metadata
141
- if self.metadata:
142
- _dict["metadata"] = self.metadata.to_dict()
143
- return _dict
144
-
145
- @classmethod
146
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
147
- """Create an instance of ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner from a dict"""
148
- if obj is None:
149
- return None
150
-
151
- if not isinstance(obj, dict):
152
- return cls.model_validate(obj)
153
-
154
- _obj = cls.model_validate(
155
- {
156
- "metadata": (
157
- GithubAppListInstallations200ResponseRowsInnerMetadata.from_dict(
158
- obj["metadata"]
159
- )
160
- if obj.get("metadata") is not None
161
- else None
162
- ),
163
- "numReplicas": obj.get("numReplicas"),
164
- "cpuKind": obj.get("cpuKind"),
165
- "cpus": obj.get("cpus"),
166
- "memoryMb": obj.get("memoryMb"),
167
- "region": obj.get("region"),
168
- "actions": obj.get("actions"),
169
- }
170
- )
171
- return _obj
@@ -1,131 +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 ManagedWorkerUpdateRequest(BaseModel):
34
- """
35
- ManagedWorkerUpdateRequest
36
- """ # noqa: E501
37
-
38
- name: Optional[StrictStr] = None
39
- build_config: Optional[ManagedWorkerCreateRequestBuildConfig] = Field(
40
- default=None, alias="buildConfig"
41
- )
42
- env_vars: Optional[Dict[str, StrictStr]] = Field(
43
- default=None,
44
- description="A map of environment variables to set for the worker",
45
- alias="envVars",
46
- )
47
- is_iac: Optional[StrictBool] = Field(default=None, alias="isIac")
48
- runtime_config: Optional[ManagedWorkerCreateRequestRuntimeConfig] = Field(
49
- default=None, alias="runtimeConfig"
50
- )
51
- __properties: ClassVar[List[str]] = [
52
- "name",
53
- "buildConfig",
54
- "envVars",
55
- "isIac",
56
- "runtimeConfig",
57
- ]
58
-
59
- model_config = ConfigDict(
60
- populate_by_name=True,
61
- validate_assignment=True,
62
- protected_namespaces=(),
63
- )
64
-
65
- def to_str(self) -> str:
66
- """Returns the string representation of the model using alias"""
67
- return pprint.pformat(self.model_dump(by_alias=True))
68
-
69
- def to_json(self) -> str:
70
- """Returns the JSON representation of the model using alias"""
71
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
72
- return json.dumps(self.to_dict())
73
-
74
- @classmethod
75
- def from_json(cls, json_str: str) -> Optional[Self]:
76
- """Create an instance of ManagedWorkerUpdateRequest from a JSON string"""
77
- return cls.from_dict(json.loads(json_str))
78
-
79
- def to_dict(self) -> Dict[str, Any]:
80
- """Return the dictionary representation of the model using alias.
81
-
82
- This has the following differences from calling pydantic's
83
- `self.model_dump(by_alias=True)`:
84
-
85
- * `None` is only added to the output dict for nullable fields that
86
- were set at model initialization. Other fields with value `None`
87
- are ignored.
88
- """
89
- excluded_fields: Set[str] = set([])
90
-
91
- _dict = self.model_dump(
92
- by_alias=True,
93
- exclude=excluded_fields,
94
- exclude_none=True,
95
- )
96
- # override the default output from pydantic by calling `to_dict()` of build_config
97
- if self.build_config:
98
- _dict["buildConfig"] = self.build_config.to_dict()
99
- # override the default output from pydantic by calling `to_dict()` of runtime_config
100
- if self.runtime_config:
101
- _dict["runtimeConfig"] = self.runtime_config.to_dict()
102
- return _dict
103
-
104
- @classmethod
105
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
106
- """Create an instance of ManagedWorkerUpdateRequest from a dict"""
107
- if obj is None:
108
- return None
109
-
110
- if not isinstance(obj, dict):
111
- return cls.model_validate(obj)
112
-
113
- _obj = cls.model_validate(
114
- {
115
- "name": obj.get("name"),
116
- "buildConfig": (
117
- ManagedWorkerCreateRequestBuildConfig.from_dict(obj["buildConfig"])
118
- if obj.get("buildConfig") is not None
119
- else None
120
- ),
121
- "isIac": obj.get("isIac"),
122
- "runtimeConfig": (
123
- ManagedWorkerCreateRequestRuntimeConfig.from_dict(
124
- obj["runtimeConfig"]
125
- )
126
- if obj.get("runtimeConfig") is not None
127
- else None
128
- ),
129
- }
130
- )
131
- return _obj
@@ -1,101 +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
23
- from typing_extensions import Self
24
-
25
-
26
- class MetadataGet200Response(BaseModel):
27
- """
28
- MetadataGet200Response
29
- """ # noqa: E501
30
-
31
- can_bill: Optional[StrictBool] = Field(
32
- default=None, description="whether the tenant can be billed", alias="canBill"
33
- )
34
- can_link_github: Optional[StrictBool] = Field(
35
- default=None,
36
- description="whether the tenant can link to GitHub",
37
- alias="canLinkGithub",
38
- )
39
- metrics_enabled: Optional[StrictBool] = Field(
40
- default=None,
41
- description="whether metrics are enabled for the tenant",
42
- alias="metricsEnabled",
43
- )
44
- __properties: ClassVar[List[str]] = ["canBill", "canLinkGithub", "metricsEnabled"]
45
-
46
- model_config = ConfigDict(
47
- populate_by_name=True,
48
- validate_assignment=True,
49
- protected_namespaces=(),
50
- )
51
-
52
- def to_str(self) -> str:
53
- """Returns the string representation of the model using alias"""
54
- return pprint.pformat(self.model_dump(by_alias=True))
55
-
56
- def to_json(self) -> str:
57
- """Returns the JSON representation of the model using alias"""
58
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
59
- return json.dumps(self.to_dict())
60
-
61
- @classmethod
62
- def from_json(cls, json_str: str) -> Optional[Self]:
63
- """Create an instance of MetadataGet200Response from a JSON string"""
64
- return cls.from_dict(json.loads(json_str))
65
-
66
- def to_dict(self) -> Dict[str, Any]:
67
- """Return the dictionary representation of the model using alias.
68
-
69
- This has the following differences from calling pydantic's
70
- `self.model_dump(by_alias=True)`:
71
-
72
- * `None` is only added to the output dict for nullable fields that
73
- were set at model initialization. Other fields with value `None`
74
- are ignored.
75
- """
76
- excluded_fields: Set[str] = set([])
77
-
78
- _dict = self.model_dump(
79
- by_alias=True,
80
- exclude=excluded_fields,
81
- exclude_none=True,
82
- )
83
- return _dict
84
-
85
- @classmethod
86
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
87
- """Create an instance of MetadataGet200Response from a dict"""
88
- if obj is None:
89
- return None
90
-
91
- if not isinstance(obj, dict):
92
- return cls.model_validate(obj)
93
-
94
- _obj = cls.model_validate(
95
- {
96
- "canBill": obj.get("canBill"),
97
- "canLinkGithub": obj.get("canLinkGithub"),
98
- "metricsEnabled": obj.get("metricsEnabled"),
99
- }
100
- )
101
- return _obj
@@ -1,105 +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.metadata_get400_response_errors_inner import (
26
- MetadataGet400ResponseErrorsInner,
27
- )
28
-
29
-
30
- class MetadataGet400Response(BaseModel):
31
- """
32
- MetadataGet400Response
33
- """ # noqa: E501
34
-
35
- errors: List[MetadataGet400ResponseErrorsInner]
36
- __properties: ClassVar[List[str]] = ["errors"]
37
-
38
- model_config = ConfigDict(
39
- populate_by_name=True,
40
- validate_assignment=True,
41
- protected_namespaces=(),
42
- )
43
-
44
- def to_str(self) -> str:
45
- """Returns the string representation of the model using alias"""
46
- return pprint.pformat(self.model_dump(by_alias=True))
47
-
48
- def to_json(self) -> str:
49
- """Returns the JSON representation of the model using alias"""
50
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
- return json.dumps(self.to_dict())
52
-
53
- @classmethod
54
- def from_json(cls, json_str: str) -> Optional[Self]:
55
- """Create an instance of MetadataGet400Response from a JSON string"""
56
- return cls.from_dict(json.loads(json_str))
57
-
58
- def to_dict(self) -> Dict[str, Any]:
59
- """Return the dictionary representation of the model using alias.
60
-
61
- This has the following differences from calling pydantic's
62
- `self.model_dump(by_alias=True)`:
63
-
64
- * `None` is only added to the output dict for nullable fields that
65
- were set at model initialization. Other fields with value `None`
66
- are ignored.
67
- """
68
- excluded_fields: Set[str] = set([])
69
-
70
- _dict = self.model_dump(
71
- by_alias=True,
72
- exclude=excluded_fields,
73
- exclude_none=True,
74
- )
75
- # override the default output from pydantic by calling `to_dict()` of each item in errors (list)
76
- _items = []
77
- if self.errors:
78
- for _item in self.errors:
79
- if _item:
80
- _items.append(_item.to_dict())
81
- _dict["errors"] = _items
82
- return _dict
83
-
84
- @classmethod
85
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
86
- """Create an instance of MetadataGet400Response from a dict"""
87
- if obj is None:
88
- return None
89
-
90
- if not isinstance(obj, dict):
91
- return cls.model_validate(obj)
92
-
93
- _obj = cls.model_validate(
94
- {
95
- "errors": (
96
- [
97
- MetadataGet400ResponseErrorsInner.from_dict(_item)
98
- for _item in obj["errors"]
99
- ]
100
- if obj.get("errors") is not None
101
- else None
102
- )
103
- }
104
- )
105
- return _obj