// 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/go/lib/api/ops/ops_models"
)

// NewPutChargesParams creates a new PutChargesParams object
// with the default values initialized.
func NewPutChargesParams() *PutChargesParams {
	var ()
	return &PutChargesParams{

		timeout: cr.DefaultTimeout,
	}
}

// NewPutChargesParamsWithTimeout creates a new PutChargesParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewPutChargesParamsWithTimeout(timeout time.Duration) *PutChargesParams {
	var ()
	return &PutChargesParams{

		timeout: timeout,
	}
}

// NewPutChargesParamsWithContext creates a new PutChargesParams object
// with the default values initialized, and the ability to set a context for a request
func NewPutChargesParamsWithContext(ctx context.Context) *PutChargesParams {
	var ()
	return &PutChargesParams{

		Context: ctx,
	}
}

// NewPutChargesParamsWithHTTPClient creates a new PutChargesParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewPutChargesParamsWithHTTPClient(client *http.Client) *PutChargesParams {
	var ()
	return &PutChargesParams{
		HTTPClient: client,
	}
}

/*PutChargesParams contains all the parameters to send to the API endpoint
for the put charges operation typically these are written to a http.Request
*/
type PutChargesParams 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 put charges params
func (o *PutChargesParams) WithTimeout(timeout time.Duration) *PutChargesParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the put charges params
func (o *PutChargesParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the put charges params
func (o *PutChargesParams) WithContext(ctx context.Context) *PutChargesParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the put charges params
func (o *PutChargesParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the put charges params
func (o *PutChargesParams) WithHTTPClient(client *http.Client) *PutChargesParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the put charges params
func (o *PutChargesParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithChargeRequest adds the chargeRequest to the put charges params
func (o *PutChargesParams) WithChargeRequest(chargeRequest *ops_models.ChargeRequest) *PutChargesParams {
	o.SetChargeRequest(chargeRequest)
	return o
}

// SetChargeRequest adds the chargeRequest to the put charges params
func (o *PutChargesParams) SetChargeRequest(chargeRequest *ops_models.ChargeRequest) {
	o.ChargeRequest = chargeRequest
}

// WriteToRequest writes these params to a swagger request
func (o *PutChargesParams) 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
}
