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

// DeleteSubscriptionfeatureReader is a Reader for the DeleteSubscriptionfeature structure.
type DeleteSubscriptionfeatureReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *DeleteSubscriptionfeatureReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewDeleteSubscriptionfeatureOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewDeleteSubscriptionfeatureBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewDeleteSubscriptionfeatureUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewDeleteSubscriptionfeatureServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[DELETE /subscriptionfeature] DeleteSubscriptionfeature", response, response.Code())
	}
}

// NewDeleteSubscriptionfeatureOK creates a DeleteSubscriptionfeatureOK with default headers values
func NewDeleteSubscriptionfeatureOK() *DeleteSubscriptionfeatureOK {
	return &DeleteSubscriptionfeatureOK{}
}

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

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

// IsSuccess returns true when this delete subscriptionfeature o k response has a 2xx status code
func (o *DeleteSubscriptionfeatureOK) IsSuccess() bool {
	return true
}

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

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

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

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

// Code gets the status code for the delete subscriptionfeature o k response
func (o *DeleteSubscriptionfeatureOK) Code() int {
	return 200
}

func (o *DeleteSubscriptionfeatureOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /subscriptionfeature][%d] deleteSubscriptionfeatureOK %s", 200, payload)
}

func (o *DeleteSubscriptionfeatureOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /subscriptionfeature][%d] deleteSubscriptionfeatureOK %s", 200, payload)
}

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

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

// NewDeleteSubscriptionfeatureBadRequest creates a DeleteSubscriptionfeatureBadRequest with default headers values
func NewDeleteSubscriptionfeatureBadRequest() *DeleteSubscriptionfeatureBadRequest {
	return &DeleteSubscriptionfeatureBadRequest{}
}

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

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

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

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

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

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

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

// Code gets the status code for the delete subscriptionfeature bad request response
func (o *DeleteSubscriptionfeatureBadRequest) Code() int {
	return 400
}

func (o *DeleteSubscriptionfeatureBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /subscriptionfeature][%d] deleteSubscriptionfeatureBadRequest %s", 400, payload)
}

func (o *DeleteSubscriptionfeatureBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /subscriptionfeature][%d] deleteSubscriptionfeatureBadRequest %s", 400, payload)
}

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

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

// NewDeleteSubscriptionfeatureUnauthorized creates a DeleteSubscriptionfeatureUnauthorized with default headers values
func NewDeleteSubscriptionfeatureUnauthorized() *DeleteSubscriptionfeatureUnauthorized {
	return &DeleteSubscriptionfeatureUnauthorized{}
}

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

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

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

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

// IsClientError returns true when this delete subscriptionfeature unauthorized response has a 4xx status code
func (o *DeleteSubscriptionfeatureUnauthorized) IsClientError() bool {
	return true
}

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

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

// Code gets the status code for the delete subscriptionfeature unauthorized response
func (o *DeleteSubscriptionfeatureUnauthorized) Code() int {
	return 401
}

func (o *DeleteSubscriptionfeatureUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /subscriptionfeature][%d] deleteSubscriptionfeatureUnauthorized %s", 401, payload)
}

func (o *DeleteSubscriptionfeatureUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /subscriptionfeature][%d] deleteSubscriptionfeatureUnauthorized %s", 401, payload)
}

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

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

// NewDeleteSubscriptionfeatureServiceUnavailable creates a DeleteSubscriptionfeatureServiceUnavailable with default headers values
func NewDeleteSubscriptionfeatureServiceUnavailable() *DeleteSubscriptionfeatureServiceUnavailable {
	return &DeleteSubscriptionfeatureServiceUnavailable{}
}

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

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

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

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

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

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

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

// Code gets the status code for the delete subscriptionfeature service unavailable response
func (o *DeleteSubscriptionfeatureServiceUnavailable) Code() int {
	return 503
}

func (o *DeleteSubscriptionfeatureServiceUnavailable) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /subscriptionfeature][%d] deleteSubscriptionfeatureServiceUnavailable %s", 503, payload)
}

func (o *DeleteSubscriptionfeatureServiceUnavailable) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /subscriptionfeature][%d] deleteSubscriptionfeatureServiceUnavailable %s", 503, payload)
}

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

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