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

// DownloadMinimalInitrdReader is a Reader for the DownloadMinimalInitrd structure.
type DownloadMinimalInitrdReader struct {
	formats strfmt.Registry
	writer  io.Writer
}

// ReadResponse reads a server response into the received o.
func (o *DownloadMinimalInitrdReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewDownloadMinimalInitrdOK(o.writer)
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 204:
		result := NewDownloadMinimalInitrdNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewDownloadMinimalInitrdUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewDownloadMinimalInitrdForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewDownloadMinimalInitrdNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 405:
		result := NewDownloadMinimalInitrdMethodNotAllowed()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 409:
		result := NewDownloadMinimalInitrdConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewDownloadMinimalInitrdInternalServerError()
		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())
	}
}

// NewDownloadMinimalInitrdOK creates a DownloadMinimalInitrdOK with default headers values
func NewDownloadMinimalInitrdOK(writer io.Writer) *DownloadMinimalInitrdOK {
	return &DownloadMinimalInitrdOK{

		Payload: writer,
	}
}

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

Success.
*/
type DownloadMinimalInitrdOK struct {
	Payload io.Writer
}

// IsSuccess returns true when this download minimal initrd o k response has a 2xx status code
func (o *DownloadMinimalInitrdOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this download minimal initrd o k response has a 3xx status code
func (o *DownloadMinimalInitrdOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this download minimal initrd o k response has a 4xx status code
func (o *DownloadMinimalInitrdOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this download minimal initrd o k response has a 5xx status code
func (o *DownloadMinimalInitrdOK) IsServerError() bool {
	return false
}

// IsCode returns true when this download minimal initrd o k response a status code equal to that given
func (o *DownloadMinimalInitrdOK) IsCode(code int) bool {
	return code == 200
}

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

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

func (o *DownloadMinimalInitrdOK) GetPayload() io.Writer {
	return o.Payload
}

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

// NewDownloadMinimalInitrdNoContent creates a DownloadMinimalInitrdNoContent with default headers values
func NewDownloadMinimalInitrdNoContent() *DownloadMinimalInitrdNoContent {
	return &DownloadMinimalInitrdNoContent{}
}

/*
DownloadMinimalInitrdNoContent describes a response with status code 204, with default header values.

Empty Success.
*/
type DownloadMinimalInitrdNoContent struct {
}

// IsSuccess returns true when this download minimal initrd no content response has a 2xx status code
func (o *DownloadMinimalInitrdNoContent) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this download minimal initrd no content response has a 3xx status code
func (o *DownloadMinimalInitrdNoContent) IsRedirect() bool {
	return false
}

// IsClientError returns true when this download minimal initrd no content response has a 4xx status code
func (o *DownloadMinimalInitrdNoContent) IsClientError() bool {
	return false
}

// IsServerError returns true when this download minimal initrd no content response has a 5xx status code
func (o *DownloadMinimalInitrdNoContent) IsServerError() bool {
	return false
}

// IsCode returns true when this download minimal initrd no content response a status code equal to that given
func (o *DownloadMinimalInitrdNoContent) IsCode(code int) bool {
	return code == 204
}

func (o *DownloadMinimalInitrdNoContent) Error() string {
	return fmt.Sprintf("[GET /v2/infra-envs/{infra_env_id}/downloads/minimal-initrd][%d] downloadMinimalInitrdNoContent ", 204)
}

func (o *DownloadMinimalInitrdNoContent) String() string {
	return fmt.Sprintf("[GET /v2/infra-envs/{infra_env_id}/downloads/minimal-initrd][%d] downloadMinimalInitrdNoContent ", 204)
}

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

	return nil
}

// NewDownloadMinimalInitrdUnauthorized creates a DownloadMinimalInitrdUnauthorized with default headers values
func NewDownloadMinimalInitrdUnauthorized() *DownloadMinimalInitrdUnauthorized {
	return &DownloadMinimalInitrdUnauthorized{}
}

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

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

// IsSuccess returns true when this download minimal initrd unauthorized response has a 2xx status code
func (o *DownloadMinimalInitrdUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this download minimal initrd unauthorized response has a 3xx status code
func (o *DownloadMinimalInitrdUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this download minimal initrd unauthorized response has a 4xx status code
func (o *DownloadMinimalInitrdUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this download minimal initrd unauthorized response has a 5xx status code
func (o *DownloadMinimalInitrdUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this download minimal initrd unauthorized response a status code equal to that given
func (o *DownloadMinimalInitrdUnauthorized) IsCode(code int) bool {
	return code == 401
}

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

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

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

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

// NewDownloadMinimalInitrdForbidden creates a DownloadMinimalInitrdForbidden with default headers values
func NewDownloadMinimalInitrdForbidden() *DownloadMinimalInitrdForbidden {
	return &DownloadMinimalInitrdForbidden{}
}

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

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

// IsSuccess returns true when this download minimal initrd forbidden response has a 2xx status code
func (o *DownloadMinimalInitrdForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this download minimal initrd forbidden response has a 3xx status code
func (o *DownloadMinimalInitrdForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this download minimal initrd forbidden response has a 4xx status code
func (o *DownloadMinimalInitrdForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this download minimal initrd forbidden response has a 5xx status code
func (o *DownloadMinimalInitrdForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this download minimal initrd forbidden response a status code equal to that given
func (o *DownloadMinimalInitrdForbidden) IsCode(code int) bool {
	return code == 403
}

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

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

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

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

// NewDownloadMinimalInitrdNotFound creates a DownloadMinimalInitrdNotFound with default headers values
func NewDownloadMinimalInitrdNotFound() *DownloadMinimalInitrdNotFound {
	return &DownloadMinimalInitrdNotFound{}
}

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

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

// IsSuccess returns true when this download minimal initrd not found response has a 2xx status code
func (o *DownloadMinimalInitrdNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this download minimal initrd not found response has a 3xx status code
func (o *DownloadMinimalInitrdNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this download minimal initrd not found response has a 4xx status code
func (o *DownloadMinimalInitrdNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this download minimal initrd not found response has a 5xx status code
func (o *DownloadMinimalInitrdNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this download minimal initrd not found response a status code equal to that given
func (o *DownloadMinimalInitrdNotFound) IsCode(code int) bool {
	return code == 404
}

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

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

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

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

// NewDownloadMinimalInitrdMethodNotAllowed creates a DownloadMinimalInitrdMethodNotAllowed with default headers values
func NewDownloadMinimalInitrdMethodNotAllowed() *DownloadMinimalInitrdMethodNotAllowed {
	return &DownloadMinimalInitrdMethodNotAllowed{}
}

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

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

// IsSuccess returns true when this download minimal initrd method not allowed response has a 2xx status code
func (o *DownloadMinimalInitrdMethodNotAllowed) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this download minimal initrd method not allowed response has a 3xx status code
func (o *DownloadMinimalInitrdMethodNotAllowed) IsRedirect() bool {
	return false
}

// IsClientError returns true when this download minimal initrd method not allowed response has a 4xx status code
func (o *DownloadMinimalInitrdMethodNotAllowed) IsClientError() bool {
	return true
}

// IsServerError returns true when this download minimal initrd method not allowed response has a 5xx status code
func (o *DownloadMinimalInitrdMethodNotAllowed) IsServerError() bool {
	return false
}

// IsCode returns true when this download minimal initrd method not allowed response a status code equal to that given
func (o *DownloadMinimalInitrdMethodNotAllowed) IsCode(code int) bool {
	return code == 405
}

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

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

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

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

// NewDownloadMinimalInitrdConflict creates a DownloadMinimalInitrdConflict with default headers values
func NewDownloadMinimalInitrdConflict() *DownloadMinimalInitrdConflict {
	return &DownloadMinimalInitrdConflict{}
}

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

Conflict.
*/
type DownloadMinimalInitrdConflict struct {
	Payload *models.Error
}

// IsSuccess returns true when this download minimal initrd conflict response has a 2xx status code
func (o *DownloadMinimalInitrdConflict) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this download minimal initrd conflict response has a 3xx status code
func (o *DownloadMinimalInitrdConflict) IsRedirect() bool {
	return false
}

// IsClientError returns true when this download minimal initrd conflict response has a 4xx status code
func (o *DownloadMinimalInitrdConflict) IsClientError() bool {
	return true
}

// IsServerError returns true when this download minimal initrd conflict response has a 5xx status code
func (o *DownloadMinimalInitrdConflict) IsServerError() bool {
	return false
}

// IsCode returns true when this download minimal initrd conflict response a status code equal to that given
func (o *DownloadMinimalInitrdConflict) IsCode(code int) bool {
	return code == 409
}

func (o *DownloadMinimalInitrdConflict) Error() string {
	return fmt.Sprintf("[GET /v2/infra-envs/{infra_env_id}/downloads/minimal-initrd][%d] downloadMinimalInitrdConflict  %+v", 409, o.Payload)
}

func (o *DownloadMinimalInitrdConflict) String() string {
	return fmt.Sprintf("[GET /v2/infra-envs/{infra_env_id}/downloads/minimal-initrd][%d] downloadMinimalInitrdConflict  %+v", 409, o.Payload)
}

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

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

// NewDownloadMinimalInitrdInternalServerError creates a DownloadMinimalInitrdInternalServerError with default headers values
func NewDownloadMinimalInitrdInternalServerError() *DownloadMinimalInitrdInternalServerError {
	return &DownloadMinimalInitrdInternalServerError{}
}

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

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

// IsSuccess returns true when this download minimal initrd internal server error response has a 2xx status code
func (o *DownloadMinimalInitrdInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this download minimal initrd internal server error response has a 3xx status code
func (o *DownloadMinimalInitrdInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this download minimal initrd internal server error response has a 4xx status code
func (o *DownloadMinimalInitrdInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this download minimal initrd internal server error response has a 5xx status code
func (o *DownloadMinimalInitrdInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this download minimal initrd internal server error response a status code equal to that given
func (o *DownloadMinimalInitrdInternalServerError) IsCode(code int) bool {
	return code == 500
}

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

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

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

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