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

// V2DeregisterClusterReader is a Reader for the V2DeregisterCluster structure.
type V2DeregisterClusterReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *V2DeregisterClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 204:
		result := NewV2DeregisterClusterNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewV2DeregisterClusterUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewV2DeregisterClusterForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewV2DeregisterClusterNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 405:
		result := NewV2DeregisterClusterMethodNotAllowed()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 409:
		result := NewV2DeregisterClusterConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewV2DeregisterClusterInternalServerError()
		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())
	}
}

// NewV2DeregisterClusterNoContent creates a V2DeregisterClusterNoContent with default headers values
func NewV2DeregisterClusterNoContent() *V2DeregisterClusterNoContent {
	return &V2DeregisterClusterNoContent{}
}

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

Success.
*/
type V2DeregisterClusterNoContent struct {
}

// IsSuccess returns true when this v2 deregister cluster no content response has a 2xx status code
func (o *V2DeregisterClusterNoContent) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this v2 deregister cluster no content response has a 3xx status code
func (o *V2DeregisterClusterNoContent) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 deregister cluster no content response has a 4xx status code
func (o *V2DeregisterClusterNoContent) IsClientError() bool {
	return false
}

// IsServerError returns true when this v2 deregister cluster no content response has a 5xx status code
func (o *V2DeregisterClusterNoContent) IsServerError() bool {
	return false
}

// IsCode returns true when this v2 deregister cluster no content response a status code equal to that given
func (o *V2DeregisterClusterNoContent) IsCode(code int) bool {
	return code == 204
}

func (o *V2DeregisterClusterNoContent) Error() string {
	return fmt.Sprintf("[DELETE /v2/clusters/{cluster_id}][%d] v2DeregisterClusterNoContent ", 204)
}

func (o *V2DeregisterClusterNoContent) String() string {
	return fmt.Sprintf("[DELETE /v2/clusters/{cluster_id}][%d] v2DeregisterClusterNoContent ", 204)
}

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

	return nil
}

// NewV2DeregisterClusterUnauthorized creates a V2DeregisterClusterUnauthorized with default headers values
func NewV2DeregisterClusterUnauthorized() *V2DeregisterClusterUnauthorized {
	return &V2DeregisterClusterUnauthorized{}
}

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

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

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

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

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

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

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

func (o *V2DeregisterClusterUnauthorized) Error() string {
	return fmt.Sprintf("[DELETE /v2/clusters/{cluster_id}][%d] v2DeregisterClusterUnauthorized  %+v", 401, o.Payload)
}

func (o *V2DeregisterClusterUnauthorized) String() string {
	return fmt.Sprintf("[DELETE /v2/clusters/{cluster_id}][%d] v2DeregisterClusterUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewV2DeregisterClusterForbidden creates a V2DeregisterClusterForbidden with default headers values
func NewV2DeregisterClusterForbidden() *V2DeregisterClusterForbidden {
	return &V2DeregisterClusterForbidden{}
}

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

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

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

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

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

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

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

func (o *V2DeregisterClusterForbidden) Error() string {
	return fmt.Sprintf("[DELETE /v2/clusters/{cluster_id}][%d] v2DeregisterClusterForbidden  %+v", 403, o.Payload)
}

func (o *V2DeregisterClusterForbidden) String() string {
	return fmt.Sprintf("[DELETE /v2/clusters/{cluster_id}][%d] v2DeregisterClusterForbidden  %+v", 403, o.Payload)
}

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

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

// NewV2DeregisterClusterNotFound creates a V2DeregisterClusterNotFound with default headers values
func NewV2DeregisterClusterNotFound() *V2DeregisterClusterNotFound {
	return &V2DeregisterClusterNotFound{}
}

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

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

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

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

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

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

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

func (o *V2DeregisterClusterNotFound) Error() string {
	return fmt.Sprintf("[DELETE /v2/clusters/{cluster_id}][%d] v2DeregisterClusterNotFound  %+v", 404, o.Payload)
}

func (o *V2DeregisterClusterNotFound) String() string {
	return fmt.Sprintf("[DELETE /v2/clusters/{cluster_id}][%d] v2DeregisterClusterNotFound  %+v", 404, o.Payload)
}

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

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

// NewV2DeregisterClusterMethodNotAllowed creates a V2DeregisterClusterMethodNotAllowed with default headers values
func NewV2DeregisterClusterMethodNotAllowed() *V2DeregisterClusterMethodNotAllowed {
	return &V2DeregisterClusterMethodNotAllowed{}
}

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

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

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

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

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

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

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

func (o *V2DeregisterClusterMethodNotAllowed) Error() string {
	return fmt.Sprintf("[DELETE /v2/clusters/{cluster_id}][%d] v2DeregisterClusterMethodNotAllowed  %+v", 405, o.Payload)
}

func (o *V2DeregisterClusterMethodNotAllowed) String() string {
	return fmt.Sprintf("[DELETE /v2/clusters/{cluster_id}][%d] v2DeregisterClusterMethodNotAllowed  %+v", 405, o.Payload)
}

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

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

// NewV2DeregisterClusterConflict creates a V2DeregisterClusterConflict with default headers values
func NewV2DeregisterClusterConflict() *V2DeregisterClusterConflict {
	return &V2DeregisterClusterConflict{}
}

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

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

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

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

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

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

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

func (o *V2DeregisterClusterConflict) Error() string {
	return fmt.Sprintf("[DELETE /v2/clusters/{cluster_id}][%d] v2DeregisterClusterConflict  %+v", 409, o.Payload)
}

func (o *V2DeregisterClusterConflict) String() string {
	return fmt.Sprintf("[DELETE /v2/clusters/{cluster_id}][%d] v2DeregisterClusterConflict  %+v", 409, o.Payload)
}

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

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

// NewV2DeregisterClusterInternalServerError creates a V2DeregisterClusterInternalServerError with default headers values
func NewV2DeregisterClusterInternalServerError() *V2DeregisterClusterInternalServerError {
	return &V2DeregisterClusterInternalServerError{}
}

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

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

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

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

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

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

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

func (o *V2DeregisterClusterInternalServerError) Error() string {
	return fmt.Sprintf("[DELETE /v2/clusters/{cluster_id}][%d] v2DeregisterClusterInternalServerError  %+v", 500, o.Payload)
}

func (o *V2DeregisterClusterInternalServerError) String() string {
	return fmt.Sprintf("[DELETE /v2/clusters/{cluster_id}][%d] v2DeregisterClusterInternalServerError  %+v", 500, o.Payload)
}

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

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