lib/api/metrc-gw/metrc_gw_client/plants/delete_plant_parameters.go

245 lines
5.8 KiB
Go
Raw Normal View History

2021-01-08 17:40:28 +00:00
// 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"
"github.com/go-openapi/swag"
)
// NewDeletePlantParams creates a new DeletePlantParams object
// with the default values initialized.
func NewDeletePlantParams() *DeletePlantParams {
var ()
return &DeletePlantParams{
timeout: cr.DefaultTimeout,
}
}
// NewDeletePlantParamsWithTimeout creates a new DeletePlantParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewDeletePlantParamsWithTimeout(timeout time.Duration) *DeletePlantParams {
var ()
return &DeletePlantParams{
timeout: timeout,
}
}
// NewDeletePlantParamsWithContext creates a new DeletePlantParams object
// with the default values initialized, and the ability to set a context for a request
func NewDeletePlantParamsWithContext(ctx context.Context) *DeletePlantParams {
var ()
return &DeletePlantParams{
Context: ctx,
}
}
// NewDeletePlantParamsWithHTTPClient creates a new DeletePlantParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewDeletePlantParamsWithHTTPClient(client *http.Client) *DeletePlantParams {
var ()
return &DeletePlantParams{
HTTPClient: client,
}
}
/*DeletePlantParams contains all the parameters to send to the API endpoint
for the delete plant operation typically these are written to a http.Request
*/
type DeletePlantParams struct {
/*ItemID
The Item Number
*/
ItemID float64
/*License
The Licnese Number for the query
*/
License string
/*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
}
// WithTimeout adds the timeout to the delete plant params
func (o *DeletePlantParams) WithTimeout(timeout time.Duration) *DeletePlantParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the delete plant params
func (o *DeletePlantParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the delete plant params
func (o *DeletePlantParams) WithContext(ctx context.Context) *DeletePlantParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the delete plant params
func (o *DeletePlantParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the delete plant params
func (o *DeletePlantParams) WithHTTPClient(client *http.Client) *DeletePlantParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the delete plant params
func (o *DeletePlantParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithItemID adds the itemID to the delete plant params
func (o *DeletePlantParams) WithItemID(itemID float64) *DeletePlantParams {
o.SetItemID(itemID)
return o
}
// SetItemID adds the itemId to the delete plant params
func (o *DeletePlantParams) SetItemID(itemID float64) {
o.ItemID = itemID
}
// WithLicense adds the license to the delete plant params
func (o *DeletePlantParams) WithLicense(license string) *DeletePlantParams {
o.SetLicense(license)
return o
}
// SetLicense adds the license to the delete plant params
func (o *DeletePlantParams) SetLicense(license string) {
o.License = license
}
// WithReseller adds the reseller to the delete plant params
func (o *DeletePlantParams) WithReseller(reseller string) *DeletePlantParams {
o.SetReseller(reseller)
return o
}
// SetReseller adds the reseller to the delete plant params
func (o *DeletePlantParams) SetReseller(reseller string) {
o.Reseller = reseller
}
// WithState adds the state to the delete plant params
func (o *DeletePlantParams) WithState(state string) *DeletePlantParams {
o.SetState(state)
return o
}
// SetState adds the state to the delete plant params
func (o *DeletePlantParams) SetState(state string) {
o.State = state
}
// WithUser adds the user to the delete plant params
func (o *DeletePlantParams) WithUser(user string) *DeletePlantParams {
o.SetUser(user)
return o
}
// SetUser adds the user to the delete plant params
func (o *DeletePlantParams) SetUser(user string) {
o.User = user
}
// WriteToRequest writes these params to a swagger request
func (o *DeletePlantParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// query param itemId
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
}
}
// 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
}