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

package operations

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

	"github.com/fiskerinc/cloud-services/pkg/ota_api/models"
)

// GetManifestmigrateVersionReader is a Reader for the GetManifestmigrateVersion structure.
type GetManifestmigrateVersionReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetManifestmigrateVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetManifestmigrateVersionOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetManifestmigrateVersionBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetManifestmigrateVersionUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewGetManifestmigrateVersionServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /manifestmigrate-version] GetManifestmigrateVersion", response, response.Code())
	}
}

// NewGetManifestmigrateVersionOK creates a GetManifestmigrateVersionOK with default headers values
func NewGetManifestmigrateVersionOK() *GetManifestmigrateVersionOK {
	return &GetManifestmigrateVersionOK{}
}

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

OK
*/
type GetManifestmigrateVersionOK struct {
	Payload *models.HandlersManifestMigrateVersion
}

// IsSuccess returns true when this get manifestmigrate version o k response has a 2xx status code
func (o *GetManifestmigrateVersionOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this get manifestmigrate version o k response has a 3xx status code
func (o *GetManifestmigrateVersionOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get manifestmigrate version o k response has a 4xx status code
func (o *GetManifestmigrateVersionOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this get manifestmigrate version o k response has a 5xx status code
func (o *GetManifestmigrateVersionOK) IsServerError() bool {
	return false
}

// IsCode returns true when this get manifestmigrate version o k response a status code equal to that given
func (o *GetManifestmigrateVersionOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the get manifestmigrate version o k response
func (o *GetManifestmigrateVersionOK) Code() int {
	return 200
}

func (o *GetManifestmigrateVersionOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /manifestmigrate-version][%d] getManifestmigrateVersionOK %s", 200, payload)
}

func (o *GetManifestmigrateVersionOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /manifestmigrate-version][%d] getManifestmigrateVersionOK %s", 200, payload)
}

func (o *GetManifestmigrateVersionOK) GetPayload() *models.HandlersManifestMigrateVersion {
	return o.Payload
}

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

	o.Payload = new(models.HandlersManifestMigrateVersion)

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

	return nil
}

// NewGetManifestmigrateVersionBadRequest creates a GetManifestmigrateVersionBadRequest with default headers values
func NewGetManifestmigrateVersionBadRequest() *GetManifestmigrateVersionBadRequest {
	return &GetManifestmigrateVersionBadRequest{}
}

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

Bad request
*/
type GetManifestmigrateVersionBadRequest struct {
	Payload *models.CommonJSONError
}

// IsSuccess returns true when this get manifestmigrate version bad request response has a 2xx status code
func (o *GetManifestmigrateVersionBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get manifestmigrate version bad request response has a 3xx status code
func (o *GetManifestmigrateVersionBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get manifestmigrate version bad request response has a 4xx status code
func (o *GetManifestmigrateVersionBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this get manifestmigrate version bad request response has a 5xx status code
func (o *GetManifestmigrateVersionBadRequest) IsServerError() bool {
	return false
}

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

// Code gets the status code for the get manifestmigrate version bad request response
func (o *GetManifestmigrateVersionBadRequest) Code() int {
	return 400
}

func (o *GetManifestmigrateVersionBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /manifestmigrate-version][%d] getManifestmigrateVersionBadRequest %s", 400, payload)
}

func (o *GetManifestmigrateVersionBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /manifestmigrate-version][%d] getManifestmigrateVersionBadRequest %s", 400, payload)
}

func (o *GetManifestmigrateVersionBadRequest) GetPayload() *models.CommonJSONError {
	return o.Payload
}

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

	o.Payload = new(models.CommonJSONError)

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

	return nil
}

// NewGetManifestmigrateVersionUnauthorized creates a GetManifestmigrateVersionUnauthorized with default headers values
func NewGetManifestmigrateVersionUnauthorized() *GetManifestmigrateVersionUnauthorized {
	return &GetManifestmigrateVersionUnauthorized{}
}

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

Unauthorized
*/
type GetManifestmigrateVersionUnauthorized struct {
	Payload *models.CommonJSONError
}

// IsSuccess returns true when this get manifestmigrate version unauthorized response has a 2xx status code
func (o *GetManifestmigrateVersionUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get manifestmigrate version unauthorized response has a 3xx status code
func (o *GetManifestmigrateVersionUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get manifestmigrate version unauthorized response has a 4xx status code
func (o *GetManifestmigrateVersionUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this get manifestmigrate version unauthorized response has a 5xx status code
func (o *GetManifestmigrateVersionUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this get manifestmigrate version unauthorized response a status code equal to that given
func (o *GetManifestmigrateVersionUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the get manifestmigrate version unauthorized response
func (o *GetManifestmigrateVersionUnauthorized) Code() int {
	return 401
}

func (o *GetManifestmigrateVersionUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /manifestmigrate-version][%d] getManifestmigrateVersionUnauthorized %s", 401, payload)
}

func (o *GetManifestmigrateVersionUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /manifestmigrate-version][%d] getManifestmigrateVersionUnauthorized %s", 401, payload)
}

func (o *GetManifestmigrateVersionUnauthorized) GetPayload() *models.CommonJSONError {
	return o.Payload
}

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

	o.Payload = new(models.CommonJSONError)

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

	return nil
}

// NewGetManifestmigrateVersionServiceUnavailable creates a GetManifestmigrateVersionServiceUnavailable with default headers values
func NewGetManifestmigrateVersionServiceUnavailable() *GetManifestmigrateVersionServiceUnavailable {
	return &GetManifestmigrateVersionServiceUnavailable{}
}

/*
GetManifestmigrateVersionServiceUnavailable describes a response with status code 503, with default header values.

Service unavailable
*/
type GetManifestmigrateVersionServiceUnavailable struct {
	Payload *models.CommonJSONError
}

// IsSuccess returns true when this get manifestmigrate version service unavailable response has a 2xx status code
func (o *GetManifestmigrateVersionServiceUnavailable) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get manifestmigrate version service unavailable response has a 3xx status code
func (o *GetManifestmigrateVersionServiceUnavailable) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get manifestmigrate version service unavailable response has a 4xx status code
func (o *GetManifestmigrateVersionServiceUnavailable) IsClientError() bool {
	return false
}

// IsServerError returns true when this get manifestmigrate version service unavailable response has a 5xx status code
func (o *GetManifestmigrateVersionServiceUnavailable) IsServerError() bool {
	return true
}

// IsCode returns true when this get manifestmigrate version service unavailable response a status code equal to that given
func (o *GetManifestmigrateVersionServiceUnavailable) IsCode(code int) bool {
	return code == 503
}

// Code gets the status code for the get manifestmigrate version service unavailable response
func (o *GetManifestmigrateVersionServiceUnavailable) Code() int {
	return 503
}

func (o *GetManifestmigrateVersionServiceUnavailable) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /manifestmigrate-version][%d] getManifestmigrateVersionServiceUnavailable %s", 503, payload)
}

func (o *GetManifestmigrateVersionServiceUnavailable) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /manifestmigrate-version][%d] getManifestmigrateVersionServiceUnavailable %s", 503, payload)
}

func (o *GetManifestmigrateVersionServiceUnavailable) GetPayload() *models.CommonJSONError {
	return o.Payload
}

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

	o.Payload = new(models.CommonJSONError)

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

	return nil
}
