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
+ id: int,
13
+ ) -> dict[str, Any]:
14
+ _kwargs: dict[str, Any] = {
15
+ "method": "delete",
16
+ "url": f"/api/Minis/{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
+ id: int,
46
+ *,
47
+ client: Union[AuthenticatedClient, Client],
48
+ ) -> Response[Any]:
49
+ """
50
+ Args:
51
+ id (int):
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
+ id=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
+ id: int,
74
+ *,
75
+ client: Union[AuthenticatedClient, Client],
76
+ ) -> Response[Any]:
77
+ """
78
+ Args:
79
+ id (int):
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
+ id=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,164 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union, cast
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.slim_mini_dto import SlimMiniDto
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ external_source: str,
14
+ external_id: str,
15
+ ) -> dict[str, Any]:
16
+ _kwargs: dict[str, Any] = {
17
+ "method": "get",
18
+ "url": f"/api/Minis/{external_source}/{external_id}",
19
+ }
20
+
21
+ return _kwargs
22
+
23
+
24
+ def _parse_response(
25
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
26
+ ) -> Optional[Union[Any, SlimMiniDto]]:
27
+ if response.status_code == 200:
28
+ response_200 = SlimMiniDto.from_dict(response.json())
29
+
30
+ return response_200
31
+
32
+ if response.status_code == 404:
33
+ response_404 = cast(Any, None)
34
+ return response_404
35
+
36
+ if client.raise_on_unexpected_status:
37
+ raise errors.UnexpectedStatus(response.status_code, response.content)
38
+ else:
39
+ return None
40
+
41
+
42
+ def _build_response(
43
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
44
+ ) -> Response[Union[Any, SlimMiniDto]]:
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
+ external_source: str,
55
+ external_id: str,
56
+ *,
57
+ client: Union[AuthenticatedClient, Client],
58
+ ) -> Response[Union[Any, SlimMiniDto]]:
59
+ """
60
+ Args:
61
+ external_source (str):
62
+ external_id (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[Union[Any, SlimMiniDto]]
70
+ """
71
+
72
+ kwargs = _get_kwargs(
73
+ external_source=external_source,
74
+ external_id=external_id,
75
+ )
76
+
77
+ response = client.get_httpx_client().request(
78
+ **kwargs,
79
+ )
80
+
81
+ return _build_response(client=client, response=response)
82
+
83
+
84
+ def sync(
85
+ external_source: str,
86
+ external_id: str,
87
+ *,
88
+ client: Union[AuthenticatedClient, Client],
89
+ ) -> Optional[Union[Any, SlimMiniDto]]:
90
+ """
91
+ Args:
92
+ external_source (str):
93
+ external_id (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
+ Union[Any, SlimMiniDto]
101
+ """
102
+
103
+ return sync_detailed(
104
+ external_source=external_source,
105
+ external_id=external_id,
106
+ client=client,
107
+ ).parsed
108
+
109
+
110
+ async def asyncio_detailed(
111
+ external_source: str,
112
+ external_id: str,
113
+ *,
114
+ client: Union[AuthenticatedClient, Client],
115
+ ) -> Response[Union[Any, SlimMiniDto]]:
116
+ """
117
+ Args:
118
+ external_source (str):
119
+ external_id (str):
120
+
121
+ Raises:
122
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
123
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
124
+
125
+ Returns:
126
+ Response[Union[Any, SlimMiniDto]]
127
+ """
128
+
129
+ kwargs = _get_kwargs(
130
+ external_source=external_source,
131
+ external_id=external_id,
132
+ )
133
+
134
+ response = await client.get_async_httpx_client().request(**kwargs)
135
+
136
+ return _build_response(client=client, response=response)
137
+
138
+
139
+ async def asyncio(
140
+ external_source: str,
141
+ external_id: str,
142
+ *,
143
+ client: Union[AuthenticatedClient, Client],
144
+ ) -> Optional[Union[Any, SlimMiniDto]]:
145
+ """
146
+ Args:
147
+ external_source (str):
148
+ external_id (str):
149
+
150
+ Raises:
151
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
152
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
153
+
154
+ Returns:
155
+ Union[Any, SlimMiniDto]
156
+ """
157
+
158
+ return (
159
+ await asyncio_detailed(
160
+ external_source=external_source,
161
+ external_id=external_id,
162
+ client=client,
163
+ )
164
+ ).parsed
@@ -0,0 +1,128 @@
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.slim_mini_dto import SlimMiniDto
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs() -> dict[str, Any]:
13
+ _kwargs: dict[str, Any] = {
14
+ "method": "get",
15
+ "url": "/api/Minis",
16
+ }
17
+
18
+ return _kwargs
19
+
20
+
21
+ def _parse_response(
22
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
23
+ ) -> Optional[list["SlimMiniDto"]]:
24
+ if response.status_code == 200:
25
+ response_200 = []
26
+ _response_200 = response.json()
27
+ for response_200_item_data in _response_200:
28
+ response_200_item = SlimMiniDto.from_dict(response_200_item_data)
29
+
30
+ response_200.append(response_200_item)
31
+
32
+ return response_200
33
+
34
+ if client.raise_on_unexpected_status:
35
+ raise errors.UnexpectedStatus(response.status_code, response.content)
36
+ else:
37
+ return None
38
+
39
+
40
+ def _build_response(
41
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
42
+ ) -> Response[list["SlimMiniDto"]]:
43
+ return Response(
44
+ status_code=HTTPStatus(response.status_code),
45
+ content=response.content,
46
+ headers=response.headers,
47
+ parsed=_parse_response(client=client, response=response),
48
+ )
49
+
50
+
51
+ def sync_detailed(
52
+ *,
53
+ client: Union[AuthenticatedClient, Client],
54
+ ) -> Response[list["SlimMiniDto"]]:
55
+ """
56
+ Raises:
57
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
58
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
59
+
60
+ Returns:
61
+ Response[list['SlimMiniDto']]
62
+ """
63
+
64
+ kwargs = _get_kwargs()
65
+
66
+ response = client.get_httpx_client().request(
67
+ **kwargs,
68
+ )
69
+
70
+ return _build_response(client=client, response=response)
71
+
72
+
73
+ def sync(
74
+ *,
75
+ client: Union[AuthenticatedClient, Client],
76
+ ) -> Optional[list["SlimMiniDto"]]:
77
+ """
78
+ Raises:
79
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
80
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
81
+
82
+ Returns:
83
+ list['SlimMiniDto']
84
+ """
85
+
86
+ return sync_detailed(
87
+ client=client,
88
+ ).parsed
89
+
90
+
91
+ async def asyncio_detailed(
92
+ *,
93
+ client: Union[AuthenticatedClient, Client],
94
+ ) -> Response[list["SlimMiniDto"]]:
95
+ """
96
+ Raises:
97
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
98
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
99
+
100
+ Returns:
101
+ Response[list['SlimMiniDto']]
102
+ """
103
+
104
+ kwargs = _get_kwargs()
105
+
106
+ response = await client.get_async_httpx_client().request(**kwargs)
107
+
108
+ return _build_response(client=client, response=response)
109
+
110
+
111
+ async def asyncio(
112
+ *,
113
+ client: Union[AuthenticatedClient, Client],
114
+ ) -> Optional[list["SlimMiniDto"]]:
115
+ """
116
+ Raises:
117
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
118
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
119
+
120
+ Returns:
121
+ list['SlimMiniDto']
122
+ """
123
+
124
+ return (
125
+ await asyncio_detailed(
126
+ client=client,
127
+ )
128
+ ).parsed
@@ -0,0 +1,177 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union, cast
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.http_validation_problem_details import HttpValidationProblemDetails
9
+ from ...models.patch_mini_command import PatchMiniCommand
10
+ from ...types import Response
11
+
12
+
13
+ def _get_kwargs(
14
+ id: int,
15
+ *,
16
+ body: PatchMiniCommand,
17
+ ) -> dict[str, Any]:
18
+ headers: dict[str, Any] = {}
19
+
20
+ _kwargs: dict[str, Any] = {
21
+ "method": "patch",
22
+ "url": f"/api/Minis/{id}",
23
+ }
24
+
25
+ _kwargs["json"] = body.to_dict()
26
+
27
+ headers["Content-Type"] = "application/json"
28
+
29
+ _kwargs["headers"] = headers
30
+ return _kwargs
31
+
32
+
33
+ def _parse_response(
34
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
35
+ ) -> Optional[Union[Any, HttpValidationProblemDetails]]:
36
+ if response.status_code == 204:
37
+ response_204 = cast(Any, None)
38
+ return response_204
39
+
40
+ if response.status_code == 400:
41
+ response_400 = HttpValidationProblemDetails.from_dict(response.json())
42
+
43
+ return response_400
44
+
45
+ if response.status_code == 404:
46
+ response_404 = cast(Any, None)
47
+ return response_404
48
+
49
+ if client.raise_on_unexpected_status:
50
+ raise errors.UnexpectedStatus(response.status_code, response.content)
51
+ else:
52
+ return None
53
+
54
+
55
+ def _build_response(
56
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
57
+ ) -> Response[Union[Any, HttpValidationProblemDetails]]:
58
+ return Response(
59
+ status_code=HTTPStatus(response.status_code),
60
+ content=response.content,
61
+ headers=response.headers,
62
+ parsed=_parse_response(client=client, response=response),
63
+ )
64
+
65
+
66
+ def sync_detailed(
67
+ id: int,
68
+ *,
69
+ client: Union[AuthenticatedClient, Client],
70
+ body: PatchMiniCommand,
71
+ ) -> Response[Union[Any, HttpValidationProblemDetails]]:
72
+ """
73
+ Args:
74
+ id (int):
75
+ body (PatchMiniCommand):
76
+
77
+ Raises:
78
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
79
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
80
+
81
+ Returns:
82
+ Response[Union[Any, HttpValidationProblemDetails]]
83
+ """
84
+
85
+ kwargs = _get_kwargs(
86
+ id=id,
87
+ body=body,
88
+ )
89
+
90
+ response = client.get_httpx_client().request(
91
+ **kwargs,
92
+ )
93
+
94
+ return _build_response(client=client, response=response)
95
+
96
+
97
+ def sync(
98
+ id: int,
99
+ *,
100
+ client: Union[AuthenticatedClient, Client],
101
+ body: PatchMiniCommand,
102
+ ) -> Optional[Union[Any, HttpValidationProblemDetails]]:
103
+ """
104
+ Args:
105
+ id (int):
106
+ body (PatchMiniCommand):
107
+
108
+ Raises:
109
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
110
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
111
+
112
+ Returns:
113
+ Union[Any, HttpValidationProblemDetails]
114
+ """
115
+
116
+ return sync_detailed(
117
+ id=id,
118
+ client=client,
119
+ body=body,
120
+ ).parsed
121
+
122
+
123
+ async def asyncio_detailed(
124
+ id: int,
125
+ *,
126
+ client: Union[AuthenticatedClient, Client],
127
+ body: PatchMiniCommand,
128
+ ) -> Response[Union[Any, HttpValidationProblemDetails]]:
129
+ """
130
+ Args:
131
+ id (int):
132
+ body (PatchMiniCommand):
133
+
134
+ Raises:
135
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
136
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
137
+
138
+ Returns:
139
+ Response[Union[Any, HttpValidationProblemDetails]]
140
+ """
141
+
142
+ kwargs = _get_kwargs(
143
+ id=id,
144
+ body=body,
145
+ )
146
+
147
+ response = await client.get_async_httpx_client().request(**kwargs)
148
+
149
+ return _build_response(client=client, response=response)
150
+
151
+
152
+ async def asyncio(
153
+ id: int,
154
+ *,
155
+ client: Union[AuthenticatedClient, Client],
156
+ body: PatchMiniCommand,
157
+ ) -> Optional[Union[Any, HttpValidationProblemDetails]]:
158
+ """
159
+ Args:
160
+ id (int):
161
+ body (PatchMiniCommand):
162
+
163
+ Raises:
164
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
165
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
166
+
167
+ Returns:
168
+ Union[Any, HttpValidationProblemDetails]
169
+ """
170
+
171
+ return (
172
+ await asyncio_detailed(
173
+ id=id,
174
+ client=client,
175
+ body=body,
176
+ )
177
+ ).parsed