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

// GetDashboardPermissionsListByUIDReader is a Reader for the GetDashboardPermissionsListByUID structure.
type GetDashboardPermissionsListByUIDReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetDashboardPermissionsListByUIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetDashboardPermissionsListByUIDOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetDashboardPermissionsListByUIDUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetDashboardPermissionsListByUIDForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetDashboardPermissionsListByUIDNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetDashboardPermissionsListByUIDInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /dashboards/uid/{uid}/permissions] getDashboardPermissionsListByUID", response, response.Code())
	}
}

// NewGetDashboardPermissionsListByUIDOK creates a GetDashboardPermissionsListByUIDOK with default headers values
func NewGetDashboardPermissionsListByUIDOK() *GetDashboardPermissionsListByUIDOK {
	return &GetDashboardPermissionsListByUIDOK{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGetDashboardPermissionsListByUIDUnauthorized creates a GetDashboardPermissionsListByUIDUnauthorized with default headers values
func NewGetDashboardPermissionsListByUIDUnauthorized() *GetDashboardPermissionsListByUIDUnauthorized {
	return &GetDashboardPermissionsListByUIDUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGetDashboardPermissionsListByUIDForbidden creates a GetDashboardPermissionsListByUIDForbidden with default headers values
func NewGetDashboardPermissionsListByUIDForbidden() *GetDashboardPermissionsListByUIDForbidden {
	return &GetDashboardPermissionsListByUIDForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewGetDashboardPermissionsListByUIDNotFound creates a GetDashboardPermissionsListByUIDNotFound with default headers values
func NewGetDashboardPermissionsListByUIDNotFound() *GetDashboardPermissionsListByUIDNotFound {
	return &GetDashboardPermissionsListByUIDNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGetDashboardPermissionsListByUIDInternalServerError creates a GetDashboardPermissionsListByUIDInternalServerError with default headers values
func NewGetDashboardPermissionsListByUIDInternalServerError() *GetDashboardPermissionsListByUIDInternalServerError {
	return &GetDashboardPermissionsListByUIDInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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