// 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 (
	"fmt"

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

// UserUnblockUserReader is a Reader for the UserUnblockUser structure.
type UserUnblockUserReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *UserUnblockUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 204:
		result := NewUserUnblockUserNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 404:
		result := NewUserUnblockUserNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewUserUnblockUserUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[DELETE /user/blocks/{username}] userUnblockUser", response, response.Code())
	}
}

// NewUserUnblockUserNoContent creates a UserUnblockUserNoContent with default headers values
func NewUserUnblockUserNoContent() *UserUnblockUserNoContent {
	return &UserUnblockUserNoContent{}
}

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

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

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

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

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

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

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

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

func (o *UserUnblockUserNoContent) Error() string {
	return fmt.Sprintf("[DELETE /user/blocks/{username}][%d] userUnblockUserNoContent", 204)
}

func (o *UserUnblockUserNoContent) String() string {
	return fmt.Sprintf("[DELETE /user/blocks/{username}][%d] userUnblockUserNoContent", 204)
}

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

	return nil
}

// NewUserUnblockUserNotFound creates a UserUnblockUserNotFound with default headers values
func NewUserUnblockUserNotFound() *UserUnblockUserNotFound {
	return &UserUnblockUserNotFound{}
}

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

APINotFound is a not found empty response
*/
type UserUnblockUserNotFound struct {
}

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

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

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

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

// IsCode returns true when this user unblock user not found response a status code equal to that given
func (o *UserUnblockUserNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the user unblock user not found response
func (o *UserUnblockUserNotFound) Code() int {
	return 404
}

func (o *UserUnblockUserNotFound) Error() string {
	return fmt.Sprintf("[DELETE /user/blocks/{username}][%d] userUnblockUserNotFound", 404)
}

func (o *UserUnblockUserNotFound) String() string {
	return fmt.Sprintf("[DELETE /user/blocks/{username}][%d] userUnblockUserNotFound", 404)
}

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

	return nil
}

// NewUserUnblockUserUnprocessableEntity creates a UserUnblockUserUnprocessableEntity with default headers values
func NewUserUnblockUserUnprocessableEntity() *UserUnblockUserUnprocessableEntity {
	return &UserUnblockUserUnprocessableEntity{}
}

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

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

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

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

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

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

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

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

func (o *UserUnblockUserUnprocessableEntity) Error() string {
	return fmt.Sprintf("[DELETE /user/blocks/{username}][%d] userUnblockUserUnprocessableEntity", 422)
}

func (o *UserUnblockUserUnprocessableEntity) String() string {
	return fmt.Sprintf("[DELETE /user/blocks/{username}][%d] userUnblockUserUnprocessableEntity", 422)
}

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