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

// PutManifestsIDSumsReader is a Reader for the PutManifestsIDSums structure.
type PutManifestsIDSumsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutManifestsIDSumsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPutManifestsIDSumsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPutManifestsIDSumsBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPutManifestsIDSumsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewPutManifestsIDSumsServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /manifests/{id}/sums] PutManifestsIDSums", response, response.Code())
	}
}

// NewPutManifestsIDSumsOK creates a PutManifestsIDSumsOK with default headers values
func NewPutManifestsIDSumsOK() *PutManifestsIDSumsOK {
	return &PutManifestsIDSumsOK{}
}

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

OK
*/
type PutManifestsIDSumsOK struct {
	Payload *models.CommonUpdateManifest
}

// IsSuccess returns true when this put manifests Id sums o k response has a 2xx status code
func (o *PutManifestsIDSumsOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this put manifests Id sums o k response has a 3xx status code
func (o *PutManifestsIDSumsOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this put manifests Id sums o k response has a 4xx status code
func (o *PutManifestsIDSumsOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this put manifests Id sums o k response has a 5xx status code
func (o *PutManifestsIDSumsOK) IsServerError() bool {
	return false
}

// IsCode returns true when this put manifests Id sums o k response a status code equal to that given
func (o *PutManifestsIDSumsOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the put manifests Id sums o k response
func (o *PutManifestsIDSumsOK) Code() int {
	return 200
}

func (o *PutManifestsIDSumsOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /manifests/{id}/sums][%d] putManifestsIdSumsOK %s", 200, payload)
}

func (o *PutManifestsIDSumsOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /manifests/{id}/sums][%d] putManifestsIdSumsOK %s", 200, payload)
}

func (o *PutManifestsIDSumsOK) GetPayload() *models.CommonUpdateManifest {
	return o.Payload
}

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

	o.Payload = new(models.CommonUpdateManifest)

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

	return nil
}

// NewPutManifestsIDSumsBadRequest creates a PutManifestsIDSumsBadRequest with default headers values
func NewPutManifestsIDSumsBadRequest() *PutManifestsIDSumsBadRequest {
	return &PutManifestsIDSumsBadRequest{}
}

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

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

// IsSuccess returns true when this put manifests Id sums bad request response has a 2xx status code
func (o *PutManifestsIDSumsBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this put manifests Id sums bad request response has a 3xx status code
func (o *PutManifestsIDSumsBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this put manifests Id sums bad request response has a 4xx status code
func (o *PutManifestsIDSumsBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this put manifests Id sums bad request response has a 5xx status code
func (o *PutManifestsIDSumsBadRequest) IsServerError() bool {
	return false
}

// IsCode returns true when this put manifests Id sums bad request response a status code equal to that given
func (o *PutManifestsIDSumsBadRequest) IsCode(code int) bool {
	return code == 400
}

// Code gets the status code for the put manifests Id sums bad request response
func (o *PutManifestsIDSumsBadRequest) Code() int {
	return 400
}

func (o *PutManifestsIDSumsBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /manifests/{id}/sums][%d] putManifestsIdSumsBadRequest %s", 400, payload)
}

func (o *PutManifestsIDSumsBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /manifests/{id}/sums][%d] putManifestsIdSumsBadRequest %s", 400, payload)
}

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

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

// NewPutManifestsIDSumsUnauthorized creates a PutManifestsIDSumsUnauthorized with default headers values
func NewPutManifestsIDSumsUnauthorized() *PutManifestsIDSumsUnauthorized {
	return &PutManifestsIDSumsUnauthorized{}
}

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

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

// IsSuccess returns true when this put manifests Id sums unauthorized response has a 2xx status code
func (o *PutManifestsIDSumsUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this put manifests Id sums unauthorized response has a 3xx status code
func (o *PutManifestsIDSumsUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this put manifests Id sums unauthorized response has a 4xx status code
func (o *PutManifestsIDSumsUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this put manifests Id sums unauthorized response has a 5xx status code
func (o *PutManifestsIDSumsUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this put manifests Id sums unauthorized response a status code equal to that given
func (o *PutManifestsIDSumsUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the put manifests Id sums unauthorized response
func (o *PutManifestsIDSumsUnauthorized) Code() int {
	return 401
}

func (o *PutManifestsIDSumsUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /manifests/{id}/sums][%d] putManifestsIdSumsUnauthorized %s", 401, payload)
}

func (o *PutManifestsIDSumsUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /manifests/{id}/sums][%d] putManifestsIdSumsUnauthorized %s", 401, payload)
}

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

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

// NewPutManifestsIDSumsServiceUnavailable creates a PutManifestsIDSumsServiceUnavailable with default headers values
func NewPutManifestsIDSumsServiceUnavailable() *PutManifestsIDSumsServiceUnavailable {
	return &PutManifestsIDSumsServiceUnavailable{}
}

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

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

// IsSuccess returns true when this put manifests Id sums service unavailable response has a 2xx status code
func (o *PutManifestsIDSumsServiceUnavailable) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this put manifests Id sums service unavailable response has a 3xx status code
func (o *PutManifestsIDSumsServiceUnavailable) IsRedirect() bool {
	return false
}

// IsClientError returns true when this put manifests Id sums service unavailable response has a 4xx status code
func (o *PutManifestsIDSumsServiceUnavailable) IsClientError() bool {
	return false
}

// IsServerError returns true when this put manifests Id sums service unavailable response has a 5xx status code
func (o *PutManifestsIDSumsServiceUnavailable) IsServerError() bool {
	return true
}

// IsCode returns true when this put manifests Id sums service unavailable response a status code equal to that given
func (o *PutManifestsIDSumsServiceUnavailable) IsCode(code int) bool {
	return code == 503
}

// Code gets the status code for the put manifests Id sums service unavailable response
func (o *PutManifestsIDSumsServiceUnavailable) Code() int {
	return 503
}

func (o *PutManifestsIDSumsServiceUnavailable) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /manifests/{id}/sums][%d] putManifestsIdSumsServiceUnavailable %s", 503, payload)
}

func (o *PutManifestsIDSumsServiceUnavailable) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /manifests/{id}/sums][%d] putManifestsIdSumsServiceUnavailable %s", 503, payload)
}

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

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