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

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

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

// GetAPI5GatewayReader is a Reader for the GetAPI5Gateway structure.
type GetAPI5GatewayReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetAPI5GatewayReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetApi5GatewayOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetApi5GatewayBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetApi5GatewayNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetApi5GatewayInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /api/5/gateway] GetAPI5Gateway", response, response.Code())
	}
}

// NewGetApi5GatewayOK creates a GetApi5GatewayOK with default headers values
func NewGetApi5GatewayOK() *GetApi5GatewayOK {
	return &GetApi5GatewayOK{}
}

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

OK
*/
type GetApi5GatewayOK struct {
	Payload []*models.ModelsGateway
}

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

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

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

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

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

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

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

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

func (o *GetApi5GatewayOK) GetPayload() []*models.ModelsGateway {
	return o.Payload
}

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

// NewGetApi5GatewayBadRequest creates a GetApi5GatewayBadRequest with default headers values
func NewGetApi5GatewayBadRequest() *GetApi5GatewayBadRequest {
	return &GetApi5GatewayBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGetApi5GatewayNotFound creates a GetApi5GatewayNotFound with default headers values
func NewGetApi5GatewayNotFound() *GetApi5GatewayNotFound {
	return &GetApi5GatewayNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGetApi5GatewayInternalServerError creates a GetApi5GatewayInternalServerError with default headers values
func NewGetApi5GatewayInternalServerError() *GetApi5GatewayInternalServerError {
	return &GetApi5GatewayInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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