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

// PostManifestSumsVersionRxswinsReader is a Reader for the PostManifestSumsVersionRxswins structure.
type PostManifestSumsVersionRxswinsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostManifestSumsVersionRxswinsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPostManifestSumsVersionRxswinsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPostManifestSumsVersionRxswinsBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPostManifestSumsVersionRxswinsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewPostManifestSumsVersionRxswinsServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /manifest/sums/{version}/rxswins] PostManifestSumsVersionRxswins", response, response.Code())
	}
}

// NewPostManifestSumsVersionRxswinsOK creates a PostManifestSumsVersionRxswinsOK with default headers values
func NewPostManifestSumsVersionRxswinsOK() *PostManifestSumsVersionRxswinsOK {
	return &PostManifestSumsVersionRxswinsOK{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPostManifestSumsVersionRxswinsBadRequest creates a PostManifestSumsVersionRxswinsBadRequest with default headers values
func NewPostManifestSumsVersionRxswinsBadRequest() *PostManifestSumsVersionRxswinsBadRequest {
	return &PostManifestSumsVersionRxswinsBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPostManifestSumsVersionRxswinsUnauthorized creates a PostManifestSumsVersionRxswinsUnauthorized with default headers values
func NewPostManifestSumsVersionRxswinsUnauthorized() *PostManifestSumsVersionRxswinsUnauthorized {
	return &PostManifestSumsVersionRxswinsUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPostManifestSumsVersionRxswinsServiceUnavailable creates a PostManifestSumsVersionRxswinsServiceUnavailable with default headers values
func NewPostManifestSumsVersionRxswinsServiceUnavailable() *PostManifestSumsVersionRxswinsServiceUnavailable {
	return &PostManifestSumsVersionRxswinsServiceUnavailable{}
}

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

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

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

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

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

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

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

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

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

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

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

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