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

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

// NewPutCompanyServiceParams creates a new PutCompanyServiceParams 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 NewPutCompanyServiceParams() *PutCompanyServiceParams {
	return NewPutCompanyServiceParamsWithTimeout(cr.DefaultTimeout)
}

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

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

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

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

	for the put company service operation.

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

	// CompanyServiceRequest.
	//
	// An array of new CompanyService records
	CompanyServiceRequest *research_models.CompanyServiceRequest

	HTTPClient *http.Client

	inner innerParams
}

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

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

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

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

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

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

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

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

// WithCompanyServiceRequest adds the companyServiceRequest to the put company service params.
func (o *PutCompanyServiceParams) WithCompanyServiceRequest(companyServiceRequest *research_models.CompanyServiceRequest) *PutCompanyServiceParams {
	o.SetCompanyServiceRequest(companyServiceRequest)
	return o
}

// SetCompanyServiceRequest adds the companyServiceRequest to the put company service params.
func (o *PutCompanyServiceParams) SetCompanyServiceRequest(companyServiceRequest *research_models.CompanyServiceRequest) {
	o.CompanyServiceRequest = companyServiceRequest
}

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

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