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

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

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

	/*EndDate
	  The end date of transaction query

	*/
	EndDate string
	/*Limit
	  The number of records to retrieve

	*/
	Limit *float64
	/*Start
	  The starting record in multi-record retrievals

	*/
	Start *float64
	/*StartDate
	  The start date of transaction query

	*/
	StartDate string

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

// WithTimeout adds the timeout to the get purchase order list params
func (o *GetPurchaseOrderListParams) WithTimeout(timeout time.Duration) *GetPurchaseOrderListParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the get purchase order list params
func (o *GetPurchaseOrderListParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the get purchase order list params
func (o *GetPurchaseOrderListParams) WithContext(ctx context.Context) *GetPurchaseOrderListParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the get purchase order list params
func (o *GetPurchaseOrderListParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the get purchase order list params
func (o *GetPurchaseOrderListParams) WithHTTPClient(client *http.Client) *GetPurchaseOrderListParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the get purchase order list params
func (o *GetPurchaseOrderListParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithEndDate adds the endDate to the get purchase order list params
func (o *GetPurchaseOrderListParams) WithEndDate(endDate string) *GetPurchaseOrderListParams {
	o.SetEndDate(endDate)
	return o
}

// SetEndDate adds the endDate to the get purchase order list params
func (o *GetPurchaseOrderListParams) SetEndDate(endDate string) {
	o.EndDate = endDate
}

// WithLimit adds the limit to the get purchase order list params
func (o *GetPurchaseOrderListParams) WithLimit(limit *float64) *GetPurchaseOrderListParams {
	o.SetLimit(limit)
	return o
}

// SetLimit adds the limit to the get purchase order list params
func (o *GetPurchaseOrderListParams) SetLimit(limit *float64) {
	o.Limit = limit
}

// WithStart adds the start to the get purchase order list params
func (o *GetPurchaseOrderListParams) WithStart(start *float64) *GetPurchaseOrderListParams {
	o.SetStart(start)
	return o
}

// SetStart adds the start to the get purchase order list params
func (o *GetPurchaseOrderListParams) SetStart(start *float64) {
	o.Start = start
}

// WithStartDate adds the startDate to the get purchase order list params
func (o *GetPurchaseOrderListParams) WithStartDate(startDate string) *GetPurchaseOrderListParams {
	o.SetStartDate(startDate)
	return o
}

// SetStartDate adds the startDate to the get purchase order list params
func (o *GetPurchaseOrderListParams) SetStartDate(startDate string) {
	o.StartDate = startDate
}

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

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

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

	if o.Limit != nil {

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

	}

	if o.Start != nil {

		// query param start
		var qrStart float64
		if o.Start != nil {
			qrStart = *o.Start
		}
		qStart := swag.FormatFloat64(qrStart)
		if qStart != "" {
			if err := r.SetQueryParam("start", qStart); err != nil {
				return err
			}
		}

	}

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

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