156 lines
4.3 KiB
Go
156 lines
4.3 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
// All Code Copyright(c) 2018-2021 by Taxnexus, Inc.
|
|
// All rights reserved worldwide.
|
|
// Proprietary product; unlicensed use is not allowed
|
|
|
|
package plants
|
|
|
|
// 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/taxnexus/lib/api/metrc-gw/metrc_gw_models"
|
|
)
|
|
|
|
// NewPostPlantsParams creates a new PostPlantsParams 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 NewPostPlantsParams() *PostPlantsParams {
|
|
return &PostPlantsParams{
|
|
timeout: cr.DefaultTimeout,
|
|
}
|
|
}
|
|
|
|
// NewPostPlantsParamsWithTimeout creates a new PostPlantsParams object
|
|
// with the ability to set a timeout on a request.
|
|
func NewPostPlantsParamsWithTimeout(timeout time.Duration) *PostPlantsParams {
|
|
return &PostPlantsParams{
|
|
timeout: timeout,
|
|
}
|
|
}
|
|
|
|
// NewPostPlantsParamsWithContext creates a new PostPlantsParams object
|
|
// with the ability to set a context for a request.
|
|
func NewPostPlantsParamsWithContext(ctx context.Context) *PostPlantsParams {
|
|
return &PostPlantsParams{
|
|
Context: ctx,
|
|
}
|
|
}
|
|
|
|
// NewPostPlantsParamsWithHTTPClient creates a new PostPlantsParams object
|
|
// with the ability to set a custom HTTPClient for a request.
|
|
func NewPostPlantsParamsWithHTTPClient(client *http.Client) *PostPlantsParams {
|
|
return &PostPlantsParams{
|
|
HTTPClient: client,
|
|
}
|
|
}
|
|
|
|
/* PostPlantsParams contains all the parameters to send to the API endpoint
|
|
for the post plants operation.
|
|
|
|
Typically these are written to a http.Request.
|
|
*/
|
|
type PostPlantsParams struct {
|
|
|
|
/* PlantRequest.
|
|
|
|
The New Plants
|
|
*/
|
|
PlantRequest *metrc_gw_models.PlantRequest
|
|
|
|
timeout time.Duration
|
|
Context context.Context
|
|
HTTPClient *http.Client
|
|
}
|
|
|
|
// WithDefaults hydrates default values in the post plants params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *PostPlantsParams) WithDefaults() *PostPlantsParams {
|
|
o.SetDefaults()
|
|
return o
|
|
}
|
|
|
|
// SetDefaults hydrates default values in the post plants params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *PostPlantsParams) SetDefaults() {
|
|
// no default values defined for this parameter
|
|
}
|
|
|
|
// WithTimeout adds the timeout to the post plants params
|
|
func (o *PostPlantsParams) WithTimeout(timeout time.Duration) *PostPlantsParams {
|
|
o.SetTimeout(timeout)
|
|
return o
|
|
}
|
|
|
|
// SetTimeout adds the timeout to the post plants params
|
|
func (o *PostPlantsParams) SetTimeout(timeout time.Duration) {
|
|
o.timeout = timeout
|
|
}
|
|
|
|
// WithContext adds the context to the post plants params
|
|
func (o *PostPlantsParams) WithContext(ctx context.Context) *PostPlantsParams {
|
|
o.SetContext(ctx)
|
|
return o
|
|
}
|
|
|
|
// SetContext adds the context to the post plants params
|
|
func (o *PostPlantsParams) SetContext(ctx context.Context) {
|
|
o.Context = ctx
|
|
}
|
|
|
|
// WithHTTPClient adds the HTTPClient to the post plants params
|
|
func (o *PostPlantsParams) WithHTTPClient(client *http.Client) *PostPlantsParams {
|
|
o.SetHTTPClient(client)
|
|
return o
|
|
}
|
|
|
|
// SetHTTPClient adds the HTTPClient to the post plants params
|
|
func (o *PostPlantsParams) SetHTTPClient(client *http.Client) {
|
|
o.HTTPClient = client
|
|
}
|
|
|
|
// WithPlantRequest adds the plantRequest to the post plants params
|
|
func (o *PostPlantsParams) WithPlantRequest(plantRequest *metrc_gw_models.PlantRequest) *PostPlantsParams {
|
|
o.SetPlantRequest(plantRequest)
|
|
return o
|
|
}
|
|
|
|
// SetPlantRequest adds the plantRequest to the post plants params
|
|
func (o *PostPlantsParams) SetPlantRequest(plantRequest *metrc_gw_models.PlantRequest) {
|
|
o.PlantRequest = plantRequest
|
|
}
|
|
|
|
// WriteToRequest writes these params to a swagger request
|
|
func (o *PostPlantsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
|
|
|
if err := r.SetTimeout(o.timeout); err != nil {
|
|
return err
|
|
}
|
|
var res []error
|
|
if o.PlantRequest != nil {
|
|
if err := r.SetBodyParam(o.PlantRequest); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|