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

package p_cloud_system_pools

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

// PcloudSystempoolsGetReader is a Reader for the PcloudSystempoolsGet structure.
type PcloudSystempoolsGetReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudSystempoolsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPcloudSystempoolsGetOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudSystempoolsGetBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudSystempoolsGetUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudSystempoolsGetForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudSystempoolsGetNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudSystempoolsGetInternalServerError()
		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}/system-pools] pcloud.systempools.get", response, response.Code())
	}
}

// NewPcloudSystempoolsGetOK creates a PcloudSystempoolsGetOK with default headers values
func NewPcloudSystempoolsGetOK() *PcloudSystempoolsGetOK {
	return &PcloudSystempoolsGetOK{}
}

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

OK
*/
type PcloudSystempoolsGetOK struct {
	Payload models.SystemPools
}

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

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

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

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

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

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

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

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

func (o *PcloudSystempoolsGetOK) GetPayload() models.SystemPools {
	return o.Payload
}

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

// NewPcloudSystempoolsGetBadRequest creates a PcloudSystempoolsGetBadRequest with default headers values
func NewPcloudSystempoolsGetBadRequest() *PcloudSystempoolsGetBadRequest {
	return &PcloudSystempoolsGetBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudSystempoolsGetUnauthorized creates a PcloudSystempoolsGetUnauthorized with default headers values
func NewPcloudSystempoolsGetUnauthorized() *PcloudSystempoolsGetUnauthorized {
	return &PcloudSystempoolsGetUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudSystempoolsGetForbidden creates a PcloudSystempoolsGetForbidden with default headers values
func NewPcloudSystempoolsGetForbidden() *PcloudSystempoolsGetForbidden {
	return &PcloudSystempoolsGetForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudSystempoolsGetNotFound creates a PcloudSystempoolsGetNotFound with default headers values
func NewPcloudSystempoolsGetNotFound() *PcloudSystempoolsGetNotFound {
	return &PcloudSystempoolsGetNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudSystempoolsGetInternalServerError creates a PcloudSystempoolsGetInternalServerError with default headers values
func NewPcloudSystempoolsGetInternalServerError() *PcloudSystempoolsGetInternalServerError {
	return &PcloudSystempoolsGetInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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