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

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

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

	/*Months
	  Amount of months to check for failed invoices.

	*/
	Months *int64

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

// WithTimeout adds the timeout to the re run all bill runs params
func (o *ReRunAllBillRunsParams) WithTimeout(timeout time.Duration) *ReRunAllBillRunsParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the re run all bill runs params
func (o *ReRunAllBillRunsParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the re run all bill runs params
func (o *ReRunAllBillRunsParams) WithContext(ctx context.Context) *ReRunAllBillRunsParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the re run all bill runs params
func (o *ReRunAllBillRunsParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the re run all bill runs params
func (o *ReRunAllBillRunsParams) WithHTTPClient(client *http.Client) *ReRunAllBillRunsParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the re run all bill runs params
func (o *ReRunAllBillRunsParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithMonths adds the months to the re run all bill runs params
func (o *ReRunAllBillRunsParams) WithMonths(months *int64) *ReRunAllBillRunsParams {
	o.SetMonths(months)
	return o
}

// SetMonths adds the months to the re run all bill runs params
func (o *ReRunAllBillRunsParams) SetMonths(months *int64) {
	o.Months = months
}

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