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,327 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast
5
+
6
+ from attrs import define as _attrs_define
7
+
8
+ if TYPE_CHECKING:
9
+ from thrustlab._models.rotor_group_resource import RotorGroupResource
10
+ from thrustlab._models.sweep_inputs import SweepInputs
11
+ from thrustlab._models.sweep_resource_error_type_0 import SweepResourceErrorType0
12
+ from thrustlab._models.sweep_resource_plot_config_json_type_0_item import SweepResourcePlotConfigJsonType0Item
13
+ from thrustlab._models.sweep_resource_summary_type_0 import SweepResourceSummaryType0
14
+ from thrustlab._models.sweep_resource_sweep_config_type_0 import SweepResourceSweepConfigType0
15
+
16
+
17
+ T = TypeVar("T", bound="SweepResource")
18
+
19
+
20
+ @_attrs_define
21
+ class SweepResource:
22
+ """
23
+ Attributes:
24
+ analysis_type (str):
25
+ battery_component_id (str):
26
+ completed_at (None | str):
27
+ completed_points (int):
28
+ created_at (None | str):
29
+ credits_cost (int):
30
+ error (None | SweepResourceErrorType0):
31
+ id (str):
32
+ inputs (SweepInputs):
33
+ is_starred (bool):
34
+ name (None | str):
35
+ object_ (Literal['sweep']):
36
+ plot_config_json (list[SweepResourcePlotConfigJsonType0Item] | None):
37
+ progress (float | None):
38
+ project_id (str):
39
+ rotor_groups (list[RotorGroupResource]):
40
+ status (str):
41
+ summary (None | SweepResourceSummaryType0):
42
+ sweep_config (None | SweepResourceSweepConfigType0):
43
+ total_points (int):
44
+ """
45
+
46
+ analysis_type: str
47
+ battery_component_id: str
48
+ completed_at: None | str
49
+ completed_points: int
50
+ created_at: None | str
51
+ credits_cost: int
52
+ error: None | SweepResourceErrorType0
53
+ id: str
54
+ inputs: SweepInputs
55
+ is_starred: bool
56
+ name: None | str
57
+ object_: Literal["sweep"]
58
+ plot_config_json: list[SweepResourcePlotConfigJsonType0Item] | None
59
+ progress: float | None
60
+ project_id: str
61
+ rotor_groups: list[RotorGroupResource]
62
+ status: str
63
+ summary: None | SweepResourceSummaryType0
64
+ sweep_config: None | SweepResourceSweepConfigType0
65
+ total_points: int
66
+
67
+ def to_dict(self) -> dict[str, Any]:
68
+ from thrustlab._models.sweep_resource_error_type_0 import SweepResourceErrorType0
69
+ from thrustlab._models.sweep_resource_summary_type_0 import SweepResourceSummaryType0
70
+ from thrustlab._models.sweep_resource_sweep_config_type_0 import SweepResourceSweepConfigType0
71
+
72
+ analysis_type = self.analysis_type
73
+
74
+ battery_component_id = self.battery_component_id
75
+
76
+ completed_at: None | str
77
+ completed_at = self.completed_at
78
+
79
+ completed_points = self.completed_points
80
+
81
+ created_at: None | str
82
+ created_at = self.created_at
83
+
84
+ credits_cost = self.credits_cost
85
+
86
+ error: dict[str, Any] | None
87
+ if isinstance(self.error, SweepResourceErrorType0):
88
+ error = self.error.to_dict()
89
+ else:
90
+ error = self.error
91
+
92
+ id = self.id
93
+
94
+ inputs = self.inputs.to_dict()
95
+
96
+ is_starred = self.is_starred
97
+
98
+ name: None | str
99
+ name = self.name
100
+
101
+ object_ = self.object_
102
+
103
+ plot_config_json: list[dict[str, Any]] | None
104
+ if isinstance(self.plot_config_json, list):
105
+ plot_config_json = []
106
+ for plot_config_json_type_0_item_data in self.plot_config_json:
107
+ plot_config_json_type_0_item = plot_config_json_type_0_item_data.to_dict()
108
+ plot_config_json.append(plot_config_json_type_0_item)
109
+
110
+ else:
111
+ plot_config_json = self.plot_config_json
112
+
113
+ progress: float | None
114
+ progress = self.progress
115
+
116
+ project_id = self.project_id
117
+
118
+ rotor_groups = []
119
+ for rotor_groups_item_data in self.rotor_groups:
120
+ rotor_groups_item = rotor_groups_item_data.to_dict()
121
+ rotor_groups.append(rotor_groups_item)
122
+
123
+ status = self.status
124
+
125
+ summary: dict[str, Any] | None
126
+ if isinstance(self.summary, SweepResourceSummaryType0):
127
+ summary = self.summary.to_dict()
128
+ else:
129
+ summary = self.summary
130
+
131
+ sweep_config: dict[str, Any] | None
132
+ if isinstance(self.sweep_config, SweepResourceSweepConfigType0):
133
+ sweep_config = self.sweep_config.to_dict()
134
+ else:
135
+ sweep_config = self.sweep_config
136
+
137
+ total_points = self.total_points
138
+
139
+ field_dict: dict[str, Any] = {}
140
+
141
+ field_dict.update(
142
+ {
143
+ "analysis_type": analysis_type,
144
+ "battery_component_id": battery_component_id,
145
+ "completed_at": completed_at,
146
+ "completed_points": completed_points,
147
+ "created_at": created_at,
148
+ "credits_cost": credits_cost,
149
+ "error": error,
150
+ "id": id,
151
+ "inputs": inputs,
152
+ "is_starred": is_starred,
153
+ "name": name,
154
+ "object": object_,
155
+ "plot_config_json": plot_config_json,
156
+ "progress": progress,
157
+ "project_id": project_id,
158
+ "rotor_groups": rotor_groups,
159
+ "status": status,
160
+ "summary": summary,
161
+ "sweep_config": sweep_config,
162
+ "total_points": total_points,
163
+ }
164
+ )
165
+
166
+ return field_dict
167
+
168
+ @classmethod
169
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
170
+ from thrustlab._models.rotor_group_resource import RotorGroupResource
171
+ from thrustlab._models.sweep_inputs import SweepInputs
172
+ from thrustlab._models.sweep_resource_error_type_0 import SweepResourceErrorType0
173
+ from thrustlab._models.sweep_resource_plot_config_json_type_0_item import SweepResourcePlotConfigJsonType0Item
174
+ from thrustlab._models.sweep_resource_summary_type_0 import SweepResourceSummaryType0
175
+ from thrustlab._models.sweep_resource_sweep_config_type_0 import SweepResourceSweepConfigType0
176
+
177
+ d = dict(src_dict)
178
+ analysis_type = d.pop("analysis_type")
179
+
180
+ battery_component_id = d.pop("battery_component_id")
181
+
182
+ def _parse_completed_at(data: object) -> None | str:
183
+ if data is None:
184
+ return data
185
+ return cast(None | str, data)
186
+
187
+ completed_at = _parse_completed_at(d.pop("completed_at"))
188
+
189
+ completed_points = d.pop("completed_points")
190
+
191
+ def _parse_created_at(data: object) -> None | str:
192
+ if data is None:
193
+ return data
194
+ return cast(None | str, data)
195
+
196
+ created_at = _parse_created_at(d.pop("created_at"))
197
+
198
+ credits_cost = d.pop("credits_cost")
199
+
200
+ def _parse_error(data: object) -> None | SweepResourceErrorType0:
201
+ if data is None:
202
+ return data
203
+ try:
204
+ if not isinstance(data, dict):
205
+ raise TypeError()
206
+ error_type_0 = SweepResourceErrorType0.from_dict(data)
207
+
208
+ return error_type_0
209
+ except (TypeError, ValueError, AttributeError, KeyError):
210
+ pass
211
+ return cast(None | SweepResourceErrorType0, data)
212
+
213
+ error = _parse_error(d.pop("error"))
214
+
215
+ id = d.pop("id")
216
+
217
+ inputs = SweepInputs.from_dict(d.pop("inputs"))
218
+
219
+ is_starred = d.pop("is_starred")
220
+
221
+ def _parse_name(data: object) -> None | str:
222
+ if data is None:
223
+ return data
224
+ return cast(None | str, data)
225
+
226
+ name = _parse_name(d.pop("name"))
227
+
228
+ object_ = cast(Literal["sweep"], d.pop("object"))
229
+ if object_ != "sweep":
230
+ raise ValueError(f"object must match const 'sweep', got '{object_}'")
231
+
232
+ def _parse_plot_config_json(data: object) -> list[SweepResourcePlotConfigJsonType0Item] | None:
233
+ if data is None:
234
+ return data
235
+ try:
236
+ if not isinstance(data, list):
237
+ raise TypeError()
238
+ plot_config_json_type_0 = []
239
+ _plot_config_json_type_0 = data
240
+ for plot_config_json_type_0_item_data in _plot_config_json_type_0:
241
+ plot_config_json_type_0_item = SweepResourcePlotConfigJsonType0Item.from_dict(
242
+ plot_config_json_type_0_item_data
243
+ )
244
+
245
+ plot_config_json_type_0.append(plot_config_json_type_0_item)
246
+
247
+ return plot_config_json_type_0
248
+ except (TypeError, ValueError, AttributeError, KeyError):
249
+ pass
250
+ return cast(list[SweepResourcePlotConfigJsonType0Item] | None, data)
251
+
252
+ plot_config_json = _parse_plot_config_json(d.pop("plot_config_json"))
253
+
254
+ def _parse_progress(data: object) -> float | None:
255
+ if data is None:
256
+ return data
257
+ return cast(float | None, data)
258
+
259
+ progress = _parse_progress(d.pop("progress"))
260
+
261
+ project_id = d.pop("project_id")
262
+
263
+ rotor_groups = []
264
+ _rotor_groups = d.pop("rotor_groups")
265
+ for rotor_groups_item_data in _rotor_groups:
266
+ rotor_groups_item = RotorGroupResource.from_dict(rotor_groups_item_data)
267
+
268
+ rotor_groups.append(rotor_groups_item)
269
+
270
+ status = d.pop("status")
271
+
272
+ def _parse_summary(data: object) -> None | SweepResourceSummaryType0:
273
+ if data is None:
274
+ return data
275
+ try:
276
+ if not isinstance(data, dict):
277
+ raise TypeError()
278
+ summary_type_0 = SweepResourceSummaryType0.from_dict(data)
279
+
280
+ return summary_type_0
281
+ except (TypeError, ValueError, AttributeError, KeyError):
282
+ pass
283
+ return cast(None | SweepResourceSummaryType0, data)
284
+
285
+ summary = _parse_summary(d.pop("summary"))
286
+
287
+ def _parse_sweep_config(data: object) -> None | SweepResourceSweepConfigType0:
288
+ if data is None:
289
+ return data
290
+ try:
291
+ if not isinstance(data, dict):
292
+ raise TypeError()
293
+ sweep_config_type_0 = SweepResourceSweepConfigType0.from_dict(data)
294
+
295
+ return sweep_config_type_0
296
+ except (TypeError, ValueError, AttributeError, KeyError):
297
+ pass
298
+ return cast(None | SweepResourceSweepConfigType0, data)
299
+
300
+ sweep_config = _parse_sweep_config(d.pop("sweep_config"))
301
+
302
+ total_points = d.pop("total_points")
303
+
304
+ sweep_resource = cls(
305
+ analysis_type=analysis_type,
306
+ battery_component_id=battery_component_id,
307
+ completed_at=completed_at,
308
+ completed_points=completed_points,
309
+ created_at=created_at,
310
+ credits_cost=credits_cost,
311
+ error=error,
312
+ id=id,
313
+ inputs=inputs,
314
+ is_starred=is_starred,
315
+ name=name,
316
+ object_=object_,
317
+ plot_config_json=plot_config_json,
318
+ progress=progress,
319
+ project_id=project_id,
320
+ rotor_groups=rotor_groups,
321
+ status=status,
322
+ summary=summary,
323
+ sweep_config=sweep_config,
324
+ total_points=total_points,
325
+ )
326
+
327
+ return sweep_resource
@@ -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="SweepResourceErrorType0")
10
+
11
+
12
+ @_attrs_define
13
+ class SweepResourceErrorType0:
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
+ sweep_resource_error_type_0 = cls()
28
+
29
+ sweep_resource_error_type_0.additional_properties = d
30
+ return sweep_resource_error_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,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="SweepResourcePlotConfigJsonType0Item")
10
+
11
+
12
+ @_attrs_define
13
+ class SweepResourcePlotConfigJsonType0Item:
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
+ sweep_resource_plot_config_json_type_0_item = cls()
28
+
29
+ sweep_resource_plot_config_json_type_0_item.additional_properties = d
30
+ return sweep_resource_plot_config_json_type_0_item
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,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="SweepResourceSummaryType0")
10
+
11
+
12
+ @_attrs_define
13
+ class SweepResourceSummaryType0:
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
+ sweep_resource_summary_type_0 = cls()
28
+
29
+ sweep_resource_summary_type_0.additional_properties = d
30
+ return sweep_resource_summary_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,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="SweepResourceSweepConfigType0")
10
+
11
+
12
+ @_attrs_define
13
+ class SweepResourceSweepConfigType0:
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
+ sweep_resource_sweep_config_type_0 = cls()
28
+
29
+ sweep_resource_sweep_config_type_0.additional_properties = d
30
+ return sweep_resource_sweep_config_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,95 @@
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
+
8
+ from thrustlab._models.types import UNSET, Unset
9
+
10
+ T = TypeVar("T", bound="SweepRotorGroupIn")
11
+
12
+
13
+ @_attrs_define
14
+ class SweepRotorGroupIn:
15
+ """
16
+ Attributes:
17
+ label (str):
18
+ motor_component_id (str):
19
+ propeller_component_id (str):
20
+ throttle_pct (float):
21
+ count (int | Unset): Default: 1.
22
+ esc_motor_wire_resistance_mohm (float | Unset): Default: 0.0.
23
+ esc_resistance_mohm (float | Unset): Default: 0.0.
24
+ """
25
+
26
+ label: str
27
+ motor_component_id: str
28
+ propeller_component_id: str
29
+ throttle_pct: float
30
+ count: int | Unset = 1
31
+ esc_motor_wire_resistance_mohm: float | Unset = 0.0
32
+ esc_resistance_mohm: float | Unset = 0.0
33
+
34
+ def to_dict(self) -> dict[str, Any]:
35
+ label = self.label
36
+
37
+ motor_component_id = self.motor_component_id
38
+
39
+ propeller_component_id = self.propeller_component_id
40
+
41
+ throttle_pct = self.throttle_pct
42
+
43
+ count = self.count
44
+
45
+ esc_motor_wire_resistance_mohm = self.esc_motor_wire_resistance_mohm
46
+
47
+ esc_resistance_mohm = self.esc_resistance_mohm
48
+
49
+ field_dict: dict[str, Any] = {}
50
+
51
+ field_dict.update(
52
+ {
53
+ "label": label,
54
+ "motor_component_id": motor_component_id,
55
+ "propeller_component_id": propeller_component_id,
56
+ "throttle_pct": throttle_pct,
57
+ }
58
+ )
59
+ if count is not UNSET:
60
+ field_dict["count"] = count
61
+ if esc_motor_wire_resistance_mohm is not UNSET:
62
+ field_dict["esc_motor_wire_resistance_mohm"] = esc_motor_wire_resistance_mohm
63
+ if esc_resistance_mohm is not UNSET:
64
+ field_dict["esc_resistance_mohm"] = esc_resistance_mohm
65
+
66
+ return field_dict
67
+
68
+ @classmethod
69
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
70
+ d = dict(src_dict)
71
+ label = d.pop("label")
72
+
73
+ motor_component_id = d.pop("motor_component_id")
74
+
75
+ propeller_component_id = d.pop("propeller_component_id")
76
+
77
+ throttle_pct = d.pop("throttle_pct")
78
+
79
+ count = d.pop("count", UNSET)
80
+
81
+ esc_motor_wire_resistance_mohm = d.pop("esc_motor_wire_resistance_mohm", UNSET)
82
+
83
+ esc_resistance_mohm = d.pop("esc_resistance_mohm", UNSET)
84
+
85
+ sweep_rotor_group_in = cls(
86
+ label=label,
87
+ motor_component_id=motor_component_id,
88
+ propeller_component_id=propeller_component_id,
89
+ throttle_pct=throttle_pct,
90
+ count=count,
91
+ esc_motor_wire_resistance_mohm=esc_motor_wire_resistance_mohm,
92
+ esc_resistance_mohm=esc_resistance_mohm,
93
+ )
94
+
95
+ return sweep_rotor_group_in
@@ -0,0 +1,55 @@
1
+ """Shared types for generated model properties.
2
+
3
+ This file is derived from the openapi-python-client types.py.jinja template and
4
+ is required by the generated _models/ package.
5
+ """
6
+
7
+ from collections.abc import Mapping, MutableMapping
8
+ from http import HTTPStatus
9
+ from typing import BinaryIO, Generic, IO, Literal, TypeVar
10
+
11
+ from attrs import define
12
+
13
+
14
+ class Unset:
15
+ def __bool__(self) -> Literal[False]:
16
+ return False
17
+
18
+
19
+ UNSET: Unset = Unset()
20
+
21
+ FileContent = IO[bytes] | bytes | str
22
+ FileTypes = (
23
+ tuple[str | None, FileContent, str | None]
24
+ | tuple[str | None, FileContent, str | None, Mapping[str, str]]
25
+ )
26
+ RequestFiles = list[tuple[str, FileTypes]]
27
+
28
+
29
+ @define
30
+ class File:
31
+ """Contains information for file uploads."""
32
+
33
+ payload: BinaryIO
34
+ file_name: str | None = None
35
+ mime_type: str | None = None
36
+
37
+ def to_tuple(self) -> FileTypes:
38
+ """Return a tuple representation that httpx will accept for multipart/form-data."""
39
+ return self.file_name, self.payload, self.mime_type
40
+
41
+
42
+ T = TypeVar("T")
43
+
44
+
45
+ @define
46
+ class Response(Generic[T]):
47
+ """A response from an endpoint."""
48
+
49
+ status_code: HTTPStatus
50
+ content: bytes
51
+ headers: MutableMapping[str, str]
52
+ parsed: T | None
53
+
54
+
55
+ __all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"]