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

// TransformClusterToAddingHostsReader is a Reader for the TransformClusterToAddingHosts structure.
type TransformClusterToAddingHostsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *TransformClusterToAddingHostsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 202:
		result := NewTransformClusterToAddingHostsAccepted()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewTransformClusterToAddingHostsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewTransformClusterToAddingHostsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewTransformClusterToAddingHostsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 405:
		result := NewTransformClusterToAddingHostsMethodNotAllowed()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 409:
		result := NewTransformClusterToAddingHostsConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewTransformClusterToAddingHostsInternalServerError()
		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())
	}
}

// NewTransformClusterToAddingHostsAccepted creates a TransformClusterToAddingHostsAccepted with default headers values
func NewTransformClusterToAddingHostsAccepted() *TransformClusterToAddingHostsAccepted {
	return &TransformClusterToAddingHostsAccepted{}
}

/*
TransformClusterToAddingHostsAccepted describes a response with status code 202, with default header values.

Success.
*/
type TransformClusterToAddingHostsAccepted struct {
	Payload *models.Cluster
}

// IsSuccess returns true when this transform cluster to adding hosts accepted response has a 2xx status code
func (o *TransformClusterToAddingHostsAccepted) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this transform cluster to adding hosts accepted response has a 3xx status code
func (o *TransformClusterToAddingHostsAccepted) IsRedirect() bool {
	return false
}

// IsClientError returns true when this transform cluster to adding hosts accepted response has a 4xx status code
func (o *TransformClusterToAddingHostsAccepted) IsClientError() bool {
	return false
}

// IsServerError returns true when this transform cluster to adding hosts accepted response has a 5xx status code
func (o *TransformClusterToAddingHostsAccepted) IsServerError() bool {
	return false
}

// IsCode returns true when this transform cluster to adding hosts accepted response a status code equal to that given
func (o *TransformClusterToAddingHostsAccepted) IsCode(code int) bool {
	return code == 202
}

func (o *TransformClusterToAddingHostsAccepted) Error() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/allow-add-hosts][%d] transformClusterToAddingHostsAccepted  %+v", 202, o.Payload)
}

func (o *TransformClusterToAddingHostsAccepted) String() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/allow-add-hosts][%d] transformClusterToAddingHostsAccepted  %+v", 202, o.Payload)
}

func (o *TransformClusterToAddingHostsAccepted) GetPayload() *models.Cluster {
	return o.Payload
}

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

	o.Payload = new(models.Cluster)

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

	return nil
}

// NewTransformClusterToAddingHostsUnauthorized creates a TransformClusterToAddingHostsUnauthorized with default headers values
func NewTransformClusterToAddingHostsUnauthorized() *TransformClusterToAddingHostsUnauthorized {
	return &TransformClusterToAddingHostsUnauthorized{}
}

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

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

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

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

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

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

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

func (o *TransformClusterToAddingHostsUnauthorized) Error() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/allow-add-hosts][%d] transformClusterToAddingHostsUnauthorized  %+v", 401, o.Payload)
}

func (o *TransformClusterToAddingHostsUnauthorized) String() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/allow-add-hosts][%d] transformClusterToAddingHostsUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewTransformClusterToAddingHostsForbidden creates a TransformClusterToAddingHostsForbidden with default headers values
func NewTransformClusterToAddingHostsForbidden() *TransformClusterToAddingHostsForbidden {
	return &TransformClusterToAddingHostsForbidden{}
}

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

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

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

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

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

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

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

func (o *TransformClusterToAddingHostsForbidden) Error() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/allow-add-hosts][%d] transformClusterToAddingHostsForbidden  %+v", 403, o.Payload)
}

func (o *TransformClusterToAddingHostsForbidden) String() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/allow-add-hosts][%d] transformClusterToAddingHostsForbidden  %+v", 403, o.Payload)
}

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

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

// NewTransformClusterToAddingHostsNotFound creates a TransformClusterToAddingHostsNotFound with default headers values
func NewTransformClusterToAddingHostsNotFound() *TransformClusterToAddingHostsNotFound {
	return &TransformClusterToAddingHostsNotFound{}
}

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

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

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

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

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

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

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

func (o *TransformClusterToAddingHostsNotFound) Error() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/allow-add-hosts][%d] transformClusterToAddingHostsNotFound  %+v", 404, o.Payload)
}

func (o *TransformClusterToAddingHostsNotFound) String() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/allow-add-hosts][%d] transformClusterToAddingHostsNotFound  %+v", 404, o.Payload)
}

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

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

// NewTransformClusterToAddingHostsMethodNotAllowed creates a TransformClusterToAddingHostsMethodNotAllowed with default headers values
func NewTransformClusterToAddingHostsMethodNotAllowed() *TransformClusterToAddingHostsMethodNotAllowed {
	return &TransformClusterToAddingHostsMethodNotAllowed{}
}

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

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

// IsSuccess returns true when this transform cluster to adding hosts method not allowed response has a 2xx status code
func (o *TransformClusterToAddingHostsMethodNotAllowed) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this transform cluster to adding hosts method not allowed response has a 3xx status code
func (o *TransformClusterToAddingHostsMethodNotAllowed) IsRedirect() bool {
	return false
}

// IsClientError returns true when this transform cluster to adding hosts method not allowed response has a 4xx status code
func (o *TransformClusterToAddingHostsMethodNotAllowed) IsClientError() bool {
	return true
}

// IsServerError returns true when this transform cluster to adding hosts method not allowed response has a 5xx status code
func (o *TransformClusterToAddingHostsMethodNotAllowed) IsServerError() bool {
	return false
}

// IsCode returns true when this transform cluster to adding hosts method not allowed response a status code equal to that given
func (o *TransformClusterToAddingHostsMethodNotAllowed) IsCode(code int) bool {
	return code == 405
}

func (o *TransformClusterToAddingHostsMethodNotAllowed) Error() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/allow-add-hosts][%d] transformClusterToAddingHostsMethodNotAllowed  %+v", 405, o.Payload)
}

func (o *TransformClusterToAddingHostsMethodNotAllowed) String() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/allow-add-hosts][%d] transformClusterToAddingHostsMethodNotAllowed  %+v", 405, o.Payload)
}

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

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

// NewTransformClusterToAddingHostsConflict creates a TransformClusterToAddingHostsConflict with default headers values
func NewTransformClusterToAddingHostsConflict() *TransformClusterToAddingHostsConflict {
	return &TransformClusterToAddingHostsConflict{}
}

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

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

// IsSuccess returns true when this transform cluster to adding hosts conflict response has a 2xx status code
func (o *TransformClusterToAddingHostsConflict) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this transform cluster to adding hosts conflict response has a 3xx status code
func (o *TransformClusterToAddingHostsConflict) IsRedirect() bool {
	return false
}

// IsClientError returns true when this transform cluster to adding hosts conflict response has a 4xx status code
func (o *TransformClusterToAddingHostsConflict) IsClientError() bool {
	return true
}

// IsServerError returns true when this transform cluster to adding hosts conflict response has a 5xx status code
func (o *TransformClusterToAddingHostsConflict) IsServerError() bool {
	return false
}

// IsCode returns true when this transform cluster to adding hosts conflict response a status code equal to that given
func (o *TransformClusterToAddingHostsConflict) IsCode(code int) bool {
	return code == 409
}

func (o *TransformClusterToAddingHostsConflict) Error() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/allow-add-hosts][%d] transformClusterToAddingHostsConflict  %+v", 409, o.Payload)
}

func (o *TransformClusterToAddingHostsConflict) String() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/allow-add-hosts][%d] transformClusterToAddingHostsConflict  %+v", 409, o.Payload)
}

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

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

// NewTransformClusterToAddingHostsInternalServerError creates a TransformClusterToAddingHostsInternalServerError with default headers values
func NewTransformClusterToAddingHostsInternalServerError() *TransformClusterToAddingHostsInternalServerError {
	return &TransformClusterToAddingHostsInternalServerError{}
}

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

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

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

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

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

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

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

func (o *TransformClusterToAddingHostsInternalServerError) Error() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/allow-add-hosts][%d] transformClusterToAddingHostsInternalServerError  %+v", 500, o.Payload)
}

func (o *TransformClusterToAddingHostsInternalServerError) String() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/allow-add-hosts][%d] transformClusterToAddingHostsInternalServerError  %+v", 500, o.Payload)
}

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

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