// 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_memberships

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

// GetManageableTenantsReader is a Reader for the GetManageableTenants structure.
type GetManageableTenantsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetManageableTenantsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewGetManageableTenantsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetManageableTenantsBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetManageableTenantsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetManageableTenantsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /manageabletenants] getManageableTenants", response, response.Code())
	}
}

// NewGetManageableTenantsOK creates a GetManageableTenantsOK with default headers values
func NewGetManageableTenantsOK() *GetManageableTenantsOK {
	return &GetManageableTenantsOK{}
}

// GetManageableTenantsOK describes a response with status code 200, with default header values.
//
// Actor-derived manageable tenant contexts
type GetManageableTenantsOK struct {
	Payload *members_models.ManageableTenantResponse
}

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

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

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

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

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

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

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

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

func (o *GetManageableTenantsOK) GetPayload() *members_models.ManageableTenantResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.ManageableTenantResponse)

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

	return nil
}

// NewGetManageableTenantsBadRequest creates a GetManageableTenantsBadRequest with default headers values
func NewGetManageableTenantsBadRequest() *GetManageableTenantsBadRequest {
	return &GetManageableTenantsBadRequest{}
}

// GetManageableTenantsBadRequest describes a response with status code 400, with default header values.
//
// Invalid pagination
type GetManageableTenantsBadRequest struct {
}

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

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

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

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

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

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

func (o *GetManageableTenantsBadRequest) Error() string {
	return fmt.Sprintf("[GET /manageabletenants][%d] getManageableTenantsBadRequest", 400)
}

func (o *GetManageableTenantsBadRequest) String() string {
	return fmt.Sprintf("[GET /manageabletenants][%d] getManageableTenantsBadRequest", 400)
}

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

	return nil
}

// NewGetManageableTenantsUnauthorized creates a GetManageableTenantsUnauthorized with default headers values
func NewGetManageableTenantsUnauthorized() *GetManageableTenantsUnauthorized {
	return &GetManageableTenantsUnauthorized{}
}

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

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

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

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

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

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

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

func (o *GetManageableTenantsUnauthorized) Error() string {
	return fmt.Sprintf("[GET /manageabletenants][%d] getManageableTenantsUnauthorized", 401)
}

func (o *GetManageableTenantsUnauthorized) String() string {
	return fmt.Sprintf("[GET /manageabletenants][%d] getManageableTenantsUnauthorized", 401)
}

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

	return nil
}

// NewGetManageableTenantsInternalServerError creates a GetManageableTenantsInternalServerError with default headers values
func NewGetManageableTenantsInternalServerError() *GetManageableTenantsInternalServerError {
	return &GetManageableTenantsInternalServerError{}
}

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

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

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

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

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

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

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

func (o *GetManageableTenantsInternalServerError) Error() string {
	return fmt.Sprintf("[GET /manageabletenants][%d] getManageableTenantsInternalServerError", 500)
}

func (o *GetManageableTenantsInternalServerError) String() string {
	return fmt.Sprintf("[GET /manageabletenants][%d] getManageableTenantsInternalServerError", 500)
}

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

	return nil
}
