# This file was auto-generated by Fern from our API Definition.

import typing

from ..core import enum

T_Result = typing.TypeVar("T_Result")


class SubjectType(enum.StrEnum):
    """
    Subject type
    """

    USER = "user"
    TEAM = "team"
    SERVICEACCOUNT = "serviceaccount"
    VIRTUALACCOUNT = "virtualaccount"
    EXTERNAL_IDENTITY = "external-identity"

    def visit(
        self,
        user: typing.Callable[[], T_Result],
        team: typing.Callable[[], T_Result],
        serviceaccount: typing.Callable[[], T_Result],
        virtualaccount: typing.Callable[[], T_Result],
        external_identity: typing.Callable[[], T_Result],
    ) -> T_Result:
        if self is SubjectType.USER:
            return user()
        if self is SubjectType.TEAM:
            return team()
        if self is SubjectType.SERVICEACCOUNT:
            return serviceaccount()
        if self is SubjectType.VIRTUALACCOUNT:
            return virtualaccount()
        if self is SubjectType.EXTERNAL_IDENTITY:
            return external_identity()
