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 facilities
|
|
|
|
|
|
|
|
// 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
|
|
|
// NewGetFacilitiesParams creates a new GetFacilitiesParams 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 NewGetFacilitiesParams() *GetFacilitiesParams {
|
|
|
|
return &GetFacilitiesParams{
|
|
|
|
timeout: cr.DefaultTimeout,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewGetFacilitiesParamsWithTimeout creates a new GetFacilitiesParams 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 NewGetFacilitiesParamsWithTimeout(timeout time.Duration) *GetFacilitiesParams {
|
|
|
|
return &GetFacilitiesParams{
|
|
|
|
timeout: timeout,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewGetFacilitiesParamsWithContext creates a new GetFacilitiesParams 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 NewGetFacilitiesParamsWithContext(ctx context.Context) *GetFacilitiesParams {
|
|
|
|
return &GetFacilitiesParams{
|
|
|
|
Context: ctx,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewGetFacilitiesParamsWithHTTPClient creates a new GetFacilitiesParams 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 NewGetFacilitiesParamsWithHTTPClient(client *http.Client) *GetFacilitiesParams {
|
|
|
|
return &GetFacilitiesParams{
|
|
|
|
HTTPClient: client,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-09 16:56:57 +00:00
|
|
|
/* GetFacilitiesParams contains all the parameters to send to the API endpoint
|
|
|
|
for the get facilities operation.
|
|
|
|
|
|
|
|
Typically these are written to a http.Request.
|
2021-01-08 17:40:28 +00:00
|
|
|
*/
|
|
|
|
type GetFacilitiesParams struct {
|
|
|
|
|
2021-02-09 16:56:57 +00:00
|
|
|
/* Production.
|
2021-01-08 17:40:28 +00:00
|
|
|
|
2021-02-09 16:56:57 +00:00
|
|
|
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 facilities params (not the query body).
|
|
|
|
//
|
|
|
|
// All values with no default are reset to their zero value.
|
|
|
|
func (o *GetFacilitiesParams) WithDefaults() *GetFacilitiesParams {
|
|
|
|
o.SetDefaults()
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetDefaults hydrates default values in the get facilities params (not the query body).
|
|
|
|
//
|
|
|
|
// All values with no default are reset to their zero value.
|
|
|
|
func (o *GetFacilitiesParams) SetDefaults() {
|
|
|
|
// no default values defined for this parameter
|
|
|
|
}
|
|
|
|
|
2021-01-08 17:40:28 +00:00
|
|
|
// WithTimeout adds the timeout to the get facilities params
|
|
|
|
func (o *GetFacilitiesParams) WithTimeout(timeout time.Duration) *GetFacilitiesParams {
|
|
|
|
o.SetTimeout(timeout)
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetTimeout adds the timeout to the get facilities params
|
|
|
|
func (o *GetFacilitiesParams) SetTimeout(timeout time.Duration) {
|
|
|
|
o.timeout = timeout
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithContext adds the context to the get facilities params
|
|
|
|
func (o *GetFacilitiesParams) WithContext(ctx context.Context) *GetFacilitiesParams {
|
|
|
|
o.SetContext(ctx)
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetContext adds the context to the get facilities params
|
|
|
|
func (o *GetFacilitiesParams) SetContext(ctx context.Context) {
|
|
|
|
o.Context = ctx
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithHTTPClient adds the HTTPClient to the get facilities params
|
|
|
|
func (o *GetFacilitiesParams) WithHTTPClient(client *http.Client) *GetFacilitiesParams {
|
|
|
|
o.SetHTTPClient(client)
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetHTTPClient adds the HTTPClient to the get facilities params
|
|
|
|
func (o *GetFacilitiesParams) SetHTTPClient(client *http.Client) {
|
|
|
|
o.HTTPClient = client
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithProduction adds the production to the get facilities params
|
|
|
|
func (o *GetFacilitiesParams) WithProduction(production *bool) *GetFacilitiesParams {
|
|
|
|
o.SetProduction(production)
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetProduction adds the production to the get facilities params
|
|
|
|
func (o *GetFacilitiesParams) SetProduction(production *bool) {
|
|
|
|
o.Production = production
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithReseller adds the reseller to the get facilities params
|
|
|
|
func (o *GetFacilitiesParams) WithReseller(reseller string) *GetFacilitiesParams {
|
|
|
|
o.SetReseller(reseller)
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetReseller adds the reseller to the get facilities params
|
|
|
|
func (o *GetFacilitiesParams) SetReseller(reseller string) {
|
|
|
|
o.Reseller = reseller
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithState adds the state to the get facilities params
|
|
|
|
func (o *GetFacilitiesParams) WithState(state string) *GetFacilitiesParams {
|
|
|
|
o.SetState(state)
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetState adds the state to the get facilities params
|
|
|
|
func (o *GetFacilitiesParams) SetState(state string) {
|
|
|
|
o.State = state
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithUser adds the user to the get facilities params
|
|
|
|
func (o *GetFacilitiesParams) WithUser(user string) *GetFacilitiesParams {
|
|
|
|
o.SetUser(user)
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetUser adds the user to the get facilities params
|
|
|
|
func (o *GetFacilitiesParams) SetUser(user string) {
|
|
|
|
o.User = user
|
|
|
|
}
|
|
|
|
|
|
|
|
// WriteToRequest writes these params to a swagger request
|
|
|
|
func (o *GetFacilitiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
|
|
|
|
|
|
|
if err := r.SetTimeout(o.timeout); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
var res []error
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|