// 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" "github.com/go-openapi/swag" ) // NewGetPlantsParams creates a new GetPlantsParams 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 NewGetPlantsParams() *GetPlantsParams { return &GetPlantsParams{ timeout: cr.DefaultTimeout, } } // NewGetPlantsParamsWithTimeout creates a new GetPlantsParams object // with the ability to set a timeout on a request. func NewGetPlantsParamsWithTimeout(timeout time.Duration) *GetPlantsParams { return &GetPlantsParams{ timeout: timeout, } } // NewGetPlantsParamsWithContext creates a new GetPlantsParams object // with the ability to set a context for a request. func NewGetPlantsParamsWithContext(ctx context.Context) *GetPlantsParams { return &GetPlantsParams{ Context: ctx, } } // NewGetPlantsParamsWithHTTPClient creates a new GetPlantsParams object // with the ability to set a custom HTTPClient for a request. func NewGetPlantsParamsWithHTTPClient(client *http.Client) *GetPlantsParams { return &GetPlantsParams{ HTTPClient: client, } } /* GetPlantsParams contains all the parameters to send to the API endpoint for the get plants operation. Typically these are written to a http.Request. */ type GetPlantsParams struct { /* Active. Get Active objects? */ Active *bool /* ItemID. The Item Number */ ItemID *float64 /* License. The Licnese Number for the query */ License string /* Production. Use Production API? */ Production *bool /* Reseller. The METRC Reseller Key */ Reseller string /* State. The 2-character State Code */ State string /* User. The METRC User Key */ User string timeout time.Duration Context context.Context HTTPClient *http.Client } // WithDefaults hydrates default values in the get plants params (not the query body). // // All values with no default are reset to their zero value. func (o *GetPlantsParams) WithDefaults() *GetPlantsParams { o.SetDefaults() return o } // SetDefaults hydrates default values in the get plants params (not the query body). // // All values with no default are reset to their zero value. func (o *GetPlantsParams) SetDefaults() { // no default values defined for this parameter } // WithTimeout adds the timeout to the get plants params func (o *GetPlantsParams) WithTimeout(timeout time.Duration) *GetPlantsParams { o.SetTimeout(timeout) return o } // SetTimeout adds the timeout to the get plants params func (o *GetPlantsParams) SetTimeout(timeout time.Duration) { o.timeout = timeout } // WithContext adds the context to the get plants params func (o *GetPlantsParams) WithContext(ctx context.Context) *GetPlantsParams { o.SetContext(ctx) return o } // SetContext adds the context to the get plants params func (o *GetPlantsParams) SetContext(ctx context.Context) { o.Context = ctx } // WithHTTPClient adds the HTTPClient to the get plants params func (o *GetPlantsParams) WithHTTPClient(client *http.Client) *GetPlantsParams { o.SetHTTPClient(client) return o } // SetHTTPClient adds the HTTPClient to the get plants params func (o *GetPlantsParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } // WithActive adds the active to the get plants params func (o *GetPlantsParams) WithActive(active *bool) *GetPlantsParams { o.SetActive(active) return o } // SetActive adds the active to the get plants params func (o *GetPlantsParams) SetActive(active *bool) { o.Active = active } // WithItemID adds the itemID to the get plants params func (o *GetPlantsParams) WithItemID(itemID *float64) *GetPlantsParams { o.SetItemID(itemID) return o } // SetItemID adds the itemId to the get plants params func (o *GetPlantsParams) SetItemID(itemID *float64) { o.ItemID = itemID } // WithLicense adds the license to the get plants params func (o *GetPlantsParams) WithLicense(license string) *GetPlantsParams { o.SetLicense(license) return o } // SetLicense adds the license to the get plants params func (o *GetPlantsParams) SetLicense(license string) { o.License = license } // WithProduction adds the production to the get plants params func (o *GetPlantsParams) WithProduction(production *bool) *GetPlantsParams { o.SetProduction(production) return o } // SetProduction adds the production to the get plants params func (o *GetPlantsParams) SetProduction(production *bool) { o.Production = production } // WithReseller adds the reseller to the get plants params func (o *GetPlantsParams) WithReseller(reseller string) *GetPlantsParams { o.SetReseller(reseller) return o } // SetReseller adds the reseller to the get plants params func (o *GetPlantsParams) SetReseller(reseller string) { o.Reseller = reseller } // WithState adds the state to the get plants params func (o *GetPlantsParams) WithState(state string) *GetPlantsParams { o.SetState(state) return o } // SetState adds the state to the get plants params func (o *GetPlantsParams) SetState(state string) { o.State = state } // WithUser adds the user to the get plants params func (o *GetPlantsParams) WithUser(user string) *GetPlantsParams { o.SetUser(user) return o } // SetUser adds the user to the get plants params func (o *GetPlantsParams) SetUser(user string) { o.User = user } // WriteToRequest writes these params to a swagger request func (o *GetPlantsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { if err := r.SetTimeout(o.timeout); err != nil { return err } var res []error if o.Active != nil { // query param active var qrActive bool if o.Active != nil { qrActive = *o.Active } qActive := swag.FormatBool(qrActive) if qActive != "" { if err := r.SetQueryParam("active", qActive); err != nil { return err } } } if o.ItemID != nil { // query param itemId var qrItemID float64 if o.ItemID != nil { qrItemID = *o.ItemID } qItemID := swag.FormatFloat64(qrItemID) if qItemID != "" { if err := r.SetQueryParam("itemId", qItemID); err != nil { return err } } } // query param license qrLicense := o.License qLicense := qrLicense if qLicense != "" { if err := r.SetQueryParam("license", qLicense); err != nil { return err } } if o.Production != nil { // query param production var qrProduction bool if o.Production != nil { qrProduction = *o.Production } qProduction := swag.FormatBool(qrProduction) if qProduction != "" { if err := r.SetQueryParam("production", qProduction); err != nil { return err } } } // query param reseller qrReseller := o.Reseller qReseller := qrReseller if qReseller != "" { if err := r.SetQueryParam("reseller", qReseller); err != nil { return err } } // query param state qrState := o.State qState := qrState if qState != "" { if err := r.SetQueryParam("state", qState); err != nil { return err } } // query param user qrUser := o.User qUser := qrUser if qUser != "" { if err := r.SetQueryParam("user", qUser); err != nil { return err } } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }