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

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

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

// NewPostIndustryCompaniesParams creates a new PostIndustryCompaniesParams 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 NewPostIndustryCompaniesParams() *PostIndustryCompaniesParams {
	return NewPostIndustryCompaniesParamsWithTimeout(cr.DefaultTimeout)
}

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

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

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

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

	for the post industry companies operation.

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

	// IndustryCompanyRequest.
	//
	// A request with an array of IndustryCompany Objects
	IndustryCompanyRequest *sfgate_models.IndustryCompanyRequest

	HTTPClient *http.Client

	inner innerParams
}

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

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

// WithTimeout adds the timeout to the post industry companies params.
func (o *PostIndustryCompaniesParams) WithTimeout(timeout time.Duration) *PostIndustryCompaniesParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the post industry companies params.
func (o *PostIndustryCompaniesParams) SetTimeout(timeout time.Duration) {
	o.inner.timeout = timeout
}

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

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

// WithHTTPClient adds the HTTPClient to the post industry companies params.
func (o *PostIndustryCompaniesParams) WithHTTPClient(client *http.Client) *PostIndustryCompaniesParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the post industry companies params.
func (o *PostIndustryCompaniesParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithIndustryCompanyRequest adds the industryCompanyRequest to the post industry companies params.
func (o *PostIndustryCompaniesParams) WithIndustryCompanyRequest(industryCompanyRequest *sfgate_models.IndustryCompanyRequest) *PostIndustryCompaniesParams {
	o.SetIndustryCompanyRequest(industryCompanyRequest)
	return o
}

// SetIndustryCompanyRequest adds the industryCompanyRequest to the post industry companies params.
func (o *PostIndustryCompaniesParams) SetIndustryCompanyRequest(industryCompanyRequest *sfgate_models.IndustryCompanyRequest) {
	o.IndustryCompanyRequest = industryCompanyRequest
}

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

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