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

// V2ResetClusterReader is a Reader for the V2ResetCluster structure.
type V2ResetClusterReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *V2ResetClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 202:
		result := NewV2ResetClusterAccepted()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewV2ResetClusterUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewV2ResetClusterForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewV2ResetClusterNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 405:
		result := NewV2ResetClusterMethodNotAllowed()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 409:
		result := NewV2ResetClusterConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewV2ResetClusterInternalServerError()
		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())
	}
}

// NewV2ResetClusterAccepted creates a V2ResetClusterAccepted with default headers values
func NewV2ResetClusterAccepted() *V2ResetClusterAccepted {
	return &V2ResetClusterAccepted{}
}

/*
V2ResetClusterAccepted describes a response with status code 202, with default header values.

Success.
*/
type V2ResetClusterAccepted struct {
	Payload *models.Cluster
}

// IsSuccess returns true when this v2 reset cluster accepted response has a 2xx status code
func (o *V2ResetClusterAccepted) IsSuccess() bool {
	return true
}

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

// IsClientError returns true when this v2 reset cluster accepted response has a 4xx status code
func (o *V2ResetClusterAccepted) IsClientError() bool {
	return false
}

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

// IsCode returns true when this v2 reset cluster accepted response a status code equal to that given
func (o *V2ResetClusterAccepted) IsCode(code int) bool {
	return code == 202
}

func (o *V2ResetClusterAccepted) Error() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/reset][%d] v2ResetClusterAccepted  %+v", 202, o.Payload)
}

func (o *V2ResetClusterAccepted) String() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/reset][%d] v2ResetClusterAccepted  %+v", 202, o.Payload)
}

func (o *V2ResetClusterAccepted) GetPayload() *models.Cluster {
	return o.Payload
}

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

	o.Payload = new(models.Cluster)

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

	return nil
}

// NewV2ResetClusterUnauthorized creates a V2ResetClusterUnauthorized with default headers values
func NewV2ResetClusterUnauthorized() *V2ResetClusterUnauthorized {
	return &V2ResetClusterUnauthorized{}
}

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

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

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

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

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

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

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

func (o *V2ResetClusterUnauthorized) Error() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/reset][%d] v2ResetClusterUnauthorized  %+v", 401, o.Payload)
}

func (o *V2ResetClusterUnauthorized) String() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/reset][%d] v2ResetClusterUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewV2ResetClusterForbidden creates a V2ResetClusterForbidden with default headers values
func NewV2ResetClusterForbidden() *V2ResetClusterForbidden {
	return &V2ResetClusterForbidden{}
}

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

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

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

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

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

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

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

func (o *V2ResetClusterForbidden) Error() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/reset][%d] v2ResetClusterForbidden  %+v", 403, o.Payload)
}

func (o *V2ResetClusterForbidden) String() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/reset][%d] v2ResetClusterForbidden  %+v", 403, o.Payload)
}

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

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

// NewV2ResetClusterNotFound creates a V2ResetClusterNotFound with default headers values
func NewV2ResetClusterNotFound() *V2ResetClusterNotFound {
	return &V2ResetClusterNotFound{}
}

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

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

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

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

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

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

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

func (o *V2ResetClusterNotFound) Error() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/reset][%d] v2ResetClusterNotFound  %+v", 404, o.Payload)
}

func (o *V2ResetClusterNotFound) String() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/reset][%d] v2ResetClusterNotFound  %+v", 404, o.Payload)
}

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

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

// NewV2ResetClusterMethodNotAllowed creates a V2ResetClusterMethodNotAllowed with default headers values
func NewV2ResetClusterMethodNotAllowed() *V2ResetClusterMethodNotAllowed {
	return &V2ResetClusterMethodNotAllowed{}
}

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

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

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

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

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

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

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

func (o *V2ResetClusterMethodNotAllowed) Error() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/reset][%d] v2ResetClusterMethodNotAllowed  %+v", 405, o.Payload)
}

func (o *V2ResetClusterMethodNotAllowed) String() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/reset][%d] v2ResetClusterMethodNotAllowed  %+v", 405, o.Payload)
}

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

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

// NewV2ResetClusterConflict creates a V2ResetClusterConflict with default headers values
func NewV2ResetClusterConflict() *V2ResetClusterConflict {
	return &V2ResetClusterConflict{}
}

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

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

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

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

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

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

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

func (o *V2ResetClusterConflict) Error() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/reset][%d] v2ResetClusterConflict  %+v", 409, o.Payload)
}

func (o *V2ResetClusterConflict) String() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/reset][%d] v2ResetClusterConflict  %+v", 409, o.Payload)
}

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

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

// NewV2ResetClusterInternalServerError creates a V2ResetClusterInternalServerError with default headers values
func NewV2ResetClusterInternalServerError() *V2ResetClusterInternalServerError {
	return &V2ResetClusterInternalServerError{}
}

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

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

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

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

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

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

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

func (o *V2ResetClusterInternalServerError) Error() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/reset][%d] v2ResetClusterInternalServerError  %+v", 500, o.Payload)
}

func (o *V2ResetClusterInternalServerError) String() string {
	return fmt.Sprintf("[POST /v2/clusters/{cluster_id}/actions/reset][%d] v2ResetClusterInternalServerError  %+v", 500, o.Payload)
}

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

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