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

// GetEffectiveEntitlementsReader is a Reader for the GetEffectiveEntitlements structure.
type GetEffectiveEntitlementsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetEffectiveEntitlementsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewGetEffectiveEntitlementsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetEffectiveEntitlementsBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetEffectiveEntitlementsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetEffectiveEntitlementsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetEffectiveEntitlementsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /effectiveentitlements] getEffectiveEntitlements", response, response.Code())
	}
}

// NewGetEffectiveEntitlementsOK creates a GetEffectiveEntitlementsOK with default headers values
func NewGetEffectiveEntitlementsOK() *GetEffectiveEntitlementsOK {
	return &GetEffectiveEntitlementsOK{}
}

// GetEffectiveEntitlementsOK describes a response with status code 200, with default header values.
//
// Effective grants with typed limits and provenance
type GetEffectiveEntitlementsOK struct {
	Payload *members_models.EffectiveEntitlementResponse
}

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

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

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

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

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

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

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

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

func (o *GetEffectiveEntitlementsOK) GetPayload() *members_models.EffectiveEntitlementResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.EffectiveEntitlementResponse)

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

	return nil
}

// NewGetEffectiveEntitlementsBadRequest creates a GetEffectiveEntitlementsBadRequest with default headers values
func NewGetEffectiveEntitlementsBadRequest() *GetEffectiveEntitlementsBadRequest {
	return &GetEffectiveEntitlementsBadRequest{}
}

// GetEffectiveEntitlementsBadRequest describes a response with status code 400, with default header values.
//
// Invalid or ambiguous effective-entitlement context
type GetEffectiveEntitlementsBadRequest struct {
}

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

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

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

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

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

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

func (o *GetEffectiveEntitlementsBadRequest) Error() string {
	return fmt.Sprintf("[GET /effectiveentitlements][%d] getEffectiveEntitlementsBadRequest", 400)
}

func (o *GetEffectiveEntitlementsBadRequest) String() string {
	return fmt.Sprintf("[GET /effectiveentitlements][%d] getEffectiveEntitlementsBadRequest", 400)
}

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

	return nil
}

// NewGetEffectiveEntitlementsUnauthorized creates a GetEffectiveEntitlementsUnauthorized with default headers values
func NewGetEffectiveEntitlementsUnauthorized() *GetEffectiveEntitlementsUnauthorized {
	return &GetEffectiveEntitlementsUnauthorized{}
}

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

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

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

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

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

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

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

func (o *GetEffectiveEntitlementsUnauthorized) Error() string {
	return fmt.Sprintf("[GET /effectiveentitlements][%d] getEffectiveEntitlementsUnauthorized", 401)
}

func (o *GetEffectiveEntitlementsUnauthorized) String() string {
	return fmt.Sprintf("[GET /effectiveentitlements][%d] getEffectiveEntitlementsUnauthorized", 401)
}

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

	return nil
}

// NewGetEffectiveEntitlementsForbidden creates a GetEffectiveEntitlementsForbidden with default headers values
func NewGetEffectiveEntitlementsForbidden() *GetEffectiveEntitlementsForbidden {
	return &GetEffectiveEntitlementsForbidden{}
}

// GetEffectiveEntitlementsForbidden describes a response with status code 403, with default header values.
//
// Actor is not authorized for the tenant or user scope
type GetEffectiveEntitlementsForbidden struct {
}

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

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

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

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

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

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

func (o *GetEffectiveEntitlementsForbidden) Error() string {
	return fmt.Sprintf("[GET /effectiveentitlements][%d] getEffectiveEntitlementsForbidden", 403)
}

func (o *GetEffectiveEntitlementsForbidden) String() string {
	return fmt.Sprintf("[GET /effectiveentitlements][%d] getEffectiveEntitlementsForbidden", 403)
}

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

	return nil
}

// NewGetEffectiveEntitlementsInternalServerError creates a GetEffectiveEntitlementsInternalServerError with default headers values
func NewGetEffectiveEntitlementsInternalServerError() *GetEffectiveEntitlementsInternalServerError {
	return &GetEffectiveEntitlementsInternalServerError{}
}

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

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

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

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

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

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

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

func (o *GetEffectiveEntitlementsInternalServerError) Error() string {
	return fmt.Sprintf("[GET /effectiveentitlements][%d] getEffectiveEntitlementsInternalServerError", 500)
}

func (o *GetEffectiveEntitlementsInternalServerError) String() string {
	return fmt.Sprintf("[GET /effectiveentitlements][%d] getEffectiveEntitlementsInternalServerError", 500)
}

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

	return nil
}
