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

// NewPutResearchProjectProductsParams creates a new PutResearchProjectProductsParams 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 NewPutResearchProjectProductsParams() *PutResearchProjectProductsParams {
	return &PutResearchProjectProductsParams{
		timeout: cr.DefaultTimeout,
	}
}

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

// NewPutResearchProjectProductsParamsWithContext creates a new PutResearchProjectProductsParams object
// with the ability to set a context for a request.
func NewPutResearchProjectProductsParamsWithContext(ctx context.Context) *PutResearchProjectProductsParams {
	return &PutResearchProjectProductsParams{
		Context: ctx,
	}
}

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

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

	for the put research project products operation.

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

	/* XAuth0UserID.

	   Auth0 User Id
	*/
	XAuth0UserID *string

	/* ResearchProjectProductRequest.

	   An array of new ResearchProjectProduct records
	*/
	ResearchProjectProductRequest *members_models.ResearchProjectProductRequest

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

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

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

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

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

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

// SetContext adds the context to the put research project products params
func (o *PutResearchProjectProductsParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

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

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

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

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

// WithResearchProjectProductRequest adds the researchProjectProductRequest to the put research project products params
func (o *PutResearchProjectProductsParams) WithResearchProjectProductRequest(researchProjectProductRequest *members_models.ResearchProjectProductRequest) *PutResearchProjectProductsParams {
	o.SetResearchProjectProductRequest(researchProjectProductRequest)
	return o
}

// SetResearchProjectProductRequest adds the researchProjectProductRequest to the put research project products params
func (o *PutResearchProjectProductsParams) SetResearchProjectProductRequest(researchProjectProductRequest *members_models.ResearchProjectProductRequest) {
	o.ResearchProjectProductRequest = researchProjectProductRequest
}

// WriteToRequest writes these params to a swagger request
func (o *PutResearchProjectProductsParams) 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.ResearchProjectProductRequest != nil {
		if err := r.SetBodyParam(o.ResearchProjectProductRequest); err != nil {
			return err
		}
	}

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