// 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 gl_balance

// 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/ledger/ledger_models"
)

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

/*PostGlBalancesParams contains all the parameters to send to the API endpoint
for the post gl balances operation typically these are written to a http.Request
*/
type PostGlBalancesParams struct {

	/*GlBalanceRequest
	  An array of new GL Balance records

	*/
	GlBalanceRequest *ledger_models.GlBalanceRequest

	timeout    time.Duration
	Context    context.Context
	HTTPClient *http.Client
}

// WithTimeout adds the timeout to the post gl balances params
func (o *PostGlBalancesParams) WithTimeout(timeout time.Duration) *PostGlBalancesParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the post gl balances params
func (o *PostGlBalancesParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the post gl balances params
func (o *PostGlBalancesParams) WithContext(ctx context.Context) *PostGlBalancesParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the post gl balances params
func (o *PostGlBalancesParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the post gl balances params
func (o *PostGlBalancesParams) WithHTTPClient(client *http.Client) *PostGlBalancesParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the post gl balances params
func (o *PostGlBalancesParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithGlBalanceRequest adds the glBalanceRequest to the post gl balances params
func (o *PostGlBalancesParams) WithGlBalanceRequest(glBalanceRequest *ledger_models.GlBalanceRequest) *PostGlBalancesParams {
	o.SetGlBalanceRequest(glBalanceRequest)
	return o
}

// SetGlBalanceRequest adds the glBalanceRequest to the post gl balances params
func (o *PostGlBalancesParams) SetGlBalanceRequest(glBalanceRequest *ledger_models.GlBalanceRequest) {
	o.GlBalanceRequest = glBalanceRequest
}

// WriteToRequest writes these params to a swagger request
func (o *PostGlBalancesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	if err := r.SetTimeout(o.timeout); err != nil {
		return err
	}
	var res []error

	if o.GlBalanceRequest != nil {
		if err := r.SetBodyParam(o.GlBalanceRequest); err != nil {
			return err
		}
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
