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

package signed_in_user

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

// UnstarDashboardByUIDReader is a Reader for the UnstarDashboardByUID structure.
type UnstarDashboardByUIDReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *UnstarDashboardByUIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewUnstarDashboardByUIDOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewUnstarDashboardByUIDBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewUnstarDashboardByUIDUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewUnstarDashboardByUIDForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewUnstarDashboardByUIDInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[DELETE /user/stars/dashboard/uid/{dashboard_uid}] unstarDashboardByUID", response, response.Code())
	}
}

// NewUnstarDashboardByUIDOK creates a UnstarDashboardByUIDOK with default headers values
func NewUnstarDashboardByUIDOK() *UnstarDashboardByUIDOK {
	return &UnstarDashboardByUIDOK{}
}

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

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

// IsSuccess returns true when this unstar dashboard by Uid Ok response has a 2xx status code
func (o *UnstarDashboardByUIDOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this unstar dashboard by Uid Ok response has a 3xx status code
func (o *UnstarDashboardByUIDOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this unstar dashboard by Uid Ok response has a 4xx status code
func (o *UnstarDashboardByUIDOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this unstar dashboard by Uid Ok response has a 5xx status code
func (o *UnstarDashboardByUIDOK) IsServerError() bool {
	return false
}

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

// Code gets the status code for the unstar dashboard by Uid Ok response
func (o *UnstarDashboardByUIDOK) Code() int {
	return 200
}

func (o *UnstarDashboardByUIDOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /user/stars/dashboard/uid/{dashboard_uid}][%d] unstarDashboardByUidOk %s", 200, payload)
}

func (o *UnstarDashboardByUIDOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /user/stars/dashboard/uid/{dashboard_uid}][%d] unstarDashboardByUidOk %s", 200, payload)
}

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

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

// NewUnstarDashboardByUIDBadRequest creates a UnstarDashboardByUIDBadRequest with default headers values
func NewUnstarDashboardByUIDBadRequest() *UnstarDashboardByUIDBadRequest {
	return &UnstarDashboardByUIDBadRequest{}
}

/*
UnstarDashboardByUIDBadRequest describes a response with status code 400, with default header values.

BadRequestError is returned when the request is invalid and it cannot be processed.
*/
type UnstarDashboardByUIDBadRequest struct {
	Payload *models.ErrorResponseBody
}

// IsSuccess returns true when this unstar dashboard by Uid bad request response has a 2xx status code
func (o *UnstarDashboardByUIDBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this unstar dashboard by Uid bad request response has a 3xx status code
func (o *UnstarDashboardByUIDBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this unstar dashboard by Uid bad request response has a 4xx status code
func (o *UnstarDashboardByUIDBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this unstar dashboard by Uid bad request response has a 5xx status code
func (o *UnstarDashboardByUIDBadRequest) IsServerError() bool {
	return false
}

// IsCode returns true when this unstar dashboard by Uid bad request response a status code equal to that given
func (o *UnstarDashboardByUIDBadRequest) IsCode(code int) bool {
	return code == 400
}

// Code gets the status code for the unstar dashboard by Uid bad request response
func (o *UnstarDashboardByUIDBadRequest) Code() int {
	return 400
}

func (o *UnstarDashboardByUIDBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /user/stars/dashboard/uid/{dashboard_uid}][%d] unstarDashboardByUidBadRequest %s", 400, payload)
}

func (o *UnstarDashboardByUIDBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /user/stars/dashboard/uid/{dashboard_uid}][%d] unstarDashboardByUidBadRequest %s", 400, payload)
}

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

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

// NewUnstarDashboardByUIDUnauthorized creates a UnstarDashboardByUIDUnauthorized with default headers values
func NewUnstarDashboardByUIDUnauthorized() *UnstarDashboardByUIDUnauthorized {
	return &UnstarDashboardByUIDUnauthorized{}
}

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

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

// IsSuccess returns true when this unstar dashboard by Uid unauthorized response has a 2xx status code
func (o *UnstarDashboardByUIDUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this unstar dashboard by Uid unauthorized response has a 3xx status code
func (o *UnstarDashboardByUIDUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this unstar dashboard by Uid unauthorized response has a 4xx status code
func (o *UnstarDashboardByUIDUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this unstar dashboard by Uid unauthorized response has a 5xx status code
func (o *UnstarDashboardByUIDUnauthorized) IsServerError() bool {
	return false
}

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

// Code gets the status code for the unstar dashboard by Uid unauthorized response
func (o *UnstarDashboardByUIDUnauthorized) Code() int {
	return 401
}

func (o *UnstarDashboardByUIDUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /user/stars/dashboard/uid/{dashboard_uid}][%d] unstarDashboardByUidUnauthorized %s", 401, payload)
}

func (o *UnstarDashboardByUIDUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /user/stars/dashboard/uid/{dashboard_uid}][%d] unstarDashboardByUidUnauthorized %s", 401, payload)
}

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

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

// NewUnstarDashboardByUIDForbidden creates a UnstarDashboardByUIDForbidden with default headers values
func NewUnstarDashboardByUIDForbidden() *UnstarDashboardByUIDForbidden {
	return &UnstarDashboardByUIDForbidden{}
}

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

// IsSuccess returns true when this unstar dashboard by Uid forbidden response has a 2xx status code
func (o *UnstarDashboardByUIDForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this unstar dashboard by Uid forbidden response has a 3xx status code
func (o *UnstarDashboardByUIDForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this unstar dashboard by Uid forbidden response has a 4xx status code
func (o *UnstarDashboardByUIDForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this unstar dashboard by Uid forbidden response has a 5xx status code
func (o *UnstarDashboardByUIDForbidden) IsServerError() bool {
	return false
}

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

// Code gets the status code for the unstar dashboard by Uid forbidden response
func (o *UnstarDashboardByUIDForbidden) Code() int {
	return 403
}

func (o *UnstarDashboardByUIDForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /user/stars/dashboard/uid/{dashboard_uid}][%d] unstarDashboardByUidForbidden %s", 403, payload)
}

func (o *UnstarDashboardByUIDForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /user/stars/dashboard/uid/{dashboard_uid}][%d] unstarDashboardByUidForbidden %s", 403, payload)
}

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

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

// NewUnstarDashboardByUIDInternalServerError creates a UnstarDashboardByUIDInternalServerError with default headers values
func NewUnstarDashboardByUIDInternalServerError() *UnstarDashboardByUIDInternalServerError {
	return &UnstarDashboardByUIDInternalServerError{}
}

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

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

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

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

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

// IsServerError returns true when this unstar dashboard by Uid internal server error response has a 5xx status code
func (o *UnstarDashboardByUIDInternalServerError) IsServerError() bool {
	return true
}

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

// Code gets the status code for the unstar dashboard by Uid internal server error response
func (o *UnstarDashboardByUIDInternalServerError) Code() int {
	return 500
}

func (o *UnstarDashboardByUIDInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /user/stars/dashboard/uid/{dashboard_uid}][%d] unstarDashboardByUidInternalServerError %s", 500, payload)
}

func (o *UnstarDashboardByUIDInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /user/stars/dashboard/uid/{dashboard_uid}][%d] unstarDashboardByUidInternalServerError %s", 500, payload)
}

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

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