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

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

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

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

	/*License
	  The Licnese Number for the query

	*/
	License *string
	/*Partner
	  The Partner Key

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	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.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
			}
		}

	}

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