# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Union
from datetime import datetime
from typing_extensions import Literal, TypeAlias

from ..._models import BaseModel
from .slack_settings import SlackSettings
from .mobile_push_settings import MobilePushSettings

__all__ = ["ChannelSettings", "Settings"]

Settings: TypeAlias = Union[MobilePushSettings, SlackSettings]


class ChannelSettings(BaseModel):
    """User's settings for a specific channel (e.g., device tokens, Slack credentials)"""

    channel_id: str
    """Channel ID"""

    created_at: datetime
    """When the settings were created"""

    provider: Literal["apns", "fcm", "slack"]
    """The provider type for this channel"""

    settings: Settings
    """Provider-specific settings. See MobilePushSettings or SlackSettings schemas."""

    updated_at: datetime
    """When the settings were last updated"""

    user_id: str
    """Internal user ID"""
