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

335 lines
11 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"
)
// GetSubscriptionfeatureReader is a Reader for the GetSubscriptionfeature structure.
type GetSubscriptionfeatureReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetSubscriptionfeatureReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetSubscriptionfeatureOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewGetSubscriptionfeatureBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 401:
result := NewGetSubscriptionfeatureUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 503:
result := NewGetSubscriptionfeatureServiceUnavailable()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[GET /subscriptionfeature] GetSubscriptionfeature", response, response.Code())
}
}
// NewGetSubscriptionfeatureOK creates a GetSubscriptionfeatureOK with default headers values
func NewGetSubscriptionfeatureOK() *GetSubscriptionfeatureOK {
return &GetSubscriptionfeatureOK{}
}
/*
GetSubscriptionfeatureOK describes a response with status code 200, with default header values.
OK
*/
type GetSubscriptionfeatureOK struct {
Payload *models.CommonSubscriptionFeature
}
// IsSuccess returns true when this get subscriptionfeature o k response has a 2xx status code
func (o *GetSubscriptionfeatureOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this get subscriptionfeature o k response has a 3xx status code
func (o *GetSubscriptionfeatureOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this get subscriptionfeature o k response has a 4xx status code
func (o *GetSubscriptionfeatureOK) IsClientError() bool {
return false
}
// IsServerError returns true when this get subscriptionfeature o k response has a 5xx status code
func (o *GetSubscriptionfeatureOK) IsServerError() bool {
return false
}
// IsCode returns true when this get subscriptionfeature o k response a status code equal to that given
func (o *GetSubscriptionfeatureOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the get subscriptionfeature o k response
func (o *GetSubscriptionfeatureOK) Code() int {
return 200
}
func (o *GetSubscriptionfeatureOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /subscriptionfeature][%d] getSubscriptionfeatureOK %s", 200, payload)
}
func (o *GetSubscriptionfeatureOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /subscriptionfeature][%d] getSubscriptionfeatureOK %s", 200, payload)
}
func (o *GetSubscriptionfeatureOK) GetPayload() *models.CommonSubscriptionFeature {
return o.Payload
}
func (o *GetSubscriptionfeatureOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.CommonSubscriptionFeature)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetSubscriptionfeatureBadRequest creates a GetSubscriptionfeatureBadRequest with default headers values
func NewGetSubscriptionfeatureBadRequest() *GetSubscriptionfeatureBadRequest {
return &GetSubscriptionfeatureBadRequest{}
}
/*
GetSubscriptionfeatureBadRequest describes a response with status code 400, with default header values.
Bad request
*/
type GetSubscriptionfeatureBadRequest struct {
Payload *models.CommonJSONError
}
// IsSuccess returns true when this get subscriptionfeature bad request response has a 2xx status code
func (o *GetSubscriptionfeatureBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get subscriptionfeature bad request response has a 3xx status code
func (o *GetSubscriptionfeatureBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this get subscriptionfeature bad request response has a 4xx status code
func (o *GetSubscriptionfeatureBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this get subscriptionfeature bad request response has a 5xx status code
func (o *GetSubscriptionfeatureBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this get subscriptionfeature bad request response a status code equal to that given
func (o *GetSubscriptionfeatureBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the get subscriptionfeature bad request response
func (o *GetSubscriptionfeatureBadRequest) Code() int {
return 400
}
func (o *GetSubscriptionfeatureBadRequest) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /subscriptionfeature][%d] getSubscriptionfeatureBadRequest %s", 400, payload)
}
func (o *GetSubscriptionfeatureBadRequest) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /subscriptionfeature][%d] getSubscriptionfeatureBadRequest %s", 400, payload)
}
func (o *GetSubscriptionfeatureBadRequest) GetPayload() *models.CommonJSONError {
return o.Payload
}
func (o *GetSubscriptionfeatureBadRequest) 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
}
// NewGetSubscriptionfeatureUnauthorized creates a GetSubscriptionfeatureUnauthorized with default headers values
func NewGetSubscriptionfeatureUnauthorized() *GetSubscriptionfeatureUnauthorized {
return &GetSubscriptionfeatureUnauthorized{}
}
/*
GetSubscriptionfeatureUnauthorized describes a response with status code 401, with default header values.
Unauthorized
*/
type GetSubscriptionfeatureUnauthorized struct {
Payload *models.CommonJSONError
}
// IsSuccess returns true when this get subscriptionfeature unauthorized response has a 2xx status code
func (o *GetSubscriptionfeatureUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get subscriptionfeature unauthorized response has a 3xx status code
func (o *GetSubscriptionfeatureUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this get subscriptionfeature unauthorized response has a 4xx status code
func (o *GetSubscriptionfeatureUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this get subscriptionfeature unauthorized response has a 5xx status code
func (o *GetSubscriptionfeatureUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this get subscriptionfeature unauthorized response a status code equal to that given
func (o *GetSubscriptionfeatureUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the get subscriptionfeature unauthorized response
func (o *GetSubscriptionfeatureUnauthorized) Code() int {
return 401
}
func (o *GetSubscriptionfeatureUnauthorized) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /subscriptionfeature][%d] getSubscriptionfeatureUnauthorized %s", 401, payload)
}
func (o *GetSubscriptionfeatureUnauthorized) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /subscriptionfeature][%d] getSubscriptionfeatureUnauthorized %s", 401, payload)
}
func (o *GetSubscriptionfeatureUnauthorized) GetPayload() *models.CommonJSONError {
return o.Payload
}
func (o *GetSubscriptionfeatureUnauthorized) 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
}
// NewGetSubscriptionfeatureServiceUnavailable creates a GetSubscriptionfeatureServiceUnavailable with default headers values
func NewGetSubscriptionfeatureServiceUnavailable() *GetSubscriptionfeatureServiceUnavailable {
return &GetSubscriptionfeatureServiceUnavailable{}
}
/*
GetSubscriptionfeatureServiceUnavailable describes a response with status code 503, with default header values.
Service unavailable
*/
type GetSubscriptionfeatureServiceUnavailable struct {
Payload *models.CommonJSONError
}
// IsSuccess returns true when this get subscriptionfeature service unavailable response has a 2xx status code
func (o *GetSubscriptionfeatureServiceUnavailable) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get subscriptionfeature service unavailable response has a 3xx status code
func (o *GetSubscriptionfeatureServiceUnavailable) IsRedirect() bool {
return false
}
// IsClientError returns true when this get subscriptionfeature service unavailable response has a 4xx status code
func (o *GetSubscriptionfeatureServiceUnavailable) IsClientError() bool {
return false
}
// IsServerError returns true when this get subscriptionfeature service unavailable response has a 5xx status code
func (o *GetSubscriptionfeatureServiceUnavailable) IsServerError() bool {
return true
}
// IsCode returns true when this get subscriptionfeature service unavailable response a status code equal to that given
func (o *GetSubscriptionfeatureServiceUnavailable) IsCode(code int) bool {
return code == 503
}
// Code gets the status code for the get subscriptionfeature service unavailable response
func (o *GetSubscriptionfeatureServiceUnavailable) Code() int {
return 503
}
func (o *GetSubscriptionfeatureServiceUnavailable) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /subscriptionfeature][%d] getSubscriptionfeatureServiceUnavailable %s", 503, payload)
}
func (o *GetSubscriptionfeatureServiceUnavailable) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /subscriptionfeature][%d] getSubscriptionfeatureServiceUnavailable %s", 503, payload)
}
func (o *GetSubscriptionfeatureServiceUnavailable) GetPayload() *models.CommonJSONError {
return o.Payload
}
func (o *GetSubscriptionfeatureServiceUnavailable) 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
}