// Code generated by go-swagger; DO NOT EDIT. // All Code Copyright(c) 2018-2020 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 values initialized. func NewPostPlantsParams() *PostPlantsParams { var () return &PostPlantsParams{ timeout: cr.DefaultTimeout, } } // NewPostPlantsParamsWithTimeout creates a new PostPlantsParams object // with the default values initialized, and the ability to set a timeout on a request func NewPostPlantsParamsWithTimeout(timeout time.Duration) *PostPlantsParams { var () return &PostPlantsParams{ timeout: timeout, } } // NewPostPlantsParamsWithContext creates a new PostPlantsParams object // with the default values initialized, and the ability to set a context for a request func NewPostPlantsParamsWithContext(ctx context.Context) *PostPlantsParams { var () return &PostPlantsParams{ Context: ctx, } } // NewPostPlantsParamsWithHTTPClient creates a new PostPlantsParams object // with the default values initialized, and the ability to set a custom HTTPClient for a request func NewPostPlantsParamsWithHTTPClient(client *http.Client) *PostPlantsParams { var () 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 } // 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 }