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

package internal_storage_regions

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

// InternalV1StorageRegionsStoragePoolsGetallReader is a Reader for the InternalV1StorageRegionsStoragePoolsGetall structure.
type InternalV1StorageRegionsStoragePoolsGetallReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *InternalV1StorageRegionsStoragePoolsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewInternalV1StorageRegionsStoragePoolsGetallOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewInternalV1StorageRegionsStoragePoolsGetallUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewInternalV1StorageRegionsStoragePoolsGetallForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewInternalV1StorageRegionsStoragePoolsGetallNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewInternalV1StorageRegionsStoragePoolsGetallInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools] internal.v1.storage.regions.storage-pools.getall", response, response.Code())
	}
}

// NewInternalV1StorageRegionsStoragePoolsGetallOK creates a InternalV1StorageRegionsStoragePoolsGetallOK with default headers values
func NewInternalV1StorageRegionsStoragePoolsGetallOK() *InternalV1StorageRegionsStoragePoolsGetallOK {
	return &InternalV1StorageRegionsStoragePoolsGetallOK{}
}

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

OK
*/
type InternalV1StorageRegionsStoragePoolsGetallOK struct {
	Payload models.StoragePools
}

// IsSuccess returns true when this internal v1 storage regions storage pools getall o k response has a 2xx status code
func (o *InternalV1StorageRegionsStoragePoolsGetallOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this internal v1 storage regions storage pools getall o k response has a 3xx status code
func (o *InternalV1StorageRegionsStoragePoolsGetallOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this internal v1 storage regions storage pools getall o k response has a 4xx status code
func (o *InternalV1StorageRegionsStoragePoolsGetallOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this internal v1 storage regions storage pools getall o k response has a 5xx status code
func (o *InternalV1StorageRegionsStoragePoolsGetallOK) IsServerError() bool {
	return false
}

// IsCode returns true when this internal v1 storage regions storage pools getall o k response a status code equal to that given
func (o *InternalV1StorageRegionsStoragePoolsGetallOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the internal v1 storage regions storage pools getall o k response
func (o *InternalV1StorageRegionsStoragePoolsGetallOK) Code() int {
	return 200
}

func (o *InternalV1StorageRegionsStoragePoolsGetallOK) Error() string {
	return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallOK  %+v", 200, o.Payload)
}

func (o *InternalV1StorageRegionsStoragePoolsGetallOK) String() string {
	return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallOK  %+v", 200, o.Payload)
}

func (o *InternalV1StorageRegionsStoragePoolsGetallOK) GetPayload() models.StoragePools {
	return o.Payload
}

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

// NewInternalV1StorageRegionsStoragePoolsGetallUnauthorized creates a InternalV1StorageRegionsStoragePoolsGetallUnauthorized with default headers values
func NewInternalV1StorageRegionsStoragePoolsGetallUnauthorized() *InternalV1StorageRegionsStoragePoolsGetallUnauthorized {
	return &InternalV1StorageRegionsStoragePoolsGetallUnauthorized{}
}

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

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

// IsSuccess returns true when this internal v1 storage regions storage pools getall unauthorized response has a 2xx status code
func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this internal v1 storage regions storage pools getall unauthorized response has a 3xx status code
func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this internal v1 storage regions storage pools getall unauthorized response has a 4xx status code
func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this internal v1 storage regions storage pools getall unauthorized response has a 5xx status code
func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this internal v1 storage regions storage pools getall unauthorized response a status code equal to that given
func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the internal v1 storage regions storage pools getall unauthorized response
func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) Code() int {
	return 401
}

func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) Error() string {
	return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallUnauthorized  %+v", 401, o.Payload)
}

func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) String() string {
	return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewInternalV1StorageRegionsStoragePoolsGetallForbidden creates a InternalV1StorageRegionsStoragePoolsGetallForbidden with default headers values
func NewInternalV1StorageRegionsStoragePoolsGetallForbidden() *InternalV1StorageRegionsStoragePoolsGetallForbidden {
	return &InternalV1StorageRegionsStoragePoolsGetallForbidden{}
}

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

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

// IsSuccess returns true when this internal v1 storage regions storage pools getall forbidden response has a 2xx status code
func (o *InternalV1StorageRegionsStoragePoolsGetallForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this internal v1 storage regions storage pools getall forbidden response has a 3xx status code
func (o *InternalV1StorageRegionsStoragePoolsGetallForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this internal v1 storage regions storage pools getall forbidden response has a 4xx status code
func (o *InternalV1StorageRegionsStoragePoolsGetallForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this internal v1 storage regions storage pools getall forbidden response has a 5xx status code
func (o *InternalV1StorageRegionsStoragePoolsGetallForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this internal v1 storage regions storage pools getall forbidden response a status code equal to that given
func (o *InternalV1StorageRegionsStoragePoolsGetallForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the internal v1 storage regions storage pools getall forbidden response
func (o *InternalV1StorageRegionsStoragePoolsGetallForbidden) Code() int {
	return 403
}

func (o *InternalV1StorageRegionsStoragePoolsGetallForbidden) Error() string {
	return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallForbidden  %+v", 403, o.Payload)
}

func (o *InternalV1StorageRegionsStoragePoolsGetallForbidden) String() string {
	return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallForbidden  %+v", 403, o.Payload)
}

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

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

// NewInternalV1StorageRegionsStoragePoolsGetallNotFound creates a InternalV1StorageRegionsStoragePoolsGetallNotFound with default headers values
func NewInternalV1StorageRegionsStoragePoolsGetallNotFound() *InternalV1StorageRegionsStoragePoolsGetallNotFound {
	return &InternalV1StorageRegionsStoragePoolsGetallNotFound{}
}

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

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

// IsSuccess returns true when this internal v1 storage regions storage pools getall not found response has a 2xx status code
func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this internal v1 storage regions storage pools getall not found response has a 3xx status code
func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this internal v1 storage regions storage pools getall not found response has a 4xx status code
func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this internal v1 storage regions storage pools getall not found response has a 5xx status code
func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this internal v1 storage regions storage pools getall not found response a status code equal to that given
func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the internal v1 storage regions storage pools getall not found response
func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) Code() int {
	return 404
}

func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) Error() string {
	return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallNotFound  %+v", 404, o.Payload)
}

func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) String() string {
	return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallNotFound  %+v", 404, o.Payload)
}

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

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

// NewInternalV1StorageRegionsStoragePoolsGetallInternalServerError creates a InternalV1StorageRegionsStoragePoolsGetallInternalServerError with default headers values
func NewInternalV1StorageRegionsStoragePoolsGetallInternalServerError() *InternalV1StorageRegionsStoragePoolsGetallInternalServerError {
	return &InternalV1StorageRegionsStoragePoolsGetallInternalServerError{}
}

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

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

// IsSuccess returns true when this internal v1 storage regions storage pools getall internal server error response has a 2xx status code
func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this internal v1 storage regions storage pools getall internal server error response has a 3xx status code
func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this internal v1 storage regions storage pools getall internal server error response has a 4xx status code
func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this internal v1 storage regions storage pools getall internal server error response has a 5xx status code
func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this internal v1 storage regions storage pools getall internal server error response a status code equal to that given
func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the internal v1 storage regions storage pools getall internal server error response
func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) Code() int {
	return 500
}

func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) Error() string {
	return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallInternalServerError  %+v", 500, o.Payload)
}

func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) String() string {
	return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallInternalServerError  %+v", 500, o.Payload)
}

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

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