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

335 lines
10 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"
"fiskerinc.com/modules/ota_api/models"
)
// DeleteManifestReader is a Reader for the DeleteManifest structure.
type DeleteManifestReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *DeleteManifestReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewDeleteManifestOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewDeleteManifestBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 401:
result := NewDeleteManifestUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 503:
result := NewDeleteManifestServiceUnavailable()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[DELETE /manifest] DeleteManifest", response, response.Code())
}
}
// NewDeleteManifestOK creates a DeleteManifestOK with default headers values
func NewDeleteManifestOK() *DeleteManifestOK {
return &DeleteManifestOK{}
}
/*
DeleteManifestOK describes a response with status code 200, with default header values.
OK
*/
type DeleteManifestOK struct {
Payload *models.CommonJSONMessage
}
// IsSuccess returns true when this delete manifest o k response has a 2xx status code
func (o *DeleteManifestOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this delete manifest o k response has a 3xx status code
func (o *DeleteManifestOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this delete manifest o k response has a 4xx status code
func (o *DeleteManifestOK) IsClientError() bool {
return false
}
// IsServerError returns true when this delete manifest o k response has a 5xx status code
func (o *DeleteManifestOK) IsServerError() bool {
return false
}
// IsCode returns true when this delete manifest o k response a status code equal to that given
func (o *DeleteManifestOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the delete manifest o k response
func (o *DeleteManifestOK) Code() int {
return 200
}
func (o *DeleteManifestOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[DELETE /manifest][%d] deleteManifestOK %s", 200, payload)
}
func (o *DeleteManifestOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[DELETE /manifest][%d] deleteManifestOK %s", 200, payload)
}
func (o *DeleteManifestOK) GetPayload() *models.CommonJSONMessage {
return o.Payload
}
func (o *DeleteManifestOK) 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
}
// NewDeleteManifestBadRequest creates a DeleteManifestBadRequest with default headers values
func NewDeleteManifestBadRequest() *DeleteManifestBadRequest {
return &DeleteManifestBadRequest{}
}
/*
DeleteManifestBadRequest describes a response with status code 400, with default header values.
Bad request
*/
type DeleteManifestBadRequest struct {
Payload *models.CommonJSONError
}
// IsSuccess returns true when this delete manifest bad request response has a 2xx status code
func (o *DeleteManifestBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this delete manifest bad request response has a 3xx status code
func (o *DeleteManifestBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this delete manifest bad request response has a 4xx status code
func (o *DeleteManifestBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this delete manifest bad request response has a 5xx status code
func (o *DeleteManifestBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this delete manifest bad request response a status code equal to that given
func (o *DeleteManifestBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the delete manifest bad request response
func (o *DeleteManifestBadRequest) Code() int {
return 400
}
func (o *DeleteManifestBadRequest) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[DELETE /manifest][%d] deleteManifestBadRequest %s", 400, payload)
}
func (o *DeleteManifestBadRequest) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[DELETE /manifest][%d] deleteManifestBadRequest %s", 400, payload)
}
func (o *DeleteManifestBadRequest) GetPayload() *models.CommonJSONError {
return o.Payload
}
func (o *DeleteManifestBadRequest) 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
}
// NewDeleteManifestUnauthorized creates a DeleteManifestUnauthorized with default headers values
func NewDeleteManifestUnauthorized() *DeleteManifestUnauthorized {
return &DeleteManifestUnauthorized{}
}
/*
DeleteManifestUnauthorized describes a response with status code 401, with default header values.
Unauthorized
*/
type DeleteManifestUnauthorized struct {
Payload *models.CommonJSONError
}
// IsSuccess returns true when this delete manifest unauthorized response has a 2xx status code
func (o *DeleteManifestUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this delete manifest unauthorized response has a 3xx status code
func (o *DeleteManifestUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this delete manifest unauthorized response has a 4xx status code
func (o *DeleteManifestUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this delete manifest unauthorized response has a 5xx status code
func (o *DeleteManifestUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this delete manifest unauthorized response a status code equal to that given
func (o *DeleteManifestUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the delete manifest unauthorized response
func (o *DeleteManifestUnauthorized) Code() int {
return 401
}
func (o *DeleteManifestUnauthorized) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[DELETE /manifest][%d] deleteManifestUnauthorized %s", 401, payload)
}
func (o *DeleteManifestUnauthorized) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[DELETE /manifest][%d] deleteManifestUnauthorized %s", 401, payload)
}
func (o *DeleteManifestUnauthorized) GetPayload() *models.CommonJSONError {
return o.Payload
}
func (o *DeleteManifestUnauthorized) 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
}
// NewDeleteManifestServiceUnavailable creates a DeleteManifestServiceUnavailable with default headers values
func NewDeleteManifestServiceUnavailable() *DeleteManifestServiceUnavailable {
return &DeleteManifestServiceUnavailable{}
}
/*
DeleteManifestServiceUnavailable describes a response with status code 503, with default header values.
Service unavailable
*/
type DeleteManifestServiceUnavailable struct {
Payload *models.CommonJSONError
}
// IsSuccess returns true when this delete manifest service unavailable response has a 2xx status code
func (o *DeleteManifestServiceUnavailable) IsSuccess() bool {
return false
}
// IsRedirect returns true when this delete manifest service unavailable response has a 3xx status code
func (o *DeleteManifestServiceUnavailable) IsRedirect() bool {
return false
}
// IsClientError returns true when this delete manifest service unavailable response has a 4xx status code
func (o *DeleteManifestServiceUnavailable) IsClientError() bool {
return false
}
// IsServerError returns true when this delete manifest service unavailable response has a 5xx status code
func (o *DeleteManifestServiceUnavailable) IsServerError() bool {
return true
}
// IsCode returns true when this delete manifest service unavailable response a status code equal to that given
func (o *DeleteManifestServiceUnavailable) IsCode(code int) bool {
return code == 503
}
// Code gets the status code for the delete manifest service unavailable response
func (o *DeleteManifestServiceUnavailable) Code() int {
return 503
}
func (o *DeleteManifestServiceUnavailable) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[DELETE /manifest][%d] deleteManifestServiceUnavailable %s", 503, payload)
}
func (o *DeleteManifestServiceUnavailable) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[DELETE /manifest][%d] deleteManifestServiceUnavailable %s", 503, payload)
}
func (o *DeleteManifestServiceUnavailable) GetPayload() *models.CommonJSONError {
return o.Payload
}
func (o *DeleteManifestServiceUnavailable) 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
}