// Code generated by go-swagger; DO NOT EDIT.

package invoice_management

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

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

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

	/*ID
	  Id of the account to be checked

	*/
	ID string
	/*Months
	  Amount of months to have in the report

	*/
	Months *int64

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

// WithTimeout adds the timeout to the get invoices by reseller params
func (o *GetInvoicesByResellerParams) WithTimeout(timeout time.Duration) *GetInvoicesByResellerParams {
	o.SetTimeout(timeout)
	return o
}

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

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

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

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

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

// WithID adds the id to the get invoices by reseller params
func (o *GetInvoicesByResellerParams) WithID(id string) *GetInvoicesByResellerParams {
	o.SetID(id)
	return o
}

// SetID adds the id to the get invoices by reseller params
func (o *GetInvoicesByResellerParams) SetID(id string) {
	o.ID = id
}

// WithMonths adds the months to the get invoices by reseller params
func (o *GetInvoicesByResellerParams) WithMonths(months *int64) *GetInvoicesByResellerParams {
	o.SetMonths(months)
	return o
}

// SetMonths adds the months to the get invoices by reseller params
func (o *GetInvoicesByResellerParams) SetMonths(months *int64) {
	o.Months = months
}

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

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

	// path param id
	if err := r.SetPathParam("id", o.ID); err != nil {
		return err
	}

	if o.Months != nil {

		// query param months
		var qrMonths int64
		if o.Months != nil {
			qrMonths = *o.Months
		}
		qMonths := swag.FormatInt64(qrMonths)
		if qMonths != "" {
			if err := r.SetQueryParam("months", qMonths); err != nil {
				return err
			}
		}

	}

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