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

package p_cloud_volume_groups

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

// PcloudVolumegroupsActionPostReader is a Reader for the PcloudVolumegroupsActionPost structure.
type PcloudVolumegroupsActionPostReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudVolumegroupsActionPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 202:
		result := NewPcloudVolumegroupsActionPostAccepted()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudVolumegroupsActionPostBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudVolumegroupsActionPostUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudVolumegroupsActionPostForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudVolumegroupsActionPostNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPcloudVolumegroupsActionPostUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudVolumegroupsActionPostInternalServerError()
		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}/volume-groups/{volume_group_id}/action] pcloud.volumegroups.action.post", response, response.Code())
	}
}

// NewPcloudVolumegroupsActionPostAccepted creates a PcloudVolumegroupsActionPostAccepted with default headers values
func NewPcloudVolumegroupsActionPostAccepted() *PcloudVolumegroupsActionPostAccepted {
	return &PcloudVolumegroupsActionPostAccepted{}
}

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

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

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

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

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

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

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

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

func (o *PcloudVolumegroupsActionPostAccepted) Error() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostAccepted  %+v", 202, o.Payload)
}

func (o *PcloudVolumegroupsActionPostAccepted) String() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostAccepted  %+v", 202, o.Payload)
}

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

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

// NewPcloudVolumegroupsActionPostBadRequest creates a PcloudVolumegroupsActionPostBadRequest with default headers values
func NewPcloudVolumegroupsActionPostBadRequest() *PcloudVolumegroupsActionPostBadRequest {
	return &PcloudVolumegroupsActionPostBadRequest{}
}

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

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

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

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

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

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

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

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

func (o *PcloudVolumegroupsActionPostBadRequest) Error() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostBadRequest  %+v", 400, o.Payload)
}

func (o *PcloudVolumegroupsActionPostBadRequest) String() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostBadRequest  %+v", 400, o.Payload)
}

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

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

// NewPcloudVolumegroupsActionPostUnauthorized creates a PcloudVolumegroupsActionPostUnauthorized with default headers values
func NewPcloudVolumegroupsActionPostUnauthorized() *PcloudVolumegroupsActionPostUnauthorized {
	return &PcloudVolumegroupsActionPostUnauthorized{}
}

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

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

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

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

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

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

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

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

func (o *PcloudVolumegroupsActionPostUnauthorized) Error() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostUnauthorized  %+v", 401, o.Payload)
}

func (o *PcloudVolumegroupsActionPostUnauthorized) String() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewPcloudVolumegroupsActionPostForbidden creates a PcloudVolumegroupsActionPostForbidden with default headers values
func NewPcloudVolumegroupsActionPostForbidden() *PcloudVolumegroupsActionPostForbidden {
	return &PcloudVolumegroupsActionPostForbidden{}
}

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

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

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

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

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

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

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

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

func (o *PcloudVolumegroupsActionPostForbidden) Error() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostForbidden  %+v", 403, o.Payload)
}

func (o *PcloudVolumegroupsActionPostForbidden) String() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostForbidden  %+v", 403, o.Payload)
}

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

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

// NewPcloudVolumegroupsActionPostNotFound creates a PcloudVolumegroupsActionPostNotFound with default headers values
func NewPcloudVolumegroupsActionPostNotFound() *PcloudVolumegroupsActionPostNotFound {
	return &PcloudVolumegroupsActionPostNotFound{}
}

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

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

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

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

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

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

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

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

func (o *PcloudVolumegroupsActionPostNotFound) Error() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostNotFound  %+v", 404, o.Payload)
}

func (o *PcloudVolumegroupsActionPostNotFound) String() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostNotFound  %+v", 404, o.Payload)
}

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

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

// NewPcloudVolumegroupsActionPostUnprocessableEntity creates a PcloudVolumegroupsActionPostUnprocessableEntity with default headers values
func NewPcloudVolumegroupsActionPostUnprocessableEntity() *PcloudVolumegroupsActionPostUnprocessableEntity {
	return &PcloudVolumegroupsActionPostUnprocessableEntity{}
}

/*
PcloudVolumegroupsActionPostUnprocessableEntity describes a response with status code 422, with default header values.

Unprocessable Entity
*/
type PcloudVolumegroupsActionPostUnprocessableEntity struct {
	Payload *models.Error
}

// IsSuccess returns true when this pcloud volumegroups action post unprocessable entity response has a 2xx status code
func (o *PcloudVolumegroupsActionPostUnprocessableEntity) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this pcloud volumegroups action post unprocessable entity response has a 3xx status code
func (o *PcloudVolumegroupsActionPostUnprocessableEntity) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud volumegroups action post unprocessable entity response has a 4xx status code
func (o *PcloudVolumegroupsActionPostUnprocessableEntity) IsClientError() bool {
	return true
}

// IsServerError returns true when this pcloud volumegroups action post unprocessable entity response has a 5xx status code
func (o *PcloudVolumegroupsActionPostUnprocessableEntity) IsServerError() bool {
	return false
}

// IsCode returns true when this pcloud volumegroups action post unprocessable entity response a status code equal to that given
func (o *PcloudVolumegroupsActionPostUnprocessableEntity) IsCode(code int) bool {
	return code == 422
}

// Code gets the status code for the pcloud volumegroups action post unprocessable entity response
func (o *PcloudVolumegroupsActionPostUnprocessableEntity) Code() int {
	return 422
}

func (o *PcloudVolumegroupsActionPostUnprocessableEntity) Error() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *PcloudVolumegroupsActionPostUnprocessableEntity) String() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostUnprocessableEntity  %+v", 422, o.Payload)
}

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

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

// NewPcloudVolumegroupsActionPostInternalServerError creates a PcloudVolumegroupsActionPostInternalServerError with default headers values
func NewPcloudVolumegroupsActionPostInternalServerError() *PcloudVolumegroupsActionPostInternalServerError {
	return &PcloudVolumegroupsActionPostInternalServerError{}
}

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

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

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

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

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

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

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

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

func (o *PcloudVolumegroupsActionPostInternalServerError) Error() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostInternalServerError  %+v", 500, o.Payload)
}

func (o *PcloudVolumegroupsActionPostInternalServerError) String() string {
	return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostInternalServerError  %+v", 500, o.Payload)
}

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

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