"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from .v3_services_routingrules_expressionbranch import (
    V3ServicesRoutingRulesExpressionBranch,
    V3ServicesRoutingRulesExpressionBranchTypedDict,
)
from squadcast_sdk.types import BaseModel
from typing import List, Literal, Optional
from typing_extensions import NotRequired, TypedDict


V3ServicesRoutingRulesRoutingRuleResponseEntityType = Literal[
    "user",
    "squad",
    "escalation_policy",
]


class V3ServicesRoutingRulesRoutingRuleResponseRouteToTypedDict(TypedDict):
    entity_type: V3ServicesRoutingRulesRoutingRuleResponseEntityType
    entity_id: str


class V3ServicesRoutingRulesRoutingRuleResponseRouteTo(BaseModel):
    entity_type: V3ServicesRoutingRulesRoutingRuleResponseEntityType

    entity_id: str


class V3ServicesRoutingRulesRoutingRuleResponseTypedDict(TypedDict):
    expression: str
    route_to: V3ServicesRoutingRulesRoutingRuleResponseRouteToTypedDict
    is_basic: bool
    basic_expression: NotRequired[List[V3ServicesRoutingRulesExpressionBranchTypedDict]]


class V3ServicesRoutingRulesRoutingRuleResponse(BaseModel):
    expression: str

    route_to: V3ServicesRoutingRulesRoutingRuleResponseRouteTo

    is_basic: bool

    basic_expression: Optional[List[V3ServicesRoutingRulesExpressionBranch]] = None
