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

package admin

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

import (
	"fmt"

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

// AdminRenameUserReader is a Reader for the AdminRenameUser structure.
type AdminRenameUserReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *AdminRenameUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 204:
		result := NewAdminRenameUserNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewAdminRenameUserForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewAdminRenameUserUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /admin/users/{username}/rename] adminRenameUser", response, response.Code())
	}
}

// NewAdminRenameUserNoContent creates a AdminRenameUserNoContent with default headers values
func NewAdminRenameUserNoContent() *AdminRenameUserNoContent {
	return &AdminRenameUserNoContent{}
}

/*
AdminRenameUserNoContent describes a response with status code 204, with default header values.

APIEmpty is an empty response
*/
type AdminRenameUserNoContent struct {
}

// IsSuccess returns true when this admin rename user no content response has a 2xx status code
func (o *AdminRenameUserNoContent) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this admin rename user no content response has a 3xx status code
func (o *AdminRenameUserNoContent) IsRedirect() bool {
	return false
}

// IsClientError returns true when this admin rename user no content response has a 4xx status code
func (o *AdminRenameUserNoContent) IsClientError() bool {
	return false
}

// IsServerError returns true when this admin rename user no content response has a 5xx status code
func (o *AdminRenameUserNoContent) IsServerError() bool {
	return false
}

// IsCode returns true when this admin rename user no content response a status code equal to that given
func (o *AdminRenameUserNoContent) IsCode(code int) bool {
	return code == 204
}

// Code gets the status code for the admin rename user no content response
func (o *AdminRenameUserNoContent) Code() int {
	return 204
}

func (o *AdminRenameUserNoContent) Error() string {
	return fmt.Sprintf("[POST /admin/users/{username}/rename][%d] adminRenameUserNoContent", 204)
}

func (o *AdminRenameUserNoContent) String() string {
	return fmt.Sprintf("[POST /admin/users/{username}/rename][%d] adminRenameUserNoContent", 204)
}

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

	return nil
}

// NewAdminRenameUserForbidden creates a AdminRenameUserForbidden with default headers values
func NewAdminRenameUserForbidden() *AdminRenameUserForbidden {
	return &AdminRenameUserForbidden{}
}

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

APIForbiddenError is a forbidden error response
*/
type AdminRenameUserForbidden struct {
	Message string
	URL     string
}

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

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

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

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

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

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

func (o *AdminRenameUserForbidden) Error() string {
	return fmt.Sprintf("[POST /admin/users/{username}/rename][%d] adminRenameUserForbidden", 403)
}

func (o *AdminRenameUserForbidden) String() string {
	return fmt.Sprintf("[POST /admin/users/{username}/rename][%d] adminRenameUserForbidden", 403)
}

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

	// hydrates response header message
	hdrMessage := response.GetHeader("message")

	if hdrMessage != "" {
		o.Message = hdrMessage
	}

	// hydrates response header url
	hdrURL := response.GetHeader("url")

	if hdrURL != "" {
		o.URL = hdrURL
	}

	return nil
}

// NewAdminRenameUserUnprocessableEntity creates a AdminRenameUserUnprocessableEntity with default headers values
func NewAdminRenameUserUnprocessableEntity() *AdminRenameUserUnprocessableEntity {
	return &AdminRenameUserUnprocessableEntity{}
}

/*
AdminRenameUserUnprocessableEntity describes a response with status code 422, with default header values.

APIValidationError is error format response related to input validation
*/
type AdminRenameUserUnprocessableEntity struct {
	Message string
	URL     string
}

// IsSuccess returns true when this admin rename user unprocessable entity response has a 2xx status code
func (o *AdminRenameUserUnprocessableEntity) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this admin rename user unprocessable entity response has a 3xx status code
func (o *AdminRenameUserUnprocessableEntity) IsRedirect() bool {
	return false
}

// IsClientError returns true when this admin rename user unprocessable entity response has a 4xx status code
func (o *AdminRenameUserUnprocessableEntity) IsClientError() bool {
	return true
}

// IsServerError returns true when this admin rename user unprocessable entity response has a 5xx status code
func (o *AdminRenameUserUnprocessableEntity) IsServerError() bool {
	return false
}

// IsCode returns true when this admin rename user unprocessable entity response a status code equal to that given
func (o *AdminRenameUserUnprocessableEntity) IsCode(code int) bool {
	return code == 422
}

// Code gets the status code for the admin rename user unprocessable entity response
func (o *AdminRenameUserUnprocessableEntity) Code() int {
	return 422
}

func (o *AdminRenameUserUnprocessableEntity) Error() string {
	return fmt.Sprintf("[POST /admin/users/{username}/rename][%d] adminRenameUserUnprocessableEntity", 422)
}

func (o *AdminRenameUserUnprocessableEntity) String() string {
	return fmt.Sprintf("[POST /admin/users/{username}/rename][%d] adminRenameUserUnprocessableEntity", 422)
}

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

	// hydrates response header message
	hdrMessage := response.GetHeader("message")

	if hdrMessage != "" {
		o.Message = hdrMessage
	}

	// hydrates response header url
	hdrURL := response.GetHeader("url")

	if hdrURL != "" {
		o.URL = hdrURL
	}

	return nil
}
