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

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

/*GetInvoicesByCustomerParams contains all the parameters to send to the API endpoint
for the get invoices by customer operation typically these are written to a http.Request
*/
type GetInvoicesByCustomerParams 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 customer params
func (o *GetInvoicesByCustomerParams) WithTimeout(timeout time.Duration) *GetInvoicesByCustomerParams {
	o.SetTimeout(timeout)
	return o
}

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

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

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

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

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

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

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

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

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

// WriteToRequest writes these params to a swagger request
func (o *GetInvoicesByCustomerParams) 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
}
