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

	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
	cr "github.com/go-openapi/runtime/client"
	"github.com/go-openapi/strfmt"
)

// NewDeleteObservationParams creates a new DeleteObservationParams 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 NewDeleteObservationParams() *DeleteObservationParams {
	return NewDeleteObservationParamsWithTimeout(cr.DefaultTimeout)
}

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

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

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

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

	for the delete observation operation.

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

	// ObservationID.
	//
	// Observation record ID
	ObservationID *string

	HTTPClient *http.Client

	inner innerParams
}

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

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

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

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

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

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

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

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

// WithObservationID adds the observationID to the delete observation params.
func (o *DeleteObservationParams) WithObservationID(observationID *string) *DeleteObservationParams {
	o.SetObservationID(observationID)
	return o
}

// SetObservationID adds the observationId to the delete observation params.
func (o *DeleteObservationParams) SetObservationID(observationID *string) {
	o.ObservationID = observationID
}

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

	if o.ObservationID != nil {

		// query param observationId
		var qrObservationID string

		if o.ObservationID != nil {
			qrObservationID = *o.ObservationID
		}
		qObservationID := qrObservationID
		if qObservationID != "" {

			if err := r.SetQueryParam("observationId", qObservationID); err != nil {
				return err
			}
		}
	}

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