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

// PcloudV2PvminstancesVolumesPostReader is a Reader for the PcloudV2PvminstancesVolumesPost structure.
type PcloudV2PvminstancesVolumesPostReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudV2PvminstancesVolumesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 202:
		result := NewPcloudV2PvminstancesVolumesPostAccepted()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudV2PvminstancesVolumesPostBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudV2PvminstancesVolumesPostUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudV2PvminstancesVolumesPostForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudV2PvminstancesVolumesPostNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 409:
		result := NewPcloudV2PvminstancesVolumesPostConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudV2PvminstancesVolumesPostInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes] pcloud.v2.pvminstances.volumes.post", response, response.Code())
	}
}

// NewPcloudV2PvminstancesVolumesPostAccepted creates a PcloudV2PvminstancesVolumesPostAccepted with default headers values
func NewPcloudV2PvminstancesVolumesPostAccepted() *PcloudV2PvminstancesVolumesPostAccepted {
	return &PcloudV2PvminstancesVolumesPostAccepted{}
}

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

Accepted
*/
type PcloudV2PvminstancesVolumesPostAccepted struct {
	Payload *models.VolumesAttachmentResponse
}

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

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

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

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

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

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

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

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

func (o *PcloudV2PvminstancesVolumesPostAccepted) GetPayload() *models.VolumesAttachmentResponse {
	return o.Payload
}

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

	o.Payload = new(models.VolumesAttachmentResponse)

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

	return nil
}

// NewPcloudV2PvminstancesVolumesPostBadRequest creates a PcloudV2PvminstancesVolumesPostBadRequest with default headers values
func NewPcloudV2PvminstancesVolumesPostBadRequest() *PcloudV2PvminstancesVolumesPostBadRequest {
	return &PcloudV2PvminstancesVolumesPostBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudV2PvminstancesVolumesPostUnauthorized creates a PcloudV2PvminstancesVolumesPostUnauthorized with default headers values
func NewPcloudV2PvminstancesVolumesPostUnauthorized() *PcloudV2PvminstancesVolumesPostUnauthorized {
	return &PcloudV2PvminstancesVolumesPostUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudV2PvminstancesVolumesPostForbidden creates a PcloudV2PvminstancesVolumesPostForbidden with default headers values
func NewPcloudV2PvminstancesVolumesPostForbidden() *PcloudV2PvminstancesVolumesPostForbidden {
	return &PcloudV2PvminstancesVolumesPostForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudV2PvminstancesVolumesPostNotFound creates a PcloudV2PvminstancesVolumesPostNotFound with default headers values
func NewPcloudV2PvminstancesVolumesPostNotFound() *PcloudV2PvminstancesVolumesPostNotFound {
	return &PcloudV2PvminstancesVolumesPostNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudV2PvminstancesVolumesPostConflict creates a PcloudV2PvminstancesVolumesPostConflict with default headers values
func NewPcloudV2PvminstancesVolumesPostConflict() *PcloudV2PvminstancesVolumesPostConflict {
	return &PcloudV2PvminstancesVolumesPostConflict{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudV2PvminstancesVolumesPostInternalServerError creates a PcloudV2PvminstancesVolumesPostInternalServerError with default headers values
func NewPcloudV2PvminstancesVolumesPostInternalServerError() *PcloudV2PvminstancesVolumesPostInternalServerError {
	return &PcloudV2PvminstancesVolumesPostInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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