File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -386,6 +386,9 @@ export namespace Cloudflare {
386386 export import CursorLimitPaginationParams = Pagination . CursorLimitPaginationParams ;
387387 export import CursorLimitPaginationResponse = Pagination . CursorLimitPaginationResponse ;
388388
389+ export import SinglePage = Pagination . SinglePage ;
390+ export import SinglePageResponse = Pagination . SinglePageResponse ;
391+
389392 export import Accounts = API . Accounts ;
390393 export import Account = API . Account ;
391394 export import AccountUpdateResponse = API . AccountUpdateResponse ;
Original file line number Diff line number Diff line change @@ -263,3 +263,37 @@ export class CursorLimitPagination<Item>
263263 } ;
264264 }
265265}
266+
267+ export type SinglePageResponse < Item > = Item [ ] ;
268+
269+ export class SinglePage < Item > extends AbstractPage < Item > {
270+ items : Array < Item > ;
271+
272+ constructor (
273+ client : APIClient ,
274+ response : Response ,
275+ body : SinglePageResponse < Item > ,
276+ options : FinalRequestOptions ,
277+ ) {
278+ super ( client , response , body , options ) ;
279+
280+ this . items = body || [ ] ;
281+ }
282+
283+ getPaginatedItems ( ) : Item [ ] {
284+ return this . items ?? [ ] ;
285+ }
286+
287+ // @deprecated Please use `nextPageInfo()` instead
288+ /**
289+ * This page represents a response that isn't actually paginated at the API level
290+ * so there will never be any next page params.
291+ */
292+ nextPageParams ( ) : null {
293+ return null ;
294+ }
295+
296+ nextPageInfo ( ) : null {
297+ return null ;
298+ }
299+ }
You can’t perform that action at this time.
0 commit comments