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

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

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

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

	/*Address
	  Postal Address URL encoded; partial addresses allowed

	*/
	Address *string
	/*CoordinateID
	  Taxnexus Record Id of a Coordinate

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

	*/
	Date *string
	/*PlaceName
	  Alternate City, ST format to backup addressQuery

	*/
	PlaceName *string
	/*Ref
	  Source system reference

	*/
	Ref *string

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

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

// SetTimeout adds the timeout to the get coordinate observable params
func (o *GetCoordinateObservableParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

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

// SetContext adds the context to the get coordinate observable params
func (o *GetCoordinateObservableParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

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

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

// WithAddress adds the address to the get coordinate observable params
func (o *GetCoordinateObservableParams) WithAddress(address *string) *GetCoordinateObservableParams {
	o.SetAddress(address)
	return o
}

// SetAddress adds the address to the get coordinate observable params
func (o *GetCoordinateObservableParams) SetAddress(address *string) {
	o.Address = address
}

// WithCoordinateID adds the coordinateID to the get coordinate observable params
func (o *GetCoordinateObservableParams) WithCoordinateID(coordinateID *string) *GetCoordinateObservableParams {
	o.SetCoordinateID(coordinateID)
	return o
}

// SetCoordinateID adds the coordinateId to the get coordinate observable params
func (o *GetCoordinateObservableParams) SetCoordinateID(coordinateID *string) {
	o.CoordinateID = coordinateID
}

// WithDate adds the date to the get coordinate observable params
func (o *GetCoordinateObservableParams) WithDate(date *string) *GetCoordinateObservableParams {
	o.SetDate(date)
	return o
}

// SetDate adds the date to the get coordinate observable params
func (o *GetCoordinateObservableParams) SetDate(date *string) {
	o.Date = date
}

// WithPlaceName adds the placeName to the get coordinate observable params
func (o *GetCoordinateObservableParams) WithPlaceName(placeName *string) *GetCoordinateObservableParams {
	o.SetPlaceName(placeName)
	return o
}

// SetPlaceName adds the placeName to the get coordinate observable params
func (o *GetCoordinateObservableParams) SetPlaceName(placeName *string) {
	o.PlaceName = placeName
}

// WithRef adds the ref to the get coordinate observable params
func (o *GetCoordinateObservableParams) WithRef(ref *string) *GetCoordinateObservableParams {
	o.SetRef(ref)
	return o
}

// SetRef adds the ref to the get coordinate observable params
func (o *GetCoordinateObservableParams) SetRef(ref *string) {
	o.Ref = ref
}

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

		// query param coordinateId
		var qrCoordinateID string
		if o.CoordinateID != nil {
			qrCoordinateID = *o.CoordinateID
		}
		qCoordinateID := qrCoordinateID
		if qCoordinateID != "" {
			if err := r.SetQueryParam("coordinateId", qCoordinateID); 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.PlaceName != nil {

		// query param placeName
		var qrPlaceName string
		if o.PlaceName != nil {
			qrPlaceName = *o.PlaceName
		}
		qPlaceName := qrPlaceName
		if qPlaceName != "" {
			if err := r.SetQueryParam("placeName", qPlaceName); err != nil {
				return err
			}
		}

	}

	if o.Ref != nil {

		// query param ref
		var qrRef string
		if o.Ref != nil {
			qrRef = *o.Ref
		}
		qRef := qrRef
		if qRef != "" {
			if err := r.SetQueryParam("ref", qRef); err != nil {
				return err
			}
		}

	}

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