// 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/fiskerinc/cloud-services/pkg/ota_api/models"
)

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

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

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

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

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

	for the post manifest sums version rxswins operation.

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

	/* SwVersionRxSwins.

	   SwVersionRxSwin data
	*/
	SwVersionRxSwins *models.CommonSwVersionRxSwinCreate

	/* Version.

	   Update manifest version name
	*/
	Version string

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

// WithDefaults hydrates default values in the post manifest sums version rxswins params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostManifestSumsVersionRxswinsParams) WithDefaults() *PostManifestSumsVersionRxswinsParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the post manifest sums version rxswins params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostManifestSumsVersionRxswinsParams) SetDefaults() {
	// no default values defined for this parameter
}

// WithTimeout adds the timeout to the post manifest sums version rxswins params
func (o *PostManifestSumsVersionRxswinsParams) WithTimeout(timeout time.Duration) *PostManifestSumsVersionRxswinsParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the post manifest sums version rxswins params
func (o *PostManifestSumsVersionRxswinsParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the post manifest sums version rxswins params
func (o *PostManifestSumsVersionRxswinsParams) WithContext(ctx context.Context) *PostManifestSumsVersionRxswinsParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the post manifest sums version rxswins params
func (o *PostManifestSumsVersionRxswinsParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the post manifest sums version rxswins params
func (o *PostManifestSumsVersionRxswinsParams) WithHTTPClient(client *http.Client) *PostManifestSumsVersionRxswinsParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the post manifest sums version rxswins params
func (o *PostManifestSumsVersionRxswinsParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithSwVersionRxSwins adds the swVersionRxSwins to the post manifest sums version rxswins params
func (o *PostManifestSumsVersionRxswinsParams) WithSwVersionRxSwins(swVersionRxSwins *models.CommonSwVersionRxSwinCreate) *PostManifestSumsVersionRxswinsParams {
	o.SetSwVersionRxSwins(swVersionRxSwins)
	return o
}

// SetSwVersionRxSwins adds the swVersionRxSwins to the post manifest sums version rxswins params
func (o *PostManifestSumsVersionRxswinsParams) SetSwVersionRxSwins(swVersionRxSwins *models.CommonSwVersionRxSwinCreate) {
	o.SwVersionRxSwins = swVersionRxSwins
}

// WithVersion adds the version to the post manifest sums version rxswins params
func (o *PostManifestSumsVersionRxswinsParams) WithVersion(version string) *PostManifestSumsVersionRxswinsParams {
	o.SetVersion(version)
	return o
}

// SetVersion adds the version to the post manifest sums version rxswins params
func (o *PostManifestSumsVersionRxswinsParams) SetVersion(version string) {
	o.Version = version
}

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

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

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

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