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

// NewPostResearchProjectServicesParams creates a new PostResearchProjectServicesParams 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 NewPostResearchProjectServicesParams() *PostResearchProjectServicesParams {
	return NewPostResearchProjectServicesParamsWithTimeout(cr.DefaultTimeout)
}

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

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

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

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

	for the post research project services operation.

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

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

	// ResearchProjectServiceRequest.
	//
	// An array of new ResearchProjectService records
	ResearchProjectServiceRequest *members_models.ResearchProjectServiceRequest

	HTTPClient *http.Client

	inner innerParams
}

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

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

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

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

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

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

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

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

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

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

// WithResearchProjectServiceRequest adds the researchProjectServiceRequest to the post research project services params.
func (o *PostResearchProjectServicesParams) WithResearchProjectServiceRequest(researchProjectServiceRequest *members_models.ResearchProjectServiceRequest) *PostResearchProjectServicesParams {
	o.SetResearchProjectServiceRequest(researchProjectServiceRequest)
	return o
}

// SetResearchProjectServiceRequest adds the researchProjectServiceRequest to the post research project services params.
func (o *PostResearchProjectServicesParams) SetResearchProjectServiceRequest(researchProjectServiceRequest *members_models.ResearchProjectServiceRequest) {
	o.ResearchProjectServiceRequest = researchProjectServiceRequest
}

// WriteToRequest writes these params to a [runtime.ClientRequest].
func (o *PostResearchProjectServicesParams) 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.ResearchProjectServiceRequest != nil {
		if err := r.SetBodyParam(o.ResearchProjectServiceRequest); err != nil {
			return err
		}
	}

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