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

package agent

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

	"0xacab.org/leap/menshen/models"
)

// NewPutAPI5AgentGatewayParams creates a new PutAPI5AgentGatewayParams 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 NewPutAPI5AgentGatewayParams() *PutAPI5AgentGatewayParams {
	return &PutAPI5AgentGatewayParams{
		timeout: cr.DefaultTimeout,
	}
}

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

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

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

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

	for the put API 5 agent gateway operation.

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

	/* Gateway.

	   gateway
	*/
	Gateway *models.ModelsGateway

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

// WithDefaults hydrates default values in the put API 5 agent gateway params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutAPI5AgentGatewayParams) WithDefaults() *PutAPI5AgentGatewayParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the put API 5 agent gateway params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutAPI5AgentGatewayParams) SetDefaults() {
	// no default values defined for this parameter
}

// WithTimeout adds the timeout to the put API 5 agent gateway params
func (o *PutAPI5AgentGatewayParams) WithTimeout(timeout time.Duration) *PutAPI5AgentGatewayParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the put API 5 agent gateway params
func (o *PutAPI5AgentGatewayParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the put API 5 agent gateway params
func (o *PutAPI5AgentGatewayParams) WithContext(ctx context.Context) *PutAPI5AgentGatewayParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the put API 5 agent gateway params
func (o *PutAPI5AgentGatewayParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the put API 5 agent gateway params
func (o *PutAPI5AgentGatewayParams) WithHTTPClient(client *http.Client) *PutAPI5AgentGatewayParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the put API 5 agent gateway params
func (o *PutAPI5AgentGatewayParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithGateway adds the gateway to the put API 5 agent gateway params
func (o *PutAPI5AgentGatewayParams) WithGateway(gateway *models.ModelsGateway) *PutAPI5AgentGatewayParams {
	o.SetGateway(gateway)
	return o
}

// SetGateway adds the gateway to the put API 5 agent gateway params
func (o *PutAPI5AgentGatewayParams) SetGateway(gateway *models.ModelsGateway) {
	o.Gateway = gateway
}

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

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

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