23
23
AsyncBillingResourceWithStreamingResponse ,
24
24
)
25
25
from ...types .organization_schema_public import OrganizationSchemaPublic
26
+ from ...types .organization_list_members_response import OrganizationListMembersResponse
27
+ from ...types .organization_retrieve_permissions_response import OrganizationRetrievePermissionsResponse
26
28
27
29
__all__ = ["OrganizationsResource" , "AsyncOrganizationsResource" ]
28
30
@@ -84,6 +86,72 @@ def retrieve(
84
86
cast_to = OrganizationSchemaPublic ,
85
87
)
86
88
89
+ def list_members (
90
+ self ,
91
+ organization_id : str ,
92
+ * ,
93
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
94
+ # The extra values given here take precedence over values defined on the client or passed to this method.
95
+ extra_headers : Headers | None = None ,
96
+ extra_query : Query | None = None ,
97
+ extra_body : Body | None = None ,
98
+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
99
+ ) -> OrganizationListMembersResponse :
100
+ """
101
+ Get a list of organization members with their names and emails.
102
+
103
+ Args:
104
+ extra_headers: Send extra headers
105
+
106
+ extra_query: Add additional query parameters to the request
107
+
108
+ extra_body: Add additional JSON properties to the request
109
+
110
+ timeout: Override the client-level default timeout for this request, in seconds
111
+ """
112
+ if not organization_id :
113
+ raise ValueError (f"Expected a non-empty value for `organization_id` but received { organization_id !r} " )
114
+ return self ._get (
115
+ f"/api/organizations/{ organization_id } /members" ,
116
+ options = make_request_options (
117
+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
118
+ ),
119
+ cast_to = OrganizationListMembersResponse ,
120
+ )
121
+
122
+ def retrieve_permissions (
123
+ self ,
124
+ organization_id : str ,
125
+ * ,
126
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
127
+ # The extra values given here take precedence over values defined on the client or passed to this method.
128
+ extra_headers : Headers | None = None ,
129
+ extra_query : Query | None = None ,
130
+ extra_body : Body | None = None ,
131
+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
132
+ ) -> OrganizationRetrievePermissionsResponse :
133
+ """
134
+ Get the user's permissions for this organization.
135
+
136
+ Args:
137
+ extra_headers: Send extra headers
138
+
139
+ extra_query: Add additional query parameters to the request
140
+
141
+ extra_body: Add additional JSON properties to the request
142
+
143
+ timeout: Override the client-level default timeout for this request, in seconds
144
+ """
145
+ if not organization_id :
146
+ raise ValueError (f"Expected a non-empty value for `organization_id` but received { organization_id !r} " )
147
+ return self ._get (
148
+ f"/api/organizations/{ organization_id } /permissions" ,
149
+ options = make_request_options (
150
+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
151
+ ),
152
+ cast_to = OrganizationRetrievePermissionsResponse ,
153
+ )
154
+
87
155
88
156
class AsyncOrganizationsResource (AsyncAPIResource ):
89
157
@cached_property
@@ -142,6 +210,72 @@ async def retrieve(
142
210
cast_to = OrganizationSchemaPublic ,
143
211
)
144
212
213
+ async def list_members (
214
+ self ,
215
+ organization_id : str ,
216
+ * ,
217
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
218
+ # The extra values given here take precedence over values defined on the client or passed to this method.
219
+ extra_headers : Headers | None = None ,
220
+ extra_query : Query | None = None ,
221
+ extra_body : Body | None = None ,
222
+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
223
+ ) -> OrganizationListMembersResponse :
224
+ """
225
+ Get a list of organization members with their names and emails.
226
+
227
+ Args:
228
+ extra_headers: Send extra headers
229
+
230
+ extra_query: Add additional query parameters to the request
231
+
232
+ extra_body: Add additional JSON properties to the request
233
+
234
+ timeout: Override the client-level default timeout for this request, in seconds
235
+ """
236
+ if not organization_id :
237
+ raise ValueError (f"Expected a non-empty value for `organization_id` but received { organization_id !r} " )
238
+ return await self ._get (
239
+ f"/api/organizations/{ organization_id } /members" ,
240
+ options = make_request_options (
241
+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
242
+ ),
243
+ cast_to = OrganizationListMembersResponse ,
244
+ )
245
+
246
+ async def retrieve_permissions (
247
+ self ,
248
+ organization_id : str ,
249
+ * ,
250
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
251
+ # The extra values given here take precedence over values defined on the client or passed to this method.
252
+ extra_headers : Headers | None = None ,
253
+ extra_query : Query | None = None ,
254
+ extra_body : Body | None = None ,
255
+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
256
+ ) -> OrganizationRetrievePermissionsResponse :
257
+ """
258
+ Get the user's permissions for this organization.
259
+
260
+ Args:
261
+ extra_headers: Send extra headers
262
+
263
+ extra_query: Add additional query parameters to the request
264
+
265
+ extra_body: Add additional JSON properties to the request
266
+
267
+ timeout: Override the client-level default timeout for this request, in seconds
268
+ """
269
+ if not organization_id :
270
+ raise ValueError (f"Expected a non-empty value for `organization_id` but received { organization_id !r} " )
271
+ return await self ._get (
272
+ f"/api/organizations/{ organization_id } /permissions" ,
273
+ options = make_request_options (
274
+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
275
+ ),
276
+ cast_to = OrganizationRetrievePermissionsResponse ,
277
+ )
278
+
145
279
146
280
class OrganizationsResourceWithRawResponse :
147
281
def __init__ (self , organizations : OrganizationsResource ) -> None :
@@ -150,6 +284,12 @@ def __init__(self, organizations: OrganizationsResource) -> None:
150
284
self .retrieve = to_raw_response_wrapper (
151
285
organizations .retrieve ,
152
286
)
287
+ self .list_members = to_raw_response_wrapper (
288
+ organizations .list_members ,
289
+ )
290
+ self .retrieve_permissions = to_raw_response_wrapper (
291
+ organizations .retrieve_permissions ,
292
+ )
153
293
154
294
@cached_property
155
295
def billing (self ) -> BillingResourceWithRawResponse :
@@ -163,6 +303,12 @@ def __init__(self, organizations: AsyncOrganizationsResource) -> None:
163
303
self .retrieve = async_to_raw_response_wrapper (
164
304
organizations .retrieve ,
165
305
)
306
+ self .list_members = async_to_raw_response_wrapper (
307
+ organizations .list_members ,
308
+ )
309
+ self .retrieve_permissions = async_to_raw_response_wrapper (
310
+ organizations .retrieve_permissions ,
311
+ )
166
312
167
313
@cached_property
168
314
def billing (self ) -> AsyncBillingResourceWithRawResponse :
@@ -176,6 +322,12 @@ def __init__(self, organizations: OrganizationsResource) -> None:
176
322
self .retrieve = to_streamed_response_wrapper (
177
323
organizations .retrieve ,
178
324
)
325
+ self .list_members = to_streamed_response_wrapper (
326
+ organizations .list_members ,
327
+ )
328
+ self .retrieve_permissions = to_streamed_response_wrapper (
329
+ organizations .retrieve_permissions ,
330
+ )
179
331
180
332
@cached_property
181
333
def billing (self ) -> BillingResourceWithStreamingResponse :
@@ -189,6 +341,12 @@ def __init__(self, organizations: AsyncOrganizationsResource) -> None:
189
341
self .retrieve = async_to_streamed_response_wrapper (
190
342
organizations .retrieve ,
191
343
)
344
+ self .list_members = async_to_streamed_response_wrapper (
345
+ organizations .list_members ,
346
+ )
347
+ self .retrieve_permissions = async_to_streamed_response_wrapper (
348
+ organizations .retrieve_permissions ,
349
+ )
192
350
193
351
@cached_property
194
352
def billing (self ) -> AsyncBillingResourceWithStreamingResponse :
0 commit comments