thrustlab 0.1.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.
Files changed (119) hide show
  1. thrustlab/__init__.py +23 -0
  2. thrustlab/_async_polling.py +47 -0
  3. thrustlab/_http.py +166 -0
  4. thrustlab/_models/__init__.py +211 -0
  5. thrustlab/_models/api_key.py +184 -0
  6. thrustlab/_models/api_key_create.py +74 -0
  7. thrustlab/_models/api_key_with_secret.py +192 -0
  8. thrustlab/_models/billing_portal_session_resource.py +74 -0
  9. thrustlab/_models/checkout_session_resource.py +94 -0
  10. thrustlab/_models/component_brand.py +80 -0
  11. thrustlab/_models/component_brands_response.py +108 -0
  12. thrustlab/_models/component_create_body.py +83 -0
  13. thrustlab/_models/component_create_body_spec_json.py +46 -0
  14. thrustlab/_models/component_list_response.py +108 -0
  15. thrustlab/_models/component_patch.py +111 -0
  16. thrustlab/_models/component_patch_spec_json_type_0.py +46 -0
  17. thrustlab/_models/component_resource.py +188 -0
  18. thrustlab/_models/component_resource_spec_json.py +46 -0
  19. thrustlab/_models/create_webhook_endpoint_v1_webhook_endpoints_post_response_create_webhook_endpoint_v1_webhook_endpoints_post.py +50 -0
  20. thrustlab/_models/credit_balance_resource.py +135 -0
  21. thrustlab/_models/credit_bucket_breakdown.py +92 -0
  22. thrustlab/_models/credit_bucket_breakdown_type.py +9 -0
  23. thrustlab/_models/credit_usage_event_resource.py +154 -0
  24. thrustlab/_models/credit_usage_event_resource_credit_type.py +9 -0
  25. thrustlab/_models/credit_usage_event_resource_type.py +16 -0
  26. thrustlab/_models/credit_usage_list_response.py +116 -0
  27. thrustlab/_models/credit_usage_related_resource.py +71 -0
  28. thrustlab/_models/credit_usage_related_resource_object.py +9 -0
  29. thrustlab/_models/fire_test_event_v1_webhook_endpoints_public_id_test_post_response_fire_test_event_v1_webhook_endpoints_public_id_test_post.py +48 -0
  30. thrustlab/_models/get_delivery_v1_webhook_endpoints_public_id_deliveries_delivery_public_id_get_response_get_delivery_v1_webhook_endpoints_public_id_deliveries_delivery_public_id_get.py +49 -0
  31. thrustlab/_models/get_event_v1_events_event_id_get_response_get_event_v1_events_event_id_get.py +46 -0
  32. thrustlab/_models/get_webhook_endpoint_v1_webhook_endpoints_public_id_get_response_get_webhook_endpoint_v1_webhook_endpoints_public_id_get.py +48 -0
  33. thrustlab/_models/http_validation_error.py +79 -0
  34. thrustlab/_models/list_deliveries_v1_webhook_endpoints_public_id_deliveries_get_response_list_deliveries_v1_webhook_endpoints_public_id_deliveries_get.py +49 -0
  35. thrustlab/_models/list_events_v1_events_get_response_list_events_v1_events_get.py +46 -0
  36. thrustlab/_models/list_response_api_key.py +116 -0
  37. thrustlab/_models/list_webhook_endpoints_v1_webhook_endpoints_get_response_list_webhook_endpoints_v1_webhook_endpoints_get.py +46 -0
  38. thrustlab/_models/patch_webhook_endpoint_v1_webhook_endpoints_public_id_patch_response_patch_webhook_endpoint_v1_webhook_endpoints_public_id_patch.py +49 -0
  39. thrustlab/_models/portal_session_in.py +42 -0
  40. thrustlab/_models/project_create_body.py +103 -0
  41. thrustlab/_models/project_list_response.py +108 -0
  42. thrustlab/_models/project_patch.py +113 -0
  43. thrustlab/_models/project_resource.py +127 -0
  44. thrustlab/_models/retry_delivery_v1_webhook_endpoints_public_id_deliveries_delivery_public_id_retry_post_response_retry_delivery_v1_webhook_endpoints_public_id_deliveries_delivery_public_id_retry_post.py +49 -0
  45. thrustlab/_models/rotate_webhook_secret_v1_webhook_endpoints_public_id_rotate_secret_post_response_rotate_webhook_secret_v1_webhook_endpoints_public_id_rotate_secret_post.py +49 -0
  46. thrustlab/_models/rotor_group_in.py +107 -0
  47. thrustlab/_models/rotor_group_resource.py +97 -0
  48. thrustlab/_models/simulation_cancel_body.py +24 -0
  49. thrustlab/_models/simulation_create_body.py +128 -0
  50. thrustlab/_models/simulation_inputs.py +66 -0
  51. thrustlab/_models/simulation_list_response.py +88 -0
  52. thrustlab/_models/simulation_patch.py +121 -0
  53. thrustlab/_models/simulation_patch_plot_config_json_type_0_item.py +46 -0
  54. thrustlab/_models/simulation_resource.py +283 -0
  55. thrustlab/_models/simulation_resource_error_type_0.py +46 -0
  56. thrustlab/_models/simulation_resource_plot_config_json_type_0_item.py +46 -0
  57. thrustlab/_models/simulation_resource_result_type_0.py +46 -0
  58. thrustlab/_models/starred_component_create_body.py +80 -0
  59. thrustlab/_models/starred_component_list_response.py +108 -0
  60. thrustlab/_models/starred_component_resource.py +106 -0
  61. thrustlab/_models/submission_create_body.py +121 -0
  62. thrustlab/_models/submission_create_body_data_json.py +46 -0
  63. thrustlab/_models/submission_list_response.py +108 -0
  64. thrustlab/_models/submission_patch.py +174 -0
  65. thrustlab/_models/submission_patch_data_json_type_0.py +46 -0
  66. thrustlab/_models/submission_resource.py +197 -0
  67. thrustlab/_models/submission_resource_data_json.py +46 -0
  68. thrustlab/_models/subscription_create.py +58 -0
  69. thrustlab/_models/subscription_resource.py +168 -0
  70. thrustlab/_models/subscription_resource_status.py +12 -0
  71. thrustlab/_models/subscription_resource_tier.py +12 -0
  72. thrustlab/_models/sweep_cancel_body.py +42 -0
  73. thrustlab/_models/sweep_config_in.py +172 -0
  74. thrustlab/_models/sweep_create_body.py +138 -0
  75. thrustlab/_models/sweep_inputs.py +66 -0
  76. thrustlab/_models/sweep_list_response.py +88 -0
  77. thrustlab/_models/sweep_param_range_in.py +136 -0
  78. thrustlab/_models/sweep_param_range_in_mode.py +9 -0
  79. thrustlab/_models/sweep_patch.py +121 -0
  80. thrustlab/_models/sweep_patch_plot_config_json_type_0_item.py +46 -0
  81. thrustlab/_models/sweep_point_list_response.py +88 -0
  82. thrustlab/_models/sweep_point_resource.py +103 -0
  83. thrustlab/_models/sweep_point_resource_inputs.py +46 -0
  84. thrustlab/_models/sweep_point_resource_rotors_type_0.py +46 -0
  85. thrustlab/_models/sweep_resource.py +327 -0
  86. thrustlab/_models/sweep_resource_error_type_0.py +46 -0
  87. thrustlab/_models/sweep_resource_plot_config_json_type_0_item.py +46 -0
  88. thrustlab/_models/sweep_resource_summary_type_0.py +46 -0
  89. thrustlab/_models/sweep_resource_sweep_config_type_0.py +46 -0
  90. thrustlab/_models/sweep_rotor_group_in.py +95 -0
  91. thrustlab/_models/types.py +55 -0
  92. thrustlab/_models/user_patch.py +73 -0
  93. thrustlab/_models/user_resource.py +170 -0
  94. thrustlab/_models/v1_health_v1_health_get_response_v1_health_v1_health_get.py +46 -0
  95. thrustlab/_models/validation_error.py +90 -0
  96. thrustlab/_models/webhook_endpoint_create.py +91 -0
  97. thrustlab/_models/webhook_endpoint_patch.py +144 -0
  98. thrustlab/_pagination.py +109 -0
  99. thrustlab/_version.py +3 -0
  100. thrustlab/client.py +100 -0
  101. thrustlab/exceptions.py +121 -0
  102. thrustlab/resources/__init__.py +1 -0
  103. thrustlab/resources/_base.py +12 -0
  104. thrustlab/resources/api_keys.py +43 -0
  105. thrustlab/resources/components.py +60 -0
  106. thrustlab/resources/credits.py +40 -0
  107. thrustlab/resources/projects.py +54 -0
  108. thrustlab/resources/simulations.py +74 -0
  109. thrustlab/resources/starred_components.py +57 -0
  110. thrustlab/resources/submissions.py +44 -0
  111. thrustlab/resources/subscriptions.py +42 -0
  112. thrustlab/resources/sweeps.py +96 -0
  113. thrustlab/resources/users.py +13 -0
  114. thrustlab/resources/webhook_endpoints.py +138 -0
  115. thrustlab/webhooks.py +121 -0
  116. thrustlab-0.1.0.dist-info/METADATA +190 -0
  117. thrustlab-0.1.0.dist-info/RECORD +119 -0
  118. thrustlab-0.1.0.dist-info/WHEEL +4 -0
  119. thrustlab-0.1.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,46 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import Any, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ T = TypeVar("T", bound="ComponentCreateBodySpecJson")
10
+
11
+
12
+ @_attrs_define
13
+ class ComponentCreateBodySpecJson:
14
+ """ """
15
+
16
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
17
+
18
+ def to_dict(self) -> dict[str, Any]:
19
+ field_dict: dict[str, Any] = {}
20
+ field_dict.update(self.additional_properties)
21
+
22
+ return field_dict
23
+
24
+ @classmethod
25
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
26
+ d = dict(src_dict)
27
+ component_create_body_spec_json = cls()
28
+
29
+ component_create_body_spec_json.additional_properties = d
30
+ return component_create_body_spec_json
31
+
32
+ @property
33
+ def additional_keys(self) -> list[str]:
34
+ return list(self.additional_properties.keys())
35
+
36
+ def __getitem__(self, key: str) -> Any:
37
+ return self.additional_properties[key]
38
+
39
+ def __setitem__(self, key: str, value: Any) -> None:
40
+ self.additional_properties[key] = value
41
+
42
+ def __delitem__(self, key: str) -> None:
43
+ del self.additional_properties[key]
44
+
45
+ def __contains__(self, key: str) -> bool:
46
+ return key in self.additional_properties
@@ -0,0 +1,108 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import TYPE_CHECKING, Any, TypeVar, cast
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ from thrustlab._models.types import UNSET, Unset
10
+
11
+ if TYPE_CHECKING:
12
+ from thrustlab._models.component_resource import ComponentResource
13
+
14
+
15
+ T = TypeVar("T", bound="ComponentListResponse")
16
+
17
+
18
+ @_attrs_define
19
+ class ComponentListResponse:
20
+ """
21
+ Attributes:
22
+ data (list[ComponentResource]):
23
+ has_more (bool):
24
+ next_cursor (None | str):
25
+ object_ (str | Unset): Default: 'list'.
26
+ """
27
+
28
+ data: list[ComponentResource]
29
+ has_more: bool
30
+ next_cursor: None | str
31
+ object_: str | Unset = "list"
32
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
33
+
34
+ def to_dict(self) -> dict[str, Any]:
35
+ data = []
36
+ for data_item_data in self.data:
37
+ data_item = data_item_data.to_dict()
38
+ data.append(data_item)
39
+
40
+ has_more = self.has_more
41
+
42
+ next_cursor: None | str
43
+ next_cursor = self.next_cursor
44
+
45
+ object_ = self.object_
46
+
47
+ field_dict: dict[str, Any] = {}
48
+ field_dict.update(self.additional_properties)
49
+ field_dict.update(
50
+ {
51
+ "data": data,
52
+ "has_more": has_more,
53
+ "next_cursor": next_cursor,
54
+ }
55
+ )
56
+ if object_ is not UNSET:
57
+ field_dict["object"] = object_
58
+
59
+ return field_dict
60
+
61
+ @classmethod
62
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
63
+ from thrustlab._models.component_resource import ComponentResource
64
+
65
+ d = dict(src_dict)
66
+ data = []
67
+ _data = d.pop("data")
68
+ for data_item_data in _data:
69
+ data_item = ComponentResource.from_dict(data_item_data)
70
+
71
+ data.append(data_item)
72
+
73
+ has_more = d.pop("has_more")
74
+
75
+ def _parse_next_cursor(data: object) -> None | str:
76
+ if data is None:
77
+ return data
78
+ return cast(None | str, data)
79
+
80
+ next_cursor = _parse_next_cursor(d.pop("next_cursor"))
81
+
82
+ object_ = d.pop("object", UNSET)
83
+
84
+ component_list_response = cls(
85
+ data=data,
86
+ has_more=has_more,
87
+ next_cursor=next_cursor,
88
+ object_=object_,
89
+ )
90
+
91
+ component_list_response.additional_properties = d
92
+ return component_list_response
93
+
94
+ @property
95
+ def additional_keys(self) -> list[str]:
96
+ return list(self.additional_properties.keys())
97
+
98
+ def __getitem__(self, key: str) -> Any:
99
+ return self.additional_properties[key]
100
+
101
+ def __setitem__(self, key: str, value: Any) -> None:
102
+ self.additional_properties[key] = value
103
+
104
+ def __delitem__(self, key: str) -> None:
105
+ del self.additional_properties[key]
106
+
107
+ def __contains__(self, key: str) -> bool:
108
+ return key in self.additional_properties
@@ -0,0 +1,111 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import TYPE_CHECKING, Any, TypeVar, cast
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ from thrustlab._models.types import UNSET, Unset
10
+
11
+ if TYPE_CHECKING:
12
+ from thrustlab._models.component_patch_spec_json_type_0 import ComponentPatchSpecJsonType0
13
+
14
+
15
+ T = TypeVar("T", bound="ComponentPatch")
16
+
17
+
18
+ @_attrs_define
19
+ class ComponentPatch:
20
+ """
21
+ Attributes:
22
+ name (None | str | Unset):
23
+ spec_json (ComponentPatchSpecJsonType0 | None | Unset):
24
+ """
25
+
26
+ name: None | str | Unset = UNSET
27
+ spec_json: ComponentPatchSpecJsonType0 | None | Unset = UNSET
28
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
29
+
30
+ def to_dict(self) -> dict[str, Any]:
31
+ from thrustlab._models.component_patch_spec_json_type_0 import ComponentPatchSpecJsonType0
32
+
33
+ name: None | str | Unset
34
+ if isinstance(self.name, Unset):
35
+ name = UNSET
36
+ else:
37
+ name = self.name
38
+
39
+ spec_json: dict[str, Any] | None | Unset
40
+ if isinstance(self.spec_json, Unset):
41
+ spec_json = UNSET
42
+ elif isinstance(self.spec_json, ComponentPatchSpecJsonType0):
43
+ spec_json = self.spec_json.to_dict()
44
+ else:
45
+ spec_json = self.spec_json
46
+
47
+ field_dict: dict[str, Any] = {}
48
+ field_dict.update(self.additional_properties)
49
+ field_dict.update({})
50
+ if name is not UNSET:
51
+ field_dict["name"] = name
52
+ if spec_json is not UNSET:
53
+ field_dict["spec_json"] = spec_json
54
+
55
+ return field_dict
56
+
57
+ @classmethod
58
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
59
+ from thrustlab._models.component_patch_spec_json_type_0 import ComponentPatchSpecJsonType0
60
+
61
+ d = dict(src_dict)
62
+
63
+ def _parse_name(data: object) -> None | str | Unset:
64
+ if data is None:
65
+ return data
66
+ if isinstance(data, Unset):
67
+ return data
68
+ return cast(None | str | Unset, data)
69
+
70
+ name = _parse_name(d.pop("name", UNSET))
71
+
72
+ def _parse_spec_json(data: object) -> ComponentPatchSpecJsonType0 | None | Unset:
73
+ if data is None:
74
+ return data
75
+ if isinstance(data, Unset):
76
+ return data
77
+ try:
78
+ if not isinstance(data, dict):
79
+ raise TypeError()
80
+ spec_json_type_0 = ComponentPatchSpecJsonType0.from_dict(data)
81
+
82
+ return spec_json_type_0
83
+ except (TypeError, ValueError, AttributeError, KeyError):
84
+ pass
85
+ return cast(ComponentPatchSpecJsonType0 | None | Unset, data)
86
+
87
+ spec_json = _parse_spec_json(d.pop("spec_json", UNSET))
88
+
89
+ component_patch = cls(
90
+ name=name,
91
+ spec_json=spec_json,
92
+ )
93
+
94
+ component_patch.additional_properties = d
95
+ return component_patch
96
+
97
+ @property
98
+ def additional_keys(self) -> list[str]:
99
+ return list(self.additional_properties.keys())
100
+
101
+ def __getitem__(self, key: str) -> Any:
102
+ return self.additional_properties[key]
103
+
104
+ def __setitem__(self, key: str, value: Any) -> None:
105
+ self.additional_properties[key] = value
106
+
107
+ def __delitem__(self, key: str) -> None:
108
+ del self.additional_properties[key]
109
+
110
+ def __contains__(self, key: str) -> bool:
111
+ return key in self.additional_properties
@@ -0,0 +1,46 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import Any, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ T = TypeVar("T", bound="ComponentPatchSpecJsonType0")
10
+
11
+
12
+ @_attrs_define
13
+ class ComponentPatchSpecJsonType0:
14
+ """ """
15
+
16
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
17
+
18
+ def to_dict(self) -> dict[str, Any]:
19
+ field_dict: dict[str, Any] = {}
20
+ field_dict.update(self.additional_properties)
21
+
22
+ return field_dict
23
+
24
+ @classmethod
25
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
26
+ d = dict(src_dict)
27
+ component_patch_spec_json_type_0 = cls()
28
+
29
+ component_patch_spec_json_type_0.additional_properties = d
30
+ return component_patch_spec_json_type_0
31
+
32
+ @property
33
+ def additional_keys(self) -> list[str]:
34
+ return list(self.additional_properties.keys())
35
+
36
+ def __getitem__(self, key: str) -> Any:
37
+ return self.additional_properties[key]
38
+
39
+ def __setitem__(self, key: str, value: Any) -> None:
40
+ self.additional_properties[key] = value
41
+
42
+ def __delitem__(self, key: str) -> None:
43
+ del self.additional_properties[key]
44
+
45
+ def __contains__(self, key: str) -> bool:
46
+ return key in self.additional_properties
@@ -0,0 +1,188 @@
1
+ from __future__ import annotations
2
+
3
+ import datetime
4
+ from collections.abc import Mapping
5
+ from typing import TYPE_CHECKING, Any, TypeVar, cast
6
+ from uuid import UUID
7
+
8
+ from attrs import define as _attrs_define
9
+ from attrs import field as _attrs_field
10
+ from dateutil.parser import isoparse
11
+
12
+ from thrustlab._models.types import UNSET, Unset
13
+
14
+ if TYPE_CHECKING:
15
+ from thrustlab._models.component_resource_spec_json import ComponentResourceSpecJson
16
+
17
+
18
+ T = TypeVar("T", bound="ComponentResource")
19
+
20
+
21
+ @_attrs_define
22
+ class ComponentResource:
23
+ """
24
+ Attributes:
25
+ base_component_id (None | UUID):
26
+ created_at (datetime.datetime):
27
+ id (str):
28
+ name (str):
29
+ source (str):
30
+ spec_json (ComponentResourceSpecJson):
31
+ type_ (str):
32
+ updated_at (datetime.datetime):
33
+ user_id (None | UUID):
34
+ visibility (str):
35
+ object_ (str | Unset): Default: 'component'.
36
+ """
37
+
38
+ base_component_id: None | UUID
39
+ created_at: datetime.datetime
40
+ id: str
41
+ name: str
42
+ source: str
43
+ spec_json: ComponentResourceSpecJson
44
+ type_: str
45
+ updated_at: datetime.datetime
46
+ user_id: None | UUID
47
+ visibility: str
48
+ object_: str | Unset = "component"
49
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
50
+
51
+ def to_dict(self) -> dict[str, Any]:
52
+ base_component_id: None | str
53
+ if isinstance(self.base_component_id, UUID):
54
+ base_component_id = str(self.base_component_id)
55
+ else:
56
+ base_component_id = self.base_component_id
57
+
58
+ created_at = self.created_at.isoformat()
59
+
60
+ id = self.id
61
+
62
+ name = self.name
63
+
64
+ source = self.source
65
+
66
+ spec_json = self.spec_json.to_dict()
67
+
68
+ type_ = self.type_
69
+
70
+ updated_at = self.updated_at.isoformat()
71
+
72
+ user_id: None | str
73
+ if isinstance(self.user_id, UUID):
74
+ user_id = str(self.user_id)
75
+ else:
76
+ user_id = self.user_id
77
+
78
+ visibility = self.visibility
79
+
80
+ object_ = self.object_
81
+
82
+ field_dict: dict[str, Any] = {}
83
+ field_dict.update(self.additional_properties)
84
+ field_dict.update(
85
+ {
86
+ "base_component_id": base_component_id,
87
+ "created_at": created_at,
88
+ "id": id,
89
+ "name": name,
90
+ "source": source,
91
+ "spec_json": spec_json,
92
+ "type": type_,
93
+ "updated_at": updated_at,
94
+ "user_id": user_id,
95
+ "visibility": visibility,
96
+ }
97
+ )
98
+ if object_ is not UNSET:
99
+ field_dict["object"] = object_
100
+
101
+ return field_dict
102
+
103
+ @classmethod
104
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
105
+ from thrustlab._models.component_resource_spec_json import ComponentResourceSpecJson
106
+
107
+ d = dict(src_dict)
108
+
109
+ def _parse_base_component_id(data: object) -> None | UUID:
110
+ if data is None:
111
+ return data
112
+ try:
113
+ if not isinstance(data, str):
114
+ raise TypeError()
115
+ base_component_id_type_0 = UUID(data)
116
+
117
+ return base_component_id_type_0
118
+ except (TypeError, ValueError, AttributeError, KeyError):
119
+ pass
120
+ return cast(None | UUID, data)
121
+
122
+ base_component_id = _parse_base_component_id(d.pop("base_component_id"))
123
+
124
+ created_at = isoparse(d.pop("created_at"))
125
+
126
+ id = d.pop("id")
127
+
128
+ name = d.pop("name")
129
+
130
+ source = d.pop("source")
131
+
132
+ spec_json = ComponentResourceSpecJson.from_dict(d.pop("spec_json"))
133
+
134
+ type_ = d.pop("type")
135
+
136
+ updated_at = isoparse(d.pop("updated_at"))
137
+
138
+ def _parse_user_id(data: object) -> None | UUID:
139
+ if data is None:
140
+ return data
141
+ try:
142
+ if not isinstance(data, str):
143
+ raise TypeError()
144
+ user_id_type_0 = UUID(data)
145
+
146
+ return user_id_type_0
147
+ except (TypeError, ValueError, AttributeError, KeyError):
148
+ pass
149
+ return cast(None | UUID, data)
150
+
151
+ user_id = _parse_user_id(d.pop("user_id"))
152
+
153
+ visibility = d.pop("visibility")
154
+
155
+ object_ = d.pop("object", UNSET)
156
+
157
+ component_resource = cls(
158
+ base_component_id=base_component_id,
159
+ created_at=created_at,
160
+ id=id,
161
+ name=name,
162
+ source=source,
163
+ spec_json=spec_json,
164
+ type_=type_,
165
+ updated_at=updated_at,
166
+ user_id=user_id,
167
+ visibility=visibility,
168
+ object_=object_,
169
+ )
170
+
171
+ component_resource.additional_properties = d
172
+ return component_resource
173
+
174
+ @property
175
+ def additional_keys(self) -> list[str]:
176
+ return list(self.additional_properties.keys())
177
+
178
+ def __getitem__(self, key: str) -> Any:
179
+ return self.additional_properties[key]
180
+
181
+ def __setitem__(self, key: str, value: Any) -> None:
182
+ self.additional_properties[key] = value
183
+
184
+ def __delitem__(self, key: str) -> None:
185
+ del self.additional_properties[key]
186
+
187
+ def __contains__(self, key: str) -> bool:
188
+ return key in self.additional_properties
@@ -0,0 +1,46 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import Any, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ T = TypeVar("T", bound="ComponentResourceSpecJson")
10
+
11
+
12
+ @_attrs_define
13
+ class ComponentResourceSpecJson:
14
+ """ """
15
+
16
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
17
+
18
+ def to_dict(self) -> dict[str, Any]:
19
+ field_dict: dict[str, Any] = {}
20
+ field_dict.update(self.additional_properties)
21
+
22
+ return field_dict
23
+
24
+ @classmethod
25
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
26
+ d = dict(src_dict)
27
+ component_resource_spec_json = cls()
28
+
29
+ component_resource_spec_json.additional_properties = d
30
+ return component_resource_spec_json
31
+
32
+ @property
33
+ def additional_keys(self) -> list[str]:
34
+ return list(self.additional_properties.keys())
35
+
36
+ def __getitem__(self, key: str) -> Any:
37
+ return self.additional_properties[key]
38
+
39
+ def __setitem__(self, key: str, value: Any) -> None:
40
+ self.additional_properties[key] = value
41
+
42
+ def __delitem__(self, key: str) -> None:
43
+ del self.additional_properties[key]
44
+
45
+ def __contains__(self, key: str) -> bool:
46
+ return key in self.additional_properties
@@ -0,0 +1,50 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import Any, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ T = TypeVar("T", bound="CreateWebhookEndpointV1WebhookEndpointsPostResponseCreateWebhookEndpointV1WebhookEndpointsPost")
10
+
11
+
12
+ @_attrs_define
13
+ class CreateWebhookEndpointV1WebhookEndpointsPostResponseCreateWebhookEndpointV1WebhookEndpointsPost:
14
+ """ """
15
+
16
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
17
+
18
+ def to_dict(self) -> dict[str, Any]:
19
+ field_dict: dict[str, Any] = {}
20
+ field_dict.update(self.additional_properties)
21
+
22
+ return field_dict
23
+
24
+ @classmethod
25
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
26
+ d = dict(src_dict)
27
+ create_webhook_endpoint_v1_webhook_endpoints_post_response_create_webhook_endpoint_v1_webhook_endpoints_post = (
28
+ cls()
29
+ )
30
+
31
+ create_webhook_endpoint_v1_webhook_endpoints_post_response_create_webhook_endpoint_v1_webhook_endpoints_post.additional_properties = d
32
+ return (
33
+ create_webhook_endpoint_v1_webhook_endpoints_post_response_create_webhook_endpoint_v1_webhook_endpoints_post
34
+ )
35
+
36
+ @property
37
+ def additional_keys(self) -> list[str]:
38
+ return list(self.additional_properties.keys())
39
+
40
+ def __getitem__(self, key: str) -> Any:
41
+ return self.additional_properties[key]
42
+
43
+ def __setitem__(self, key: str, value: Any) -> None:
44
+ self.additional_properties[key] = value
45
+
46
+ def __delitem__(self, key: str) -> None:
47
+ del self.additional_properties[key]
48
+
49
+ def __contains__(self, key: str) -> bool:
50
+ return key in self.additional_properties