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

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

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

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

	/*Active
	  Retrieve only active records?

	*/
	Active *bool
	/*CompanyID
	  Taxnexus Id of the Company to be retrieved

	*/
	CompanyID *string
	/*LicensetypeID
	  Taxnexus Id of the License Type to be retrieved

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

	*/
	Limit *int64
	/*Offset
	  How many objects to skip? (default 0)

	*/
	Offset *int64

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

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

// SetTimeout adds the timeout to the get license types params
func (o *GetLicenseTypesParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

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

// SetContext adds the context to the get license types params
func (o *GetLicenseTypesParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

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

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

// WithActive adds the active to the get license types params
func (o *GetLicenseTypesParams) WithActive(active *bool) *GetLicenseTypesParams {
	o.SetActive(active)
	return o
}

// SetActive adds the active to the get license types params
func (o *GetLicenseTypesParams) SetActive(active *bool) {
	o.Active = active
}

// WithCompanyID adds the companyID to the get license types params
func (o *GetLicenseTypesParams) WithCompanyID(companyID *string) *GetLicenseTypesParams {
	o.SetCompanyID(companyID)
	return o
}

// SetCompanyID adds the companyId to the get license types params
func (o *GetLicenseTypesParams) SetCompanyID(companyID *string) {
	o.CompanyID = companyID
}

// WithLicensetypeID adds the licensetypeID to the get license types params
func (o *GetLicenseTypesParams) WithLicensetypeID(licensetypeID *string) *GetLicenseTypesParams {
	o.SetLicensetypeID(licensetypeID)
	return o
}

// SetLicensetypeID adds the licensetypeId to the get license types params
func (o *GetLicenseTypesParams) SetLicensetypeID(licensetypeID *string) {
	o.LicensetypeID = licensetypeID
}

// WithLimit adds the limit to the get license types params
func (o *GetLicenseTypesParams) WithLimit(limit *int64) *GetLicenseTypesParams {
	o.SetLimit(limit)
	return o
}

// SetLimit adds the limit to the get license types params
func (o *GetLicenseTypesParams) SetLimit(limit *int64) {
	o.Limit = limit
}

// WithOffset adds the offset to the get license types params
func (o *GetLicenseTypesParams) WithOffset(offset *int64) *GetLicenseTypesParams {
	o.SetOffset(offset)
	return o
}

// SetOffset adds the offset to the get license types params
func (o *GetLicenseTypesParams) SetOffset(offset *int64) {
	o.Offset = offset
}

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

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

	if o.Active != nil {

		// query param active
		var qrActive bool
		if o.Active != nil {
			qrActive = *o.Active
		}
		qActive := swag.FormatBool(qrActive)
		if qActive != "" {
			if err := r.SetQueryParam("active", qActive); err != nil {
				return err
			}
		}

	}

	if o.CompanyID != nil {

		// query param companyId
		var qrCompanyID string
		if o.CompanyID != nil {
			qrCompanyID = *o.CompanyID
		}
		qCompanyID := qrCompanyID
		if qCompanyID != "" {
			if err := r.SetQueryParam("companyId", qCompanyID); err != nil {
				return err
			}
		}

	}

	if o.LicensetypeID != nil {

		// query param licensetypeId
		var qrLicensetypeID string
		if o.LicensetypeID != nil {
			qrLicensetypeID = *o.LicensetypeID
		}
		qLicensetypeID := qrLicensetypeID
		if qLicensetypeID != "" {
			if err := r.SetQueryParam("licensetypeId", qLicensetypeID); 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 len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
