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

package 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"

	"git.coopcloud.tech/decentral1se/gtslib/models"
)

// GetUserReader is a Reader for the GetUser structure.
type GetUserReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetUserOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetUserBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetUserUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetUserForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 406:
		result := NewGetUserNotAcceptable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetUserInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /api/v1/user] getUser", response, response.Code())
	}
}

// NewGetUserOK creates a GetUserOK with default headers values
func NewGetUserOK() *GetUserOK {
	return &GetUserOK{}
}

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

The requested user.
*/
type GetUserOK struct {
	Payload *models.User
}

// IsSuccess returns true when this get user o k response has a 2xx status code
func (o *GetUserOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this get user o k response has a 3xx status code
func (o *GetUserOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get user o k response has a 4xx status code
func (o *GetUserOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this get user o k response has a 5xx status code
func (o *GetUserOK) IsServerError() bool {
	return false
}

// IsCode returns true when this get user o k response a status code equal to that given
func (o *GetUserOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the get user o k response
func (o *GetUserOK) Code() int {
	return 200
}

func (o *GetUserOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/v1/user][%d] getUserOK %s", 200, payload)
}

func (o *GetUserOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/v1/user][%d] getUserOK %s", 200, payload)
}

func (o *GetUserOK) GetPayload() *models.User {
	return o.Payload
}

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

	o.Payload = new(models.User)

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

	return nil
}

// NewGetUserBadRequest creates a GetUserBadRequest with default headers values
func NewGetUserBadRequest() *GetUserBadRequest {
	return &GetUserBadRequest{}
}

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

bad request
*/
type GetUserBadRequest struct {
}

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

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

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

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

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

// Code gets the status code for the get user bad request response
func (o *GetUserBadRequest) Code() int {
	return 400
}

func (o *GetUserBadRequest) Error() string {
	return fmt.Sprintf("[GET /api/v1/user][%d] getUserBadRequest", 400)
}

func (o *GetUserBadRequest) String() string {
	return fmt.Sprintf("[GET /api/v1/user][%d] getUserBadRequest", 400)
}

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

	return nil
}

// NewGetUserUnauthorized creates a GetUserUnauthorized with default headers values
func NewGetUserUnauthorized() *GetUserUnauthorized {
	return &GetUserUnauthorized{}
}

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

unauthorized
*/
type GetUserUnauthorized struct {
}

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

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

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

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

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

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

func (o *GetUserUnauthorized) Error() string {
	return fmt.Sprintf("[GET /api/v1/user][%d] getUserUnauthorized", 401)
}

func (o *GetUserUnauthorized) String() string {
	return fmt.Sprintf("[GET /api/v1/user][%d] getUserUnauthorized", 401)
}

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

	return nil
}

// NewGetUserForbidden creates a GetUserForbidden with default headers values
func NewGetUserForbidden() *GetUserForbidden {
	return &GetUserForbidden{}
}

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

forbidden
*/
type GetUserForbidden struct {
}

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

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

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

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

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

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

func (o *GetUserForbidden) Error() string {
	return fmt.Sprintf("[GET /api/v1/user][%d] getUserForbidden", 403)
}

func (o *GetUserForbidden) String() string {
	return fmt.Sprintf("[GET /api/v1/user][%d] getUserForbidden", 403)
}

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

	return nil
}

// NewGetUserNotAcceptable creates a GetUserNotAcceptable with default headers values
func NewGetUserNotAcceptable() *GetUserNotAcceptable {
	return &GetUserNotAcceptable{}
}

/*
GetUserNotAcceptable describes a response with status code 406, with default header values.

not acceptable
*/
type GetUserNotAcceptable struct {
}

// IsSuccess returns true when this get user not acceptable response has a 2xx status code
func (o *GetUserNotAcceptable) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get user not acceptable response has a 3xx status code
func (o *GetUserNotAcceptable) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get user not acceptable response has a 4xx status code
func (o *GetUserNotAcceptable) IsClientError() bool {
	return true
}

// IsServerError returns true when this get user not acceptable response has a 5xx status code
func (o *GetUserNotAcceptable) IsServerError() bool {
	return false
}

// IsCode returns true when this get user not acceptable response a status code equal to that given
func (o *GetUserNotAcceptable) IsCode(code int) bool {
	return code == 406
}

// Code gets the status code for the get user not acceptable response
func (o *GetUserNotAcceptable) Code() int {
	return 406
}

func (o *GetUserNotAcceptable) Error() string {
	return fmt.Sprintf("[GET /api/v1/user][%d] getUserNotAcceptable", 406)
}

func (o *GetUserNotAcceptable) String() string {
	return fmt.Sprintf("[GET /api/v1/user][%d] getUserNotAcceptable", 406)
}

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

	return nil
}

// NewGetUserInternalServerError creates a GetUserInternalServerError with default headers values
func NewGetUserInternalServerError() *GetUserInternalServerError {
	return &GetUserInternalServerError{}
}

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

internal error
*/
type GetUserInternalServerError struct {
}

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

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

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

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

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

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

func (o *GetUserInternalServerError) Error() string {
	return fmt.Sprintf("[GET /api/v1/user][%d] getUserInternalServerError", 500)
}

func (o *GetUserInternalServerError) String() string {
	return fmt.Sprintf("[GET /api/v1/user][%d] getUserInternalServerError", 500)
}

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

	return nil
}
