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

package cluster_authorization

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"fmt"
	"io"

	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"

	"github.com/RafayLabs/rcloud-base/api/def/clients/sentry/models"
)

// ClusterAuthorizationGetUserAuthorizationReader is a Reader for the ClusterAuthorizationGetUserAuthorization structure.
type ClusterAuthorizationGetUserAuthorizationReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *ClusterAuthorizationGetUserAuthorizationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewClusterAuthorizationGetUserAuthorizationOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewClusterAuthorizationGetUserAuthorizationForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewClusterAuthorizationGetUserAuthorizationNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		result := NewClusterAuthorizationGetUserAuthorizationDefault(response.Code())
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		if response.Code()/100 == 2 {
			return result, nil
		}
		return nil, result
	}
}

// NewClusterAuthorizationGetUserAuthorizationOK creates a ClusterAuthorizationGetUserAuthorizationOK with default headers values
func NewClusterAuthorizationGetUserAuthorizationOK() *ClusterAuthorizationGetUserAuthorizationOK {
	return &ClusterAuthorizationGetUserAuthorizationOK{}
}

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

A successful response.
*/
type ClusterAuthorizationGetUserAuthorizationOK struct {
	Payload *models.RPCGetUserAuthorizationResponse
}

func (o *ClusterAuthorizationGetUserAuthorizationOK) Error() string {
	return fmt.Sprintf("[GET /v2/sentry/authorization/user][%d] clusterAuthorizationGetUserAuthorizationOK  %+v", 200, o.Payload)
}
func (o *ClusterAuthorizationGetUserAuthorizationOK) GetPayload() *models.RPCGetUserAuthorizationResponse {
	return o.Payload
}

func (o *ClusterAuthorizationGetUserAuthorizationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(models.RPCGetUserAuthorizationResponse)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewClusterAuthorizationGetUserAuthorizationForbidden creates a ClusterAuthorizationGetUserAuthorizationForbidden with default headers values
func NewClusterAuthorizationGetUserAuthorizationForbidden() *ClusterAuthorizationGetUserAuthorizationForbidden {
	return &ClusterAuthorizationGetUserAuthorizationForbidden{}
}

/* ClusterAuthorizationGetUserAuthorizationForbidden describes a response with status code 403, with default header values.

Returned when the user does not have permission to access the resource.
*/
type ClusterAuthorizationGetUserAuthorizationForbidden struct {
	Payload interface{}
}

func (o *ClusterAuthorizationGetUserAuthorizationForbidden) Error() string {
	return fmt.Sprintf("[GET /v2/sentry/authorization/user][%d] clusterAuthorizationGetUserAuthorizationForbidden  %+v", 403, o.Payload)
}
func (o *ClusterAuthorizationGetUserAuthorizationForbidden) GetPayload() interface{} {
	return o.Payload
}

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

// NewClusterAuthorizationGetUserAuthorizationNotFound creates a ClusterAuthorizationGetUserAuthorizationNotFound with default headers values
func NewClusterAuthorizationGetUserAuthorizationNotFound() *ClusterAuthorizationGetUserAuthorizationNotFound {
	return &ClusterAuthorizationGetUserAuthorizationNotFound{}
}

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

Returned when the resource does not exist.
*/
type ClusterAuthorizationGetUserAuthorizationNotFound struct {
	Payload string
}

func (o *ClusterAuthorizationGetUserAuthorizationNotFound) Error() string {
	return fmt.Sprintf("[GET /v2/sentry/authorization/user][%d] clusterAuthorizationGetUserAuthorizationNotFound  %+v", 404, o.Payload)
}
func (o *ClusterAuthorizationGetUserAuthorizationNotFound) GetPayload() string {
	return o.Payload
}

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

// NewClusterAuthorizationGetUserAuthorizationDefault creates a ClusterAuthorizationGetUserAuthorizationDefault with default headers values
func NewClusterAuthorizationGetUserAuthorizationDefault(code int) *ClusterAuthorizationGetUserAuthorizationDefault {
	return &ClusterAuthorizationGetUserAuthorizationDefault{
		_statusCode: code,
	}
}

/* ClusterAuthorizationGetUserAuthorizationDefault describes a response with status code -1, with default header values.

An unexpected error response.
*/
type ClusterAuthorizationGetUserAuthorizationDefault struct {
	_statusCode int

	Payload *models.GooglerpcStatus
}

// Code gets the status code for the cluster authorization get user authorization default response
func (o *ClusterAuthorizationGetUserAuthorizationDefault) Code() int {
	return o._statusCode
}

func (o *ClusterAuthorizationGetUserAuthorizationDefault) Error() string {
	return fmt.Sprintf("[GET /v2/sentry/authorization/user][%d] ClusterAuthorization_GetUserAuthorization default  %+v", o._statusCode, o.Payload)
}
func (o *ClusterAuthorizationGetUserAuthorizationDefault) GetPayload() *models.GooglerpcStatus {
	return o.Payload
}

func (o *ClusterAuthorizationGetUserAuthorizationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(models.GooglerpcStatus)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}
