lib/api/research/research_client/factors/put_factor_parameters.go

158 lines
4.3 KiB
Go

// 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 factors
// 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/vernonkeenan/lib/api/research/research_models"
)
// NewPutFactorParams creates a new PutFactorParams 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 NewPutFactorParams() *PutFactorParams {
return &PutFactorParams{
timeout: cr.DefaultTimeout,
}
}
// NewPutFactorParamsWithTimeout creates a new PutFactorParams object
// with the ability to set a timeout on a request.
func NewPutFactorParamsWithTimeout(timeout time.Duration) *PutFactorParams {
return &PutFactorParams{
timeout: timeout,
}
}
// NewPutFactorParamsWithContext creates a new PutFactorParams object
// with the ability to set a context for a request.
func NewPutFactorParamsWithContext(ctx context.Context) *PutFactorParams {
return &PutFactorParams{
Context: ctx,
}
}
// NewPutFactorParamsWithHTTPClient creates a new PutFactorParams object
// with the ability to set a custom HTTPClient for a request.
func NewPutFactorParamsWithHTTPClient(client *http.Client) *PutFactorParams {
return &PutFactorParams{
HTTPClient: client,
}
}
/*
PutFactorParams contains all the parameters to send to the API endpoint
for the put factor operation.
Typically these are written to a http.Request.
*/
type PutFactorParams struct {
/* FactorRequest.
An array of new Factor records
*/
FactorRequest *research_models.FactorRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the put factor params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutFactorParams) WithDefaults() *PutFactorParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the put factor params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutFactorParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the put factor params
func (o *PutFactorParams) WithTimeout(timeout time.Duration) *PutFactorParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put factor params
func (o *PutFactorParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the put factor params
func (o *PutFactorParams) WithContext(ctx context.Context) *PutFactorParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put factor params
func (o *PutFactorParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the put factor params
func (o *PutFactorParams) WithHTTPClient(client *http.Client) *PutFactorParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put factor params
func (o *PutFactorParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithFactorRequest adds the factorRequest to the put factor params
func (o *PutFactorParams) WithFactorRequest(factorRequest *research_models.FactorRequest) *PutFactorParams {
o.SetFactorRequest(factorRequest)
return o
}
// SetFactorRequest adds the factorRequest to the put factor params
func (o *PutFactorParams) SetFactorRequest(factorRequest *research_models.FactorRequest) {
o.FactorRequest = factorRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PutFactorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.FactorRequest != nil {
if err := r.SetBodyParam(o.FactorRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}