// Code generated by go-swagger; DO NOT EDIT. package bookmarks // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "context" "net/http" "time" "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // NewBookmarksGetParams creates a new BookmarksGetParams object, // with the default timeout for this client. // // Default values are not hydrated, since defaults are normally applied by the API server side. // // To enforce default values in parameter, use SetDefaults or WithDefaults. func NewBookmarksGetParams() *BookmarksGetParams { return &BookmarksGetParams{ timeout: cr.DefaultTimeout, } } // NewBookmarksGetParamsWithTimeout creates a new BookmarksGetParams object // with the ability to set a timeout on a request. func NewBookmarksGetParamsWithTimeout(timeout time.Duration) *BookmarksGetParams { return &BookmarksGetParams{ timeout: timeout, } } // NewBookmarksGetParamsWithContext creates a new BookmarksGetParams object // with the ability to set a context for a request. func NewBookmarksGetParamsWithContext(ctx context.Context) *BookmarksGetParams { return &BookmarksGetParams{ Context: ctx, } } // NewBookmarksGetParamsWithHTTPClient creates a new BookmarksGetParams object // with the ability to set a custom HTTPClient for a request. func NewBookmarksGetParamsWithHTTPClient(client *http.Client) *BookmarksGetParams { return &BookmarksGetParams{ HTTPClient: client, } } /* BookmarksGetParams contains all the parameters to send to the API endpoint for the bookmarks get operation. Typically these are written to a http.Request. */ type BookmarksGetParams struct { /* Limit. Number of statuses to return. Default: 30 */ Limit *int64 /* MaxID. Return only bookmarked statuses *OLDER* than the given bookmark ID. The status with the corresponding bookmark ID will not be included in the response. */ MaxID *string /* MinID. Return only bookmarked statuses *NEWER* than the given bookmark ID. The status with the corresponding bookmark ID will not be included in the response. */ MinID *string timeout time.Duration Context context.Context HTTPClient *http.Client } // WithDefaults hydrates default values in the bookmarks get params (not the query body). // // All values with no default are reset to their zero value. func (o *BookmarksGetParams) WithDefaults() *BookmarksGetParams { o.SetDefaults() return o } // SetDefaults hydrates default values in the bookmarks get params (not the query body). // // All values with no default are reset to their zero value. func (o *BookmarksGetParams) SetDefaults() { var ( limitDefault = int64(30) ) val := BookmarksGetParams{ Limit: &limitDefault, } val.timeout = o.timeout val.Context = o.Context val.HTTPClient = o.HTTPClient *o = val } // WithTimeout adds the timeout to the bookmarks get params func (o *BookmarksGetParams) WithTimeout(timeout time.Duration) *BookmarksGetParams { o.SetTimeout(timeout) return o } // SetTimeout adds the timeout to the bookmarks get params func (o *BookmarksGetParams) SetTimeout(timeout time.Duration) { o.timeout = timeout } // WithContext adds the context to the bookmarks get params func (o *BookmarksGetParams) WithContext(ctx context.Context) *BookmarksGetParams { o.SetContext(ctx) return o } // SetContext adds the context to the bookmarks get params func (o *BookmarksGetParams) SetContext(ctx context.Context) { o.Context = ctx } // WithHTTPClient adds the HTTPClient to the bookmarks get params func (o *BookmarksGetParams) WithHTTPClient(client *http.Client) *BookmarksGetParams { o.SetHTTPClient(client) return o } // SetHTTPClient adds the HTTPClient to the bookmarks get params func (o *BookmarksGetParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } // WithLimit adds the limit to the bookmarks get params func (o *BookmarksGetParams) WithLimit(limit *int64) *BookmarksGetParams { o.SetLimit(limit) return o } // SetLimit adds the limit to the bookmarks get params func (o *BookmarksGetParams) SetLimit(limit *int64) { o.Limit = limit } // WithMaxID adds the maxID to the bookmarks get params func (o *BookmarksGetParams) WithMaxID(maxID *string) *BookmarksGetParams { o.SetMaxID(maxID) return o } // SetMaxID adds the maxId to the bookmarks get params func (o *BookmarksGetParams) SetMaxID(maxID *string) { o.MaxID = maxID } // WithMinID adds the minID to the bookmarks get params func (o *BookmarksGetParams) WithMinID(minID *string) *BookmarksGetParams { o.SetMinID(minID) return o } // SetMinID adds the minId to the bookmarks get params func (o *BookmarksGetParams) SetMinID(minID *string) { o.MinID = minID } // WriteToRequest writes these params to a swagger request func (o *BookmarksGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { if err := r.SetTimeout(o.timeout); err != nil { return err } var res []error if o.Limit != nil { // query param limit var qrLimit int64 if o.Limit != nil { qrLimit = *o.Limit } qLimit := swag.FormatInt64(qrLimit) if qLimit != "" { if err := r.SetQueryParam("limit", qLimit); err != nil { return err } } } if o.MaxID != nil { // query param max_id var qrMaxID string if o.MaxID != nil { qrMaxID = *o.MaxID } qMaxID := qrMaxID if qMaxID != "" { if err := r.SetQueryParam("max_id", qMaxID); err != nil { return err } } } if o.MinID != nil { // query param min_id var qrMinID string if o.MinID != nil { qrMinID = *o.MinID } qMinID := qrMinID if qMinID != "" { if err := r.SetQueryParam("min_id", qMinID); err != nil { return err } } } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }