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

// 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/go-openapi/swag"
)

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

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

	/*AccountID
	  Taxnexus Record Id of an Account

	*/
	AccountID *string
	/*Month
	  The Month Number (1,2, ..., 12) of the report

	*/
	Month *int64
	/*Quarter
	  The Quarter Number (1,2,3,4) of the report

	*/
	Quarter *int64
	/*Semiannual
	  The Semiannual Number (1,2) of the report

	*/
	Semiannual *int64
	/*Year
	  The year of the report

	*/
	Year *int64

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

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

// SetTimeout adds the timeout to the get use tax params
func (o *GetUseTaxParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

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

// SetContext adds the context to the get use tax params
func (o *GetUseTaxParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

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

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

// WithAccountID adds the accountID to the get use tax params
func (o *GetUseTaxParams) WithAccountID(accountID *string) *GetUseTaxParams {
	o.SetAccountID(accountID)
	return o
}

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

// WithMonth adds the month to the get use tax params
func (o *GetUseTaxParams) WithMonth(month *int64) *GetUseTaxParams {
	o.SetMonth(month)
	return o
}

// SetMonth adds the month to the get use tax params
func (o *GetUseTaxParams) SetMonth(month *int64) {
	o.Month = month
}

// WithQuarter adds the quarter to the get use tax params
func (o *GetUseTaxParams) WithQuarter(quarter *int64) *GetUseTaxParams {
	o.SetQuarter(quarter)
	return o
}

// SetQuarter adds the quarter to the get use tax params
func (o *GetUseTaxParams) SetQuarter(quarter *int64) {
	o.Quarter = quarter
}

// WithSemiannual adds the semiannual to the get use tax params
func (o *GetUseTaxParams) WithSemiannual(semiannual *int64) *GetUseTaxParams {
	o.SetSemiannual(semiannual)
	return o
}

// SetSemiannual adds the semiannual to the get use tax params
func (o *GetUseTaxParams) SetSemiannual(semiannual *int64) {
	o.Semiannual = semiannual
}

// WithYear adds the year to the get use tax params
func (o *GetUseTaxParams) WithYear(year *int64) *GetUseTaxParams {
	o.SetYear(year)
	return o
}

// SetYear adds the year to the get use tax params
func (o *GetUseTaxParams) SetYear(year *int64) {
	o.Year = year
}

// WriteToRequest writes these params to a swagger request
func (o *GetUseTaxParams) 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.Month != nil {

		// query param month
		var qrMonth int64
		if o.Month != nil {
			qrMonth = *o.Month
		}
		qMonth := swag.FormatInt64(qrMonth)
		if qMonth != "" {
			if err := r.SetQueryParam("month", qMonth); err != nil {
				return err
			}
		}

	}

	if o.Quarter != nil {

		// query param quarter
		var qrQuarter int64
		if o.Quarter != nil {
			qrQuarter = *o.Quarter
		}
		qQuarter := swag.FormatInt64(qrQuarter)
		if qQuarter != "" {
			if err := r.SetQueryParam("quarter", qQuarter); err != nil {
				return err
			}
		}

	}

	if o.Semiannual != nil {

		// query param semiannual
		var qrSemiannual int64
		if o.Semiannual != nil {
			qrSemiannual = *o.Semiannual
		}
		qSemiannual := swag.FormatInt64(qrSemiannual)
		if qSemiannual != "" {
			if err := r.SetQueryParam("semiannual", qSemiannual); err != nil {
				return err
			}
		}

	}

	if o.Year != nil {

		// query param year
		var qrYear int64
		if o.Year != nil {
			qrYear = *o.Year
		}
		qYear := swag.FormatInt64(qrYear)
		if qYear != "" {
			if err := r.SetQueryParam("year", qYear); err != nil {
				return err
			}
		}

	}

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