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

package product_management

// 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/Cyclops-Labs/cyclops-4-hpc.git/services/customerdb/models"
)

// NewUpdateProductParams creates a new UpdateProductParams object
// with the default values initialized.
func NewUpdateProductParams() *UpdateProductParams {
	var ()
	return &UpdateProductParams{

		timeout: cr.DefaultTimeout,
	}
}

// NewUpdateProductParamsWithTimeout creates a new UpdateProductParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewUpdateProductParamsWithTimeout(timeout time.Duration) *UpdateProductParams {
	var ()
	return &UpdateProductParams{

		timeout: timeout,
	}
}

// NewUpdateProductParamsWithContext creates a new UpdateProductParams object
// with the default values initialized, and the ability to set a context for a request
func NewUpdateProductParamsWithContext(ctx context.Context) *UpdateProductParams {
	var ()
	return &UpdateProductParams{

		Context: ctx,
	}
}

// NewUpdateProductParamsWithHTTPClient creates a new UpdateProductParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewUpdateProductParamsWithHTTPClient(client *http.Client) *UpdateProductParams {
	var ()
	return &UpdateProductParams{
		HTTPClient: client,
	}
}

/*UpdateProductParams contains all the parameters to send to the API endpoint
for the update product operation typically these are written to a http.Request
*/
type UpdateProductParams struct {

	/*ID
	  Id of the product to be updated

	*/
	ID string
	/*Product
	  Product to be updated

	*/
	Product *models.Product

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

// WithTimeout adds the timeout to the update product params
func (o *UpdateProductParams) WithTimeout(timeout time.Duration) *UpdateProductParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the update product params
func (o *UpdateProductParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the update product params
func (o *UpdateProductParams) WithContext(ctx context.Context) *UpdateProductParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the update product params
func (o *UpdateProductParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the update product params
func (o *UpdateProductParams) WithHTTPClient(client *http.Client) *UpdateProductParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the update product params
func (o *UpdateProductParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithID adds the id to the update product params
func (o *UpdateProductParams) WithID(id string) *UpdateProductParams {
	o.SetID(id)
	return o
}

// SetID adds the id to the update product params
func (o *UpdateProductParams) SetID(id string) {
	o.ID = id
}

// WithProduct adds the product to the update product params
func (o *UpdateProductParams) WithProduct(product *models.Product) *UpdateProductParams {
	o.SetProduct(product)
	return o
}

// SetProduct adds the product to the update product params
func (o *UpdateProductParams) SetProduct(product *models.Product) {
	o.Product = product
}

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

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

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

	if o.Product != nil {
		if err := r.SetBodyParam(o.Product); err != nil {
			return err
		}
	}

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