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

package admin_provisioning

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

// AdminProvisioningReloadDashboardsReader is a Reader for the AdminProvisioningReloadDashboards structure.
type AdminProvisioningReloadDashboardsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *AdminProvisioningReloadDashboardsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewAdminProvisioningReloadDashboardsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewAdminProvisioningReloadDashboardsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewAdminProvisioningReloadDashboardsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewAdminProvisioningReloadDashboardsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /admin/provisioning/dashboards/reload] adminProvisioningReloadDashboards", response, response.Code())
	}
}

// NewAdminProvisioningReloadDashboardsOK creates a AdminProvisioningReloadDashboardsOK with default headers values
func NewAdminProvisioningReloadDashboardsOK() *AdminProvisioningReloadDashboardsOK {
	return &AdminProvisioningReloadDashboardsOK{}
}

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

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

// IsSuccess returns true when this admin provisioning reload dashboards Ok response has a 2xx status code
func (o *AdminProvisioningReloadDashboardsOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this admin provisioning reload dashboards Ok response has a 3xx status code
func (o *AdminProvisioningReloadDashboardsOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this admin provisioning reload dashboards Ok response has a 4xx status code
func (o *AdminProvisioningReloadDashboardsOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this admin provisioning reload dashboards Ok response has a 5xx status code
func (o *AdminProvisioningReloadDashboardsOK) IsServerError() bool {
	return false
}

// IsCode returns true when this admin provisioning reload dashboards Ok response a status code equal to that given
func (o *AdminProvisioningReloadDashboardsOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the admin provisioning reload dashboards Ok response
func (o *AdminProvisioningReloadDashboardsOK) Code() int {
	return 200
}

func (o *AdminProvisioningReloadDashboardsOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /admin/provisioning/dashboards/reload][%d] adminProvisioningReloadDashboardsOk %s", 200, payload)
}

func (o *AdminProvisioningReloadDashboardsOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /admin/provisioning/dashboards/reload][%d] adminProvisioningReloadDashboardsOk %s", 200, payload)
}

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

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

// NewAdminProvisioningReloadDashboardsUnauthorized creates a AdminProvisioningReloadDashboardsUnauthorized with default headers values
func NewAdminProvisioningReloadDashboardsUnauthorized() *AdminProvisioningReloadDashboardsUnauthorized {
	return &AdminProvisioningReloadDashboardsUnauthorized{}
}

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

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

// IsSuccess returns true when this admin provisioning reload dashboards unauthorized response has a 2xx status code
func (o *AdminProvisioningReloadDashboardsUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this admin provisioning reload dashboards unauthorized response has a 3xx status code
func (o *AdminProvisioningReloadDashboardsUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this admin provisioning reload dashboards unauthorized response has a 4xx status code
func (o *AdminProvisioningReloadDashboardsUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this admin provisioning reload dashboards unauthorized response has a 5xx status code
func (o *AdminProvisioningReloadDashboardsUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this admin provisioning reload dashboards unauthorized response a status code equal to that given
func (o *AdminProvisioningReloadDashboardsUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the admin provisioning reload dashboards unauthorized response
func (o *AdminProvisioningReloadDashboardsUnauthorized) Code() int {
	return 401
}

func (o *AdminProvisioningReloadDashboardsUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /admin/provisioning/dashboards/reload][%d] adminProvisioningReloadDashboardsUnauthorized %s", 401, payload)
}

func (o *AdminProvisioningReloadDashboardsUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /admin/provisioning/dashboards/reload][%d] adminProvisioningReloadDashboardsUnauthorized %s", 401, payload)
}

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

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

// NewAdminProvisioningReloadDashboardsForbidden creates a AdminProvisioningReloadDashboardsForbidden with default headers values
func NewAdminProvisioningReloadDashboardsForbidden() *AdminProvisioningReloadDashboardsForbidden {
	return &AdminProvisioningReloadDashboardsForbidden{}
}

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

// IsSuccess returns true when this admin provisioning reload dashboards forbidden response has a 2xx status code
func (o *AdminProvisioningReloadDashboardsForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this admin provisioning reload dashboards forbidden response has a 3xx status code
func (o *AdminProvisioningReloadDashboardsForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this admin provisioning reload dashboards forbidden response has a 4xx status code
func (o *AdminProvisioningReloadDashboardsForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this admin provisioning reload dashboards forbidden response has a 5xx status code
func (o *AdminProvisioningReloadDashboardsForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this admin provisioning reload dashboards forbidden response a status code equal to that given
func (o *AdminProvisioningReloadDashboardsForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the admin provisioning reload dashboards forbidden response
func (o *AdminProvisioningReloadDashboardsForbidden) Code() int {
	return 403
}

func (o *AdminProvisioningReloadDashboardsForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /admin/provisioning/dashboards/reload][%d] adminProvisioningReloadDashboardsForbidden %s", 403, payload)
}

func (o *AdminProvisioningReloadDashboardsForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /admin/provisioning/dashboards/reload][%d] adminProvisioningReloadDashboardsForbidden %s", 403, payload)
}

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

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

// NewAdminProvisioningReloadDashboardsInternalServerError creates a AdminProvisioningReloadDashboardsInternalServerError with default headers values
func NewAdminProvisioningReloadDashboardsInternalServerError() *AdminProvisioningReloadDashboardsInternalServerError {
	return &AdminProvisioningReloadDashboardsInternalServerError{}
}

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

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

// IsSuccess returns true when this admin provisioning reload dashboards internal server error response has a 2xx status code
func (o *AdminProvisioningReloadDashboardsInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this admin provisioning reload dashboards internal server error response has a 3xx status code
func (o *AdminProvisioningReloadDashboardsInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this admin provisioning reload dashboards internal server error response has a 4xx status code
func (o *AdminProvisioningReloadDashboardsInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this admin provisioning reload dashboards internal server error response has a 5xx status code
func (o *AdminProvisioningReloadDashboardsInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this admin provisioning reload dashboards internal server error response a status code equal to that given
func (o *AdminProvisioningReloadDashboardsInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the admin provisioning reload dashboards internal server error response
func (o *AdminProvisioningReloadDashboardsInternalServerError) Code() int {
	return 500
}

func (o *AdminProvisioningReloadDashboardsInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /admin/provisioning/dashboards/reload][%d] adminProvisioningReloadDashboardsInternalServerError %s", 500, payload)
}

func (o *AdminProvisioningReloadDashboardsInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /admin/provisioning/dashboards/reload][%d] adminProvisioningReloadDashboardsInternalServerError %s", 500, payload)
}

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

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