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

// PutAPI5AgentGatewayReader is a Reader for the PutAPI5AgentGateway structure.
type PutAPI5AgentGatewayReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutAPI5AgentGatewayReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPutApi5AgentGatewayOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPutApi5AgentGatewayBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPutApi5AgentGatewayNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutApi5AgentGatewayInternalServerError()
		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/gateway] PutAPI5AgentGateway", response, response.Code())
	}
}

// NewPutApi5AgentGatewayOK creates a PutApi5AgentGatewayOK with default headers values
func NewPutApi5AgentGatewayOK() *PutApi5AgentGatewayOK {
	return &PutApi5AgentGatewayOK{}
}

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

OK
*/
type PutApi5AgentGatewayOK struct {
	Payload *models.ModelsGateway
}

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

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

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

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

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

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

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

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

func (o *PutApi5AgentGatewayOK) GetPayload() *models.ModelsGateway {
	return o.Payload
}

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

	o.Payload = new(models.ModelsGateway)

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

	return nil
}

// NewPutApi5AgentGatewayBadRequest creates a PutApi5AgentGatewayBadRequest with default headers values
func NewPutApi5AgentGatewayBadRequest() *PutApi5AgentGatewayBadRequest {
	return &PutApi5AgentGatewayBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

func (o *PutApi5AgentGatewayBadRequest) 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
}

// NewPutApi5AgentGatewayNotFound creates a PutApi5AgentGatewayNotFound with default headers values
func NewPutApi5AgentGatewayNotFound() *PutApi5AgentGatewayNotFound {
	return &PutApi5AgentGatewayNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

func (o *PutApi5AgentGatewayNotFound) 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
}

// NewPutApi5AgentGatewayInternalServerError creates a PutApi5AgentGatewayInternalServerError with default headers values
func NewPutApi5AgentGatewayInternalServerError() *PutApi5AgentGatewayInternalServerError {
	return &PutApi5AgentGatewayInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

func (o *PutApi5AgentGatewayInternalServerError) 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
}
