4444 async_to_streamed_response_wrapper ,
4545)
4646from ._streaming import Stream as Stream , AsyncStream as AsyncStream
47+ from .pagination import SyncOffsetPagination , AsyncOffsetPagination
4748from ._exceptions import APIStatusError
4849from ._base_client import (
4950 DEFAULT_MAX_RETRIES ,
5051 SyncAPIClient ,
5152 AsyncAPIClient ,
53+ AsyncPaginator ,
5254 make_request_options ,
5355)
5456from .types .list_events_response import ListEventsResponse
@@ -605,7 +607,7 @@ def list_connection_configs(
605607 extra_query : Query | None = None ,
606608 extra_body : Body | None = None ,
607609 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
608- ) -> ListConnectionConfigsResponse :
610+ ) -> SyncOffsetPagination [ ListConnectionConfigsResponse ] :
609611 """
610612 List all connector configurations with optional filtering
611613
@@ -620,8 +622,9 @@ def list_connection_configs(
620622
621623 timeout: Override the client-level default timeout for this request, in seconds
622624 """
623- return self .get (
625+ return self .get_api_list (
624626 "/connector-config" ,
627+ page = SyncOffsetPagination [ListConnectionConfigsResponse ],
625628 options = make_request_options (
626629 extra_headers = extra_headers ,
627630 extra_query = extra_query ,
@@ -637,7 +640,9 @@ def list_connection_configs(
637640 client_list_connection_configs_params .ClientListConnectionConfigsParams ,
638641 ),
639642 ),
640- cast_to = ListConnectionConfigsResponse ,
643+ model = cast (
644+ Any , ListConnectionConfigsResponse
645+ ), # Union types cannot be passed in as arguments in the type system
641646 )
642647
643648 def list_connections (
@@ -708,7 +713,7 @@ def list_events(
708713 extra_query : Query | None = None ,
709714 extra_body : Body | None = None ,
710715 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
711- ) -> ListEventsResponse :
716+ ) -> SyncOffsetPagination [ ListEventsResponse ] :
712717 """
713718 List all events for an organization
714719
@@ -721,8 +726,9 @@ def list_events(
721726
722727 timeout: Override the client-level default timeout for this request, in seconds
723728 """
724- return self .get (
729+ return self .get_api_list (
725730 "/event" ,
731+ page = SyncOffsetPagination [ListEventsResponse ],
726732 options = make_request_options (
727733 extra_headers = extra_headers ,
728734 extra_query = extra_query ,
@@ -736,7 +742,7 @@ def list_events(
736742 client_list_events_params .ClientListEventsParams ,
737743 ),
738744 ),
739- cast_to = ListEventsResponse ,
745+ model = ListEventsResponse ,
740746 )
741747
742748 @override
@@ -1248,7 +1254,7 @@ async def get_connection(
12481254 cast_to = GetConnectionResponse ,
12491255 )
12501256
1251- async def list_connection_configs (
1257+ def list_connection_configs (
12521258 self ,
12531259 * ,
12541260 connector_name : Literal [
@@ -1316,7 +1322,7 @@ async def list_connection_configs(
13161322 extra_query : Query | None = None ,
13171323 extra_body : Body | None = None ,
13181324 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
1319- ) -> ListConnectionConfigsResponse :
1325+ ) -> AsyncPaginator [ ListConnectionConfigsResponse , AsyncOffsetPagination [ ListConnectionConfigsResponse ]] :
13201326 """
13211327 List all connector configurations with optional filtering
13221328
@@ -1331,14 +1337,15 @@ async def list_connection_configs(
13311337
13321338 timeout: Override the client-level default timeout for this request, in seconds
13331339 """
1334- return await self .get (
1340+ return self .get_api_list (
13351341 "/connector-config" ,
1342+ page = AsyncOffsetPagination [ListConnectionConfigsResponse ],
13361343 options = make_request_options (
13371344 extra_headers = extra_headers ,
13381345 extra_query = extra_query ,
13391346 extra_body = extra_body ,
13401347 timeout = timeout ,
1341- query = await async_maybe_transform (
1348+ query = maybe_transform (
13421349 {
13431350 "connector_name" : connector_name ,
13441351 "expand" : expand ,
@@ -1348,7 +1355,9 @@ async def list_connection_configs(
13481355 client_list_connection_configs_params .ClientListConnectionConfigsParams ,
13491356 ),
13501357 ),
1351- cast_to = ListConnectionConfigsResponse ,
1358+ model = cast (
1359+ Any , ListConnectionConfigsResponse
1360+ ), # Union types cannot be passed in as arguments in the type system
13521361 )
13531362
13541363 async def list_connections (
@@ -1408,7 +1417,7 @@ async def list_connections(
14081417 ),
14091418 )
14101419
1411- async def list_events (
1420+ def list_events (
14121421 self ,
14131422 * ,
14141423 limit : int | NotGiven = NOT_GIVEN ,
@@ -1419,7 +1428,7 @@ async def list_events(
14191428 extra_query : Query | None = None ,
14201429 extra_body : Body | None = None ,
14211430 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
1422- ) -> ListEventsResponse :
1431+ ) -> AsyncPaginator [ ListEventsResponse , AsyncOffsetPagination [ ListEventsResponse ]] :
14231432 """
14241433 List all events for an organization
14251434
@@ -1432,22 +1441,23 @@ async def list_events(
14321441
14331442 timeout: Override the client-level default timeout for this request, in seconds
14341443 """
1435- return await self .get (
1444+ return self .get_api_list (
14361445 "/event" ,
1446+ page = AsyncOffsetPagination [ListEventsResponse ],
14371447 options = make_request_options (
14381448 extra_headers = extra_headers ,
14391449 extra_query = extra_query ,
14401450 extra_body = extra_body ,
14411451 timeout = timeout ,
1442- query = await async_maybe_transform (
1452+ query = maybe_transform (
14431453 {
14441454 "limit" : limit ,
14451455 "offset" : offset ,
14461456 },
14471457 client_list_events_params .ClientListEventsParams ,
14481458 ),
14491459 ),
1450- cast_to = ListEventsResponse ,
1460+ model = ListEventsResponse ,
14511461 )
14521462
14531463 @override
0 commit comments