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

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

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

/*GetCoasParams contains all the parameters to send to the API endpoint
for the get coas operation typically these are written to a http.Request
*/
type GetCoasParams struct {

	/*AccountID
	  Taxnexus Record Id of an Account

	*/
	AccountID *string
	/*CoaID
	  Taxnexus Id of the Chart of Accounts to be retrieved

	*/
	CoaID *string
	/*DateFrom
	  The Starting Date for an object retrieval

	*/
	DateFrom *string
	/*DateTo
	  The Ending Date for an object retrieval

	*/
	DateTo *string

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

// WithTimeout adds the timeout to the get coas params
func (o *GetCoasParams) WithTimeout(timeout time.Duration) *GetCoasParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the get coas params
func (o *GetCoasParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the get coas params
func (o *GetCoasParams) WithContext(ctx context.Context) *GetCoasParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the get coas params
func (o *GetCoasParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the get coas params
func (o *GetCoasParams) WithHTTPClient(client *http.Client) *GetCoasParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the get coas params
func (o *GetCoasParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithAccountID adds the accountID to the get coas params
func (o *GetCoasParams) WithAccountID(accountID *string) *GetCoasParams {
	o.SetAccountID(accountID)
	return o
}

// SetAccountID adds the accountId to the get coas params
func (o *GetCoasParams) SetAccountID(accountID *string) {
	o.AccountID = accountID
}

// WithCoaID adds the coaID to the get coas params
func (o *GetCoasParams) WithCoaID(coaID *string) *GetCoasParams {
	o.SetCoaID(coaID)
	return o
}

// SetCoaID adds the coaId to the get coas params
func (o *GetCoasParams) SetCoaID(coaID *string) {
	o.CoaID = coaID
}

// WithDateFrom adds the dateFrom to the get coas params
func (o *GetCoasParams) WithDateFrom(dateFrom *string) *GetCoasParams {
	o.SetDateFrom(dateFrom)
	return o
}

// SetDateFrom adds the dateFrom to the get coas params
func (o *GetCoasParams) SetDateFrom(dateFrom *string) {
	o.DateFrom = dateFrom
}

// WithDateTo adds the dateTo to the get coas params
func (o *GetCoasParams) WithDateTo(dateTo *string) *GetCoasParams {
	o.SetDateTo(dateTo)
	return o
}

// SetDateTo adds the dateTo to the get coas params
func (o *GetCoasParams) SetDateTo(dateTo *string) {
	o.DateTo = dateTo
}

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

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

	if o.AccountID != nil {

		// query param accountId
		var qrAccountID string
		if o.AccountID != nil {
			qrAccountID = *o.AccountID
		}
		qAccountID := qrAccountID
		if qAccountID != "" {
			if err := r.SetQueryParam("accountId", qAccountID); err != nil {
				return err
			}
		}

	}

	if o.CoaID != nil {

		// query param coaId
		var qrCoaID string
		if o.CoaID != nil {
			qrCoaID = *o.CoaID
		}
		qCoaID := qrCoaID
		if qCoaID != "" {
			if err := r.SetQueryParam("coaId", qCoaID); err != nil {
				return err
			}
		}

	}

	if o.DateFrom != nil {

		// query param dateFrom
		var qrDateFrom string
		if o.DateFrom != nil {
			qrDateFrom = *o.DateFrom
		}
		qDateFrom := qrDateFrom
		if qDateFrom != "" {
			if err := r.SetQueryParam("dateFrom", qDateFrom); err != nil {
				return err
			}
		}

	}

	if o.DateTo != nil {

		// query param dateTo
		var qrDateTo string
		if o.DateTo != nil {
			qrDateTo = *o.DateTo
		}
		qDateTo := qrDateTo
		if qDateTo != "" {
			if err := r.SetQueryParam("dateTo", qDateTo); err != nil {
				return err
			}
		}

	}

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