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

package dashboards

// 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/grafana/grafana-openapi-client-go/models"
)

// CalculateDashboardDiffReader is a Reader for the CalculateDashboardDiff structure.
type CalculateDashboardDiffReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *CalculateDashboardDiffReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewCalculateDashboardDiffOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewCalculateDashboardDiffUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewCalculateDashboardDiffForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewCalculateDashboardDiffInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /dashboards/calculate-diff] calculateDashboardDiff", response, response.Code())
	}
}

// NewCalculateDashboardDiffOK creates a CalculateDashboardDiffOK with default headers values
func NewCalculateDashboardDiffOK() *CalculateDashboardDiffOK {
	return &CalculateDashboardDiffOK{}
}

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

(empty)
*/
type CalculateDashboardDiffOK struct {
	Payload []uint8
}

// IsSuccess returns true when this calculate dashboard diff Ok response has a 2xx status code
func (o *CalculateDashboardDiffOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this calculate dashboard diff Ok response has a 3xx status code
func (o *CalculateDashboardDiffOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this calculate dashboard diff Ok response has a 4xx status code
func (o *CalculateDashboardDiffOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this calculate dashboard diff Ok response has a 5xx status code
func (o *CalculateDashboardDiffOK) IsServerError() bool {
	return false
}

// IsCode returns true when this calculate dashboard diff Ok response a status code equal to that given
func (o *CalculateDashboardDiffOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the calculate dashboard diff Ok response
func (o *CalculateDashboardDiffOK) Code() int {
	return 200
}

func (o *CalculateDashboardDiffOK) Error() string {
	return fmt.Sprintf("[POST /dashboards/calculate-diff][%d] calculateDashboardDiffOk  %+v", 200, o.Payload)
}

func (o *CalculateDashboardDiffOK) String() string {
	return fmt.Sprintf("[POST /dashboards/calculate-diff][%d] calculateDashboardDiffOk  %+v", 200, o.Payload)
}

func (o *CalculateDashboardDiffOK) GetPayload() []uint8 {
	return o.Payload
}

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

// NewCalculateDashboardDiffUnauthorized creates a CalculateDashboardDiffUnauthorized with default headers values
func NewCalculateDashboardDiffUnauthorized() *CalculateDashboardDiffUnauthorized {
	return &CalculateDashboardDiffUnauthorized{}
}

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

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

// IsSuccess returns true when this calculate dashboard diff unauthorized response has a 2xx status code
func (o *CalculateDashboardDiffUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this calculate dashboard diff unauthorized response has a 3xx status code
func (o *CalculateDashboardDiffUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this calculate dashboard diff unauthorized response has a 4xx status code
func (o *CalculateDashboardDiffUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this calculate dashboard diff unauthorized response has a 5xx status code
func (o *CalculateDashboardDiffUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this calculate dashboard diff unauthorized response a status code equal to that given
func (o *CalculateDashboardDiffUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the calculate dashboard diff unauthorized response
func (o *CalculateDashboardDiffUnauthorized) Code() int {
	return 401
}

func (o *CalculateDashboardDiffUnauthorized) Error() string {
	return fmt.Sprintf("[POST /dashboards/calculate-diff][%d] calculateDashboardDiffUnauthorized  %+v", 401, o.Payload)
}

func (o *CalculateDashboardDiffUnauthorized) String() string {
	return fmt.Sprintf("[POST /dashboards/calculate-diff][%d] calculateDashboardDiffUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewCalculateDashboardDiffForbidden creates a CalculateDashboardDiffForbidden with default headers values
func NewCalculateDashboardDiffForbidden() *CalculateDashboardDiffForbidden {
	return &CalculateDashboardDiffForbidden{}
}

/*
CalculateDashboardDiffForbidden 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 CalculateDashboardDiffForbidden struct {
	Payload *models.ErrorResponseBody
}

// IsSuccess returns true when this calculate dashboard diff forbidden response has a 2xx status code
func (o *CalculateDashboardDiffForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this calculate dashboard diff forbidden response has a 3xx status code
func (o *CalculateDashboardDiffForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this calculate dashboard diff forbidden response has a 4xx status code
func (o *CalculateDashboardDiffForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this calculate dashboard diff forbidden response has a 5xx status code
func (o *CalculateDashboardDiffForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this calculate dashboard diff forbidden response a status code equal to that given
func (o *CalculateDashboardDiffForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the calculate dashboard diff forbidden response
func (o *CalculateDashboardDiffForbidden) Code() int {
	return 403
}

func (o *CalculateDashboardDiffForbidden) Error() string {
	return fmt.Sprintf("[POST /dashboards/calculate-diff][%d] calculateDashboardDiffForbidden  %+v", 403, o.Payload)
}

func (o *CalculateDashboardDiffForbidden) String() string {
	return fmt.Sprintf("[POST /dashboards/calculate-diff][%d] calculateDashboardDiffForbidden  %+v", 403, o.Payload)
}

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

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

// NewCalculateDashboardDiffInternalServerError creates a CalculateDashboardDiffInternalServerError with default headers values
func NewCalculateDashboardDiffInternalServerError() *CalculateDashboardDiffInternalServerError {
	return &CalculateDashboardDiffInternalServerError{}
}

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

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

// IsSuccess returns true when this calculate dashboard diff internal server error response has a 2xx status code
func (o *CalculateDashboardDiffInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this calculate dashboard diff internal server error response has a 3xx status code
func (o *CalculateDashboardDiffInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this calculate dashboard diff internal server error response has a 4xx status code
func (o *CalculateDashboardDiffInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this calculate dashboard diff internal server error response has a 5xx status code
func (o *CalculateDashboardDiffInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this calculate dashboard diff internal server error response a status code equal to that given
func (o *CalculateDashboardDiffInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the calculate dashboard diff internal server error response
func (o *CalculateDashboardDiffInternalServerError) Code() int {
	return 500
}

func (o *CalculateDashboardDiffInternalServerError) Error() string {
	return fmt.Sprintf("[POST /dashboards/calculate-diff][%d] calculateDashboardDiffInternalServerError  %+v", 500, o.Payload)
}

func (o *CalculateDashboardDiffInternalServerError) String() string {
	return fmt.Sprintf("[POST /dashboards/calculate-diff][%d] calculateDashboardDiffInternalServerError  %+v", 500, o.Payload)
}

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

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