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

// PcloudV2VolumesDeleteReader is a Reader for the PcloudV2VolumesDelete structure.
type PcloudV2VolumesDeleteReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudV2VolumesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 202:
		result := NewPcloudV2VolumesDeleteAccepted()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 206:
		result := NewPcloudV2VolumesDeletePartialContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudV2VolumesDeleteBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudV2VolumesDeleteUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudV2VolumesDeleteNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 408:
		result := NewPcloudV2VolumesDeleteRequestTimeout()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 429:
		result := NewPcloudV2VolumesDeleteTooManyRequests()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudV2VolumesDeleteInternalServerError()
		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}/volumes] pcloud.v2.volumes.delete", response, response.Code())
	}
}

// NewPcloudV2VolumesDeleteAccepted creates a PcloudV2VolumesDeleteAccepted with default headers values
func NewPcloudV2VolumesDeleteAccepted() *PcloudV2VolumesDeleteAccepted {
	return &PcloudV2VolumesDeleteAccepted{}
}

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

Accepted
*/
type PcloudV2VolumesDeleteAccepted struct {
	Payload *models.VolumesDeleteResponse
}

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

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

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

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

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

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

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

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

func (o *PcloudV2VolumesDeleteAccepted) GetPayload() *models.VolumesDeleteResponse {
	return o.Payload
}

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

	o.Payload = new(models.VolumesDeleteResponse)

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

	return nil
}

// NewPcloudV2VolumesDeletePartialContent creates a PcloudV2VolumesDeletePartialContent with default headers values
func NewPcloudV2VolumesDeletePartialContent() *PcloudV2VolumesDeletePartialContent {
	return &PcloudV2VolumesDeletePartialContent{}
}

/*
PcloudV2VolumesDeletePartialContent describes a response with status code 206, with default header values.

Partial Content
*/
type PcloudV2VolumesDeletePartialContent struct {
	Payload *models.VolumesDeleteResponse
}

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

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

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

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

// IsCode returns true when this pcloud v2 volumes delete partial content response a status code equal to that given
func (o *PcloudV2VolumesDeletePartialContent) IsCode(code int) bool {
	return code == 206
}

// Code gets the status code for the pcloud v2 volumes delete partial content response
func (o *PcloudV2VolumesDeletePartialContent) Code() int {
	return 206
}

func (o *PcloudV2VolumesDeletePartialContent) Error() string {
	return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeletePartialContent  %+v", 206, o.Payload)
}

func (o *PcloudV2VolumesDeletePartialContent) String() string {
	return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeletePartialContent  %+v", 206, o.Payload)
}

func (o *PcloudV2VolumesDeletePartialContent) GetPayload() *models.VolumesDeleteResponse {
	return o.Payload
}

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

	o.Payload = new(models.VolumesDeleteResponse)

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

	return nil
}

// NewPcloudV2VolumesDeleteBadRequest creates a PcloudV2VolumesDeleteBadRequest with default headers values
func NewPcloudV2VolumesDeleteBadRequest() *PcloudV2VolumesDeleteBadRequest {
	return &PcloudV2VolumesDeleteBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudV2VolumesDeleteUnauthorized creates a PcloudV2VolumesDeleteUnauthorized with default headers values
func NewPcloudV2VolumesDeleteUnauthorized() *PcloudV2VolumesDeleteUnauthorized {
	return &PcloudV2VolumesDeleteUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudV2VolumesDeleteNotFound creates a PcloudV2VolumesDeleteNotFound with default headers values
func NewPcloudV2VolumesDeleteNotFound() *PcloudV2VolumesDeleteNotFound {
	return &PcloudV2VolumesDeleteNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudV2VolumesDeleteRequestTimeout creates a PcloudV2VolumesDeleteRequestTimeout with default headers values
func NewPcloudV2VolumesDeleteRequestTimeout() *PcloudV2VolumesDeleteRequestTimeout {
	return &PcloudV2VolumesDeleteRequestTimeout{}
}

/*
PcloudV2VolumesDeleteRequestTimeout describes a response with status code 408, with default header values.

Request Timeout
*/
type PcloudV2VolumesDeleteRequestTimeout struct {
	Payload *models.Error
}

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

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

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

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

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

// Code gets the status code for the pcloud v2 volumes delete request timeout response
func (o *PcloudV2VolumesDeleteRequestTimeout) Code() int {
	return 408
}

func (o *PcloudV2VolumesDeleteRequestTimeout) Error() string {
	return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteRequestTimeout  %+v", 408, o.Payload)
}

func (o *PcloudV2VolumesDeleteRequestTimeout) String() string {
	return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteRequestTimeout  %+v", 408, o.Payload)
}

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

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

// NewPcloudV2VolumesDeleteTooManyRequests creates a PcloudV2VolumesDeleteTooManyRequests with default headers values
func NewPcloudV2VolumesDeleteTooManyRequests() *PcloudV2VolumesDeleteTooManyRequests {
	return &PcloudV2VolumesDeleteTooManyRequests{}
}

/*
PcloudV2VolumesDeleteTooManyRequests describes a response with status code 429, with default header values.

Too Many Requests
*/
type PcloudV2VolumesDeleteTooManyRequests struct {
	Payload *models.Error
}

// IsSuccess returns true when this pcloud v2 volumes delete too many requests response has a 2xx status code
func (o *PcloudV2VolumesDeleteTooManyRequests) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this pcloud v2 volumes delete too many requests response has a 3xx status code
func (o *PcloudV2VolumesDeleteTooManyRequests) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud v2 volumes delete too many requests response has a 4xx status code
func (o *PcloudV2VolumesDeleteTooManyRequests) IsClientError() bool {
	return true
}

// IsServerError returns true when this pcloud v2 volumes delete too many requests response has a 5xx status code
func (o *PcloudV2VolumesDeleteTooManyRequests) IsServerError() bool {
	return false
}

// IsCode returns true when this pcloud v2 volumes delete too many requests response a status code equal to that given
func (o *PcloudV2VolumesDeleteTooManyRequests) IsCode(code int) bool {
	return code == 429
}

// Code gets the status code for the pcloud v2 volumes delete too many requests response
func (o *PcloudV2VolumesDeleteTooManyRequests) Code() int {
	return 429
}

func (o *PcloudV2VolumesDeleteTooManyRequests) Error() string {
	return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteTooManyRequests  %+v", 429, o.Payload)
}

func (o *PcloudV2VolumesDeleteTooManyRequests) String() string {
	return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteTooManyRequests  %+v", 429, o.Payload)
}

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

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

// NewPcloudV2VolumesDeleteInternalServerError creates a PcloudV2VolumesDeleteInternalServerError with default headers values
func NewPcloudV2VolumesDeleteInternalServerError() *PcloudV2VolumesDeleteInternalServerError {
	return &PcloudV2VolumesDeleteInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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