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

// PcloudCloudinstancesVolumesActionPostReader is a Reader for the PcloudCloudinstancesVolumesActionPost structure.
type PcloudCloudinstancesVolumesActionPostReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudCloudinstancesVolumesActionPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 202:
		result := NewPcloudCloudinstancesVolumesActionPostAccepted()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudCloudinstancesVolumesActionPostBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudCloudinstancesVolumesActionPostUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudCloudinstancesVolumesActionPostForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudCloudinstancesVolumesActionPostNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 409:
		result := NewPcloudCloudinstancesVolumesActionPostConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudCloudinstancesVolumesActionPostInternalServerError()
		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}/volumes/{volume_id}/action] pcloud.cloudinstances.volumes.action.post", response, response.Code())
	}
}

// NewPcloudCloudinstancesVolumesActionPostAccepted creates a PcloudCloudinstancesVolumesActionPostAccepted with default headers values
func NewPcloudCloudinstancesVolumesActionPostAccepted() *PcloudCloudinstancesVolumesActionPostAccepted {
	return &PcloudCloudinstancesVolumesActionPostAccepted{}
}

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

Accepted
*/
type PcloudCloudinstancesVolumesActionPostAccepted struct {
	Payload models.Object
}

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

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

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

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

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

// Code gets the status code for the pcloud cloudinstances volumes action post accepted response
func (o *PcloudCloudinstancesVolumesActionPostAccepted) Code() int {
	return 202
}

func (o *PcloudCloudinstancesVolumesActionPostAccepted) Error() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostAccepted  %+v", 202, o.Payload)
}

func (o *PcloudCloudinstancesVolumesActionPostAccepted) String() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostAccepted  %+v", 202, o.Payload)
}

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

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

// NewPcloudCloudinstancesVolumesActionPostBadRequest creates a PcloudCloudinstancesVolumesActionPostBadRequest with default headers values
func NewPcloudCloudinstancesVolumesActionPostBadRequest() *PcloudCloudinstancesVolumesActionPostBadRequest {
	return &PcloudCloudinstancesVolumesActionPostBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudCloudinstancesVolumesActionPostUnauthorized creates a PcloudCloudinstancesVolumesActionPostUnauthorized with default headers values
func NewPcloudCloudinstancesVolumesActionPostUnauthorized() *PcloudCloudinstancesVolumesActionPostUnauthorized {
	return &PcloudCloudinstancesVolumesActionPostUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudCloudinstancesVolumesActionPostForbidden creates a PcloudCloudinstancesVolumesActionPostForbidden with default headers values
func NewPcloudCloudinstancesVolumesActionPostForbidden() *PcloudCloudinstancesVolumesActionPostForbidden {
	return &PcloudCloudinstancesVolumesActionPostForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudCloudinstancesVolumesActionPostNotFound creates a PcloudCloudinstancesVolumesActionPostNotFound with default headers values
func NewPcloudCloudinstancesVolumesActionPostNotFound() *PcloudCloudinstancesVolumesActionPostNotFound {
	return &PcloudCloudinstancesVolumesActionPostNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudCloudinstancesVolumesActionPostConflict creates a PcloudCloudinstancesVolumesActionPostConflict with default headers values
func NewPcloudCloudinstancesVolumesActionPostConflict() *PcloudCloudinstancesVolumesActionPostConflict {
	return &PcloudCloudinstancesVolumesActionPostConflict{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudCloudinstancesVolumesActionPostInternalServerError creates a PcloudCloudinstancesVolumesActionPostInternalServerError with default headers values
func NewPcloudCloudinstancesVolumesActionPostInternalServerError() *PcloudCloudinstancesVolumesActionPostInternalServerError {
	return &PcloudCloudinstancesVolumesActionPostInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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