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

package bulk_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"
)

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

/*ListBillRunsParams contains all the parameters to send to the API endpoint
for the list bill runs operation typically these are written to a http.Request
*/
type ListBillRunsParams struct {

	/*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 list bill runs params
func (o *ListBillRunsParams) WithTimeout(timeout time.Duration) *ListBillRunsParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the list bill runs params
func (o *ListBillRunsParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the list bill runs params
func (o *ListBillRunsParams) WithContext(ctx context.Context) *ListBillRunsParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the list bill runs params
func (o *ListBillRunsParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the list bill runs params
func (o *ListBillRunsParams) WithHTTPClient(client *http.Client) *ListBillRunsParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the list bill runs params
func (o *ListBillRunsParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithMonths adds the months to the list bill runs params
func (o *ListBillRunsParams) WithMonths(months *int64) *ListBillRunsParams {
	o.SetMonths(months)
	return o
}

// SetMonths adds the months to the list bill runs params
func (o *ListBillRunsParams) SetMonths(months *int64) {
	o.Months = months
}

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

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

	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
}
