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

// V2ResetHostValidationReader is a Reader for the V2ResetHostValidation structure.
type V2ResetHostValidationReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *V2ResetHostValidationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewV2ResetHostValidationOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewV2ResetHostValidationBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewV2ResetHostValidationUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewV2ResetHostValidationForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewV2ResetHostValidationNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 409:
		result := NewV2ResetHostValidationConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewV2ResetHostValidationInternalServerError()
		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())
	}
}

// NewV2ResetHostValidationOK creates a V2ResetHostValidationOK with default headers values
func NewV2ResetHostValidationOK() *V2ResetHostValidationOK {
	return &V2ResetHostValidationOK{}
}

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

Success.
*/
type V2ResetHostValidationOK struct {
	Payload *models.Host
}

// IsSuccess returns true when this v2 reset host validation o k response has a 2xx status code
func (o *V2ResetHostValidationOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this v2 reset host validation o k response has a 3xx status code
func (o *V2ResetHostValidationOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 reset host validation o k response has a 4xx status code
func (o *V2ResetHostValidationOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this v2 reset host validation o k response has a 5xx status code
func (o *V2ResetHostValidationOK) IsServerError() bool {
	return false
}

// IsCode returns true when this v2 reset host validation o k response a status code equal to that given
func (o *V2ResetHostValidationOK) IsCode(code int) bool {
	return code == 200
}

func (o *V2ResetHostValidationOK) Error() string {
	return fmt.Sprintf("[PATCH /v2/infra-envs/{infra_env_id}/hosts/{host_id}/actions/reset-validation/{validation_id}][%d] v2ResetHostValidationOK  %+v", 200, o.Payload)
}

func (o *V2ResetHostValidationOK) String() string {
	return fmt.Sprintf("[PATCH /v2/infra-envs/{infra_env_id}/hosts/{host_id}/actions/reset-validation/{validation_id}][%d] v2ResetHostValidationOK  %+v", 200, o.Payload)
}

func (o *V2ResetHostValidationOK) GetPayload() *models.Host {
	return o.Payload
}

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

	o.Payload = new(models.Host)

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

	return nil
}

// NewV2ResetHostValidationBadRequest creates a V2ResetHostValidationBadRequest with default headers values
func NewV2ResetHostValidationBadRequest() *V2ResetHostValidationBadRequest {
	return &V2ResetHostValidationBadRequest{}
}

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

Bad Request
*/
type V2ResetHostValidationBadRequest struct {
	Payload *models.Error
}

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

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

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

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

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

func (o *V2ResetHostValidationBadRequest) Error() string {
	return fmt.Sprintf("[PATCH /v2/infra-envs/{infra_env_id}/hosts/{host_id}/actions/reset-validation/{validation_id}][%d] v2ResetHostValidationBadRequest  %+v", 400, o.Payload)
}

func (o *V2ResetHostValidationBadRequest) String() string {
	return fmt.Sprintf("[PATCH /v2/infra-envs/{infra_env_id}/hosts/{host_id}/actions/reset-validation/{validation_id}][%d] v2ResetHostValidationBadRequest  %+v", 400, o.Payload)
}

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

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

// NewV2ResetHostValidationUnauthorized creates a V2ResetHostValidationUnauthorized with default headers values
func NewV2ResetHostValidationUnauthorized() *V2ResetHostValidationUnauthorized {
	return &V2ResetHostValidationUnauthorized{}
}

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

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

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

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

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

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

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

func (o *V2ResetHostValidationUnauthorized) Error() string {
	return fmt.Sprintf("[PATCH /v2/infra-envs/{infra_env_id}/hosts/{host_id}/actions/reset-validation/{validation_id}][%d] v2ResetHostValidationUnauthorized  %+v", 401, o.Payload)
}

func (o *V2ResetHostValidationUnauthorized) String() string {
	return fmt.Sprintf("[PATCH /v2/infra-envs/{infra_env_id}/hosts/{host_id}/actions/reset-validation/{validation_id}][%d] v2ResetHostValidationUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewV2ResetHostValidationForbidden creates a V2ResetHostValidationForbidden with default headers values
func NewV2ResetHostValidationForbidden() *V2ResetHostValidationForbidden {
	return &V2ResetHostValidationForbidden{}
}

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

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

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

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

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

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

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

func (o *V2ResetHostValidationForbidden) Error() string {
	return fmt.Sprintf("[PATCH /v2/infra-envs/{infra_env_id}/hosts/{host_id}/actions/reset-validation/{validation_id}][%d] v2ResetHostValidationForbidden  %+v", 403, o.Payload)
}

func (o *V2ResetHostValidationForbidden) String() string {
	return fmt.Sprintf("[PATCH /v2/infra-envs/{infra_env_id}/hosts/{host_id}/actions/reset-validation/{validation_id}][%d] v2ResetHostValidationForbidden  %+v", 403, o.Payload)
}

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

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

// NewV2ResetHostValidationNotFound creates a V2ResetHostValidationNotFound with default headers values
func NewV2ResetHostValidationNotFound() *V2ResetHostValidationNotFound {
	return &V2ResetHostValidationNotFound{}
}

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

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

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

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

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

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

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

func (o *V2ResetHostValidationNotFound) Error() string {
	return fmt.Sprintf("[PATCH /v2/infra-envs/{infra_env_id}/hosts/{host_id}/actions/reset-validation/{validation_id}][%d] v2ResetHostValidationNotFound  %+v", 404, o.Payload)
}

func (o *V2ResetHostValidationNotFound) String() string {
	return fmt.Sprintf("[PATCH /v2/infra-envs/{infra_env_id}/hosts/{host_id}/actions/reset-validation/{validation_id}][%d] v2ResetHostValidationNotFound  %+v", 404, o.Payload)
}

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

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

// NewV2ResetHostValidationConflict creates a V2ResetHostValidationConflict with default headers values
func NewV2ResetHostValidationConflict() *V2ResetHostValidationConflict {
	return &V2ResetHostValidationConflict{}
}

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

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

// IsSuccess returns true when this v2 reset host validation conflict response has a 2xx status code
func (o *V2ResetHostValidationConflict) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this v2 reset host validation conflict response has a 3xx status code
func (o *V2ResetHostValidationConflict) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 reset host validation conflict response has a 4xx status code
func (o *V2ResetHostValidationConflict) IsClientError() bool {
	return true
}

// IsServerError returns true when this v2 reset host validation conflict response has a 5xx status code
func (o *V2ResetHostValidationConflict) IsServerError() bool {
	return false
}

// IsCode returns true when this v2 reset host validation conflict response a status code equal to that given
func (o *V2ResetHostValidationConflict) IsCode(code int) bool {
	return code == 409
}

func (o *V2ResetHostValidationConflict) Error() string {
	return fmt.Sprintf("[PATCH /v2/infra-envs/{infra_env_id}/hosts/{host_id}/actions/reset-validation/{validation_id}][%d] v2ResetHostValidationConflict  %+v", 409, o.Payload)
}

func (o *V2ResetHostValidationConflict) String() string {
	return fmt.Sprintf("[PATCH /v2/infra-envs/{infra_env_id}/hosts/{host_id}/actions/reset-validation/{validation_id}][%d] v2ResetHostValidationConflict  %+v", 409, o.Payload)
}

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

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

// NewV2ResetHostValidationInternalServerError creates a V2ResetHostValidationInternalServerError with default headers values
func NewV2ResetHostValidationInternalServerError() *V2ResetHostValidationInternalServerError {
	return &V2ResetHostValidationInternalServerError{}
}

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

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

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

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

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

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

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

func (o *V2ResetHostValidationInternalServerError) Error() string {
	return fmt.Sprintf("[PATCH /v2/infra-envs/{infra_env_id}/hosts/{host_id}/actions/reset-validation/{validation_id}][%d] v2ResetHostValidationInternalServerError  %+v", 500, o.Payload)
}

func (o *V2ResetHostValidationInternalServerError) String() string {
	return fmt.Sprintf("[PATCH /v2/infra-envs/{infra_env_id}/hosts/{host_id}/actions/reset-validation/{validation_id}][%d] v2ResetHostValidationInternalServerError  %+v", 500, o.Payload)
}

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

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