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

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

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

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

	/*State
	  state to filter

	*/
	State *string
	/*Type
	  resource type to filter

	*/
	Type *string

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

// WithTimeout adds the timeout to the list cycles params
func (o *ListCyclesParams) WithTimeout(timeout time.Duration) *ListCyclesParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the list cycles params
func (o *ListCyclesParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

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

// SetContext adds the context to the list cycles params
func (o *ListCyclesParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

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

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

// WithState adds the state to the list cycles params
func (o *ListCyclesParams) WithState(state *string) *ListCyclesParams {
	o.SetState(state)
	return o
}

// SetState adds the state to the list cycles params
func (o *ListCyclesParams) SetState(state *string) {
	o.State = state
}

// WithType adds the typeVar to the list cycles params
func (o *ListCyclesParams) WithType(typeVar *string) *ListCyclesParams {
	o.SetType(typeVar)
	return o
}

// SetType adds the type to the list cycles params
func (o *ListCyclesParams) SetType(typeVar *string) {
	o.Type = typeVar
}

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

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

	if o.State != nil {

		// query param state
		var qrState string
		if o.State != nil {
			qrState = *o.State
		}
		qState := qrState
		if qState != "" {
			if err := r.SetQueryParam("state", qState); err != nil {
				return err
			}
		}

	}

	if o.Type != nil {

		// query param type
		var qrType string
		if o.Type != nil {
			qrType = *o.Type
		}
		qType := qrType
		if qType != "" {
			if err := r.SetQueryParam("type", qType); err != nil {
				return err
			}
		}

	}

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