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

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

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

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

	/*Active
	  Retrieve only active records?

	*/
	Active *bool
	/*Address
	  Postal Address URL encoded; partial addresses allowed

	*/
	Address *string
	/*CountryCode
	  The Country abbreviation (2 char)

	*/
	CountryCode *string
	/*County
	  The County Name

	*/
	County *string
	/*Date
	  Transaction date (defaults to current)

	*/
	Date *string
	/*Ids
	  Taxnexus Record Ids of the Tax Types in a JSON array url encoded

	*/
	Ids *string
	/*Limit
	  How many objects to return at one time

	*/
	Limit *int64
	/*Offset
	  How many objects to skip? (default 0)

	*/
	Offset *int64
	/*Place
	  The City name (must be accompanied by State)

	*/
	Place *string
	/*State
	  The State or Province abbreviation (2 char)

	*/
	State *string
	/*TaxTypeID
	  Taxnexus Record Id of the Tax Type

	*/
	TaxTypeID *string

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

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

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

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

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

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

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

// WithActive adds the active to the get tax types params
func (o *GetTaxTypesParams) WithActive(active *bool) *GetTaxTypesParams {
	o.SetActive(active)
	return o
}

// SetActive adds the active to the get tax types params
func (o *GetTaxTypesParams) SetActive(active *bool) {
	o.Active = active
}

// WithAddress adds the address to the get tax types params
func (o *GetTaxTypesParams) WithAddress(address *string) *GetTaxTypesParams {
	o.SetAddress(address)
	return o
}

// SetAddress adds the address to the get tax types params
func (o *GetTaxTypesParams) SetAddress(address *string) {
	o.Address = address
}

// WithCountryCode adds the countryCode to the get tax types params
func (o *GetTaxTypesParams) WithCountryCode(countryCode *string) *GetTaxTypesParams {
	o.SetCountryCode(countryCode)
	return o
}

// SetCountryCode adds the countryCode to the get tax types params
func (o *GetTaxTypesParams) SetCountryCode(countryCode *string) {
	o.CountryCode = countryCode
}

// WithCounty adds the county to the get tax types params
func (o *GetTaxTypesParams) WithCounty(county *string) *GetTaxTypesParams {
	o.SetCounty(county)
	return o
}

// SetCounty adds the county to the get tax types params
func (o *GetTaxTypesParams) SetCounty(county *string) {
	o.County = county
}

// WithDate adds the date to the get tax types params
func (o *GetTaxTypesParams) WithDate(date *string) *GetTaxTypesParams {
	o.SetDate(date)
	return o
}

// SetDate adds the date to the get tax types params
func (o *GetTaxTypesParams) SetDate(date *string) {
	o.Date = date
}

// WithIds adds the ids to the get tax types params
func (o *GetTaxTypesParams) WithIds(ids *string) *GetTaxTypesParams {
	o.SetIds(ids)
	return o
}

// SetIds adds the ids to the get tax types params
func (o *GetTaxTypesParams) SetIds(ids *string) {
	o.Ids = ids
}

// WithLimit adds the limit to the get tax types params
func (o *GetTaxTypesParams) WithLimit(limit *int64) *GetTaxTypesParams {
	o.SetLimit(limit)
	return o
}

// SetLimit adds the limit to the get tax types params
func (o *GetTaxTypesParams) SetLimit(limit *int64) {
	o.Limit = limit
}

// WithOffset adds the offset to the get tax types params
func (o *GetTaxTypesParams) WithOffset(offset *int64) *GetTaxTypesParams {
	o.SetOffset(offset)
	return o
}

// SetOffset adds the offset to the get tax types params
func (o *GetTaxTypesParams) SetOffset(offset *int64) {
	o.Offset = offset
}

// WithPlace adds the place to the get tax types params
func (o *GetTaxTypesParams) WithPlace(place *string) *GetTaxTypesParams {
	o.SetPlace(place)
	return o
}

// SetPlace adds the place to the get tax types params
func (o *GetTaxTypesParams) SetPlace(place *string) {
	o.Place = place
}

// WithState adds the state to the get tax types params
func (o *GetTaxTypesParams) WithState(state *string) *GetTaxTypesParams {
	o.SetState(state)
	return o
}

// SetState adds the state to the get tax types params
func (o *GetTaxTypesParams) SetState(state *string) {
	o.State = state
}

// WithTaxTypeID adds the taxTypeID to the get tax types params
func (o *GetTaxTypesParams) WithTaxTypeID(taxTypeID *string) *GetTaxTypesParams {
	o.SetTaxTypeID(taxTypeID)
	return o
}

// SetTaxTypeID adds the taxTypeId to the get tax types params
func (o *GetTaxTypesParams) SetTaxTypeID(taxTypeID *string) {
	o.TaxTypeID = taxTypeID
}

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

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

	if o.Active != nil {

		// query param active
		var qrActive bool
		if o.Active != nil {
			qrActive = *o.Active
		}
		qActive := swag.FormatBool(qrActive)
		if qActive != "" {
			if err := r.SetQueryParam("active", qActive); err != nil {
				return err
			}
		}

	}

	if o.Address != nil {

		// query param address
		var qrAddress string
		if o.Address != nil {
			qrAddress = *o.Address
		}
		qAddress := qrAddress
		if qAddress != "" {
			if err := r.SetQueryParam("address", qAddress); err != nil {
				return err
			}
		}

	}

	if o.CountryCode != nil {

		// query param countryCode
		var qrCountryCode string
		if o.CountryCode != nil {
			qrCountryCode = *o.CountryCode
		}
		qCountryCode := qrCountryCode
		if qCountryCode != "" {
			if err := r.SetQueryParam("countryCode", qCountryCode); err != nil {
				return err
			}
		}

	}

	if o.County != nil {

		// query param county
		var qrCounty string
		if o.County != nil {
			qrCounty = *o.County
		}
		qCounty := qrCounty
		if qCounty != "" {
			if err := r.SetQueryParam("county", qCounty); err != nil {
				return err
			}
		}

	}

	if o.Date != nil {

		// query param date
		var qrDate string
		if o.Date != nil {
			qrDate = *o.Date
		}
		qDate := qrDate
		if qDate != "" {
			if err := r.SetQueryParam("date", qDate); err != nil {
				return err
			}
		}

	}

	if o.Ids != nil {

		// query param ids
		var qrIds string
		if o.Ids != nil {
			qrIds = *o.Ids
		}
		qIds := qrIds
		if qIds != "" {
			if err := r.SetQueryParam("ids", qIds); err != nil {
				return err
			}
		}

	}

	if o.Limit != nil {

		// query param limit
		var qrLimit int64
		if o.Limit != nil {
			qrLimit = *o.Limit
		}
		qLimit := swag.FormatInt64(qrLimit)
		if qLimit != "" {
			if err := r.SetQueryParam("limit", qLimit); err != nil {
				return err
			}
		}

	}

	if o.Offset != nil {

		// query param offset
		var qrOffset int64
		if o.Offset != nil {
			qrOffset = *o.Offset
		}
		qOffset := swag.FormatInt64(qrOffset)
		if qOffset != "" {
			if err := r.SetQueryParam("offset", qOffset); err != nil {
				return err
			}
		}

	}

	if o.Place != nil {

		// query param place
		var qrPlace string
		if o.Place != nil {
			qrPlace = *o.Place
		}
		qPlace := qrPlace
		if qPlace != "" {
			if err := r.SetQueryParam("place", qPlace); err != nil {
				return err
			}
		}

	}

	if o.State != nil {

		// query param state
		var qrState string
		if o.State != nil {
			qrState = *o.State
		}
		qState := qrState
		if qState != "" {
			if err := r.SetQueryParam("state", qState); err != nil {
				return err
			}
		}

	}

	if o.TaxTypeID != nil {

		// query param taxTypeId
		var qrTaxTypeID string
		if o.TaxTypeID != nil {
			qrTaxTypeID = *o.TaxTypeID
		}
		qTaxTypeID := qrTaxTypeID
		if qTaxTypeID != "" {
			if err := r.SetQueryParam("taxTypeId", qTaxTypeID); err != nil {
				return err
			}
		}

	}

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