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,148 @@
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 cast, Union
12
+ from typing import Union
13
+
14
+
15
+
16
+
17
+
18
+
19
+ T = TypeVar("T", bound="UpdateGroupCommand")
20
+
21
+
22
+
23
+ @_attrs_define
24
+ class UpdateGroupCommand:
25
+ """
26
+ Attributes:
27
+ group_id (Union[Unset, str]):
28
+ name (Union[None, Unset, str]):
29
+ user_ids (Union[None, Unset, list[str]]):
30
+ mini_ids (Union[None, Unset, list[int]]):
31
+ """
32
+
33
+ group_id: Union[Unset, str] = UNSET
34
+ name: Union[None, Unset, str] = UNSET
35
+ user_ids: Union[None, Unset, list[str]] = UNSET
36
+ mini_ids: Union[None, Unset, list[int]] = UNSET
37
+
38
+
39
+
40
+
41
+
42
+ def to_dict(self) -> dict[str, Any]:
43
+ group_id = self.group_id
44
+
45
+ name: Union[None, Unset, str]
46
+ if isinstance(self.name, Unset):
47
+ name = UNSET
48
+ else:
49
+ name = self.name
50
+
51
+ user_ids: Union[None, Unset, list[str]]
52
+ if isinstance(self.user_ids, Unset):
53
+ user_ids = UNSET
54
+ elif isinstance(self.user_ids, list):
55
+ user_ids = self.user_ids
56
+
57
+
58
+ else:
59
+ user_ids = self.user_ids
60
+
61
+ mini_ids: Union[None, Unset, list[int]]
62
+ if isinstance(self.mini_ids, Unset):
63
+ mini_ids = UNSET
64
+ elif isinstance(self.mini_ids, list):
65
+ mini_ids = self.mini_ids
66
+
67
+
68
+ else:
69
+ mini_ids = self.mini_ids
70
+
71
+
72
+ field_dict: dict[str, Any] = {}
73
+
74
+ field_dict.update({
75
+ })
76
+ if group_id is not UNSET:
77
+ field_dict["groupId"] = group_id
78
+ if name is not UNSET:
79
+ field_dict["name"] = name
80
+ if user_ids is not UNSET:
81
+ field_dict["userIds"] = user_ids
82
+ if mini_ids is not UNSET:
83
+ field_dict["miniIds"] = mini_ids
84
+
85
+ return field_dict
86
+
87
+
88
+
89
+ @classmethod
90
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
91
+ d = dict(src_dict)
92
+ group_id = d.pop("groupId", UNSET)
93
+
94
+ def _parse_name(data: object) -> Union[None, Unset, str]:
95
+ if data is None:
96
+ return data
97
+ if isinstance(data, Unset):
98
+ return data
99
+ return cast(Union[None, Unset, str], data)
100
+
101
+ name = _parse_name(d.pop("name", UNSET))
102
+
103
+
104
+ def _parse_user_ids(data: object) -> Union[None, Unset, list[str]]:
105
+ if data is None:
106
+ return data
107
+ if isinstance(data, Unset):
108
+ return data
109
+ try:
110
+ if not isinstance(data, list):
111
+ raise TypeError()
112
+ user_ids_type_0 = cast(list[str], data)
113
+
114
+ return user_ids_type_0
115
+ except: # noqa: E722
116
+ pass
117
+ return cast(Union[None, Unset, list[str]], data)
118
+
119
+ user_ids = _parse_user_ids(d.pop("userIds", UNSET))
120
+
121
+
122
+ def _parse_mini_ids(data: object) -> Union[None, Unset, list[int]]:
123
+ if data is None:
124
+ return data
125
+ if isinstance(data, Unset):
126
+ return data
127
+ try:
128
+ if not isinstance(data, list):
129
+ raise TypeError()
130
+ mini_ids_type_0 = cast(list[int], data)
131
+
132
+ return mini_ids_type_0
133
+ except: # noqa: E722
134
+ pass
135
+ return cast(Union[None, Unset, list[int]], data)
136
+
137
+ mini_ids = _parse_mini_ids(d.pop("miniIds", UNSET))
138
+
139
+
140
+ update_group_command = cls(
141
+ group_id=group_id,
142
+ name=name,
143
+ user_ids=user_ids,
144
+ mini_ids=mini_ids,
145
+ )
146
+
147
+ return update_group_command
148
+
@@ -0,0 +1,153 @@
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, Union
11
+ from typing import Union
12
+
13
+
14
+
15
+
16
+
17
+
18
+ T = TypeVar("T", bound="UpdateMiniCommand")
19
+
20
+
21
+
22
+ @_attrs_define
23
+ class UpdateMiniCommand:
24
+ """
25
+ Attributes:
26
+ id (Union[Unset, int]):
27
+ name (Union[Unset, str]):
28
+ description (Union[None, Unset, str]):
29
+ template_id (Union[None, Unset, str]):
30
+ external_id (Union[None, Unset, str]):
31
+ external_source (Union[None, Unset, str]):
32
+ """
33
+
34
+ id: Union[Unset, int] = UNSET
35
+ name: Union[Unset, str] = UNSET
36
+ description: Union[None, Unset, str] = UNSET
37
+ template_id: Union[None, Unset, str] = UNSET
38
+ external_id: Union[None, Unset, str] = UNSET
39
+ external_source: Union[None, Unset, str] = UNSET
40
+
41
+
42
+
43
+
44
+
45
+ def to_dict(self) -> dict[str, Any]:
46
+ id = self.id
47
+
48
+ name = self.name
49
+
50
+ description: Union[None, Unset, str]
51
+ if isinstance(self.description, Unset):
52
+ description = UNSET
53
+ else:
54
+ description = self.description
55
+
56
+ template_id: Union[None, Unset, str]
57
+ if isinstance(self.template_id, Unset):
58
+ template_id = UNSET
59
+ else:
60
+ template_id = self.template_id
61
+
62
+ external_id: Union[None, Unset, str]
63
+ if isinstance(self.external_id, Unset):
64
+ external_id = UNSET
65
+ else:
66
+ external_id = self.external_id
67
+
68
+ external_source: Union[None, Unset, str]
69
+ if isinstance(self.external_source, Unset):
70
+ external_source = UNSET
71
+ else:
72
+ external_source = self.external_source
73
+
74
+
75
+ field_dict: dict[str, Any] = {}
76
+
77
+ field_dict.update({
78
+ })
79
+ if id is not UNSET:
80
+ field_dict["id"] = id
81
+ if name is not UNSET:
82
+ field_dict["name"] = name
83
+ if description is not UNSET:
84
+ field_dict["description"] = description
85
+ if template_id is not UNSET:
86
+ field_dict["templateId"] = template_id
87
+ if external_id is not UNSET:
88
+ field_dict["externalId"] = external_id
89
+ if external_source is not UNSET:
90
+ field_dict["externalSource"] = external_source
91
+
92
+ return field_dict
93
+
94
+
95
+
96
+ @classmethod
97
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
98
+ d = dict(src_dict)
99
+ id = d.pop("id", UNSET)
100
+
101
+ name = d.pop("name", UNSET)
102
+
103
+ def _parse_description(data: object) -> Union[None, Unset, str]:
104
+ if data is None:
105
+ return data
106
+ if isinstance(data, Unset):
107
+ return data
108
+ return cast(Union[None, Unset, str], data)
109
+
110
+ description = _parse_description(d.pop("description", UNSET))
111
+
112
+
113
+ def _parse_template_id(data: object) -> Union[None, Unset, str]:
114
+ if data is None:
115
+ return data
116
+ if isinstance(data, Unset):
117
+ return data
118
+ return cast(Union[None, Unset, str], data)
119
+
120
+ template_id = _parse_template_id(d.pop("templateId", UNSET))
121
+
122
+
123
+ def _parse_external_id(data: object) -> Union[None, Unset, str]:
124
+ if data is None:
125
+ return data
126
+ if isinstance(data, Unset):
127
+ return data
128
+ return cast(Union[None, Unset, str], data)
129
+
130
+ external_id = _parse_external_id(d.pop("externalId", UNSET))
131
+
132
+
133
+ def _parse_external_source(data: object) -> Union[None, Unset, str]:
134
+ if data is None:
135
+ return data
136
+ if isinstance(data, Unset):
137
+ return data
138
+ return cast(Union[None, Unset, str], data)
139
+
140
+ external_source = _parse_external_source(d.pop("externalSource", UNSET))
141
+
142
+
143
+ update_mini_command = cls(
144
+ id=id,
145
+ name=name,
146
+ description=description,
147
+ template_id=template_id,
148
+ external_id=external_id,
149
+ external_source=external_source,
150
+ )
151
+
152
+ return update_mini_command
153
+
@@ -0,0 +1,74 @@
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
+
14
+
15
+
16
+
17
+
18
+ T = TypeVar("T", bound="UpdateMiniTemplateWorkspacesCommand")
19
+
20
+
21
+
22
+ @_attrs_define
23
+ class UpdateMiniTemplateWorkspacesCommand:
24
+ """
25
+ Attributes:
26
+ mini_template_id (Union[Unset, str]):
27
+ workspace_ids (Union[Unset, list[str]]):
28
+ """
29
+
30
+ mini_template_id: Union[Unset, str] = UNSET
31
+ workspace_ids: Union[Unset, list[str]] = UNSET
32
+
33
+
34
+
35
+
36
+
37
+ def to_dict(self) -> dict[str, Any]:
38
+ mini_template_id = self.mini_template_id
39
+
40
+ workspace_ids: Union[Unset, list[str]] = UNSET
41
+ if not isinstance(self.workspace_ids, Unset):
42
+ workspace_ids = self.workspace_ids
43
+
44
+
45
+
46
+
47
+ field_dict: dict[str, Any] = {}
48
+
49
+ field_dict.update({
50
+ })
51
+ if mini_template_id is not UNSET:
52
+ field_dict["miniTemplateId"] = mini_template_id
53
+ if workspace_ids is not UNSET:
54
+ field_dict["workspaceIds"] = workspace_ids
55
+
56
+ return field_dict
57
+
58
+
59
+
60
+ @classmethod
61
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
62
+ d = dict(src_dict)
63
+ mini_template_id = d.pop("miniTemplateId", UNSET)
64
+
65
+ workspace_ids = cast(list[str], d.pop("workspaceIds", UNSET))
66
+
67
+
68
+ update_mini_template_workspaces_command = cls(
69
+ mini_template_id=mini_template_id,
70
+ workspace_ids=workspace_ids,
71
+ )
72
+
73
+ return update_mini_template_workspaces_command
74
+
@@ -0,0 +1,274 @@
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
+ if TYPE_CHECKING:
17
+ from ..models.record_relation_dto import RecordRelationDto
18
+ from ..models.record_authorization_dto import RecordAuthorizationDto
19
+ from ..models.update_record_command_tags import UpdateRecordCommandTags
20
+
21
+
22
+
23
+
24
+
25
+ T = TypeVar("T", bound="UpdateRecordCommand")
26
+
27
+
28
+
29
+ @_attrs_define
30
+ class UpdateRecordCommand:
31
+ """
32
+ Attributes:
33
+ id (Union[Unset, str]):
34
+ title (Union[Unset, str]):
35
+ description (Union[None, Unset, str]):
36
+ event_date (Union[None, Unset, datetime.datetime]):
37
+ schema (Union[Unset, Any]):
38
+ content (Union[Unset, Any]):
39
+ relations (Union[Unset, list['RecordRelationDto']]):
40
+ external_uri (Union[None, Unset, str]):
41
+ labels (Union[Unset, list[str]]):
42
+ tags (Union[Unset, UpdateRecordCommandTags]):
43
+ authorization (Union['RecordAuthorizationDto', None, Unset]):
44
+ archived (Union[Unset, bool]):
45
+ """
46
+
47
+ id: Union[Unset, str] = UNSET
48
+ title: Union[Unset, str] = UNSET
49
+ description: Union[None, Unset, str] = UNSET
50
+ event_date: Union[None, Unset, datetime.datetime] = UNSET
51
+ schema: Union[Unset, Any] = UNSET
52
+ content: Union[Unset, Any] = UNSET
53
+ relations: Union[Unset, list['RecordRelationDto']] = UNSET
54
+ external_uri: Union[None, Unset, str] = UNSET
55
+ labels: Union[Unset, list[str]] = UNSET
56
+ tags: Union[Unset, 'UpdateRecordCommandTags'] = UNSET
57
+ authorization: Union['RecordAuthorizationDto', None, Unset] = UNSET
58
+ archived: Union[Unset, bool] = UNSET
59
+
60
+
61
+
62
+
63
+
64
+ def to_dict(self) -> dict[str, Any]:
65
+ from ..models.record_relation_dto import RecordRelationDto
66
+ from ..models.record_authorization_dto import RecordAuthorizationDto
67
+ from ..models.update_record_command_tags import UpdateRecordCommandTags
68
+ id = self.id
69
+
70
+ title = self.title
71
+
72
+ description: Union[None, Unset, str]
73
+ if isinstance(self.description, Unset):
74
+ description = UNSET
75
+ else:
76
+ description = self.description
77
+
78
+ event_date: Union[None, Unset, str]
79
+ if isinstance(self.event_date, Unset):
80
+ event_date = UNSET
81
+ elif isinstance(self.event_date, datetime.datetime):
82
+ event_date = self.event_date.isoformat()
83
+ else:
84
+ event_date = self.event_date
85
+
86
+ schema = self.schema
87
+
88
+ content = self.content
89
+
90
+ relations: Union[Unset, list[dict[str, Any]]] = UNSET
91
+ if not isinstance(self.relations, Unset):
92
+ relations = []
93
+ for relations_item_data in self.relations:
94
+ relations_item = relations_item_data.to_dict()
95
+ relations.append(relations_item)
96
+
97
+
98
+
99
+ external_uri: Union[None, Unset, str]
100
+ if isinstance(self.external_uri, Unset):
101
+ external_uri = UNSET
102
+ else:
103
+ external_uri = self.external_uri
104
+
105
+ labels: Union[Unset, list[str]] = UNSET
106
+ if not isinstance(self.labels, Unset):
107
+ labels = self.labels
108
+
109
+
110
+
111
+ tags: Union[Unset, dict[str, Any]] = UNSET
112
+ if not isinstance(self.tags, Unset):
113
+ tags = self.tags.to_dict()
114
+
115
+ authorization: Union[None, Unset, dict[str, Any]]
116
+ if isinstance(self.authorization, Unset):
117
+ authorization = UNSET
118
+ elif isinstance(self.authorization, RecordAuthorizationDto):
119
+ authorization = self.authorization.to_dict()
120
+ else:
121
+ authorization = self.authorization
122
+
123
+ archived = self.archived
124
+
125
+
126
+ field_dict: dict[str, Any] = {}
127
+
128
+ field_dict.update({
129
+ })
130
+ if id is not UNSET:
131
+ field_dict["id"] = id
132
+ if title is not UNSET:
133
+ field_dict["title"] = title
134
+ if description is not UNSET:
135
+ field_dict["description"] = description
136
+ if event_date is not UNSET:
137
+ field_dict["eventDate"] = event_date
138
+ if schema is not UNSET:
139
+ field_dict["schema"] = schema
140
+ if content is not UNSET:
141
+ field_dict["content"] = content
142
+ if relations is not UNSET:
143
+ field_dict["relations"] = relations
144
+ if external_uri is not UNSET:
145
+ field_dict["externalUri"] = external_uri
146
+ if labels is not UNSET:
147
+ field_dict["labels"] = labels
148
+ if tags is not UNSET:
149
+ field_dict["tags"] = tags
150
+ if authorization is not UNSET:
151
+ field_dict["authorization"] = authorization
152
+ if archived is not UNSET:
153
+ field_dict["archived"] = archived
154
+
155
+ return field_dict
156
+
157
+
158
+
159
+ @classmethod
160
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
161
+ from ..models.record_relation_dto import RecordRelationDto
162
+ from ..models.record_authorization_dto import RecordAuthorizationDto
163
+ from ..models.update_record_command_tags import UpdateRecordCommandTags
164
+ d = dict(src_dict)
165
+ id = d.pop("id", UNSET)
166
+
167
+ title = d.pop("title", UNSET)
168
+
169
+ def _parse_description(data: object) -> Union[None, Unset, str]:
170
+ if data is None:
171
+ return data
172
+ if isinstance(data, Unset):
173
+ return data
174
+ return cast(Union[None, Unset, str], data)
175
+
176
+ description = _parse_description(d.pop("description", UNSET))
177
+
178
+
179
+ def _parse_event_date(data: object) -> Union[None, Unset, datetime.datetime]:
180
+ if data is None:
181
+ return data
182
+ if isinstance(data, Unset):
183
+ return data
184
+ try:
185
+ if not isinstance(data, str):
186
+ raise TypeError()
187
+ event_date_type_0 = isoparse(data)
188
+
189
+
190
+
191
+ return event_date_type_0
192
+ except: # noqa: E722
193
+ pass
194
+ return cast(Union[None, Unset, datetime.datetime], data)
195
+
196
+ event_date = _parse_event_date(d.pop("eventDate", UNSET))
197
+
198
+
199
+ schema = d.pop("schema", UNSET)
200
+
201
+ content = d.pop("content", UNSET)
202
+
203
+ relations = []
204
+ _relations = d.pop("relations", UNSET)
205
+ for relations_item_data in (_relations or []):
206
+ relations_item = RecordRelationDto.from_dict(relations_item_data)
207
+
208
+
209
+
210
+ relations.append(relations_item)
211
+
212
+
213
+ def _parse_external_uri(data: object) -> Union[None, Unset, str]:
214
+ if data is None:
215
+ return data
216
+ if isinstance(data, Unset):
217
+ return data
218
+ return cast(Union[None, Unset, str], data)
219
+
220
+ external_uri = _parse_external_uri(d.pop("externalUri", UNSET))
221
+
222
+
223
+ labels = cast(list[str], d.pop("labels", UNSET))
224
+
225
+
226
+ _tags = d.pop("tags", UNSET)
227
+ tags: Union[Unset, UpdateRecordCommandTags]
228
+ if isinstance(_tags, Unset):
229
+ tags = UNSET
230
+ else:
231
+ tags = UpdateRecordCommandTags.from_dict(_tags)
232
+
233
+
234
+
235
+
236
+ def _parse_authorization(data: object) -> Union['RecordAuthorizationDto', None, Unset]:
237
+ if data is None:
238
+ return data
239
+ if isinstance(data, Unset):
240
+ return data
241
+ try:
242
+ if not isinstance(data, dict):
243
+ raise TypeError()
244
+ authorization_type_0 = RecordAuthorizationDto.from_dict(data)
245
+
246
+
247
+
248
+ return authorization_type_0
249
+ except: # noqa: E722
250
+ pass
251
+ return cast(Union['RecordAuthorizationDto', None, Unset], data)
252
+
253
+ authorization = _parse_authorization(d.pop("authorization", UNSET))
254
+
255
+
256
+ archived = d.pop("archived", UNSET)
257
+
258
+ update_record_command = cls(
259
+ id=id,
260
+ title=title,
261
+ description=description,
262
+ event_date=event_date,
263
+ schema=schema,
264
+ content=content,
265
+ relations=relations,
266
+ external_uri=external_uri,
267
+ labels=labels,
268
+ tags=tags,
269
+ authorization=authorization,
270
+ archived=archived,
271
+ )
272
+
273
+ return update_record_command
274
+
@@ -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="UpdateRecordCommandTags")
16
+
17
+
18
+
19
+ @_attrs_define
20
+ class UpdateRecordCommandTags:
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
+ update_record_command_tags = cls(
43
+ )
44
+
45
+
46
+ update_record_command_tags.additional_properties = d
47
+ return update_record_command_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