// Code generated by go-swagger; DO NOT EDIT.

// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package research_projects

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

	"code.tnxs.net/work/lib/api/members/members_models"
)

// 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 &PutResearchProjectCompaniesParams{
		timeout: 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{
		timeout: timeout,
	}
}

// NewPutResearchProjectCompaniesParamsWithContext creates a new PutResearchProjectCompaniesParams object
// with the ability to set a context for a request.
func NewPutResearchProjectCompaniesParamsWithContext(ctx context.Context) *PutResearchProjectCompaniesParams {
	return &PutResearchProjectCompaniesParams{
		Context: 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 {

	/* XAuth0UserID.

	   Auth0 User Id
	*/
	XAuth0UserID *string

	/* ResearchProjectCompanyRequest.

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

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

// 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.timeout = timeout
}

// WithContext adds the context to the put research project companies params
func (o *PutResearchProjectCompaniesParams) WithContext(ctx context.Context) *PutResearchProjectCompaniesParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the put research project companies params
func (o *PutResearchProjectCompaniesParams) SetContext(ctx context.Context) {
	o.Context = 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
}

// WithXAuth0UserID adds the xAuth0UserID to the put research project companies params
func (o *PutResearchProjectCompaniesParams) WithXAuth0UserID(xAuth0UserID *string) *PutResearchProjectCompaniesParams {
	o.SetXAuth0UserID(xAuth0UserID)
	return o
}

// SetXAuth0UserID adds the xAuth0UserId to the put research project companies params
func (o *PutResearchProjectCompaniesParams) SetXAuth0UserID(xAuth0UserID *string) {
	o.XAuth0UserID = xAuth0UserID
}

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

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

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

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

	if o.XAuth0UserID != nil {

		// header param X-Auth0-UserId
		if err := r.SetHeaderParam("X-Auth0-UserId", *o.XAuth0UserID); err != nil {
			return err
		}
	}
	if o.ResearchProjectCompanyRequest != nil {
		if err := r.SetBodyParam(o.ResearchProjectCompanyRequest); err != nil {
			return err
		}
	}

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