minikai 0.1.7__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 minikai might be problematic. Click here for more details.

Files changed (100) hide show
  1. minikai/__init__.py +8 -0
  2. minikai/api/__init__.py +1 -0
  3. minikai/api/groups/__init__.py +1 -0
  4. minikai/api/groups/add_minis_to_group.py +196 -0
  5. minikai/api/groups/add_users_to_group.py +196 -0
  6. minikai/api/groups/create_group.py +178 -0
  7. minikai/api/groups/delete_group.py +115 -0
  8. minikai/api/groups/get_group.py +170 -0
  9. minikai/api/groups/get_group_minis.py +175 -0
  10. minikai/api/groups/get_group_users.py +175 -0
  11. minikai/api/groups/get_groups.py +150 -0
  12. minikai/api/groups/remove_minis_from_group.py +196 -0
  13. minikai/api/groups/remove_users_from_group.py +196 -0
  14. minikai/api/groups/update_group.py +195 -0
  15. minikai/api/minis/__init__.py +1 -0
  16. minikai/api/minis/create_mini.py +178 -0
  17. minikai/api/minis/delete_mini.py +115 -0
  18. minikai/api/minis/get_external_mini.py +183 -0
  19. minikai/api/minis/get_minis.py +150 -0
  20. minikai/api/minis/patch_mini.py +195 -0
  21. minikai/api/minis/update_mini.py +195 -0
  22. minikai/api/records/__init__.py +1 -0
  23. minikai/api/records/add_attachments.py +203 -0
  24. minikai/api/records/add_relations.py +209 -0
  25. minikai/api/records/create_record.py +182 -0
  26. minikai/api/records/delete_record.py +115 -0
  27. minikai/api/records/download_attachment.py +119 -0
  28. minikai/api/records/get_created_by.py +202 -0
  29. minikai/api/records/get_labels.py +194 -0
  30. minikai/api/records/get_records_by_external.py +248 -0
  31. minikai/api/records/get_states.py +194 -0
  32. minikai/api/records/get_updated_by.py +202 -0
  33. minikai/api/records/remove_attachments.py +132 -0
  34. minikai/api/records/remove_relations.py +132 -0
  35. minikai/api/records/update_attachments.py +203 -0
  36. minikai/api/records/update_record.py +199 -0
  37. minikai/api/records/update_relations.py +209 -0
  38. minikai/api/records/upsert_records_by_external_uri.py +182 -0
  39. minikai/api/users/__init__.py +1 -0
  40. minikai/api/users/delete_api_users_minis.py +122 -0
  41. minikai/api/users/get_api_users_minis.py +175 -0
  42. minikai/api/users/get_users.py +150 -0
  43. minikai/api/users/post_api_users_minis.py +187 -0
  44. minikai/client.py +271 -0
  45. minikai/errors.py +14 -0
  46. minikai/models/__init__.py +103 -0
  47. minikai/models/add_attachments_body.py +140 -0
  48. minikai/models/batch_upsert_result.py +124 -0
  49. minikai/models/create_group_command.py +127 -0
  50. minikai/models/create_mini_command.py +144 -0
  51. minikai/models/create_record_command.py +263 -0
  52. minikai/models/create_record_command_tags.py +63 -0
  53. minikai/models/cursor_paginated_list_of_record_dto.py +122 -0
  54. minikai/models/document_file_dto.py +171 -0
  55. minikai/models/document_file_metadata_dto.py +72 -0
  56. minikai/models/failed_upsert_item.py +83 -0
  57. minikai/models/form_field.py +138 -0
  58. minikai/models/form_field_dto.py +181 -0
  59. minikai/models/form_field_type.py +10 -0
  60. minikai/models/group_dto.py +155 -0
  61. minikai/models/http_validation_problem_details.py +198 -0
  62. minikai/models/http_validation_problem_details_errors.py +74 -0
  63. minikai/models/mini_dto.py +224 -0
  64. minikai/models/mini_template_dto.py +167 -0
  65. minikai/models/paginated_list_of_record_dto.py +124 -0
  66. minikai/models/patch_mini_command.py +102 -0
  67. minikai/models/problem_details.py +174 -0
  68. minikai/models/record.py +441 -0
  69. minikai/models/record_attachment.py +265 -0
  70. minikai/models/record_attachment_dto.py +265 -0
  71. minikai/models/record_attachment_dto_metadata_type_0.py +63 -0
  72. minikai/models/record_attachment_metadata_type_0.py +63 -0
  73. minikai/models/record_authorization.py +107 -0
  74. minikai/models/record_authorization_dto.py +107 -0
  75. minikai/models/record_dto.py +385 -0
  76. minikai/models/record_dto_tags.py +63 -0
  77. minikai/models/record_relation.py +105 -0
  78. minikai/models/record_relation_dto.py +105 -0
  79. minikai/models/record_state.py +10 -0
  80. minikai/models/record_tag.py +159 -0
  81. minikai/models/record_tag_dto.py +68 -0
  82. minikai/models/slim_mini_dto.py +197 -0
  83. minikai/models/tool_dto.py +95 -0
  84. minikai/models/update_attachments_body.py +140 -0
  85. minikai/models/update_group_command.py +148 -0
  86. minikai/models/update_mini_command.py +153 -0
  87. minikai/models/update_mini_template_workspaces_command.py +74 -0
  88. minikai/models/update_record_command.py +274 -0
  89. minikai/models/update_record_command_tags.py +63 -0
  90. minikai/models/upsert_record_dto.py +275 -0
  91. minikai/models/upsert_record_dto_tags.py +63 -0
  92. minikai/models/upsert_records_by_external_uri_command.py +79 -0
  93. minikai/models/user_dto.py +215 -0
  94. minikai/models/user_to_mini_dto.py +99 -0
  95. minikai/models/workspace_dto.py +99 -0
  96. minikai/py.typed +1 -0
  97. minikai/types.py +53 -0
  98. minikai-0.1.7.dist-info/METADATA +133 -0
  99. minikai-0.1.7.dist-info/RECORD +100 -0
  100. minikai-0.1.7.dist-info/WHEEL +4 -0
@@ -0,0 +1,275 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING, Generator
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..types import UNSET, Unset
8
+
9
+ from ..models.record_state import check_record_state
10
+ from ..models.record_state import RecordState
11
+ from ..types import UNSET, Unset
12
+ from dateutil.parser import isoparse
13
+ from typing import cast
14
+ from typing import cast, Union
15
+ from typing import Union
16
+ import datetime
17
+
18
+ if TYPE_CHECKING:
19
+ from ..models.record_relation_dto import RecordRelationDto
20
+ from ..models.upsert_record_dto_tags import UpsertRecordDtoTags
21
+ from ..models.record_authorization_dto import RecordAuthorizationDto
22
+
23
+
24
+
25
+
26
+
27
+ T = TypeVar("T", bound="UpsertRecordDto")
28
+
29
+
30
+
31
+ @_attrs_define
32
+ class UpsertRecordDto:
33
+ """
34
+ Attributes:
35
+ external_uri (Union[Unset, str]):
36
+ title (Union[Unset, str]):
37
+ description (Union[None, Unset, str]):
38
+ mini_id (Union[Unset, str]):
39
+ event_date (Union[None, Unset, datetime.datetime]):
40
+ schema (Union[Unset, Any]):
41
+ content (Union[Unset, Any]):
42
+ relations (Union[Unset, list['RecordRelationDto']]):
43
+ labels (Union[Unset, list[str]]):
44
+ tags (Union[Unset, UpsertRecordDtoTags]):
45
+ authorization (Union['RecordAuthorizationDto', None, Unset]):
46
+ state (Union[Unset, RecordState]):
47
+ """
48
+
49
+ external_uri: Union[Unset, str] = UNSET
50
+ title: Union[Unset, str] = UNSET
51
+ description: Union[None, Unset, str] = UNSET
52
+ mini_id: Union[Unset, str] = UNSET
53
+ event_date: Union[None, Unset, datetime.datetime] = UNSET
54
+ schema: Union[Unset, Any] = UNSET
55
+ content: Union[Unset, Any] = UNSET
56
+ relations: Union[Unset, list['RecordRelationDto']] = UNSET
57
+ labels: Union[Unset, list[str]] = UNSET
58
+ tags: Union[Unset, 'UpsertRecordDtoTags'] = UNSET
59
+ authorization: Union['RecordAuthorizationDto', None, Unset] = UNSET
60
+ state: Union[Unset, RecordState] = UNSET
61
+
62
+
63
+
64
+
65
+
66
+ def to_dict(self) -> dict[str, Any]:
67
+ from ..models.record_relation_dto import RecordRelationDto
68
+ from ..models.upsert_record_dto_tags import UpsertRecordDtoTags
69
+ from ..models.record_authorization_dto import RecordAuthorizationDto
70
+ external_uri = self.external_uri
71
+
72
+ title = self.title
73
+
74
+ description: Union[None, Unset, str]
75
+ if isinstance(self.description, Unset):
76
+ description = UNSET
77
+ else:
78
+ description = self.description
79
+
80
+ mini_id = self.mini_id
81
+
82
+ event_date: Union[None, Unset, str]
83
+ if isinstance(self.event_date, Unset):
84
+ event_date = UNSET
85
+ elif isinstance(self.event_date, datetime.datetime):
86
+ event_date = self.event_date.isoformat()
87
+ else:
88
+ event_date = self.event_date
89
+
90
+ schema = self.schema
91
+
92
+ content = self.content
93
+
94
+ relations: Union[Unset, list[dict[str, Any]]] = UNSET
95
+ if not isinstance(self.relations, Unset):
96
+ relations = []
97
+ for relations_item_data in self.relations:
98
+ relations_item = relations_item_data.to_dict()
99
+ relations.append(relations_item)
100
+
101
+
102
+
103
+ labels: Union[Unset, list[str]] = UNSET
104
+ if not isinstance(self.labels, Unset):
105
+ labels = self.labels
106
+
107
+
108
+
109
+ tags: Union[Unset, dict[str, Any]] = UNSET
110
+ if not isinstance(self.tags, Unset):
111
+ tags = self.tags.to_dict()
112
+
113
+ authorization: Union[None, Unset, dict[str, Any]]
114
+ if isinstance(self.authorization, Unset):
115
+ authorization = UNSET
116
+ elif isinstance(self.authorization, RecordAuthorizationDto):
117
+ authorization = self.authorization.to_dict()
118
+ else:
119
+ authorization = self.authorization
120
+
121
+ state: Union[Unset, int] = UNSET
122
+ if not isinstance(self.state, Unset):
123
+ state = self.state
124
+
125
+
126
+
127
+ field_dict: dict[str, Any] = {}
128
+
129
+ field_dict.update({
130
+ })
131
+ if external_uri is not UNSET:
132
+ field_dict["externalUri"] = external_uri
133
+ if title is not UNSET:
134
+ field_dict["title"] = title
135
+ if description is not UNSET:
136
+ field_dict["description"] = description
137
+ if mini_id is not UNSET:
138
+ field_dict["miniId"] = mini_id
139
+ if event_date is not UNSET:
140
+ field_dict["eventDate"] = event_date
141
+ if schema is not UNSET:
142
+ field_dict["schema"] = schema
143
+ if content is not UNSET:
144
+ field_dict["content"] = content
145
+ if relations is not UNSET:
146
+ field_dict["relations"] = relations
147
+ if labels is not UNSET:
148
+ field_dict["labels"] = labels
149
+ if tags is not UNSET:
150
+ field_dict["tags"] = tags
151
+ if authorization is not UNSET:
152
+ field_dict["authorization"] = authorization
153
+ if state is not UNSET:
154
+ field_dict["state"] = state
155
+
156
+ return field_dict
157
+
158
+
159
+
160
+ @classmethod
161
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
162
+ from ..models.record_relation_dto import RecordRelationDto
163
+ from ..models.upsert_record_dto_tags import UpsertRecordDtoTags
164
+ from ..models.record_authorization_dto import RecordAuthorizationDto
165
+ d = dict(src_dict)
166
+ external_uri = d.pop("externalUri", UNSET)
167
+
168
+ title = d.pop("title", UNSET)
169
+
170
+ def _parse_description(data: object) -> Union[None, Unset, str]:
171
+ if data is None:
172
+ return data
173
+ if isinstance(data, Unset):
174
+ return data
175
+ return cast(Union[None, Unset, str], data)
176
+
177
+ description = _parse_description(d.pop("description", UNSET))
178
+
179
+
180
+ mini_id = d.pop("miniId", UNSET)
181
+
182
+ def _parse_event_date(data: object) -> Union[None, Unset, datetime.datetime]:
183
+ if data is None:
184
+ return data
185
+ if isinstance(data, Unset):
186
+ return data
187
+ try:
188
+ if not isinstance(data, str):
189
+ raise TypeError()
190
+ event_date_type_0 = isoparse(data)
191
+
192
+
193
+
194
+ return event_date_type_0
195
+ except: # noqa: E722
196
+ pass
197
+ return cast(Union[None, Unset, datetime.datetime], data)
198
+
199
+ event_date = _parse_event_date(d.pop("eventDate", UNSET))
200
+
201
+
202
+ schema = d.pop("schema", UNSET)
203
+
204
+ content = d.pop("content", UNSET)
205
+
206
+ relations = []
207
+ _relations = d.pop("relations", UNSET)
208
+ for relations_item_data in (_relations or []):
209
+ relations_item = RecordRelationDto.from_dict(relations_item_data)
210
+
211
+
212
+
213
+ relations.append(relations_item)
214
+
215
+
216
+ labels = cast(list[str], d.pop("labels", UNSET))
217
+
218
+
219
+ _tags = d.pop("tags", UNSET)
220
+ tags: Union[Unset, UpsertRecordDtoTags]
221
+ if isinstance(_tags, Unset):
222
+ tags = UNSET
223
+ else:
224
+ tags = UpsertRecordDtoTags.from_dict(_tags)
225
+
226
+
227
+
228
+
229
+ def _parse_authorization(data: object) -> Union['RecordAuthorizationDto', None, Unset]:
230
+ if data is None:
231
+ return data
232
+ if isinstance(data, Unset):
233
+ return data
234
+ try:
235
+ if not isinstance(data, dict):
236
+ raise TypeError()
237
+ authorization_type_0 = RecordAuthorizationDto.from_dict(data)
238
+
239
+
240
+
241
+ return authorization_type_0
242
+ except: # noqa: E722
243
+ pass
244
+ return cast(Union['RecordAuthorizationDto', None, Unset], data)
245
+
246
+ authorization = _parse_authorization(d.pop("authorization", UNSET))
247
+
248
+
249
+ _state = d.pop("state", UNSET)
250
+ state: Union[Unset, RecordState]
251
+ if isinstance(_state, Unset):
252
+ state = UNSET
253
+ else:
254
+ state = check_record_state(_state)
255
+
256
+
257
+
258
+
259
+ upsert_record_dto = cls(
260
+ external_uri=external_uri,
261
+ title=title,
262
+ description=description,
263
+ mini_id=mini_id,
264
+ event_date=event_date,
265
+ schema=schema,
266
+ content=content,
267
+ relations=relations,
268
+ labels=labels,
269
+ tags=tags,
270
+ authorization=authorization,
271
+ state=state,
272
+ )
273
+
274
+ return upsert_record_dto
275
+
@@ -0,0 +1,63 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING, Generator
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..types import UNSET, Unset
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+ T = TypeVar("T", bound="UpsertRecordDtoTags")
16
+
17
+
18
+
19
+ @_attrs_define
20
+ class UpsertRecordDtoTags:
21
+ """
22
+ """
23
+
24
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
25
+
26
+
27
+
28
+
29
+
30
+ def to_dict(self) -> dict[str, Any]:
31
+
32
+ field_dict: dict[str, Any] = {}
33
+ field_dict.update(self.additional_properties)
34
+
35
+ return field_dict
36
+
37
+
38
+
39
+ @classmethod
40
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
41
+ d = dict(src_dict)
42
+ upsert_record_dto_tags = cls(
43
+ )
44
+
45
+
46
+ upsert_record_dto_tags.additional_properties = d
47
+ return upsert_record_dto_tags
48
+
49
+ @property
50
+ def additional_keys(self) -> list[str]:
51
+ return list(self.additional_properties.keys())
52
+
53
+ def __getitem__(self, key: str) -> Any:
54
+ return self.additional_properties[key]
55
+
56
+ def __setitem__(self, key: str, value: Any) -> None:
57
+ self.additional_properties[key] = value
58
+
59
+ def __delitem__(self, key: str) -> None:
60
+ del self.additional_properties[key]
61
+
62
+ def __contains__(self, key: str) -> bool:
63
+ return key in self.additional_properties
@@ -0,0 +1,79 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING, Generator
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..types import UNSET, Unset
8
+
9
+ from ..types import UNSET, Unset
10
+ from typing import cast
11
+ from typing import Union
12
+
13
+ if TYPE_CHECKING:
14
+ from ..models.upsert_record_dto import UpsertRecordDto
15
+
16
+
17
+
18
+
19
+
20
+ T = TypeVar("T", bound="UpsertRecordsByExternalUriCommand")
21
+
22
+
23
+
24
+ @_attrs_define
25
+ class UpsertRecordsByExternalUriCommand:
26
+ """
27
+ Attributes:
28
+ items (Union[Unset, list['UpsertRecordDto']]):
29
+ """
30
+
31
+ items: Union[Unset, list['UpsertRecordDto']] = UNSET
32
+
33
+
34
+
35
+
36
+
37
+ def to_dict(self) -> dict[str, Any]:
38
+ from ..models.upsert_record_dto import UpsertRecordDto
39
+ items: Union[Unset, list[dict[str, Any]]] = UNSET
40
+ if not isinstance(self.items, Unset):
41
+ items = []
42
+ for items_item_data in self.items:
43
+ items_item = items_item_data.to_dict()
44
+ items.append(items_item)
45
+
46
+
47
+
48
+
49
+ field_dict: dict[str, Any] = {}
50
+
51
+ field_dict.update({
52
+ })
53
+ if items is not UNSET:
54
+ field_dict["items"] = items
55
+
56
+ return field_dict
57
+
58
+
59
+
60
+ @classmethod
61
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
62
+ from ..models.upsert_record_dto import UpsertRecordDto
63
+ d = dict(src_dict)
64
+ items = []
65
+ _items = d.pop("items", UNSET)
66
+ for items_item_data in (_items or []):
67
+ items_item = UpsertRecordDto.from_dict(items_item_data)
68
+
69
+
70
+
71
+ items.append(items_item)
72
+
73
+
74
+ upsert_records_by_external_uri_command = cls(
75
+ items=items,
76
+ )
77
+
78
+ return upsert_records_by_external_uri_command
79
+
@@ -0,0 +1,215 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING, Generator
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..types import UNSET, Unset
8
+
9
+ from ..types import UNSET, Unset
10
+ from dateutil.parser import isoparse
11
+ from typing import cast
12
+ from typing import cast, Union
13
+ from typing import Union
14
+ import datetime
15
+
16
+
17
+
18
+
19
+
20
+
21
+ T = TypeVar("T", bound="UserDto")
22
+
23
+
24
+
25
+ @_attrs_define
26
+ class UserDto:
27
+ """
28
+ Attributes:
29
+ id (Union[Unset, str]):
30
+ email (Union[Unset, str]):
31
+ first_name (Union[None, Unset, str]):
32
+ last_name (Union[None, Unset, str]):
33
+ profile_picture_url (Union[None, Unset, str]):
34
+ created_at (Union[None, Unset, datetime.datetime]):
35
+ updated_at (Union[None, Unset, datetime.datetime]):
36
+ organization_ids (Union[Unset, list[str]]):
37
+ """
38
+
39
+ id: Union[Unset, str] = UNSET
40
+ email: Union[Unset, str] = UNSET
41
+ first_name: Union[None, Unset, str] = UNSET
42
+ last_name: Union[None, Unset, str] = UNSET
43
+ profile_picture_url: Union[None, Unset, str] = UNSET
44
+ created_at: Union[None, Unset, datetime.datetime] = UNSET
45
+ updated_at: Union[None, Unset, datetime.datetime] = UNSET
46
+ organization_ids: Union[Unset, list[str]] = UNSET
47
+
48
+
49
+
50
+
51
+
52
+ def to_dict(self) -> dict[str, Any]:
53
+ id = self.id
54
+
55
+ email = self.email
56
+
57
+ first_name: Union[None, Unset, str]
58
+ if isinstance(self.first_name, Unset):
59
+ first_name = UNSET
60
+ else:
61
+ first_name = self.first_name
62
+
63
+ last_name: Union[None, Unset, str]
64
+ if isinstance(self.last_name, Unset):
65
+ last_name = UNSET
66
+ else:
67
+ last_name = self.last_name
68
+
69
+ profile_picture_url: Union[None, Unset, str]
70
+ if isinstance(self.profile_picture_url, Unset):
71
+ profile_picture_url = UNSET
72
+ else:
73
+ profile_picture_url = self.profile_picture_url
74
+
75
+ created_at: Union[None, Unset, str]
76
+ if isinstance(self.created_at, Unset):
77
+ created_at = UNSET
78
+ elif isinstance(self.created_at, datetime.datetime):
79
+ created_at = self.created_at.isoformat()
80
+ else:
81
+ created_at = self.created_at
82
+
83
+ updated_at: Union[None, Unset, str]
84
+ if isinstance(self.updated_at, Unset):
85
+ updated_at = UNSET
86
+ elif isinstance(self.updated_at, datetime.datetime):
87
+ updated_at = self.updated_at.isoformat()
88
+ else:
89
+ updated_at = self.updated_at
90
+
91
+ organization_ids: Union[Unset, list[str]] = UNSET
92
+ if not isinstance(self.organization_ids, Unset):
93
+ organization_ids = self.organization_ids
94
+
95
+
96
+
97
+
98
+ field_dict: dict[str, Any] = {}
99
+
100
+ field_dict.update({
101
+ })
102
+ if id is not UNSET:
103
+ field_dict["id"] = id
104
+ if email is not UNSET:
105
+ field_dict["email"] = email
106
+ if first_name is not UNSET:
107
+ field_dict["firstName"] = first_name
108
+ if last_name is not UNSET:
109
+ field_dict["lastName"] = last_name
110
+ if profile_picture_url is not UNSET:
111
+ field_dict["profilePictureUrl"] = profile_picture_url
112
+ if created_at is not UNSET:
113
+ field_dict["createdAt"] = created_at
114
+ if updated_at is not UNSET:
115
+ field_dict["updatedAt"] = updated_at
116
+ if organization_ids is not UNSET:
117
+ field_dict["organizationIds"] = organization_ids
118
+
119
+ return field_dict
120
+
121
+
122
+
123
+ @classmethod
124
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
125
+ d = dict(src_dict)
126
+ id = d.pop("id", UNSET)
127
+
128
+ email = d.pop("email", UNSET)
129
+
130
+ def _parse_first_name(data: object) -> Union[None, Unset, str]:
131
+ if data is None:
132
+ return data
133
+ if isinstance(data, Unset):
134
+ return data
135
+ return cast(Union[None, Unset, str], data)
136
+
137
+ first_name = _parse_first_name(d.pop("firstName", UNSET))
138
+
139
+
140
+ def _parse_last_name(data: object) -> Union[None, Unset, str]:
141
+ if data is None:
142
+ return data
143
+ if isinstance(data, Unset):
144
+ return data
145
+ return cast(Union[None, Unset, str], data)
146
+
147
+ last_name = _parse_last_name(d.pop("lastName", UNSET))
148
+
149
+
150
+ def _parse_profile_picture_url(data: object) -> Union[None, Unset, str]:
151
+ if data is None:
152
+ return data
153
+ if isinstance(data, Unset):
154
+ return data
155
+ return cast(Union[None, Unset, str], data)
156
+
157
+ profile_picture_url = _parse_profile_picture_url(d.pop("profilePictureUrl", UNSET))
158
+
159
+
160
+ def _parse_created_at(data: object) -> Union[None, Unset, datetime.datetime]:
161
+ if data is None:
162
+ return data
163
+ if isinstance(data, Unset):
164
+ return data
165
+ try:
166
+ if not isinstance(data, str):
167
+ raise TypeError()
168
+ created_at_type_0 = isoparse(data)
169
+
170
+
171
+
172
+ return created_at_type_0
173
+ except: # noqa: E722
174
+ pass
175
+ return cast(Union[None, Unset, datetime.datetime], data)
176
+
177
+ created_at = _parse_created_at(d.pop("createdAt", UNSET))
178
+
179
+
180
+ def _parse_updated_at(data: object) -> Union[None, Unset, datetime.datetime]:
181
+ if data is None:
182
+ return data
183
+ if isinstance(data, Unset):
184
+ return data
185
+ try:
186
+ if not isinstance(data, str):
187
+ raise TypeError()
188
+ updated_at_type_0 = isoparse(data)
189
+
190
+
191
+
192
+ return updated_at_type_0
193
+ except: # noqa: E722
194
+ pass
195
+ return cast(Union[None, Unset, datetime.datetime], data)
196
+
197
+ updated_at = _parse_updated_at(d.pop("updatedAt", UNSET))
198
+
199
+
200
+ organization_ids = cast(list[str], d.pop("organizationIds", UNSET))
201
+
202
+
203
+ user_dto = cls(
204
+ id=id,
205
+ email=email,
206
+ first_name=first_name,
207
+ last_name=last_name,
208
+ profile_picture_url=profile_picture_url,
209
+ created_at=created_at,
210
+ updated_at=updated_at,
211
+ organization_ids=organization_ids,
212
+ )
213
+
214
+ return user_dto
215
+