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

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

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

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

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

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

	for the delete company product operation.

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

	/* CompanyProductID.

	   CompanyProduct record ID
	*/
	CompanyProductID *string

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

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

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

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

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

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

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

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

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

// WithCompanyProductID adds the companyProductID to the delete company product params
func (o *DeleteCompanyProductParams) WithCompanyProductID(companyProductID *string) *DeleteCompanyProductParams {
	o.SetCompanyProductID(companyProductID)
	return o
}

// SetCompanyProductID adds the companyProductId to the delete company product params
func (o *DeleteCompanyProductParams) SetCompanyProductID(companyProductID *string) {
	o.CompanyProductID = companyProductID
}

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

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

	if o.CompanyProductID != nil {

		// query param companyProductId
		var qrCompanyProductID string

		if o.CompanyProductID != nil {
			qrCompanyProductID = *o.CompanyProductID
		}
		qCompanyProductID := qrCompanyProductID
		if qCompanyProductID != "" {

			if err := r.SetQueryParam("companyProductId", qCompanyProductID); err != nil {
				return err
			}
		}
	}

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