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

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

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

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

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

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

	for the datasource proxy p o s tcalls operation.

	Typically these are written to a http.Request.
*/
type DatasourceProxyPOSTcallsParams struct {

	// DatasourceProxyParam.
	DatasourceProxyParam interface{}

	// DatasourceProxyRoute.
	DatasourceProxyRoute string

	// ID.
	ID string

	timeout    time.Duration
	Context    context.Context
	HTTPClient *http.Client
}

// WithDefaults hydrates default values in the datasource proxy p o s tcalls params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *DatasourceProxyPOSTcallsParams) WithDefaults() *DatasourceProxyPOSTcallsParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the datasource proxy p o s tcalls params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *DatasourceProxyPOSTcallsParams) SetDefaults() {
	// no default values defined for this parameter
}

// WithTimeout adds the timeout to the datasource proxy p o s tcalls params
func (o *DatasourceProxyPOSTcallsParams) WithTimeout(timeout time.Duration) *DatasourceProxyPOSTcallsParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the datasource proxy p o s tcalls params
func (o *DatasourceProxyPOSTcallsParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the datasource proxy p o s tcalls params
func (o *DatasourceProxyPOSTcallsParams) WithContext(ctx context.Context) *DatasourceProxyPOSTcallsParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the datasource proxy p o s tcalls params
func (o *DatasourceProxyPOSTcallsParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the datasource proxy p o s tcalls params
func (o *DatasourceProxyPOSTcallsParams) WithHTTPClient(client *http.Client) *DatasourceProxyPOSTcallsParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the datasource proxy p o s tcalls params
func (o *DatasourceProxyPOSTcallsParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithDatasourceProxyParam adds the datasourceProxyParam to the datasource proxy p o s tcalls params
func (o *DatasourceProxyPOSTcallsParams) WithDatasourceProxyParam(datasourceProxyParam interface{}) *DatasourceProxyPOSTcallsParams {
	o.SetDatasourceProxyParam(datasourceProxyParam)
	return o
}

// SetDatasourceProxyParam adds the datasourceProxyParam to the datasource proxy p o s tcalls params
func (o *DatasourceProxyPOSTcallsParams) SetDatasourceProxyParam(datasourceProxyParam interface{}) {
	o.DatasourceProxyParam = datasourceProxyParam
}

// WithDatasourceProxyRoute adds the datasourceProxyRoute to the datasource proxy p o s tcalls params
func (o *DatasourceProxyPOSTcallsParams) WithDatasourceProxyRoute(datasourceProxyRoute string) *DatasourceProxyPOSTcallsParams {
	o.SetDatasourceProxyRoute(datasourceProxyRoute)
	return o
}

// SetDatasourceProxyRoute adds the datasourceProxyRoute to the datasource proxy p o s tcalls params
func (o *DatasourceProxyPOSTcallsParams) SetDatasourceProxyRoute(datasourceProxyRoute string) {
	o.DatasourceProxyRoute = datasourceProxyRoute
}

// WithID adds the id to the datasource proxy p o s tcalls params
func (o *DatasourceProxyPOSTcallsParams) WithID(id string) *DatasourceProxyPOSTcallsParams {
	o.SetID(id)
	return o
}

// SetID adds the id to the datasource proxy p o s tcalls params
func (o *DatasourceProxyPOSTcallsParams) SetID(id string) {
	o.ID = id
}

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

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

	// path param datasource_proxy_route
	if err := r.SetPathParam("datasource_proxy_route", o.DatasourceProxyRoute); err != nil {
		return err
	}

	// path param id
	if err := r.SetPathParam("id", o.ID); err != nil {
		return err
	}

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