// Code generated by go-swagger; DO NOT EDIT.

package datasources

// 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"
)

// NewGetDataSourcesParams creates a new GetDataSourcesParams 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 NewGetDataSourcesParams() *GetDataSourcesParams {
	return &GetDataSourcesParams{
		timeout: cr.DefaultTimeout,
	}
}

// NewGetDataSourcesParamsWithTimeout creates a new GetDataSourcesParams object
// with the ability to set a timeout on a request.
func NewGetDataSourcesParamsWithTimeout(timeout time.Duration) *GetDataSourcesParams {
	return &GetDataSourcesParams{
		timeout: timeout,
	}
}

// NewGetDataSourcesParamsWithContext creates a new GetDataSourcesParams object
// with the ability to set a context for a request.
func NewGetDataSourcesParamsWithContext(ctx context.Context) *GetDataSourcesParams {
	return &GetDataSourcesParams{
		Context: ctx,
	}
}

// NewGetDataSourcesParamsWithHTTPClient creates a new GetDataSourcesParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetDataSourcesParamsWithHTTPClient(client *http.Client) *GetDataSourcesParams {
	return &GetDataSourcesParams{
		HTTPClient: client,
	}
}

/*
GetDataSourcesParams contains all the parameters to send to the API endpoint

	for the get data sources operation.

	Typically these are written to a http.Request.
*/
type GetDataSourcesParams struct {
	timeout    time.Duration
	Context    context.Context
	HTTPClient *http.Client
}

// WithDefaults hydrates default values in the get data sources params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetDataSourcesParams) WithDefaults() *GetDataSourcesParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the get data sources params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetDataSourcesParams) SetDefaults() {
	// no default values defined for this parameter
}

// WithTimeout adds the timeout to the get data sources params
func (o *GetDataSourcesParams) WithTimeout(timeout time.Duration) *GetDataSourcesParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the get data sources params
func (o *GetDataSourcesParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the get data sources params
func (o *GetDataSourcesParams) WithContext(ctx context.Context) *GetDataSourcesParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the get data sources params
func (o *GetDataSourcesParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the get data sources params
func (o *GetDataSourcesParams) WithHTTPClient(client *http.Client) *GetDataSourcesParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the get data sources params
func (o *GetDataSourcesParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WriteToRequest writes these params to a swagger request
func (o *GetDataSourcesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	if err := r.SetTimeout(o.timeout); err != nil {
		return err
	}
	var res []error

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
