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

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

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

/*UDRRedoParams contains all the parameters to send to the API endpoint
for the u d r redo operation typically these are written to a http.Request
*/
type UDRRedoParams struct {

	/*From
	  Datetime from which to regenerate the udrs

	*/
	From *strfmt.DateTime
	/*Interval
	  Interval to do increments

	*/
	Interval *string
	/*To
	  Datetime until which to regenerate the udrs

	*/
	To *strfmt.DateTime

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

// WithTimeout adds the timeout to the u d r redo params
func (o *UDRRedoParams) WithTimeout(timeout time.Duration) *UDRRedoParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the u d r redo params
func (o *UDRRedoParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the u d r redo params
func (o *UDRRedoParams) WithContext(ctx context.Context) *UDRRedoParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the u d r redo params
func (o *UDRRedoParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the u d r redo params
func (o *UDRRedoParams) WithHTTPClient(client *http.Client) *UDRRedoParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the u d r redo params
func (o *UDRRedoParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithFrom adds the from to the u d r redo params
func (o *UDRRedoParams) WithFrom(from *strfmt.DateTime) *UDRRedoParams {
	o.SetFrom(from)
	return o
}

// SetFrom adds the from to the u d r redo params
func (o *UDRRedoParams) SetFrom(from *strfmt.DateTime) {
	o.From = from
}

// WithInterval adds the interval to the u d r redo params
func (o *UDRRedoParams) WithInterval(interval *string) *UDRRedoParams {
	o.SetInterval(interval)
	return o
}

// SetInterval adds the interval to the u d r redo params
func (o *UDRRedoParams) SetInterval(interval *string) {
	o.Interval = interval
}

// WithTo adds the to to the u d r redo params
func (o *UDRRedoParams) WithTo(to *strfmt.DateTime) *UDRRedoParams {
	o.SetTo(to)
	return o
}

// SetTo adds the to to the u d r redo params
func (o *UDRRedoParams) SetTo(to *strfmt.DateTime) {
	o.To = to
}

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

	}

	if o.Interval != nil {

		// query param interval
		var qrInterval string
		if o.Interval != nil {
			qrInterval = *o.Interval
		}
		qInterval := qrInterval
		if qInterval != "" {
			if err := r.SetQueryParam("interval", qInterval); 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
}
