lib/api/research/research_client/observations/put_observation_parameters.go

158 lines
4.6 KiB
Go

// 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"
"code.tnxs.net/work/lib/api/research/research_models"
)
// 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 &PutObservationParams{
timeout: 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{
timeout: timeout,
}
}
// NewPutObservationParamsWithContext creates a new PutObservationParams object
// with the ability to set a context for a request.
func NewPutObservationParamsWithContext(ctx context.Context) *PutObservationParams {
return &PutObservationParams{
Context: 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
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// 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.timeout = timeout
}
// WithContext adds the context to the put observation params
func (o *PutObservationParams) WithContext(ctx context.Context) *PutObservationParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put observation params
func (o *PutObservationParams) SetContext(ctx context.Context) {
o.Context = 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 swagger request
func (o *PutObservationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.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
}