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

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

// PcloudSharedprocessorpoolsPutReader is a Reader for the PcloudSharedprocessorpoolsPut structure.
type PcloudSharedprocessorpoolsPutReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudSharedprocessorpoolsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPcloudSharedprocessorpoolsPutOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudSharedprocessorpoolsPutBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudSharedprocessorpoolsPutUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudSharedprocessorpoolsPutForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudSharedprocessorpoolsPutNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudSharedprocessorpoolsPutInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}] pcloud.sharedprocessorpools.put", response, response.Code())
	}
}

// NewPcloudSharedprocessorpoolsPutOK creates a PcloudSharedprocessorpoolsPutOK with default headers values
func NewPcloudSharedprocessorpoolsPutOK() *PcloudSharedprocessorpoolsPutOK {
	return &PcloudSharedprocessorpoolsPutOK{}
}

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

OK
*/
type PcloudSharedprocessorpoolsPutOK struct {
	Payload *models.SharedProcessorPool
}

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

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

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

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

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

// Code gets the status code for the pcloud sharedprocessorpools put o k response
func (o *PcloudSharedprocessorpoolsPutOK) Code() int {
	return 200
}

func (o *PcloudSharedprocessorpoolsPutOK) Error() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutOK  %+v", 200, o.Payload)
}

func (o *PcloudSharedprocessorpoolsPutOK) String() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutOK  %+v", 200, o.Payload)
}

func (o *PcloudSharedprocessorpoolsPutOK) GetPayload() *models.SharedProcessorPool {
	return o.Payload
}

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

	o.Payload = new(models.SharedProcessorPool)

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

	return nil
}

// NewPcloudSharedprocessorpoolsPutBadRequest creates a PcloudSharedprocessorpoolsPutBadRequest with default headers values
func NewPcloudSharedprocessorpoolsPutBadRequest() *PcloudSharedprocessorpoolsPutBadRequest {
	return &PcloudSharedprocessorpoolsPutBadRequest{}
}

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

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

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

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

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

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

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

// Code gets the status code for the pcloud sharedprocessorpools put bad request response
func (o *PcloudSharedprocessorpoolsPutBadRequest) Code() int {
	return 400
}

func (o *PcloudSharedprocessorpoolsPutBadRequest) Error() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutBadRequest  %+v", 400, o.Payload)
}

func (o *PcloudSharedprocessorpoolsPutBadRequest) String() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutBadRequest  %+v", 400, o.Payload)
}

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

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

// NewPcloudSharedprocessorpoolsPutUnauthorized creates a PcloudSharedprocessorpoolsPutUnauthorized with default headers values
func NewPcloudSharedprocessorpoolsPutUnauthorized() *PcloudSharedprocessorpoolsPutUnauthorized {
	return &PcloudSharedprocessorpoolsPutUnauthorized{}
}

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

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

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

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

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

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

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

// Code gets the status code for the pcloud sharedprocessorpools put unauthorized response
func (o *PcloudSharedprocessorpoolsPutUnauthorized) Code() int {
	return 401
}

func (o *PcloudSharedprocessorpoolsPutUnauthorized) Error() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutUnauthorized  %+v", 401, o.Payload)
}

func (o *PcloudSharedprocessorpoolsPutUnauthorized) String() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewPcloudSharedprocessorpoolsPutForbidden creates a PcloudSharedprocessorpoolsPutForbidden with default headers values
func NewPcloudSharedprocessorpoolsPutForbidden() *PcloudSharedprocessorpoolsPutForbidden {
	return &PcloudSharedprocessorpoolsPutForbidden{}
}

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

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

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

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

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

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

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

// Code gets the status code for the pcloud sharedprocessorpools put forbidden response
func (o *PcloudSharedprocessorpoolsPutForbidden) Code() int {
	return 403
}

func (o *PcloudSharedprocessorpoolsPutForbidden) Error() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutForbidden  %+v", 403, o.Payload)
}

func (o *PcloudSharedprocessorpoolsPutForbidden) String() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutForbidden  %+v", 403, o.Payload)
}

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

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

// NewPcloudSharedprocessorpoolsPutNotFound creates a PcloudSharedprocessorpoolsPutNotFound with default headers values
func NewPcloudSharedprocessorpoolsPutNotFound() *PcloudSharedprocessorpoolsPutNotFound {
	return &PcloudSharedprocessorpoolsPutNotFound{}
}

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

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

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

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

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

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

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

// Code gets the status code for the pcloud sharedprocessorpools put not found response
func (o *PcloudSharedprocessorpoolsPutNotFound) Code() int {
	return 404
}

func (o *PcloudSharedprocessorpoolsPutNotFound) Error() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutNotFound  %+v", 404, o.Payload)
}

func (o *PcloudSharedprocessorpoolsPutNotFound) String() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutNotFound  %+v", 404, o.Payload)
}

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

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

// NewPcloudSharedprocessorpoolsPutInternalServerError creates a PcloudSharedprocessorpoolsPutInternalServerError with default headers values
func NewPcloudSharedprocessorpoolsPutInternalServerError() *PcloudSharedprocessorpoolsPutInternalServerError {
	return &PcloudSharedprocessorpoolsPutInternalServerError{}
}

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

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

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

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

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

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

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

// Code gets the status code for the pcloud sharedprocessorpools put internal server error response
func (o *PcloudSharedprocessorpoolsPutInternalServerError) Code() int {
	return 500
}

func (o *PcloudSharedprocessorpoolsPutInternalServerError) Error() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutInternalServerError  %+v", 500, o.Payload)
}

func (o *PcloudSharedprocessorpoolsPutInternalServerError) String() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutInternalServerError  %+v", 500, o.Payload)
}

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

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