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

// DeleteManifestSumsVersionRxswinsRxswinReader is a Reader for the DeleteManifestSumsVersionRxswinsRxswin structure.
type DeleteManifestSumsVersionRxswinsRxswinReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *DeleteManifestSumsVersionRxswinsRxswinReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewDeleteManifestSumsVersionRxswinsRxswinOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewDeleteManifestSumsVersionRxswinsRxswinBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewDeleteManifestSumsVersionRxswinsRxswinUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewDeleteManifestSumsVersionRxswinsRxswinServiceUnavailable()
		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}/rxswins/{rxswin}] DeleteManifestSumsVersionRxswinsRxswin", response, response.Code())
	}
}

// NewDeleteManifestSumsVersionRxswinsRxswinOK creates a DeleteManifestSumsVersionRxswinsRxswinOK with default headers values
func NewDeleteManifestSumsVersionRxswinsRxswinOK() *DeleteManifestSumsVersionRxswinsRxswinOK {
	return &DeleteManifestSumsVersionRxswinsRxswinOK{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewDeleteManifestSumsVersionRxswinsRxswinBadRequest creates a DeleteManifestSumsVersionRxswinsRxswinBadRequest with default headers values
func NewDeleteManifestSumsVersionRxswinsRxswinBadRequest() *DeleteManifestSumsVersionRxswinsRxswinBadRequest {
	return &DeleteManifestSumsVersionRxswinsRxswinBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewDeleteManifestSumsVersionRxswinsRxswinUnauthorized creates a DeleteManifestSumsVersionRxswinsRxswinUnauthorized with default headers values
func NewDeleteManifestSumsVersionRxswinsRxswinUnauthorized() *DeleteManifestSumsVersionRxswinsRxswinUnauthorized {
	return &DeleteManifestSumsVersionRxswinsRxswinUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewDeleteManifestSumsVersionRxswinsRxswinServiceUnavailable creates a DeleteManifestSumsVersionRxswinsRxswinServiceUnavailable with default headers values
func NewDeleteManifestSumsVersionRxswinsRxswinServiceUnavailable() *DeleteManifestSumsVersionRxswinsRxswinServiceUnavailable {
	return &DeleteManifestSumsVersionRxswinsRxswinServiceUnavailable{}
}

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

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

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

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

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

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

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

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

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

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

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

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