lib/api/research/research_client/observations/delete_observation_paramete...

168 lines
4.8 KiB
Go
Raw Normal View History

2023-10-01 15:54:52 +00:00
// 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 observations
// 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"
)
// 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 &DeleteObservationParams{
timeout: 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{
timeout: timeout,
}
}
// NewDeleteObservationParamsWithContext creates a new DeleteObservationParams object
// with the ability to set a context for a request.
func NewDeleteObservationParamsWithContext(ctx context.Context) *DeleteObservationParams {
return &DeleteObservationParams{
Context: 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
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// 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.timeout = timeout
}
// WithContext adds the context to the delete observation params
func (o *DeleteObservationParams) WithContext(ctx context.Context) *DeleteObservationParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the delete observation params
func (o *DeleteObservationParams) SetContext(ctx context.Context) {
o.Context = 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 swagger request
func (o *DeleteObservationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.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
}