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

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

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

	/*Product
	  Product to be added

	*/
	Product *models.Product

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

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

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

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

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

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

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

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

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

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

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

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

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