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

// GetSubscriptionfeaturesReader is a Reader for the GetSubscriptionfeatures structure.
type GetSubscriptionfeaturesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetSubscriptionfeaturesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetSubscriptionfeaturesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetSubscriptionfeaturesBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetSubscriptionfeaturesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewGetSubscriptionfeaturesServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /subscriptionfeatures] GetSubscriptionfeatures", response, response.Code())
	}
}

// NewGetSubscriptionfeaturesOK creates a GetSubscriptionfeaturesOK with default headers values
func NewGetSubscriptionfeaturesOK() *GetSubscriptionfeaturesOK {
	return &GetSubscriptionfeaturesOK{}
}

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

OK
*/
type GetSubscriptionfeaturesOK struct {
	Payload *models.CommonJSONDBQueryResult
}

// IsSuccess returns true when this get subscriptionfeatures o k response has a 2xx status code
func (o *GetSubscriptionfeaturesOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this get subscriptionfeatures o k response has a 3xx status code
func (o *GetSubscriptionfeaturesOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get subscriptionfeatures o k response has a 4xx status code
func (o *GetSubscriptionfeaturesOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this get subscriptionfeatures o k response has a 5xx status code
func (o *GetSubscriptionfeaturesOK) IsServerError() bool {
	return false
}

// IsCode returns true when this get subscriptionfeatures o k response a status code equal to that given
func (o *GetSubscriptionfeaturesOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the get subscriptionfeatures o k response
func (o *GetSubscriptionfeaturesOK) Code() int {
	return 200
}

func (o *GetSubscriptionfeaturesOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /subscriptionfeatures][%d] getSubscriptionfeaturesOK %s", 200, payload)
}

func (o *GetSubscriptionfeaturesOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /subscriptionfeatures][%d] getSubscriptionfeaturesOK %s", 200, payload)
}

func (o *GetSubscriptionfeaturesOK) GetPayload() *models.CommonJSONDBQueryResult {
	return o.Payload
}

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

	o.Payload = new(models.CommonJSONDBQueryResult)

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

	return nil
}

// NewGetSubscriptionfeaturesBadRequest creates a GetSubscriptionfeaturesBadRequest with default headers values
func NewGetSubscriptionfeaturesBadRequest() *GetSubscriptionfeaturesBadRequest {
	return &GetSubscriptionfeaturesBadRequest{}
}

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

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

// IsSuccess returns true when this get subscriptionfeatures bad request response has a 2xx status code
func (o *GetSubscriptionfeaturesBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get subscriptionfeatures bad request response has a 3xx status code
func (o *GetSubscriptionfeaturesBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get subscriptionfeatures bad request response has a 4xx status code
func (o *GetSubscriptionfeaturesBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this get subscriptionfeatures bad request response has a 5xx status code
func (o *GetSubscriptionfeaturesBadRequest) IsServerError() bool {
	return false
}

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

// Code gets the status code for the get subscriptionfeatures bad request response
func (o *GetSubscriptionfeaturesBadRequest) Code() int {
	return 400
}

func (o *GetSubscriptionfeaturesBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /subscriptionfeatures][%d] getSubscriptionfeaturesBadRequest %s", 400, payload)
}

func (o *GetSubscriptionfeaturesBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /subscriptionfeatures][%d] getSubscriptionfeaturesBadRequest %s", 400, payload)
}

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

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

// NewGetSubscriptionfeaturesUnauthorized creates a GetSubscriptionfeaturesUnauthorized with default headers values
func NewGetSubscriptionfeaturesUnauthorized() *GetSubscriptionfeaturesUnauthorized {
	return &GetSubscriptionfeaturesUnauthorized{}
}

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

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

// IsSuccess returns true when this get subscriptionfeatures unauthorized response has a 2xx status code
func (o *GetSubscriptionfeaturesUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get subscriptionfeatures unauthorized response has a 3xx status code
func (o *GetSubscriptionfeaturesUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get subscriptionfeatures unauthorized response has a 4xx status code
func (o *GetSubscriptionfeaturesUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this get subscriptionfeatures unauthorized response has a 5xx status code
func (o *GetSubscriptionfeaturesUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this get subscriptionfeatures unauthorized response a status code equal to that given
func (o *GetSubscriptionfeaturesUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the get subscriptionfeatures unauthorized response
func (o *GetSubscriptionfeaturesUnauthorized) Code() int {
	return 401
}

func (o *GetSubscriptionfeaturesUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /subscriptionfeatures][%d] getSubscriptionfeaturesUnauthorized %s", 401, payload)
}

func (o *GetSubscriptionfeaturesUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /subscriptionfeatures][%d] getSubscriptionfeaturesUnauthorized %s", 401, payload)
}

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

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

// NewGetSubscriptionfeaturesServiceUnavailable creates a GetSubscriptionfeaturesServiceUnavailable with default headers values
func NewGetSubscriptionfeaturesServiceUnavailable() *GetSubscriptionfeaturesServiceUnavailable {
	return &GetSubscriptionfeaturesServiceUnavailable{}
}

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

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

// IsSuccess returns true when this get subscriptionfeatures service unavailable response has a 2xx status code
func (o *GetSubscriptionfeaturesServiceUnavailable) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get subscriptionfeatures service unavailable response has a 3xx status code
func (o *GetSubscriptionfeaturesServiceUnavailable) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get subscriptionfeatures service unavailable response has a 4xx status code
func (o *GetSubscriptionfeaturesServiceUnavailable) IsClientError() bool {
	return false
}

// IsServerError returns true when this get subscriptionfeatures service unavailable response has a 5xx status code
func (o *GetSubscriptionfeaturesServiceUnavailable) IsServerError() bool {
	return true
}

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

// Code gets the status code for the get subscriptionfeatures service unavailable response
func (o *GetSubscriptionfeaturesServiceUnavailable) Code() int {
	return 503
}

func (o *GetSubscriptionfeaturesServiceUnavailable) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /subscriptionfeatures][%d] getSubscriptionfeaturesServiceUnavailable %s", 503, payload)
}

func (o *GetSubscriptionfeaturesServiceUnavailable) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /subscriptionfeatures][%d] getSubscriptionfeaturesServiceUnavailable %s", 503, payload)
}

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

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