// Code generated by go-swagger; DO NOT EDIT. package task // 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/decentral1se/go-kimai/models" ) // NewGetAPITasksParams creates a new GetAPITasksParams 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 NewGetAPITasksParams() *GetAPITasksParams { return &GetAPITasksParams{ timeout: cr.DefaultTimeout, } } // NewGetAPITasksParamsWithTimeout creates a new GetAPITasksParams object // with the ability to set a timeout on a request. func NewGetAPITasksParamsWithTimeout(timeout time.Duration) *GetAPITasksParams { return &GetAPITasksParams{ timeout: timeout, } } // NewGetAPITasksParamsWithContext creates a new GetAPITasksParams object // with the ability to set a context for a request. func NewGetAPITasksParamsWithContext(ctx context.Context) *GetAPITasksParams { return &GetAPITasksParams{ Context: ctx, } } // NewGetAPITasksParamsWithHTTPClient creates a new GetAPITasksParams object // with the ability to set a custom HTTPClient for a request. func NewGetAPITasksParamsWithHTTPClient(client *http.Client) *GetAPITasksParams { return &GetAPITasksParams{ HTTPClient: client, } } /* GetAPITasksParams contains all the parameters to send to the API endpoint for the get API tasks operation. Typically these are written to a http.Request. */ type GetAPITasksParams struct { /* Query. Attention: This is a GET request and you can pass in every field of the form as query parameter. */ Query *models.TaskQuery timeout time.Duration Context context.Context HTTPClient *http.Client } // WithDefaults hydrates default values in the get API tasks params (not the query body). // // All values with no default are reset to their zero value. func (o *GetAPITasksParams) WithDefaults() *GetAPITasksParams { o.SetDefaults() return o } // SetDefaults hydrates default values in the get API tasks params (not the query body). // // All values with no default are reset to their zero value. func (o *GetAPITasksParams) SetDefaults() { // no default values defined for this parameter } // WithTimeout adds the timeout to the get API tasks params func (o *GetAPITasksParams) WithTimeout(timeout time.Duration) *GetAPITasksParams { o.SetTimeout(timeout) return o } // SetTimeout adds the timeout to the get API tasks params func (o *GetAPITasksParams) SetTimeout(timeout time.Duration) { o.timeout = timeout } // WithContext adds the context to the get API tasks params func (o *GetAPITasksParams) WithContext(ctx context.Context) *GetAPITasksParams { o.SetContext(ctx) return o } // SetContext adds the context to the get API tasks params func (o *GetAPITasksParams) SetContext(ctx context.Context) { o.Context = ctx } // WithHTTPClient adds the HTTPClient to the get API tasks params func (o *GetAPITasksParams) WithHTTPClient(client *http.Client) *GetAPITasksParams { o.SetHTTPClient(client) return o } // SetHTTPClient adds the HTTPClient to the get API tasks params func (o *GetAPITasksParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } // WithQuery adds the query to the get API tasks params func (o *GetAPITasksParams) WithQuery(query *models.TaskQuery) *GetAPITasksParams { o.SetQuery(query) return o } // SetQuery adds the query to the get API tasks params func (o *GetAPITasksParams) SetQuery(query *models.TaskQuery) { o.Query = query } // WriteToRequest writes these params to a swagger request func (o *GetAPITasksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { if err := r.SetTimeout(o.timeout); err != nil { return err } var res []error if o.Query != nil { if err := r.SetBodyParam(o.Query); err != nil { return err } } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }