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

package instance

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"encoding/json"
	"fmt"
	"io"

	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"

	"git.coopcloud.tech/decentral1se/gtslib/models"
)

// InstanceUpdateReader is a Reader for the InstanceUpdate structure.
type InstanceUpdateReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *InstanceUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewInstanceUpdateOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewInstanceUpdateBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewInstanceUpdateUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewInstanceUpdateForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewInstanceUpdateNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 406:
		result := NewInstanceUpdateNotAcceptable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewInstanceUpdateInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PATCH /api/v1/instance] instanceUpdate", response, response.Code())
	}
}

// NewInstanceUpdateOK creates a InstanceUpdateOK with default headers values
func NewInstanceUpdateOK() *InstanceUpdateOK {
	return &InstanceUpdateOK{}
}

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

The newly updated instance.
*/
type InstanceUpdateOK struct {
	Payload *models.InstanceV1
}

// IsSuccess returns true when this instance update o k response has a 2xx status code
func (o *InstanceUpdateOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this instance update o k response has a 3xx status code
func (o *InstanceUpdateOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this instance update o k response has a 4xx status code
func (o *InstanceUpdateOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this instance update o k response has a 5xx status code
func (o *InstanceUpdateOK) IsServerError() bool {
	return false
}

// IsCode returns true when this instance update o k response a status code equal to that given
func (o *InstanceUpdateOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the instance update o k response
func (o *InstanceUpdateOK) Code() int {
	return 200
}

func (o *InstanceUpdateOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PATCH /api/v1/instance][%d] instanceUpdateOK %s", 200, payload)
}

func (o *InstanceUpdateOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PATCH /api/v1/instance][%d] instanceUpdateOK %s", 200, payload)
}

func (o *InstanceUpdateOK) GetPayload() *models.InstanceV1 {
	return o.Payload
}

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

	o.Payload = new(models.InstanceV1)

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

	return nil
}

// NewInstanceUpdateBadRequest creates a InstanceUpdateBadRequest with default headers values
func NewInstanceUpdateBadRequest() *InstanceUpdateBadRequest {
	return &InstanceUpdateBadRequest{}
}

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

bad request
*/
type InstanceUpdateBadRequest struct {
}

// IsSuccess returns true when this instance update bad request response has a 2xx status code
func (o *InstanceUpdateBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this instance update bad request response has a 3xx status code
func (o *InstanceUpdateBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this instance update bad request response has a 4xx status code
func (o *InstanceUpdateBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this instance update bad request response has a 5xx status code
func (o *InstanceUpdateBadRequest) IsServerError() bool {
	return false
}

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

// Code gets the status code for the instance update bad request response
func (o *InstanceUpdateBadRequest) Code() int {
	return 400
}

func (o *InstanceUpdateBadRequest) Error() string {
	return fmt.Sprintf("[PATCH /api/v1/instance][%d] instanceUpdateBadRequest", 400)
}

func (o *InstanceUpdateBadRequest) String() string {
	return fmt.Sprintf("[PATCH /api/v1/instance][%d] instanceUpdateBadRequest", 400)
}

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

	return nil
}

// NewInstanceUpdateUnauthorized creates a InstanceUpdateUnauthorized with default headers values
func NewInstanceUpdateUnauthorized() *InstanceUpdateUnauthorized {
	return &InstanceUpdateUnauthorized{}
}

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

unauthorized
*/
type InstanceUpdateUnauthorized struct {
}

// IsSuccess returns true when this instance update unauthorized response has a 2xx status code
func (o *InstanceUpdateUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this instance update unauthorized response has a 3xx status code
func (o *InstanceUpdateUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this instance update unauthorized response has a 4xx status code
func (o *InstanceUpdateUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this instance update unauthorized response has a 5xx status code
func (o *InstanceUpdateUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this instance update unauthorized response a status code equal to that given
func (o *InstanceUpdateUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the instance update unauthorized response
func (o *InstanceUpdateUnauthorized) Code() int {
	return 401
}

func (o *InstanceUpdateUnauthorized) Error() string {
	return fmt.Sprintf("[PATCH /api/v1/instance][%d] instanceUpdateUnauthorized", 401)
}

func (o *InstanceUpdateUnauthorized) String() string {
	return fmt.Sprintf("[PATCH /api/v1/instance][%d] instanceUpdateUnauthorized", 401)
}

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

	return nil
}

// NewInstanceUpdateForbidden creates a InstanceUpdateForbidden with default headers values
func NewInstanceUpdateForbidden() *InstanceUpdateForbidden {
	return &InstanceUpdateForbidden{}
}

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

forbidden
*/
type InstanceUpdateForbidden struct {
}

// IsSuccess returns true when this instance update forbidden response has a 2xx status code
func (o *InstanceUpdateForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this instance update forbidden response has a 3xx status code
func (o *InstanceUpdateForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this instance update forbidden response has a 4xx status code
func (o *InstanceUpdateForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this instance update forbidden response has a 5xx status code
func (o *InstanceUpdateForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this instance update forbidden response a status code equal to that given
func (o *InstanceUpdateForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the instance update forbidden response
func (o *InstanceUpdateForbidden) Code() int {
	return 403
}

func (o *InstanceUpdateForbidden) Error() string {
	return fmt.Sprintf("[PATCH /api/v1/instance][%d] instanceUpdateForbidden", 403)
}

func (o *InstanceUpdateForbidden) String() string {
	return fmt.Sprintf("[PATCH /api/v1/instance][%d] instanceUpdateForbidden", 403)
}

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

	return nil
}

// NewInstanceUpdateNotFound creates a InstanceUpdateNotFound with default headers values
func NewInstanceUpdateNotFound() *InstanceUpdateNotFound {
	return &InstanceUpdateNotFound{}
}

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

not found
*/
type InstanceUpdateNotFound struct {
}

// IsSuccess returns true when this instance update not found response has a 2xx status code
func (o *InstanceUpdateNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this instance update not found response has a 3xx status code
func (o *InstanceUpdateNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this instance update not found response has a 4xx status code
func (o *InstanceUpdateNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this instance update not found response has a 5xx status code
func (o *InstanceUpdateNotFound) IsServerError() bool {
	return false
}

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

// Code gets the status code for the instance update not found response
func (o *InstanceUpdateNotFound) Code() int {
	return 404
}

func (o *InstanceUpdateNotFound) Error() string {
	return fmt.Sprintf("[PATCH /api/v1/instance][%d] instanceUpdateNotFound", 404)
}

func (o *InstanceUpdateNotFound) String() string {
	return fmt.Sprintf("[PATCH /api/v1/instance][%d] instanceUpdateNotFound", 404)
}

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

	return nil
}

// NewInstanceUpdateNotAcceptable creates a InstanceUpdateNotAcceptable with default headers values
func NewInstanceUpdateNotAcceptable() *InstanceUpdateNotAcceptable {
	return &InstanceUpdateNotAcceptable{}
}

/*
InstanceUpdateNotAcceptable describes a response with status code 406, with default header values.

not acceptable
*/
type InstanceUpdateNotAcceptable struct {
}

// IsSuccess returns true when this instance update not acceptable response has a 2xx status code
func (o *InstanceUpdateNotAcceptable) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this instance update not acceptable response has a 3xx status code
func (o *InstanceUpdateNotAcceptable) IsRedirect() bool {
	return false
}

// IsClientError returns true when this instance update not acceptable response has a 4xx status code
func (o *InstanceUpdateNotAcceptable) IsClientError() bool {
	return true
}

// IsServerError returns true when this instance update not acceptable response has a 5xx status code
func (o *InstanceUpdateNotAcceptable) IsServerError() bool {
	return false
}

// IsCode returns true when this instance update not acceptable response a status code equal to that given
func (o *InstanceUpdateNotAcceptable) IsCode(code int) bool {
	return code == 406
}

// Code gets the status code for the instance update not acceptable response
func (o *InstanceUpdateNotAcceptable) Code() int {
	return 406
}

func (o *InstanceUpdateNotAcceptable) Error() string {
	return fmt.Sprintf("[PATCH /api/v1/instance][%d] instanceUpdateNotAcceptable", 406)
}

func (o *InstanceUpdateNotAcceptable) String() string {
	return fmt.Sprintf("[PATCH /api/v1/instance][%d] instanceUpdateNotAcceptable", 406)
}

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

	return nil
}

// NewInstanceUpdateInternalServerError creates a InstanceUpdateInternalServerError with default headers values
func NewInstanceUpdateInternalServerError() *InstanceUpdateInternalServerError {
	return &InstanceUpdateInternalServerError{}
}

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

internal server error
*/
type InstanceUpdateInternalServerError struct {
}

// IsSuccess returns true when this instance update internal server error response has a 2xx status code
func (o *InstanceUpdateInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this instance update internal server error response has a 3xx status code
func (o *InstanceUpdateInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this instance update internal server error response has a 4xx status code
func (o *InstanceUpdateInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this instance update internal server error response has a 5xx status code
func (o *InstanceUpdateInternalServerError) IsServerError() bool {
	return true
}

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

// Code gets the status code for the instance update internal server error response
func (o *InstanceUpdateInternalServerError) Code() int {
	return 500
}

func (o *InstanceUpdateInternalServerError) Error() string {
	return fmt.Sprintf("[PATCH /api/v1/instance][%d] instanceUpdateInternalServerError", 500)
}

func (o *InstanceUpdateInternalServerError) String() string {
	return fmt.Sprintf("[PATCH /api/v1/instance][%d] instanceUpdateInternalServerError", 500)
}

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

	return nil
}
