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

// AdminProvisioningReloadPluginsReader is a Reader for the AdminProvisioningReloadPlugins structure.
type AdminProvisioningReloadPluginsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *AdminProvisioningReloadPluginsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewAdminProvisioningReloadPluginsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewAdminProvisioningReloadPluginsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewAdminProvisioningReloadPluginsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewAdminProvisioningReloadPluginsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /admin/provisioning/plugins/reload] adminProvisioningReloadPlugins", response, response.Code())
	}
}

// NewAdminProvisioningReloadPluginsOK creates a AdminProvisioningReloadPluginsOK with default headers values
func NewAdminProvisioningReloadPluginsOK() *AdminProvisioningReloadPluginsOK {
	return &AdminProvisioningReloadPluginsOK{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewAdminProvisioningReloadPluginsUnauthorized creates a AdminProvisioningReloadPluginsUnauthorized with default headers values
func NewAdminProvisioningReloadPluginsUnauthorized() *AdminProvisioningReloadPluginsUnauthorized {
	return &AdminProvisioningReloadPluginsUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewAdminProvisioningReloadPluginsForbidden creates a AdminProvisioningReloadPluginsForbidden with default headers values
func NewAdminProvisioningReloadPluginsForbidden() *AdminProvisioningReloadPluginsForbidden {
	return &AdminProvisioningReloadPluginsForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewAdminProvisioningReloadPluginsInternalServerError creates a AdminProvisioningReloadPluginsInternalServerError with default headers values
func NewAdminProvisioningReloadPluginsInternalServerError() *AdminProvisioningReloadPluginsInternalServerError {
	return &AdminProvisioningReloadPluginsInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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