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

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

// NewPutResearchProjectCompaniesParams creates a new PutResearchProjectCompaniesParams 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 NewPutResearchProjectCompaniesParams() *PutResearchProjectCompaniesParams {
	return NewPutResearchProjectCompaniesParamsWithTimeout(cr.DefaultTimeout)
}

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

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

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

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

	for the put research project companies operation.

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

	// ResearchProjectCompanyRequest.
	//
	// An array of new ResearchProjectCompany records
	ResearchProjectCompanyRequest *sfgate_models.ResearchProjectCompanyRequest

	HTTPClient *http.Client

	inner innerParams
}

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

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

// WithTimeout adds the timeout to the put research project companies params.
func (o *PutResearchProjectCompaniesParams) WithTimeout(timeout time.Duration) *PutResearchProjectCompaniesParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the put research project companies params.
func (o *PutResearchProjectCompaniesParams) SetTimeout(timeout time.Duration) {
	o.inner.timeout = timeout
}

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

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

// WithHTTPClient adds the HTTPClient to the put research project companies params.
func (o *PutResearchProjectCompaniesParams) WithHTTPClient(client *http.Client) *PutResearchProjectCompaniesParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the put research project companies params.
func (o *PutResearchProjectCompaniesParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithResearchProjectCompanyRequest adds the researchProjectCompanyRequest to the put research project companies params.
func (o *PutResearchProjectCompaniesParams) WithResearchProjectCompanyRequest(researchProjectCompanyRequest *sfgate_models.ResearchProjectCompanyRequest) *PutResearchProjectCompaniesParams {
	o.SetResearchProjectCompanyRequest(researchProjectCompanyRequest)
	return o
}

// SetResearchProjectCompanyRequest adds the researchProjectCompanyRequest to the put research project companies params.
func (o *PutResearchProjectCompaniesParams) SetResearchProjectCompanyRequest(researchProjectCompanyRequest *sfgate_models.ResearchProjectCompanyRequest) {
	o.ResearchProjectCompanyRequest = researchProjectCompanyRequest
}

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

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