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

// NewSubmitCompanyProductProposalParams creates a new SubmitCompanyProductProposalParams 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 NewSubmitCompanyProductProposalParams() *SubmitCompanyProductProposalParams {
	return NewSubmitCompanyProductProposalParamsWithTimeout(cr.DefaultTimeout)
}

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

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

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

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

	for the submit company product proposal operation.

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

	// CompanyProductProposalID.
	//
	// CompanyProduct proposal record ID
	//
	// Format: uuid
	CompanyProductProposalID strfmt.UUID

	// CompanyProductProposalSubmitRequest.
	//
	// Optimistic draft submission request
	CompanyProductProposalSubmitRequest *research_models.CompanyProductProposalSubmitRequest

	HTTPClient *http.Client

	inner innerParams
}

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

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

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

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

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

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

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

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

// WithCompanyProductProposalID adds the companyProductProposalID to the submit company product proposal params.
func (o *SubmitCompanyProductProposalParams) WithCompanyProductProposalID(companyProductProposalID strfmt.UUID) *SubmitCompanyProductProposalParams {
	o.SetCompanyProductProposalID(companyProductProposalID)
	return o
}

// SetCompanyProductProposalID adds the companyProductProposalId to the submit company product proposal params.
func (o *SubmitCompanyProductProposalParams) SetCompanyProductProposalID(companyProductProposalID strfmt.UUID) {
	o.CompanyProductProposalID = companyProductProposalID
}

// WithCompanyProductProposalSubmitRequest adds the companyProductProposalSubmitRequest to the submit company product proposal params.
func (o *SubmitCompanyProductProposalParams) WithCompanyProductProposalSubmitRequest(companyProductProposalSubmitRequest *research_models.CompanyProductProposalSubmitRequest) *SubmitCompanyProductProposalParams {
	o.SetCompanyProductProposalSubmitRequest(companyProductProposalSubmitRequest)
	return o
}

// SetCompanyProductProposalSubmitRequest adds the companyProductProposalSubmitRequest to the submit company product proposal params.
func (o *SubmitCompanyProductProposalParams) SetCompanyProductProposalSubmitRequest(companyProductProposalSubmitRequest *research_models.CompanyProductProposalSubmitRequest) {
	o.CompanyProductProposalSubmitRequest = companyProductProposalSubmitRequest
}

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

	// path param companyProductProposalId
	if err := r.SetPathParam("companyProductProposalId", o.CompanyProductProposalID.String()); err != nil {
		return err
	}
	if o.CompanyProductProposalSubmitRequest != nil {
		if err := r.SetBodyParam(o.CompanyProductProposalSubmitRequest); err != nil {
			return err
		}
	}

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