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

// UpdateInfraEnvReader is a Reader for the UpdateInfraEnv structure.
type UpdateInfraEnvReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *UpdateInfraEnvReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 201:
		result := NewUpdateInfraEnvCreated()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewUpdateInfraEnvBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewUpdateInfraEnvUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewUpdateInfraEnvForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewUpdateInfraEnvNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 405:
		result := NewUpdateInfraEnvMethodNotAllowed()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 409:
		result := NewUpdateInfraEnvConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewUpdateInfraEnvInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 501:
		result := NewUpdateInfraEnvNotImplemented()
		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())
	}
}

// NewUpdateInfraEnvCreated creates a UpdateInfraEnvCreated with default headers values
func NewUpdateInfraEnvCreated() *UpdateInfraEnvCreated {
	return &UpdateInfraEnvCreated{}
}

/*
UpdateInfraEnvCreated describes a response with status code 201, with default header values.

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

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

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

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

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

// IsCode returns true when this update infra env created response a status code equal to that given
func (o *UpdateInfraEnvCreated) IsCode(code int) bool {
	return code == 201
}

func (o *UpdateInfraEnvCreated) Error() string {
	return fmt.Sprintf("[PATCH /v2/infra-envs/{infra_env_id}][%d] updateInfraEnvCreated  %+v", 201, o.Payload)
}

func (o *UpdateInfraEnvCreated) String() string {
	return fmt.Sprintf("[PATCH /v2/infra-envs/{infra_env_id}][%d] updateInfraEnvCreated  %+v", 201, o.Payload)
}

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

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

// NewUpdateInfraEnvBadRequest creates a UpdateInfraEnvBadRequest with default headers values
func NewUpdateInfraEnvBadRequest() *UpdateInfraEnvBadRequest {
	return &UpdateInfraEnvBadRequest{}
}

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

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

// IsSuccess returns true when this update infra env bad request response has a 2xx status code
func (o *UpdateInfraEnvBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this update infra env bad request response has a 3xx status code
func (o *UpdateInfraEnvBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update infra env bad request response has a 4xx status code
func (o *UpdateInfraEnvBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this update infra env bad request response has a 5xx status code
func (o *UpdateInfraEnvBadRequest) IsServerError() bool {
	return false
}

// IsCode returns true when this update infra env bad request response a status code equal to that given
func (o *UpdateInfraEnvBadRequest) IsCode(code int) bool {
	return code == 400
}

func (o *UpdateInfraEnvBadRequest) Error() string {
	return fmt.Sprintf("[PATCH /v2/infra-envs/{infra_env_id}][%d] updateInfraEnvBadRequest  %+v", 400, o.Payload)
}

func (o *UpdateInfraEnvBadRequest) String() string {
	return fmt.Sprintf("[PATCH /v2/infra-envs/{infra_env_id}][%d] updateInfraEnvBadRequest  %+v", 400, o.Payload)
}

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

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

// NewUpdateInfraEnvUnauthorized creates a UpdateInfraEnvUnauthorized with default headers values
func NewUpdateInfraEnvUnauthorized() *UpdateInfraEnvUnauthorized {
	return &UpdateInfraEnvUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewUpdateInfraEnvForbidden creates a UpdateInfraEnvForbidden with default headers values
func NewUpdateInfraEnvForbidden() *UpdateInfraEnvForbidden {
	return &UpdateInfraEnvForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewUpdateInfraEnvNotFound creates a UpdateInfraEnvNotFound with default headers values
func NewUpdateInfraEnvNotFound() *UpdateInfraEnvNotFound {
	return &UpdateInfraEnvNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewUpdateInfraEnvMethodNotAllowed creates a UpdateInfraEnvMethodNotAllowed with default headers values
func NewUpdateInfraEnvMethodNotAllowed() *UpdateInfraEnvMethodNotAllowed {
	return &UpdateInfraEnvMethodNotAllowed{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewUpdateInfraEnvConflict creates a UpdateInfraEnvConflict with default headers values
func NewUpdateInfraEnvConflict() *UpdateInfraEnvConflict {
	return &UpdateInfraEnvConflict{}
}

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

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

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

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

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

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

// IsCode returns true when this update infra env conflict response a status code equal to that given
func (o *UpdateInfraEnvConflict) IsCode(code int) bool {
	return code == 409
}

func (o *UpdateInfraEnvConflict) Error() string {
	return fmt.Sprintf("[PATCH /v2/infra-envs/{infra_env_id}][%d] updateInfraEnvConflict  %+v", 409, o.Payload)
}

func (o *UpdateInfraEnvConflict) String() string {
	return fmt.Sprintf("[PATCH /v2/infra-envs/{infra_env_id}][%d] updateInfraEnvConflict  %+v", 409, o.Payload)
}

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

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

// NewUpdateInfraEnvInternalServerError creates a UpdateInfraEnvInternalServerError with default headers values
func NewUpdateInfraEnvInternalServerError() *UpdateInfraEnvInternalServerError {
	return &UpdateInfraEnvInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewUpdateInfraEnvNotImplemented creates a UpdateInfraEnvNotImplemented with default headers values
func NewUpdateInfraEnvNotImplemented() *UpdateInfraEnvNotImplemented {
	return &UpdateInfraEnvNotImplemented{}
}

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

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

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

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

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

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

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

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

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

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

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