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

package devices

// 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/cisco-sso/meraki-cli/models"
)

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

/*CycleDeviceSwitchPortsParams contains all the parameters to send to the API endpoint
for the cycle device switch ports operation typically these are written to a http.Request
*/
type CycleDeviceSwitchPortsParams struct {

	/*CycleDeviceSwitchPorts*/
	CycleDeviceSwitchPorts *models.CycleDeviceSwitchPorts
	/*Serial*/
	Serial string

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

// WithTimeout adds the timeout to the cycle device switch ports params
func (o *CycleDeviceSwitchPortsParams) WithTimeout(timeout time.Duration) *CycleDeviceSwitchPortsParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the cycle device switch ports params
func (o *CycleDeviceSwitchPortsParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the cycle device switch ports params
func (o *CycleDeviceSwitchPortsParams) WithContext(ctx context.Context) *CycleDeviceSwitchPortsParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the cycle device switch ports params
func (o *CycleDeviceSwitchPortsParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the cycle device switch ports params
func (o *CycleDeviceSwitchPortsParams) WithHTTPClient(client *http.Client) *CycleDeviceSwitchPortsParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the cycle device switch ports params
func (o *CycleDeviceSwitchPortsParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithCycleDeviceSwitchPorts adds the cycleDeviceSwitchPorts to the cycle device switch ports params
func (o *CycleDeviceSwitchPortsParams) WithCycleDeviceSwitchPorts(cycleDeviceSwitchPorts *models.CycleDeviceSwitchPorts) *CycleDeviceSwitchPortsParams {
	o.SetCycleDeviceSwitchPorts(cycleDeviceSwitchPorts)
	return o
}

// SetCycleDeviceSwitchPorts adds the cycleDeviceSwitchPorts to the cycle device switch ports params
func (o *CycleDeviceSwitchPortsParams) SetCycleDeviceSwitchPorts(cycleDeviceSwitchPorts *models.CycleDeviceSwitchPorts) {
	o.CycleDeviceSwitchPorts = cycleDeviceSwitchPorts
}

// WithSerial adds the serial to the cycle device switch ports params
func (o *CycleDeviceSwitchPortsParams) WithSerial(serial string) *CycleDeviceSwitchPortsParams {
	o.SetSerial(serial)
	return o
}

// SetSerial adds the serial to the cycle device switch ports params
func (o *CycleDeviceSwitchPortsParams) SetSerial(serial string) {
	o.Serial = serial
}

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

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

	if o.CycleDeviceSwitchPorts != nil {
		if err := r.SetBodyParam(o.CycleDeviceSwitchPorts); err != nil {
			return err
		}
	}

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

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