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

import (
	"context"
	"net/http"
	"time"

	"code.tnxs.net/vernonkeenan/lib/api/research/research_models"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
	cr "github.com/go-openapi/runtime/client"
	"github.com/go-openapi/strfmt"
)

// NewPutObservationParams creates a new PutObservationParams 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 NewPutObservationParams() *PutObservationParams {
	return NewPutObservationParamsWithTimeout(cr.DefaultTimeout)
}

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

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

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

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

	for the put observation operation.

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

	// ObservationRequest.
	//
	// An array of new Observation records
	ObservationRequest *research_models.ObservationRequest

	HTTPClient *http.Client

	inner innerParams
}

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

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

// WithTimeout adds the timeout to the put observation params.
func (o *PutObservationParams) WithTimeout(timeout time.Duration) *PutObservationParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the put observation params.
func (o *PutObservationParams) SetTimeout(timeout time.Duration) {
	o.inner.timeout = timeout
}

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

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

// WithHTTPClient adds the HTTPClient to the put observation params.
func (o *PutObservationParams) WithHTTPClient(client *http.Client) *PutObservationParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the put observation params.
func (o *PutObservationParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithObservationRequest adds the observationRequest to the put observation params.
func (o *PutObservationParams) WithObservationRequest(observationRequest *research_models.ObservationRequest) *PutObservationParams {
	o.SetObservationRequest(observationRequest)
	return o
}

// SetObservationRequest adds the observationRequest to the put observation params.
func (o *PutObservationParams) SetObservationRequest(observationRequest *research_models.ObservationRequest) {
	o.ObservationRequest = observationRequest
}

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

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