From 502e846f12ded0c7972f2a4932568cf63d813d6b Mon Sep 17 00:00:00 2001 From: Reuben Miller Date: Fri, 5 Apr 2024 13:06:08 +0200 Subject: [PATCH] feat(pagination): support currentPage property --- pkg/c8y/paginationOptions.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/c8y/paginationOptions.go b/pkg/c8y/paginationOptions.go index dfb2115f..7d5f1b47 100644 --- a/pkg/c8y/paginationOptions.go +++ b/pkg/c8y/paginationOptions.go @@ -10,6 +10,15 @@ type PaginationOptions struct { // Include count of elements in the statistics response. Only supported >= 10.13 WithTotalElements bool `url:"withTotalElements,omitempty"` + + // Defines the slice of data to be returned, starting with 1. By default, the first page is returned. + CurrentPage *int `url:"currentPage,omitempty"` +} + +// Set the current page to return +func (o *PaginationOptions) SetCurrentPage(v int) *PaginationOptions { + o.CurrentPage = &v + return o } // NewPaginationOptions returns a pagination options object with a specified pagesize and WithTotalPages set to false