// Code generated by go-swagger; DO NOT EDIT.

package p_cloud_volumes

// 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/IBM-Cloud/power-go-client/power/models"
)

// PcloudV2PvminstancesVolumesDeleteReader is a Reader for the PcloudV2PvminstancesVolumesDelete structure.
type PcloudV2PvminstancesVolumesDeleteReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudV2PvminstancesVolumesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 202:
		result := NewPcloudV2PvminstancesVolumesDeleteAccepted()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudV2PvminstancesVolumesDeleteBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudV2PvminstancesVolumesDeleteUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudV2PvminstancesVolumesDeleteForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudV2PvminstancesVolumesDeleteNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 409:
		result := NewPcloudV2PvminstancesVolumesDeleteConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudV2PvminstancesVolumesDeleteInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes] pcloud.v2.pvminstances.volumes.delete", response, response.Code())
	}
}

// NewPcloudV2PvminstancesVolumesDeleteAccepted creates a PcloudV2PvminstancesVolumesDeleteAccepted with default headers values
func NewPcloudV2PvminstancesVolumesDeleteAccepted() *PcloudV2PvminstancesVolumesDeleteAccepted {
	return &PcloudV2PvminstancesVolumesDeleteAccepted{}
}

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

Accepted
*/
type PcloudV2PvminstancesVolumesDeleteAccepted struct {
	Payload *models.VolumesDetachmentResponse
}

// IsSuccess returns true when this pcloud v2 pvminstances volumes delete accepted response has a 2xx status code
func (o *PcloudV2PvminstancesVolumesDeleteAccepted) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this pcloud v2 pvminstances volumes delete accepted response has a 3xx status code
func (o *PcloudV2PvminstancesVolumesDeleteAccepted) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud v2 pvminstances volumes delete accepted response has a 4xx status code
func (o *PcloudV2PvminstancesVolumesDeleteAccepted) IsClientError() bool {
	return false
}

// IsServerError returns true when this pcloud v2 pvminstances volumes delete accepted response has a 5xx status code
func (o *PcloudV2PvminstancesVolumesDeleteAccepted) IsServerError() bool {
	return false
}

// IsCode returns true when this pcloud v2 pvminstances volumes delete accepted response a status code equal to that given
func (o *PcloudV2PvminstancesVolumesDeleteAccepted) IsCode(code int) bool {
	return code == 202
}

// Code gets the status code for the pcloud v2 pvminstances volumes delete accepted response
func (o *PcloudV2PvminstancesVolumesDeleteAccepted) Code() int {
	return 202
}

func (o *PcloudV2PvminstancesVolumesDeleteAccepted) Error() string {
	return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteAccepted  %+v", 202, o.Payload)
}

func (o *PcloudV2PvminstancesVolumesDeleteAccepted) String() string {
	return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteAccepted  %+v", 202, o.Payload)
}

func (o *PcloudV2PvminstancesVolumesDeleteAccepted) GetPayload() *models.VolumesDetachmentResponse {
	return o.Payload
}

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

	o.Payload = new(models.VolumesDetachmentResponse)

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

	return nil
}

// NewPcloudV2PvminstancesVolumesDeleteBadRequest creates a PcloudV2PvminstancesVolumesDeleteBadRequest with default headers values
func NewPcloudV2PvminstancesVolumesDeleteBadRequest() *PcloudV2PvminstancesVolumesDeleteBadRequest {
	return &PcloudV2PvminstancesVolumesDeleteBadRequest{}
}

/*
PcloudV2PvminstancesVolumesDeleteBadRequest describes a response with status code 400, with default header values.

Bad Request
*/
type PcloudV2PvminstancesVolumesDeleteBadRequest struct {
	Payload *models.Error
}

// IsSuccess returns true when this pcloud v2 pvminstances volumes delete bad request response has a 2xx status code
func (o *PcloudV2PvminstancesVolumesDeleteBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this pcloud v2 pvminstances volumes delete bad request response has a 3xx status code
func (o *PcloudV2PvminstancesVolumesDeleteBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud v2 pvminstances volumes delete bad request response has a 4xx status code
func (o *PcloudV2PvminstancesVolumesDeleteBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this pcloud v2 pvminstances volumes delete bad request response has a 5xx status code
func (o *PcloudV2PvminstancesVolumesDeleteBadRequest) IsServerError() bool {
	return false
}

// IsCode returns true when this pcloud v2 pvminstances volumes delete bad request response a status code equal to that given
func (o *PcloudV2PvminstancesVolumesDeleteBadRequest) IsCode(code int) bool {
	return code == 400
}

// Code gets the status code for the pcloud v2 pvminstances volumes delete bad request response
func (o *PcloudV2PvminstancesVolumesDeleteBadRequest) Code() int {
	return 400
}

func (o *PcloudV2PvminstancesVolumesDeleteBadRequest) Error() string {
	return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteBadRequest  %+v", 400, o.Payload)
}

func (o *PcloudV2PvminstancesVolumesDeleteBadRequest) String() string {
	return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteBadRequest  %+v", 400, o.Payload)
}

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

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

// NewPcloudV2PvminstancesVolumesDeleteUnauthorized creates a PcloudV2PvminstancesVolumesDeleteUnauthorized with default headers values
func NewPcloudV2PvminstancesVolumesDeleteUnauthorized() *PcloudV2PvminstancesVolumesDeleteUnauthorized {
	return &PcloudV2PvminstancesVolumesDeleteUnauthorized{}
}

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

Unauthorized
*/
type PcloudV2PvminstancesVolumesDeleteUnauthorized struct {
	Payload *models.Error
}

// IsSuccess returns true when this pcloud v2 pvminstances volumes delete unauthorized response has a 2xx status code
func (o *PcloudV2PvminstancesVolumesDeleteUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this pcloud v2 pvminstances volumes delete unauthorized response has a 3xx status code
func (o *PcloudV2PvminstancesVolumesDeleteUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud v2 pvminstances volumes delete unauthorized response has a 4xx status code
func (o *PcloudV2PvminstancesVolumesDeleteUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this pcloud v2 pvminstances volumes delete unauthorized response has a 5xx status code
func (o *PcloudV2PvminstancesVolumesDeleteUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this pcloud v2 pvminstances volumes delete unauthorized response a status code equal to that given
func (o *PcloudV2PvminstancesVolumesDeleteUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the pcloud v2 pvminstances volumes delete unauthorized response
func (o *PcloudV2PvminstancesVolumesDeleteUnauthorized) Code() int {
	return 401
}

func (o *PcloudV2PvminstancesVolumesDeleteUnauthorized) Error() string {
	return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteUnauthorized  %+v", 401, o.Payload)
}

func (o *PcloudV2PvminstancesVolumesDeleteUnauthorized) String() string {
	return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewPcloudV2PvminstancesVolumesDeleteForbidden creates a PcloudV2PvminstancesVolumesDeleteForbidden with default headers values
func NewPcloudV2PvminstancesVolumesDeleteForbidden() *PcloudV2PvminstancesVolumesDeleteForbidden {
	return &PcloudV2PvminstancesVolumesDeleteForbidden{}
}

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

Forbidden
*/
type PcloudV2PvminstancesVolumesDeleteForbidden struct {
	Payload *models.Error
}

// IsSuccess returns true when this pcloud v2 pvminstances volumes delete forbidden response has a 2xx status code
func (o *PcloudV2PvminstancesVolumesDeleteForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this pcloud v2 pvminstances volumes delete forbidden response has a 3xx status code
func (o *PcloudV2PvminstancesVolumesDeleteForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud v2 pvminstances volumes delete forbidden response has a 4xx status code
func (o *PcloudV2PvminstancesVolumesDeleteForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this pcloud v2 pvminstances volumes delete forbidden response has a 5xx status code
func (o *PcloudV2PvminstancesVolumesDeleteForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this pcloud v2 pvminstances volumes delete forbidden response a status code equal to that given
func (o *PcloudV2PvminstancesVolumesDeleteForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the pcloud v2 pvminstances volumes delete forbidden response
func (o *PcloudV2PvminstancesVolumesDeleteForbidden) Code() int {
	return 403
}

func (o *PcloudV2PvminstancesVolumesDeleteForbidden) Error() string {
	return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteForbidden  %+v", 403, o.Payload)
}

func (o *PcloudV2PvminstancesVolumesDeleteForbidden) String() string {
	return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteForbidden  %+v", 403, o.Payload)
}

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

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

// NewPcloudV2PvminstancesVolumesDeleteNotFound creates a PcloudV2PvminstancesVolumesDeleteNotFound with default headers values
func NewPcloudV2PvminstancesVolumesDeleteNotFound() *PcloudV2PvminstancesVolumesDeleteNotFound {
	return &PcloudV2PvminstancesVolumesDeleteNotFound{}
}

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

Not Found
*/
type PcloudV2PvminstancesVolumesDeleteNotFound struct {
	Payload *models.Error
}

// IsSuccess returns true when this pcloud v2 pvminstances volumes delete not found response has a 2xx status code
func (o *PcloudV2PvminstancesVolumesDeleteNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this pcloud v2 pvminstances volumes delete not found response has a 3xx status code
func (o *PcloudV2PvminstancesVolumesDeleteNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud v2 pvminstances volumes delete not found response has a 4xx status code
func (o *PcloudV2PvminstancesVolumesDeleteNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this pcloud v2 pvminstances volumes delete not found response has a 5xx status code
func (o *PcloudV2PvminstancesVolumesDeleteNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this pcloud v2 pvminstances volumes delete not found response a status code equal to that given
func (o *PcloudV2PvminstancesVolumesDeleteNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the pcloud v2 pvminstances volumes delete not found response
func (o *PcloudV2PvminstancesVolumesDeleteNotFound) Code() int {
	return 404
}

func (o *PcloudV2PvminstancesVolumesDeleteNotFound) Error() string {
	return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteNotFound  %+v", 404, o.Payload)
}

func (o *PcloudV2PvminstancesVolumesDeleteNotFound) String() string {
	return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteNotFound  %+v", 404, o.Payload)
}

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

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

// NewPcloudV2PvminstancesVolumesDeleteConflict creates a PcloudV2PvminstancesVolumesDeleteConflict with default headers values
func NewPcloudV2PvminstancesVolumesDeleteConflict() *PcloudV2PvminstancesVolumesDeleteConflict {
	return &PcloudV2PvminstancesVolumesDeleteConflict{}
}

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

Conflict
*/
type PcloudV2PvminstancesVolumesDeleteConflict struct {
	Payload *models.Error
}

// IsSuccess returns true when this pcloud v2 pvminstances volumes delete conflict response has a 2xx status code
func (o *PcloudV2PvminstancesVolumesDeleteConflict) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this pcloud v2 pvminstances volumes delete conflict response has a 3xx status code
func (o *PcloudV2PvminstancesVolumesDeleteConflict) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud v2 pvminstances volumes delete conflict response has a 4xx status code
func (o *PcloudV2PvminstancesVolumesDeleteConflict) IsClientError() bool {
	return true
}

// IsServerError returns true when this pcloud v2 pvminstances volumes delete conflict response has a 5xx status code
func (o *PcloudV2PvminstancesVolumesDeleteConflict) IsServerError() bool {
	return false
}

// IsCode returns true when this pcloud v2 pvminstances volumes delete conflict response a status code equal to that given
func (o *PcloudV2PvminstancesVolumesDeleteConflict) IsCode(code int) bool {
	return code == 409
}

// Code gets the status code for the pcloud v2 pvminstances volumes delete conflict response
func (o *PcloudV2PvminstancesVolumesDeleteConflict) Code() int {
	return 409
}

func (o *PcloudV2PvminstancesVolumesDeleteConflict) Error() string {
	return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteConflict  %+v", 409, o.Payload)
}

func (o *PcloudV2PvminstancesVolumesDeleteConflict) String() string {
	return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteConflict  %+v", 409, o.Payload)
}

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

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

// NewPcloudV2PvminstancesVolumesDeleteInternalServerError creates a PcloudV2PvminstancesVolumesDeleteInternalServerError with default headers values
func NewPcloudV2PvminstancesVolumesDeleteInternalServerError() *PcloudV2PvminstancesVolumesDeleteInternalServerError {
	return &PcloudV2PvminstancesVolumesDeleteInternalServerError{}
}

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

Internal Server Error
*/
type PcloudV2PvminstancesVolumesDeleteInternalServerError struct {
	Payload *models.Error
}

// IsSuccess returns true when this pcloud v2 pvminstances volumes delete internal server error response has a 2xx status code
func (o *PcloudV2PvminstancesVolumesDeleteInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this pcloud v2 pvminstances volumes delete internal server error response has a 3xx status code
func (o *PcloudV2PvminstancesVolumesDeleteInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud v2 pvminstances volumes delete internal server error response has a 4xx status code
func (o *PcloudV2PvminstancesVolumesDeleteInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this pcloud v2 pvminstances volumes delete internal server error response has a 5xx status code
func (o *PcloudV2PvminstancesVolumesDeleteInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this pcloud v2 pvminstances volumes delete internal server error response a status code equal to that given
func (o *PcloudV2PvminstancesVolumesDeleteInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the pcloud v2 pvminstances volumes delete internal server error response
func (o *PcloudV2PvminstancesVolumesDeleteInternalServerError) Code() int {
	return 500
}

func (o *PcloudV2PvminstancesVolumesDeleteInternalServerError) Error() string {
	return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteInternalServerError  %+v", 500, o.Payload)
}

func (o *PcloudV2PvminstancesVolumesDeleteInternalServerError) String() string {
	return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteInternalServerError  %+v", 500, o.Payload)
}

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

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