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,98 +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
24
- from typing_extensions import Annotated, Self
25
-
26
-
27
- class GithubAppListInstallations200ResponseRowsInnerMetadata(BaseModel):
28
- """
29
- GithubAppListInstallations200ResponseRowsInnerMetadata
30
- """ # noqa: E501
31
-
32
- id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field(
33
- description="the id of this resource, in UUID format"
34
- )
35
- created_at: datetime = Field(
36
- description="the time that this resource was created", alias="createdAt"
37
- )
38
- updated_at: datetime = Field(
39
- description="the time that this resource was last updated", alias="updatedAt"
40
- )
41
- __properties: ClassVar[List[str]] = ["id", "createdAt", "updatedAt"]
42
-
43
- model_config = ConfigDict(
44
- populate_by_name=True,
45
- validate_assignment=True,
46
- protected_namespaces=(),
47
- )
48
-
49
- def to_str(self) -> str:
50
- """Returns the string representation of the model using alias"""
51
- return pprint.pformat(self.model_dump(by_alias=True))
52
-
53
- def to_json(self) -> str:
54
- """Returns the JSON representation of the model using alias"""
55
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
56
- return json.dumps(self.to_dict())
57
-
58
- @classmethod
59
- def from_json(cls, json_str: str) -> Optional[Self]:
60
- """Create an instance of GithubAppListInstallations200ResponseRowsInnerMetadata from a JSON string"""
61
- return cls.from_dict(json.loads(json_str))
62
-
63
- def to_dict(self) -> Dict[str, Any]:
64
- """Return the dictionary representation of the model using alias.
65
-
66
- This has the following differences from calling pydantic's
67
- `self.model_dump(by_alias=True)`:
68
-
69
- * `None` is only added to the output dict for nullable fields that
70
- were set at model initialization. Other fields with value `None`
71
- are ignored.
72
- """
73
- excluded_fields: Set[str] = set([])
74
-
75
- _dict = self.model_dump(
76
- by_alias=True,
77
- exclude=excluded_fields,
78
- exclude_none=True,
79
- )
80
- return _dict
81
-
82
- @classmethod
83
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
- """Create an instance of GithubAppListInstallations200ResponseRowsInnerMetadata from a dict"""
85
- if obj is None:
86
- return None
87
-
88
- if not isinstance(obj, dict):
89
- return cls.model_validate(obj)
90
-
91
- _obj = cls.model_validate(
92
- {
93
- "id": obj.get("id"),
94
- "createdAt": obj.get("createdAt"),
95
- "updatedAt": obj.get("updatedAt"),
96
- }
97
- )
98
- return _obj
@@ -1,86 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Hatchet API
5
-
6
- The Hatchet API
7
-
8
- The version of the OpenAPI document: 1.0.0
9
- Generated by OpenAPI Generator (https://openapi-generator.tech)
10
-
11
- Do not edit the class manually.
12
- """ # noqa: E501
13
-
14
-
15
- from __future__ import annotations
16
-
17
- import json
18
- import pprint
19
- import re # noqa: F401
20
- from typing import Any, ClassVar, Dict, List, Optional, Set
21
-
22
- from pydantic import BaseModel, ConfigDict, StrictStr
23
- from typing_extensions import Self
24
-
25
-
26
- class GithubAppListRepos200ResponseInner(BaseModel):
27
- """
28
- GithubAppListRepos200ResponseInner
29
- """ # noqa: E501
30
-
31
- repo_owner: StrictStr
32
- repo_name: StrictStr
33
- __properties: ClassVar[List[str]] = ["repo_owner", "repo_name"]
34
-
35
- model_config = ConfigDict(
36
- populate_by_name=True,
37
- validate_assignment=True,
38
- protected_namespaces=(),
39
- )
40
-
41
- def to_str(self) -> str:
42
- """Returns the string representation of the model using alias"""
43
- return pprint.pformat(self.model_dump(by_alias=True))
44
-
45
- def to_json(self) -> str:
46
- """Returns the JSON representation of the model using alias"""
47
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
- return json.dumps(self.to_dict())
49
-
50
- @classmethod
51
- def from_json(cls, json_str: str) -> Optional[Self]:
52
- """Create an instance of GithubAppListRepos200ResponseInner from a JSON string"""
53
- return cls.from_dict(json.loads(json_str))
54
-
55
- def to_dict(self) -> Dict[str, Any]:
56
- """Return the dictionary representation of the model using alias.
57
-
58
- This has the following differences from calling pydantic's
59
- `self.model_dump(by_alias=True)`:
60
-
61
- * `None` is only added to the output dict for nullable fields that
62
- were set at model initialization. Other fields with value `None`
63
- are ignored.
64
- """
65
- excluded_fields: Set[str] = set([])
66
-
67
- _dict = self.model_dump(
68
- by_alias=True,
69
- exclude=excluded_fields,
70
- exclude_none=True,
71
- )
72
- return _dict
73
-
74
- @classmethod
75
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
- """Create an instance of GithubAppListRepos200ResponseInner from a dict"""
77
- if obj is None:
78
- return None
79
-
80
- if not isinstance(obj, dict):
81
- return cls.model_validate(obj)
82
-
83
- _obj = cls.model_validate(
84
- {"repo_owner": obj.get("repo_owner"), "repo_name": obj.get("repo_name")}
85
- )
86
- return _obj
@@ -1,107 +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
23
- from typing_extensions import Self
24
-
25
- from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_runtime_config import (
26
- ManagedWorkerCreateRequestRuntimeConfig,
27
- )
28
-
29
-
30
- class InfraAsCodeCreateRequest(BaseModel):
31
- """
32
- InfraAsCodeCreateRequest
33
- """ # noqa: E501
34
-
35
- runtime_configs: List[ManagedWorkerCreateRequestRuntimeConfig] = Field(
36
- alias="runtimeConfigs"
37
- )
38
- __properties: ClassVar[List[str]] = ["runtimeConfigs"]
39
-
40
- model_config = ConfigDict(
41
- populate_by_name=True,
42
- validate_assignment=True,
43
- protected_namespaces=(),
44
- )
45
-
46
- def to_str(self) -> str:
47
- """Returns the string representation of the model using alias"""
48
- return pprint.pformat(self.model_dump(by_alias=True))
49
-
50
- def to_json(self) -> str:
51
- """Returns the JSON representation of the model using alias"""
52
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
53
- return json.dumps(self.to_dict())
54
-
55
- @classmethod
56
- def from_json(cls, json_str: str) -> Optional[Self]:
57
- """Create an instance of InfraAsCodeCreateRequest from a JSON string"""
58
- return cls.from_dict(json.loads(json_str))
59
-
60
- def to_dict(self) -> Dict[str, Any]:
61
- """Return the dictionary representation of the model using alias.
62
-
63
- This has the following differences from calling pydantic's
64
- `self.model_dump(by_alias=True)`:
65
-
66
- * `None` is only added to the output dict for nullable fields that
67
- were set at model initialization. Other fields with value `None`
68
- are ignored.
69
- """
70
- excluded_fields: Set[str] = set([])
71
-
72
- _dict = self.model_dump(
73
- by_alias=True,
74
- exclude=excluded_fields,
75
- exclude_none=True,
76
- )
77
- # override the default output from pydantic by calling `to_dict()` of each item in runtime_configs (list)
78
- _items = []
79
- if self.runtime_configs:
80
- for _item in self.runtime_configs:
81
- if _item:
82
- _items.append(_item.to_dict())
83
- _dict["runtimeConfigs"] = _items
84
- return _dict
85
-
86
- @classmethod
87
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
88
- """Create an instance of InfraAsCodeCreateRequest from a dict"""
89
- if obj is None:
90
- return None
91
-
92
- if not isinstance(obj, dict):
93
- return cls.model_validate(obj)
94
-
95
- _obj = cls.model_validate(
96
- {
97
- "runtimeConfigs": (
98
- [
99
- ManagedWorkerCreateRequestRuntimeConfig.from_dict(_item)
100
- for _item in obj["runtimeConfigs"]
101
- ]
102
- if obj.get("runtimeConfigs") is not None
103
- else None
104
- )
105
- }
106
- )
107
- return _obj
@@ -1,136 +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, StrictStr
24
- from typing_extensions import Self
25
-
26
- from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_event import (
27
- LogCreateRequestInnerEvent,
28
- )
29
- from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_fly import (
30
- LogCreateRequestInnerFly,
31
- )
32
- from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_log import (
33
- LogCreateRequestInnerLog,
34
- )
35
-
36
-
37
- class LogCreateRequestInner(BaseModel):
38
- """
39
- LogCreateRequestInner
40
- """ # noqa: E501
41
-
42
- event: Optional[LogCreateRequestInnerEvent] = None
43
- fly: Optional[LogCreateRequestInnerFly] = None
44
- host: Optional[StrictStr] = None
45
- log: Optional[LogCreateRequestInnerLog] = None
46
- message: Optional[StrictStr] = None
47
- timestamp: Optional[datetime] = None
48
- __properties: ClassVar[List[str]] = [
49
- "event",
50
- "fly",
51
- "host",
52
- "log",
53
- "message",
54
- "timestamp",
55
- ]
56
-
57
- model_config = ConfigDict(
58
- populate_by_name=True,
59
- validate_assignment=True,
60
- protected_namespaces=(),
61
- )
62
-
63
- def to_str(self) -> str:
64
- """Returns the string representation of the model using alias"""
65
- return pprint.pformat(self.model_dump(by_alias=True))
66
-
67
- def to_json(self) -> str:
68
- """Returns the JSON representation of the model using alias"""
69
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
70
- return json.dumps(self.to_dict())
71
-
72
- @classmethod
73
- def from_json(cls, json_str: str) -> Optional[Self]:
74
- """Create an instance of LogCreateRequestInner from a JSON string"""
75
- return cls.from_dict(json.loads(json_str))
76
-
77
- def to_dict(self) -> Dict[str, Any]:
78
- """Return the dictionary representation of the model using alias.
79
-
80
- This has the following differences from calling pydantic's
81
- `self.model_dump(by_alias=True)`:
82
-
83
- * `None` is only added to the output dict for nullable fields that
84
- were set at model initialization. Other fields with value `None`
85
- are ignored.
86
- """
87
- excluded_fields: Set[str] = set([])
88
-
89
- _dict = self.model_dump(
90
- by_alias=True,
91
- exclude=excluded_fields,
92
- exclude_none=True,
93
- )
94
- # override the default output from pydantic by calling `to_dict()` of event
95
- if self.event:
96
- _dict["event"] = self.event.to_dict()
97
- # override the default output from pydantic by calling `to_dict()` of fly
98
- if self.fly:
99
- _dict["fly"] = self.fly.to_dict()
100
- # override the default output from pydantic by calling `to_dict()` of log
101
- if self.log:
102
- _dict["log"] = self.log.to_dict()
103
- return _dict
104
-
105
- @classmethod
106
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
107
- """Create an instance of LogCreateRequestInner from a dict"""
108
- if obj is None:
109
- return None
110
-
111
- if not isinstance(obj, dict):
112
- return cls.model_validate(obj)
113
-
114
- _obj = cls.model_validate(
115
- {
116
- "event": (
117
- LogCreateRequestInnerEvent.from_dict(obj["event"])
118
- if obj.get("event") is not None
119
- else None
120
- ),
121
- "fly": (
122
- LogCreateRequestInnerFly.from_dict(obj["fly"])
123
- if obj.get("fly") is not None
124
- else None
125
- ),
126
- "host": obj.get("host"),
127
- "log": (
128
- LogCreateRequestInnerLog.from_dict(obj["log"])
129
- if obj.get("log") is not None
130
- else None
131
- ),
132
- "message": obj.get("message"),
133
- "timestamp": obj.get("timestamp"),
134
- }
135
- )
136
- return _obj
@@ -1,83 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Hatchet API
5
-
6
- The Hatchet API
7
-
8
- The version of the OpenAPI document: 1.0.0
9
- Generated by OpenAPI Generator (https://openapi-generator.tech)
10
-
11
- Do not edit the class manually.
12
- """ # noqa: E501
13
-
14
-
15
- from __future__ import annotations
16
-
17
- import json
18
- import pprint
19
- import re # noqa: F401
20
- from typing import Any, ClassVar, Dict, List, Optional, Set
21
-
22
- from pydantic import BaseModel, ConfigDict, StrictStr
23
- from typing_extensions import Self
24
-
25
-
26
- class LogCreateRequestInnerEvent(BaseModel):
27
- """
28
- LogCreateRequestInnerEvent
29
- """ # noqa: E501
30
-
31
- provider: Optional[StrictStr] = None
32
- __properties: ClassVar[List[str]] = ["provider"]
33
-
34
- model_config = ConfigDict(
35
- populate_by_name=True,
36
- validate_assignment=True,
37
- protected_namespaces=(),
38
- )
39
-
40
- def to_str(self) -> str:
41
- """Returns the string representation of the model using alias"""
42
- return pprint.pformat(self.model_dump(by_alias=True))
43
-
44
- def to_json(self) -> str:
45
- """Returns the JSON representation of the model using alias"""
46
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
- return json.dumps(self.to_dict())
48
-
49
- @classmethod
50
- def from_json(cls, json_str: str) -> Optional[Self]:
51
- """Create an instance of LogCreateRequestInnerEvent from a JSON string"""
52
- return cls.from_dict(json.loads(json_str))
53
-
54
- def to_dict(self) -> Dict[str, Any]:
55
- """Return the dictionary representation of the model using alias.
56
-
57
- This has the following differences from calling pydantic's
58
- `self.model_dump(by_alias=True)`:
59
-
60
- * `None` is only added to the output dict for nullable fields that
61
- were set at model initialization. Other fields with value `None`
62
- are ignored.
63
- """
64
- excluded_fields: Set[str] = set([])
65
-
66
- _dict = self.model_dump(
67
- by_alias=True,
68
- exclude=excluded_fields,
69
- exclude_none=True,
70
- )
71
- return _dict
72
-
73
- @classmethod
74
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
- """Create an instance of LogCreateRequestInnerEvent from a dict"""
76
- if obj is None:
77
- return None
78
-
79
- if not isinstance(obj, dict):
80
- return cls.model_validate(obj)
81
-
82
- _obj = cls.model_validate({"provider": obj.get("provider")})
83
- return _obj
@@ -1,100 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Hatchet API
5
-
6
- The Hatchet API
7
-
8
- The version of the OpenAPI document: 1.0.0
9
- Generated by OpenAPI Generator (https://openapi-generator.tech)
10
-
11
- Do not edit the class manually.
12
- """ # noqa: E501
13
-
14
-
15
- from __future__ import annotations
16
-
17
- import json
18
- import pprint
19
- import re # noqa: F401
20
- from typing import Any, ClassVar, Dict, List, Optional, Set
21
-
22
- from pydantic import BaseModel, ConfigDict, StrictStr
23
- from typing_extensions import Self
24
-
25
- from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_fly_app import (
26
- LogCreateRequestInnerFlyApp,
27
- )
28
-
29
-
30
- class LogCreateRequestInnerFly(BaseModel):
31
- """
32
- LogCreateRequestInnerFly
33
- """ # noqa: E501
34
-
35
- app: Optional[LogCreateRequestInnerFlyApp] = None
36
- region: Optional[StrictStr] = None
37
- __properties: ClassVar[List[str]] = ["app", "region"]
38
-
39
- model_config = ConfigDict(
40
- populate_by_name=True,
41
- validate_assignment=True,
42
- protected_namespaces=(),
43
- )
44
-
45
- def to_str(self) -> str:
46
- """Returns the string representation of the model using alias"""
47
- return pprint.pformat(self.model_dump(by_alias=True))
48
-
49
- def to_json(self) -> str:
50
- """Returns the JSON representation of the model using alias"""
51
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
- return json.dumps(self.to_dict())
53
-
54
- @classmethod
55
- def from_json(cls, json_str: str) -> Optional[Self]:
56
- """Create an instance of LogCreateRequestInnerFly from a JSON string"""
57
- return cls.from_dict(json.loads(json_str))
58
-
59
- def to_dict(self) -> Dict[str, Any]:
60
- """Return the dictionary representation of the model using alias.
61
-
62
- This has the following differences from calling pydantic's
63
- `self.model_dump(by_alias=True)`:
64
-
65
- * `None` is only added to the output dict for nullable fields that
66
- were set at model initialization. Other fields with value `None`
67
- are ignored.
68
- """
69
- excluded_fields: Set[str] = set([])
70
-
71
- _dict = self.model_dump(
72
- by_alias=True,
73
- exclude=excluded_fields,
74
- exclude_none=True,
75
- )
76
- # override the default output from pydantic by calling `to_dict()` of app
77
- if self.app:
78
- _dict["app"] = self.app.to_dict()
79
- return _dict
80
-
81
- @classmethod
82
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
- """Create an instance of LogCreateRequestInnerFly from a dict"""
84
- if obj is None:
85
- return None
86
-
87
- if not isinstance(obj, dict):
88
- return cls.model_validate(obj)
89
-
90
- _obj = cls.model_validate(
91
- {
92
- "app": (
93
- LogCreateRequestInnerFlyApp.from_dict(obj["app"])
94
- if obj.get("app") is not None
95
- else None
96
- ),
97
- "region": obj.get("region"),
98
- }
99
- )
100
- return _obj
@@ -1,86 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Hatchet API
5
-
6
- The Hatchet API
7
-
8
- The version of the OpenAPI document: 1.0.0
9
- Generated by OpenAPI Generator (https://openapi-generator.tech)
10
-
11
- Do not edit the class manually.
12
- """ # noqa: E501
13
-
14
-
15
- from __future__ import annotations
16
-
17
- import json
18
- import pprint
19
- import re # noqa: F401
20
- from typing import Any, ClassVar, Dict, List, Optional, Set
21
-
22
- from pydantic import BaseModel, ConfigDict, StrictStr
23
- from typing_extensions import Self
24
-
25
-
26
- class LogCreateRequestInnerFlyApp(BaseModel):
27
- """
28
- LogCreateRequestInnerFlyApp
29
- """ # noqa: E501
30
-
31
- instance: Optional[StrictStr] = None
32
- name: Optional[StrictStr] = None
33
- __properties: ClassVar[List[str]] = ["instance", "name"]
34
-
35
- model_config = ConfigDict(
36
- populate_by_name=True,
37
- validate_assignment=True,
38
- protected_namespaces=(),
39
- )
40
-
41
- def to_str(self) -> str:
42
- """Returns the string representation of the model using alias"""
43
- return pprint.pformat(self.model_dump(by_alias=True))
44
-
45
- def to_json(self) -> str:
46
- """Returns the JSON representation of the model using alias"""
47
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
- return json.dumps(self.to_dict())
49
-
50
- @classmethod
51
- def from_json(cls, json_str: str) -> Optional[Self]:
52
- """Create an instance of LogCreateRequestInnerFlyApp from a JSON string"""
53
- return cls.from_dict(json.loads(json_str))
54
-
55
- def to_dict(self) -> Dict[str, Any]:
56
- """Return the dictionary representation of the model using alias.
57
-
58
- This has the following differences from calling pydantic's
59
- `self.model_dump(by_alias=True)`:
60
-
61
- * `None` is only added to the output dict for nullable fields that
62
- were set at model initialization. Other fields with value `None`
63
- are ignored.
64
- """
65
- excluded_fields: Set[str] = set([])
66
-
67
- _dict = self.model_dump(
68
- by_alias=True,
69
- exclude=excluded_fields,
70
- exclude_none=True,
71
- )
72
- return _dict
73
-
74
- @classmethod
75
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
- """Create an instance of LogCreateRequestInnerFlyApp from a dict"""
77
- if obj is None:
78
- return None
79
-
80
- if not isinstance(obj, dict):
81
- return cls.model_validate(obj)
82
-
83
- _obj = cls.model_validate(
84
- {"instance": obj.get("instance"), "name": obj.get("name")}
85
- )
86
- return _obj