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

// Get5BridgesReader is a Reader for the Get5Bridges structure.
type Get5BridgesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *Get5BridgesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGet5BridgesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGet5BridgesBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGet5BridgesNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGet5BridgesInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /5/bridges] Get5Bridges", response, response.Code())
	}
}

// NewGet5BridgesOK creates a Get5BridgesOK with default headers values
func NewGet5BridgesOK() *Get5BridgesOK {
	return &Get5BridgesOK{}
}

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

OK
*/
type Get5BridgesOK struct {
	Payload []*models.ModelsBridge
}

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

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

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

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

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

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

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

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

func (o *Get5BridgesOK) GetPayload() []*models.ModelsBridge {
	return o.Payload
}

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

// NewGet5BridgesBadRequest creates a Get5BridgesBadRequest with default headers values
func NewGet5BridgesBadRequest() *Get5BridgesBadRequest {
	return &Get5BridgesBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGet5BridgesNotFound creates a Get5BridgesNotFound with default headers values
func NewGet5BridgesNotFound() *Get5BridgesNotFound {
	return &Get5BridgesNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGet5BridgesInternalServerError creates a Get5BridgesInternalServerError with default headers values
func NewGet5BridgesInternalServerError() *Get5BridgesInternalServerError {
	return &Get5BridgesInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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