// 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 (
	"encoding/json"
	"fmt"
	"io"

	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"

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

// PutAPI5AgentBridgeReader is a Reader for the PutAPI5AgentBridge structure.
type PutAPI5AgentBridgeReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutAPI5AgentBridgeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPutApi5AgentBridgeOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPutApi5AgentBridgeBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPutApi5AgentBridgeNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutApi5AgentBridgeInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /api/5/agent/bridge] PutAPI5AgentBridge", response, response.Code())
	}
}

// NewPutApi5AgentBridgeOK creates a PutApi5AgentBridgeOK with default headers values
func NewPutApi5AgentBridgeOK() *PutApi5AgentBridgeOK {
	return &PutApi5AgentBridgeOK{}
}

/*
PutApi5AgentBridgeOK describes a response with status code 200, with default header values.

OK
*/
type PutApi5AgentBridgeOK struct {
	Payload *models.ModelsBridge
}

// IsSuccess returns true when this put api5 agent bridge o k response has a 2xx status code
func (o *PutApi5AgentBridgeOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this put api5 agent bridge o k response has a 3xx status code
func (o *PutApi5AgentBridgeOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this put api5 agent bridge o k response has a 4xx status code
func (o *PutApi5AgentBridgeOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this put api5 agent bridge o k response has a 5xx status code
func (o *PutApi5AgentBridgeOK) IsServerError() bool {
	return false
}

// IsCode returns true when this put api5 agent bridge o k response a status code equal to that given
func (o *PutApi5AgentBridgeOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the put api5 agent bridge o k response
func (o *PutApi5AgentBridgeOK) Code() int {
	return 200
}

func (o *PutApi5AgentBridgeOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /api/5/agent/bridge][%d] putApi5AgentBridgeOK %s", 200, payload)
}

func (o *PutApi5AgentBridgeOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /api/5/agent/bridge][%d] putApi5AgentBridgeOK %s", 200, payload)
}

func (o *PutApi5AgentBridgeOK) GetPayload() *models.ModelsBridge {
	return o.Payload
}

func (o *PutApi5AgentBridgeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(models.ModelsBridge)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewPutApi5AgentBridgeBadRequest creates a PutApi5AgentBridgeBadRequest with default headers values
func NewPutApi5AgentBridgeBadRequest() *PutApi5AgentBridgeBadRequest {
	return &PutApi5AgentBridgeBadRequest{}
}

/*
PutApi5AgentBridgeBadRequest describes a response with status code 400, with default header values.

Bad Request
*/
type PutApi5AgentBridgeBadRequest struct {
	Payload interface{}
}

// IsSuccess returns true when this put api5 agent bridge bad request response has a 2xx status code
func (o *PutApi5AgentBridgeBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this put api5 agent bridge bad request response has a 3xx status code
func (o *PutApi5AgentBridgeBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this put api5 agent bridge bad request response has a 4xx status code
func (o *PutApi5AgentBridgeBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this put api5 agent bridge bad request response has a 5xx status code
func (o *PutApi5AgentBridgeBadRequest) IsServerError() bool {
	return false
}

// IsCode returns true when this put api5 agent bridge bad request response a status code equal to that given
func (o *PutApi5AgentBridgeBadRequest) IsCode(code int) bool {
	return code == 400
}

// Code gets the status code for the put api5 agent bridge bad request response
func (o *PutApi5AgentBridgeBadRequest) Code() int {
	return 400
}

func (o *PutApi5AgentBridgeBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /api/5/agent/bridge][%d] putApi5AgentBridgeBadRequest %s", 400, payload)
}

func (o *PutApi5AgentBridgeBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /api/5/agent/bridge][%d] putApi5AgentBridgeBadRequest %s", 400, payload)
}

func (o *PutApi5AgentBridgeBadRequest) GetPayload() interface{} {
	return o.Payload
}

func (o *PutApi5AgentBridgeBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	// response payload
	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewPutApi5AgentBridgeNotFound creates a PutApi5AgentBridgeNotFound with default headers values
func NewPutApi5AgentBridgeNotFound() *PutApi5AgentBridgeNotFound {
	return &PutApi5AgentBridgeNotFound{}
}

/*
PutApi5AgentBridgeNotFound describes a response with status code 404, with default header values.

Not Found
*/
type PutApi5AgentBridgeNotFound struct {
	Payload interface{}
}

// IsSuccess returns true when this put api5 agent bridge not found response has a 2xx status code
func (o *PutApi5AgentBridgeNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this put api5 agent bridge not found response has a 3xx status code
func (o *PutApi5AgentBridgeNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this put api5 agent bridge not found response has a 4xx status code
func (o *PutApi5AgentBridgeNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this put api5 agent bridge not found response has a 5xx status code
func (o *PutApi5AgentBridgeNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this put api5 agent bridge not found response a status code equal to that given
func (o *PutApi5AgentBridgeNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the put api5 agent bridge not found response
func (o *PutApi5AgentBridgeNotFound) Code() int {
	return 404
}

func (o *PutApi5AgentBridgeNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /api/5/agent/bridge][%d] putApi5AgentBridgeNotFound %s", 404, payload)
}

func (o *PutApi5AgentBridgeNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /api/5/agent/bridge][%d] putApi5AgentBridgeNotFound %s", 404, payload)
}

func (o *PutApi5AgentBridgeNotFound) GetPayload() interface{} {
	return o.Payload
}

func (o *PutApi5AgentBridgeNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	// response payload
	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewPutApi5AgentBridgeInternalServerError creates a PutApi5AgentBridgeInternalServerError with default headers values
func NewPutApi5AgentBridgeInternalServerError() *PutApi5AgentBridgeInternalServerError {
	return &PutApi5AgentBridgeInternalServerError{}
}

/*
PutApi5AgentBridgeInternalServerError describes a response with status code 500, with default header values.

Internal Server Error
*/
type PutApi5AgentBridgeInternalServerError struct {
	Payload interface{}
}

// IsSuccess returns true when this put api5 agent bridge internal server error response has a 2xx status code
func (o *PutApi5AgentBridgeInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this put api5 agent bridge internal server error response has a 3xx status code
func (o *PutApi5AgentBridgeInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this put api5 agent bridge internal server error response has a 4xx status code
func (o *PutApi5AgentBridgeInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this put api5 agent bridge internal server error response has a 5xx status code
func (o *PutApi5AgentBridgeInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this put api5 agent bridge internal server error response a status code equal to that given
func (o *PutApi5AgentBridgeInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the put api5 agent bridge internal server error response
func (o *PutApi5AgentBridgeInternalServerError) Code() int {
	return 500
}

func (o *PutApi5AgentBridgeInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /api/5/agent/bridge][%d] putApi5AgentBridgeInternalServerError %s", 500, payload)
}

func (o *PutApi5AgentBridgeInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /api/5/agent/bridge][%d] putApi5AgentBridgeInternalServerError %s", 500, payload)
}

func (o *PutApi5AgentBridgeInternalServerError) GetPayload() interface{} {
	return o.Payload
}

func (o *PutApi5AgentBridgeInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	// response payload
	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}
