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

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

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

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

	/*Address
	  Postal Address URL encoded; partial addresses allowed

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

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

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

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

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

	*/
	State *string

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

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

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

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

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

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

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

// WithAddress adds the address to the get coordinates params
func (o *GetCoordinatesParams) WithAddress(address *string) *GetCoordinatesParams {
	o.SetAddress(address)
	return o
}

// SetAddress adds the address to the get coordinates params
func (o *GetCoordinatesParams) SetAddress(address *string) {
	o.Address = address
}

// WithCountry adds the country to the get coordinates params
func (o *GetCoordinatesParams) WithCountry(country *string) *GetCoordinatesParams {
	o.SetCountry(country)
	return o
}

// SetCountry adds the country to the get coordinates params
func (o *GetCoordinatesParams) SetCountry(country *string) {
	o.Country = country
}

// WithLimit adds the limit to the get coordinates params
func (o *GetCoordinatesParams) WithLimit(limit *int32) *GetCoordinatesParams {
	o.SetLimit(limit)
	return o
}

// SetLimit adds the limit to the get coordinates params
func (o *GetCoordinatesParams) SetLimit(limit *int32) {
	o.Limit = limit
}

// WithOffset adds the offset to the get coordinates params
func (o *GetCoordinatesParams) WithOffset(offset *int32) *GetCoordinatesParams {
	o.SetOffset(offset)
	return o
}

// SetOffset adds the offset to the get coordinates params
func (o *GetCoordinatesParams) SetOffset(offset *int32) {
	o.Offset = offset
}

// WithPlace adds the place to the get coordinates params
func (o *GetCoordinatesParams) WithPlace(place *string) *GetCoordinatesParams {
	o.SetPlace(place)
	return o
}

// SetPlace adds the place to the get coordinates params
func (o *GetCoordinatesParams) SetPlace(place *string) {
	o.Place = place
}

// WithState adds the state to the get coordinates params
func (o *GetCoordinatesParams) WithState(state *string) *GetCoordinatesParams {
	o.SetState(state)
	return o
}

// SetState adds the state to the get coordinates params
func (o *GetCoordinatesParams) SetState(state *string) {
	o.State = state
}

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

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

	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.Country != nil {

		// query param country
		var qrCountry string
		if o.Country != nil {
			qrCountry = *o.Country
		}
		qCountry := qrCountry
		if qCountry != "" {
			if err := r.SetQueryParam("country", qCountry); err != nil {
				return err
			}
		}

	}

	if o.Limit != nil {

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

	}

	if o.Offset != nil {

		// query param offset
		var qrOffset int32
		if o.Offset != nil {
			qrOffset = *o.Offset
		}
		qOffset := swag.FormatInt32(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 len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
