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

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

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

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

	/*GlAccountRequest
	  An array of new GL Account records

	*/
	GlAccountRequest *ledger_models.GlAccountRequest

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

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

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

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

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

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

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

// WithGlAccountRequest adds the glAccountRequest to the post gl accounts params
func (o *PostGlAccountsParams) WithGlAccountRequest(glAccountRequest *ledger_models.GlAccountRequest) *PostGlAccountsParams {
	o.SetGlAccountRequest(glAccountRequest)
	return o
}

// SetGlAccountRequest adds the glAccountRequest to the post gl accounts params
func (o *PostGlAccountsParams) SetGlAccountRequest(glAccountRequest *ledger_models.GlAccountRequest) {
	o.GlAccountRequest = glAccountRequest
}

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

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

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

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