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

import (
	"context"
	"net/http"
	"time"

	"code.tnxs.net/vernonkeenan/lib/api/research/research_models"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
	cr "github.com/go-openapi/runtime/client"
	"github.com/go-openapi/strfmt"
)

// NewPostCompanyProductProposalParams creates a new PostCompanyProductProposalParams 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 NewPostCompanyProductProposalParams() *PostCompanyProductProposalParams {
	return NewPostCompanyProductProposalParamsWithTimeout(cr.DefaultTimeout)
}

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

// NewPostCompanyProductProposalParamsWithContext creates a new PostCompanyProductProposalParams object
// with the ability to set a context for a request.
//
// Deprecated: use the operation call with context to pass the context instead of [PostCompanyProductProposalParams].
func NewPostCompanyProductProposalParamsWithContext(ctx context.Context) *PostCompanyProductProposalParams {
	return &PostCompanyProductProposalParams{
		inner: innerParams{
			ctx: ctx,
		},
	}
}

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

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

	for the post company product proposal operation.

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

	// CompanyProductProposalRequest.
	//
	// A human-attributed draft proposal for an existing CompanyProduct
	CompanyProductProposalRequest *research_models.CompanyProductProposalRequest

	HTTPClient *http.Client

	inner innerParams
}

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

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

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

// SetTimeout adds the timeout to the post company product proposal params.
func (o *PostCompanyProductProposalParams) SetTimeout(timeout time.Duration) {
	o.inner.timeout = timeout
}

// WithContext adds the context to the post company product proposal params.
//
// Deprecated: use the operation call with context to pass the context instead of [PostCompanyProductProposalParams].
func (o *PostCompanyProductProposalParams) WithContext(ctx context.Context) *PostCompanyProductProposalParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the post company product proposal params.
//
// Deprecated: use the operation call with context to pass the context instead of [PostCompanyProductProposalParams].
func (o *PostCompanyProductProposalParams) SetContext(ctx context.Context) {
	o.inner.ctx = ctx
}

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

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

// WithCompanyProductProposalRequest adds the companyProductProposalRequest to the post company product proposal params.
func (o *PostCompanyProductProposalParams) WithCompanyProductProposalRequest(companyProductProposalRequest *research_models.CompanyProductProposalRequest) *PostCompanyProductProposalParams {
	o.SetCompanyProductProposalRequest(companyProductProposalRequest)
	return o
}

// SetCompanyProductProposalRequest adds the companyProductProposalRequest to the post company product proposal params.
func (o *PostCompanyProductProposalParams) SetCompanyProductProposalRequest(companyProductProposalRequest *research_models.CompanyProductProposalRequest) {
	o.CompanyProductProposalRequest = companyProductProposalRequest
}

// WriteToRequest writes these params to a [runtime.ClientRequest].
func (o *PostCompanyProductProposalParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
	if err := r.SetTimeout(o.inner.timeout); err != nil {
		return err
	}
	var res []error
	if o.CompanyProductProposalRequest != nil {
		if err := r.SetBodyParam(o.CompanyProductProposalRequest); err != nil {
			return err
		}
	}

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