github.com/hashicorp/hcp-sdk-go@v0.94.0/clients/cloud-billing/preview/2020-11-05/models/common_pagination_request.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package models 4 5 // This file was generated by the swagger tool. 6 // Editing this file might prove futile when you re-run the swagger generate command 7 8 import ( 9 "context" 10 11 "github.com/go-openapi/strfmt" 12 "github.com/go-openapi/swag" 13 ) 14 15 // CommonPaginationRequest PaginationRequest are the parameters for a paginated list request. 16 // 17 // swagger:model commonPaginationRequest 18 type CommonPaginationRequest struct { 19 20 // Specifies a page token to use to retrieve the next page. Set this to the 21 // `next_page_token` returned by previous list requests to get the next page of 22 // results. If set, `previous_page_token` must not be set. 23 NextPageToken string `json:"next_page_token,omitempty"` 24 25 // The max number of results per page that should be returned. If the number 26 // of available results is larger than `page_size`, a `next_page_token` is 27 // returned which can be used to get the next page of results in subsequent 28 // requests. A value of zero will cause `page_size` to be defaulted. 29 PageSize int64 `json:"page_size,omitempty"` 30 31 // Specifies a page token to use to retrieve the previous page. Set this to 32 // the `previous_page_token` returned by previous list requests to get the 33 // previous page of results. If set, `next_page_token` must not be set. 34 PreviousPageToken string `json:"previous_page_token,omitempty"` 35 } 36 37 // Validate validates this common pagination request 38 func (m *CommonPaginationRequest) Validate(formats strfmt.Registry) error { 39 return nil 40 } 41 42 // ContextValidate validates this common pagination request based on context it is used 43 func (m *CommonPaginationRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { 44 return nil 45 } 46 47 // MarshalBinary interface implementation 48 func (m *CommonPaginationRequest) MarshalBinary() ([]byte, error) { 49 if m == nil { 50 return nil, nil 51 } 52 return swag.WriteJSON(m) 53 } 54 55 // UnmarshalBinary interface implementation 56 func (m *CommonPaginationRequest) UnmarshalBinary(b []byte) error { 57 var res CommonPaginationRequest 58 if err := swag.ReadJSON(b, &res); err != nil { 59 return err 60 } 61 *m = res 62 return nil 63 }