Files
cloud-services/pkg/ota_api/client/operations/put_manifest_responses.go

335 lines
9.7 KiB
Go

// 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"
)
// PutManifestReader is a Reader for the PutManifest structure.
type PutManifestReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PutManifestReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPutManifestOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewPutManifestBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 401:
result := NewPutManifestUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 503:
result := NewPutManifestServiceUnavailable()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[PUT /manifest] PutManifest", response, response.Code())
}
}
// NewPutManifestOK creates a PutManifestOK with default headers values
func NewPutManifestOK() *PutManifestOK {
return &PutManifestOK{}
}
/*
PutManifestOK describes a response with status code 200, with default header values.
OK
*/
type PutManifestOK struct {
Payload *models.CommonUpdateManifest
}
// IsSuccess returns true when this put manifest o k response has a 2xx status code
func (o *PutManifestOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this put manifest o k response has a 3xx status code
func (o *PutManifestOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this put manifest o k response has a 4xx status code
func (o *PutManifestOK) IsClientError() bool {
return false
}
// IsServerError returns true when this put manifest o k response has a 5xx status code
func (o *PutManifestOK) IsServerError() bool {
return false
}
// IsCode returns true when this put manifest o k response a status code equal to that given
func (o *PutManifestOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the put manifest o k response
func (o *PutManifestOK) Code() int {
return 200
}
func (o *PutManifestOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /manifest][%d] putManifestOK %s", 200, payload)
}
func (o *PutManifestOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /manifest][%d] putManifestOK %s", 200, payload)
}
func (o *PutManifestOK) GetPayload() *models.CommonUpdateManifest {
return o.Payload
}
func (o *PutManifestOK) 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
}
// NewPutManifestBadRequest creates a PutManifestBadRequest with default headers values
func NewPutManifestBadRequest() *PutManifestBadRequest {
return &PutManifestBadRequest{}
}
/*
PutManifestBadRequest describes a response with status code 400, with default header values.
Bad request
*/
type PutManifestBadRequest struct {
Payload *models.CommonJSONError
}
// IsSuccess returns true when this put manifest bad request response has a 2xx status code
func (o *PutManifestBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put manifest bad request response has a 3xx status code
func (o *PutManifestBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this put manifest bad request response has a 4xx status code
func (o *PutManifestBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this put manifest bad request response has a 5xx status code
func (o *PutManifestBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this put manifest bad request response a status code equal to that given
func (o *PutManifestBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the put manifest bad request response
func (o *PutManifestBadRequest) Code() int {
return 400
}
func (o *PutManifestBadRequest) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /manifest][%d] putManifestBadRequest %s", 400, payload)
}
func (o *PutManifestBadRequest) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /manifest][%d] putManifestBadRequest %s", 400, payload)
}
func (o *PutManifestBadRequest) GetPayload() *models.CommonJSONError {
return o.Payload
}
func (o *PutManifestBadRequest) 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
}
// NewPutManifestUnauthorized creates a PutManifestUnauthorized with default headers values
func NewPutManifestUnauthorized() *PutManifestUnauthorized {
return &PutManifestUnauthorized{}
}
/*
PutManifestUnauthorized describes a response with status code 401, with default header values.
Unauthorized
*/
type PutManifestUnauthorized struct {
Payload *models.CommonJSONError
}
// IsSuccess returns true when this put manifest unauthorized response has a 2xx status code
func (o *PutManifestUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put manifest unauthorized response has a 3xx status code
func (o *PutManifestUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this put manifest unauthorized response has a 4xx status code
func (o *PutManifestUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this put manifest unauthorized response has a 5xx status code
func (o *PutManifestUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this put manifest unauthorized response a status code equal to that given
func (o *PutManifestUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the put manifest unauthorized response
func (o *PutManifestUnauthorized) Code() int {
return 401
}
func (o *PutManifestUnauthorized) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /manifest][%d] putManifestUnauthorized %s", 401, payload)
}
func (o *PutManifestUnauthorized) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /manifest][%d] putManifestUnauthorized %s", 401, payload)
}
func (o *PutManifestUnauthorized) GetPayload() *models.CommonJSONError {
return o.Payload
}
func (o *PutManifestUnauthorized) 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
}
// NewPutManifestServiceUnavailable creates a PutManifestServiceUnavailable with default headers values
func NewPutManifestServiceUnavailable() *PutManifestServiceUnavailable {
return &PutManifestServiceUnavailable{}
}
/*
PutManifestServiceUnavailable describes a response with status code 503, with default header values.
Service unavailable
*/
type PutManifestServiceUnavailable struct {
Payload *models.CommonJSONError
}
// IsSuccess returns true when this put manifest service unavailable response has a 2xx status code
func (o *PutManifestServiceUnavailable) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put manifest service unavailable response has a 3xx status code
func (o *PutManifestServiceUnavailable) IsRedirect() bool {
return false
}
// IsClientError returns true when this put manifest service unavailable response has a 4xx status code
func (o *PutManifestServiceUnavailable) IsClientError() bool {
return false
}
// IsServerError returns true when this put manifest service unavailable response has a 5xx status code
func (o *PutManifestServiceUnavailable) IsServerError() bool {
return true
}
// IsCode returns true when this put manifest service unavailable response a status code equal to that given
func (o *PutManifestServiceUnavailable) IsCode(code int) bool {
return code == 503
}
// Code gets the status code for the put manifest service unavailable response
func (o *PutManifestServiceUnavailable) Code() int {
return 503
}
func (o *PutManifestServiceUnavailable) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /manifest][%d] putManifestServiceUnavailable %s", 503, payload)
}
func (o *PutManifestServiceUnavailable) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /manifest][%d] putManifestServiceUnavailable %s", 503, payload)
}
func (o *PutManifestServiceUnavailable) GetPayload() *models.CommonJSONError {
return o.Payload
}
func (o *PutManifestServiceUnavailable) 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
}