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

// PutManifestsArchiveReader is a Reader for the PutManifestsArchive structure.
type PutManifestsArchiveReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutManifestsArchiveReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPutManifestsArchiveOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPutManifestsArchiveBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPutManifestsArchiveUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewPutManifestsArchiveServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /manifests/archive] PutManifestsArchive", response, response.Code())
	}
}

// NewPutManifestsArchiveOK creates a PutManifestsArchiveOK with default headers values
func NewPutManifestsArchiveOK() *PutManifestsArchiveOK {
	return &PutManifestsArchiveOK{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPutManifestsArchiveBadRequest creates a PutManifestsArchiveBadRequest with default headers values
func NewPutManifestsArchiveBadRequest() *PutManifestsArchiveBadRequest {
	return &PutManifestsArchiveBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPutManifestsArchiveUnauthorized creates a PutManifestsArchiveUnauthorized with default headers values
func NewPutManifestsArchiveUnauthorized() *PutManifestsArchiveUnauthorized {
	return &PutManifestsArchiveUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPutManifestsArchiveServiceUnavailable creates a PutManifestsArchiveServiceUnavailable with default headers values
func NewPutManifestsArchiveServiceUnavailable() *PutManifestsArchiveServiceUnavailable {
	return &PutManifestsArchiveServiceUnavailable{}
}

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

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

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

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

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

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

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

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

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

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

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

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