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

// PostManifestmigrateManifestIDReader is a Reader for the PostManifestmigrateManifestID structure.
type PostManifestmigrateManifestIDReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostManifestmigrateManifestIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPostManifestmigrateManifestIDOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPostManifestmigrateManifestIDBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPostManifestmigrateManifestIDUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewPostManifestmigrateManifestIDServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /manifestmigrate/{manifest_id}] PostManifestmigrateManifestID", response, response.Code())
	}
}

// NewPostManifestmigrateManifestIDOK creates a PostManifestmigrateManifestIDOK with default headers values
func NewPostManifestmigrateManifestIDOK() *PostManifestmigrateManifestIDOK {
	return &PostManifestmigrateManifestIDOK{}
}

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

OK
*/
type PostManifestmigrateManifestIDOK struct {
	Payload *models.CommonJSONMessage
}

// IsSuccess returns true when this post manifestmigrate manifest Id o k response has a 2xx status code
func (o *PostManifestmigrateManifestIDOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this post manifestmigrate manifest Id o k response has a 3xx status code
func (o *PostManifestmigrateManifestIDOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this post manifestmigrate manifest Id o k response has a 4xx status code
func (o *PostManifestmigrateManifestIDOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this post manifestmigrate manifest Id o k response has a 5xx status code
func (o *PostManifestmigrateManifestIDOK) IsServerError() bool {
	return false
}

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

// Code gets the status code for the post manifestmigrate manifest Id o k response
func (o *PostManifestmigrateManifestIDOK) Code() int {
	return 200
}

func (o *PostManifestmigrateManifestIDOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /manifestmigrate/{manifest_id}][%d] postManifestmigrateManifestIdOK %s", 200, payload)
}

func (o *PostManifestmigrateManifestIDOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /manifestmigrate/{manifest_id}][%d] postManifestmigrateManifestIdOK %s", 200, payload)
}

func (o *PostManifestmigrateManifestIDOK) GetPayload() *models.CommonJSONMessage {
	return o.Payload
}

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

	o.Payload = new(models.CommonJSONMessage)

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

	return nil
}

// NewPostManifestmigrateManifestIDBadRequest creates a PostManifestmigrateManifestIDBadRequest with default headers values
func NewPostManifestmigrateManifestIDBadRequest() *PostManifestmigrateManifestIDBadRequest {
	return &PostManifestmigrateManifestIDBadRequest{}
}

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

Bad Request
*/
type PostManifestmigrateManifestIDBadRequest struct {
	Payload *models.CommonJSONError
}

// IsSuccess returns true when this post manifestmigrate manifest Id bad request response has a 2xx status code
func (o *PostManifestmigrateManifestIDBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this post manifestmigrate manifest Id bad request response has a 3xx status code
func (o *PostManifestmigrateManifestIDBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this post manifestmigrate manifest Id bad request response has a 4xx status code
func (o *PostManifestmigrateManifestIDBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this post manifestmigrate manifest Id bad request response has a 5xx status code
func (o *PostManifestmigrateManifestIDBadRequest) IsServerError() bool {
	return false
}

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

// Code gets the status code for the post manifestmigrate manifest Id bad request response
func (o *PostManifestmigrateManifestIDBadRequest) Code() int {
	return 400
}

func (o *PostManifestmigrateManifestIDBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /manifestmigrate/{manifest_id}][%d] postManifestmigrateManifestIdBadRequest %s", 400, payload)
}

func (o *PostManifestmigrateManifestIDBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /manifestmigrate/{manifest_id}][%d] postManifestmigrateManifestIdBadRequest %s", 400, payload)
}

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

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

// NewPostManifestmigrateManifestIDUnauthorized creates a PostManifestmigrateManifestIDUnauthorized with default headers values
func NewPostManifestmigrateManifestIDUnauthorized() *PostManifestmigrateManifestIDUnauthorized {
	return &PostManifestmigrateManifestIDUnauthorized{}
}

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

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

// IsSuccess returns true when this post manifestmigrate manifest Id unauthorized response has a 2xx status code
func (o *PostManifestmigrateManifestIDUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this post manifestmigrate manifest Id unauthorized response has a 3xx status code
func (o *PostManifestmigrateManifestIDUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this post manifestmigrate manifest Id unauthorized response has a 4xx status code
func (o *PostManifestmigrateManifestIDUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this post manifestmigrate manifest Id unauthorized response has a 5xx status code
func (o *PostManifestmigrateManifestIDUnauthorized) IsServerError() bool {
	return false
}

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

// Code gets the status code for the post manifestmigrate manifest Id unauthorized response
func (o *PostManifestmigrateManifestIDUnauthorized) Code() int {
	return 401
}

func (o *PostManifestmigrateManifestIDUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /manifestmigrate/{manifest_id}][%d] postManifestmigrateManifestIdUnauthorized %s", 401, payload)
}

func (o *PostManifestmigrateManifestIDUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /manifestmigrate/{manifest_id}][%d] postManifestmigrateManifestIdUnauthorized %s", 401, payload)
}

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

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

// NewPostManifestmigrateManifestIDServiceUnavailable creates a PostManifestmigrateManifestIDServiceUnavailable with default headers values
func NewPostManifestmigrateManifestIDServiceUnavailable() *PostManifestmigrateManifestIDServiceUnavailable {
	return &PostManifestmigrateManifestIDServiceUnavailable{}
}

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

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

// IsSuccess returns true when this post manifestmigrate manifest Id service unavailable response has a 2xx status code
func (o *PostManifestmigrateManifestIDServiceUnavailable) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this post manifestmigrate manifest Id service unavailable response has a 3xx status code
func (o *PostManifestmigrateManifestIDServiceUnavailable) IsRedirect() bool {
	return false
}

// IsClientError returns true when this post manifestmigrate manifest Id service unavailable response has a 4xx status code
func (o *PostManifestmigrateManifestIDServiceUnavailable) IsClientError() bool {
	return false
}

// IsServerError returns true when this post manifestmigrate manifest Id service unavailable response has a 5xx status code
func (o *PostManifestmigrateManifestIDServiceUnavailable) IsServerError() bool {
	return true
}

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

// Code gets the status code for the post manifestmigrate manifest Id service unavailable response
func (o *PostManifestmigrateManifestIDServiceUnavailable) Code() int {
	return 503
}

func (o *PostManifestmigrateManifestIDServiceUnavailable) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /manifestmigrate/{manifest_id}][%d] postManifestmigrateManifestIdServiceUnavailable %s", 503, payload)
}

func (o *PostManifestmigrateManifestIDServiceUnavailable) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /manifestmigrate/{manifest_id}][%d] postManifestmigrateManifestIdServiceUnavailable %s", 503, payload)
}

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

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