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

// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package company_products

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

	"code.tnxs.net/vernonkeenan/lib/api/research/research_models"
)

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

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

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

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

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

	for the put company product operation.

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

	/* CompanyProductRequest.

	   An array of new CompanyProduct records
	*/
	CompanyProductRequest *research_models.CompanyProductRequest

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

// WithDefaults hydrates default values in the put company product params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutCompanyProductParams) WithDefaults() *PutCompanyProductParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the put company product params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutCompanyProductParams) SetDefaults() {
	// no default values defined for this parameter
}

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

// SetTimeout adds the timeout to the put company product params
func (o *PutCompanyProductParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

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

// SetContext adds the context to the put company product params
func (o *PutCompanyProductParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

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

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

// WithCompanyProductRequest adds the companyProductRequest to the put company product params
func (o *PutCompanyProductParams) WithCompanyProductRequest(companyProductRequest *research_models.CompanyProductRequest) *PutCompanyProductParams {
	o.SetCompanyProductRequest(companyProductRequest)
	return o
}

// SetCompanyProductRequest adds the companyProductRequest to the put company product params
func (o *PutCompanyProductParams) SetCompanyProductRequest(companyProductRequest *research_models.CompanyProductRequest) {
	o.CompanyProductRequest = companyProductRequest
}

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

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

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