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}), }, )