// Code generated by go-swagger; DO NOT EDIT. package operations // 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" ) // NewGetFleetsParams creates a new GetFleetsParams 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 NewGetFleetsParams() *GetFleetsParams { return &GetFleetsParams{ timeout: cr.DefaultTimeout, } } // NewGetFleetsParamsWithTimeout creates a new GetFleetsParams object // with the ability to set a timeout on a request. func NewGetFleetsParamsWithTimeout(timeout time.Duration) *GetFleetsParams { return &GetFleetsParams{ timeout: timeout, } } // NewGetFleetsParamsWithContext creates a new GetFleetsParams object // with the ability to set a context for a request. func NewGetFleetsParamsWithContext(ctx context.Context) *GetFleetsParams { return &GetFleetsParams{ Context: ctx, } } // NewGetFleetsParamsWithHTTPClient creates a new GetFleetsParams object // with the ability to set a custom HTTPClient for a request. func NewGetFleetsParamsWithHTTPClient(client *http.Client) *GetFleetsParams { return &GetFleetsParams{ HTTPClient: client, } } /* GetFleetsParams contains all the parameters to send to the API endpoint for the get fleets operation. Typically these are written to a http.Request. */ type GetFleetsParams struct { /* Limit. Max number of records */ Limit *int64 /* Offset. Records offset */ Offset *int64 /* Tags. Tags associated with fleet */ Tags *string timeout time.Duration Context context.Context HTTPClient *http.Client } // WithDefaults hydrates default values in the get fleets params (not the query body). // // All values with no default are reset to their zero value. func (o *GetFleetsParams) WithDefaults() *GetFleetsParams { o.SetDefaults() return o } // SetDefaults hydrates default values in the get fleets params (not the query body). // // All values with no default are reset to their zero value. func (o *GetFleetsParams) SetDefaults() { // no default values defined for this parameter } // WithTimeout adds the timeout to the get fleets params func (o *GetFleetsParams) WithTimeout(timeout time.Duration) *GetFleetsParams { o.SetTimeout(timeout) return o } // SetTimeout adds the timeout to the get fleets params func (o *GetFleetsParams) SetTimeout(timeout time.Duration) { o.timeout = timeout } // WithContext adds the context to the get fleets params func (o *GetFleetsParams) WithContext(ctx context.Context) *GetFleetsParams { o.SetContext(ctx) return o } // SetContext adds the context to the get fleets params func (o *GetFleetsParams) SetContext(ctx context.Context) { o.Context = ctx } // WithHTTPClient adds the HTTPClient to the get fleets params func (o *GetFleetsParams) WithHTTPClient(client *http.Client) *GetFleetsParams { o.SetHTTPClient(client) return o } // SetHTTPClient adds the HTTPClient to the get fleets params func (o *GetFleetsParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } // WithLimit adds the limit to the get fleets params func (o *GetFleetsParams) WithLimit(limit *int64) *GetFleetsParams { o.SetLimit(limit) return o } // SetLimit adds the limit to the get fleets params func (o *GetFleetsParams) SetLimit(limit *int64) { o.Limit = limit } // WithOffset adds the offset to the get fleets params func (o *GetFleetsParams) WithOffset(offset *int64) *GetFleetsParams { o.SetOffset(offset) return o } // SetOffset adds the offset to the get fleets params func (o *GetFleetsParams) SetOffset(offset *int64) { o.Offset = offset } // WithTags adds the tags to the get fleets params func (o *GetFleetsParams) WithTags(tags *string) *GetFleetsParams { o.SetTags(tags) return o } // SetTags adds the tags to the get fleets params func (o *GetFleetsParams) SetTags(tags *string) { o.Tags = tags } // WriteToRequest writes these params to a swagger request func (o *GetFleetsParams) 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.Offset != nil { // query param offset var qrOffset int64 if o.Offset != nil { qrOffset = *o.Offset } qOffset := swag.FormatInt64(qrOffset) if qOffset != "" { if err := r.SetQueryParam("offset", qOffset); err != nil { return err } } } if o.Tags != nil { // query param tags var qrTags string if o.Tags != nil { qrTags = *o.Tags } qTags := qrTags if qTags != "" { if err := r.SetQueryParam("tags", qTags); err != nil { return err } } } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }