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