2021-01-08 17:40:28 +00:00
|
|
|
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
|
2021-01-19 16:58:40 +00:00
|
|
|
// All Code Copyright(c) 2018-2021 by Taxnexus, Inc.
|
2021-01-08 17:40:28 +00:00
|
|
|
// All rights reserved worldwide.
|
|
|
|
// Proprietary product; unlicensed use is not allowed
|
|
|
|
|
|
|
|
package strains
|
|
|
|
|
|
|
|
// 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"
|
|
|
|
)
|
|
|
|
|
2021-02-09 16:56:57 +00:00
|
|
|
// NewGetStrainsParams creates a new GetStrainsParams 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.
|
2021-01-08 17:40:28 +00:00
|
|
|
func NewGetStrainsParams() *GetStrainsParams {
|
|
|
|
return &GetStrainsParams{
|
|
|
|
timeout: cr.DefaultTimeout,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewGetStrainsParamsWithTimeout creates a new GetStrainsParams object
|
2021-02-09 16:56:57 +00:00
|
|
|
// with the ability to set a timeout on a request.
|
2021-01-08 17:40:28 +00:00
|
|
|
func NewGetStrainsParamsWithTimeout(timeout time.Duration) *GetStrainsParams {
|
|
|
|
return &GetStrainsParams{
|
|
|
|
timeout: timeout,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewGetStrainsParamsWithContext creates a new GetStrainsParams object
|
2021-02-09 16:56:57 +00:00
|
|
|
// with the ability to set a context for a request.
|
2021-01-08 17:40:28 +00:00
|
|
|
func NewGetStrainsParamsWithContext(ctx context.Context) *GetStrainsParams {
|
|
|
|
return &GetStrainsParams{
|
|
|
|
Context: ctx,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewGetStrainsParamsWithHTTPClient creates a new GetStrainsParams object
|
2021-02-09 16:56:57 +00:00
|
|
|
// with the ability to set a custom HTTPClient for a request.
|
2021-01-08 17:40:28 +00:00
|
|
|
func NewGetStrainsParamsWithHTTPClient(client *http.Client) *GetStrainsParams {
|
|
|
|
return &GetStrainsParams{
|
|
|
|
HTTPClient: client,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-09 16:56:57 +00:00
|
|
|
/* GetStrainsParams contains all the parameters to send to the API endpoint
|
|
|
|
for the get strains operation.
|
|
|
|
|
|
|
|
Typically these are written to a http.Request.
|
2021-01-08 17:40:28 +00:00
|
|
|
*/
|
|
|
|
type GetStrainsParams struct {
|
|
|
|
|
2021-02-09 16:56:57 +00:00
|
|
|
/* Active.
|
2021-01-08 17:40:28 +00:00
|
|
|
|
2021-02-09 16:56:57 +00:00
|
|
|
Get Active objects?
|
2021-01-08 17:40:28 +00:00
|
|
|
*/
|
|
|
|
Active *bool
|
|
|
|
|
2021-02-09 16:56:57 +00:00
|
|
|
/* ItemID.
|
|
|
|
|
|
|
|
The Item Number
|
2021-01-08 17:40:28 +00:00
|
|
|
*/
|
|
|
|
ItemID *float64
|
|
|
|
|
2021-02-09 16:56:57 +00:00
|
|
|
/* Label.
|
|
|
|
|
|
|
|
The METRC Package Label
|
2021-01-08 17:40:28 +00:00
|
|
|
*/
|
|
|
|
Label *string
|
|
|
|
|
2021-02-09 16:56:57 +00:00
|
|
|
/* License.
|
|
|
|
|
|
|
|
The Licnese Number for the query
|
2021-01-08 17:40:28 +00:00
|
|
|
*/
|
|
|
|
License string
|
|
|
|
|
2021-02-09 16:56:57 +00:00
|
|
|
/* Onhold.
|
|
|
|
|
|
|
|
Get On Hold objects?
|
2021-01-08 17:40:28 +00:00
|
|
|
*/
|
|
|
|
Onhold *bool
|
|
|
|
|
2021-02-09 16:56:57 +00:00
|
|
|
/* Production.
|
|
|
|
|
|
|
|
Use Production API?
|
2021-01-08 17:40:28 +00:00
|
|
|
*/
|
|
|
|
Production *bool
|
|
|
|
|
2021-02-09 16:56:57 +00:00
|
|
|
/* Reseller.
|
|
|
|
|
|
|
|
The METRC Reseller Key
|
2021-01-08 17:40:28 +00:00
|
|
|
*/
|
|
|
|
Reseller string
|
|
|
|
|
2021-02-09 16:56:57 +00:00
|
|
|
/* State.
|
|
|
|
|
|
|
|
The 2-character State Code
|
2021-01-08 17:40:28 +00:00
|
|
|
*/
|
|
|
|
State string
|
|
|
|
|
2021-02-09 16:56:57 +00:00
|
|
|
/* User.
|
|
|
|
|
|
|
|
The METRC User Key
|
2021-01-08 17:40:28 +00:00
|
|
|
*/
|
|
|
|
User string
|
|
|
|
|
|
|
|
timeout time.Duration
|
|
|
|
Context context.Context
|
|
|
|
HTTPClient *http.Client
|
|
|
|
}
|
|
|
|
|
2021-02-09 16:56:57 +00:00
|
|
|
// WithDefaults hydrates default values in the get strains params (not the query body).
|
|
|
|
//
|
|
|
|
// All values with no default are reset to their zero value.
|
|
|
|
func (o *GetStrainsParams) WithDefaults() *GetStrainsParams {
|
|
|
|
o.SetDefaults()
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetDefaults hydrates default values in the get strains params (not the query body).
|
|
|
|
//
|
|
|
|
// All values with no default are reset to their zero value.
|
|
|
|
func (o *GetStrainsParams) SetDefaults() {
|
|
|
|
// no default values defined for this parameter
|
|
|
|
}
|
|
|
|
|
2021-01-08 17:40:28 +00:00
|
|
|
// WithTimeout adds the timeout to the get strains params
|
|
|
|
func (o *GetStrainsParams) WithTimeout(timeout time.Duration) *GetStrainsParams {
|
|
|
|
o.SetTimeout(timeout)
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetTimeout adds the timeout to the get strains params
|
|
|
|
func (o *GetStrainsParams) SetTimeout(timeout time.Duration) {
|
|
|
|
o.timeout = timeout
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithContext adds the context to the get strains params
|
|
|
|
func (o *GetStrainsParams) WithContext(ctx context.Context) *GetStrainsParams {
|
|
|
|
o.SetContext(ctx)
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetContext adds the context to the get strains params
|
|
|
|
func (o *GetStrainsParams) SetContext(ctx context.Context) {
|
|
|
|
o.Context = ctx
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithHTTPClient adds the HTTPClient to the get strains params
|
|
|
|
func (o *GetStrainsParams) WithHTTPClient(client *http.Client) *GetStrainsParams {
|
|
|
|
o.SetHTTPClient(client)
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetHTTPClient adds the HTTPClient to the get strains params
|
|
|
|
func (o *GetStrainsParams) SetHTTPClient(client *http.Client) {
|
|
|
|
o.HTTPClient = client
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithActive adds the active to the get strains params
|
|
|
|
func (o *GetStrainsParams) WithActive(active *bool) *GetStrainsParams {
|
|
|
|
o.SetActive(active)
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetActive adds the active to the get strains params
|
|
|
|
func (o *GetStrainsParams) SetActive(active *bool) {
|
|
|
|
o.Active = active
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithItemID adds the itemID to the get strains params
|
|
|
|
func (o *GetStrainsParams) WithItemID(itemID *float64) *GetStrainsParams {
|
|
|
|
o.SetItemID(itemID)
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetItemID adds the itemId to the get strains params
|
|
|
|
func (o *GetStrainsParams) SetItemID(itemID *float64) {
|
|
|
|
o.ItemID = itemID
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithLabel adds the label to the get strains params
|
|
|
|
func (o *GetStrainsParams) WithLabel(label *string) *GetStrainsParams {
|
|
|
|
o.SetLabel(label)
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetLabel adds the label to the get strains params
|
|
|
|
func (o *GetStrainsParams) SetLabel(label *string) {
|
|
|
|
o.Label = label
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithLicense adds the license to the get strains params
|
|
|
|
func (o *GetStrainsParams) WithLicense(license string) *GetStrainsParams {
|
|
|
|
o.SetLicense(license)
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetLicense adds the license to the get strains params
|
|
|
|
func (o *GetStrainsParams) SetLicense(license string) {
|
|
|
|
o.License = license
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithOnhold adds the onhold to the get strains params
|
|
|
|
func (o *GetStrainsParams) WithOnhold(onhold *bool) *GetStrainsParams {
|
|
|
|
o.SetOnhold(onhold)
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetOnhold adds the onhold to the get strains params
|
|
|
|
func (o *GetStrainsParams) SetOnhold(onhold *bool) {
|
|
|
|
o.Onhold = onhold
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithProduction adds the production to the get strains params
|
|
|
|
func (o *GetStrainsParams) WithProduction(production *bool) *GetStrainsParams {
|
|
|
|
o.SetProduction(production)
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetProduction adds the production to the get strains params
|
|
|
|
func (o *GetStrainsParams) SetProduction(production *bool) {
|
|
|
|
o.Production = production
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithReseller adds the reseller to the get strains params
|
|
|
|
func (o *GetStrainsParams) WithReseller(reseller string) *GetStrainsParams {
|
|
|
|
o.SetReseller(reseller)
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetReseller adds the reseller to the get strains params
|
|
|
|
func (o *GetStrainsParams) SetReseller(reseller string) {
|
|
|
|
o.Reseller = reseller
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithState adds the state to the get strains params
|
|
|
|
func (o *GetStrainsParams) WithState(state string) *GetStrainsParams {
|
|
|
|
o.SetState(state)
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetState adds the state to the get strains params
|
|
|
|
func (o *GetStrainsParams) SetState(state string) {
|
|
|
|
o.State = state
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithUser adds the user to the get strains params
|
|
|
|
func (o *GetStrainsParams) WithUser(user string) *GetStrainsParams {
|
|
|
|
o.SetUser(user)
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetUser adds the user to the get strains params
|
|
|
|
func (o *GetStrainsParams) SetUser(user string) {
|
|
|
|
o.User = user
|
|
|
|
}
|
|
|
|
|
|
|
|
// WriteToRequest writes these params to a swagger request
|
|
|
|
func (o *GetStrainsParams) 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
|
2021-02-09 16:56:57 +00:00
|
|
|
|
2021-01-08 17:40:28 +00:00
|
|
|
if o.Active != nil {
|
|
|
|
qrActive = *o.Active
|
|
|
|
}
|
|
|
|
qActive := swag.FormatBool(qrActive)
|
|
|
|
if qActive != "" {
|
2021-02-09 16:56:57 +00:00
|
|
|
|
2021-01-08 17:40:28 +00:00
|
|
|
if err := r.SetQueryParam("active", qActive); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if o.ItemID != nil {
|
|
|
|
|
|
|
|
// query param itemId
|
|
|
|
var qrItemID float64
|
2021-02-09 16:56:57 +00:00
|
|
|
|
2021-01-08 17:40:28 +00:00
|
|
|
if o.ItemID != nil {
|
|
|
|
qrItemID = *o.ItemID
|
|
|
|
}
|
|
|
|
qItemID := swag.FormatFloat64(qrItemID)
|
|
|
|
if qItemID != "" {
|
2021-02-09 16:56:57 +00:00
|
|
|
|
2021-01-08 17:40:28 +00:00
|
|
|
if err := r.SetQueryParam("itemId", qItemID); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if o.Label != nil {
|
|
|
|
|
|
|
|
// query param label
|
|
|
|
var qrLabel string
|
2021-02-09 16:56:57 +00:00
|
|
|
|
2021-01-08 17:40:28 +00:00
|
|
|
if o.Label != nil {
|
|
|
|
qrLabel = *o.Label
|
|
|
|
}
|
|
|
|
qLabel := qrLabel
|
|
|
|
if qLabel != "" {
|
2021-02-09 16:56:57 +00:00
|
|
|
|
2021-01-08 17:40:28 +00:00
|
|
|
if err := r.SetQueryParam("label", qLabel); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// query param license
|
|
|
|
qrLicense := o.License
|
|
|
|
qLicense := qrLicense
|
|
|
|
if qLicense != "" {
|
2021-02-09 16:56:57 +00:00
|
|
|
|
2021-01-08 17:40:28 +00:00
|
|
|
if err := r.SetQueryParam("license", qLicense); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if o.Onhold != nil {
|
|
|
|
|
|
|
|
// query param onhold
|
|
|
|
var qrOnhold bool
|
2021-02-09 16:56:57 +00:00
|
|
|
|
2021-01-08 17:40:28 +00:00
|
|
|
if o.Onhold != nil {
|
|
|
|
qrOnhold = *o.Onhold
|
|
|
|
}
|
|
|
|
qOnhold := swag.FormatBool(qrOnhold)
|
|
|
|
if qOnhold != "" {
|
2021-02-09 16:56:57 +00:00
|
|
|
|
2021-01-08 17:40:28 +00:00
|
|
|
if err := r.SetQueryParam("onhold", qOnhold); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if o.Production != nil {
|
|
|
|
|
|
|
|
// query param production
|
|
|
|
var qrProduction bool
|
2021-02-09 16:56:57 +00:00
|
|
|
|
2021-01-08 17:40:28 +00:00
|
|
|
if o.Production != nil {
|
|
|
|
qrProduction = *o.Production
|
|
|
|
}
|
|
|
|
qProduction := swag.FormatBool(qrProduction)
|
|
|
|
if qProduction != "" {
|
2021-02-09 16:56:57 +00:00
|
|
|
|
2021-01-08 17:40:28 +00:00
|
|
|
if err := r.SetQueryParam("production", qProduction); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// query param reseller
|
|
|
|
qrReseller := o.Reseller
|
|
|
|
qReseller := qrReseller
|
|
|
|
if qReseller != "" {
|
2021-02-09 16:56:57 +00:00
|
|
|
|
2021-01-08 17:40:28 +00:00
|
|
|
if err := r.SetQueryParam("reseller", qReseller); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// query param state
|
|
|
|
qrState := o.State
|
|
|
|
qState := qrState
|
|
|
|
if qState != "" {
|
2021-02-09 16:56:57 +00:00
|
|
|
|
2021-01-08 17:40:28 +00:00
|
|
|
if err := r.SetQueryParam("state", qState); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// query param user
|
|
|
|
qrUser := o.User
|
|
|
|
qUser := qrUser
|
|
|
|
if qUser != "" {
|
2021-02-09 16:56:57 +00:00
|
|
|
|
2021-01-08 17:40:28 +00:00
|
|
|
if err := r.SetQueryParam("user", qUser); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(res) > 0 {
|
|
|
|
return errors.CompositeValidationError(res...)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|