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

package organization

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

// OrganizationUnblockUserReader is a Reader for the OrganizationUnblockUser structure.
type OrganizationUnblockUserReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *OrganizationUnblockUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 204:
		result := NewOrganizationUnblockUserNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 404:
		result := NewOrganizationUnblockUserNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewOrganizationUnblockUserUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[DELETE /orgs/{org}/blocks/{username}] organizationUnblockUser", response, response.Code())
	}
}

// NewOrganizationUnblockUserNoContent creates a OrganizationUnblockUserNoContent with default headers values
func NewOrganizationUnblockUserNoContent() *OrganizationUnblockUserNoContent {
	return &OrganizationUnblockUserNoContent{}
}

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

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

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

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

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

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

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

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

func (o *OrganizationUnblockUserNoContent) Error() string {
	return fmt.Sprintf("[DELETE /orgs/{org}/blocks/{username}][%d] organizationUnblockUserNoContent", 204)
}

func (o *OrganizationUnblockUserNoContent) String() string {
	return fmt.Sprintf("[DELETE /orgs/{org}/blocks/{username}][%d] organizationUnblockUserNoContent", 204)
}

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

	return nil
}

// NewOrganizationUnblockUserNotFound creates a OrganizationUnblockUserNotFound with default headers values
func NewOrganizationUnblockUserNotFound() *OrganizationUnblockUserNotFound {
	return &OrganizationUnblockUserNotFound{}
}

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

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

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

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

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

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

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

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

func (o *OrganizationUnblockUserNotFound) Error() string {
	return fmt.Sprintf("[DELETE /orgs/{org}/blocks/{username}][%d] organizationUnblockUserNotFound", 404)
}

func (o *OrganizationUnblockUserNotFound) String() string {
	return fmt.Sprintf("[DELETE /orgs/{org}/blocks/{username}][%d] organizationUnblockUserNotFound", 404)
}

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

	return nil
}

// NewOrganizationUnblockUserUnprocessableEntity creates a OrganizationUnblockUserUnprocessableEntity with default headers values
func NewOrganizationUnblockUserUnprocessableEntity() *OrganizationUnblockUserUnprocessableEntity {
	return &OrganizationUnblockUserUnprocessableEntity{}
}

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

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

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

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

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

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

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

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

func (o *OrganizationUnblockUserUnprocessableEntity) Error() string {
	return fmt.Sprintf("[DELETE /orgs/{org}/blocks/{username}][%d] organizationUnblockUserUnprocessableEntity", 422)
}

func (o *OrganizationUnblockUserUnprocessableEntity) String() string {
	return fmt.Sprintf("[DELETE /orgs/{org}/blocks/{username}][%d] organizationUnblockUserUnprocessableEntity", 422)
}

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