code: func NewPaginationMeta(offset, limit int, hasMore bool, currentURL string) PaginationMeta {
  	pm := PaginationMeta{
  		Limit:         limit,
  		CurrentOffset: offset,
  	}
  
  	// Calculate next/prev offsets, leave nil if not valid pages
  	nextOffset := offset + limit
  	if hasMore {
  		pm.NextOffset = &nextOffset
  	}
  
  	prevOffset := offset - limit
  	if prevOffset < 0 {
  		prevOffset = 0
  	}
  	if prevOffset < offset {
  		pm.PrevOffset = &prevOffset
  	}
  
  	// If URL format provided, populate URLs. Intentionally swallow URL errors for now, API should
  	// catch missing URLs if we call with bad URL arg (and we care about them being present).
  	if currentURL != "" && pm.NextOffset != nil {
  		pm.NextURL, _ = setQueryParam(currentURL, "offset", *pm.NextOffset, 0)
  	}
  	if currentURL != "" && pm.PrevOffset != nil {
  		pm.PrevURL, _ = setQueryParam(currentURL, "offset", *pm.PrevOffset, 0)
  	}
  
  	return pm
  }
docs: // NewPaginationMeta populates pagination meta data from result parameters