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

package admin_users

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

// AdminEnableUserReader is a Reader for the AdminEnableUser structure.
type AdminEnableUserReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *AdminEnableUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewAdminEnableUserOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewAdminEnableUserUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewAdminEnableUserForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewAdminEnableUserNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewAdminEnableUserInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /admin/users/{user_id}/enable] adminEnableUser", response, response.Code())
	}
}

// NewAdminEnableUserOK creates a AdminEnableUserOK with default headers values
func NewAdminEnableUserOK() *AdminEnableUserOK {
	return &AdminEnableUserOK{}
}

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

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

// IsSuccess returns true when this admin enable user Ok response has a 2xx status code
func (o *AdminEnableUserOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this admin enable user Ok response has a 3xx status code
func (o *AdminEnableUserOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this admin enable user Ok response has a 4xx status code
func (o *AdminEnableUserOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this admin enable user Ok response has a 5xx status code
func (o *AdminEnableUserOK) IsServerError() bool {
	return false
}

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

// Code gets the status code for the admin enable user Ok response
func (o *AdminEnableUserOK) Code() int {
	return 200
}

func (o *AdminEnableUserOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /admin/users/{user_id}/enable][%d] adminEnableUserOk %s", 200, payload)
}

func (o *AdminEnableUserOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /admin/users/{user_id}/enable][%d] adminEnableUserOk %s", 200, payload)
}

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

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

// NewAdminEnableUserUnauthorized creates a AdminEnableUserUnauthorized with default headers values
func NewAdminEnableUserUnauthorized() *AdminEnableUserUnauthorized {
	return &AdminEnableUserUnauthorized{}
}

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

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

// IsSuccess returns true when this admin enable user unauthorized response has a 2xx status code
func (o *AdminEnableUserUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this admin enable user unauthorized response has a 3xx status code
func (o *AdminEnableUserUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this admin enable user unauthorized response has a 4xx status code
func (o *AdminEnableUserUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this admin enable user unauthorized response has a 5xx status code
func (o *AdminEnableUserUnauthorized) IsServerError() bool {
	return false
}

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

// Code gets the status code for the admin enable user unauthorized response
func (o *AdminEnableUserUnauthorized) Code() int {
	return 401
}

func (o *AdminEnableUserUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /admin/users/{user_id}/enable][%d] adminEnableUserUnauthorized %s", 401, payload)
}

func (o *AdminEnableUserUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /admin/users/{user_id}/enable][%d] adminEnableUserUnauthorized %s", 401, payload)
}

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

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

// NewAdminEnableUserForbidden creates a AdminEnableUserForbidden with default headers values
func NewAdminEnableUserForbidden() *AdminEnableUserForbidden {
	return &AdminEnableUserForbidden{}
}

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

// IsSuccess returns true when this admin enable user forbidden response has a 2xx status code
func (o *AdminEnableUserForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this admin enable user forbidden response has a 3xx status code
func (o *AdminEnableUserForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this admin enable user forbidden response has a 4xx status code
func (o *AdminEnableUserForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this admin enable user forbidden response has a 5xx status code
func (o *AdminEnableUserForbidden) IsServerError() bool {
	return false
}

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

// Code gets the status code for the admin enable user forbidden response
func (o *AdminEnableUserForbidden) Code() int {
	return 403
}

func (o *AdminEnableUserForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /admin/users/{user_id}/enable][%d] adminEnableUserForbidden %s", 403, payload)
}

func (o *AdminEnableUserForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /admin/users/{user_id}/enable][%d] adminEnableUserForbidden %s", 403, payload)
}

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

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

// NewAdminEnableUserNotFound creates a AdminEnableUserNotFound with default headers values
func NewAdminEnableUserNotFound() *AdminEnableUserNotFound {
	return &AdminEnableUserNotFound{}
}

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

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

// IsSuccess returns true when this admin enable user not found response has a 2xx status code
func (o *AdminEnableUserNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this admin enable user not found response has a 3xx status code
func (o *AdminEnableUserNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this admin enable user not found response has a 4xx status code
func (o *AdminEnableUserNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this admin enable user not found response has a 5xx status code
func (o *AdminEnableUserNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this admin enable user not found response a status code equal to that given
func (o *AdminEnableUserNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the admin enable user not found response
func (o *AdminEnableUserNotFound) Code() int {
	return 404
}

func (o *AdminEnableUserNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /admin/users/{user_id}/enable][%d] adminEnableUserNotFound %s", 404, payload)
}

func (o *AdminEnableUserNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /admin/users/{user_id}/enable][%d] adminEnableUserNotFound %s", 404, payload)
}

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

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

// NewAdminEnableUserInternalServerError creates a AdminEnableUserInternalServerError with default headers values
func NewAdminEnableUserInternalServerError() *AdminEnableUserInternalServerError {
	return &AdminEnableUserInternalServerError{}
}

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

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

// IsSuccess returns true when this admin enable user internal server error response has a 2xx status code
func (o *AdminEnableUserInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this admin enable user internal server error response has a 3xx status code
func (o *AdminEnableUserInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this admin enable user internal server error response has a 4xx status code
func (o *AdminEnableUserInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this admin enable user internal server error response has a 5xx status code
func (o *AdminEnableUserInternalServerError) IsServerError() bool {
	return true
}

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

// Code gets the status code for the admin enable user internal server error response
func (o *AdminEnableUserInternalServerError) Code() int {
	return 500
}

func (o *AdminEnableUserInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /admin/users/{user_id}/enable][%d] adminEnableUserInternalServerError %s", 500, payload)
}

func (o *AdminEnableUserInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /admin/users/{user_id}/enable][%d] adminEnableUserInternalServerError %s", 500, payload)
}

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

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