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

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

// ReadResponse reads a server response into the received o.
func (o *V2DownloadClusterFilesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewV2DownloadClusterFilesOK(o.writer)
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewV2DownloadClusterFilesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewV2DownloadClusterFilesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewV2DownloadClusterFilesNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 405:
		result := NewV2DownloadClusterFilesMethodNotAllowed()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 409:
		result := NewV2DownloadClusterFilesConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewV2DownloadClusterFilesInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewV2DownloadClusterFilesServiceUnavailable()
		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())
	}
}

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

		Payload: writer,
	}
}

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

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

// IsSuccess returns true when this v2 download cluster files o k response has a 2xx status code
func (o *V2DownloadClusterFilesOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this v2 download cluster files o k response has a 3xx status code
func (o *V2DownloadClusterFilesOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 download cluster files o k response has a 4xx status code
func (o *V2DownloadClusterFilesOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this v2 download cluster files o k response has a 5xx status code
func (o *V2DownloadClusterFilesOK) IsServerError() bool {
	return false
}

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

func (o *V2DownloadClusterFilesOK) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/downloads/files][%d] v2DownloadClusterFilesOK  %+v", 200, o.Payload)
}

func (o *V2DownloadClusterFilesOK) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/downloads/files][%d] v2DownloadClusterFilesOK  %+v", 200, o.Payload)
}

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

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

// NewV2DownloadClusterFilesUnauthorized creates a V2DownloadClusterFilesUnauthorized with default headers values
func NewV2DownloadClusterFilesUnauthorized() *V2DownloadClusterFilesUnauthorized {
	return &V2DownloadClusterFilesUnauthorized{}
}

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

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

// IsSuccess returns true when this v2 download cluster files unauthorized response has a 2xx status code
func (o *V2DownloadClusterFilesUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this v2 download cluster files unauthorized response has a 3xx status code
func (o *V2DownloadClusterFilesUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 download cluster files unauthorized response has a 4xx status code
func (o *V2DownloadClusterFilesUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this v2 download cluster files unauthorized response has a 5xx status code
func (o *V2DownloadClusterFilesUnauthorized) IsServerError() bool {
	return false
}

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

func (o *V2DownloadClusterFilesUnauthorized) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/downloads/files][%d] v2DownloadClusterFilesUnauthorized  %+v", 401, o.Payload)
}

func (o *V2DownloadClusterFilesUnauthorized) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/downloads/files][%d] v2DownloadClusterFilesUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewV2DownloadClusterFilesForbidden creates a V2DownloadClusterFilesForbidden with default headers values
func NewV2DownloadClusterFilesForbidden() *V2DownloadClusterFilesForbidden {
	return &V2DownloadClusterFilesForbidden{}
}

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

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

// IsSuccess returns true when this v2 download cluster files forbidden response has a 2xx status code
func (o *V2DownloadClusterFilesForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this v2 download cluster files forbidden response has a 3xx status code
func (o *V2DownloadClusterFilesForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 download cluster files forbidden response has a 4xx status code
func (o *V2DownloadClusterFilesForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this v2 download cluster files forbidden response has a 5xx status code
func (o *V2DownloadClusterFilesForbidden) IsServerError() bool {
	return false
}

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

func (o *V2DownloadClusterFilesForbidden) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/downloads/files][%d] v2DownloadClusterFilesForbidden  %+v", 403, o.Payload)
}

func (o *V2DownloadClusterFilesForbidden) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/downloads/files][%d] v2DownloadClusterFilesForbidden  %+v", 403, o.Payload)
}

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

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

// NewV2DownloadClusterFilesNotFound creates a V2DownloadClusterFilesNotFound with default headers values
func NewV2DownloadClusterFilesNotFound() *V2DownloadClusterFilesNotFound {
	return &V2DownloadClusterFilesNotFound{}
}

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

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

// IsSuccess returns true when this v2 download cluster files not found response has a 2xx status code
func (o *V2DownloadClusterFilesNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this v2 download cluster files not found response has a 3xx status code
func (o *V2DownloadClusterFilesNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 download cluster files not found response has a 4xx status code
func (o *V2DownloadClusterFilesNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this v2 download cluster files not found response has a 5xx status code
func (o *V2DownloadClusterFilesNotFound) IsServerError() bool {
	return false
}

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

func (o *V2DownloadClusterFilesNotFound) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/downloads/files][%d] v2DownloadClusterFilesNotFound  %+v", 404, o.Payload)
}

func (o *V2DownloadClusterFilesNotFound) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/downloads/files][%d] v2DownloadClusterFilesNotFound  %+v", 404, o.Payload)
}

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

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

// NewV2DownloadClusterFilesMethodNotAllowed creates a V2DownloadClusterFilesMethodNotAllowed with default headers values
func NewV2DownloadClusterFilesMethodNotAllowed() *V2DownloadClusterFilesMethodNotAllowed {
	return &V2DownloadClusterFilesMethodNotAllowed{}
}

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

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

// IsSuccess returns true when this v2 download cluster files method not allowed response has a 2xx status code
func (o *V2DownloadClusterFilesMethodNotAllowed) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this v2 download cluster files method not allowed response has a 3xx status code
func (o *V2DownloadClusterFilesMethodNotAllowed) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 download cluster files method not allowed response has a 4xx status code
func (o *V2DownloadClusterFilesMethodNotAllowed) IsClientError() bool {
	return true
}

// IsServerError returns true when this v2 download cluster files method not allowed response has a 5xx status code
func (o *V2DownloadClusterFilesMethodNotAllowed) IsServerError() bool {
	return false
}

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

func (o *V2DownloadClusterFilesMethodNotAllowed) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/downloads/files][%d] v2DownloadClusterFilesMethodNotAllowed  %+v", 405, o.Payload)
}

func (o *V2DownloadClusterFilesMethodNotAllowed) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/downloads/files][%d] v2DownloadClusterFilesMethodNotAllowed  %+v", 405, o.Payload)
}

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

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

// NewV2DownloadClusterFilesConflict creates a V2DownloadClusterFilesConflict with default headers values
func NewV2DownloadClusterFilesConflict() *V2DownloadClusterFilesConflict {
	return &V2DownloadClusterFilesConflict{}
}

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

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

// IsSuccess returns true when this v2 download cluster files conflict response has a 2xx status code
func (o *V2DownloadClusterFilesConflict) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this v2 download cluster files conflict response has a 3xx status code
func (o *V2DownloadClusterFilesConflict) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 download cluster files conflict response has a 4xx status code
func (o *V2DownloadClusterFilesConflict) IsClientError() bool {
	return true
}

// IsServerError returns true when this v2 download cluster files conflict response has a 5xx status code
func (o *V2DownloadClusterFilesConflict) IsServerError() bool {
	return false
}

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

func (o *V2DownloadClusterFilesConflict) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/downloads/files][%d] v2DownloadClusterFilesConflict  %+v", 409, o.Payload)
}

func (o *V2DownloadClusterFilesConflict) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/downloads/files][%d] v2DownloadClusterFilesConflict  %+v", 409, o.Payload)
}

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

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

// NewV2DownloadClusterFilesInternalServerError creates a V2DownloadClusterFilesInternalServerError with default headers values
func NewV2DownloadClusterFilesInternalServerError() *V2DownloadClusterFilesInternalServerError {
	return &V2DownloadClusterFilesInternalServerError{}
}

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

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

// IsSuccess returns true when this v2 download cluster files internal server error response has a 2xx status code
func (o *V2DownloadClusterFilesInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this v2 download cluster files internal server error response has a 3xx status code
func (o *V2DownloadClusterFilesInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 download cluster files internal server error response has a 4xx status code
func (o *V2DownloadClusterFilesInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this v2 download cluster files internal server error response has a 5xx status code
func (o *V2DownloadClusterFilesInternalServerError) IsServerError() bool {
	return true
}

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

func (o *V2DownloadClusterFilesInternalServerError) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/downloads/files][%d] v2DownloadClusterFilesInternalServerError  %+v", 500, o.Payload)
}

func (o *V2DownloadClusterFilesInternalServerError) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/downloads/files][%d] v2DownloadClusterFilesInternalServerError  %+v", 500, o.Payload)
}

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

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

// NewV2DownloadClusterFilesServiceUnavailable creates a V2DownloadClusterFilesServiceUnavailable with default headers values
func NewV2DownloadClusterFilesServiceUnavailable() *V2DownloadClusterFilesServiceUnavailable {
	return &V2DownloadClusterFilesServiceUnavailable{}
}

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

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

// IsSuccess returns true when this v2 download cluster files service unavailable response has a 2xx status code
func (o *V2DownloadClusterFilesServiceUnavailable) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this v2 download cluster files service unavailable response has a 3xx status code
func (o *V2DownloadClusterFilesServiceUnavailable) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 download cluster files service unavailable response has a 4xx status code
func (o *V2DownloadClusterFilesServiceUnavailable) IsClientError() bool {
	return false
}

// IsServerError returns true when this v2 download cluster files service unavailable response has a 5xx status code
func (o *V2DownloadClusterFilesServiceUnavailable) IsServerError() bool {
	return true
}

// IsCode returns true when this v2 download cluster files service unavailable response a status code equal to that given
func (o *V2DownloadClusterFilesServiceUnavailable) IsCode(code int) bool {
	return code == 503
}

func (o *V2DownloadClusterFilesServiceUnavailable) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/downloads/files][%d] v2DownloadClusterFilesServiceUnavailable  %+v", 503, o.Payload)
}

func (o *V2DownloadClusterFilesServiceUnavailable) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/downloads/files][%d] v2DownloadClusterFilesServiceUnavailable  %+v", 503, o.Payload)
}

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

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