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

// BootstrapPatchBootstrapAgentTemplateReader is a Reader for the BootstrapPatchBootstrapAgentTemplate structure.
type BootstrapPatchBootstrapAgentTemplateReader struct {
	formats strfmt.Registry
}

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

// NewBootstrapPatchBootstrapAgentTemplateOK creates a BootstrapPatchBootstrapAgentTemplateOK with default headers values
func NewBootstrapPatchBootstrapAgentTemplateOK() *BootstrapPatchBootstrapAgentTemplateOK {
	return &BootstrapPatchBootstrapAgentTemplateOK{}
}

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

A successful response.
*/
type BootstrapPatchBootstrapAgentTemplateOK struct {
	Payload *models.SentryBootstrapAgentTemplate
}

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

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

	o.Payload = new(models.SentryBootstrapAgentTemplate)

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

	return nil
}

// NewBootstrapPatchBootstrapAgentTemplateForbidden creates a BootstrapPatchBootstrapAgentTemplateForbidden with default headers values
func NewBootstrapPatchBootstrapAgentTemplateForbidden() *BootstrapPatchBootstrapAgentTemplateForbidden {
	return &BootstrapPatchBootstrapAgentTemplateForbidden{}
}

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

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

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

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

// NewBootstrapPatchBootstrapAgentTemplateNotFound creates a BootstrapPatchBootstrapAgentTemplateNotFound with default headers values
func NewBootstrapPatchBootstrapAgentTemplateNotFound() *BootstrapPatchBootstrapAgentTemplateNotFound {
	return &BootstrapPatchBootstrapAgentTemplateNotFound{}
}

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

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

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

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

// NewBootstrapPatchBootstrapAgentTemplateInternalServerError creates a BootstrapPatchBootstrapAgentTemplateInternalServerError with default headers values
func NewBootstrapPatchBootstrapAgentTemplateInternalServerError() *BootstrapPatchBootstrapAgentTemplateInternalServerError {
	return &BootstrapPatchBootstrapAgentTemplateInternalServerError{}
}

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

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

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

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

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

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

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

	Payload *models.GooglerpcStatus
}

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

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

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