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

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

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

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

	/*EndDate
	  The last modified end timestamp

	*/
	EndDate *string
	/*License
	  The Licnese Number for the query

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

	*/
	Limit *int64
	/*Offset
	  How many objects to skip

	*/
	Offset *int64
	/*Partner
	  The Partner Key

	*/
	Partner *string
	/*PoID
	  The ID Purchase Order to be retrieved

	*/
	PoID *string
	/*StartDate
	  The last modified start timestamp

	*/
	StartDate *string
	/*State
	  The 2-character State Code

	*/
	State string
	/*User
	  The Taxnexus User's Key on the Vendor API

	*/
	User string
	/*Vendor
	  The name of the Vendor Gateway to be used

	*/
	Vendor *string

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

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

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

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

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

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

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

// WithEndDate adds the endDate to the get pos params
func (o *GetPosParams) WithEndDate(endDate *string) *GetPosParams {
	o.SetEndDate(endDate)
	return o
}

// SetEndDate adds the endDate to the get pos params
func (o *GetPosParams) SetEndDate(endDate *string) {
	o.EndDate = endDate
}

// WithLicense adds the license to the get pos params
func (o *GetPosParams) WithLicense(license *string) *GetPosParams {
	o.SetLicense(license)
	return o
}

// SetLicense adds the license to the get pos params
func (o *GetPosParams) SetLicense(license *string) {
	o.License = license
}

// WithLimit adds the limit to the get pos params
func (o *GetPosParams) WithLimit(limit *int64) *GetPosParams {
	o.SetLimit(limit)
	return o
}

// SetLimit adds the limit to the get pos params
func (o *GetPosParams) SetLimit(limit *int64) {
	o.Limit = limit
}

// WithOffset adds the offset to the get pos params
func (o *GetPosParams) WithOffset(offset *int64) *GetPosParams {
	o.SetOffset(offset)
	return o
}

// SetOffset adds the offset to the get pos params
func (o *GetPosParams) SetOffset(offset *int64) {
	o.Offset = offset
}

// WithPartner adds the partner to the get pos params
func (o *GetPosParams) WithPartner(partner *string) *GetPosParams {
	o.SetPartner(partner)
	return o
}

// SetPartner adds the partner to the get pos params
func (o *GetPosParams) SetPartner(partner *string) {
	o.Partner = partner
}

// WithPoID adds the poID to the get pos params
func (o *GetPosParams) WithPoID(poID *string) *GetPosParams {
	o.SetPoID(poID)
	return o
}

// SetPoID adds the poId to the get pos params
func (o *GetPosParams) SetPoID(poID *string) {
	o.PoID = poID
}

// WithStartDate adds the startDate to the get pos params
func (o *GetPosParams) WithStartDate(startDate *string) *GetPosParams {
	o.SetStartDate(startDate)
	return o
}

// SetStartDate adds the startDate to the get pos params
func (o *GetPosParams) SetStartDate(startDate *string) {
	o.StartDate = startDate
}

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

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

// WithUser adds the user to the get pos params
func (o *GetPosParams) WithUser(user string) *GetPosParams {
	o.SetUser(user)
	return o
}

// SetUser adds the user to the get pos params
func (o *GetPosParams) SetUser(user string) {
	o.User = user
}

// WithVendor adds the vendor to the get pos params
func (o *GetPosParams) WithVendor(vendor *string) *GetPosParams {
	o.SetVendor(vendor)
	return o
}

// SetVendor adds the vendor to the get pos params
func (o *GetPosParams) SetVendor(vendor *string) {
	o.Vendor = vendor
}

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

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

	if o.EndDate != nil {

		// query param endDate
		var qrEndDate string
		if o.EndDate != nil {
			qrEndDate = *o.EndDate
		}
		qEndDate := qrEndDate
		if qEndDate != "" {
			if err := r.SetQueryParam("endDate", qEndDate); err != nil {
				return err
			}
		}

	}

	if o.License != nil {

		// query param license
		var qrLicense string
		if o.License != nil {
			qrLicense = *o.License
		}
		qLicense := qrLicense
		if qLicense != "" {
			if err := r.SetQueryParam("license", qLicense); 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.Partner != nil {

		// query param partner
		var qrPartner string
		if o.Partner != nil {
			qrPartner = *o.Partner
		}
		qPartner := qrPartner
		if qPartner != "" {
			if err := r.SetQueryParam("partner", qPartner); err != nil {
				return err
			}
		}

	}

	if o.PoID != nil {

		// query param poId
		var qrPoID string
		if o.PoID != nil {
			qrPoID = *o.PoID
		}
		qPoID := qrPoID
		if qPoID != "" {
			if err := r.SetQueryParam("poId", qPoID); err != nil {
				return err
			}
		}

	}

	if o.StartDate != nil {

		// query param startDate
		var qrStartDate string
		if o.StartDate != nil {
			qrStartDate = *o.StartDate
		}
		qStartDate := qrStartDate
		if qStartDate != "" {
			if err := r.SetQueryParam("startDate", qStartDate); err != nil {
				return err
			}
		}

	}

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

	// query param user
	qrUser := o.User
	qUser := qrUser
	if qUser != "" {
		if err := r.SetQueryParam("user", qUser); err != nil {
			return err
		}
	}

	if o.Vendor != nil {

		// query param vendor
		var qrVendor string
		if o.Vendor != nil {
			qrVendor = *o.Vendor
		}
		qVendor := qrVendor
		if qVendor != "" {
			if err := r.SetQueryParam("vendor", qVendor); err != nil {
				return err
			}
		}

	}

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