Skip to content

Commit

Permalink
Merge pull request #44 from reubenmiller/feat-paging-current-page
Browse files Browse the repository at this point in the history
feat(pagination): support currentPage property
  • Loading branch information
reubenmiller committed Apr 5, 2024
2 parents d47986d + 502e846 commit 88e96c5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/c8y/paginationOptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 88e96c5

Please sign in to comment.