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

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

// PcloudPlacementgroupsGetallReader is a Reader for the PcloudPlacementgroupsGetall structure.
type PcloudPlacementgroupsGetallReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudPlacementgroupsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPcloudPlacementgroupsGetallOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudPlacementgroupsGetallBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudPlacementgroupsGetallUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudPlacementgroupsGetallForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudPlacementgroupsGetallNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudPlacementgroupsGetallInternalServerError()
		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}/placement-groups] pcloud.placementgroups.getall", response, response.Code())
	}
}

// NewPcloudPlacementgroupsGetallOK creates a PcloudPlacementgroupsGetallOK with default headers values
func NewPcloudPlacementgroupsGetallOK() *PcloudPlacementgroupsGetallOK {
	return &PcloudPlacementgroupsGetallOK{}
}

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

OK
*/
type PcloudPlacementgroupsGetallOK struct {
	Payload *models.PlacementGroups
}

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

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

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

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

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

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

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

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

func (o *PcloudPlacementgroupsGetallOK) GetPayload() *models.PlacementGroups {
	return o.Payload
}

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

	o.Payload = new(models.PlacementGroups)

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

	return nil
}

// NewPcloudPlacementgroupsGetallBadRequest creates a PcloudPlacementgroupsGetallBadRequest with default headers values
func NewPcloudPlacementgroupsGetallBadRequest() *PcloudPlacementgroupsGetallBadRequest {
	return &PcloudPlacementgroupsGetallBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudPlacementgroupsGetallUnauthorized creates a PcloudPlacementgroupsGetallUnauthorized with default headers values
func NewPcloudPlacementgroupsGetallUnauthorized() *PcloudPlacementgroupsGetallUnauthorized {
	return &PcloudPlacementgroupsGetallUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudPlacementgroupsGetallForbidden creates a PcloudPlacementgroupsGetallForbidden with default headers values
func NewPcloudPlacementgroupsGetallForbidden() *PcloudPlacementgroupsGetallForbidden {
	return &PcloudPlacementgroupsGetallForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudPlacementgroupsGetallNotFound creates a PcloudPlacementgroupsGetallNotFound with default headers values
func NewPcloudPlacementgroupsGetallNotFound() *PcloudPlacementgroupsGetallNotFound {
	return &PcloudPlacementgroupsGetallNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPcloudPlacementgroupsGetallInternalServerError creates a PcloudPlacementgroupsGetallInternalServerError with default headers values
func NewPcloudPlacementgroupsGetallInternalServerError() *PcloudPlacementgroupsGetallInternalServerError {
	return &PcloudPlacementgroupsGetallInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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