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

// PcloudVolumegroupsGetReader is a Reader for the PcloudVolumegroupsGet structure.
type PcloudVolumegroupsGetReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudVolumegroupsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPcloudVolumegroupsGetOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudVolumegroupsGetBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudVolumegroupsGetUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudVolumegroupsGetForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudVolumegroupsGetNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudVolumegroupsGetInternalServerError()
		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}/volume-groups/{volume_group_id}] pcloud.volumegroups.get", response, response.Code())
	}
}

// NewPcloudVolumegroupsGetOK creates a PcloudVolumegroupsGetOK with default headers values
func NewPcloudVolumegroupsGetOK() *PcloudVolumegroupsGetOK {
	return &PcloudVolumegroupsGetOK{}
}

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

OK
*/
type PcloudVolumegroupsGetOK struct {
	Payload *models.VolumeGroup
}

// IsSuccess returns true when this pcloud volumegroups get o k response has a 2xx status code
func (o *PcloudVolumegroupsGetOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this pcloud volumegroups get o k response has a 3xx status code
func (o *PcloudVolumegroupsGetOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud volumegroups get o k response has a 4xx status code
func (o *PcloudVolumegroupsGetOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this pcloud volumegroups get o k response has a 5xx status code
func (o *PcloudVolumegroupsGetOK) IsServerError() bool {
	return false
}

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

// Code gets the status code for the pcloud volumegroups get o k response
func (o *PcloudVolumegroupsGetOK) Code() int {
	return 200
}

func (o *PcloudVolumegroupsGetOK) Error() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetOK  %+v", 200, o.Payload)
}

func (o *PcloudVolumegroupsGetOK) String() string {
	return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetOK  %+v", 200, o.Payload)
}

func (o *PcloudVolumegroupsGetOK) GetPayload() *models.VolumeGroup {
	return o.Payload
}

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

	o.Payload = new(models.VolumeGroup)

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

	return nil
}

// NewPcloudVolumegroupsGetBadRequest creates a PcloudVolumegroupsGetBadRequest with default headers values
func NewPcloudVolumegroupsGetBadRequest() *PcloudVolumegroupsGetBadRequest {
	return &PcloudVolumegroupsGetBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudVolumegroupsGetUnauthorized creates a PcloudVolumegroupsGetUnauthorized with default headers values
func NewPcloudVolumegroupsGetUnauthorized() *PcloudVolumegroupsGetUnauthorized {
	return &PcloudVolumegroupsGetUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudVolumegroupsGetForbidden creates a PcloudVolumegroupsGetForbidden with default headers values
func NewPcloudVolumegroupsGetForbidden() *PcloudVolumegroupsGetForbidden {
	return &PcloudVolumegroupsGetForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudVolumegroupsGetNotFound creates a PcloudVolumegroupsGetNotFound with default headers values
func NewPcloudVolumegroupsGetNotFound() *PcloudVolumegroupsGetNotFound {
	return &PcloudVolumegroupsGetNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudVolumegroupsGetInternalServerError creates a PcloudVolumegroupsGetInternalServerError with default headers values
func NewPcloudVolumegroupsGetInternalServerError() *PcloudVolumegroupsGetInternalServerError {
	return &PcloudVolumegroupsGetInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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