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

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

// ReadResponse reads a server response into the received o.
func (o *V2DownloadClusterCredentialsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewV2DownloadClusterCredentialsOK(o.writer)
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewV2DownloadClusterCredentialsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewV2DownloadClusterCredentialsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewV2DownloadClusterCredentialsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 405:
		result := NewV2DownloadClusterCredentialsMethodNotAllowed()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 409:
		result := NewV2DownloadClusterCredentialsConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewV2DownloadClusterCredentialsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewV2DownloadClusterCredentialsServiceUnavailable()
		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())
	}
}

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

		Payload: writer,
	}
}

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

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

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

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

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

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

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

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

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

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

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

// NewV2DownloadClusterCredentialsUnauthorized creates a V2DownloadClusterCredentialsUnauthorized with default headers values
func NewV2DownloadClusterCredentialsUnauthorized() *V2DownloadClusterCredentialsUnauthorized {
	return &V2DownloadClusterCredentialsUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewV2DownloadClusterCredentialsForbidden creates a V2DownloadClusterCredentialsForbidden with default headers values
func NewV2DownloadClusterCredentialsForbidden() *V2DownloadClusterCredentialsForbidden {
	return &V2DownloadClusterCredentialsForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewV2DownloadClusterCredentialsNotFound creates a V2DownloadClusterCredentialsNotFound with default headers values
func NewV2DownloadClusterCredentialsNotFound() *V2DownloadClusterCredentialsNotFound {
	return &V2DownloadClusterCredentialsNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewV2DownloadClusterCredentialsMethodNotAllowed creates a V2DownloadClusterCredentialsMethodNotAllowed with default headers values
func NewV2DownloadClusterCredentialsMethodNotAllowed() *V2DownloadClusterCredentialsMethodNotAllowed {
	return &V2DownloadClusterCredentialsMethodNotAllowed{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewV2DownloadClusterCredentialsConflict creates a V2DownloadClusterCredentialsConflict with default headers values
func NewV2DownloadClusterCredentialsConflict() *V2DownloadClusterCredentialsConflict {
	return &V2DownloadClusterCredentialsConflict{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewV2DownloadClusterCredentialsInternalServerError creates a V2DownloadClusterCredentialsInternalServerError with default headers values
func NewV2DownloadClusterCredentialsInternalServerError() *V2DownloadClusterCredentialsInternalServerError {
	return &V2DownloadClusterCredentialsInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewV2DownloadClusterCredentialsServiceUnavailable creates a V2DownloadClusterCredentialsServiceUnavailable with default headers values
func NewV2DownloadClusterCredentialsServiceUnavailable() *V2DownloadClusterCredentialsServiceUnavailable {
	return &V2DownloadClusterCredentialsServiceUnavailable{}
}

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

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

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

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

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

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

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

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

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

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

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