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.
- minikai/__init__.py +8 -0
- minikai/api/__init__.py +1 -0
- minikai/api/groups/__init__.py +1 -0
- minikai/api/groups/add_minis_to_group.py +196 -0
- minikai/api/groups/add_users_to_group.py +196 -0
- minikai/api/groups/create_group.py +178 -0
- minikai/api/groups/delete_group.py +115 -0
- minikai/api/groups/get_group.py +170 -0
- minikai/api/groups/get_group_minis.py +175 -0
- minikai/api/groups/get_group_users.py +175 -0
- minikai/api/groups/get_groups.py +150 -0
- minikai/api/groups/remove_minis_from_group.py +196 -0
- minikai/api/groups/remove_users_from_group.py +196 -0
- minikai/api/groups/update_group.py +195 -0
- minikai/api/minis/__init__.py +1 -0
- minikai/api/minis/create_mini.py +178 -0
- minikai/api/minis/delete_mini.py +115 -0
- minikai/api/minis/get_external_mini.py +183 -0
- minikai/api/minis/get_minis.py +150 -0
- minikai/api/minis/patch_mini.py +195 -0
- minikai/api/minis/update_mini.py +195 -0
- minikai/api/records/__init__.py +1 -0
- minikai/api/records/add_attachments.py +203 -0
- minikai/api/records/add_relations.py +209 -0
- minikai/api/records/create_record.py +182 -0
- minikai/api/records/delete_record.py +115 -0
- minikai/api/records/download_attachment.py +119 -0
- minikai/api/records/get_created_by.py +202 -0
- minikai/api/records/get_labels.py +194 -0
- minikai/api/records/get_records_by_external.py +248 -0
- minikai/api/records/get_states.py +194 -0
- minikai/api/records/get_updated_by.py +202 -0
- minikai/api/records/remove_attachments.py +132 -0
- minikai/api/records/remove_relations.py +132 -0
- minikai/api/records/update_attachments.py +203 -0
- minikai/api/records/update_record.py +199 -0
- minikai/api/records/update_relations.py +209 -0
- minikai/api/records/upsert_records_by_external_uri.py +182 -0
- minikai/api/users/__init__.py +1 -0
- minikai/api/users/delete_api_users_minis.py +122 -0
- minikai/api/users/get_api_users_minis.py +175 -0
- minikai/api/users/get_users.py +150 -0
- minikai/api/users/post_api_users_minis.py +187 -0
- minikai/client.py +271 -0
- minikai/errors.py +14 -0
- minikai/models/__init__.py +103 -0
- minikai/models/add_attachments_body.py +140 -0
- minikai/models/batch_upsert_result.py +124 -0
- minikai/models/create_group_command.py +127 -0
- minikai/models/create_mini_command.py +144 -0
- minikai/models/create_record_command.py +263 -0
- minikai/models/create_record_command_tags.py +63 -0
- minikai/models/cursor_paginated_list_of_record_dto.py +122 -0
- minikai/models/document_file_dto.py +171 -0
- minikai/models/document_file_metadata_dto.py +72 -0
- minikai/models/failed_upsert_item.py +83 -0
- minikai/models/form_field.py +138 -0
- minikai/models/form_field_dto.py +181 -0
- minikai/models/form_field_type.py +10 -0
- minikai/models/group_dto.py +155 -0
- minikai/models/http_validation_problem_details.py +198 -0
- minikai/models/http_validation_problem_details_errors.py +74 -0
- minikai/models/mini_dto.py +224 -0
- minikai/models/mini_template_dto.py +167 -0
- minikai/models/paginated_list_of_record_dto.py +124 -0
- minikai/models/patch_mini_command.py +102 -0
- minikai/models/problem_details.py +174 -0
- minikai/models/record.py +441 -0
- minikai/models/record_attachment.py +265 -0
- minikai/models/record_attachment_dto.py +265 -0
- minikai/models/record_attachment_dto_metadata_type_0.py +63 -0
- minikai/models/record_attachment_metadata_type_0.py +63 -0
- minikai/models/record_authorization.py +107 -0
- minikai/models/record_authorization_dto.py +107 -0
- minikai/models/record_dto.py +385 -0
- minikai/models/record_dto_tags.py +63 -0
- minikai/models/record_relation.py +105 -0
- minikai/models/record_relation_dto.py +105 -0
- minikai/models/record_state.py +10 -0
- minikai/models/record_tag.py +159 -0
- minikai/models/record_tag_dto.py +68 -0
- minikai/models/slim_mini_dto.py +197 -0
- minikai/models/tool_dto.py +95 -0
- minikai/models/update_attachments_body.py +140 -0
- minikai/models/update_group_command.py +148 -0
- minikai/models/update_mini_command.py +153 -0
- minikai/models/update_mini_template_workspaces_command.py +74 -0
- minikai/models/update_record_command.py +274 -0
- minikai/models/update_record_command_tags.py +63 -0
- minikai/models/upsert_record_dto.py +275 -0
- minikai/models/upsert_record_dto_tags.py +63 -0
- minikai/models/upsert_records_by_external_uri_command.py +79 -0
- minikai/models/user_dto.py +215 -0
- minikai/models/user_to_mini_dto.py +99 -0
- minikai/models/workspace_dto.py +99 -0
- minikai/py.typed +1 -0
- minikai/types.py +53 -0
- minikai-0.1.7.dist-info/METADATA +133 -0
- minikai-0.1.7.dist-info/RECORD +100 -0
- minikai-0.1.7.dist-info/WHEEL +4 -0
minikai/__init__.py
ADDED
minikai/api/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
""" Contains methods for accessing the API """
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
""" Contains endpoint functions for accessing the API """
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Optional, Union, cast
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ...client import AuthenticatedClient, Client
|
|
7
|
+
from ...types import Response, UNSET
|
|
8
|
+
from ... import errors
|
|
9
|
+
|
|
10
|
+
from ...models.http_validation_problem_details import HttpValidationProblemDetails
|
|
11
|
+
from typing import cast
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _get_kwargs(
|
|
16
|
+
group_id: str,
|
|
17
|
+
*,
|
|
18
|
+
body: list[int],
|
|
19
|
+
|
|
20
|
+
) -> dict[str, Any]:
|
|
21
|
+
headers: dict[str, Any] = {}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
_kwargs: dict[str, Any] = {
|
|
29
|
+
"method": "patch",
|
|
30
|
+
"url": "/api/Groups/{group_id}/minis".format(group_id=group_id,),
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
_kwargs["json"] = body
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
headers["Content-Type"] = "application/json"
|
|
39
|
+
|
|
40
|
+
_kwargs["headers"] = headers
|
|
41
|
+
return _kwargs
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Union[Any, HttpValidationProblemDetails]]:
|
|
46
|
+
if response.status_code == 204:
|
|
47
|
+
response_204 = cast(Any, None)
|
|
48
|
+
return response_204
|
|
49
|
+
|
|
50
|
+
if response.status_code == 400:
|
|
51
|
+
response_400 = HttpValidationProblemDetails.from_dict(response.json())
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
return response_400
|
|
56
|
+
|
|
57
|
+
if response.status_code == 404:
|
|
58
|
+
response_404 = cast(Any, None)
|
|
59
|
+
return response_404
|
|
60
|
+
|
|
61
|
+
if client.raise_on_unexpected_status:
|
|
62
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
63
|
+
else:
|
|
64
|
+
return None
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Union[Any, HttpValidationProblemDetails]]:
|
|
68
|
+
return Response(
|
|
69
|
+
status_code=HTTPStatus(response.status_code),
|
|
70
|
+
content=response.content,
|
|
71
|
+
headers=response.headers,
|
|
72
|
+
parsed=_parse_response(client=client, response=response),
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def sync_detailed(
|
|
77
|
+
group_id: str,
|
|
78
|
+
*,
|
|
79
|
+
client: Union[AuthenticatedClient, Client],
|
|
80
|
+
body: list[int],
|
|
81
|
+
|
|
82
|
+
) -> Response[Union[Any, HttpValidationProblemDetails]]:
|
|
83
|
+
"""
|
|
84
|
+
Args:
|
|
85
|
+
group_id (str):
|
|
86
|
+
body (list[int]):
|
|
87
|
+
|
|
88
|
+
Raises:
|
|
89
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
90
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
91
|
+
|
|
92
|
+
Returns:
|
|
93
|
+
Response[Union[Any, HttpValidationProblemDetails]]
|
|
94
|
+
"""
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
kwargs = _get_kwargs(
|
|
98
|
+
group_id=group_id,
|
|
99
|
+
body=body,
|
|
100
|
+
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
response = client.get_httpx_client().request(
|
|
104
|
+
**kwargs,
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
return _build_response(client=client, response=response)
|
|
108
|
+
|
|
109
|
+
def sync(
|
|
110
|
+
group_id: str,
|
|
111
|
+
*,
|
|
112
|
+
client: Union[AuthenticatedClient, Client],
|
|
113
|
+
body: list[int],
|
|
114
|
+
|
|
115
|
+
) -> Optional[Union[Any, HttpValidationProblemDetails]]:
|
|
116
|
+
"""
|
|
117
|
+
Args:
|
|
118
|
+
group_id (str):
|
|
119
|
+
body (list[int]):
|
|
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
|
+
Union[Any, HttpValidationProblemDetails]
|
|
127
|
+
"""
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
return sync_detailed(
|
|
131
|
+
group_id=group_id,
|
|
132
|
+
client=client,
|
|
133
|
+
body=body,
|
|
134
|
+
|
|
135
|
+
).parsed
|
|
136
|
+
|
|
137
|
+
async def asyncio_detailed(
|
|
138
|
+
group_id: str,
|
|
139
|
+
*,
|
|
140
|
+
client: Union[AuthenticatedClient, Client],
|
|
141
|
+
body: list[int],
|
|
142
|
+
|
|
143
|
+
) -> Response[Union[Any, HttpValidationProblemDetails]]:
|
|
144
|
+
"""
|
|
145
|
+
Args:
|
|
146
|
+
group_id (str):
|
|
147
|
+
body (list[int]):
|
|
148
|
+
|
|
149
|
+
Raises:
|
|
150
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
151
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
152
|
+
|
|
153
|
+
Returns:
|
|
154
|
+
Response[Union[Any, HttpValidationProblemDetails]]
|
|
155
|
+
"""
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
kwargs = _get_kwargs(
|
|
159
|
+
group_id=group_id,
|
|
160
|
+
body=body,
|
|
161
|
+
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
response = await client.get_async_httpx_client().request(
|
|
165
|
+
**kwargs
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
return _build_response(client=client, response=response)
|
|
169
|
+
|
|
170
|
+
async def asyncio(
|
|
171
|
+
group_id: str,
|
|
172
|
+
*,
|
|
173
|
+
client: Union[AuthenticatedClient, Client],
|
|
174
|
+
body: list[int],
|
|
175
|
+
|
|
176
|
+
) -> Optional[Union[Any, HttpValidationProblemDetails]]:
|
|
177
|
+
"""
|
|
178
|
+
Args:
|
|
179
|
+
group_id (str):
|
|
180
|
+
body (list[int]):
|
|
181
|
+
|
|
182
|
+
Raises:
|
|
183
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
184
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
185
|
+
|
|
186
|
+
Returns:
|
|
187
|
+
Union[Any, HttpValidationProblemDetails]
|
|
188
|
+
"""
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
return (await asyncio_detailed(
|
|
192
|
+
group_id=group_id,
|
|
193
|
+
client=client,
|
|
194
|
+
body=body,
|
|
195
|
+
|
|
196
|
+
)).parsed
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Optional, Union, cast
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ...client import AuthenticatedClient, Client
|
|
7
|
+
from ...types import Response, UNSET
|
|
8
|
+
from ... import errors
|
|
9
|
+
|
|
10
|
+
from ...models.http_validation_problem_details import HttpValidationProblemDetails
|
|
11
|
+
from typing import cast
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _get_kwargs(
|
|
16
|
+
group_id: str,
|
|
17
|
+
*,
|
|
18
|
+
body: list[str],
|
|
19
|
+
|
|
20
|
+
) -> dict[str, Any]:
|
|
21
|
+
headers: dict[str, Any] = {}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
_kwargs: dict[str, Any] = {
|
|
29
|
+
"method": "patch",
|
|
30
|
+
"url": "/api/Groups/{group_id}/users".format(group_id=group_id,),
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
_kwargs["json"] = body
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
headers["Content-Type"] = "application/json"
|
|
39
|
+
|
|
40
|
+
_kwargs["headers"] = headers
|
|
41
|
+
return _kwargs
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Union[Any, HttpValidationProblemDetails]]:
|
|
46
|
+
if response.status_code == 204:
|
|
47
|
+
response_204 = cast(Any, None)
|
|
48
|
+
return response_204
|
|
49
|
+
|
|
50
|
+
if response.status_code == 400:
|
|
51
|
+
response_400 = HttpValidationProblemDetails.from_dict(response.json())
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
return response_400
|
|
56
|
+
|
|
57
|
+
if response.status_code == 404:
|
|
58
|
+
response_404 = cast(Any, None)
|
|
59
|
+
return response_404
|
|
60
|
+
|
|
61
|
+
if client.raise_on_unexpected_status:
|
|
62
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
63
|
+
else:
|
|
64
|
+
return None
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Union[Any, HttpValidationProblemDetails]]:
|
|
68
|
+
return Response(
|
|
69
|
+
status_code=HTTPStatus(response.status_code),
|
|
70
|
+
content=response.content,
|
|
71
|
+
headers=response.headers,
|
|
72
|
+
parsed=_parse_response(client=client, response=response),
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def sync_detailed(
|
|
77
|
+
group_id: str,
|
|
78
|
+
*,
|
|
79
|
+
client: Union[AuthenticatedClient, Client],
|
|
80
|
+
body: list[str],
|
|
81
|
+
|
|
82
|
+
) -> Response[Union[Any, HttpValidationProblemDetails]]:
|
|
83
|
+
"""
|
|
84
|
+
Args:
|
|
85
|
+
group_id (str):
|
|
86
|
+
body (list[str]):
|
|
87
|
+
|
|
88
|
+
Raises:
|
|
89
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
90
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
91
|
+
|
|
92
|
+
Returns:
|
|
93
|
+
Response[Union[Any, HttpValidationProblemDetails]]
|
|
94
|
+
"""
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
kwargs = _get_kwargs(
|
|
98
|
+
group_id=group_id,
|
|
99
|
+
body=body,
|
|
100
|
+
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
response = client.get_httpx_client().request(
|
|
104
|
+
**kwargs,
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
return _build_response(client=client, response=response)
|
|
108
|
+
|
|
109
|
+
def sync(
|
|
110
|
+
group_id: str,
|
|
111
|
+
*,
|
|
112
|
+
client: Union[AuthenticatedClient, Client],
|
|
113
|
+
body: list[str],
|
|
114
|
+
|
|
115
|
+
) -> Optional[Union[Any, HttpValidationProblemDetails]]:
|
|
116
|
+
"""
|
|
117
|
+
Args:
|
|
118
|
+
group_id (str):
|
|
119
|
+
body (list[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
|
+
Union[Any, HttpValidationProblemDetails]
|
|
127
|
+
"""
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
return sync_detailed(
|
|
131
|
+
group_id=group_id,
|
|
132
|
+
client=client,
|
|
133
|
+
body=body,
|
|
134
|
+
|
|
135
|
+
).parsed
|
|
136
|
+
|
|
137
|
+
async def asyncio_detailed(
|
|
138
|
+
group_id: str,
|
|
139
|
+
*,
|
|
140
|
+
client: Union[AuthenticatedClient, Client],
|
|
141
|
+
body: list[str],
|
|
142
|
+
|
|
143
|
+
) -> Response[Union[Any, HttpValidationProblemDetails]]:
|
|
144
|
+
"""
|
|
145
|
+
Args:
|
|
146
|
+
group_id (str):
|
|
147
|
+
body (list[str]):
|
|
148
|
+
|
|
149
|
+
Raises:
|
|
150
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
151
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
152
|
+
|
|
153
|
+
Returns:
|
|
154
|
+
Response[Union[Any, HttpValidationProblemDetails]]
|
|
155
|
+
"""
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
kwargs = _get_kwargs(
|
|
159
|
+
group_id=group_id,
|
|
160
|
+
body=body,
|
|
161
|
+
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
response = await client.get_async_httpx_client().request(
|
|
165
|
+
**kwargs
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
return _build_response(client=client, response=response)
|
|
169
|
+
|
|
170
|
+
async def asyncio(
|
|
171
|
+
group_id: str,
|
|
172
|
+
*,
|
|
173
|
+
client: Union[AuthenticatedClient, Client],
|
|
174
|
+
body: list[str],
|
|
175
|
+
|
|
176
|
+
) -> Optional[Union[Any, HttpValidationProblemDetails]]:
|
|
177
|
+
"""
|
|
178
|
+
Args:
|
|
179
|
+
group_id (str):
|
|
180
|
+
body (list[str]):
|
|
181
|
+
|
|
182
|
+
Raises:
|
|
183
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
184
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
185
|
+
|
|
186
|
+
Returns:
|
|
187
|
+
Union[Any, HttpValidationProblemDetails]
|
|
188
|
+
"""
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
return (await asyncio_detailed(
|
|
192
|
+
group_id=group_id,
|
|
193
|
+
client=client,
|
|
194
|
+
body=body,
|
|
195
|
+
|
|
196
|
+
)).parsed
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Optional, Union, cast
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ...client import AuthenticatedClient, Client
|
|
7
|
+
from ...types import Response, UNSET
|
|
8
|
+
from ... import errors
|
|
9
|
+
|
|
10
|
+
from ...models.create_group_command import CreateGroupCommand
|
|
11
|
+
from ...models.http_validation_problem_details import HttpValidationProblemDetails
|
|
12
|
+
from typing import cast
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _get_kwargs(
|
|
17
|
+
*,
|
|
18
|
+
body: CreateGroupCommand,
|
|
19
|
+
|
|
20
|
+
) -> dict[str, Any]:
|
|
21
|
+
headers: dict[str, Any] = {}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
_kwargs: dict[str, Any] = {
|
|
29
|
+
"method": "post",
|
|
30
|
+
"url": "/api/Groups",
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
_kwargs["json"] = body.to_dict()
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
headers["Content-Type"] = "application/json"
|
|
37
|
+
|
|
38
|
+
_kwargs["headers"] = headers
|
|
39
|
+
return _kwargs
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Union[HttpValidationProblemDetails, str]]:
|
|
44
|
+
if response.status_code == 201:
|
|
45
|
+
response_201 = cast(str, response.json())
|
|
46
|
+
return response_201
|
|
47
|
+
|
|
48
|
+
if response.status_code == 400:
|
|
49
|
+
response_400 = HttpValidationProblemDetails.from_dict(response.json())
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
return response_400
|
|
54
|
+
|
|
55
|
+
if client.raise_on_unexpected_status:
|
|
56
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
57
|
+
else:
|
|
58
|
+
return None
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Union[HttpValidationProblemDetails, str]]:
|
|
62
|
+
return Response(
|
|
63
|
+
status_code=HTTPStatus(response.status_code),
|
|
64
|
+
content=response.content,
|
|
65
|
+
headers=response.headers,
|
|
66
|
+
parsed=_parse_response(client=client, response=response),
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def sync_detailed(
|
|
71
|
+
*,
|
|
72
|
+
client: Union[AuthenticatedClient, Client],
|
|
73
|
+
body: CreateGroupCommand,
|
|
74
|
+
|
|
75
|
+
) -> Response[Union[HttpValidationProblemDetails, str]]:
|
|
76
|
+
"""
|
|
77
|
+
Args:
|
|
78
|
+
body (CreateGroupCommand):
|
|
79
|
+
|
|
80
|
+
Raises:
|
|
81
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
82
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
83
|
+
|
|
84
|
+
Returns:
|
|
85
|
+
Response[Union[HttpValidationProblemDetails, str]]
|
|
86
|
+
"""
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
kwargs = _get_kwargs(
|
|
90
|
+
body=body,
|
|
91
|
+
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
response = client.get_httpx_client().request(
|
|
95
|
+
**kwargs,
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
return _build_response(client=client, response=response)
|
|
99
|
+
|
|
100
|
+
def sync(
|
|
101
|
+
*,
|
|
102
|
+
client: Union[AuthenticatedClient, Client],
|
|
103
|
+
body: CreateGroupCommand,
|
|
104
|
+
|
|
105
|
+
) -> Optional[Union[HttpValidationProblemDetails, str]]:
|
|
106
|
+
"""
|
|
107
|
+
Args:
|
|
108
|
+
body (CreateGroupCommand):
|
|
109
|
+
|
|
110
|
+
Raises:
|
|
111
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
112
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
113
|
+
|
|
114
|
+
Returns:
|
|
115
|
+
Union[HttpValidationProblemDetails, str]
|
|
116
|
+
"""
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
return sync_detailed(
|
|
120
|
+
client=client,
|
|
121
|
+
body=body,
|
|
122
|
+
|
|
123
|
+
).parsed
|
|
124
|
+
|
|
125
|
+
async def asyncio_detailed(
|
|
126
|
+
*,
|
|
127
|
+
client: Union[AuthenticatedClient, Client],
|
|
128
|
+
body: CreateGroupCommand,
|
|
129
|
+
|
|
130
|
+
) -> Response[Union[HttpValidationProblemDetails, str]]:
|
|
131
|
+
"""
|
|
132
|
+
Args:
|
|
133
|
+
body (CreateGroupCommand):
|
|
134
|
+
|
|
135
|
+
Raises:
|
|
136
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
137
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
138
|
+
|
|
139
|
+
Returns:
|
|
140
|
+
Response[Union[HttpValidationProblemDetails, str]]
|
|
141
|
+
"""
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
kwargs = _get_kwargs(
|
|
145
|
+
body=body,
|
|
146
|
+
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
response = await client.get_async_httpx_client().request(
|
|
150
|
+
**kwargs
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
return _build_response(client=client, response=response)
|
|
154
|
+
|
|
155
|
+
async def asyncio(
|
|
156
|
+
*,
|
|
157
|
+
client: Union[AuthenticatedClient, Client],
|
|
158
|
+
body: CreateGroupCommand,
|
|
159
|
+
|
|
160
|
+
) -> Optional[Union[HttpValidationProblemDetails, str]]:
|
|
161
|
+
"""
|
|
162
|
+
Args:
|
|
163
|
+
body (CreateGroupCommand):
|
|
164
|
+
|
|
165
|
+
Raises:
|
|
166
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
167
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
168
|
+
|
|
169
|
+
Returns:
|
|
170
|
+
Union[HttpValidationProblemDetails, str]
|
|
171
|
+
"""
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
return (await asyncio_detailed(
|
|
175
|
+
client=client,
|
|
176
|
+
body=body,
|
|
177
|
+
|
|
178
|
+
)).parsed
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Optional, Union, cast
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ...client import AuthenticatedClient, Client
|
|
7
|
+
from ...types import Response, UNSET
|
|
8
|
+
from ... import errors
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
group_id: str,
|
|
15
|
+
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
_kwargs: dict[str, Any] = {
|
|
24
|
+
"method": "delete",
|
|
25
|
+
"url": "/api/Groups/{group_id}".format(group_id=group_id,),
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
return _kwargs
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
|
34
|
+
if response.status_code == 204:
|
|
35
|
+
return None
|
|
36
|
+
|
|
37
|
+
if response.status_code == 404:
|
|
38
|
+
return None
|
|
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(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
|
47
|
+
return Response(
|
|
48
|
+
status_code=HTTPStatus(response.status_code),
|
|
49
|
+
content=response.content,
|
|
50
|
+
headers=response.headers,
|
|
51
|
+
parsed=_parse_response(client=client, response=response),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def sync_detailed(
|
|
56
|
+
group_id: str,
|
|
57
|
+
*,
|
|
58
|
+
client: Union[AuthenticatedClient, Client],
|
|
59
|
+
|
|
60
|
+
) -> Response[Any]:
|
|
61
|
+
"""
|
|
62
|
+
Args:
|
|
63
|
+
group_id (str):
|
|
64
|
+
|
|
65
|
+
Raises:
|
|
66
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
67
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
68
|
+
|
|
69
|
+
Returns:
|
|
70
|
+
Response[Any]
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
kwargs = _get_kwargs(
|
|
75
|
+
group_id=group_id,
|
|
76
|
+
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
response = client.get_httpx_client().request(
|
|
80
|
+
**kwargs,
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
return _build_response(client=client, response=response)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
async def asyncio_detailed(
|
|
87
|
+
group_id: str,
|
|
88
|
+
*,
|
|
89
|
+
client: Union[AuthenticatedClient, Client],
|
|
90
|
+
|
|
91
|
+
) -> Response[Any]:
|
|
92
|
+
"""
|
|
93
|
+
Args:
|
|
94
|
+
group_id (str):
|
|
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[Any]
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
kwargs = _get_kwargs(
|
|
106
|
+
group_id=group_id,
|
|
107
|
+
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
response = await client.get_async_httpx_client().request(
|
|
111
|
+
**kwargs
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
return _build_response(client=client, response=response)
|
|
115
|
+
|