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

// GetInfraEnvReader is a Reader for the GetInfraEnv structure.
type GetInfraEnvReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetInfraEnvReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetInfraEnvOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetInfraEnvUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetInfraEnvForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetInfraEnvNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 405:
		result := NewGetInfraEnvMethodNotAllowed()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetInfraEnvInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 501:
		result := NewGetInfraEnvNotImplemented()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewGetInfraEnvServiceUnavailable()
		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())
	}
}

// NewGetInfraEnvOK creates a GetInfraEnvOK with default headers values
func NewGetInfraEnvOK() *GetInfraEnvOK {
	return &GetInfraEnvOK{}
}

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

Success.
*/
type GetInfraEnvOK struct {
	Payload *models.InfraEnv
}

// IsSuccess returns true when this get infra env o k response has a 2xx status code
func (o *GetInfraEnvOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this get infra env o k response has a 3xx status code
func (o *GetInfraEnvOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get infra env o k response has a 4xx status code
func (o *GetInfraEnvOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this get infra env o k response has a 5xx status code
func (o *GetInfraEnvOK) IsServerError() bool {
	return false
}

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

func (o *GetInfraEnvOK) Error() string {
	return fmt.Sprintf("[GET /v2/infra-envs/{infra_env_id}][%d] getInfraEnvOK  %+v", 200, o.Payload)
}

func (o *GetInfraEnvOK) String() string {
	return fmt.Sprintf("[GET /v2/infra-envs/{infra_env_id}][%d] getInfraEnvOK  %+v", 200, o.Payload)
}

func (o *GetInfraEnvOK) GetPayload() *models.InfraEnv {
	return o.Payload
}

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

	o.Payload = new(models.InfraEnv)

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

	return nil
}

// NewGetInfraEnvUnauthorized creates a GetInfraEnvUnauthorized with default headers values
func NewGetInfraEnvUnauthorized() *GetInfraEnvUnauthorized {
	return &GetInfraEnvUnauthorized{}
}

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

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

// IsSuccess returns true when this get infra env unauthorized response has a 2xx status code
func (o *GetInfraEnvUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get infra env unauthorized response has a 3xx status code
func (o *GetInfraEnvUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get infra env unauthorized response has a 4xx status code
func (o *GetInfraEnvUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this get infra env unauthorized response has a 5xx status code
func (o *GetInfraEnvUnauthorized) IsServerError() bool {
	return false
}

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

func (o *GetInfraEnvUnauthorized) Error() string {
	return fmt.Sprintf("[GET /v2/infra-envs/{infra_env_id}][%d] getInfraEnvUnauthorized  %+v", 401, o.Payload)
}

func (o *GetInfraEnvUnauthorized) String() string {
	return fmt.Sprintf("[GET /v2/infra-envs/{infra_env_id}][%d] getInfraEnvUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewGetInfraEnvForbidden creates a GetInfraEnvForbidden with default headers values
func NewGetInfraEnvForbidden() *GetInfraEnvForbidden {
	return &GetInfraEnvForbidden{}
}

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

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

// IsSuccess returns true when this get infra env forbidden response has a 2xx status code
func (o *GetInfraEnvForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get infra env forbidden response has a 3xx status code
func (o *GetInfraEnvForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get infra env forbidden response has a 4xx status code
func (o *GetInfraEnvForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this get infra env forbidden response has a 5xx status code
func (o *GetInfraEnvForbidden) IsServerError() bool {
	return false
}

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

func (o *GetInfraEnvForbidden) Error() string {
	return fmt.Sprintf("[GET /v2/infra-envs/{infra_env_id}][%d] getInfraEnvForbidden  %+v", 403, o.Payload)
}

func (o *GetInfraEnvForbidden) String() string {
	return fmt.Sprintf("[GET /v2/infra-envs/{infra_env_id}][%d] getInfraEnvForbidden  %+v", 403, o.Payload)
}

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

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

// NewGetInfraEnvNotFound creates a GetInfraEnvNotFound with default headers values
func NewGetInfraEnvNotFound() *GetInfraEnvNotFound {
	return &GetInfraEnvNotFound{}
}

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

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

// IsSuccess returns true when this get infra env not found response has a 2xx status code
func (o *GetInfraEnvNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get infra env not found response has a 3xx status code
func (o *GetInfraEnvNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get infra env not found response has a 4xx status code
func (o *GetInfraEnvNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this get infra env not found response has a 5xx status code
func (o *GetInfraEnvNotFound) IsServerError() bool {
	return false
}

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

func (o *GetInfraEnvNotFound) Error() string {
	return fmt.Sprintf("[GET /v2/infra-envs/{infra_env_id}][%d] getInfraEnvNotFound  %+v", 404, o.Payload)
}

func (o *GetInfraEnvNotFound) String() string {
	return fmt.Sprintf("[GET /v2/infra-envs/{infra_env_id}][%d] getInfraEnvNotFound  %+v", 404, o.Payload)
}

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

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

// NewGetInfraEnvMethodNotAllowed creates a GetInfraEnvMethodNotAllowed with default headers values
func NewGetInfraEnvMethodNotAllowed() *GetInfraEnvMethodNotAllowed {
	return &GetInfraEnvMethodNotAllowed{}
}

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

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

// IsSuccess returns true when this get infra env method not allowed response has a 2xx status code
func (o *GetInfraEnvMethodNotAllowed) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get infra env method not allowed response has a 3xx status code
func (o *GetInfraEnvMethodNotAllowed) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get infra env method not allowed response has a 4xx status code
func (o *GetInfraEnvMethodNotAllowed) IsClientError() bool {
	return true
}

// IsServerError returns true when this get infra env method not allowed response has a 5xx status code
func (o *GetInfraEnvMethodNotAllowed) IsServerError() bool {
	return false
}

// IsCode returns true when this get infra env method not allowed response a status code equal to that given
func (o *GetInfraEnvMethodNotAllowed) IsCode(code int) bool {
	return code == 405
}

func (o *GetInfraEnvMethodNotAllowed) Error() string {
	return fmt.Sprintf("[GET /v2/infra-envs/{infra_env_id}][%d] getInfraEnvMethodNotAllowed  %+v", 405, o.Payload)
}

func (o *GetInfraEnvMethodNotAllowed) String() string {
	return fmt.Sprintf("[GET /v2/infra-envs/{infra_env_id}][%d] getInfraEnvMethodNotAllowed  %+v", 405, o.Payload)
}

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

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

// NewGetInfraEnvInternalServerError creates a GetInfraEnvInternalServerError with default headers values
func NewGetInfraEnvInternalServerError() *GetInfraEnvInternalServerError {
	return &GetInfraEnvInternalServerError{}
}

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

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

// IsSuccess returns true when this get infra env internal server error response has a 2xx status code
func (o *GetInfraEnvInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get infra env internal server error response has a 3xx status code
func (o *GetInfraEnvInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get infra env internal server error response has a 4xx status code
func (o *GetInfraEnvInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this get infra env internal server error response has a 5xx status code
func (o *GetInfraEnvInternalServerError) IsServerError() bool {
	return true
}

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

func (o *GetInfraEnvInternalServerError) Error() string {
	return fmt.Sprintf("[GET /v2/infra-envs/{infra_env_id}][%d] getInfraEnvInternalServerError  %+v", 500, o.Payload)
}

func (o *GetInfraEnvInternalServerError) String() string {
	return fmt.Sprintf("[GET /v2/infra-envs/{infra_env_id}][%d] getInfraEnvInternalServerError  %+v", 500, o.Payload)
}

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

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

// NewGetInfraEnvNotImplemented creates a GetInfraEnvNotImplemented with default headers values
func NewGetInfraEnvNotImplemented() *GetInfraEnvNotImplemented {
	return &GetInfraEnvNotImplemented{}
}

/*
GetInfraEnvNotImplemented describes a response with status code 501, with default header values.

Not implemented.
*/
type GetInfraEnvNotImplemented struct {
	Payload *models.Error
}

// IsSuccess returns true when this get infra env not implemented response has a 2xx status code
func (o *GetInfraEnvNotImplemented) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get infra env not implemented response has a 3xx status code
func (o *GetInfraEnvNotImplemented) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get infra env not implemented response has a 4xx status code
func (o *GetInfraEnvNotImplemented) IsClientError() bool {
	return false
}

// IsServerError returns true when this get infra env not implemented response has a 5xx status code
func (o *GetInfraEnvNotImplemented) IsServerError() bool {
	return true
}

// IsCode returns true when this get infra env not implemented response a status code equal to that given
func (o *GetInfraEnvNotImplemented) IsCode(code int) bool {
	return code == 501
}

func (o *GetInfraEnvNotImplemented) Error() string {
	return fmt.Sprintf("[GET /v2/infra-envs/{infra_env_id}][%d] getInfraEnvNotImplemented  %+v", 501, o.Payload)
}

func (o *GetInfraEnvNotImplemented) String() string {
	return fmt.Sprintf("[GET /v2/infra-envs/{infra_env_id}][%d] getInfraEnvNotImplemented  %+v", 501, o.Payload)
}

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

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

// NewGetInfraEnvServiceUnavailable creates a GetInfraEnvServiceUnavailable with default headers values
func NewGetInfraEnvServiceUnavailable() *GetInfraEnvServiceUnavailable {
	return &GetInfraEnvServiceUnavailable{}
}

/*
GetInfraEnvServiceUnavailable describes a response with status code 503, with default header values.

Unavailable.
*/
type GetInfraEnvServiceUnavailable struct {
	Payload *models.Error
}

// IsSuccess returns true when this get infra env service unavailable response has a 2xx status code
func (o *GetInfraEnvServiceUnavailable) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get infra env service unavailable response has a 3xx status code
func (o *GetInfraEnvServiceUnavailable) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get infra env service unavailable response has a 4xx status code
func (o *GetInfraEnvServiceUnavailable) IsClientError() bool {
	return false
}

// IsServerError returns true when this get infra env service unavailable response has a 5xx status code
func (o *GetInfraEnvServiceUnavailable) IsServerError() bool {
	return true
}

// IsCode returns true when this get infra env service unavailable response a status code equal to that given
func (o *GetInfraEnvServiceUnavailable) IsCode(code int) bool {
	return code == 503
}

func (o *GetInfraEnvServiceUnavailable) Error() string {
	return fmt.Sprintf("[GET /v2/infra-envs/{infra_env_id}][%d] getInfraEnvServiceUnavailable  %+v", 503, o.Payload)
}

func (o *GetInfraEnvServiceUnavailable) String() string {
	return fmt.Sprintf("[GET /v2/infra-envs/{infra_env_id}][%d] getInfraEnvServiceUnavailable  %+v", 503, o.Payload)
}

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

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