// Code generated by go-swagger; DO NOT EDIT.

package bootstrap

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"fmt"
	"io"

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

	"github.com/RafayLabs/rcloud-base/api/def/clients/sentry/models"
)

// BootstrapGetBootstrapInfraReader is a Reader for the BootstrapGetBootstrapInfra structure.
type BootstrapGetBootstrapInfraReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *BootstrapGetBootstrapInfraReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewBootstrapGetBootstrapInfraOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewBootstrapGetBootstrapInfraForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewBootstrapGetBootstrapInfraNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewBootstrapGetBootstrapInfraInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		result := NewBootstrapGetBootstrapInfraDefault(response.Code())
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		if response.Code()/100 == 2 {
			return result, nil
		}
		return nil, result
	}
}

// NewBootstrapGetBootstrapInfraOK creates a BootstrapGetBootstrapInfraOK with default headers values
func NewBootstrapGetBootstrapInfraOK() *BootstrapGetBootstrapInfraOK {
	return &BootstrapGetBootstrapInfraOK{}
}

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

A successful response.
*/
type BootstrapGetBootstrapInfraOK struct {
	Payload *models.SentryBootstrapInfra
}

func (o *BootstrapGetBootstrapInfraOK) Error() string {
	return fmt.Sprintf("[GET /v2/sentry/bootstrap/infra/{metadata.name}][%d] bootstrapGetBootstrapInfraOK  %+v", 200, o.Payload)
}
func (o *BootstrapGetBootstrapInfraOK) GetPayload() *models.SentryBootstrapInfra {
	return o.Payload
}

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

	o.Payload = new(models.SentryBootstrapInfra)

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

	return nil
}

// NewBootstrapGetBootstrapInfraForbidden creates a BootstrapGetBootstrapInfraForbidden with default headers values
func NewBootstrapGetBootstrapInfraForbidden() *BootstrapGetBootstrapInfraForbidden {
	return &BootstrapGetBootstrapInfraForbidden{}
}

/* BootstrapGetBootstrapInfraForbidden describes a response with status code 403, with default header values.

Returned when the user does not have permission to access the resource.
*/
type BootstrapGetBootstrapInfraForbidden struct {
	Payload interface{}
}

func (o *BootstrapGetBootstrapInfraForbidden) Error() string {
	return fmt.Sprintf("[GET /v2/sentry/bootstrap/infra/{metadata.name}][%d] bootstrapGetBootstrapInfraForbidden  %+v", 403, o.Payload)
}
func (o *BootstrapGetBootstrapInfraForbidden) GetPayload() interface{} {
	return o.Payload
}

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

// NewBootstrapGetBootstrapInfraNotFound creates a BootstrapGetBootstrapInfraNotFound with default headers values
func NewBootstrapGetBootstrapInfraNotFound() *BootstrapGetBootstrapInfraNotFound {
	return &BootstrapGetBootstrapInfraNotFound{}
}

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

Returned when the resource does not exist.
*/
type BootstrapGetBootstrapInfraNotFound struct {
	Payload interface{}
}

func (o *BootstrapGetBootstrapInfraNotFound) Error() string {
	return fmt.Sprintf("[GET /v2/sentry/bootstrap/infra/{metadata.name}][%d] bootstrapGetBootstrapInfraNotFound  %+v", 404, o.Payload)
}
func (o *BootstrapGetBootstrapInfraNotFound) GetPayload() interface{} {
	return o.Payload
}

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

// NewBootstrapGetBootstrapInfraInternalServerError creates a BootstrapGetBootstrapInfraInternalServerError with default headers values
func NewBootstrapGetBootstrapInfraInternalServerError() *BootstrapGetBootstrapInfraInternalServerError {
	return &BootstrapGetBootstrapInfraInternalServerError{}
}

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

Returned for internal server error
*/
type BootstrapGetBootstrapInfraInternalServerError struct {
	Payload interface{}
}

func (o *BootstrapGetBootstrapInfraInternalServerError) Error() string {
	return fmt.Sprintf("[GET /v2/sentry/bootstrap/infra/{metadata.name}][%d] bootstrapGetBootstrapInfraInternalServerError  %+v", 500, o.Payload)
}
func (o *BootstrapGetBootstrapInfraInternalServerError) GetPayload() interface{} {
	return o.Payload
}

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

// NewBootstrapGetBootstrapInfraDefault creates a BootstrapGetBootstrapInfraDefault with default headers values
func NewBootstrapGetBootstrapInfraDefault(code int) *BootstrapGetBootstrapInfraDefault {
	return &BootstrapGetBootstrapInfraDefault{
		_statusCode: code,
	}
}

/* BootstrapGetBootstrapInfraDefault describes a response with status code -1, with default header values.

An unexpected error response.
*/
type BootstrapGetBootstrapInfraDefault struct {
	_statusCode int

	Payload *models.GooglerpcStatus
}

// Code gets the status code for the bootstrap get bootstrap infra default response
func (o *BootstrapGetBootstrapInfraDefault) Code() int {
	return o._statusCode
}

func (o *BootstrapGetBootstrapInfraDefault) Error() string {
	return fmt.Sprintf("[GET /v2/sentry/bootstrap/infra/{metadata.name}][%d] Bootstrap_GetBootstrapInfra default  %+v", o._statusCode, o.Payload)
}
func (o *BootstrapGetBootstrapInfraDefault) GetPayload() *models.GooglerpcStatus {
	return o.Payload
}

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

	o.Payload = new(models.GooglerpcStatus)

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

	return nil
}
