18
18
from ..._wrappers import ResultWrapper
19
19
from ...pagination import SyncSinglePage , AsyncSinglePage
20
20
from ..._base_client import AsyncPaginator , make_request_options
21
- from ...types .shared .role import Role
21
+ from ...types .accounts .role_get_response import RoleGetResponse
22
+ from ...types .accounts .role_list_response import RoleListResponse
22
23
23
24
__all__ = ["RolesResource" , "AsyncRolesResource" ]
24
25
@@ -53,7 +54,7 @@ def list(
53
54
extra_query : Query | None = None ,
54
55
extra_body : Body | None = None ,
55
56
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
56
- ) -> SyncSinglePage [Role ]:
57
+ ) -> SyncSinglePage [RoleListResponse ]:
57
58
"""
58
59
Get all available roles for an account.
59
60
@@ -72,11 +73,11 @@ def list(
72
73
raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
73
74
return self ._get_api_list (
74
75
f"/accounts/{ account_id } /roles" ,
75
- page = SyncSinglePage [Role ],
76
+ page = SyncSinglePage [RoleListResponse ],
76
77
options = make_request_options (
77
78
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
78
79
),
79
- model = Role ,
80
+ model = RoleListResponse ,
80
81
)
81
82
82
83
def get (
@@ -90,7 +91,7 @@ def get(
90
91
extra_query : Query | None = None ,
91
92
extra_body : Body | None = None ,
92
93
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
93
- ) -> object :
94
+ ) -> Optional [ RoleGetResponse ] :
94
95
"""
95
96
Get information about a specific role for an account.
96
97
@@ -118,9 +119,9 @@ def get(
118
119
extra_query = extra_query ,
119
120
extra_body = extra_body ,
120
121
timeout = timeout ,
121
- post_parser = ResultWrapper [Optional [object ]]._unwrapper ,
122
+ post_parser = ResultWrapper [Optional [RoleGetResponse ]]._unwrapper ,
122
123
),
123
- cast_to = cast (Type [object ] , ResultWrapper [object ]),
124
+ cast_to = cast (Type [Optional [ RoleGetResponse ]] , ResultWrapper [RoleGetResponse ]),
124
125
)
125
126
126
127
@@ -154,7 +155,7 @@ def list(
154
155
extra_query : Query | None = None ,
155
156
extra_body : Body | None = None ,
156
157
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
157
- ) -> AsyncPaginator [Role , AsyncSinglePage [Role ]]:
158
+ ) -> AsyncPaginator [RoleListResponse , AsyncSinglePage [RoleListResponse ]]:
158
159
"""
159
160
Get all available roles for an account.
160
161
@@ -173,11 +174,11 @@ def list(
173
174
raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
174
175
return self ._get_api_list (
175
176
f"/accounts/{ account_id } /roles" ,
176
- page = AsyncSinglePage [Role ],
177
+ page = AsyncSinglePage [RoleListResponse ],
177
178
options = make_request_options (
178
179
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
179
180
),
180
- model = Role ,
181
+ model = RoleListResponse ,
181
182
)
182
183
183
184
async def get (
@@ -191,7 +192,7 @@ async def get(
191
192
extra_query : Query | None = None ,
192
193
extra_body : Body | None = None ,
193
194
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
194
- ) -> object :
195
+ ) -> Optional [ RoleGetResponse ] :
195
196
"""
196
197
Get information about a specific role for an account.
197
198
@@ -219,9 +220,9 @@ async def get(
219
220
extra_query = extra_query ,
220
221
extra_body = extra_body ,
221
222
timeout = timeout ,
222
- post_parser = ResultWrapper [Optional [object ]]._unwrapper ,
223
+ post_parser = ResultWrapper [Optional [RoleGetResponse ]]._unwrapper ,
223
224
),
224
- cast_to = cast (Type [object ] , ResultWrapper [object ]),
225
+ cast_to = cast (Type [Optional [ RoleGetResponse ]] , ResultWrapper [RoleGetResponse ]),
225
226
)
226
227
227
228
0 commit comments