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

// BootstrapUpdateBootstrapAgentReader is a Reader for the BootstrapUpdateBootstrapAgent structure.
type BootstrapUpdateBootstrapAgentReader struct {
	formats strfmt.Registry
}

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

// NewBootstrapUpdateBootstrapAgentOK creates a BootstrapUpdateBootstrapAgentOK with default headers values
func NewBootstrapUpdateBootstrapAgentOK() *BootstrapUpdateBootstrapAgentOK {
	return &BootstrapUpdateBootstrapAgentOK{}
}

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

A successful response.
*/
type BootstrapUpdateBootstrapAgentOK struct {
	Payload *models.SentryBootstrapAgent
}

func (o *BootstrapUpdateBootstrapAgentOK) Error() string {
	return fmt.Sprintf("[PUT /v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}][%d] bootstrapUpdateBootstrapAgentOK  %+v", 200, o.Payload)
}
func (o *BootstrapUpdateBootstrapAgentOK) GetPayload() *models.SentryBootstrapAgent {
	return o.Payload
}

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

	o.Payload = new(models.SentryBootstrapAgent)

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

	return nil
}

// NewBootstrapUpdateBootstrapAgentForbidden creates a BootstrapUpdateBootstrapAgentForbidden with default headers values
func NewBootstrapUpdateBootstrapAgentForbidden() *BootstrapUpdateBootstrapAgentForbidden {
	return &BootstrapUpdateBootstrapAgentForbidden{}
}

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

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

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

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

// NewBootstrapUpdateBootstrapAgentNotFound creates a BootstrapUpdateBootstrapAgentNotFound with default headers values
func NewBootstrapUpdateBootstrapAgentNotFound() *BootstrapUpdateBootstrapAgentNotFound {
	return &BootstrapUpdateBootstrapAgentNotFound{}
}

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

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

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

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

// NewBootstrapUpdateBootstrapAgentInternalServerError creates a BootstrapUpdateBootstrapAgentInternalServerError with default headers values
func NewBootstrapUpdateBootstrapAgentInternalServerError() *BootstrapUpdateBootstrapAgentInternalServerError {
	return &BootstrapUpdateBootstrapAgentInternalServerError{}
}

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

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

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

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

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

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

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

	Payload *models.GooglerpcStatus
}

// Code gets the status code for the bootstrap update bootstrap agent default response
func (o *BootstrapUpdateBootstrapAgentDefault) Code() int {
	return o._statusCode
}

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

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