// 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/members/members_models"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
	cr "github.com/go-openapi/runtime/client"
	"github.com/go-openapi/strfmt"
)

// NewPostResearchProjectCompaniesParams creates a new PostResearchProjectCompaniesParams 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 NewPostResearchProjectCompaniesParams() *PostResearchProjectCompaniesParams {
	return NewPostResearchProjectCompaniesParamsWithTimeout(cr.DefaultTimeout)
}

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

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

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

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

	for the post research project companies operation.

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

	// XAuth0UserID.
	//
	// Auth0 User Id
	XAuth0UserID *string

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

	HTTPClient *http.Client

	inner innerParams
}

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

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

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

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

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

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

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

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

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

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

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

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

// WriteToRequest writes these params to a [runtime.ClientRequest].
func (o *PostResearchProjectCompaniesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
	if err := r.SetTimeout(o.inner.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
}
