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

// BootstrapPatchBootstrapInfraReader is a Reader for the BootstrapPatchBootstrapInfra structure.
type BootstrapPatchBootstrapInfraReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *BootstrapPatchBootstrapInfraReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewBootstrapPatchBootstrapInfraOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewBootstrapPatchBootstrapInfraForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewBootstrapPatchBootstrapInfraNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewBootstrapPatchBootstrapInfraInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		result := NewBootstrapPatchBootstrapInfraDefault(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
	}
}

// NewBootstrapPatchBootstrapInfraOK creates a BootstrapPatchBootstrapInfraOK with default headers values
func NewBootstrapPatchBootstrapInfraOK() *BootstrapPatchBootstrapInfraOK {
	return &BootstrapPatchBootstrapInfraOK{}
}

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

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

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

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

// NewBootstrapPatchBootstrapInfraForbidden creates a BootstrapPatchBootstrapInfraForbidden with default headers values
func NewBootstrapPatchBootstrapInfraForbidden() *BootstrapPatchBootstrapInfraForbidden {
	return &BootstrapPatchBootstrapInfraForbidden{}
}

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

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

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

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

// NewBootstrapPatchBootstrapInfraNotFound creates a BootstrapPatchBootstrapInfraNotFound with default headers values
func NewBootstrapPatchBootstrapInfraNotFound() *BootstrapPatchBootstrapInfraNotFound {
	return &BootstrapPatchBootstrapInfraNotFound{}
}

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

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

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

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

// NewBootstrapPatchBootstrapInfraInternalServerError creates a BootstrapPatchBootstrapInfraInternalServerError with default headers values
func NewBootstrapPatchBootstrapInfraInternalServerError() *BootstrapPatchBootstrapInfraInternalServerError {
	return &BootstrapPatchBootstrapInfraInternalServerError{}
}

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

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

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

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

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

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

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

	Payload *models.GooglerpcStatus
}

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

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

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