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

package provisioning

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

// NewGet5BridgesParams creates a new Get5BridgesParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewGet5BridgesParams() *Get5BridgesParams {
	return &Get5BridgesParams{
		timeout: cr.DefaultTimeout,
	}
}

// NewGet5BridgesParamsWithTimeout creates a new Get5BridgesParams object
// with the ability to set a timeout on a request.
func NewGet5BridgesParamsWithTimeout(timeout time.Duration) *Get5BridgesParams {
	return &Get5BridgesParams{
		timeout: timeout,
	}
}

// NewGet5BridgesParamsWithContext creates a new Get5BridgesParams object
// with the ability to set a context for a request.
func NewGet5BridgesParamsWithContext(ctx context.Context) *Get5BridgesParams {
	return &Get5BridgesParams{
		Context: ctx,
	}
}

// NewGet5BridgesParamsWithHTTPClient creates a new Get5BridgesParams object
// with the ability to set a custom HTTPClient for a request.
func NewGet5BridgesParamsWithHTTPClient(client *http.Client) *Get5BridgesParams {
	return &Get5BridgesParams{
		HTTPClient: client,
	}
}

/*
Get5BridgesParams contains all the parameters to send to the API endpoint

	for the get5 bridges operation.

	Typically these are written to a http.Request.
*/
type Get5BridgesParams struct {

	/* Loc.

	   location
	*/
	Loc *string

	/* Port.

	   port
	*/
	Port *string

	/* Tr.

	   transport (tcp|udp)
	*/
	Tr *string

	/* Type.

	   type
	*/
	Type *string

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

// WithDefaults hydrates default values in the get5 bridges params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *Get5BridgesParams) WithDefaults() *Get5BridgesParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the get5 bridges params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *Get5BridgesParams) SetDefaults() {
	// no default values defined for this parameter
}

// WithTimeout adds the timeout to the get5 bridges params
func (o *Get5BridgesParams) WithTimeout(timeout time.Duration) *Get5BridgesParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the get5 bridges params
func (o *Get5BridgesParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the get5 bridges params
func (o *Get5BridgesParams) WithContext(ctx context.Context) *Get5BridgesParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the get5 bridges params
func (o *Get5BridgesParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the get5 bridges params
func (o *Get5BridgesParams) WithHTTPClient(client *http.Client) *Get5BridgesParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the get5 bridges params
func (o *Get5BridgesParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithLoc adds the loc to the get5 bridges params
func (o *Get5BridgesParams) WithLoc(loc *string) *Get5BridgesParams {
	o.SetLoc(loc)
	return o
}

// SetLoc adds the loc to the get5 bridges params
func (o *Get5BridgesParams) SetLoc(loc *string) {
	o.Loc = loc
}

// WithPort adds the port to the get5 bridges params
func (o *Get5BridgesParams) WithPort(port *string) *Get5BridgesParams {
	o.SetPort(port)
	return o
}

// SetPort adds the port to the get5 bridges params
func (o *Get5BridgesParams) SetPort(port *string) {
	o.Port = port
}

// WithTr adds the tr to the get5 bridges params
func (o *Get5BridgesParams) WithTr(tr *string) *Get5BridgesParams {
	o.SetTr(tr)
	return o
}

// SetTr adds the tr to the get5 bridges params
func (o *Get5BridgesParams) SetTr(tr *string) {
	o.Tr = tr
}

// WithType adds the typeVar to the get5 bridges params
func (o *Get5BridgesParams) WithType(typeVar *string) *Get5BridgesParams {
	o.SetType(typeVar)
	return o
}

// SetType adds the type to the get5 bridges params
func (o *Get5BridgesParams) SetType(typeVar *string) {
	o.Type = typeVar
}

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

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

	if o.Loc != nil {

		// query param loc
		var qrLoc string

		if o.Loc != nil {
			qrLoc = *o.Loc
		}
		qLoc := qrLoc
		if qLoc != "" {

			if err := r.SetQueryParam("loc", qLoc); err != nil {
				return err
			}
		}
	}

	if o.Port != nil {

		// query param port
		var qrPort string

		if o.Port != nil {
			qrPort = *o.Port
		}
		qPort := qrPort
		if qPort != "" {

			if err := r.SetQueryParam("port", qPort); err != nil {
				return err
			}
		}
	}

	if o.Tr != nil {

		// query param tr
		var qrTr string

		if o.Tr != nil {
			qrTr = *o.Tr
		}
		qTr := qrTr
		if qTr != "" {

			if err := r.SetQueryParam("tr", qTr); 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
}
