// Code generated by go-swagger; DO NOT EDIT.

// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package portal_access

import (
	"encoding/json"
	stderrors "errors"
	"fmt"
	"io"

	"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"
)

// GetSubscriptionsReader is a Reader for the GetSubscriptions structure.
type GetSubscriptionsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetSubscriptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewGetSubscriptionsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetSubscriptionsBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetSubscriptionsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetSubscriptionsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetSubscriptionsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /subscriptions] getSubscriptions", response, response.Code())
	}
}

// NewGetSubscriptionsOK creates a GetSubscriptionsOK with default headers values
func NewGetSubscriptionsOK() *GetSubscriptionsOK {
	return &GetSubscriptionsOK{}
}

// GetSubscriptionsOK describes a response with status code 200, with default header values.
//
// Authorized subscription records
type GetSubscriptionsOK struct {
	Payload *members_models.SubscriptionResponse
}

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

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

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

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

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

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

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

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

func (o *GetSubscriptionsOK) GetPayload() *members_models.SubscriptionResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.SubscriptionResponse)

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

	return nil
}

// NewGetSubscriptionsBadRequest creates a GetSubscriptionsBadRequest with default headers values
func NewGetSubscriptionsBadRequest() *GetSubscriptionsBadRequest {
	return &GetSubscriptionsBadRequest{}
}

// GetSubscriptionsBadRequest describes a response with status code 400, with default header values.
//
// Invalid subscription filter
type GetSubscriptionsBadRequest struct {
}

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

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

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

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

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

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

func (o *GetSubscriptionsBadRequest) Error() string {
	return fmt.Sprintf("[GET /subscriptions][%d] getSubscriptionsBadRequest", 400)
}

func (o *GetSubscriptionsBadRequest) String() string {
	return fmt.Sprintf("[GET /subscriptions][%d] getSubscriptionsBadRequest", 400)
}

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

	return nil
}

// NewGetSubscriptionsUnauthorized creates a GetSubscriptionsUnauthorized with default headers values
func NewGetSubscriptionsUnauthorized() *GetSubscriptionsUnauthorized {
	return &GetSubscriptionsUnauthorized{}
}

// GetSubscriptionsUnauthorized describes a response with status code 401, with default header values.
//
// Missing or invalid server or session credential
type GetSubscriptionsUnauthorized struct {
}

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

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

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

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

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

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

func (o *GetSubscriptionsUnauthorized) Error() string {
	return fmt.Sprintf("[GET /subscriptions][%d] getSubscriptionsUnauthorized", 401)
}

func (o *GetSubscriptionsUnauthorized) String() string {
	return fmt.Sprintf("[GET /subscriptions][%d] getSubscriptionsUnauthorized", 401)
}

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

	return nil
}

// NewGetSubscriptionsForbidden creates a GetSubscriptionsForbidden with default headers values
func NewGetSubscriptionsForbidden() *GetSubscriptionsForbidden {
	return &GetSubscriptionsForbidden{}
}

// GetSubscriptionsForbidden describes a response with status code 403, with default header values.
//
// Actor is not a member of or cannot manage the requested tenant
type GetSubscriptionsForbidden struct {
}

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

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

// IsClientError returns true when this get subscriptions forbidden response has a 4xx status code
func (o *GetSubscriptionsForbidden) IsClientError() bool {
	return true
}

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

// IsCode returns true when this get subscriptions forbidden response a status code equal to that given
func (o *GetSubscriptionsForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the get subscriptions forbidden response
func (o *GetSubscriptionsForbidden) Code() int {
	return 403
}

func (o *GetSubscriptionsForbidden) Error() string {
	return fmt.Sprintf("[GET /subscriptions][%d] getSubscriptionsForbidden", 403)
}

func (o *GetSubscriptionsForbidden) String() string {
	return fmt.Sprintf("[GET /subscriptions][%d] getSubscriptionsForbidden", 403)
}

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

	return nil
}

// NewGetSubscriptionsInternalServerError creates a GetSubscriptionsInternalServerError with default headers values
func NewGetSubscriptionsInternalServerError() *GetSubscriptionsInternalServerError {
	return &GetSubscriptionsInternalServerError{}
}

// GetSubscriptionsInternalServerError describes a response with status code 500, with default header values.
//
// Server error
type GetSubscriptionsInternalServerError struct {
}

// IsSuccess returns true when this get subscriptions internal server error response has a 2xx status code
func (o *GetSubscriptionsInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get subscriptions internal server error response has a 3xx status code
func (o *GetSubscriptionsInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get subscriptions internal server error response has a 4xx status code
func (o *GetSubscriptionsInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this get subscriptions internal server error response has a 5xx status code
func (o *GetSubscriptionsInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this get subscriptions internal server error response a status code equal to that given
func (o *GetSubscriptionsInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the get subscriptions internal server error response
func (o *GetSubscriptionsInternalServerError) Code() int {
	return 500
}

func (o *GetSubscriptionsInternalServerError) Error() string {
	return fmt.Sprintf("[GET /subscriptions][%d] getSubscriptionsInternalServerError", 500)
}

func (o *GetSubscriptionsInternalServerError) String() string {
	return fmt.Sprintf("[GET /subscriptions][%d] getSubscriptionsInternalServerError", 500)
}

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

	return nil
}
