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

// DeleteManifestSumsVersionReader is a Reader for the DeleteManifestSumsVersion structure.
type DeleteManifestSumsVersionReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *DeleteManifestSumsVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewDeleteManifestSumsVersionOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewDeleteManifestSumsVersionBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewDeleteManifestSumsVersionUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewDeleteManifestSumsVersionServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[DELETE /manifest/sums/{version}] DeleteManifestSumsVersion", response, response.Code())
	}
}

// NewDeleteManifestSumsVersionOK creates a DeleteManifestSumsVersionOK with default headers values
func NewDeleteManifestSumsVersionOK() *DeleteManifestSumsVersionOK {
	return &DeleteManifestSumsVersionOK{}
}

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

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

// IsSuccess returns true when this delete manifest sums version o k response has a 2xx status code
func (o *DeleteManifestSumsVersionOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this delete manifest sums version o k response has a 3xx status code
func (o *DeleteManifestSumsVersionOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete manifest sums version o k response has a 4xx status code
func (o *DeleteManifestSumsVersionOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this delete manifest sums version o k response has a 5xx status code
func (o *DeleteManifestSumsVersionOK) IsServerError() bool {
	return false
}

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

// Code gets the status code for the delete manifest sums version o k response
func (o *DeleteManifestSumsVersionOK) Code() int {
	return 200
}

func (o *DeleteManifestSumsVersionOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /manifest/sums/{version}][%d] deleteManifestSumsVersionOK %s", 200, payload)
}

func (o *DeleteManifestSumsVersionOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /manifest/sums/{version}][%d] deleteManifestSumsVersionOK %s", 200, payload)
}

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

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

// NewDeleteManifestSumsVersionBadRequest creates a DeleteManifestSumsVersionBadRequest with default headers values
func NewDeleteManifestSumsVersionBadRequest() *DeleteManifestSumsVersionBadRequest {
	return &DeleteManifestSumsVersionBadRequest{}
}

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

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

// IsSuccess returns true when this delete manifest sums version bad request response has a 2xx status code
func (o *DeleteManifestSumsVersionBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete manifest sums version bad request response has a 3xx status code
func (o *DeleteManifestSumsVersionBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete manifest sums version bad request response has a 4xx status code
func (o *DeleteManifestSumsVersionBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this delete manifest sums version bad request response has a 5xx status code
func (o *DeleteManifestSumsVersionBadRequest) IsServerError() bool {
	return false
}

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

// Code gets the status code for the delete manifest sums version bad request response
func (o *DeleteManifestSumsVersionBadRequest) Code() int {
	return 400
}

func (o *DeleteManifestSumsVersionBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /manifest/sums/{version}][%d] deleteManifestSumsVersionBadRequest %s", 400, payload)
}

func (o *DeleteManifestSumsVersionBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /manifest/sums/{version}][%d] deleteManifestSumsVersionBadRequest %s", 400, payload)
}

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

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

// NewDeleteManifestSumsVersionUnauthorized creates a DeleteManifestSumsVersionUnauthorized with default headers values
func NewDeleteManifestSumsVersionUnauthorized() *DeleteManifestSumsVersionUnauthorized {
	return &DeleteManifestSumsVersionUnauthorized{}
}

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

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

// IsSuccess returns true when this delete manifest sums version unauthorized response has a 2xx status code
func (o *DeleteManifestSumsVersionUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete manifest sums version unauthorized response has a 3xx status code
func (o *DeleteManifestSumsVersionUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete manifest sums version unauthorized response has a 4xx status code
func (o *DeleteManifestSumsVersionUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this delete manifest sums version unauthorized response has a 5xx status code
func (o *DeleteManifestSumsVersionUnauthorized) IsServerError() bool {
	return false
}

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

// Code gets the status code for the delete manifest sums version unauthorized response
func (o *DeleteManifestSumsVersionUnauthorized) Code() int {
	return 401
}

func (o *DeleteManifestSumsVersionUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /manifest/sums/{version}][%d] deleteManifestSumsVersionUnauthorized %s", 401, payload)
}

func (o *DeleteManifestSumsVersionUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /manifest/sums/{version}][%d] deleteManifestSumsVersionUnauthorized %s", 401, payload)
}

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

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

// NewDeleteManifestSumsVersionServiceUnavailable creates a DeleteManifestSumsVersionServiceUnavailable with default headers values
func NewDeleteManifestSumsVersionServiceUnavailable() *DeleteManifestSumsVersionServiceUnavailable {
	return &DeleteManifestSumsVersionServiceUnavailable{}
}

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

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

// IsSuccess returns true when this delete manifest sums version service unavailable response has a 2xx status code
func (o *DeleteManifestSumsVersionServiceUnavailable) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete manifest sums version service unavailable response has a 3xx status code
func (o *DeleteManifestSumsVersionServiceUnavailable) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete manifest sums version service unavailable response has a 4xx status code
func (o *DeleteManifestSumsVersionServiceUnavailable) IsClientError() bool {
	return false
}

// IsServerError returns true when this delete manifest sums version service unavailable response has a 5xx status code
func (o *DeleteManifestSumsVersionServiceUnavailable) IsServerError() bool {
	return true
}

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

// Code gets the status code for the delete manifest sums version service unavailable response
func (o *DeleteManifestSumsVersionServiceUnavailable) Code() int {
	return 503
}

func (o *DeleteManifestSumsVersionServiceUnavailable) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /manifest/sums/{version}][%d] deleteManifestSumsVersionServiceUnavailable %s", 503, payload)
}

func (o *DeleteManifestSumsVersionServiceUnavailable) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /manifest/sums/{version}][%d] deleteManifestSumsVersionServiceUnavailable %s", 503, payload)
}

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

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