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

package manifests

// 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/openshift/assisted-service/models"
)

// V2UpdateClusterManifestReader is a Reader for the V2UpdateClusterManifest structure.
type V2UpdateClusterManifestReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *V2UpdateClusterManifestReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewV2UpdateClusterManifestOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewV2UpdateClusterManifestBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewV2UpdateClusterManifestUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewV2UpdateClusterManifestForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewV2UpdateClusterManifestNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 405:
		result := NewV2UpdateClusterManifestMethodNotAllowed()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 409:
		result := NewV2UpdateClusterManifestConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewV2UpdateClusterManifestInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
	}
}

// NewV2UpdateClusterManifestOK creates a V2UpdateClusterManifestOK with default headers values
func NewV2UpdateClusterManifestOK() *V2UpdateClusterManifestOK {
	return &V2UpdateClusterManifestOK{}
}

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

Success.
*/
type V2UpdateClusterManifestOK struct {
	Payload *models.Manifest
}

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

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

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

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

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

func (o *V2UpdateClusterManifestOK) Error() string {
	return fmt.Sprintf("[PATCH /v2/clusters/{cluster_id}/manifests][%d] v2UpdateClusterManifestOK  %+v", 200, o.Payload)
}

func (o *V2UpdateClusterManifestOK) String() string {
	return fmt.Sprintf("[PATCH /v2/clusters/{cluster_id}/manifests][%d] v2UpdateClusterManifestOK  %+v", 200, o.Payload)
}

func (o *V2UpdateClusterManifestOK) GetPayload() *models.Manifest {
	return o.Payload
}

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

	o.Payload = new(models.Manifest)

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

	return nil
}

// NewV2UpdateClusterManifestBadRequest creates a V2UpdateClusterManifestBadRequest with default headers values
func NewV2UpdateClusterManifestBadRequest() *V2UpdateClusterManifestBadRequest {
	return &V2UpdateClusterManifestBadRequest{}
}

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

Error.
*/
type V2UpdateClusterManifestBadRequest struct {
	Payload *models.Error
}

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

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

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

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

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

func (o *V2UpdateClusterManifestBadRequest) Error() string {
	return fmt.Sprintf("[PATCH /v2/clusters/{cluster_id}/manifests][%d] v2UpdateClusterManifestBadRequest  %+v", 400, o.Payload)
}

func (o *V2UpdateClusterManifestBadRequest) String() string {
	return fmt.Sprintf("[PATCH /v2/clusters/{cluster_id}/manifests][%d] v2UpdateClusterManifestBadRequest  %+v", 400, o.Payload)
}

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

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

// NewV2UpdateClusterManifestUnauthorized creates a V2UpdateClusterManifestUnauthorized with default headers values
func NewV2UpdateClusterManifestUnauthorized() *V2UpdateClusterManifestUnauthorized {
	return &V2UpdateClusterManifestUnauthorized{}
}

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

Unauthorized.
*/
type V2UpdateClusterManifestUnauthorized struct {
	Payload *models.InfraError
}

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

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

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

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

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

func (o *V2UpdateClusterManifestUnauthorized) Error() string {
	return fmt.Sprintf("[PATCH /v2/clusters/{cluster_id}/manifests][%d] v2UpdateClusterManifestUnauthorized  %+v", 401, o.Payload)
}

func (o *V2UpdateClusterManifestUnauthorized) String() string {
	return fmt.Sprintf("[PATCH /v2/clusters/{cluster_id}/manifests][%d] v2UpdateClusterManifestUnauthorized  %+v", 401, o.Payload)
}

func (o *V2UpdateClusterManifestUnauthorized) GetPayload() *models.InfraError {
	return o.Payload
}

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

	o.Payload = new(models.InfraError)

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

	return nil
}

// NewV2UpdateClusterManifestForbidden creates a V2UpdateClusterManifestForbidden with default headers values
func NewV2UpdateClusterManifestForbidden() *V2UpdateClusterManifestForbidden {
	return &V2UpdateClusterManifestForbidden{}
}

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

Forbidden.
*/
type V2UpdateClusterManifestForbidden struct {
	Payload *models.InfraError
}

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

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

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

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

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

func (o *V2UpdateClusterManifestForbidden) Error() string {
	return fmt.Sprintf("[PATCH /v2/clusters/{cluster_id}/manifests][%d] v2UpdateClusterManifestForbidden  %+v", 403, o.Payload)
}

func (o *V2UpdateClusterManifestForbidden) String() string {
	return fmt.Sprintf("[PATCH /v2/clusters/{cluster_id}/manifests][%d] v2UpdateClusterManifestForbidden  %+v", 403, o.Payload)
}

func (o *V2UpdateClusterManifestForbidden) GetPayload() *models.InfraError {
	return o.Payload
}

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

	o.Payload = new(models.InfraError)

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

	return nil
}

// NewV2UpdateClusterManifestNotFound creates a V2UpdateClusterManifestNotFound with default headers values
func NewV2UpdateClusterManifestNotFound() *V2UpdateClusterManifestNotFound {
	return &V2UpdateClusterManifestNotFound{}
}

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

Error.
*/
type V2UpdateClusterManifestNotFound struct {
	Payload *models.Error
}

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

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

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

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

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

func (o *V2UpdateClusterManifestNotFound) Error() string {
	return fmt.Sprintf("[PATCH /v2/clusters/{cluster_id}/manifests][%d] v2UpdateClusterManifestNotFound  %+v", 404, o.Payload)
}

func (o *V2UpdateClusterManifestNotFound) String() string {
	return fmt.Sprintf("[PATCH /v2/clusters/{cluster_id}/manifests][%d] v2UpdateClusterManifestNotFound  %+v", 404, o.Payload)
}

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

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

// NewV2UpdateClusterManifestMethodNotAllowed creates a V2UpdateClusterManifestMethodNotAllowed with default headers values
func NewV2UpdateClusterManifestMethodNotAllowed() *V2UpdateClusterManifestMethodNotAllowed {
	return &V2UpdateClusterManifestMethodNotAllowed{}
}

/*
V2UpdateClusterManifestMethodNotAllowed describes a response with status code 405, with default header values.

Method Not Allowed.
*/
type V2UpdateClusterManifestMethodNotAllowed struct {
	Payload *models.Error
}

// IsSuccess returns true when this v2 update cluster manifest method not allowed response has a 2xx status code
func (o *V2UpdateClusterManifestMethodNotAllowed) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this v2 update cluster manifest method not allowed response has a 3xx status code
func (o *V2UpdateClusterManifestMethodNotAllowed) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 update cluster manifest method not allowed response has a 4xx status code
func (o *V2UpdateClusterManifestMethodNotAllowed) IsClientError() bool {
	return true
}

// IsServerError returns true when this v2 update cluster manifest method not allowed response has a 5xx status code
func (o *V2UpdateClusterManifestMethodNotAllowed) IsServerError() bool {
	return false
}

// IsCode returns true when this v2 update cluster manifest method not allowed response a status code equal to that given
func (o *V2UpdateClusterManifestMethodNotAllowed) IsCode(code int) bool {
	return code == 405
}

func (o *V2UpdateClusterManifestMethodNotAllowed) Error() string {
	return fmt.Sprintf("[PATCH /v2/clusters/{cluster_id}/manifests][%d] v2UpdateClusterManifestMethodNotAllowed  %+v", 405, o.Payload)
}

func (o *V2UpdateClusterManifestMethodNotAllowed) String() string {
	return fmt.Sprintf("[PATCH /v2/clusters/{cluster_id}/manifests][%d] v2UpdateClusterManifestMethodNotAllowed  %+v", 405, o.Payload)
}

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

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

// NewV2UpdateClusterManifestConflict creates a V2UpdateClusterManifestConflict with default headers values
func NewV2UpdateClusterManifestConflict() *V2UpdateClusterManifestConflict {
	return &V2UpdateClusterManifestConflict{}
}

/*
V2UpdateClusterManifestConflict describes a response with status code 409, with default header values.

Error.
*/
type V2UpdateClusterManifestConflict struct {
	Payload *models.Error
}

// IsSuccess returns true when this v2 update cluster manifest conflict response has a 2xx status code
func (o *V2UpdateClusterManifestConflict) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this v2 update cluster manifest conflict response has a 3xx status code
func (o *V2UpdateClusterManifestConflict) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 update cluster manifest conflict response has a 4xx status code
func (o *V2UpdateClusterManifestConflict) IsClientError() bool {
	return true
}

// IsServerError returns true when this v2 update cluster manifest conflict response has a 5xx status code
func (o *V2UpdateClusterManifestConflict) IsServerError() bool {
	return false
}

// IsCode returns true when this v2 update cluster manifest conflict response a status code equal to that given
func (o *V2UpdateClusterManifestConflict) IsCode(code int) bool {
	return code == 409
}

func (o *V2UpdateClusterManifestConflict) Error() string {
	return fmt.Sprintf("[PATCH /v2/clusters/{cluster_id}/manifests][%d] v2UpdateClusterManifestConflict  %+v", 409, o.Payload)
}

func (o *V2UpdateClusterManifestConflict) String() string {
	return fmt.Sprintf("[PATCH /v2/clusters/{cluster_id}/manifests][%d] v2UpdateClusterManifestConflict  %+v", 409, o.Payload)
}

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

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

// NewV2UpdateClusterManifestInternalServerError creates a V2UpdateClusterManifestInternalServerError with default headers values
func NewV2UpdateClusterManifestInternalServerError() *V2UpdateClusterManifestInternalServerError {
	return &V2UpdateClusterManifestInternalServerError{}
}

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

Error.
*/
type V2UpdateClusterManifestInternalServerError struct {
	Payload *models.Error
}

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

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

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

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

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

func (o *V2UpdateClusterManifestInternalServerError) Error() string {
	return fmt.Sprintf("[PATCH /v2/clusters/{cluster_id}/manifests][%d] v2UpdateClusterManifestInternalServerError  %+v", 500, o.Payload)
}

func (o *V2UpdateClusterManifestInternalServerError) String() string {
	return fmt.Sprintf("[PATCH /v2/clusters/{cluster_id}/manifests][%d] v2UpdateClusterManifestInternalServerError  %+v", 500, o.Payload)
}

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

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