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

package snapshots

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

	"github.com/grafana/grafana-openapi-client-go/models"
)

// DeleteDashboardSnapshotByDeleteKeyReader is a Reader for the DeleteDashboardSnapshotByDeleteKey structure.
type DeleteDashboardSnapshotByDeleteKeyReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *DeleteDashboardSnapshotByDeleteKeyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewDeleteDashboardSnapshotByDeleteKeyOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewDeleteDashboardSnapshotByDeleteKeyUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewDeleteDashboardSnapshotByDeleteKeyForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewDeleteDashboardSnapshotByDeleteKeyNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewDeleteDashboardSnapshotByDeleteKeyInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /snapshots-delete/{deleteKey}] deleteDashboardSnapshotByDeleteKey", response, response.Code())
	}
}

// NewDeleteDashboardSnapshotByDeleteKeyOK creates a DeleteDashboardSnapshotByDeleteKeyOK with default headers values
func NewDeleteDashboardSnapshotByDeleteKeyOK() *DeleteDashboardSnapshotByDeleteKeyOK {
	return &DeleteDashboardSnapshotByDeleteKeyOK{}
}

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

An OKResponse is returned if the request was successful.
*/
type DeleteDashboardSnapshotByDeleteKeyOK struct {
	Payload *models.SuccessResponseBody
}

// IsSuccess returns true when this delete dashboard snapshot by delete key Ok response has a 2xx status code
func (o *DeleteDashboardSnapshotByDeleteKeyOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this delete dashboard snapshot by delete key Ok response has a 3xx status code
func (o *DeleteDashboardSnapshotByDeleteKeyOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete dashboard snapshot by delete key Ok response has a 4xx status code
func (o *DeleteDashboardSnapshotByDeleteKeyOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this delete dashboard snapshot by delete key Ok response has a 5xx status code
func (o *DeleteDashboardSnapshotByDeleteKeyOK) IsServerError() bool {
	return false
}

// IsCode returns true when this delete dashboard snapshot by delete key Ok response a status code equal to that given
func (o *DeleteDashboardSnapshotByDeleteKeyOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the delete dashboard snapshot by delete key Ok response
func (o *DeleteDashboardSnapshotByDeleteKeyOK) Code() int {
	return 200
}

func (o *DeleteDashboardSnapshotByDeleteKeyOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /snapshots-delete/{deleteKey}][%d] deleteDashboardSnapshotByDeleteKeyOk %s", 200, payload)
}

func (o *DeleteDashboardSnapshotByDeleteKeyOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /snapshots-delete/{deleteKey}][%d] deleteDashboardSnapshotByDeleteKeyOk %s", 200, payload)
}

func (o *DeleteDashboardSnapshotByDeleteKeyOK) GetPayload() *models.SuccessResponseBody {
	return o.Payload
}

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

	o.Payload = new(models.SuccessResponseBody)

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

	return nil
}

// NewDeleteDashboardSnapshotByDeleteKeyUnauthorized creates a DeleteDashboardSnapshotByDeleteKeyUnauthorized with default headers values
func NewDeleteDashboardSnapshotByDeleteKeyUnauthorized() *DeleteDashboardSnapshotByDeleteKeyUnauthorized {
	return &DeleteDashboardSnapshotByDeleteKeyUnauthorized{}
}

/*
DeleteDashboardSnapshotByDeleteKeyUnauthorized describes a response with status code 401, with default header values.

UnauthorizedError is returned when the request is not authenticated.
*/
type DeleteDashboardSnapshotByDeleteKeyUnauthorized struct {
	Payload *models.ErrorResponseBody
}

// IsSuccess returns true when this delete dashboard snapshot by delete key unauthorized response has a 2xx status code
func (o *DeleteDashboardSnapshotByDeleteKeyUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete dashboard snapshot by delete key unauthorized response has a 3xx status code
func (o *DeleteDashboardSnapshotByDeleteKeyUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete dashboard snapshot by delete key unauthorized response has a 4xx status code
func (o *DeleteDashboardSnapshotByDeleteKeyUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this delete dashboard snapshot by delete key unauthorized response has a 5xx status code
func (o *DeleteDashboardSnapshotByDeleteKeyUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this delete dashboard snapshot by delete key unauthorized response a status code equal to that given
func (o *DeleteDashboardSnapshotByDeleteKeyUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the delete dashboard snapshot by delete key unauthorized response
func (o *DeleteDashboardSnapshotByDeleteKeyUnauthorized) Code() int {
	return 401
}

func (o *DeleteDashboardSnapshotByDeleteKeyUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /snapshots-delete/{deleteKey}][%d] deleteDashboardSnapshotByDeleteKeyUnauthorized %s", 401, payload)
}

func (o *DeleteDashboardSnapshotByDeleteKeyUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /snapshots-delete/{deleteKey}][%d] deleteDashboardSnapshotByDeleteKeyUnauthorized %s", 401, payload)
}

func (o *DeleteDashboardSnapshotByDeleteKeyUnauthorized) GetPayload() *models.ErrorResponseBody {
	return o.Payload
}

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

	o.Payload = new(models.ErrorResponseBody)

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

	return nil
}

// NewDeleteDashboardSnapshotByDeleteKeyForbidden creates a DeleteDashboardSnapshotByDeleteKeyForbidden with default headers values
func NewDeleteDashboardSnapshotByDeleteKeyForbidden() *DeleteDashboardSnapshotByDeleteKeyForbidden {
	return &DeleteDashboardSnapshotByDeleteKeyForbidden{}
}

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

ForbiddenError is returned if the user/token has insufficient permissions to access the requested resource.
*/
type DeleteDashboardSnapshotByDeleteKeyForbidden struct {
	Payload *models.ErrorResponseBody
}

// IsSuccess returns true when this delete dashboard snapshot by delete key forbidden response has a 2xx status code
func (o *DeleteDashboardSnapshotByDeleteKeyForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete dashboard snapshot by delete key forbidden response has a 3xx status code
func (o *DeleteDashboardSnapshotByDeleteKeyForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete dashboard snapshot by delete key forbidden response has a 4xx status code
func (o *DeleteDashboardSnapshotByDeleteKeyForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this delete dashboard snapshot by delete key forbidden response has a 5xx status code
func (o *DeleteDashboardSnapshotByDeleteKeyForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this delete dashboard snapshot by delete key forbidden response a status code equal to that given
func (o *DeleteDashboardSnapshotByDeleteKeyForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the delete dashboard snapshot by delete key forbidden response
func (o *DeleteDashboardSnapshotByDeleteKeyForbidden) Code() int {
	return 403
}

func (o *DeleteDashboardSnapshotByDeleteKeyForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /snapshots-delete/{deleteKey}][%d] deleteDashboardSnapshotByDeleteKeyForbidden %s", 403, payload)
}

func (o *DeleteDashboardSnapshotByDeleteKeyForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /snapshots-delete/{deleteKey}][%d] deleteDashboardSnapshotByDeleteKeyForbidden %s", 403, payload)
}

func (o *DeleteDashboardSnapshotByDeleteKeyForbidden) GetPayload() *models.ErrorResponseBody {
	return o.Payload
}

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

	o.Payload = new(models.ErrorResponseBody)

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

	return nil
}

// NewDeleteDashboardSnapshotByDeleteKeyNotFound creates a DeleteDashboardSnapshotByDeleteKeyNotFound with default headers values
func NewDeleteDashboardSnapshotByDeleteKeyNotFound() *DeleteDashboardSnapshotByDeleteKeyNotFound {
	return &DeleteDashboardSnapshotByDeleteKeyNotFound{}
}

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

NotFoundError is returned when the requested resource was not found.
*/
type DeleteDashboardSnapshotByDeleteKeyNotFound struct {
	Payload *models.ErrorResponseBody
}

// IsSuccess returns true when this delete dashboard snapshot by delete key not found response has a 2xx status code
func (o *DeleteDashboardSnapshotByDeleteKeyNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete dashboard snapshot by delete key not found response has a 3xx status code
func (o *DeleteDashboardSnapshotByDeleteKeyNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete dashboard snapshot by delete key not found response has a 4xx status code
func (o *DeleteDashboardSnapshotByDeleteKeyNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this delete dashboard snapshot by delete key not found response has a 5xx status code
func (o *DeleteDashboardSnapshotByDeleteKeyNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this delete dashboard snapshot by delete key not found response a status code equal to that given
func (o *DeleteDashboardSnapshotByDeleteKeyNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the delete dashboard snapshot by delete key not found response
func (o *DeleteDashboardSnapshotByDeleteKeyNotFound) Code() int {
	return 404
}

func (o *DeleteDashboardSnapshotByDeleteKeyNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /snapshots-delete/{deleteKey}][%d] deleteDashboardSnapshotByDeleteKeyNotFound %s", 404, payload)
}

func (o *DeleteDashboardSnapshotByDeleteKeyNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /snapshots-delete/{deleteKey}][%d] deleteDashboardSnapshotByDeleteKeyNotFound %s", 404, payload)
}

func (o *DeleteDashboardSnapshotByDeleteKeyNotFound) GetPayload() *models.ErrorResponseBody {
	return o.Payload
}

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

	o.Payload = new(models.ErrorResponseBody)

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

	return nil
}

// NewDeleteDashboardSnapshotByDeleteKeyInternalServerError creates a DeleteDashboardSnapshotByDeleteKeyInternalServerError with default headers values
func NewDeleteDashboardSnapshotByDeleteKeyInternalServerError() *DeleteDashboardSnapshotByDeleteKeyInternalServerError {
	return &DeleteDashboardSnapshotByDeleteKeyInternalServerError{}
}

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

InternalServerError is a general error indicating something went wrong internally.
*/
type DeleteDashboardSnapshotByDeleteKeyInternalServerError struct {
	Payload *models.ErrorResponseBody
}

// IsSuccess returns true when this delete dashboard snapshot by delete key internal server error response has a 2xx status code
func (o *DeleteDashboardSnapshotByDeleteKeyInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete dashboard snapshot by delete key internal server error response has a 3xx status code
func (o *DeleteDashboardSnapshotByDeleteKeyInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete dashboard snapshot by delete key internal server error response has a 4xx status code
func (o *DeleteDashboardSnapshotByDeleteKeyInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this delete dashboard snapshot by delete key internal server error response has a 5xx status code
func (o *DeleteDashboardSnapshotByDeleteKeyInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this delete dashboard snapshot by delete key internal server error response a status code equal to that given
func (o *DeleteDashboardSnapshotByDeleteKeyInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the delete dashboard snapshot by delete key internal server error response
func (o *DeleteDashboardSnapshotByDeleteKeyInternalServerError) Code() int {
	return 500
}

func (o *DeleteDashboardSnapshotByDeleteKeyInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /snapshots-delete/{deleteKey}][%d] deleteDashboardSnapshotByDeleteKeyInternalServerError %s", 500, payload)
}

func (o *DeleteDashboardSnapshotByDeleteKeyInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /snapshots-delete/{deleteKey}][%d] deleteDashboardSnapshotByDeleteKeyInternalServerError %s", 500, payload)
}

func (o *DeleteDashboardSnapshotByDeleteKeyInternalServerError) GetPayload() *models.ErrorResponseBody {
	return o.Payload
}

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

	o.Payload = new(models.ErrorResponseBody)

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

	return nil
}
