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

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

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

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

	/*From
	  Datetime from which to get the usage report

	*/
	From *strfmt.DateTime
	/*ID
	  Id of the reseller to be checked

	*/
	ID string
	/*To
	  Datetime until which to get the usage report

	*/
	To *strfmt.DateTime

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

// WithTimeout adds the timeout to the get usage summary params
func (o *GetUsageSummaryParams) WithTimeout(timeout time.Duration) *GetUsageSummaryParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the get usage summary params
func (o *GetUsageSummaryParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the get usage summary params
func (o *GetUsageSummaryParams) WithContext(ctx context.Context) *GetUsageSummaryParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the get usage summary params
func (o *GetUsageSummaryParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the get usage summary params
func (o *GetUsageSummaryParams) WithHTTPClient(client *http.Client) *GetUsageSummaryParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the get usage summary params
func (o *GetUsageSummaryParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithFrom adds the from to the get usage summary params
func (o *GetUsageSummaryParams) WithFrom(from *strfmt.DateTime) *GetUsageSummaryParams {
	o.SetFrom(from)
	return o
}

// SetFrom adds the from to the get usage summary params
func (o *GetUsageSummaryParams) SetFrom(from *strfmt.DateTime) {
	o.From = from
}

// WithID adds the id to the get usage summary params
func (o *GetUsageSummaryParams) WithID(id string) *GetUsageSummaryParams {
	o.SetID(id)
	return o
}

// SetID adds the id to the get usage summary params
func (o *GetUsageSummaryParams) SetID(id string) {
	o.ID = id
}

// WithTo adds the to to the get usage summary params
func (o *GetUsageSummaryParams) WithTo(to *strfmt.DateTime) *GetUsageSummaryParams {
	o.SetTo(to)
	return o
}

// SetTo adds the to to the get usage summary params
func (o *GetUsageSummaryParams) SetTo(to *strfmt.DateTime) {
	o.To = to
}

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

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

	if o.From != nil {

		// query param from
		var qrFrom strfmt.DateTime
		if o.From != nil {
			qrFrom = *o.From
		}
		qFrom := qrFrom.String()
		if qFrom != "" {
			if err := r.SetQueryParam("from", qFrom); err != nil {
				return err
			}
		}

	}

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

	if o.To != nil {

		// query param to
		var qrTo strfmt.DateTime
		if o.To != nil {
			qrTo = *o.To
		}
		qTo := qrTo.String()
		if qTo != "" {
			if err := r.SetQueryParam("to", qTo); err != nil {
				return err
			}
		}

	}

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