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

// UpdateSignedInUserReader is a Reader for the UpdateSignedInUser structure.
type UpdateSignedInUserReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *UpdateSignedInUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewUpdateSignedInUserOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewUpdateSignedInUserUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewUpdateSignedInUserForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 409:
		result := NewUpdateSignedInUserConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewUpdateSignedInUserInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /user] updateSignedInUser", response, response.Code())
	}
}

// NewUpdateSignedInUserOK creates a UpdateSignedInUserOK with default headers values
func NewUpdateSignedInUserOK() *UpdateSignedInUserOK {
	return &UpdateSignedInUserOK{}
}

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

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

// IsSuccess returns true when this update signed in user Ok response has a 2xx status code
func (o *UpdateSignedInUserOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this update signed in user Ok response has a 3xx status code
func (o *UpdateSignedInUserOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update signed in user Ok response has a 4xx status code
func (o *UpdateSignedInUserOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this update signed in user Ok response has a 5xx status code
func (o *UpdateSignedInUserOK) IsServerError() bool {
	return false
}

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

// Code gets the status code for the update signed in user Ok response
func (o *UpdateSignedInUserOK) Code() int {
	return 200
}

func (o *UpdateSignedInUserOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /user][%d] updateSignedInUserOk %s", 200, payload)
}

func (o *UpdateSignedInUserOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /user][%d] updateSignedInUserOk %s", 200, payload)
}

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

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

// NewUpdateSignedInUserUnauthorized creates a UpdateSignedInUserUnauthorized with default headers values
func NewUpdateSignedInUserUnauthorized() *UpdateSignedInUserUnauthorized {
	return &UpdateSignedInUserUnauthorized{}
}

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

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

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

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

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

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

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

// Code gets the status code for the update signed in user unauthorized response
func (o *UpdateSignedInUserUnauthorized) Code() int {
	return 401
}

func (o *UpdateSignedInUserUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /user][%d] updateSignedInUserUnauthorized %s", 401, payload)
}

func (o *UpdateSignedInUserUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /user][%d] updateSignedInUserUnauthorized %s", 401, payload)
}

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

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

// NewUpdateSignedInUserForbidden creates a UpdateSignedInUserForbidden with default headers values
func NewUpdateSignedInUserForbidden() *UpdateSignedInUserForbidden {
	return &UpdateSignedInUserForbidden{}
}

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

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

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

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

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

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

// Code gets the status code for the update signed in user forbidden response
func (o *UpdateSignedInUserForbidden) Code() int {
	return 403
}

func (o *UpdateSignedInUserForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /user][%d] updateSignedInUserForbidden %s", 403, payload)
}

func (o *UpdateSignedInUserForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /user][%d] updateSignedInUserForbidden %s", 403, payload)
}

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

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

// NewUpdateSignedInUserConflict creates a UpdateSignedInUserConflict with default headers values
func NewUpdateSignedInUserConflict() *UpdateSignedInUserConflict {
	return &UpdateSignedInUserConflict{}
}

/*
UpdateSignedInUserConflict describes a response with status code 409, with default header values.

ConflictError
*/
type UpdateSignedInUserConflict struct {
	Payload *models.ErrorResponseBody
}

// IsSuccess returns true when this update signed in user conflict response has a 2xx status code
func (o *UpdateSignedInUserConflict) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this update signed in user conflict response has a 3xx status code
func (o *UpdateSignedInUserConflict) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update signed in user conflict response has a 4xx status code
func (o *UpdateSignedInUserConflict) IsClientError() bool {
	return true
}

// IsServerError returns true when this update signed in user conflict response has a 5xx status code
func (o *UpdateSignedInUserConflict) IsServerError() bool {
	return false
}

// IsCode returns true when this update signed in user conflict response a status code equal to that given
func (o *UpdateSignedInUserConflict) IsCode(code int) bool {
	return code == 409
}

// Code gets the status code for the update signed in user conflict response
func (o *UpdateSignedInUserConflict) Code() int {
	return 409
}

func (o *UpdateSignedInUserConflict) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /user][%d] updateSignedInUserConflict %s", 409, payload)
}

func (o *UpdateSignedInUserConflict) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /user][%d] updateSignedInUserConflict %s", 409, payload)
}

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

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

// NewUpdateSignedInUserInternalServerError creates a UpdateSignedInUserInternalServerError with default headers values
func NewUpdateSignedInUserInternalServerError() *UpdateSignedInUserInternalServerError {
	return &UpdateSignedInUserInternalServerError{}
}

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

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

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

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

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

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

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

// Code gets the status code for the update signed in user internal server error response
func (o *UpdateSignedInUserInternalServerError) Code() int {
	return 500
}

func (o *UpdateSignedInUserInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /user][%d] updateSignedInUserInternalServerError %s", 500, payload)
}

func (o *UpdateSignedInUserInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /user][%d] updateSignedInUserInternalServerError %s", 500, payload)
}

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

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