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
@@ -19,30 +19,58 @@ import pprint
19
19
  import re # noqa: F401
20
20
  from typing import Any, ClassVar, Dict, List, Optional, Set
21
21
 
22
- from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from pydantic import (
23
+ BaseModel,
24
+ ConfigDict,
25
+ Field,
26
+ StrictBool,
27
+ StrictStr,
28
+ field_validator,
29
+ )
23
30
  from typing_extensions import Self
24
31
 
25
- from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner_metadata import (
26
- GithubAppListInstallations200ResponseRowsInnerMetadata,
27
- )
32
+ from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta
28
33
 
29
34
 
30
- class GithubAppListInstallations200ResponseRowsInner(BaseModel):
35
+ class CronWorkflows(BaseModel):
31
36
  """
32
- GithubAppListInstallations200ResponseRowsInner
37
+ CronWorkflows
33
38
  """ # noqa: E501
34
39
 
35
- metadata: GithubAppListInstallations200ResponseRowsInnerMetadata
36
- installation_settings_url: StrictStr
37
- account_name: StrictStr
38
- account_avatar_url: StrictStr
40
+ metadata: APIResourceMeta
41
+ tenant_id: StrictStr = Field(alias="tenantId")
42
+ workflow_version_id: StrictStr = Field(alias="workflowVersionId")
43
+ workflow_id: StrictStr = Field(alias="workflowId")
44
+ workflow_name: StrictStr = Field(alias="workflowName")
45
+ cron: StrictStr
46
+ name: Optional[StrictStr] = None
47
+ input: Optional[Dict[str, Any]] = None
48
+ additional_metadata: Optional[Dict[str, Any]] = Field(
49
+ default=None, alias="additionalMetadata"
50
+ )
51
+ enabled: StrictBool
52
+ method: StrictStr
39
53
  __properties: ClassVar[List[str]] = [
40
54
  "metadata",
41
- "installation_settings_url",
42
- "account_name",
43
- "account_avatar_url",
55
+ "tenantId",
56
+ "workflowVersionId",
57
+ "workflowId",
58
+ "workflowName",
59
+ "cron",
60
+ "name",
61
+ "input",
62
+ "additionalMetadata",
63
+ "enabled",
64
+ "method",
44
65
  ]
45
66
 
67
+ @field_validator("method")
68
+ def method_validate_enum(cls, value):
69
+ """Validates the enum"""
70
+ if value not in set(["DEFAULT", "API"]):
71
+ raise ValueError("must be one of enum values ('DEFAULT', 'API')")
72
+ return value
73
+
46
74
  model_config = ConfigDict(
47
75
  populate_by_name=True,
48
76
  validate_assignment=True,
@@ -60,7 +88,7 @@ class GithubAppListInstallations200ResponseRowsInner(BaseModel):
60
88
 
61
89
  @classmethod
62
90
  def from_json(cls, json_str: str) -> Optional[Self]:
63
- """Create an instance of GithubAppListInstallations200ResponseRowsInner from a JSON string"""
91
+ """Create an instance of CronWorkflows from a JSON string"""
64
92
  return cls.from_dict(json.loads(json_str))
65
93
 
66
94
  def to_dict(self) -> Dict[str, Any]:
@@ -87,7 +115,7 @@ class GithubAppListInstallations200ResponseRowsInner(BaseModel):
87
115
 
88
116
  @classmethod
89
117
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
90
- """Create an instance of GithubAppListInstallations200ResponseRowsInner from a dict"""
118
+ """Create an instance of CronWorkflows from a dict"""
91
119
  if obj is None:
92
120
  return None
93
121
 
@@ -97,15 +125,20 @@ class GithubAppListInstallations200ResponseRowsInner(BaseModel):
97
125
  _obj = cls.model_validate(
98
126
  {
99
127
  "metadata": (
100
- GithubAppListInstallations200ResponseRowsInnerMetadata.from_dict(
101
- obj["metadata"]
102
- )
128
+ APIResourceMeta.from_dict(obj["metadata"])
103
129
  if obj.get("metadata") is not None
104
130
  else None
105
131
  ),
106
- "installation_settings_url": obj.get("installation_settings_url"),
107
- "account_name": obj.get("account_name"),
108
- "account_avatar_url": obj.get("account_avatar_url"),
132
+ "tenantId": obj.get("tenantId"),
133
+ "workflowVersionId": obj.get("workflowVersionId"),
134
+ "workflowId": obj.get("workflowId"),
135
+ "workflowName": obj.get("workflowName"),
136
+ "cron": obj.get("cron"),
137
+ "name": obj.get("name"),
138
+ "input": obj.get("input"),
139
+ "additionalMetadata": obj.get("additionalMetadata"),
140
+ "enabled": obj.get("enabled"),
141
+ "method": obj.get("method"),
109
142
  }
110
143
  )
111
144
  return _obj
@@ -22,21 +22,17 @@ from typing import Any, ClassVar, Dict, List, Optional, Set
22
22
  from pydantic import BaseModel, ConfigDict
23
23
  from typing_extensions import Self
24
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.log_list200_response_rows_inner import (
29
- LogList200ResponseRowsInner,
30
- )
25
+ from hatchet_sdk.clients.rest.models.cron_workflows import CronWorkflows
26
+ from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse
31
27
 
32
28
 
33
- class LogList200Response(BaseModel):
29
+ class CronWorkflowsList(BaseModel):
34
30
  """
35
- LogList200Response
31
+ CronWorkflowsList
36
32
  """ # noqa: E501
37
33
 
38
- rows: Optional[List[LogList200ResponseRowsInner]] = None
39
- pagination: Optional[GithubAppListInstallations200ResponsePagination] = None
34
+ rows: Optional[List[CronWorkflows]] = None
35
+ pagination: Optional[PaginationResponse] = None
40
36
  __properties: ClassVar[List[str]] = ["rows", "pagination"]
41
37
 
42
38
  model_config = ConfigDict(
@@ -56,7 +52,7 @@ class LogList200Response(BaseModel):
56
52
 
57
53
  @classmethod
58
54
  def from_json(cls, json_str: str) -> Optional[Self]:
59
- """Create an instance of LogList200Response from a JSON string"""
55
+ """Create an instance of CronWorkflowsList from a JSON string"""
60
56
  return cls.from_dict(json.loads(json_str))
61
57
 
62
58
  def to_dict(self) -> Dict[str, Any]:
@@ -79,9 +75,9 @@ class LogList200Response(BaseModel):
79
75
  # override the default output from pydantic by calling `to_dict()` of each item in rows (list)
80
76
  _items = []
81
77
  if self.rows:
82
- for _item in self.rows:
83
- if _item:
84
- _items.append(_item.to_dict())
78
+ for _item_rows in self.rows:
79
+ if _item_rows:
80
+ _items.append(_item_rows.to_dict())
85
81
  _dict["rows"] = _items
86
82
  # override the default output from pydantic by calling `to_dict()` of pagination
87
83
  if self.pagination:
@@ -90,7 +86,7 @@ class LogList200Response(BaseModel):
90
86
 
91
87
  @classmethod
92
88
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
93
- """Create an instance of LogList200Response from a dict"""
89
+ """Create an instance of CronWorkflowsList from a dict"""
94
90
  if obj is None:
95
91
  return None
96
92
 
@@ -100,17 +96,12 @@ class LogList200Response(BaseModel):
100
96
  _obj = cls.model_validate(
101
97
  {
102
98
  "rows": (
103
- [
104
- LogList200ResponseRowsInner.from_dict(_item)
105
- for _item in obj["rows"]
106
- ]
99
+ [CronWorkflows.from_dict(_item) for _item in obj["rows"]]
107
100
  if obj.get("rows") is not None
108
101
  else None
109
102
  ),
110
103
  "pagination": (
111
- GithubAppListInstallations200ResponsePagination.from_dict(
112
- obj["pagination"]
113
- )
104
+ PaginationResponse.from_dict(obj["pagination"])
114
105
  if obj.get("pagination") is not None
115
106
  else None
116
107
  ),
@@ -0,0 +1,37 @@
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
+ from enum import Enum
19
+
20
+ from typing_extensions import Self
21
+
22
+
23
+ class CronWorkflowsOrderByField(str, Enum):
24
+ """
25
+ CronWorkflowsOrderByField
26
+ """
27
+
28
+ """
29
+ allowed enum values
30
+ """
31
+ NAME = "name"
32
+ CREATEDAT = "createdAt"
33
+
34
+ @classmethod
35
+ def from_json(cls, json_str: str) -> Self:
36
+ """Create an instance of CronWorkflowsOrderByField from a JSON string"""
37
+ return cls(json.loads(json_str))
@@ -78,9 +78,9 @@ class EventList(BaseModel):
78
78
  # override the default output from pydantic by calling `to_dict()` of each item in rows (list)
79
79
  _items = []
80
80
  if self.rows:
81
- for _item in self.rows:
82
- if _item:
83
- _items.append(_item.to_dict())
81
+ for _item_rows in self.rows:
82
+ if _item_rows:
83
+ _items.append(_item_rows.to_dict())
84
84
  _dict["rows"] = _items
85
85
  return _dict
86
86
 
@@ -73,9 +73,9 @@ class GetStepRunDiffResponse(BaseModel):
73
73
  # override the default output from pydantic by calling `to_dict()` of each item in diffs (list)
74
74
  _items = []
75
75
  if self.diffs:
76
- for _item in self.diffs:
77
- if _item:
78
- _items.append(_item.to_dict())
76
+ for _item_diffs in self.diffs:
77
+ if _item_diffs:
78
+ _items.append(_item_diffs.to_dict())
79
79
  _dict["diffs"] = _items
80
80
  return _dict
81
81
 
@@ -95,9 +95,9 @@ class Job(BaseModel):
95
95
  # override the default output from pydantic by calling `to_dict()` of each item in steps (list)
96
96
  _items = []
97
97
  if self.steps:
98
- for _item in self.steps:
99
- if _item:
100
- _items.append(_item.to_dict())
98
+ for _item_steps in self.steps:
99
+ if _item_steps:
100
+ _items.append(_item_steps.to_dict())
101
101
  _dict["steps"] = _items
102
102
  return _dict
103
103
 
@@ -117,9 +117,9 @@ class JobRun(BaseModel):
117
117
  # override the default output from pydantic by calling `to_dict()` of each item in step_runs (list)
118
118
  _items = []
119
119
  if self.step_runs:
120
- for _item in self.step_runs:
121
- if _item:
122
- _items.append(_item.to_dict())
120
+ for _item_step_runs in self.step_runs:
121
+ if _item_step_runs:
122
+ _items.append(_item_step_runs.to_dict())
123
123
  _dict["stepRuns"] = _items
124
124
  return _dict
125
125
 
@@ -78,9 +78,9 @@ class ListAPITokensResponse(BaseModel):
78
78
  # override the default output from pydantic by calling `to_dict()` of each item in rows (list)
79
79
  _items = []
80
80
  if self.rows:
81
- for _item in self.rows:
82
- if _item:
83
- _items.append(_item.to_dict())
81
+ for _item_rows in self.rows:
82
+ if _item_rows:
83
+ _items.append(_item_rows.to_dict())
84
84
  _dict["rows"] = _items
85
85
  return _dict
86
86
 
@@ -73,9 +73,9 @@ class ListPullRequestsResponse(BaseModel):
73
73
  # override the default output from pydantic by calling `to_dict()` of each item in pull_requests (list)
74
74
  _items = []
75
75
  if self.pull_requests:
76
- for _item in self.pull_requests:
77
- if _item:
78
- _items.append(_item.to_dict())
76
+ for _item_pull_requests in self.pull_requests:
77
+ if _item_pull_requests:
78
+ _items.append(_item_pull_requests.to_dict())
79
79
  _dict["pullRequests"] = _items
80
80
  return _dict
81
81
 
@@ -78,9 +78,9 @@ class ListSlackWebhooks(BaseModel):
78
78
  # override the default output from pydantic by calling `to_dict()` of each item in rows (list)
79
79
  _items = []
80
80
  if self.rows:
81
- for _item in self.rows:
82
- if _item:
83
- _items.append(_item.to_dict())
81
+ for _item_rows in self.rows:
82
+ if _item_rows:
83
+ _items.append(_item_rows.to_dict())
84
84
  _dict["rows"] = _items
85
85
  return _dict
86
86
 
@@ -78,9 +78,9 @@ class ListSNSIntegrations(BaseModel):
78
78
  # override the default output from pydantic by calling `to_dict()` of each item in rows (list)
79
79
  _items = []
80
80
  if self.rows:
81
- for _item in self.rows:
82
- if _item:
83
- _items.append(_item.to_dict())
81
+ for _item_rows in self.rows:
82
+ if _item_rows:
83
+ _items.append(_item_rows.to_dict())
84
84
  _dict["rows"] = _items
85
85
  return _dict
86
86
 
@@ -78,9 +78,9 @@ class LogLineList(BaseModel):
78
78
  # override the default output from pydantic by calling `to_dict()` of each item in rows (list)
79
79
  _items = []
80
80
  if self.rows:
81
- for _item in self.rows:
82
- if _item:
83
- _items.append(_item.to_dict())
81
+ for _item_rows in self.rows:
82
+ if _item_rows:
83
+ _items.append(_item_rows.to_dict())
84
84
  _dict["rows"] = _items
85
85
  return _dict
86
86
 
@@ -78,9 +78,9 @@ class RateLimitList(BaseModel):
78
78
  # override the default output from pydantic by calling `to_dict()` of each item in rows (list)
79
79
  _items = []
80
80
  if self.rows:
81
- for _item in self.rows:
82
- if _item:
83
- _items.append(_item.to_dict())
81
+ for _item_rows in self.rows:
82
+ if _item_rows:
83
+ _items.append(_item_rows.to_dict())
84
84
  _dict["rows"] = _items
85
85
  return _dict
86
86
 
@@ -73,9 +73,9 @@ class ReplayWorkflowRunsResponse(BaseModel):
73
73
  # override the default output from pydantic by calling `to_dict()` of each item in workflow_runs (list)
74
74
  _items = []
75
75
  if self.workflow_runs:
76
- for _item in self.workflow_runs:
77
- if _item:
78
- _items.append(_item.to_dict())
76
+ for _item_workflow_runs in self.workflow_runs:
77
+ if _item_workflow_runs:
78
+ _items.append(_item_workflow_runs.to_dict())
79
79
  _dict["workflowRuns"] = _items
80
80
  return _dict
81
81
 
@@ -20,19 +20,19 @@ import re # noqa: F401
20
20
  from datetime import datetime
21
21
  from typing import Any, ClassVar, Dict, List, Optional, Set
22
22
 
23
- from pydantic import BaseModel, ConfigDict, StrictStr
23
+ from pydantic import BaseModel, ConfigDict, Field
24
24
  from typing_extensions import Self
25
25
 
26
26
 
27
- class LogList200ResponseRowsInner(BaseModel):
27
+ class ScheduleWorkflowRunRequest(BaseModel):
28
28
  """
29
- LogList200ResponseRowsInner
29
+ ScheduleWorkflowRunRequest
30
30
  """ # noqa: E501
31
31
 
32
- timestamp: datetime
33
- instance: StrictStr
34
- line: StrictStr
35
- __properties: ClassVar[List[str]] = ["timestamp", "instance", "line"]
32
+ input: Dict[str, Any]
33
+ additional_metadata: Dict[str, Any] = Field(alias="additionalMetadata")
34
+ trigger_at: datetime = Field(alias="triggerAt")
35
+ __properties: ClassVar[List[str]] = ["input", "additionalMetadata", "triggerAt"]
36
36
 
37
37
  model_config = ConfigDict(
38
38
  populate_by_name=True,
@@ -51,7 +51,7 @@ class LogList200ResponseRowsInner(BaseModel):
51
51
 
52
52
  @classmethod
53
53
  def from_json(cls, json_str: str) -> Optional[Self]:
54
- """Create an instance of LogList200ResponseRowsInner from a JSON string"""
54
+ """Create an instance of ScheduleWorkflowRunRequest from a JSON string"""
55
55
  return cls.from_dict(json.loads(json_str))
56
56
 
57
57
  def to_dict(self) -> Dict[str, Any]:
@@ -75,7 +75,7 @@ class LogList200ResponseRowsInner(BaseModel):
75
75
 
76
76
  @classmethod
77
77
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
- """Create an instance of LogList200ResponseRowsInner from a dict"""
78
+ """Create an instance of ScheduleWorkflowRunRequest from a dict"""
79
79
  if obj is None:
80
80
  return None
81
81
 
@@ -84,9 +84,9 @@ class LogList200ResponseRowsInner(BaseModel):
84
84
 
85
85
  _obj = cls.model_validate(
86
86
  {
87
- "timestamp": obj.get("timestamp"),
88
- "instance": obj.get("instance"),
89
- "line": obj.get("line"),
87
+ "input": obj.get("input"),
88
+ "additionalMetadata": obj.get("additionalMetadata"),
89
+ "triggerAt": obj.get("triggerAt"),
90
90
  }
91
91
  )
92
92
  return _obj
@@ -0,0 +1,42 @@
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
+ from enum import Enum
19
+
20
+ from typing_extensions import Self
21
+
22
+
23
+ class ScheduledRunStatus(str, Enum):
24
+ """
25
+ ScheduledRunStatus
26
+ """
27
+
28
+ """
29
+ allowed enum values
30
+ """
31
+ PENDING = "PENDING"
32
+ RUNNING = "RUNNING"
33
+ SUCCEEDED = "SUCCEEDED"
34
+ FAILED = "FAILED"
35
+ CANCELLED = "CANCELLED"
36
+ QUEUED = "QUEUED"
37
+ SCHEDULED = "SCHEDULED"
38
+
39
+ @classmethod
40
+ def from_json(cls, json_str: str) -> Self:
41
+ """Create an instance of ScheduledRunStatus from a JSON string"""
42
+ return cls(json.loads(json_str))
@@ -0,0 +1,153 @@
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, StrictStr, field_validator
24
+ from typing_extensions import Annotated, Self
25
+
26
+ from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta
27
+ from hatchet_sdk.clients.rest.models.workflow_run_status import WorkflowRunStatus
28
+
29
+
30
+ class ScheduledWorkflows(BaseModel):
31
+ """
32
+ ScheduledWorkflows
33
+ """ # noqa: E501
34
+
35
+ metadata: APIResourceMeta
36
+ tenant_id: StrictStr = Field(alias="tenantId")
37
+ workflow_version_id: StrictStr = Field(alias="workflowVersionId")
38
+ workflow_id: StrictStr = Field(alias="workflowId")
39
+ workflow_name: StrictStr = Field(alias="workflowName")
40
+ trigger_at: datetime = Field(alias="triggerAt")
41
+ input: Optional[Dict[str, Any]] = None
42
+ additional_metadata: Optional[Dict[str, Any]] = Field(
43
+ default=None, alias="additionalMetadata"
44
+ )
45
+ workflow_run_created_at: Optional[datetime] = Field(
46
+ default=None, alias="workflowRunCreatedAt"
47
+ )
48
+ workflow_run_name: Optional[StrictStr] = Field(
49
+ default=None, alias="workflowRunName"
50
+ )
51
+ workflow_run_status: Optional[WorkflowRunStatus] = Field(
52
+ default=None, alias="workflowRunStatus"
53
+ )
54
+ workflow_run_id: Optional[
55
+ Annotated[str, Field(min_length=36, strict=True, max_length=36)]
56
+ ] = Field(default=None, alias="workflowRunId")
57
+ method: StrictStr
58
+ __properties: ClassVar[List[str]] = [
59
+ "metadata",
60
+ "tenantId",
61
+ "workflowVersionId",
62
+ "workflowId",
63
+ "workflowName",
64
+ "triggerAt",
65
+ "input",
66
+ "additionalMetadata",
67
+ "workflowRunCreatedAt",
68
+ "workflowRunName",
69
+ "workflowRunStatus",
70
+ "workflowRunId",
71
+ "method",
72
+ ]
73
+
74
+ @field_validator("method")
75
+ def method_validate_enum(cls, value):
76
+ """Validates the enum"""
77
+ if value not in set(["DEFAULT", "API"]):
78
+ raise ValueError("must be one of enum values ('DEFAULT', 'API')")
79
+ return value
80
+
81
+ model_config = ConfigDict(
82
+ populate_by_name=True,
83
+ validate_assignment=True,
84
+ protected_namespaces=(),
85
+ )
86
+
87
+ def to_str(self) -> str:
88
+ """Returns the string representation of the model using alias"""
89
+ return pprint.pformat(self.model_dump(by_alias=True))
90
+
91
+ def to_json(self) -> str:
92
+ """Returns the JSON representation of the model using alias"""
93
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
94
+ return json.dumps(self.to_dict())
95
+
96
+ @classmethod
97
+ def from_json(cls, json_str: str) -> Optional[Self]:
98
+ """Create an instance of ScheduledWorkflows from a JSON string"""
99
+ return cls.from_dict(json.loads(json_str))
100
+
101
+ def to_dict(self) -> Dict[str, Any]:
102
+ """Return the dictionary representation of the model using alias.
103
+
104
+ This has the following differences from calling pydantic's
105
+ `self.model_dump(by_alias=True)`:
106
+
107
+ * `None` is only added to the output dict for nullable fields that
108
+ were set at model initialization. Other fields with value `None`
109
+ are ignored.
110
+ """
111
+ excluded_fields: Set[str] = set([])
112
+
113
+ _dict = self.model_dump(
114
+ by_alias=True,
115
+ exclude=excluded_fields,
116
+ exclude_none=True,
117
+ )
118
+ # override the default output from pydantic by calling `to_dict()` of metadata
119
+ if self.metadata:
120
+ _dict["metadata"] = self.metadata.to_dict()
121
+ return _dict
122
+
123
+ @classmethod
124
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
125
+ """Create an instance of ScheduledWorkflows from a dict"""
126
+ if obj is None:
127
+ return None
128
+
129
+ if not isinstance(obj, dict):
130
+ return cls.model_validate(obj)
131
+
132
+ _obj = cls.model_validate(
133
+ {
134
+ "metadata": (
135
+ APIResourceMeta.from_dict(obj["metadata"])
136
+ if obj.get("metadata") is not None
137
+ else None
138
+ ),
139
+ "tenantId": obj.get("tenantId"),
140
+ "workflowVersionId": obj.get("workflowVersionId"),
141
+ "workflowId": obj.get("workflowId"),
142
+ "workflowName": obj.get("workflowName"),
143
+ "triggerAt": obj.get("triggerAt"),
144
+ "input": obj.get("input"),
145
+ "additionalMetadata": obj.get("additionalMetadata"),
146
+ "workflowRunCreatedAt": obj.get("workflowRunCreatedAt"),
147
+ "workflowRunName": obj.get("workflowRunName"),
148
+ "workflowRunStatus": obj.get("workflowRunStatus"),
149
+ "workflowRunId": obj.get("workflowRunId"),
150
+ "method": obj.get("method"),
151
+ }
152
+ )
153
+ return _obj