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

// PcloudCloudinstancesVolumesGetallReader is a Reader for the PcloudCloudinstancesVolumesGetall structure.
type PcloudCloudinstancesVolumesGetallReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudCloudinstancesVolumesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPcloudCloudinstancesVolumesGetallOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudCloudinstancesVolumesGetallBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudCloudinstancesVolumesGetallUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudCloudinstancesVolumesGetallForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudCloudinstancesVolumesGetallNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudCloudinstancesVolumesGetallInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes] pcloud.cloudinstances.volumes.getall", response, response.Code())
	}
}

// NewPcloudCloudinstancesVolumesGetallOK creates a PcloudCloudinstancesVolumesGetallOK with default headers values
func NewPcloudCloudinstancesVolumesGetallOK() *PcloudCloudinstancesVolumesGetallOK {
	return &PcloudCloudinstancesVolumesGetallOK{}
}

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

OK
*/
type PcloudCloudinstancesVolumesGetallOK struct {
	Payload *models.Volumes
}

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

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

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

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

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

// Code gets the status code for the pcloud cloudinstances volumes getall o k response
func (o *PcloudCloudinstancesVolumesGetallOK) Code() int {
	return 200
}

func (o *PcloudCloudinstancesVolumesGetallOK) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallOK  %+v", 200, o.Payload)
}

func (o *PcloudCloudinstancesVolumesGetallOK) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallOK  %+v", 200, o.Payload)
}

func (o *PcloudCloudinstancesVolumesGetallOK) GetPayload() *models.Volumes {
	return o.Payload
}

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

	o.Payload = new(models.Volumes)

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

	return nil
}

// NewPcloudCloudinstancesVolumesGetallBadRequest creates a PcloudCloudinstancesVolumesGetallBadRequest with default headers values
func NewPcloudCloudinstancesVolumesGetallBadRequest() *PcloudCloudinstancesVolumesGetallBadRequest {
	return &PcloudCloudinstancesVolumesGetallBadRequest{}
}

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

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

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

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

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

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

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

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

func (o *PcloudCloudinstancesVolumesGetallBadRequest) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallBadRequest  %+v", 400, o.Payload)
}

func (o *PcloudCloudinstancesVolumesGetallBadRequest) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallBadRequest  %+v", 400, o.Payload)
}

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

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

// NewPcloudCloudinstancesVolumesGetallUnauthorized creates a PcloudCloudinstancesVolumesGetallUnauthorized with default headers values
func NewPcloudCloudinstancesVolumesGetallUnauthorized() *PcloudCloudinstancesVolumesGetallUnauthorized {
	return &PcloudCloudinstancesVolumesGetallUnauthorized{}
}

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

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

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

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

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

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

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

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

func (o *PcloudCloudinstancesVolumesGetallUnauthorized) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallUnauthorized  %+v", 401, o.Payload)
}

func (o *PcloudCloudinstancesVolumesGetallUnauthorized) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewPcloudCloudinstancesVolumesGetallForbidden creates a PcloudCloudinstancesVolumesGetallForbidden with default headers values
func NewPcloudCloudinstancesVolumesGetallForbidden() *PcloudCloudinstancesVolumesGetallForbidden {
	return &PcloudCloudinstancesVolumesGetallForbidden{}
}

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

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

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

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

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

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

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

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

func (o *PcloudCloudinstancesVolumesGetallForbidden) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallForbidden  %+v", 403, o.Payload)
}

func (o *PcloudCloudinstancesVolumesGetallForbidden) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallForbidden  %+v", 403, o.Payload)
}

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

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

// NewPcloudCloudinstancesVolumesGetallNotFound creates a PcloudCloudinstancesVolumesGetallNotFound with default headers values
func NewPcloudCloudinstancesVolumesGetallNotFound() *PcloudCloudinstancesVolumesGetallNotFound {
	return &PcloudCloudinstancesVolumesGetallNotFound{}
}

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

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

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

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

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

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

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

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

func (o *PcloudCloudinstancesVolumesGetallNotFound) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallNotFound  %+v", 404, o.Payload)
}

func (o *PcloudCloudinstancesVolumesGetallNotFound) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallNotFound  %+v", 404, o.Payload)
}

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

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

// NewPcloudCloudinstancesVolumesGetallInternalServerError creates a PcloudCloudinstancesVolumesGetallInternalServerError with default headers values
func NewPcloudCloudinstancesVolumesGetallInternalServerError() *PcloudCloudinstancesVolumesGetallInternalServerError {
	return &PcloudCloudinstancesVolumesGetallInternalServerError{}
}

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

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

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

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

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

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

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

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

func (o *PcloudCloudinstancesVolumesGetallInternalServerError) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallInternalServerError  %+v", 500, o.Payload)
}

func (o *PcloudCloudinstancesVolumesGetallInternalServerError) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallInternalServerError  %+v", 500, o.Payload)
}

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

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