// 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/bitmask-core/models"
)

// Get5GatewayLocationReader is a Reader for the Get5GatewayLocation structure.
type Get5GatewayLocationReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *Get5GatewayLocationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGet5GatewayLocationOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGet5GatewayLocationBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGet5GatewayLocationNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGet5GatewayLocationInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /5/gateway/{location}] Get5GatewayLocation", response, response.Code())
	}
}

// NewGet5GatewayLocationOK creates a Get5GatewayLocationOK with default headers values
func NewGet5GatewayLocationOK() *Get5GatewayLocationOK {
	return &Get5GatewayLocationOK{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGet5GatewayLocationBadRequest creates a Get5GatewayLocationBadRequest with default headers values
func NewGet5GatewayLocationBadRequest() *Get5GatewayLocationBadRequest {
	return &Get5GatewayLocationBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGet5GatewayLocationNotFound creates a Get5GatewayLocationNotFound with default headers values
func NewGet5GatewayLocationNotFound() *Get5GatewayLocationNotFound {
	return &Get5GatewayLocationNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGet5GatewayLocationInternalServerError creates a Get5GatewayLocationInternalServerError with default headers values
func NewGet5GatewayLocationInternalServerError() *Get5GatewayLocationInternalServerError {
	return &Get5GatewayLocationInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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