From 0ad46e17772a799cd8a3be894f5a81da0d055ad0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 28 Mar 2024 04:15:39 +0000 Subject: [PATCH] feat(api): update via SDK Studio (#180) --- src/cloudflare/pagination.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/cloudflare/pagination.py b/src/cloudflare/pagination.py index 7382cf23d68..b6f4cc2cfc6 100644 --- a/src/cloudflare/pagination.py +++ b/src/cloudflare/pagination.py @@ -257,14 +257,14 @@ def next_page_info(self) -> Optional[PageInfo]: class SyncSinglePage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - items: List[_T] + result: List[_T] @override def _get_page_items(self) -> List[_T]: - items = self.items - if not items: + result = self.result + if not result: return [] - return items + return result @override def next_page_info(self) -> None: @@ -279,20 +279,20 @@ def build(cls: Type[_BaseModelT], *, response: Response, data: object) -> _BaseM return cls.construct( None, **{ - **(cast(Mapping[str, Any], data) if is_mapping(data) else {"items": data}), + **(cast(Mapping[str, Any], data) if is_mapping(data) else {"result": data}), }, ) class AsyncSinglePage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - items: List[_T] + result: List[_T] @override def _get_page_items(self) -> List[_T]: - items = self.items - if not items: + result = self.result + if not result: return [] - return items + return result @override def next_page_info(self) -> None: @@ -307,6 +307,6 @@ def build(cls: Type[_BaseModelT], *, response: Response, data: object) -> _BaseM return cls.construct( None, **{ - **(cast(Mapping[str, Any], data) if is_mapping(data) else {"items": data}), + **(cast(Mapping[str, Any], data) if is_mapping(data) else {"result": data}), }, )