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

// GetClusterSupportedPlatformsReader is a Reader for the GetClusterSupportedPlatforms structure.
type GetClusterSupportedPlatformsReader struct {
	formats strfmt.Registry
}

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

// NewGetClusterSupportedPlatformsOK creates a GetClusterSupportedPlatformsOK with default headers values
func NewGetClusterSupportedPlatformsOK() *GetClusterSupportedPlatformsOK {
	return &GetClusterSupportedPlatformsOK{}
}

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

Success.
*/
type GetClusterSupportedPlatformsOK struct {
	Payload []models.PlatformType
}

// IsSuccess returns true when this get cluster supported platforms o k response has a 2xx status code
func (o *GetClusterSupportedPlatformsOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this get cluster supported platforms o k response has a 3xx status code
func (o *GetClusterSupportedPlatformsOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get cluster supported platforms o k response has a 4xx status code
func (o *GetClusterSupportedPlatformsOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this get cluster supported platforms o k response has a 5xx status code
func (o *GetClusterSupportedPlatformsOK) IsServerError() bool {
	return false
}

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

func (o *GetClusterSupportedPlatformsOK) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/supported-platforms][%d] getClusterSupportedPlatformsOK  %+v", 200, o.Payload)
}

func (o *GetClusterSupportedPlatformsOK) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/supported-platforms][%d] getClusterSupportedPlatformsOK  %+v", 200, o.Payload)
}

func (o *GetClusterSupportedPlatformsOK) GetPayload() []models.PlatformType {
	return o.Payload
}

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

// NewGetClusterSupportedPlatformsUnauthorized creates a GetClusterSupportedPlatformsUnauthorized with default headers values
func NewGetClusterSupportedPlatformsUnauthorized() *GetClusterSupportedPlatformsUnauthorized {
	return &GetClusterSupportedPlatformsUnauthorized{}
}

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

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

// IsSuccess returns true when this get cluster supported platforms unauthorized response has a 2xx status code
func (o *GetClusterSupportedPlatformsUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get cluster supported platforms unauthorized response has a 3xx status code
func (o *GetClusterSupportedPlatformsUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get cluster supported platforms unauthorized response has a 4xx status code
func (o *GetClusterSupportedPlatformsUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this get cluster supported platforms unauthorized response has a 5xx status code
func (o *GetClusterSupportedPlatformsUnauthorized) IsServerError() bool {
	return false
}

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

func (o *GetClusterSupportedPlatformsUnauthorized) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/supported-platforms][%d] getClusterSupportedPlatformsUnauthorized  %+v", 401, o.Payload)
}

func (o *GetClusterSupportedPlatformsUnauthorized) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/supported-platforms][%d] getClusterSupportedPlatformsUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewGetClusterSupportedPlatformsForbidden creates a GetClusterSupportedPlatformsForbidden with default headers values
func NewGetClusterSupportedPlatformsForbidden() *GetClusterSupportedPlatformsForbidden {
	return &GetClusterSupportedPlatformsForbidden{}
}

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

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

// IsSuccess returns true when this get cluster supported platforms forbidden response has a 2xx status code
func (o *GetClusterSupportedPlatformsForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get cluster supported platforms forbidden response has a 3xx status code
func (o *GetClusterSupportedPlatformsForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get cluster supported platforms forbidden response has a 4xx status code
func (o *GetClusterSupportedPlatformsForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this get cluster supported platforms forbidden response has a 5xx status code
func (o *GetClusterSupportedPlatformsForbidden) IsServerError() bool {
	return false
}

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

func (o *GetClusterSupportedPlatformsForbidden) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/supported-platforms][%d] getClusterSupportedPlatformsForbidden  %+v", 403, o.Payload)
}

func (o *GetClusterSupportedPlatformsForbidden) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/supported-platforms][%d] getClusterSupportedPlatformsForbidden  %+v", 403, o.Payload)
}

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

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

// NewGetClusterSupportedPlatformsNotFound creates a GetClusterSupportedPlatformsNotFound with default headers values
func NewGetClusterSupportedPlatformsNotFound() *GetClusterSupportedPlatformsNotFound {
	return &GetClusterSupportedPlatformsNotFound{}
}

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

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

// IsSuccess returns true when this get cluster supported platforms not found response has a 2xx status code
func (o *GetClusterSupportedPlatformsNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get cluster supported platforms not found response has a 3xx status code
func (o *GetClusterSupportedPlatformsNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get cluster supported platforms not found response has a 4xx status code
func (o *GetClusterSupportedPlatformsNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this get cluster supported platforms not found response has a 5xx status code
func (o *GetClusterSupportedPlatformsNotFound) IsServerError() bool {
	return false
}

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

func (o *GetClusterSupportedPlatformsNotFound) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/supported-platforms][%d] getClusterSupportedPlatformsNotFound  %+v", 404, o.Payload)
}

func (o *GetClusterSupportedPlatformsNotFound) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/supported-platforms][%d] getClusterSupportedPlatformsNotFound  %+v", 404, o.Payload)
}

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

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

// NewGetClusterSupportedPlatformsInternalServerError creates a GetClusterSupportedPlatformsInternalServerError with default headers values
func NewGetClusterSupportedPlatformsInternalServerError() *GetClusterSupportedPlatformsInternalServerError {
	return &GetClusterSupportedPlatformsInternalServerError{}
}

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

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

// IsSuccess returns true when this get cluster supported platforms internal server error response has a 2xx status code
func (o *GetClusterSupportedPlatformsInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get cluster supported platforms internal server error response has a 3xx status code
func (o *GetClusterSupportedPlatformsInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get cluster supported platforms internal server error response has a 4xx status code
func (o *GetClusterSupportedPlatformsInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this get cluster supported platforms internal server error response has a 5xx status code
func (o *GetClusterSupportedPlatformsInternalServerError) IsServerError() bool {
	return true
}

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

func (o *GetClusterSupportedPlatformsInternalServerError) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/supported-platforms][%d] getClusterSupportedPlatformsInternalServerError  %+v", 500, o.Payload)
}

func (o *GetClusterSupportedPlatformsInternalServerError) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/supported-platforms][%d] getClusterSupportedPlatformsInternalServerError  %+v", 500, o.Payload)
}

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

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