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

// GetManifestSumsVersionRxswinsReader is a Reader for the GetManifestSumsVersionRxswins structure.
type GetManifestSumsVersionRxswinsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetManifestSumsVersionRxswinsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetManifestSumsVersionRxswinsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetManifestSumsVersionRxswinsBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetManifestSumsVersionRxswinsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewGetManifestSumsVersionRxswinsServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /manifest/sums/{version}/rxswins] GetManifestSumsVersionRxswins", response, response.Code())
	}
}

// NewGetManifestSumsVersionRxswinsOK creates a GetManifestSumsVersionRxswinsOK with default headers values
func NewGetManifestSumsVersionRxswinsOK() *GetManifestSumsVersionRxswinsOK {
	return &GetManifestSumsVersionRxswinsOK{}
}

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

OK
*/
type GetManifestSumsVersionRxswinsOK struct {
	Payload []*models.CommonSwVersionRxSwin
}

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

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

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

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

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

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

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

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

func (o *GetManifestSumsVersionRxswinsOK) GetPayload() []*models.CommonSwVersionRxSwin {
	return o.Payload
}

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

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

	return nil
}

// NewGetManifestSumsVersionRxswinsBadRequest creates a GetManifestSumsVersionRxswinsBadRequest with default headers values
func NewGetManifestSumsVersionRxswinsBadRequest() *GetManifestSumsVersionRxswinsBadRequest {
	return &GetManifestSumsVersionRxswinsBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGetManifestSumsVersionRxswinsUnauthorized creates a GetManifestSumsVersionRxswinsUnauthorized with default headers values
func NewGetManifestSumsVersionRxswinsUnauthorized() *GetManifestSumsVersionRxswinsUnauthorized {
	return &GetManifestSumsVersionRxswinsUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGetManifestSumsVersionRxswinsServiceUnavailable creates a GetManifestSumsVersionRxswinsServiceUnavailable with default headers values
func NewGetManifestSumsVersionRxswinsServiceUnavailable() *GetManifestSumsVersionRxswinsServiceUnavailable {
	return &GetManifestSumsVersionRxswinsServiceUnavailable{}
}

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

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

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

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

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

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

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

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

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

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

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

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