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

package p_cloud_s_p_p_placement_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"
)

// PcloudSppplacementgroupsGetallReader is a Reader for the PcloudSppplacementgroupsGetall structure.
type PcloudSppplacementgroupsGetallReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudSppplacementgroupsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPcloudSppplacementgroupsGetallOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudSppplacementgroupsGetallBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudSppplacementgroupsGetallUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudSppplacementgroupsGetallForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudSppplacementgroupsGetallNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudSppplacementgroupsGetallInternalServerError()
		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}/spp-placement-groups] pcloud.sppplacementgroups.getall", response, response.Code())
	}
}

// NewPcloudSppplacementgroupsGetallOK creates a PcloudSppplacementgroupsGetallOK with default headers values
func NewPcloudSppplacementgroupsGetallOK() *PcloudSppplacementgroupsGetallOK {
	return &PcloudSppplacementgroupsGetallOK{}
}

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

OK
*/
type PcloudSppplacementgroupsGetallOK struct {
	Payload *models.SPPPlacementGroups
}

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

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

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

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

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

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

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

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

func (o *PcloudSppplacementgroupsGetallOK) GetPayload() *models.SPPPlacementGroups {
	return o.Payload
}

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

	o.Payload = new(models.SPPPlacementGroups)

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

	return nil
}

// NewPcloudSppplacementgroupsGetallBadRequest creates a PcloudSppplacementgroupsGetallBadRequest with default headers values
func NewPcloudSppplacementgroupsGetallBadRequest() *PcloudSppplacementgroupsGetallBadRequest {
	return &PcloudSppplacementgroupsGetallBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudSppplacementgroupsGetallUnauthorized creates a PcloudSppplacementgroupsGetallUnauthorized with default headers values
func NewPcloudSppplacementgroupsGetallUnauthorized() *PcloudSppplacementgroupsGetallUnauthorized {
	return &PcloudSppplacementgroupsGetallUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudSppplacementgroupsGetallForbidden creates a PcloudSppplacementgroupsGetallForbidden with default headers values
func NewPcloudSppplacementgroupsGetallForbidden() *PcloudSppplacementgroupsGetallForbidden {
	return &PcloudSppplacementgroupsGetallForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudSppplacementgroupsGetallNotFound creates a PcloudSppplacementgroupsGetallNotFound with default headers values
func NewPcloudSppplacementgroupsGetallNotFound() *PcloudSppplacementgroupsGetallNotFound {
	return &PcloudSppplacementgroupsGetallNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudSppplacementgroupsGetallInternalServerError creates a PcloudSppplacementgroupsGetallInternalServerError with default headers values
func NewPcloudSppplacementgroupsGetallInternalServerError() *PcloudSppplacementgroupsGetallInternalServerError {
	return &PcloudSppplacementgroupsGetallInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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