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

// ListClusterHostsReader is a Reader for the ListClusterHosts structure.
type ListClusterHostsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *ListClusterHostsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewListClusterHostsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewListClusterHostsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewListClusterHostsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewListClusterHostsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewListClusterHostsInternalServerError()
		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())
	}
}

// NewListClusterHostsOK creates a ListClusterHostsOK with default headers values
func NewListClusterHostsOK() *ListClusterHostsOK {
	return &ListClusterHostsOK{}
}

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

Success.
*/
type ListClusterHostsOK struct {
	Payload models.HostList
}

// IsSuccess returns true when this list cluster hosts o k response has a 2xx status code
func (o *ListClusterHostsOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this list cluster hosts o k response has a 3xx status code
func (o *ListClusterHostsOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this list cluster hosts o k response has a 4xx status code
func (o *ListClusterHostsOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this list cluster hosts o k response has a 5xx status code
func (o *ListClusterHostsOK) IsServerError() bool {
	return false
}

// IsCode returns true when this list cluster hosts o k response a status code equal to that given
func (o *ListClusterHostsOK) IsCode(code int) bool {
	return code == 200
}

func (o *ListClusterHostsOK) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/hosts][%d] listClusterHostsOK  %+v", 200, o.Payload)
}

func (o *ListClusterHostsOK) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/hosts][%d] listClusterHostsOK  %+v", 200, o.Payload)
}

func (o *ListClusterHostsOK) GetPayload() models.HostList {
	return o.Payload
}

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

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

	return nil
}

// NewListClusterHostsUnauthorized creates a ListClusterHostsUnauthorized with default headers values
func NewListClusterHostsUnauthorized() *ListClusterHostsUnauthorized {
	return &ListClusterHostsUnauthorized{}
}

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

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

// IsSuccess returns true when this list cluster hosts unauthorized response has a 2xx status code
func (o *ListClusterHostsUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this list cluster hosts unauthorized response has a 3xx status code
func (o *ListClusterHostsUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this list cluster hosts unauthorized response has a 4xx status code
func (o *ListClusterHostsUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this list cluster hosts unauthorized response has a 5xx status code
func (o *ListClusterHostsUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this list cluster hosts unauthorized response a status code equal to that given
func (o *ListClusterHostsUnauthorized) IsCode(code int) bool {
	return code == 401
}

func (o *ListClusterHostsUnauthorized) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/hosts][%d] listClusterHostsUnauthorized  %+v", 401, o.Payload)
}

func (o *ListClusterHostsUnauthorized) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/hosts][%d] listClusterHostsUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewListClusterHostsForbidden creates a ListClusterHostsForbidden with default headers values
func NewListClusterHostsForbidden() *ListClusterHostsForbidden {
	return &ListClusterHostsForbidden{}
}

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

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

// IsSuccess returns true when this list cluster hosts forbidden response has a 2xx status code
func (o *ListClusterHostsForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this list cluster hosts forbidden response has a 3xx status code
func (o *ListClusterHostsForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this list cluster hosts forbidden response has a 4xx status code
func (o *ListClusterHostsForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this list cluster hosts forbidden response has a 5xx status code
func (o *ListClusterHostsForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this list cluster hosts forbidden response a status code equal to that given
func (o *ListClusterHostsForbidden) IsCode(code int) bool {
	return code == 403
}

func (o *ListClusterHostsForbidden) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/hosts][%d] listClusterHostsForbidden  %+v", 403, o.Payload)
}

func (o *ListClusterHostsForbidden) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/hosts][%d] listClusterHostsForbidden  %+v", 403, o.Payload)
}

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

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

// NewListClusterHostsNotFound creates a ListClusterHostsNotFound with default headers values
func NewListClusterHostsNotFound() *ListClusterHostsNotFound {
	return &ListClusterHostsNotFound{}
}

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

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

// IsSuccess returns true when this list cluster hosts not found response has a 2xx status code
func (o *ListClusterHostsNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this list cluster hosts not found response has a 3xx status code
func (o *ListClusterHostsNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this list cluster hosts not found response has a 4xx status code
func (o *ListClusterHostsNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this list cluster hosts not found response has a 5xx status code
func (o *ListClusterHostsNotFound) IsServerError() bool {
	return false
}

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

func (o *ListClusterHostsNotFound) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/hosts][%d] listClusterHostsNotFound  %+v", 404, o.Payload)
}

func (o *ListClusterHostsNotFound) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/hosts][%d] listClusterHostsNotFound  %+v", 404, o.Payload)
}

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

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

// NewListClusterHostsInternalServerError creates a ListClusterHostsInternalServerError with default headers values
func NewListClusterHostsInternalServerError() *ListClusterHostsInternalServerError {
	return &ListClusterHostsInternalServerError{}
}

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

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

// IsSuccess returns true when this list cluster hosts internal server error response has a 2xx status code
func (o *ListClusterHostsInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this list cluster hosts internal server error response has a 3xx status code
func (o *ListClusterHostsInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this list cluster hosts internal server error response has a 4xx status code
func (o *ListClusterHostsInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this list cluster hosts internal server error response has a 5xx status code
func (o *ListClusterHostsInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this list cluster hosts internal server error response a status code equal to that given
func (o *ListClusterHostsInternalServerError) IsCode(code int) bool {
	return code == 500
}

func (o *ListClusterHostsInternalServerError) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/hosts][%d] listClusterHostsInternalServerError  %+v", 500, o.Payload)
}

func (o *ListClusterHostsInternalServerError) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/hosts][%d] listClusterHostsInternalServerError  %+v", 500, o.Payload)
}

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

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