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

// PcloudPvminstancesVolumesPostReader is a Reader for the PcloudPvminstancesVolumesPost structure.
type PcloudPvminstancesVolumesPostReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudPvminstancesVolumesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPcloudPvminstancesVolumesPostOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudPvminstancesVolumesPostBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudPvminstancesVolumesPostUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudPvminstancesVolumesPostForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudPvminstancesVolumesPostNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 409:
		result := NewPcloudPvminstancesVolumesPostConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudPvminstancesVolumesPostInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}] pcloud.pvminstances.volumes.post", response, response.Code())
	}
}

// NewPcloudPvminstancesVolumesPostOK creates a PcloudPvminstancesVolumesPostOK with default headers values
func NewPcloudPvminstancesVolumesPostOK() *PcloudPvminstancesVolumesPostOK {
	return &PcloudPvminstancesVolumesPostOK{}
}

/*
PcloudPvminstancesVolumesPostOK describes a response with status code 200, with default header values.

OK
*/
type PcloudPvminstancesVolumesPostOK struct {
	Payload models.Object
}

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

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

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

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

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

// Code gets the status code for the pcloud pvminstances volumes post o k response
func (o *PcloudPvminstancesVolumesPostOK) Code() int {
	return 200
}

func (o *PcloudPvminstancesVolumesPostOK) Error() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostOK  %+v", 200, o.Payload)
}

func (o *PcloudPvminstancesVolumesPostOK) String() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostOK  %+v", 200, o.Payload)
}

func (o *PcloudPvminstancesVolumesPostOK) GetPayload() models.Object {
	return o.Payload
}

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

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

	return nil
}

// NewPcloudPvminstancesVolumesPostBadRequest creates a PcloudPvminstancesVolumesPostBadRequest with default headers values
func NewPcloudPvminstancesVolumesPostBadRequest() *PcloudPvminstancesVolumesPostBadRequest {
	return &PcloudPvminstancesVolumesPostBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudPvminstancesVolumesPostUnauthorized creates a PcloudPvminstancesVolumesPostUnauthorized with default headers values
func NewPcloudPvminstancesVolumesPostUnauthorized() *PcloudPvminstancesVolumesPostUnauthorized {
	return &PcloudPvminstancesVolumesPostUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudPvminstancesVolumesPostForbidden creates a PcloudPvminstancesVolumesPostForbidden with default headers values
func NewPcloudPvminstancesVolumesPostForbidden() *PcloudPvminstancesVolumesPostForbidden {
	return &PcloudPvminstancesVolumesPostForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudPvminstancesVolumesPostNotFound creates a PcloudPvminstancesVolumesPostNotFound with default headers values
func NewPcloudPvminstancesVolumesPostNotFound() *PcloudPvminstancesVolumesPostNotFound {
	return &PcloudPvminstancesVolumesPostNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudPvminstancesVolumesPostConflict creates a PcloudPvminstancesVolumesPostConflict with default headers values
func NewPcloudPvminstancesVolumesPostConflict() *PcloudPvminstancesVolumesPostConflict {
	return &PcloudPvminstancesVolumesPostConflict{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudPvminstancesVolumesPostInternalServerError creates a PcloudPvminstancesVolumesPostInternalServerError with default headers values
func NewPcloudPvminstancesVolumesPostInternalServerError() *PcloudPvminstancesVolumesPostInternalServerError {
	return &PcloudPvminstancesVolumesPostInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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