44
55from pydantic import Field , StrictFloat , StrictInt , StrictStr
66
7- from conductor .asyncio_client .adapters .models .granted_access_response_adapter import (
8- GrantedAccessResponseAdapter ,
9- )
107from conductor .asyncio_client .adapters .models .group_adapter import GroupAdapter
118from conductor .asyncio_client .adapters .models .upsert_group_request_adapter import (
129 UpsertGroupRequestAdapter ,
1310)
1411from conductor .asyncio_client .http .api import GroupResourceApi
15- from conductor .asyncio_client .adapters .utils import convert_list_to_adapter , convert_to_adapter
16-
1712
18- class GroupResourceApiAdapter :
19- """Adapter for GroupResourceApi that converts between generated models and adapters."""
2013
21- def __init__ (self , api_client ):
22- self ._api = GroupResourceApi (api_client )
23-
24- async def list_groups (
14+ class GroupResourceApiAdapter (GroupResourceApi ):
15+ async def list_groups ( # type: ignore[override]
2516 self ,
2617 _request_timeout : Union [
2718 None ,
@@ -33,15 +24,14 @@ async def list_groups(
3324 _headers : Optional [Dict [StrictStr , Any ]] = None ,
3425 _host_index : Annotated [StrictInt , Field (ge = 0 , le = 0 )] = 0 ,
3526 ) -> List [GroupAdapter ]:
36- """List all groups, returning GroupAdapter instances."""
37- result = await self ._api .list_groups (
27+ result = await super ().list_groups (
3828 _request_timeout = _request_timeout ,
3929 _request_auth = _request_auth ,
4030 _content_type = _content_type ,
4131 _headers = _headers ,
4232 _host_index = _host_index ,
4333 )
44- return convert_list_to_adapter ( result , GroupAdapter )
34+ return result # type: ignore[return-value]
4535
4636 async def get_group (
4737 self ,
@@ -56,21 +46,20 @@ async def get_group(
5646 _headers : Optional [Dict [StrictStr , Any ]] = None ,
5747 _host_index : Annotated [StrictInt , Field (ge = 0 , le = 0 )] = 0 ,
5848 ) -> GroupAdapter :
59- """Get a group by ID, returning a GroupAdapter instance."""
60- result = await self ._api .get_group (
49+ result = await super ().get_group (
6150 id ,
6251 _request_timeout = _request_timeout ,
6352 _request_auth = _request_auth ,
6453 _content_type = _content_type ,
6554 _headers = _headers ,
6655 _host_index = _host_index ,
6756 )
68- return convert_to_adapter ( result , GroupAdapter )
57+ return result # type: ignore[return-value]
6958
7059 async def upsert_group (
7160 self ,
7261 id : StrictStr ,
73- upsert_group_request : UpsertGroupRequestAdapter ,
62+ upsert_group_request : UpsertGroupRequestAdapter , # type: ignore[override]
7463 _request_timeout : Union [
7564 None ,
7665 Annotated [StrictFloat , Field (gt = 0 )],
@@ -81,8 +70,7 @@ async def upsert_group(
8170 _headers : Optional [Dict [StrictStr , Any ]] = None ,
8271 _host_index : Annotated [StrictInt , Field (ge = 0 , le = 0 )] = 0 ,
8372 ) -> GroupAdapter :
84- """Create or update a group, returning a GroupAdapter instance."""
85- result = await self ._api .upsert_group (
73+ result = await super ().upsert_group (
8674 id ,
8775 upsert_group_request ,
8876 _request_timeout = _request_timeout ,
@@ -91,174 +79,5 @@ async def upsert_group(
9179 _headers = _headers ,
9280 _host_index = _host_index ,
9381 )
94- return convert_to_adapter (result , GroupAdapter )
95-
96- async def delete_group (
97- self ,
98- id : StrictStr ,
99- _request_timeout : Union [
100- None ,
101- Annotated [StrictFloat , Field (gt = 0 )],
102- Tuple [Annotated [StrictFloat , Field (gt = 0 )], Annotated [StrictFloat , Field (gt = 0 )]],
103- ] = None ,
104- _request_auth : Optional [Dict [StrictStr , Any ]] = None ,
105- _content_type : Optional [StrictStr ] = None ,
106- _headers : Optional [Dict [StrictStr , Any ]] = None ,
107- _host_index : Annotated [StrictInt , Field (ge = 0 , le = 0 )] = 0 ,
108- ) -> None :
109- """Delete a group by ID."""
110- await self ._api .delete_group (
111- id ,
112- _request_timeout = _request_timeout ,
113- _request_auth = _request_auth ,
114- _content_type = _content_type ,
115- _headers = _headers ,
116- _host_index = _host_index ,
117- )
11882
119- async def add_user_to_group (
120- self ,
121- group_id : StrictStr ,
122- user_id : StrictStr ,
123- _request_timeout : Union [
124- None ,
125- Annotated [StrictFloat , Field (gt = 0 )],
126- Tuple [Annotated [StrictFloat , Field (gt = 0 )], Annotated [StrictFloat , Field (gt = 0 )]],
127- ] = None ,
128- _request_auth : Optional [Dict [StrictStr , Any ]] = None ,
129- _content_type : Optional [StrictStr ] = None ,
130- _headers : Optional [Dict [StrictStr , Any ]] = None ,
131- _host_index : Annotated [StrictInt , Field (ge = 0 , le = 0 )] = 0 ,
132- ) -> object :
133- """Add a user to a group."""
134- return await self ._api .add_user_to_group (
135- group_id ,
136- user_id ,
137- _request_timeout = _request_timeout ,
138- _request_auth = _request_auth ,
139- _content_type = _content_type ,
140- _headers = _headers ,
141- _host_index = _host_index ,
142- )
143-
144- async def remove_user_from_group (
145- self ,
146- group_id : StrictStr ,
147- user_id : StrictStr ,
148- _request_timeout : Union [
149- None ,
150- Annotated [StrictFloat , Field (gt = 0 )],
151- Tuple [Annotated [StrictFloat , Field (gt = 0 )], Annotated [StrictFloat , Field (gt = 0 )]],
152- ] = None ,
153- _request_auth : Optional [Dict [StrictStr , Any ]] = None ,
154- _content_type : Optional [StrictStr ] = None ,
155- _headers : Optional [Dict [StrictStr , Any ]] = None ,
156- _host_index : Annotated [StrictInt , Field (ge = 0 , le = 0 )] = 0 ,
157- ) -> object :
158- """Remove a user from a group."""
159- return await self ._api .remove_user_from_group (
160- group_id ,
161- user_id ,
162- _request_timeout = _request_timeout ,
163- _request_auth = _request_auth ,
164- _content_type = _content_type ,
165- _headers = _headers ,
166- _host_index = _host_index ,
167- )
168-
169- async def add_users_to_group (
170- self ,
171- group_id : StrictStr ,
172- request_body : List [StrictStr ],
173- _request_timeout : Union [
174- None ,
175- Annotated [StrictFloat , Field (gt = 0 )],
176- Tuple [Annotated [StrictFloat , Field (gt = 0 )], Annotated [StrictFloat , Field (gt = 0 )]],
177- ] = None ,
178- _request_auth : Optional [Dict [StrictStr , Any ]] = None ,
179- _content_type : Optional [StrictStr ] = None ,
180- _headers : Optional [Dict [StrictStr , Any ]] = None ,
181- _host_index : Annotated [StrictInt , Field (ge = 0 , le = 0 )] = 0 ,
182- ) -> None :
183- """Add multiple users to a group."""
184- await self ._api .add_users_to_group (
185- group_id ,
186- request_body ,
187- _request_timeout = _request_timeout ,
188- _request_auth = _request_auth ,
189- _content_type = _content_type ,
190- _headers = _headers ,
191- _host_index = _host_index ,
192- )
193-
194- async def remove_users_from_group (
195- self ,
196- group_id : StrictStr ,
197- request_body : List [StrictStr ],
198- _request_timeout : Union [
199- None ,
200- Annotated [StrictFloat , Field (gt = 0 )],
201- Tuple [Annotated [StrictFloat , Field (gt = 0 )], Annotated [StrictFloat , Field (gt = 0 )]],
202- ] = None ,
203- _request_auth : Optional [Dict [StrictStr , Any ]] = None ,
204- _content_type : Optional [StrictStr ] = None ,
205- _headers : Optional [Dict [StrictStr , Any ]] = None ,
206- _host_index : Annotated [StrictInt , Field (ge = 0 , le = 0 )] = 0 ,
207- ) -> None :
208- """Remove multiple users from a group."""
209- await self ._api .remove_users_from_group (
210- group_id ,
211- request_body ,
212- _request_timeout = _request_timeout ,
213- _request_auth = _request_auth ,
214- _content_type = _content_type ,
215- _headers = _headers ,
216- _host_index = _host_index ,
217- )
218-
219- async def get_users_in_group (
220- self ,
221- id : StrictStr ,
222- _request_timeout : Union [
223- None ,
224- Annotated [StrictFloat , Field (gt = 0 )],
225- Tuple [Annotated [StrictFloat , Field (gt = 0 )], Annotated [StrictFloat , Field (gt = 0 )]],
226- ] = None ,
227- _request_auth : Optional [Dict [StrictStr , Any ]] = None ,
228- _content_type : Optional [StrictStr ] = None ,
229- _headers : Optional [Dict [StrictStr , Any ]] = None ,
230- _host_index : Annotated [StrictInt , Field (ge = 0 , le = 0 )] = 0 ,
231- ) -> object :
232- """Get users in a group."""
233- return await self ._api .get_users_in_group (
234- id ,
235- _request_timeout = _request_timeout ,
236- _request_auth = _request_auth ,
237- _content_type = _content_type ,
238- _headers = _headers ,
239- _host_index = _host_index ,
240- )
241-
242- async def get_granted_permissions1 (
243- self ,
244- group_id : StrictStr ,
245- _request_timeout : Union [
246- None ,
247- Annotated [StrictFloat , Field (gt = 0 )],
248- Tuple [Annotated [StrictFloat , Field (gt = 0 )], Annotated [StrictFloat , Field (gt = 0 )]],
249- ] = None ,
250- _request_auth : Optional [Dict [StrictStr , Any ]] = None ,
251- _content_type : Optional [StrictStr ] = None ,
252- _headers : Optional [Dict [StrictStr , Any ]] = None ,
253- _host_index : Annotated [StrictInt , Field (ge = 0 , le = 0 )] = 0 ,
254- ) -> GrantedAccessResponseAdapter :
255- """Get granted permissions for a group."""
256- result = await self ._api .get_granted_permissions1 (
257- group_id ,
258- _request_timeout = _request_timeout ,
259- _request_auth = _request_auth ,
260- _content_type = _content_type ,
261- _headers = _headers ,
262- _host_index = _host_index ,
263- )
264- return convert_to_adapter (result , GrantedAccessResponseAdapter )
83+ return result # type: ignore[return-value]
0 commit comments