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

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

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

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

	/*EndDate
	  The last modified end timestamp

	*/
	EndDate *string
	/*Item
	  The Item Number

	*/
	Item *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
	/*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 invoices params
func (o *GetInvoicesParams) WithTimeout(timeout time.Duration) *GetInvoicesParams {
	o.SetTimeout(timeout)
	return o
}

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

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

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

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

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

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

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

// WithItem adds the item to the get invoices params
func (o *GetInvoicesParams) WithItem(item *string) *GetInvoicesParams {
	o.SetItem(item)
	return o
}

// SetItem adds the item to the get invoices params
func (o *GetInvoicesParams) SetItem(item *string) {
	o.Item = item
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

		// query param item
		var qrItem string
		if o.Item != nil {
			qrItem = *o.Item
		}
		qItem := qrItem
		if qItem != "" {
			if err := r.SetQueryParam("item", qItem); 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.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
}
