Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct {
// Order of the resources in the response. desc (default), asc.
// Order is optional.
Order string `json:"order"`
// Limit number of results per call. Accepted values: 0 - 100. Default 25
// Limit is optional.
Limit int `json:"limit"`
// StartingAfter is a cursor for use in pagination.
// StartingAfter is a resource ID that defines your place in the list.
// StartingAfter is optional.
StartingAfter *string `json:"starting_after"`
// EndingBefore is cursor for use in pagination.
// EndingBefore is a resource ID that defines your place in the list.
// EndingBefore is optional.
EndingBefore *string `json:"ending_before"`
}
Request is a parameter to return list of data with pagination. Request is optional, most fields automatically filled by system. If you already have a response with pagination, you can generate pagination request directly to traverse next or prev page.
func (Request) QueryParams ¶
type Response ¶
type Response struct {
Order string `json:"order"`
StartingAfter *string `json:"starting_after"`
EndingBefore *string `json:"ending_before"`
Total int `json:"total"`
Yielded int `json:"yielded"`
Limit int `json:"limit"`
PreviousURI *string `json:"previous_uri"`
NextURI *string `json:"next_uri"`
// CursorRange returns cursors for starting after and ending before.
// Format: [starting_after, ending_before].
CursorRange []string `json:"cursor_range"`
}
func (*Response) HasNextPage ¶
HasNextPage returns true if next page exists and can be traversed.
func (*Response) HasPrevPage ¶
HasPrevPage returns true if prev page exists and can be traversed.
func (*Response) NextPageCursor ¶
NextPageCursor returns cursor to be used as starting after value.
func (*Response) NextPageRequest ¶
NextPageRequest returns pagination request for the next page result.
func (*Response) PrevPageCursor ¶
PrevPageCursor returns cursor to be used as ending before value.
func (*Response) PrevPageRequest ¶
PrevPageRequest returns pagination request for the prev page result.