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

// V2GetClusterDefaultConfigReader is a Reader for the V2GetClusterDefaultConfig structure.
type V2GetClusterDefaultConfigReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *V2GetClusterDefaultConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewV2GetClusterDefaultConfigOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewV2GetClusterDefaultConfigUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewV2GetClusterDefaultConfigForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewV2GetClusterDefaultConfigInternalServerError()
		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())
	}
}

// NewV2GetClusterDefaultConfigOK creates a V2GetClusterDefaultConfigOK with default headers values
func NewV2GetClusterDefaultConfigOK() *V2GetClusterDefaultConfigOK {
	return &V2GetClusterDefaultConfigOK{}
}

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

Success.
*/
type V2GetClusterDefaultConfigOK struct {
	Payload *models.ClusterDefaultConfig
}

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

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

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

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

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

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

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

func (o *V2GetClusterDefaultConfigOK) GetPayload() *models.ClusterDefaultConfig {
	return o.Payload
}

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

	o.Payload = new(models.ClusterDefaultConfig)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewV2GetClusterDefaultConfigUnauthorized creates a V2GetClusterDefaultConfigUnauthorized with default headers values
func NewV2GetClusterDefaultConfigUnauthorized() *V2GetClusterDefaultConfigUnauthorized {
	return &V2GetClusterDefaultConfigUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewV2GetClusterDefaultConfigForbidden creates a V2GetClusterDefaultConfigForbidden with default headers values
func NewV2GetClusterDefaultConfigForbidden() *V2GetClusterDefaultConfigForbidden {
	return &V2GetClusterDefaultConfigForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewV2GetClusterDefaultConfigInternalServerError creates a V2GetClusterDefaultConfigInternalServerError with default headers values
func NewV2GetClusterDefaultConfigInternalServerError() *V2GetClusterDefaultConfigInternalServerError {
	return &V2GetClusterDefaultConfigInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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