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,117 +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 datetime import datetime
21
- from typing import Any, ClassVar, Dict, List, Optional, Set
22
-
23
- from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
24
- from typing_extensions import Self
25
-
26
-
27
- class ManagedWorkerEventsList200ResponseRowsInner(BaseModel):
28
- """
29
- ManagedWorkerEventsList200ResponseRowsInner
30
- """ # noqa: E501
31
-
32
- id: StrictInt
33
- time_first_seen: datetime = Field(alias="timeFirstSeen")
34
- time_last_seen: datetime = Field(alias="timeLastSeen")
35
- managed_worker_id: StrictStr = Field(alias="managedWorkerId")
36
- status: StrictStr
37
- message: StrictStr
38
- data: Dict[str, Any]
39
- __properties: ClassVar[List[str]] = [
40
- "id",
41
- "timeFirstSeen",
42
- "timeLastSeen",
43
- "managedWorkerId",
44
- "status",
45
- "message",
46
- "data",
47
- ]
48
-
49
- @field_validator("status")
50
- def status_validate_enum(cls, value):
51
- """Validates the enum"""
52
- if value not in set(["IN_PROGRESS", "SUCCEEDED", "FAILED", "CANCELLED"]):
53
- raise ValueError(
54
- "must be one of enum values ('IN_PROGRESS', 'SUCCEEDED', 'FAILED', 'CANCELLED')"
55
- )
56
- return value
57
-
58
- model_config = ConfigDict(
59
- populate_by_name=True,
60
- validate_assignment=True,
61
- protected_namespaces=(),
62
- )
63
-
64
- def to_str(self) -> str:
65
- """Returns the string representation of the model using alias"""
66
- return pprint.pformat(self.model_dump(by_alias=True))
67
-
68
- def to_json(self) -> str:
69
- """Returns the JSON representation of the model using alias"""
70
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
71
- return json.dumps(self.to_dict())
72
-
73
- @classmethod
74
- def from_json(cls, json_str: str) -> Optional[Self]:
75
- """Create an instance of ManagedWorkerEventsList200ResponseRowsInner from a JSON string"""
76
- return cls.from_dict(json.loads(json_str))
77
-
78
- def to_dict(self) -> Dict[str, Any]:
79
- """Return the dictionary representation of the model using alias.
80
-
81
- This has the following differences from calling pydantic's
82
- `self.model_dump(by_alias=True)`:
83
-
84
- * `None` is only added to the output dict for nullable fields that
85
- were set at model initialization. Other fields with value `None`
86
- are ignored.
87
- """
88
- excluded_fields: Set[str] = set([])
89
-
90
- _dict = self.model_dump(
91
- by_alias=True,
92
- exclude=excluded_fields,
93
- exclude_none=True,
94
- )
95
- return _dict
96
-
97
- @classmethod
98
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
99
- """Create an instance of ManagedWorkerEventsList200ResponseRowsInner from a dict"""
100
- if obj is None:
101
- return None
102
-
103
- if not isinstance(obj, dict):
104
- return cls.model_validate(obj)
105
-
106
- _obj = cls.model_validate(
107
- {
108
- "id": obj.get("id"),
109
- "timeFirstSeen": obj.get("timeFirstSeen"),
110
- "timeLastSeen": obj.get("timeLastSeen"),
111
- "managedWorkerId": obj.get("managedWorkerId"),
112
- "status": obj.get("status"),
113
- "message": obj.get("message"),
114
- "data": obj.get("data"),
115
- }
116
- )
117
- 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_instances_list200_response_rows_inner import (
29
- ManagedWorkerInstancesList200ResponseRowsInner,
30
- )
31
-
32
-
33
- class ManagedWorkerInstancesList200Response(BaseModel):
34
- """
35
- ManagedWorkerInstancesList200Response
36
- """ # noqa: E501
37
-
38
- pagination: Optional[GithubAppListInstallations200ResponsePagination] = None
39
- rows: Optional[List[ManagedWorkerInstancesList200ResponseRowsInner]] = 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 ManagedWorkerInstancesList200Response 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 ManagedWorkerInstancesList200Response 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
- ManagedWorkerInstancesList200ResponseRowsInner.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
@@ -1,113 +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
23
- from typing_extensions import Self
24
-
25
-
26
- class ManagedWorkerInstancesList200ResponseRowsInner(BaseModel):
27
- """
28
- ManagedWorkerInstancesList200ResponseRowsInner
29
- """ # noqa: E501
30
-
31
- instance_id: StrictStr = Field(alias="instanceId")
32
- name: StrictStr
33
- region: StrictStr
34
- state: StrictStr
35
- cpu_kind: StrictStr = Field(alias="cpuKind")
36
- cpus: StrictInt
37
- memory_mb: StrictInt = Field(alias="memoryMb")
38
- disk_gb: StrictInt = Field(alias="diskGb")
39
- commit_sha: StrictStr = Field(alias="commitSha")
40
- __properties: ClassVar[List[str]] = [
41
- "instanceId",
42
- "name",
43
- "region",
44
- "state",
45
- "cpuKind",
46
- "cpus",
47
- "memoryMb",
48
- "diskGb",
49
- "commitSha",
50
- ]
51
-
52
- model_config = ConfigDict(
53
- populate_by_name=True,
54
- validate_assignment=True,
55
- protected_namespaces=(),
56
- )
57
-
58
- def to_str(self) -> str:
59
- """Returns the string representation of the model using alias"""
60
- return pprint.pformat(self.model_dump(by_alias=True))
61
-
62
- def to_json(self) -> str:
63
- """Returns the JSON representation of the model using alias"""
64
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
65
- return json.dumps(self.to_dict())
66
-
67
- @classmethod
68
- def from_json(cls, json_str: str) -> Optional[Self]:
69
- """Create an instance of ManagedWorkerInstancesList200ResponseRowsInner from a JSON string"""
70
- return cls.from_dict(json.loads(json_str))
71
-
72
- def to_dict(self) -> Dict[str, Any]:
73
- """Return the dictionary representation of the model using alias.
74
-
75
- This has the following differences from calling pydantic's
76
- `self.model_dump(by_alias=True)`:
77
-
78
- * `None` is only added to the output dict for nullable fields that
79
- were set at model initialization. Other fields with value `None`
80
- are ignored.
81
- """
82
- excluded_fields: Set[str] = set([])
83
-
84
- _dict = self.model_dump(
85
- by_alias=True,
86
- exclude=excluded_fields,
87
- exclude_none=True,
88
- )
89
- return _dict
90
-
91
- @classmethod
92
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
93
- """Create an instance of ManagedWorkerInstancesList200ResponseRowsInner 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
- "instanceId": obj.get("instanceId"),
103
- "name": obj.get("name"),
104
- "region": obj.get("region"),
105
- "state": obj.get("state"),
106
- "cpuKind": obj.get("cpuKind"),
107
- "cpus": obj.get("cpus"),
108
- "memoryMb": obj.get("memoryMb"),
109
- "diskGb": obj.get("diskGb"),
110
- "commitSha": obj.get("commitSha"),
111
- }
112
- )
113
- return _obj
@@ -1,154 +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.github_app_list_installations200_response_rows_inner_metadata import (
26
- GithubAppListInstallations200ResponseRowsInnerMetadata,
27
- )
28
- from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner_build_config import (
29
- ManagedWorkerList200ResponseRowsInnerBuildConfig,
30
- )
31
- from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner_runtime_configs_inner import (
32
- ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner,
33
- )
34
-
35
-
36
- class ManagedWorkerList200ResponseRowsInner(BaseModel):
37
- """
38
- ManagedWorkerList200ResponseRowsInner
39
- """ # noqa: E501
40
-
41
- metadata: GithubAppListInstallations200ResponseRowsInnerMetadata
42
- name: StrictStr
43
- build_config: ManagedWorkerList200ResponseRowsInnerBuildConfig = Field(
44
- alias="buildConfig"
45
- )
46
- is_iac: StrictBool = Field(alias="isIac")
47
- env_vars: Dict[str, StrictStr] = Field(
48
- description="A map of environment variables to set for the worker",
49
- alias="envVars",
50
- )
51
- runtime_configs: Optional[
52
- List[ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner]
53
- ] = Field(default=None, alias="runtimeConfigs")
54
- __properties: ClassVar[List[str]] = [
55
- "metadata",
56
- "name",
57
- "buildConfig",
58
- "isIac",
59
- "envVars",
60
- "runtimeConfigs",
61
- ]
62
-
63
- model_config = ConfigDict(
64
- populate_by_name=True,
65
- validate_assignment=True,
66
- protected_namespaces=(),
67
- )
68
-
69
- def to_str(self) -> str:
70
- """Returns the string representation of the model using alias"""
71
- return pprint.pformat(self.model_dump(by_alias=True))
72
-
73
- def to_json(self) -> str:
74
- """Returns the JSON representation of the model using alias"""
75
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
76
- return json.dumps(self.to_dict())
77
-
78
- @classmethod
79
- def from_json(cls, json_str: str) -> Optional[Self]:
80
- """Create an instance of ManagedWorkerList200ResponseRowsInner from a JSON string"""
81
- return cls.from_dict(json.loads(json_str))
82
-
83
- def to_dict(self) -> Dict[str, Any]:
84
- """Return the dictionary representation of the model using alias.
85
-
86
- This has the following differences from calling pydantic's
87
- `self.model_dump(by_alias=True)`:
88
-
89
- * `None` is only added to the output dict for nullable fields that
90
- were set at model initialization. Other fields with value `None`
91
- are ignored.
92
- """
93
- excluded_fields: Set[str] = set([])
94
-
95
- _dict = self.model_dump(
96
- by_alias=True,
97
- exclude=excluded_fields,
98
- exclude_none=True,
99
- )
100
- # override the default output from pydantic by calling `to_dict()` of metadata
101
- if self.metadata:
102
- _dict["metadata"] = self.metadata.to_dict()
103
- # override the default output from pydantic by calling `to_dict()` of build_config
104
- if self.build_config:
105
- _dict["buildConfig"] = self.build_config.to_dict()
106
- # override the default output from pydantic by calling `to_dict()` of each item in runtime_configs (list)
107
- _items = []
108
- if self.runtime_configs:
109
- for _item in self.runtime_configs:
110
- if _item:
111
- _items.append(_item.to_dict())
112
- _dict["runtimeConfigs"] = _items
113
- return _dict
114
-
115
- @classmethod
116
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
117
- """Create an instance of ManagedWorkerList200ResponseRowsInner from a dict"""
118
- if obj is None:
119
- return None
120
-
121
- if not isinstance(obj, dict):
122
- return cls.model_validate(obj)
123
-
124
- _obj = cls.model_validate(
125
- {
126
- "metadata": (
127
- GithubAppListInstallations200ResponseRowsInnerMetadata.from_dict(
128
- obj["metadata"]
129
- )
130
- if obj.get("metadata") is not None
131
- else None
132
- ),
133
- "name": obj.get("name"),
134
- "buildConfig": (
135
- ManagedWorkerList200ResponseRowsInnerBuildConfig.from_dict(
136
- obj["buildConfig"]
137
- )
138
- if obj.get("buildConfig") is not None
139
- else None
140
- ),
141
- "isIac": obj.get("isIac"),
142
- "runtimeConfigs": (
143
- [
144
- ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner.from_dict(
145
- _item
146
- )
147
- for _item in obj["runtimeConfigs"]
148
- ]
149
- if obj.get("runtimeConfigs") is not None
150
- else None
151
- ),
152
- }
153
- )
154
- return _obj
@@ -1,151 +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.github_app_list_installations200_response_rows_inner_metadata import (
26
- GithubAppListInstallations200ResponseRowsInnerMetadata,
27
- )
28
- from hatchet_sdk.clients.cloud_rest.models.github_app_list_repos200_response_inner import (
29
- GithubAppListRepos200ResponseInner,
30
- )
31
- from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner_build_config_steps_inner import (
32
- ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner,
33
- )
34
-
35
-
36
- class ManagedWorkerList200ResponseRowsInnerBuildConfig(BaseModel):
37
- """
38
- ManagedWorkerList200ResponseRowsInnerBuildConfig
39
- """ # noqa: E501
40
-
41
- metadata: GithubAppListInstallations200ResponseRowsInnerMetadata
42
- github_installation_id: Annotated[
43
- str, Field(min_length=36, strict=True, max_length=36)
44
- ] = Field(alias="githubInstallationId")
45
- github_repository: GithubAppListRepos200ResponseInner = Field(
46
- alias="githubRepository"
47
- )
48
- github_repository_branch: StrictStr = Field(alias="githubRepositoryBranch")
49
- steps: Optional[
50
- List[ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner]
51
- ] = None
52
- __properties: ClassVar[List[str]] = [
53
- "metadata",
54
- "githubInstallationId",
55
- "githubRepository",
56
- "githubRepositoryBranch",
57
- "steps",
58
- ]
59
-
60
- model_config = ConfigDict(
61
- populate_by_name=True,
62
- validate_assignment=True,
63
- protected_namespaces=(),
64
- )
65
-
66
- def to_str(self) -> str:
67
- """Returns the string representation of the model using alias"""
68
- return pprint.pformat(self.model_dump(by_alias=True))
69
-
70
- def to_json(self) -> str:
71
- """Returns the JSON representation of the model using alias"""
72
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
73
- return json.dumps(self.to_dict())
74
-
75
- @classmethod
76
- def from_json(cls, json_str: str) -> Optional[Self]:
77
- """Create an instance of ManagedWorkerList200ResponseRowsInnerBuildConfig from a JSON string"""
78
- return cls.from_dict(json.loads(json_str))
79
-
80
- def to_dict(self) -> Dict[str, Any]:
81
- """Return the dictionary representation of the model using alias.
82
-
83
- This has the following differences from calling pydantic's
84
- `self.model_dump(by_alias=True)`:
85
-
86
- * `None` is only added to the output dict for nullable fields that
87
- were set at model initialization. Other fields with value `None`
88
- are ignored.
89
- """
90
- excluded_fields: Set[str] = set([])
91
-
92
- _dict = self.model_dump(
93
- by_alias=True,
94
- exclude=excluded_fields,
95
- exclude_none=True,
96
- )
97
- # override the default output from pydantic by calling `to_dict()` of metadata
98
- if self.metadata:
99
- _dict["metadata"] = self.metadata.to_dict()
100
- # override the default output from pydantic by calling `to_dict()` of github_repository
101
- if self.github_repository:
102
- _dict["githubRepository"] = self.github_repository.to_dict()
103
- # override the default output from pydantic by calling `to_dict()` of each item in steps (list)
104
- _items = []
105
- if self.steps:
106
- for _item in self.steps:
107
- if _item:
108
- _items.append(_item.to_dict())
109
- _dict["steps"] = _items
110
- return _dict
111
-
112
- @classmethod
113
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
114
- """Create an instance of ManagedWorkerList200ResponseRowsInnerBuildConfig from a dict"""
115
- if obj is None:
116
- return None
117
-
118
- if not isinstance(obj, dict):
119
- return cls.model_validate(obj)
120
-
121
- _obj = cls.model_validate(
122
- {
123
- "metadata": (
124
- GithubAppListInstallations200ResponseRowsInnerMetadata.from_dict(
125
- obj["metadata"]
126
- )
127
- if obj.get("metadata") is not None
128
- else None
129
- ),
130
- "githubInstallationId": obj.get("githubInstallationId"),
131
- "githubRepository": (
132
- GithubAppListRepos200ResponseInner.from_dict(
133
- obj["githubRepository"]
134
- )
135
- if obj.get("githubRepository") is not None
136
- else None
137
- ),
138
- "githubRepositoryBranch": obj.get("githubRepositoryBranch"),
139
- "steps": (
140
- [
141
- ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner.from_dict(
142
- _item
143
- )
144
- for _item in obj["steps"]
145
- ]
146
- if obj.get("steps") is not None
147
- else None
148
- ),
149
- }
150
- )
151
- return _obj