lib/api/ops/ops_client/charge/post_charges_parameters.go

156 lines
4.4 KiB
Go

// 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 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"
"code.tnxs.net/taxnexus/lib/api/ops/ops_models"
)
// NewPostChargesParams creates a new PostChargesParams 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 NewPostChargesParams() *PostChargesParams {
return &PostChargesParams{
timeout: cr.DefaultTimeout,
}
}
// NewPostChargesParamsWithTimeout creates a new PostChargesParams object
// with the ability to set a timeout on a request.
func NewPostChargesParamsWithTimeout(timeout time.Duration) *PostChargesParams {
return &PostChargesParams{
timeout: timeout,
}
}
// NewPostChargesParamsWithContext creates a new PostChargesParams object
// with the ability to set a context for a request.
func NewPostChargesParamsWithContext(ctx context.Context) *PostChargesParams {
return &PostChargesParams{
Context: ctx,
}
}
// NewPostChargesParamsWithHTTPClient creates a new PostChargesParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostChargesParamsWithHTTPClient(client *http.Client) *PostChargesParams {
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
}
// WithDefaults hydrates default values in the post charges params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostChargesParams) WithDefaults() *PostChargesParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the post charges params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostChargesParams) SetDefaults() {
// no default values defined for this parameter
}
// 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
}