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

// GetAPI5GatewayLocationReader is a Reader for the GetAPI5GatewayLocation structure.
type GetAPI5GatewayLocationReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetAPI5GatewayLocationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetApi5GatewayLocationOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetApi5GatewayLocationBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetApi5GatewayLocationNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetApi5GatewayLocationInternalServerError()
		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/{location}] GetAPI5GatewayLocation", response, response.Code())
	}
}

// NewGetApi5GatewayLocationOK creates a GetApi5GatewayLocationOK with default headers values
func NewGetApi5GatewayLocationOK() *GetApi5GatewayLocationOK {
	return &GetApi5GatewayLocationOK{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGetApi5GatewayLocationBadRequest creates a GetApi5GatewayLocationBadRequest with default headers values
func NewGetApi5GatewayLocationBadRequest() *GetApi5GatewayLocationBadRequest {
	return &GetApi5GatewayLocationBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGetApi5GatewayLocationNotFound creates a GetApi5GatewayLocationNotFound with default headers values
func NewGetApi5GatewayLocationNotFound() *GetApi5GatewayLocationNotFound {
	return &GetApi5GatewayLocationNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGetApi5GatewayLocationInternalServerError creates a GetApi5GatewayLocationInternalServerError with default headers values
func NewGetApi5GatewayLocationInternalServerError() *GetApi5GatewayLocationInternalServerError {
	return &GetApi5GatewayLocationInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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