|
6 | 6 |
|
7 | 7 | import httpx |
8 | 8 |
|
9 | | -from ..types import credential_provider_create_params, credential_provider_update_params |
| 9 | +from ..types import ( |
| 10 | + credential_provider_list_params, |
| 11 | + credential_provider_create_params, |
| 12 | + credential_provider_update_params, |
| 13 | +) |
10 | 14 | from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given |
11 | 15 | from .._utils import path_template, maybe_transform, async_maybe_transform |
12 | 16 | from .._compat import cached_property |
|
17 | 21 | async_to_raw_response_wrapper, |
18 | 22 | async_to_streamed_response_wrapper, |
19 | 23 | ) |
20 | | -from .._base_client import make_request_options |
| 24 | +from ..pagination import SyncOffsetPagination, AsyncOffsetPagination |
| 25 | +from .._base_client import AsyncPaginator, make_request_options |
21 | 26 | from ..types.credential_provider import CredentialProvider |
22 | 27 | from ..types.credential_provider_test_result import CredentialProviderTestResult |
23 | | -from ..types.credential_provider_list_response import CredentialProviderListResponse |
24 | 28 | from ..types.credential_provider_list_items_response import CredentialProviderListItemsResponse |
25 | 29 |
|
26 | 30 | __all__ = ["CredentialProvidersResource", "AsyncCredentialProvidersResource"] |
@@ -194,20 +198,48 @@ def update( |
194 | 198 | def list( |
195 | 199 | self, |
196 | 200 | *, |
| 201 | + limit: int | Omit = omit, |
| 202 | + offset: int | Omit = omit, |
197 | 203 | # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
198 | 204 | # The extra values given here take precedence over values defined on the client or passed to this method. |
199 | 205 | extra_headers: Headers | None = None, |
200 | 206 | extra_query: Query | None = None, |
201 | 207 | extra_body: Body | None = None, |
202 | 208 | timeout: float | httpx.Timeout | None | NotGiven = not_given, |
203 | | - ) -> CredentialProviderListResponse: |
204 | | - """List external credential providers configured for the organization.""" |
205 | | - return self._get( |
| 209 | + ) -> SyncOffsetPagination[CredentialProvider]: |
| 210 | + """ |
| 211 | + List external credential providers configured for the organization. |
| 212 | +
|
| 213 | + Args: |
| 214 | + limit: Limit the number of credential providers to return. |
| 215 | +
|
| 216 | + offset: Offset the number of credential providers to return. |
| 217 | +
|
| 218 | + extra_headers: Send extra headers |
| 219 | +
|
| 220 | + extra_query: Add additional query parameters to the request |
| 221 | +
|
| 222 | + extra_body: Add additional JSON properties to the request |
| 223 | +
|
| 224 | + timeout: Override the client-level default timeout for this request, in seconds |
| 225 | + """ |
| 226 | + return self._get_api_list( |
206 | 227 | "/org/credential_providers", |
| 228 | + page=SyncOffsetPagination[CredentialProvider], |
207 | 229 | options=make_request_options( |
208 | | - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 230 | + extra_headers=extra_headers, |
| 231 | + extra_query=extra_query, |
| 232 | + extra_body=extra_body, |
| 233 | + timeout=timeout, |
| 234 | + query=maybe_transform( |
| 235 | + { |
| 236 | + "limit": limit, |
| 237 | + "offset": offset, |
| 238 | + }, |
| 239 | + credential_provider_list_params.CredentialProviderListParams, |
| 240 | + ), |
209 | 241 | ), |
210 | | - cast_to=CredentialProviderListResponse, |
| 242 | + model=CredentialProvider, |
211 | 243 | ) |
212 | 244 |
|
213 | 245 | def delete( |
@@ -477,23 +509,51 @@ async def update( |
477 | 509 | cast_to=CredentialProvider, |
478 | 510 | ) |
479 | 511 |
|
480 | | - async def list( |
| 512 | + def list( |
481 | 513 | self, |
482 | 514 | *, |
| 515 | + limit: int | Omit = omit, |
| 516 | + offset: int | Omit = omit, |
483 | 517 | # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
484 | 518 | # The extra values given here take precedence over values defined on the client or passed to this method. |
485 | 519 | extra_headers: Headers | None = None, |
486 | 520 | extra_query: Query | None = None, |
487 | 521 | extra_body: Body | None = None, |
488 | 522 | timeout: float | httpx.Timeout | None | NotGiven = not_given, |
489 | | - ) -> CredentialProviderListResponse: |
490 | | - """List external credential providers configured for the organization.""" |
491 | | - return await self._get( |
| 523 | + ) -> AsyncPaginator[CredentialProvider, AsyncOffsetPagination[CredentialProvider]]: |
| 524 | + """ |
| 525 | + List external credential providers configured for the organization. |
| 526 | +
|
| 527 | + Args: |
| 528 | + limit: Limit the number of credential providers to return. |
| 529 | +
|
| 530 | + offset: Offset the number of credential providers to return. |
| 531 | +
|
| 532 | + extra_headers: Send extra headers |
| 533 | +
|
| 534 | + extra_query: Add additional query parameters to the request |
| 535 | +
|
| 536 | + extra_body: Add additional JSON properties to the request |
| 537 | +
|
| 538 | + timeout: Override the client-level default timeout for this request, in seconds |
| 539 | + """ |
| 540 | + return self._get_api_list( |
492 | 541 | "/org/credential_providers", |
| 542 | + page=AsyncOffsetPagination[CredentialProvider], |
493 | 543 | options=make_request_options( |
494 | | - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 544 | + extra_headers=extra_headers, |
| 545 | + extra_query=extra_query, |
| 546 | + extra_body=extra_body, |
| 547 | + timeout=timeout, |
| 548 | + query=maybe_transform( |
| 549 | + { |
| 550 | + "limit": limit, |
| 551 | + "offset": offset, |
| 552 | + }, |
| 553 | + credential_provider_list_params.CredentialProviderListParams, |
| 554 | + ), |
495 | 555 | ), |
496 | | - cast_to=CredentialProviderListResponse, |
| 556 | + model=CredentialProvider, |
497 | 557 | ) |
498 | 558 |
|
499 | 559 | async def delete( |
|
0 commit comments