convexity-api-client 0.21.0.dev330__py3-none-any.whl → 0.21.0.dev332__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 (37) hide show
  1. convexity_api_client/api/v1/erp_config_delete_user_table_preference.py +180 -0
  2. convexity_api_client/api/v1/erp_config_list_user_table_preferences.py +166 -0
  3. convexity_api_client/api/v1/erp_config_update_user_table_preference.py +202 -0
  4. convexity_api_client/api/v1/inventory_list_templates.py +18 -61
  5. convexity_api_client/api/v1/purchasing_list_pos.py +18 -61
  6. convexity_api_client/api/v1/purchasing_list_vendors.py +18 -61
  7. convexity_api_client/api/v1/sales_list_invoices.py +18 -61
  8. convexity_api_client/api/v1/sales_list_orders.py +18 -61
  9. convexity_api_client/models/__init__.py +24 -12
  10. convexity_api_client/models/erp_configured_column_config.py +31 -0
  11. convexity_api_client/models/erp_configured_column_config_data_type_type_0.py +12 -0
  12. convexity_api_client/models/erp_project_config.py +18 -0
  13. convexity_api_client/models/erp_project_config_tablecolumns.py +68 -0
  14. convexity_api_client/models/erp_user_table_preference.py +201 -0
  15. convexity_api_client/models/erp_user_table_preference_response.py +102 -0
  16. convexity_api_client/models/erp_user_table_preference_response_columnlabels.py +47 -0
  17. convexity_api_client/models/erp_user_table_preference_response_columnwidths.py +47 -0
  18. convexity_api_client/models/import_task_payload.py +108 -0
  19. convexity_api_client/models/import_task_payload_type.py +9 -0
  20. convexity_api_client/models/list_erp_user_table_preferences_response.py +75 -0
  21. convexity_api_client/models/list_inventory_items_request.py +11 -62
  22. convexity_api_client/models/profile.py +43 -0
  23. convexity_api_client/models/project.py +43 -0
  24. convexity_api_client/models/search_purchase_orders_request.py +11 -51
  25. convexity_api_client/models/update_erp_user_table_preference_request.py +92 -0
  26. convexity_api_client/models/update_erp_user_table_preference_request_columnlabels.py +47 -0
  27. convexity_api_client/models/update_erp_user_table_preference_request_columnwidths.py +47 -0
  28. convexity_api_client/models/worker_task_response.py +18 -2
  29. {convexity_api_client-0.21.0.dev330.dist-info → convexity_api_client-0.21.0.dev332.dist-info}/METADATA +1 -1
  30. {convexity_api_client-0.21.0.dev330.dist-info → convexity_api_client-0.21.0.dev332.dist-info}/RECORD +31 -22
  31. {convexity_api_client-0.21.0.dev330.dist-info → convexity_api_client-0.21.0.dev332.dist-info}/WHEEL +1 -1
  32. convexity_api_client/models/inventory_list_templates_filter_operator_type_0.py +0 -19
  33. convexity_api_client/models/list_inventory_items_request_filter_operator_type_0.py +0 -19
  34. convexity_api_client/models/purchasing_list_pos_filter_operator_type_0.py +0 -19
  35. convexity_api_client/models/purchasing_list_vendors_filter_operator_type_0.py +0 -19
  36. convexity_api_client/models/sales_list_invoices_filter_operator_type_0.py +0 -19
  37. convexity_api_client/models/sales_list_orders_filter_operator_type_0.py +0 -19
@@ -10,6 +10,7 @@ from ..types import UNSET, Unset
10
10
  if TYPE_CHECKING:
11
11
  from ..models.erp_forecasting_config import ErpForecastingConfig
12
12
  from ..models.erp_inventory_policy_writeback_action_config import ErpInventoryPolicyWritebackActionConfig
13
+ from ..models.erp_project_config_tablecolumns import ErpProjectConfigTablecolumns
13
14
  from ..models.erp_purchase_order_line_detail_panel_config import ErpPurchaseOrderLineDetailPanelConfig
14
15
  from ..models.erp_purchase_order_writeback_action_config import ErpPurchaseOrderWritebackActionConfig
15
16
  from ..models.erp_sales_order_builder_surface_config import ErpSalesOrderBuilderSurfaceConfig
@@ -27,6 +28,7 @@ class ErpProjectConfig:
27
28
  type_ (Literal['erp_project_config'] | Unset): Default: 'erp_project_config'.
28
29
  source_of_record (ErpSourceOfRecordConfig | Unset):
29
30
  forecasting (ErpForecastingConfig | Unset):
31
+ table_columns (ErpProjectConfigTablecolumns | Unset):
30
32
  show_kpi_cards (bool | Unset): Default: False.
31
33
  inventory_item_browser (ErpSurfaceConfig | Unset):
32
34
  inventory_replenishment_policy_list (ErpSurfaceConfig | Unset):
@@ -57,6 +59,7 @@ class ErpProjectConfig:
57
59
  type_: Literal["erp_project_config"] | Unset = "erp_project_config"
58
60
  source_of_record: ErpSourceOfRecordConfig | Unset = UNSET
59
61
  forecasting: ErpForecastingConfig | Unset = UNSET
62
+ table_columns: ErpProjectConfigTablecolumns | Unset = UNSET
60
63
  show_kpi_cards: bool | Unset = False
61
64
  inventory_item_browser: ErpSurfaceConfig | Unset = UNSET
62
65
  inventory_replenishment_policy_list: ErpSurfaceConfig | Unset = UNSET
@@ -89,6 +92,10 @@ class ErpProjectConfig:
89
92
  if not isinstance(self.forecasting, Unset):
90
93
  forecasting = self.forecasting.to_dict()
91
94
 
95
+ table_columns: dict[str, Any] | Unset = UNSET
96
+ if not isinstance(self.table_columns, Unset):
97
+ table_columns = self.table_columns.to_dict()
98
+
92
99
  show_kpi_cards = self.show_kpi_cards
93
100
 
94
101
  inventory_item_browser: dict[str, Any] | Unset = UNSET
@@ -176,6 +183,8 @@ class ErpProjectConfig:
176
183
  field_dict["source_of_record"] = source_of_record
177
184
  if forecasting is not UNSET:
178
185
  field_dict["forecasting"] = forecasting
186
+ if table_columns is not UNSET:
187
+ field_dict["tableColumns"] = table_columns
179
188
  if show_kpi_cards is not UNSET:
180
189
  field_dict["show_kpi_cards"] = show_kpi_cards
181
190
  if inventory_item_browser is not UNSET:
@@ -223,6 +232,7 @@ class ErpProjectConfig:
223
232
  def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
224
233
  from ..models.erp_forecasting_config import ErpForecastingConfig
225
234
  from ..models.erp_inventory_policy_writeback_action_config import ErpInventoryPolicyWritebackActionConfig
235
+ from ..models.erp_project_config_tablecolumns import ErpProjectConfigTablecolumns
226
236
  from ..models.erp_purchase_order_line_detail_panel_config import ErpPurchaseOrderLineDetailPanelConfig
227
237
  from ..models.erp_purchase_order_writeback_action_config import ErpPurchaseOrderWritebackActionConfig
228
238
  from ..models.erp_sales_order_builder_surface_config import ErpSalesOrderBuilderSurfaceConfig
@@ -248,6 +258,13 @@ class ErpProjectConfig:
248
258
  else:
249
259
  forecasting = ErpForecastingConfig.from_dict(_forecasting)
250
260
 
261
+ _table_columns = d.pop("tableColumns", UNSET)
262
+ table_columns: ErpProjectConfigTablecolumns | Unset
263
+ if isinstance(_table_columns, Unset):
264
+ table_columns = UNSET
265
+ else:
266
+ table_columns = ErpProjectConfigTablecolumns.from_dict(_table_columns)
267
+
251
268
  show_kpi_cards = d.pop("show_kpi_cards", UNSET)
252
269
 
253
270
  _inventory_item_browser = d.pop("inventory_item_browser", UNSET)
@@ -391,6 +408,7 @@ class ErpProjectConfig:
391
408
  type_=type_,
392
409
  source_of_record=source_of_record,
393
410
  forecasting=forecasting,
411
+ table_columns=table_columns,
394
412
  show_kpi_cards=show_kpi_cards,
395
413
  inventory_item_browser=inventory_item_browser,
396
414
  inventory_replenishment_policy_list=inventory_replenishment_policy_list,
@@ -0,0 +1,68 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import TYPE_CHECKING, Any, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ if TYPE_CHECKING:
10
+ from ..models.erp_configured_column_config import ErpConfiguredColumnConfig
11
+
12
+
13
+ T = TypeVar("T", bound="ErpProjectConfigTablecolumns")
14
+
15
+
16
+ @_attrs_define
17
+ class ErpProjectConfigTablecolumns:
18
+ """ """
19
+
20
+ additional_properties: dict[str, list[ErpConfiguredColumnConfig]] = _attrs_field(init=False, factory=dict)
21
+
22
+ def to_dict(self) -> dict[str, Any]:
23
+
24
+ field_dict: dict[str, Any] = {}
25
+ for prop_name, prop in self.additional_properties.items():
26
+ field_dict[prop_name] = []
27
+ for additional_property_item_data in prop:
28
+ additional_property_item = additional_property_item_data.to_dict()
29
+ field_dict[prop_name].append(additional_property_item)
30
+
31
+ return field_dict
32
+
33
+ @classmethod
34
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
35
+ from ..models.erp_configured_column_config import ErpConfiguredColumnConfig
36
+
37
+ d = dict(src_dict)
38
+ erp_project_config_tablecolumns = cls()
39
+
40
+ additional_properties = {}
41
+ for prop_name, prop_dict in d.items():
42
+ additional_property = []
43
+ _additional_property = prop_dict
44
+ for additional_property_item_data in _additional_property:
45
+ additional_property_item = ErpConfiguredColumnConfig.from_dict(additional_property_item_data)
46
+
47
+ additional_property.append(additional_property_item)
48
+
49
+ additional_properties[prop_name] = additional_property
50
+
51
+ erp_project_config_tablecolumns.additional_properties = additional_properties
52
+ return erp_project_config_tablecolumns
53
+
54
+ @property
55
+ def additional_keys(self) -> list[str]:
56
+ return list(self.additional_properties.keys())
57
+
58
+ def __getitem__(self, key: str) -> list[ErpConfiguredColumnConfig]:
59
+ return self.additional_properties[key]
60
+
61
+ def __setitem__(self, key: str, value: list[ErpConfiguredColumnConfig]) -> None:
62
+ self.additional_properties[key] = value
63
+
64
+ def __delitem__(self, key: str) -> None:
65
+ del self.additional_properties[key]
66
+
67
+ def __contains__(self, key: str) -> bool:
68
+ return key in self.additional_properties
@@ -0,0 +1,201 @@
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
+
7
+ from attrs import define as _attrs_define
8
+ from attrs import field as _attrs_field
9
+
10
+ from ..types import UNSET, Unset
11
+
12
+ if TYPE_CHECKING:
13
+ from ..models.profile import Profile
14
+ from ..models.project import Project
15
+
16
+
17
+ T = TypeVar("T", bound="ERPUserTablePreference")
18
+
19
+
20
+ @_attrs_define
21
+ class ERPUserTablePreference:
22
+ """Per-user presentation preferences for one ERP table surface.
23
+
24
+
25
+ Attributes:
26
+ id (str):
27
+ project_id (str):
28
+ user_id (str):
29
+ surface_key (str):
30
+ visible_column_ids (list[str]):
31
+ column_widths (str):
32
+ column_labels (str):
33
+ created_at (datetime.datetime):
34
+ updated_at (datetime.datetime):
35
+ project (None | Project | Unset):
36
+ profile (None | Profile | Unset):
37
+ """
38
+
39
+ id: str
40
+ project_id: str
41
+ user_id: str
42
+ surface_key: str
43
+ visible_column_ids: list[str]
44
+ column_widths: str
45
+ column_labels: str
46
+ created_at: datetime.datetime
47
+ updated_at: datetime.datetime
48
+ project: None | Project | Unset = UNSET
49
+ profile: None | Profile | Unset = UNSET
50
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
51
+
52
+ def to_dict(self) -> dict[str, Any]:
53
+ from ..models.profile import Profile
54
+ from ..models.project import Project
55
+
56
+ id = self.id
57
+
58
+ project_id = self.project_id
59
+
60
+ user_id = self.user_id
61
+
62
+ surface_key = self.surface_key
63
+
64
+ visible_column_ids = self.visible_column_ids
65
+
66
+ column_widths = self.column_widths
67
+
68
+ column_labels = self.column_labels
69
+
70
+ created_at = self.created_at.isoformat()
71
+
72
+ updated_at = self.updated_at.isoformat()
73
+
74
+ project: dict[str, Any] | None | Unset
75
+ if isinstance(self.project, Unset):
76
+ project = UNSET
77
+ elif isinstance(self.project, Project):
78
+ project = self.project.to_dict()
79
+ else:
80
+ project = self.project
81
+
82
+ profile: dict[str, Any] | None | Unset
83
+ if isinstance(self.profile, Unset):
84
+ profile = UNSET
85
+ elif isinstance(self.profile, Profile):
86
+ profile = self.profile.to_dict()
87
+ else:
88
+ profile = self.profile
89
+
90
+ field_dict: dict[str, Any] = {}
91
+ field_dict.update(self.additional_properties)
92
+ field_dict.update(
93
+ {
94
+ "id": id,
95
+ "project_id": project_id,
96
+ "user_id": user_id,
97
+ "surface_key": surface_key,
98
+ "visible_column_ids": visible_column_ids,
99
+ "column_widths": column_widths,
100
+ "column_labels": column_labels,
101
+ "created_at": created_at,
102
+ "updated_at": updated_at,
103
+ }
104
+ )
105
+ if project is not UNSET:
106
+ field_dict["project"] = project
107
+ if profile is not UNSET:
108
+ field_dict["profile"] = profile
109
+
110
+ return field_dict
111
+
112
+ @classmethod
113
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
114
+ from ..models.profile import Profile
115
+ from ..models.project import Project
116
+
117
+ d = dict(src_dict)
118
+ id = d.pop("id")
119
+
120
+ project_id = d.pop("project_id")
121
+
122
+ user_id = d.pop("user_id")
123
+
124
+ surface_key = d.pop("surface_key")
125
+
126
+ visible_column_ids = cast(list[str], d.pop("visible_column_ids"))
127
+
128
+ column_widths = d.pop("column_widths")
129
+
130
+ column_labels = d.pop("column_labels")
131
+
132
+ created_at = datetime.datetime.fromisoformat(d.pop("created_at"))
133
+
134
+ updated_at = datetime.datetime.fromisoformat(d.pop("updated_at"))
135
+
136
+ def _parse_project(data: object) -> None | Project | Unset:
137
+ if data is None:
138
+ return data
139
+ if isinstance(data, Unset):
140
+ return data
141
+ try:
142
+ if not isinstance(data, dict):
143
+ raise TypeError()
144
+ project_type_0 = Project.from_dict(data)
145
+
146
+ return project_type_0
147
+ except (TypeError, ValueError, AttributeError, KeyError):
148
+ pass
149
+ return cast(None | Project | Unset, data)
150
+
151
+ project = _parse_project(d.pop("project", UNSET))
152
+
153
+ def _parse_profile(data: object) -> None | Profile | Unset:
154
+ if data is None:
155
+ return data
156
+ if isinstance(data, Unset):
157
+ return data
158
+ try:
159
+ if not isinstance(data, dict):
160
+ raise TypeError()
161
+ profile_type_0 = Profile.from_dict(data)
162
+
163
+ return profile_type_0
164
+ except (TypeError, ValueError, AttributeError, KeyError):
165
+ pass
166
+ return cast(None | Profile | Unset, data)
167
+
168
+ profile = _parse_profile(d.pop("profile", UNSET))
169
+
170
+ erp_user_table_preference = cls(
171
+ id=id,
172
+ project_id=project_id,
173
+ user_id=user_id,
174
+ surface_key=surface_key,
175
+ visible_column_ids=visible_column_ids,
176
+ column_widths=column_widths,
177
+ column_labels=column_labels,
178
+ created_at=created_at,
179
+ updated_at=updated_at,
180
+ project=project,
181
+ profile=profile,
182
+ )
183
+
184
+ erp_user_table_preference.additional_properties = d
185
+ return erp_user_table_preference
186
+
187
+ @property
188
+ def additional_keys(self) -> list[str]:
189
+ return list(self.additional_properties.keys())
190
+
191
+ def __getitem__(self, key: str) -> Any:
192
+ return self.additional_properties[key]
193
+
194
+ def __setitem__(self, key: str, value: Any) -> None:
195
+ self.additional_properties[key] = value
196
+
197
+ def __delitem__(self, key: str) -> None:
198
+ del self.additional_properties[key]
199
+
200
+ def __contains__(self, key: str) -> bool:
201
+ return key in self.additional_properties
@@ -0,0 +1,102 @@
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
+
7
+ from attrs import define as _attrs_define
8
+ from attrs import field as _attrs_field
9
+
10
+ if TYPE_CHECKING:
11
+ from ..models.erp_user_table_preference_response_columnlabels import ERPUserTablePreferenceResponseColumnlabels
12
+ from ..models.erp_user_table_preference_response_columnwidths import ERPUserTablePreferenceResponseColumnwidths
13
+
14
+
15
+ T = TypeVar("T", bound="ERPUserTablePreferenceResponse")
16
+
17
+
18
+ @_attrs_define
19
+ class ERPUserTablePreferenceResponse:
20
+ """
21
+ Attributes:
22
+ surface_key (str):
23
+ visible_column_ids (list[str]):
24
+ column_widths (ERPUserTablePreferenceResponseColumnwidths):
25
+ column_labels (ERPUserTablePreferenceResponseColumnlabels):
26
+ updated_at (datetime.datetime):
27
+ """
28
+
29
+ surface_key: str
30
+ visible_column_ids: list[str]
31
+ column_widths: ERPUserTablePreferenceResponseColumnwidths
32
+ column_labels: ERPUserTablePreferenceResponseColumnlabels
33
+ updated_at: datetime.datetime
34
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
35
+
36
+ def to_dict(self) -> dict[str, Any]:
37
+ surface_key = self.surface_key
38
+
39
+ visible_column_ids = self.visible_column_ids
40
+
41
+ column_widths = self.column_widths.to_dict()
42
+
43
+ column_labels = self.column_labels.to_dict()
44
+
45
+ updated_at = self.updated_at.isoformat()
46
+
47
+ field_dict: dict[str, Any] = {}
48
+ field_dict.update(self.additional_properties)
49
+ field_dict.update(
50
+ {
51
+ "surfaceKey": surface_key,
52
+ "visibleColumnIds": visible_column_ids,
53
+ "columnWidths": column_widths,
54
+ "columnLabels": column_labels,
55
+ "updatedAt": updated_at,
56
+ }
57
+ )
58
+
59
+ return field_dict
60
+
61
+ @classmethod
62
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
63
+ from ..models.erp_user_table_preference_response_columnlabels import ERPUserTablePreferenceResponseColumnlabels
64
+ from ..models.erp_user_table_preference_response_columnwidths import ERPUserTablePreferenceResponseColumnwidths
65
+
66
+ d = dict(src_dict)
67
+ surface_key = d.pop("surfaceKey")
68
+
69
+ visible_column_ids = cast(list[str], d.pop("visibleColumnIds"))
70
+
71
+ column_widths = ERPUserTablePreferenceResponseColumnwidths.from_dict(d.pop("columnWidths"))
72
+
73
+ column_labels = ERPUserTablePreferenceResponseColumnlabels.from_dict(d.pop("columnLabels"))
74
+
75
+ updated_at = datetime.datetime.fromisoformat(d.pop("updatedAt"))
76
+
77
+ erp_user_table_preference_response = cls(
78
+ surface_key=surface_key,
79
+ visible_column_ids=visible_column_ids,
80
+ column_widths=column_widths,
81
+ column_labels=column_labels,
82
+ updated_at=updated_at,
83
+ )
84
+
85
+ erp_user_table_preference_response.additional_properties = d
86
+ return erp_user_table_preference_response
87
+
88
+ @property
89
+ def additional_keys(self) -> list[str]:
90
+ return list(self.additional_properties.keys())
91
+
92
+ def __getitem__(self, key: str) -> Any:
93
+ return self.additional_properties[key]
94
+
95
+ def __setitem__(self, key: str, value: Any) -> None:
96
+ self.additional_properties[key] = value
97
+
98
+ def __delitem__(self, key: str) -> None:
99
+ del self.additional_properties[key]
100
+
101
+ def __contains__(self, key: str) -> bool:
102
+ return key in self.additional_properties
@@ -0,0 +1,47 @@
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="ERPUserTablePreferenceResponseColumnlabels")
10
+
11
+
12
+ @_attrs_define
13
+ class ERPUserTablePreferenceResponseColumnlabels:
14
+ """ """
15
+
16
+ additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict)
17
+
18
+ def to_dict(self) -> dict[str, Any]:
19
+
20
+ field_dict: dict[str, Any] = {}
21
+ field_dict.update(self.additional_properties)
22
+
23
+ return field_dict
24
+
25
+ @classmethod
26
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
27
+ d = dict(src_dict)
28
+ erp_user_table_preference_response_columnlabels = cls()
29
+
30
+ erp_user_table_preference_response_columnlabels.additional_properties = d
31
+ return erp_user_table_preference_response_columnlabels
32
+
33
+ @property
34
+ def additional_keys(self) -> list[str]:
35
+ return list(self.additional_properties.keys())
36
+
37
+ def __getitem__(self, key: str) -> str:
38
+ return self.additional_properties[key]
39
+
40
+ def __setitem__(self, key: str, value: str) -> None:
41
+ self.additional_properties[key] = value
42
+
43
+ def __delitem__(self, key: str) -> None:
44
+ del self.additional_properties[key]
45
+
46
+ def __contains__(self, key: str) -> bool:
47
+ return key in self.additional_properties
@@ -0,0 +1,47 @@
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="ERPUserTablePreferenceResponseColumnwidths")
10
+
11
+
12
+ @_attrs_define
13
+ class ERPUserTablePreferenceResponseColumnwidths:
14
+ """ """
15
+
16
+ additional_properties: dict[str, int] = _attrs_field(init=False, factory=dict)
17
+
18
+ def to_dict(self) -> dict[str, Any]:
19
+
20
+ field_dict: dict[str, Any] = {}
21
+ field_dict.update(self.additional_properties)
22
+
23
+ return field_dict
24
+
25
+ @classmethod
26
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
27
+ d = dict(src_dict)
28
+ erp_user_table_preference_response_columnwidths = cls()
29
+
30
+ erp_user_table_preference_response_columnwidths.additional_properties = d
31
+ return erp_user_table_preference_response_columnwidths
32
+
33
+ @property
34
+ def additional_keys(self) -> list[str]:
35
+ return list(self.additional_properties.keys())
36
+
37
+ def __getitem__(self, key: str) -> int:
38
+ return self.additional_properties[key]
39
+
40
+ def __setitem__(self, key: str, value: int) -> None:
41
+ self.additional_properties[key] = value
42
+
43
+ def __delitem__(self, key: str) -> None:
44
+ del self.additional_properties[key]
45
+
46
+ def __contains__(self, key: str) -> bool:
47
+ 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 Any, TypeVar, cast
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ from ..models.import_task_payload_type import ImportTaskPayloadType
10
+ from ..types import UNSET, Unset
11
+
12
+ T = TypeVar("T", bound="ImportTaskPayload")
13
+
14
+
15
+ @_attrs_define
16
+ class ImportTaskPayload:
17
+ """Payload for IMPORT_VALIDATE / IMPORT_COMMIT worker tasks.
18
+
19
+ Carries only the import job id (+ project + initiating user). The per-entity
20
+ strategy is resolved from ``ImportJob.entity_type`` at execution time, so
21
+ this payload stays entity-agnostic.
22
+
23
+ A single model serves both import task types; ``type`` acts as the
24
+ discriminator so the payload can participate in ``WorkerTaskPayload``.
25
+
26
+ Attributes:
27
+ type_ (ImportTaskPayloadType): Which import stage this payload drives (validate or commit)
28
+ import_id (str):
29
+ project_id (str):
30
+ user_id (None | str | Unset):
31
+ """
32
+
33
+ type_: ImportTaskPayloadType
34
+ import_id: str
35
+ project_id: str
36
+ user_id: None | str | Unset = UNSET
37
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
38
+
39
+ def to_dict(self) -> dict[str, Any]:
40
+ type_ = self.type_.value
41
+
42
+ import_id = self.import_id
43
+
44
+ project_id = self.project_id
45
+
46
+ user_id: None | str | Unset
47
+ if isinstance(self.user_id, Unset):
48
+ user_id = UNSET
49
+ else:
50
+ user_id = self.user_id
51
+
52
+ field_dict: dict[str, Any] = {}
53
+ field_dict.update(self.additional_properties)
54
+ field_dict.update(
55
+ {
56
+ "type": type_,
57
+ "importId": import_id,
58
+ "projectId": project_id,
59
+ }
60
+ )
61
+ if user_id is not UNSET:
62
+ field_dict["userId"] = user_id
63
+
64
+ return field_dict
65
+
66
+ @classmethod
67
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
68
+ d = dict(src_dict)
69
+ type_ = ImportTaskPayloadType(d.pop("type"))
70
+
71
+ import_id = d.pop("importId")
72
+
73
+ project_id = d.pop("projectId")
74
+
75
+ def _parse_user_id(data: object) -> None | str | Unset:
76
+ if data is None:
77
+ return data
78
+ if isinstance(data, Unset):
79
+ return data
80
+ return cast(None | str | Unset, data)
81
+
82
+ user_id = _parse_user_id(d.pop("userId", UNSET))
83
+
84
+ import_task_payload = cls(
85
+ type_=type_,
86
+ import_id=import_id,
87
+ project_id=project_id,
88
+ user_id=user_id,
89
+ )
90
+
91
+ import_task_payload.additional_properties = d
92
+ return import_task_payload
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,9 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ImportTaskPayloadType(str, Enum):
5
+ IMPORT_COMMIT = "import_commit"
6
+ IMPORT_VALIDATE = "import_validate"
7
+
8
+ def __str__(self) -> str:
9
+ return str(self.value)