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

package dashboard_permissions

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

// GetDashboardPermissionsListByIDReader is a Reader for the GetDashboardPermissionsListByID structure.
type GetDashboardPermissionsListByIDReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetDashboardPermissionsListByIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetDashboardPermissionsListByIDOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetDashboardPermissionsListByIDUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetDashboardPermissionsListByIDForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetDashboardPermissionsListByIDNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetDashboardPermissionsListByIDInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /dashboards/id/{DashboardID}/permissions] getDashboardPermissionsListByID", response, response.Code())
	}
}

// NewGetDashboardPermissionsListByIDOK creates a GetDashboardPermissionsListByIDOK with default headers values
func NewGetDashboardPermissionsListByIDOK() *GetDashboardPermissionsListByIDOK {
	return &GetDashboardPermissionsListByIDOK{}
}

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

(empty)
*/
type GetDashboardPermissionsListByIDOK struct {
	Payload []*models.DashboardACLInfoDTO
}

// IsSuccess returns true when this get dashboard permissions list by Id Ok response has a 2xx status code
func (o *GetDashboardPermissionsListByIDOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this get dashboard permissions list by Id Ok response has a 3xx status code
func (o *GetDashboardPermissionsListByIDOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get dashboard permissions list by Id Ok response has a 4xx status code
func (o *GetDashboardPermissionsListByIDOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this get dashboard permissions list by Id Ok response has a 5xx status code
func (o *GetDashboardPermissionsListByIDOK) IsServerError() bool {
	return false
}

// IsCode returns true when this get dashboard permissions list by Id Ok response a status code equal to that given
func (o *GetDashboardPermissionsListByIDOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the get dashboard permissions list by Id Ok response
func (o *GetDashboardPermissionsListByIDOK) Code() int {
	return 200
}

func (o *GetDashboardPermissionsListByIDOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /dashboards/id/{DashboardID}/permissions][%d] getDashboardPermissionsListByIdOk %s", 200, payload)
}

func (o *GetDashboardPermissionsListByIDOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /dashboards/id/{DashboardID}/permissions][%d] getDashboardPermissionsListByIdOk %s", 200, payload)
}

func (o *GetDashboardPermissionsListByIDOK) GetPayload() []*models.DashboardACLInfoDTO {
	return o.Payload
}

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

// NewGetDashboardPermissionsListByIDUnauthorized creates a GetDashboardPermissionsListByIDUnauthorized with default headers values
func NewGetDashboardPermissionsListByIDUnauthorized() *GetDashboardPermissionsListByIDUnauthorized {
	return &GetDashboardPermissionsListByIDUnauthorized{}
}

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

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

// IsSuccess returns true when this get dashboard permissions list by Id unauthorized response has a 2xx status code
func (o *GetDashboardPermissionsListByIDUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get dashboard permissions list by Id unauthorized response has a 3xx status code
func (o *GetDashboardPermissionsListByIDUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get dashboard permissions list by Id unauthorized response has a 4xx status code
func (o *GetDashboardPermissionsListByIDUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this get dashboard permissions list by Id unauthorized response has a 5xx status code
func (o *GetDashboardPermissionsListByIDUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this get dashboard permissions list by Id unauthorized response a status code equal to that given
func (o *GetDashboardPermissionsListByIDUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the get dashboard permissions list by Id unauthorized response
func (o *GetDashboardPermissionsListByIDUnauthorized) Code() int {
	return 401
}

func (o *GetDashboardPermissionsListByIDUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /dashboards/id/{DashboardID}/permissions][%d] getDashboardPermissionsListByIdUnauthorized %s", 401, payload)
}

func (o *GetDashboardPermissionsListByIDUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /dashboards/id/{DashboardID}/permissions][%d] getDashboardPermissionsListByIdUnauthorized %s", 401, payload)
}

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

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

// NewGetDashboardPermissionsListByIDForbidden creates a GetDashboardPermissionsListByIDForbidden with default headers values
func NewGetDashboardPermissionsListByIDForbidden() *GetDashboardPermissionsListByIDForbidden {
	return &GetDashboardPermissionsListByIDForbidden{}
}

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

// IsSuccess returns true when this get dashboard permissions list by Id forbidden response has a 2xx status code
func (o *GetDashboardPermissionsListByIDForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get dashboard permissions list by Id forbidden response has a 3xx status code
func (o *GetDashboardPermissionsListByIDForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get dashboard permissions list by Id forbidden response has a 4xx status code
func (o *GetDashboardPermissionsListByIDForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this get dashboard permissions list by Id forbidden response has a 5xx status code
func (o *GetDashboardPermissionsListByIDForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this get dashboard permissions list by Id forbidden response a status code equal to that given
func (o *GetDashboardPermissionsListByIDForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the get dashboard permissions list by Id forbidden response
func (o *GetDashboardPermissionsListByIDForbidden) Code() int {
	return 403
}

func (o *GetDashboardPermissionsListByIDForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /dashboards/id/{DashboardID}/permissions][%d] getDashboardPermissionsListByIdForbidden %s", 403, payload)
}

func (o *GetDashboardPermissionsListByIDForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /dashboards/id/{DashboardID}/permissions][%d] getDashboardPermissionsListByIdForbidden %s", 403, payload)
}

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

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

// NewGetDashboardPermissionsListByIDNotFound creates a GetDashboardPermissionsListByIDNotFound with default headers values
func NewGetDashboardPermissionsListByIDNotFound() *GetDashboardPermissionsListByIDNotFound {
	return &GetDashboardPermissionsListByIDNotFound{}
}

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

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

// IsSuccess returns true when this get dashboard permissions list by Id not found response has a 2xx status code
func (o *GetDashboardPermissionsListByIDNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get dashboard permissions list by Id not found response has a 3xx status code
func (o *GetDashboardPermissionsListByIDNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get dashboard permissions list by Id not found response has a 4xx status code
func (o *GetDashboardPermissionsListByIDNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this get dashboard permissions list by Id not found response has a 5xx status code
func (o *GetDashboardPermissionsListByIDNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this get dashboard permissions list by Id not found response a status code equal to that given
func (o *GetDashboardPermissionsListByIDNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the get dashboard permissions list by Id not found response
func (o *GetDashboardPermissionsListByIDNotFound) Code() int {
	return 404
}

func (o *GetDashboardPermissionsListByIDNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /dashboards/id/{DashboardID}/permissions][%d] getDashboardPermissionsListByIdNotFound %s", 404, payload)
}

func (o *GetDashboardPermissionsListByIDNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /dashboards/id/{DashboardID}/permissions][%d] getDashboardPermissionsListByIdNotFound %s", 404, payload)
}

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

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

// NewGetDashboardPermissionsListByIDInternalServerError creates a GetDashboardPermissionsListByIDInternalServerError with default headers values
func NewGetDashboardPermissionsListByIDInternalServerError() *GetDashboardPermissionsListByIDInternalServerError {
	return &GetDashboardPermissionsListByIDInternalServerError{}
}

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

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

// IsSuccess returns true when this get dashboard permissions list by Id internal server error response has a 2xx status code
func (o *GetDashboardPermissionsListByIDInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get dashboard permissions list by Id internal server error response has a 3xx status code
func (o *GetDashboardPermissionsListByIDInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get dashboard permissions list by Id internal server error response has a 4xx status code
func (o *GetDashboardPermissionsListByIDInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this get dashboard permissions list by Id internal server error response has a 5xx status code
func (o *GetDashboardPermissionsListByIDInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this get dashboard permissions list by Id internal server error response a status code equal to that given
func (o *GetDashboardPermissionsListByIDInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the get dashboard permissions list by Id internal server error response
func (o *GetDashboardPermissionsListByIDInternalServerError) Code() int {
	return 500
}

func (o *GetDashboardPermissionsListByIDInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /dashboards/id/{DashboardID}/permissions][%d] getDashboardPermissionsListByIdInternalServerError %s", 500, payload)
}

func (o *GetDashboardPermissionsListByIDInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /dashboards/id/{DashboardID}/permissions][%d] getDashboardPermissionsListByIdInternalServerError %s", 500, payload)
}

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

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