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

package installer

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

import (
	"fmt"
	"io"

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

	"github.com/openshift/assisted-service/models"
)

// V2DeregisterHostReader is a Reader for the V2DeregisterHost structure.
type V2DeregisterHostReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *V2DeregisterHostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 204:
		result := NewV2DeregisterHostNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewV2DeregisterHostBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewV2DeregisterHostUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewV2DeregisterHostForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewV2DeregisterHostNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 405:
		result := NewV2DeregisterHostMethodNotAllowed()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewV2DeregisterHostInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
	}
}

// NewV2DeregisterHostNoContent creates a V2DeregisterHostNoContent with default headers values
func NewV2DeregisterHostNoContent() *V2DeregisterHostNoContent {
	return &V2DeregisterHostNoContent{}
}

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

Success.
*/
type V2DeregisterHostNoContent struct {
}

// IsSuccess returns true when this v2 deregister host no content response has a 2xx status code
func (o *V2DeregisterHostNoContent) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this v2 deregister host no content response has a 3xx status code
func (o *V2DeregisterHostNoContent) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 deregister host no content response has a 4xx status code
func (o *V2DeregisterHostNoContent) IsClientError() bool {
	return false
}

// IsServerError returns true when this v2 deregister host no content response has a 5xx status code
func (o *V2DeregisterHostNoContent) IsServerError() bool {
	return false
}

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

func (o *V2DeregisterHostNoContent) Error() string {
	return fmt.Sprintf("[DELETE /v2/infra-envs/{infra_env_id}/hosts/{host_id}][%d] v2DeregisterHostNoContent ", 204)
}

func (o *V2DeregisterHostNoContent) String() string {
	return fmt.Sprintf("[DELETE /v2/infra-envs/{infra_env_id}/hosts/{host_id}][%d] v2DeregisterHostNoContent ", 204)
}

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

	return nil
}

// NewV2DeregisterHostBadRequest creates a V2DeregisterHostBadRequest with default headers values
func NewV2DeregisterHostBadRequest() *V2DeregisterHostBadRequest {
	return &V2DeregisterHostBadRequest{}
}

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

Error.
*/
type V2DeregisterHostBadRequest struct {
	Payload *models.Error
}

// IsSuccess returns true when this v2 deregister host bad request response has a 2xx status code
func (o *V2DeregisterHostBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this v2 deregister host bad request response has a 3xx status code
func (o *V2DeregisterHostBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 deregister host bad request response has a 4xx status code
func (o *V2DeregisterHostBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this v2 deregister host bad request response has a 5xx status code
func (o *V2DeregisterHostBadRequest) IsServerError() bool {
	return false
}

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

func (o *V2DeregisterHostBadRequest) Error() string {
	return fmt.Sprintf("[DELETE /v2/infra-envs/{infra_env_id}/hosts/{host_id}][%d] v2DeregisterHostBadRequest  %+v", 400, o.Payload)
}

func (o *V2DeregisterHostBadRequest) String() string {
	return fmt.Sprintf("[DELETE /v2/infra-envs/{infra_env_id}/hosts/{host_id}][%d] v2DeregisterHostBadRequest  %+v", 400, o.Payload)
}

func (o *V2DeregisterHostBadRequest) GetPayload() *models.Error {
	return o.Payload
}

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

	o.Payload = new(models.Error)

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

	return nil
}

// NewV2DeregisterHostUnauthorized creates a V2DeregisterHostUnauthorized with default headers values
func NewV2DeregisterHostUnauthorized() *V2DeregisterHostUnauthorized {
	return &V2DeregisterHostUnauthorized{}
}

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

Unauthorized.
*/
type V2DeregisterHostUnauthorized struct {
	Payload *models.InfraError
}

// IsSuccess returns true when this v2 deregister host unauthorized response has a 2xx status code
func (o *V2DeregisterHostUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this v2 deregister host unauthorized response has a 3xx status code
func (o *V2DeregisterHostUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 deregister host unauthorized response has a 4xx status code
func (o *V2DeregisterHostUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this v2 deregister host unauthorized response has a 5xx status code
func (o *V2DeregisterHostUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this v2 deregister host unauthorized response a status code equal to that given
func (o *V2DeregisterHostUnauthorized) IsCode(code int) bool {
	return code == 401
}

func (o *V2DeregisterHostUnauthorized) Error() string {
	return fmt.Sprintf("[DELETE /v2/infra-envs/{infra_env_id}/hosts/{host_id}][%d] v2DeregisterHostUnauthorized  %+v", 401, o.Payload)
}

func (o *V2DeregisterHostUnauthorized) String() string {
	return fmt.Sprintf("[DELETE /v2/infra-envs/{infra_env_id}/hosts/{host_id}][%d] v2DeregisterHostUnauthorized  %+v", 401, o.Payload)
}

func (o *V2DeregisterHostUnauthorized) GetPayload() *models.InfraError {
	return o.Payload
}

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

	o.Payload = new(models.InfraError)

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

	return nil
}

// NewV2DeregisterHostForbidden creates a V2DeregisterHostForbidden with default headers values
func NewV2DeregisterHostForbidden() *V2DeregisterHostForbidden {
	return &V2DeregisterHostForbidden{}
}

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

Forbidden.
*/
type V2DeregisterHostForbidden struct {
	Payload *models.InfraError
}

// IsSuccess returns true when this v2 deregister host forbidden response has a 2xx status code
func (o *V2DeregisterHostForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this v2 deregister host forbidden response has a 3xx status code
func (o *V2DeregisterHostForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 deregister host forbidden response has a 4xx status code
func (o *V2DeregisterHostForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this v2 deregister host forbidden response has a 5xx status code
func (o *V2DeregisterHostForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this v2 deregister host forbidden response a status code equal to that given
func (o *V2DeregisterHostForbidden) IsCode(code int) bool {
	return code == 403
}

func (o *V2DeregisterHostForbidden) Error() string {
	return fmt.Sprintf("[DELETE /v2/infra-envs/{infra_env_id}/hosts/{host_id}][%d] v2DeregisterHostForbidden  %+v", 403, o.Payload)
}

func (o *V2DeregisterHostForbidden) String() string {
	return fmt.Sprintf("[DELETE /v2/infra-envs/{infra_env_id}/hosts/{host_id}][%d] v2DeregisterHostForbidden  %+v", 403, o.Payload)
}

func (o *V2DeregisterHostForbidden) GetPayload() *models.InfraError {
	return o.Payload
}

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

	o.Payload = new(models.InfraError)

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

	return nil
}

// NewV2DeregisterHostNotFound creates a V2DeregisterHostNotFound with default headers values
func NewV2DeregisterHostNotFound() *V2DeregisterHostNotFound {
	return &V2DeregisterHostNotFound{}
}

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

Error.
*/
type V2DeregisterHostNotFound struct {
	Payload *models.Error
}

// IsSuccess returns true when this v2 deregister host not found response has a 2xx status code
func (o *V2DeregisterHostNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this v2 deregister host not found response has a 3xx status code
func (o *V2DeregisterHostNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 deregister host not found response has a 4xx status code
func (o *V2DeregisterHostNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this v2 deregister host not found response has a 5xx status code
func (o *V2DeregisterHostNotFound) IsServerError() bool {
	return false
}

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

func (o *V2DeregisterHostNotFound) Error() string {
	return fmt.Sprintf("[DELETE /v2/infra-envs/{infra_env_id}/hosts/{host_id}][%d] v2DeregisterHostNotFound  %+v", 404, o.Payload)
}

func (o *V2DeregisterHostNotFound) String() string {
	return fmt.Sprintf("[DELETE /v2/infra-envs/{infra_env_id}/hosts/{host_id}][%d] v2DeregisterHostNotFound  %+v", 404, o.Payload)
}

func (o *V2DeregisterHostNotFound) GetPayload() *models.Error {
	return o.Payload
}

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

	o.Payload = new(models.Error)

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

	return nil
}

// NewV2DeregisterHostMethodNotAllowed creates a V2DeregisterHostMethodNotAllowed with default headers values
func NewV2DeregisterHostMethodNotAllowed() *V2DeregisterHostMethodNotAllowed {
	return &V2DeregisterHostMethodNotAllowed{}
}

/*
V2DeregisterHostMethodNotAllowed describes a response with status code 405, with default header values.

Method Not Allowed.
*/
type V2DeregisterHostMethodNotAllowed struct {
	Payload *models.Error
}

// IsSuccess returns true when this v2 deregister host method not allowed response has a 2xx status code
func (o *V2DeregisterHostMethodNotAllowed) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this v2 deregister host method not allowed response has a 3xx status code
func (o *V2DeregisterHostMethodNotAllowed) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 deregister host method not allowed response has a 4xx status code
func (o *V2DeregisterHostMethodNotAllowed) IsClientError() bool {
	return true
}

// IsServerError returns true when this v2 deregister host method not allowed response has a 5xx status code
func (o *V2DeregisterHostMethodNotAllowed) IsServerError() bool {
	return false
}

// IsCode returns true when this v2 deregister host method not allowed response a status code equal to that given
func (o *V2DeregisterHostMethodNotAllowed) IsCode(code int) bool {
	return code == 405
}

func (o *V2DeregisterHostMethodNotAllowed) Error() string {
	return fmt.Sprintf("[DELETE /v2/infra-envs/{infra_env_id}/hosts/{host_id}][%d] v2DeregisterHostMethodNotAllowed  %+v", 405, o.Payload)
}

func (o *V2DeregisterHostMethodNotAllowed) String() string {
	return fmt.Sprintf("[DELETE /v2/infra-envs/{infra_env_id}/hosts/{host_id}][%d] v2DeregisterHostMethodNotAllowed  %+v", 405, o.Payload)
}

func (o *V2DeregisterHostMethodNotAllowed) GetPayload() *models.Error {
	return o.Payload
}

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

	o.Payload = new(models.Error)

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

	return nil
}

// NewV2DeregisterHostInternalServerError creates a V2DeregisterHostInternalServerError with default headers values
func NewV2DeregisterHostInternalServerError() *V2DeregisterHostInternalServerError {
	return &V2DeregisterHostInternalServerError{}
}

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

Error.
*/
type V2DeregisterHostInternalServerError struct {
	Payload *models.Error
}

// IsSuccess returns true when this v2 deregister host internal server error response has a 2xx status code
func (o *V2DeregisterHostInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this v2 deregister host internal server error response has a 3xx status code
func (o *V2DeregisterHostInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 deregister host internal server error response has a 4xx status code
func (o *V2DeregisterHostInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this v2 deregister host internal server error response has a 5xx status code
func (o *V2DeregisterHostInternalServerError) IsServerError() bool {
	return true
}

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

func (o *V2DeregisterHostInternalServerError) Error() string {
	return fmt.Sprintf("[DELETE /v2/infra-envs/{infra_env_id}/hosts/{host_id}][%d] v2DeregisterHostInternalServerError  %+v", 500, o.Payload)
}

func (o *V2DeregisterHostInternalServerError) String() string {
	return fmt.Sprintf("[DELETE /v2/infra-envs/{infra_env_id}/hosts/{host_id}][%d] v2DeregisterHostInternalServerError  %+v", 500, o.Payload)
}

func (o *V2DeregisterHostInternalServerError) GetPayload() *models.Error {
	return o.Payload
}

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

	o.Payload = new(models.Error)

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

	return nil
}
