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

package p_cloud_p_vm_instances

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

// PcloudPvminstancesPutReader is a Reader for the PcloudPvminstancesPut structure.
type PcloudPvminstancesPutReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PcloudPvminstancesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 202:
		result := NewPcloudPvminstancesPutAccepted()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPcloudPvminstancesPutBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPcloudPvminstancesPutUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPcloudPvminstancesPutForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPcloudPvminstancesPutNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPcloudPvminstancesPutUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPcloudPvminstancesPutInternalServerError()
		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}/pvm-instances/{pvm_instance_id}] pcloud.pvminstances.put", response, response.Code())
	}
}

// NewPcloudPvminstancesPutAccepted creates a PcloudPvminstancesPutAccepted with default headers values
func NewPcloudPvminstancesPutAccepted() *PcloudPvminstancesPutAccepted {
	return &PcloudPvminstancesPutAccepted{}
}

/*
PcloudPvminstancesPutAccepted describes a response with status code 202, with default header values.

Accepted (this is a long running operation)
*/
type PcloudPvminstancesPutAccepted struct {
	Payload *models.PVMInstanceUpdateResponse
}

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

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

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

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

// IsCode returns true when this pcloud pvminstances put accepted response a status code equal to that given
func (o *PcloudPvminstancesPutAccepted) IsCode(code int) bool {
	return code == 202
}

// Code gets the status code for the pcloud pvminstances put accepted response
func (o *PcloudPvminstancesPutAccepted) Code() int {
	return 202
}

func (o *PcloudPvminstancesPutAccepted) Error() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutAccepted  %+v", 202, o.Payload)
}

func (o *PcloudPvminstancesPutAccepted) String() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutAccepted  %+v", 202, o.Payload)
}

func (o *PcloudPvminstancesPutAccepted) GetPayload() *models.PVMInstanceUpdateResponse {
	return o.Payload
}

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

	o.Payload = new(models.PVMInstanceUpdateResponse)

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

	return nil
}

// NewPcloudPvminstancesPutBadRequest creates a PcloudPvminstancesPutBadRequest with default headers values
func NewPcloudPvminstancesPutBadRequest() *PcloudPvminstancesPutBadRequest {
	return &PcloudPvminstancesPutBadRequest{}
}

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

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

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

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

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

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

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

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

func (o *PcloudPvminstancesPutBadRequest) Error() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutBadRequest  %+v", 400, o.Payload)
}

func (o *PcloudPvminstancesPutBadRequest) String() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutBadRequest  %+v", 400, o.Payload)
}

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

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

// NewPcloudPvminstancesPutUnauthorized creates a PcloudPvminstancesPutUnauthorized with default headers values
func NewPcloudPvminstancesPutUnauthorized() *PcloudPvminstancesPutUnauthorized {
	return &PcloudPvminstancesPutUnauthorized{}
}

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

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

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

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

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

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

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

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

func (o *PcloudPvminstancesPutUnauthorized) Error() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutUnauthorized  %+v", 401, o.Payload)
}

func (o *PcloudPvminstancesPutUnauthorized) String() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewPcloudPvminstancesPutForbidden creates a PcloudPvminstancesPutForbidden with default headers values
func NewPcloudPvminstancesPutForbidden() *PcloudPvminstancesPutForbidden {
	return &PcloudPvminstancesPutForbidden{}
}

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

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

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

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

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

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

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

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

func (o *PcloudPvminstancesPutForbidden) Error() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutForbidden  %+v", 403, o.Payload)
}

func (o *PcloudPvminstancesPutForbidden) String() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutForbidden  %+v", 403, o.Payload)
}

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

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

// NewPcloudPvminstancesPutNotFound creates a PcloudPvminstancesPutNotFound with default headers values
func NewPcloudPvminstancesPutNotFound() *PcloudPvminstancesPutNotFound {
	return &PcloudPvminstancesPutNotFound{}
}

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

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

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

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

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

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

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

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

func (o *PcloudPvminstancesPutNotFound) Error() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutNotFound  %+v", 404, o.Payload)
}

func (o *PcloudPvminstancesPutNotFound) String() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutNotFound  %+v", 404, o.Payload)
}

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

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

// NewPcloudPvminstancesPutUnprocessableEntity creates a PcloudPvminstancesPutUnprocessableEntity with default headers values
func NewPcloudPvminstancesPutUnprocessableEntity() *PcloudPvminstancesPutUnprocessableEntity {
	return &PcloudPvminstancesPutUnprocessableEntity{}
}

/*
PcloudPvminstancesPutUnprocessableEntity describes a response with status code 422, with default header values.

Unprocessable Entity
*/
type PcloudPvminstancesPutUnprocessableEntity struct {
	Payload *models.Error
}

// IsSuccess returns true when this pcloud pvminstances put unprocessable entity response has a 2xx status code
func (o *PcloudPvminstancesPutUnprocessableEntity) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this pcloud pvminstances put unprocessable entity response has a 3xx status code
func (o *PcloudPvminstancesPutUnprocessableEntity) IsRedirect() bool {
	return false
}

// IsClientError returns true when this pcloud pvminstances put unprocessable entity response has a 4xx status code
func (o *PcloudPvminstancesPutUnprocessableEntity) IsClientError() bool {
	return true
}

// IsServerError returns true when this pcloud pvminstances put unprocessable entity response has a 5xx status code
func (o *PcloudPvminstancesPutUnprocessableEntity) IsServerError() bool {
	return false
}

// IsCode returns true when this pcloud pvminstances put unprocessable entity response a status code equal to that given
func (o *PcloudPvminstancesPutUnprocessableEntity) IsCode(code int) bool {
	return code == 422
}

// Code gets the status code for the pcloud pvminstances put unprocessable entity response
func (o *PcloudPvminstancesPutUnprocessableEntity) Code() int {
	return 422
}

func (o *PcloudPvminstancesPutUnprocessableEntity) Error() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *PcloudPvminstancesPutUnprocessableEntity) String() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutUnprocessableEntity  %+v", 422, o.Payload)
}

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

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

// NewPcloudPvminstancesPutInternalServerError creates a PcloudPvminstancesPutInternalServerError with default headers values
func NewPcloudPvminstancesPutInternalServerError() *PcloudPvminstancesPutInternalServerError {
	return &PcloudPvminstancesPutInternalServerError{}
}

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

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

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

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

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

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

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

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

func (o *PcloudPvminstancesPutInternalServerError) Error() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutInternalServerError  %+v", 500, o.Payload)
}

func (o *PcloudPvminstancesPutInternalServerError) String() string {
	return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutInternalServerError  %+v", 500, o.Payload)
}

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

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