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

// V2GetClusterInstallConfigReader is a Reader for the V2GetClusterInstallConfig structure.
type V2GetClusterInstallConfigReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *V2GetClusterInstallConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewV2GetClusterInstallConfigOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewV2GetClusterInstallConfigUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewV2GetClusterInstallConfigForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewV2GetClusterInstallConfigNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 405:
		result := NewV2GetClusterInstallConfigMethodNotAllowed()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewV2GetClusterInstallConfigInternalServerError()
		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())
	}
}

// NewV2GetClusterInstallConfigOK creates a V2GetClusterInstallConfigOK with default headers values
func NewV2GetClusterInstallConfigOK() *V2GetClusterInstallConfigOK {
	return &V2GetClusterInstallConfigOK{}
}

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

Success.
*/
type V2GetClusterInstallConfigOK struct {
	Payload string
}

// IsSuccess returns true when this v2 get cluster install config o k response has a 2xx status code
func (o *V2GetClusterInstallConfigOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this v2 get cluster install config o k response has a 3xx status code
func (o *V2GetClusterInstallConfigOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 get cluster install config o k response has a 4xx status code
func (o *V2GetClusterInstallConfigOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this v2 get cluster install config o k response has a 5xx status code
func (o *V2GetClusterInstallConfigOK) IsServerError() bool {
	return false
}

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

func (o *V2GetClusterInstallConfigOK) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/install-config][%d] v2GetClusterInstallConfigOK  %+v", 200, o.Payload)
}

func (o *V2GetClusterInstallConfigOK) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/install-config][%d] v2GetClusterInstallConfigOK  %+v", 200, o.Payload)
}

func (o *V2GetClusterInstallConfigOK) GetPayload() string {
	return o.Payload
}

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

// NewV2GetClusterInstallConfigUnauthorized creates a V2GetClusterInstallConfigUnauthorized with default headers values
func NewV2GetClusterInstallConfigUnauthorized() *V2GetClusterInstallConfigUnauthorized {
	return &V2GetClusterInstallConfigUnauthorized{}
}

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

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

// IsSuccess returns true when this v2 get cluster install config unauthorized response has a 2xx status code
func (o *V2GetClusterInstallConfigUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this v2 get cluster install config unauthorized response has a 3xx status code
func (o *V2GetClusterInstallConfigUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 get cluster install config unauthorized response has a 4xx status code
func (o *V2GetClusterInstallConfigUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this v2 get cluster install config unauthorized response has a 5xx status code
func (o *V2GetClusterInstallConfigUnauthorized) IsServerError() bool {
	return false
}

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

func (o *V2GetClusterInstallConfigUnauthorized) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/install-config][%d] v2GetClusterInstallConfigUnauthorized  %+v", 401, o.Payload)
}

func (o *V2GetClusterInstallConfigUnauthorized) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/install-config][%d] v2GetClusterInstallConfigUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewV2GetClusterInstallConfigForbidden creates a V2GetClusterInstallConfigForbidden with default headers values
func NewV2GetClusterInstallConfigForbidden() *V2GetClusterInstallConfigForbidden {
	return &V2GetClusterInstallConfigForbidden{}
}

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

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

// IsSuccess returns true when this v2 get cluster install config forbidden response has a 2xx status code
func (o *V2GetClusterInstallConfigForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this v2 get cluster install config forbidden response has a 3xx status code
func (o *V2GetClusterInstallConfigForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 get cluster install config forbidden response has a 4xx status code
func (o *V2GetClusterInstallConfigForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this v2 get cluster install config forbidden response has a 5xx status code
func (o *V2GetClusterInstallConfigForbidden) IsServerError() bool {
	return false
}

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

func (o *V2GetClusterInstallConfigForbidden) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/install-config][%d] v2GetClusterInstallConfigForbidden  %+v", 403, o.Payload)
}

func (o *V2GetClusterInstallConfigForbidden) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/install-config][%d] v2GetClusterInstallConfigForbidden  %+v", 403, o.Payload)
}

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

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

// NewV2GetClusterInstallConfigNotFound creates a V2GetClusterInstallConfigNotFound with default headers values
func NewV2GetClusterInstallConfigNotFound() *V2GetClusterInstallConfigNotFound {
	return &V2GetClusterInstallConfigNotFound{}
}

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

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

// IsSuccess returns true when this v2 get cluster install config not found response has a 2xx status code
func (o *V2GetClusterInstallConfigNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this v2 get cluster install config not found response has a 3xx status code
func (o *V2GetClusterInstallConfigNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 get cluster install config not found response has a 4xx status code
func (o *V2GetClusterInstallConfigNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this v2 get cluster install config not found response has a 5xx status code
func (o *V2GetClusterInstallConfigNotFound) IsServerError() bool {
	return false
}

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

func (o *V2GetClusterInstallConfigNotFound) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/install-config][%d] v2GetClusterInstallConfigNotFound  %+v", 404, o.Payload)
}

func (o *V2GetClusterInstallConfigNotFound) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/install-config][%d] v2GetClusterInstallConfigNotFound  %+v", 404, o.Payload)
}

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

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

// NewV2GetClusterInstallConfigMethodNotAllowed creates a V2GetClusterInstallConfigMethodNotAllowed with default headers values
func NewV2GetClusterInstallConfigMethodNotAllowed() *V2GetClusterInstallConfigMethodNotAllowed {
	return &V2GetClusterInstallConfigMethodNotAllowed{}
}

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

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

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

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

// IsClientError returns true when this v2 get cluster install config method not allowed response has a 4xx status code
func (o *V2GetClusterInstallConfigMethodNotAllowed) IsClientError() bool {
	return true
}

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

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

func (o *V2GetClusterInstallConfigMethodNotAllowed) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/install-config][%d] v2GetClusterInstallConfigMethodNotAllowed  %+v", 405, o.Payload)
}

func (o *V2GetClusterInstallConfigMethodNotAllowed) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/install-config][%d] v2GetClusterInstallConfigMethodNotAllowed  %+v", 405, o.Payload)
}

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

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

// NewV2GetClusterInstallConfigInternalServerError creates a V2GetClusterInstallConfigInternalServerError with default headers values
func NewV2GetClusterInstallConfigInternalServerError() *V2GetClusterInstallConfigInternalServerError {
	return &V2GetClusterInstallConfigInternalServerError{}
}

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

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

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

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

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

// IsServerError returns true when this v2 get cluster install config internal server error response has a 5xx status code
func (o *V2GetClusterInstallConfigInternalServerError) IsServerError() bool {
	return true
}

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

func (o *V2GetClusterInstallConfigInternalServerError) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/install-config][%d] v2GetClusterInstallConfigInternalServerError  %+v", 500, o.Payload)
}

func (o *V2GetClusterInstallConfigInternalServerError) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/install-config][%d] v2GetClusterInstallConfigInternalServerError  %+v", 500, o.Payload)
}

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

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