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

package signed_in_user

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

// RevokeUserAuthTokenReader is a Reader for the RevokeUserAuthToken structure.
type RevokeUserAuthTokenReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *RevokeUserAuthTokenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewRevokeUserAuthTokenOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewRevokeUserAuthTokenBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewRevokeUserAuthTokenUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewRevokeUserAuthTokenForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewRevokeUserAuthTokenInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /user/revoke-auth-token] revokeUserAuthToken", response, response.Code())
	}
}

// NewRevokeUserAuthTokenOK creates a RevokeUserAuthTokenOK with default headers values
func NewRevokeUserAuthTokenOK() *RevokeUserAuthTokenOK {
	return &RevokeUserAuthTokenOK{}
}

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

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

// IsSuccess returns true when this revoke user auth token Ok response has a 2xx status code
func (o *RevokeUserAuthTokenOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this revoke user auth token Ok response has a 3xx status code
func (o *RevokeUserAuthTokenOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this revoke user auth token Ok response has a 4xx status code
func (o *RevokeUserAuthTokenOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this revoke user auth token Ok response has a 5xx status code
func (o *RevokeUserAuthTokenOK) IsServerError() bool {
	return false
}

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

// Code gets the status code for the revoke user auth token Ok response
func (o *RevokeUserAuthTokenOK) Code() int {
	return 200
}

func (o *RevokeUserAuthTokenOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /user/revoke-auth-token][%d] revokeUserAuthTokenOk %s", 200, payload)
}

func (o *RevokeUserAuthTokenOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /user/revoke-auth-token][%d] revokeUserAuthTokenOk %s", 200, payload)
}

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

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

// NewRevokeUserAuthTokenBadRequest creates a RevokeUserAuthTokenBadRequest with default headers values
func NewRevokeUserAuthTokenBadRequest() *RevokeUserAuthTokenBadRequest {
	return &RevokeUserAuthTokenBadRequest{}
}

/*
RevokeUserAuthTokenBadRequest describes a response with status code 400, with default header values.

BadRequestError is returned when the request is invalid and it cannot be processed.
*/
type RevokeUserAuthTokenBadRequest struct {
	Payload *models.ErrorResponseBody
}

// IsSuccess returns true when this revoke user auth token bad request response has a 2xx status code
func (o *RevokeUserAuthTokenBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this revoke user auth token bad request response has a 3xx status code
func (o *RevokeUserAuthTokenBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this revoke user auth token bad request response has a 4xx status code
func (o *RevokeUserAuthTokenBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this revoke user auth token bad request response has a 5xx status code
func (o *RevokeUserAuthTokenBadRequest) IsServerError() bool {
	return false
}

// IsCode returns true when this revoke user auth token bad request response a status code equal to that given
func (o *RevokeUserAuthTokenBadRequest) IsCode(code int) bool {
	return code == 400
}

// Code gets the status code for the revoke user auth token bad request response
func (o *RevokeUserAuthTokenBadRequest) Code() int {
	return 400
}

func (o *RevokeUserAuthTokenBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /user/revoke-auth-token][%d] revokeUserAuthTokenBadRequest %s", 400, payload)
}

func (o *RevokeUserAuthTokenBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /user/revoke-auth-token][%d] revokeUserAuthTokenBadRequest %s", 400, payload)
}

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

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

// NewRevokeUserAuthTokenUnauthorized creates a RevokeUserAuthTokenUnauthorized with default headers values
func NewRevokeUserAuthTokenUnauthorized() *RevokeUserAuthTokenUnauthorized {
	return &RevokeUserAuthTokenUnauthorized{}
}

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

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

// IsSuccess returns true when this revoke user auth token unauthorized response has a 2xx status code
func (o *RevokeUserAuthTokenUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this revoke user auth token unauthorized response has a 3xx status code
func (o *RevokeUserAuthTokenUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this revoke user auth token unauthorized response has a 4xx status code
func (o *RevokeUserAuthTokenUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this revoke user auth token unauthorized response has a 5xx status code
func (o *RevokeUserAuthTokenUnauthorized) IsServerError() bool {
	return false
}

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

// Code gets the status code for the revoke user auth token unauthorized response
func (o *RevokeUserAuthTokenUnauthorized) Code() int {
	return 401
}

func (o *RevokeUserAuthTokenUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /user/revoke-auth-token][%d] revokeUserAuthTokenUnauthorized %s", 401, payload)
}

func (o *RevokeUserAuthTokenUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /user/revoke-auth-token][%d] revokeUserAuthTokenUnauthorized %s", 401, payload)
}

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

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

// NewRevokeUserAuthTokenForbidden creates a RevokeUserAuthTokenForbidden with default headers values
func NewRevokeUserAuthTokenForbidden() *RevokeUserAuthTokenForbidden {
	return &RevokeUserAuthTokenForbidden{}
}

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

// IsSuccess returns true when this revoke user auth token forbidden response has a 2xx status code
func (o *RevokeUserAuthTokenForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this revoke user auth token forbidden response has a 3xx status code
func (o *RevokeUserAuthTokenForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this revoke user auth token forbidden response has a 4xx status code
func (o *RevokeUserAuthTokenForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this revoke user auth token forbidden response has a 5xx status code
func (o *RevokeUserAuthTokenForbidden) IsServerError() bool {
	return false
}

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

// Code gets the status code for the revoke user auth token forbidden response
func (o *RevokeUserAuthTokenForbidden) Code() int {
	return 403
}

func (o *RevokeUserAuthTokenForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /user/revoke-auth-token][%d] revokeUserAuthTokenForbidden %s", 403, payload)
}

func (o *RevokeUserAuthTokenForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /user/revoke-auth-token][%d] revokeUserAuthTokenForbidden %s", 403, payload)
}

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

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

// NewRevokeUserAuthTokenInternalServerError creates a RevokeUserAuthTokenInternalServerError with default headers values
func NewRevokeUserAuthTokenInternalServerError() *RevokeUserAuthTokenInternalServerError {
	return &RevokeUserAuthTokenInternalServerError{}
}

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

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

// IsSuccess returns true when this revoke user auth token internal server error response has a 2xx status code
func (o *RevokeUserAuthTokenInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this revoke user auth token internal server error response has a 3xx status code
func (o *RevokeUserAuthTokenInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this revoke user auth token internal server error response has a 4xx status code
func (o *RevokeUserAuthTokenInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this revoke user auth token internal server error response has a 5xx status code
func (o *RevokeUserAuthTokenInternalServerError) IsServerError() bool {
	return true
}

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

// Code gets the status code for the revoke user auth token internal server error response
func (o *RevokeUserAuthTokenInternalServerError) Code() int {
	return 500
}

func (o *RevokeUserAuthTokenInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /user/revoke-auth-token][%d] revokeUserAuthTokenInternalServerError %s", 500, payload)
}

func (o *RevokeUserAuthTokenInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /user/revoke-auth-token][%d] revokeUserAuthTokenInternalServerError %s", 500, payload)
}

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

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