143 lines
3.8 KiB
Go
143 lines
3.8 KiB
Go
|
// 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 charge
|
||
|
|
||
|
// 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/taxnexus/lib/api/ops/ops_models"
|
||
|
)
|
||
|
|
||
|
// NewPostChargesParams creates a new PostChargesParams object
|
||
|
// with the default values initialized.
|
||
|
func NewPostChargesParams() *PostChargesParams {
|
||
|
var ()
|
||
|
return &PostChargesParams{
|
||
|
|
||
|
timeout: cr.DefaultTimeout,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// NewPostChargesParamsWithTimeout creates a new PostChargesParams object
|
||
|
// with the default values initialized, and the ability to set a timeout on a request
|
||
|
func NewPostChargesParamsWithTimeout(timeout time.Duration) *PostChargesParams {
|
||
|
var ()
|
||
|
return &PostChargesParams{
|
||
|
|
||
|
timeout: timeout,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// NewPostChargesParamsWithContext creates a new PostChargesParams object
|
||
|
// with the default values initialized, and the ability to set a context for a request
|
||
|
func NewPostChargesParamsWithContext(ctx context.Context) *PostChargesParams {
|
||
|
var ()
|
||
|
return &PostChargesParams{
|
||
|
|
||
|
Context: ctx,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// NewPostChargesParamsWithHTTPClient creates a new PostChargesParams object
|
||
|
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||
|
func NewPostChargesParamsWithHTTPClient(client *http.Client) *PostChargesParams {
|
||
|
var ()
|
||
|
return &PostChargesParams{
|
||
|
HTTPClient: client,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/*PostChargesParams contains all the parameters to send to the API endpoint
|
||
|
for the post charges operation typically these are written to a http.Request
|
||
|
*/
|
||
|
type PostChargesParams struct {
|
||
|
|
||
|
/*ChargeRequest
|
||
|
A request with an array of Charge Objects
|
||
|
|
||
|
*/
|
||
|
ChargeRequest *ops_models.ChargeRequest
|
||
|
|
||
|
timeout time.Duration
|
||
|
Context context.Context
|
||
|
HTTPClient *http.Client
|
||
|
}
|
||
|
|
||
|
// WithTimeout adds the timeout to the post charges params
|
||
|
func (o *PostChargesParams) WithTimeout(timeout time.Duration) *PostChargesParams {
|
||
|
o.SetTimeout(timeout)
|
||
|
return o
|
||
|
}
|
||
|
|
||
|
// SetTimeout adds the timeout to the post charges params
|
||
|
func (o *PostChargesParams) SetTimeout(timeout time.Duration) {
|
||
|
o.timeout = timeout
|
||
|
}
|
||
|
|
||
|
// WithContext adds the context to the post charges params
|
||
|
func (o *PostChargesParams) WithContext(ctx context.Context) *PostChargesParams {
|
||
|
o.SetContext(ctx)
|
||
|
return o
|
||
|
}
|
||
|
|
||
|
// SetContext adds the context to the post charges params
|
||
|
func (o *PostChargesParams) SetContext(ctx context.Context) {
|
||
|
o.Context = ctx
|
||
|
}
|
||
|
|
||
|
// WithHTTPClient adds the HTTPClient to the post charges params
|
||
|
func (o *PostChargesParams) WithHTTPClient(client *http.Client) *PostChargesParams {
|
||
|
o.SetHTTPClient(client)
|
||
|
return o
|
||
|
}
|
||
|
|
||
|
// SetHTTPClient adds the HTTPClient to the post charges params
|
||
|
func (o *PostChargesParams) SetHTTPClient(client *http.Client) {
|
||
|
o.HTTPClient = client
|
||
|
}
|
||
|
|
||
|
// WithChargeRequest adds the chargeRequest to the post charges params
|
||
|
func (o *PostChargesParams) WithChargeRequest(chargeRequest *ops_models.ChargeRequest) *PostChargesParams {
|
||
|
o.SetChargeRequest(chargeRequest)
|
||
|
return o
|
||
|
}
|
||
|
|
||
|
// SetChargeRequest adds the chargeRequest to the post charges params
|
||
|
func (o *PostChargesParams) SetChargeRequest(chargeRequest *ops_models.ChargeRequest) {
|
||
|
o.ChargeRequest = chargeRequest
|
||
|
}
|
||
|
|
||
|
// WriteToRequest writes these params to a swagger request
|
||
|
func (o *PostChargesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||
|
|
||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||
|
return err
|
||
|
}
|
||
|
var res []error
|
||
|
|
||
|
if o.ChargeRequest != nil {
|
||
|
if err := r.SetBodyParam(o.ChargeRequest); err != nil {
|
||
|
return err
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if len(res) > 0 {
|
||
|
return errors.CompositeValidationError(res...)
|
||
|
}
|
||
|
return nil
|
||
|
}
|