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

// RegisterInfraEnvReader is a Reader for the RegisterInfraEnv structure.
type RegisterInfraEnvReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *RegisterInfraEnvReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 201:
		result := NewRegisterInfraEnvCreated()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewRegisterInfraEnvBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewRegisterInfraEnvUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewRegisterInfraEnvForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewRegisterInfraEnvNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 405:
		result := NewRegisterInfraEnvMethodNotAllowed()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 409:
		result := NewRegisterInfraEnvConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewRegisterInfraEnvInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 501:
		result := NewRegisterInfraEnvNotImplemented()
		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())
	}
}

// NewRegisterInfraEnvCreated creates a RegisterInfraEnvCreated with default headers values
func NewRegisterInfraEnvCreated() *RegisterInfraEnvCreated {
	return &RegisterInfraEnvCreated{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewRegisterInfraEnvBadRequest creates a RegisterInfraEnvBadRequest with default headers values
func NewRegisterInfraEnvBadRequest() *RegisterInfraEnvBadRequest {
	return &RegisterInfraEnvBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewRegisterInfraEnvUnauthorized creates a RegisterInfraEnvUnauthorized with default headers values
func NewRegisterInfraEnvUnauthorized() *RegisterInfraEnvUnauthorized {
	return &RegisterInfraEnvUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewRegisterInfraEnvForbidden creates a RegisterInfraEnvForbidden with default headers values
func NewRegisterInfraEnvForbidden() *RegisterInfraEnvForbidden {
	return &RegisterInfraEnvForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewRegisterInfraEnvNotFound creates a RegisterInfraEnvNotFound with default headers values
func NewRegisterInfraEnvNotFound() *RegisterInfraEnvNotFound {
	return &RegisterInfraEnvNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewRegisterInfraEnvMethodNotAllowed creates a RegisterInfraEnvMethodNotAllowed with default headers values
func NewRegisterInfraEnvMethodNotAllowed() *RegisterInfraEnvMethodNotAllowed {
	return &RegisterInfraEnvMethodNotAllowed{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewRegisterInfraEnvConflict creates a RegisterInfraEnvConflict with default headers values
func NewRegisterInfraEnvConflict() *RegisterInfraEnvConflict {
	return &RegisterInfraEnvConflict{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewRegisterInfraEnvInternalServerError creates a RegisterInfraEnvInternalServerError with default headers values
func NewRegisterInfraEnvInternalServerError() *RegisterInfraEnvInternalServerError {
	return &RegisterInfraEnvInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewRegisterInfraEnvNotImplemented creates a RegisterInfraEnvNotImplemented with default headers values
func NewRegisterInfraEnvNotImplemented() *RegisterInfraEnvNotImplemented {
	return &RegisterInfraEnvNotImplemented{}
}

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

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

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

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

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

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

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

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

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

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

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