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

package models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"net/http"
	"time"

	"golang.org/x/net/context"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
	cr "github.com/go-openapi/runtime/client"

	strfmt "github.com/go-openapi/strfmt"
)

// NewListModelsParams creates a new ListModelsParams object
// with the default values initialized.
func NewListModelsParams() *ListModelsParams {
	var (
		versionDefault = string("2017-02-13")
	)
	return &ListModelsParams{
		Version: versionDefault,

		timeout: cr.DefaultTimeout,
	}
}

// NewListModelsParamsWithTimeout creates a new ListModelsParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewListModelsParamsWithTimeout(timeout time.Duration) *ListModelsParams {
	var (
		versionDefault = string("2017-02-13")
	)
	return &ListModelsParams{
		Version: versionDefault,

		timeout: timeout,
	}
}

// NewListModelsParamsWithContext creates a new ListModelsParams object
// with the default values initialized, and the ability to set a context for a request
func NewListModelsParamsWithContext(ctx context.Context) *ListModelsParams {
	var (
		versionDefault = string("2017-02-13")
	)
	return &ListModelsParams{
		Version: versionDefault,

		Context: ctx,
	}
}

// NewListModelsParamsWithHTTPClient creates a new ListModelsParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewListModelsParamsWithHTTPClient(client *http.Client) *ListModelsParams {
	var (
		versionDefault = string("2017-02-13")
	)
	return &ListModelsParams{
		Version:    versionDefault,
		HTTPClient: client,
	}
}

/*ListModelsParams contains all the parameters to send to the API endpoint
for the list models operation typically these are written to a http.Request
*/
type ListModelsParams struct {

	/*Version
	  The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

	*/
	Version string

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

// WithTimeout adds the timeout to the list models params
func (o *ListModelsParams) WithTimeout(timeout time.Duration) *ListModelsParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the list models params
func (o *ListModelsParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the list models params
func (o *ListModelsParams) WithContext(ctx context.Context) *ListModelsParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the list models params
func (o *ListModelsParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the list models params
func (o *ListModelsParams) WithHTTPClient(client *http.Client) *ListModelsParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the list models params
func (o *ListModelsParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithVersion adds the version to the list models params
func (o *ListModelsParams) WithVersion(version string) *ListModelsParams {
	o.SetVersion(version)
	return o
}

// SetVersion adds the version to the list models params
func (o *ListModelsParams) SetVersion(version string) {
	o.Version = version
}

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

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

	// query param version
	qrVersion := o.Version
	qVersion := qrVersion
	if qVersion != "" {
		if err := r.SetQueryParam("version", qVersion); err != nil {
			return err
		}
	}

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