minikai 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.

Potentially problematic release.


This version of minikai might be problematic. Click here for more details.

Files changed (87) 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 +176 -0
  5. minikai/api/groups/add_users_to_group.py +176 -0
  6. minikai/api/groups/create_group.py +160 -0
  7. minikai/api/groups/delete_group.py +95 -0
  8. minikai/api/groups/get_group.py +151 -0
  9. minikai/api/groups/get_group_minis.py +156 -0
  10. minikai/api/groups/get_group_users.py +156 -0
  11. minikai/api/groups/get_groups.py +128 -0
  12. minikai/api/groups/remove_minis_from_group.py +176 -0
  13. minikai/api/groups/remove_users_from_group.py +176 -0
  14. minikai/api/groups/update_group.py +177 -0
  15. minikai/api/minis/__init__.py +1 -0
  16. minikai/api/minis/create_mini.py +160 -0
  17. minikai/api/minis/delete_mini.py +95 -0
  18. minikai/api/minis/get_external_mini.py +164 -0
  19. minikai/api/minis/get_minis.py +128 -0
  20. minikai/api/minis/patch_mini.py +177 -0
  21. minikai/api/minis/update_mini.py +177 -0
  22. minikai/api/records/__init__.py +1 -0
  23. minikai/api/records/add_attachments.py +182 -0
  24. minikai/api/records/add_relations.py +187 -0
  25. minikai/api/records/create_record.py +162 -0
  26. minikai/api/records/delete_record.py +95 -0
  27. minikai/api/records/get_records_by_external.py +230 -0
  28. minikai/api/records/remove_attachments.py +110 -0
  29. minikai/api/records/remove_relations.py +110 -0
  30. minikai/api/records/update_attachments.py +182 -0
  31. minikai/api/records/update_record.py +179 -0
  32. minikai/api/records/update_relations.py +187 -0
  33. minikai/api/users/__init__.py +1 -0
  34. minikai/api/users/delete_api_users_minis.py +102 -0
  35. minikai/api/users/get_api_users_minis.py +156 -0
  36. minikai/api/users/get_users.py +128 -0
  37. minikai/api/users/post_api_users_minis.py +168 -0
  38. minikai/client.py +268 -0
  39. minikai/errors.py +16 -0
  40. minikai/models/__init__.py +89 -0
  41. minikai/models/add_attachments_body.py +98 -0
  42. minikai/models/create_group_command.py +102 -0
  43. minikai/models/create_mini_command.py +120 -0
  44. minikai/models/create_record_command.py +268 -0
  45. minikai/models/create_record_command_tags.py +44 -0
  46. minikai/models/document_file_dto.py +147 -0
  47. minikai/models/form_field.py +112 -0
  48. minikai/models/form_field_dto.py +149 -0
  49. minikai/models/form_field_type.py +16 -0
  50. minikai/models/group_dto.py +124 -0
  51. minikai/models/http_validation_problem_details.py +173 -0
  52. minikai/models/http_validation_problem_details_errors.py +51 -0
  53. minikai/models/json_node.py +119 -0
  54. minikai/models/json_node_options.py +42 -0
  55. minikai/models/mini_dto.py +189 -0
  56. minikai/models/mini_template_dto.py +135 -0
  57. minikai/models/paginated_list_of_record_dto.py +101 -0
  58. minikai/models/patch_mini_command.py +80 -0
  59. minikai/models/problem_details.py +151 -0
  60. minikai/models/record.py +379 -0
  61. minikai/models/record_attachment.py +236 -0
  62. minikai/models/record_attachment_dto.py +236 -0
  63. minikai/models/record_attachment_dto_metadata_type_0.py +44 -0
  64. minikai/models/record_attachment_metadata_type_0.py +44 -0
  65. minikai/models/record_authorization.py +75 -0
  66. minikai/models/record_authorization_dto.py +75 -0
  67. minikai/models/record_dto.py +377 -0
  68. minikai/models/record_dto_tags.py +44 -0
  69. minikai/models/record_relation.py +81 -0
  70. minikai/models/record_relation_dto.py +81 -0
  71. minikai/models/record_tags.py +44 -0
  72. minikai/models/slim_mini_dto.py +168 -0
  73. minikai/models/tool_dto.py +76 -0
  74. minikai/models/update_attachments_body.py +98 -0
  75. minikai/models/update_group_command.py +122 -0
  76. minikai/models/update_mini_command.py +129 -0
  77. minikai/models/update_mini_template_workspaces_command.py +51 -0
  78. minikai/models/update_record_command.py +266 -0
  79. minikai/models/update_record_command_tags.py +44 -0
  80. minikai/models/user_dto.py +182 -0
  81. minikai/models/user_to_mini_dto.py +78 -0
  82. minikai/models/workspace_dto.py +78 -0
  83. minikai/py.typed +1 -0
  84. minikai/types.py +54 -0
  85. minikai-0.1.0.dist-info/METADATA +133 -0
  86. minikai-0.1.0.dist-info/RECORD +87 -0
  87. minikai-0.1.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,95 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...types import Response
9
+
10
+
11
+ def _get_kwargs(
12
+ record_id: str,
13
+ ) -> dict[str, Any]:
14
+ _kwargs: dict[str, Any] = {
15
+ "method": "delete",
16
+ "url": f"/api/Records/{record_id}",
17
+ }
18
+
19
+ return _kwargs
20
+
21
+
22
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
23
+ if response.status_code == 204:
24
+ return None
25
+
26
+ if response.status_code == 404:
27
+ return None
28
+
29
+ if client.raise_on_unexpected_status:
30
+ raise errors.UnexpectedStatus(response.status_code, response.content)
31
+ else:
32
+ return None
33
+
34
+
35
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
36
+ return Response(
37
+ status_code=HTTPStatus(response.status_code),
38
+ content=response.content,
39
+ headers=response.headers,
40
+ parsed=_parse_response(client=client, response=response),
41
+ )
42
+
43
+
44
+ def sync_detailed(
45
+ record_id: str,
46
+ *,
47
+ client: Union[AuthenticatedClient, Client],
48
+ ) -> Response[Any]:
49
+ """
50
+ Args:
51
+ record_id (str):
52
+
53
+ Raises:
54
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
55
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
56
+
57
+ Returns:
58
+ Response[Any]
59
+ """
60
+
61
+ kwargs = _get_kwargs(
62
+ record_id=record_id,
63
+ )
64
+
65
+ response = client.get_httpx_client().request(
66
+ **kwargs,
67
+ )
68
+
69
+ return _build_response(client=client, response=response)
70
+
71
+
72
+ async def asyncio_detailed(
73
+ record_id: str,
74
+ *,
75
+ client: Union[AuthenticatedClient, Client],
76
+ ) -> Response[Any]:
77
+ """
78
+ Args:
79
+ record_id (str):
80
+
81
+ Raises:
82
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
83
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
84
+
85
+ Returns:
86
+ Response[Any]
87
+ """
88
+
89
+ kwargs = _get_kwargs(
90
+ record_id=record_id,
91
+ )
92
+
93
+ response = await client.get_async_httpx_client().request(**kwargs)
94
+
95
+ return _build_response(client=client, response=response)
@@ -0,0 +1,230 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.paginated_list_of_record_dto import PaginatedListOfRecordDto
9
+ from ...types import UNSET, Response, Unset
10
+
11
+
12
+ def _get_kwargs(
13
+ *,
14
+ body: list[str],
15
+ mini_id: Union[None, Unset, str] = UNSET,
16
+ session_id: Union[None, Unset, str] = UNSET,
17
+ page_number: Union[Unset, int] = 1,
18
+ page_size: Union[Unset, int] = 10,
19
+ ) -> dict[str, Any]:
20
+ headers: dict[str, Any] = {}
21
+
22
+ params: dict[str, Any] = {}
23
+
24
+ json_mini_id: Union[None, Unset, str]
25
+ if isinstance(mini_id, Unset):
26
+ json_mini_id = UNSET
27
+ else:
28
+ json_mini_id = mini_id
29
+ params["miniId"] = json_mini_id
30
+
31
+ json_session_id: Union[None, Unset, str]
32
+ if isinstance(session_id, Unset):
33
+ json_session_id = UNSET
34
+ else:
35
+ json_session_id = session_id
36
+ params["sessionId"] = json_session_id
37
+
38
+ params["pageNumber"] = page_number
39
+
40
+ params["pageSize"] = page_size
41
+
42
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
43
+
44
+ _kwargs: dict[str, Any] = {
45
+ "method": "post",
46
+ "url": "/api/Records/external",
47
+ "params": params,
48
+ }
49
+
50
+ _kwargs["json"] = body
51
+
52
+ headers["Content-Type"] = "application/json"
53
+
54
+ _kwargs["headers"] = headers
55
+ return _kwargs
56
+
57
+
58
+ def _parse_response(
59
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
60
+ ) -> Optional[PaginatedListOfRecordDto]:
61
+ if response.status_code == 200:
62
+ response_200 = PaginatedListOfRecordDto.from_dict(response.json())
63
+
64
+ return response_200
65
+
66
+ if client.raise_on_unexpected_status:
67
+ raise errors.UnexpectedStatus(response.status_code, response.content)
68
+ else:
69
+ return None
70
+
71
+
72
+ def _build_response(
73
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
74
+ ) -> Response[PaginatedListOfRecordDto]:
75
+ return Response(
76
+ status_code=HTTPStatus(response.status_code),
77
+ content=response.content,
78
+ headers=response.headers,
79
+ parsed=_parse_response(client=client, response=response),
80
+ )
81
+
82
+
83
+ def sync_detailed(
84
+ *,
85
+ client: Union[AuthenticatedClient, Client],
86
+ body: list[str],
87
+ mini_id: Union[None, Unset, str] = UNSET,
88
+ session_id: Union[None, Unset, str] = UNSET,
89
+ page_number: Union[Unset, int] = 1,
90
+ page_size: Union[Unset, int] = 10,
91
+ ) -> Response[PaginatedListOfRecordDto]:
92
+ """
93
+ Args:
94
+ mini_id (Union[None, Unset, str]):
95
+ session_id (Union[None, Unset, str]):
96
+ page_number (Union[Unset, int]): Default: 1.
97
+ page_size (Union[Unset, int]): Default: 10.
98
+ body (list[str]):
99
+
100
+ Raises:
101
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
102
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
103
+
104
+ Returns:
105
+ Response[PaginatedListOfRecordDto]
106
+ """
107
+
108
+ kwargs = _get_kwargs(
109
+ body=body,
110
+ mini_id=mini_id,
111
+ session_id=session_id,
112
+ page_number=page_number,
113
+ page_size=page_size,
114
+ )
115
+
116
+ response = client.get_httpx_client().request(
117
+ **kwargs,
118
+ )
119
+
120
+ return _build_response(client=client, response=response)
121
+
122
+
123
+ def sync(
124
+ *,
125
+ client: Union[AuthenticatedClient, Client],
126
+ body: list[str],
127
+ mini_id: Union[None, Unset, str] = UNSET,
128
+ session_id: Union[None, Unset, str] = UNSET,
129
+ page_number: Union[Unset, int] = 1,
130
+ page_size: Union[Unset, int] = 10,
131
+ ) -> Optional[PaginatedListOfRecordDto]:
132
+ """
133
+ Args:
134
+ mini_id (Union[None, Unset, str]):
135
+ session_id (Union[None, Unset, str]):
136
+ page_number (Union[Unset, int]): Default: 1.
137
+ page_size (Union[Unset, int]): Default: 10.
138
+ body (list[str]):
139
+
140
+ Raises:
141
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
142
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
143
+
144
+ Returns:
145
+ PaginatedListOfRecordDto
146
+ """
147
+
148
+ return sync_detailed(
149
+ client=client,
150
+ body=body,
151
+ mini_id=mini_id,
152
+ session_id=session_id,
153
+ page_number=page_number,
154
+ page_size=page_size,
155
+ ).parsed
156
+
157
+
158
+ async def asyncio_detailed(
159
+ *,
160
+ client: Union[AuthenticatedClient, Client],
161
+ body: list[str],
162
+ mini_id: Union[None, Unset, str] = UNSET,
163
+ session_id: Union[None, Unset, str] = UNSET,
164
+ page_number: Union[Unset, int] = 1,
165
+ page_size: Union[Unset, int] = 10,
166
+ ) -> Response[PaginatedListOfRecordDto]:
167
+ """
168
+ Args:
169
+ mini_id (Union[None, Unset, str]):
170
+ session_id (Union[None, Unset, str]):
171
+ page_number (Union[Unset, int]): Default: 1.
172
+ page_size (Union[Unset, int]): Default: 10.
173
+ body (list[str]):
174
+
175
+ Raises:
176
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
177
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
178
+
179
+ Returns:
180
+ Response[PaginatedListOfRecordDto]
181
+ """
182
+
183
+ kwargs = _get_kwargs(
184
+ body=body,
185
+ mini_id=mini_id,
186
+ session_id=session_id,
187
+ page_number=page_number,
188
+ page_size=page_size,
189
+ )
190
+
191
+ response = await client.get_async_httpx_client().request(**kwargs)
192
+
193
+ return _build_response(client=client, response=response)
194
+
195
+
196
+ async def asyncio(
197
+ *,
198
+ client: Union[AuthenticatedClient, Client],
199
+ body: list[str],
200
+ mini_id: Union[None, Unset, str] = UNSET,
201
+ session_id: Union[None, Unset, str] = UNSET,
202
+ page_number: Union[Unset, int] = 1,
203
+ page_size: Union[Unset, int] = 10,
204
+ ) -> Optional[PaginatedListOfRecordDto]:
205
+ """
206
+ Args:
207
+ mini_id (Union[None, Unset, str]):
208
+ session_id (Union[None, Unset, str]):
209
+ page_number (Union[Unset, int]): Default: 1.
210
+ page_size (Union[Unset, int]): Default: 10.
211
+ body (list[str]):
212
+
213
+ Raises:
214
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
215
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
216
+
217
+ Returns:
218
+ PaginatedListOfRecordDto
219
+ """
220
+
221
+ return (
222
+ await asyncio_detailed(
223
+ client=client,
224
+ body=body,
225
+ mini_id=mini_id,
226
+ session_id=session_id,
227
+ page_number=page_number,
228
+ page_size=page_size,
229
+ )
230
+ ).parsed
@@ -0,0 +1,110 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...types import Response
9
+
10
+
11
+ def _get_kwargs(
12
+ record_id: str,
13
+ *,
14
+ body: list[str],
15
+ ) -> dict[str, Any]:
16
+ headers: dict[str, Any] = {}
17
+
18
+ _kwargs: dict[str, Any] = {
19
+ "method": "delete",
20
+ "url": f"/api/Records/{record_id}/attachments",
21
+ }
22
+
23
+ _kwargs["json"] = body
24
+
25
+ headers["Content-Type"] = "application/json"
26
+
27
+ _kwargs["headers"] = headers
28
+ return _kwargs
29
+
30
+
31
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
32
+ if response.status_code == 204:
33
+ return None
34
+
35
+ if response.status_code == 404:
36
+ return None
37
+
38
+ if client.raise_on_unexpected_status:
39
+ raise errors.UnexpectedStatus(response.status_code, response.content)
40
+ else:
41
+ return None
42
+
43
+
44
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
45
+ return Response(
46
+ status_code=HTTPStatus(response.status_code),
47
+ content=response.content,
48
+ headers=response.headers,
49
+ parsed=_parse_response(client=client, response=response),
50
+ )
51
+
52
+
53
+ def sync_detailed(
54
+ record_id: str,
55
+ *,
56
+ client: Union[AuthenticatedClient, Client],
57
+ body: list[str],
58
+ ) -> Response[Any]:
59
+ """
60
+ Args:
61
+ record_id (str):
62
+ body (list[str]):
63
+
64
+ Raises:
65
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
66
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
67
+
68
+ Returns:
69
+ Response[Any]
70
+ """
71
+
72
+ kwargs = _get_kwargs(
73
+ record_id=record_id,
74
+ body=body,
75
+ )
76
+
77
+ response = client.get_httpx_client().request(
78
+ **kwargs,
79
+ )
80
+
81
+ return _build_response(client=client, response=response)
82
+
83
+
84
+ async def asyncio_detailed(
85
+ record_id: str,
86
+ *,
87
+ client: Union[AuthenticatedClient, Client],
88
+ body: list[str],
89
+ ) -> Response[Any]:
90
+ """
91
+ Args:
92
+ record_id (str):
93
+ body (list[str]):
94
+
95
+ Raises:
96
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
97
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
98
+
99
+ Returns:
100
+ Response[Any]
101
+ """
102
+
103
+ kwargs = _get_kwargs(
104
+ record_id=record_id,
105
+ body=body,
106
+ )
107
+
108
+ response = await client.get_async_httpx_client().request(**kwargs)
109
+
110
+ return _build_response(client=client, response=response)
@@ -0,0 +1,110 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...types import Response
9
+
10
+
11
+ def _get_kwargs(
12
+ record_id: str,
13
+ *,
14
+ body: list[str],
15
+ ) -> dict[str, Any]:
16
+ headers: dict[str, Any] = {}
17
+
18
+ _kwargs: dict[str, Any] = {
19
+ "method": "delete",
20
+ "url": f"/api/Records/{record_id}/relations",
21
+ }
22
+
23
+ _kwargs["json"] = body
24
+
25
+ headers["Content-Type"] = "application/json"
26
+
27
+ _kwargs["headers"] = headers
28
+ return _kwargs
29
+
30
+
31
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
32
+ if response.status_code == 204:
33
+ return None
34
+
35
+ if response.status_code == 404:
36
+ return None
37
+
38
+ if client.raise_on_unexpected_status:
39
+ raise errors.UnexpectedStatus(response.status_code, response.content)
40
+ else:
41
+ return None
42
+
43
+
44
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
45
+ return Response(
46
+ status_code=HTTPStatus(response.status_code),
47
+ content=response.content,
48
+ headers=response.headers,
49
+ parsed=_parse_response(client=client, response=response),
50
+ )
51
+
52
+
53
+ def sync_detailed(
54
+ record_id: str,
55
+ *,
56
+ client: Union[AuthenticatedClient, Client],
57
+ body: list[str],
58
+ ) -> Response[Any]:
59
+ """
60
+ Args:
61
+ record_id (str):
62
+ body (list[str]):
63
+
64
+ Raises:
65
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
66
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
67
+
68
+ Returns:
69
+ Response[Any]
70
+ """
71
+
72
+ kwargs = _get_kwargs(
73
+ record_id=record_id,
74
+ body=body,
75
+ )
76
+
77
+ response = client.get_httpx_client().request(
78
+ **kwargs,
79
+ )
80
+
81
+ return _build_response(client=client, response=response)
82
+
83
+
84
+ async def asyncio_detailed(
85
+ record_id: str,
86
+ *,
87
+ client: Union[AuthenticatedClient, Client],
88
+ body: list[str],
89
+ ) -> Response[Any]:
90
+ """
91
+ Args:
92
+ record_id (str):
93
+ body (list[str]):
94
+
95
+ Raises:
96
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
97
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
98
+
99
+ Returns:
100
+ Response[Any]
101
+ """
102
+
103
+ kwargs = _get_kwargs(
104
+ record_id=record_id,
105
+ body=body,
106
+ )
107
+
108
+ response = await client.get_async_httpx_client().request(**kwargs)
109
+
110
+ return _build_response(client=client, response=response)