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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .slack_webhook_auth import SlackWebhookAuth


class SlackWebhookIntegration(UniversalBaseModel):
    """
    +label=Slack Webhook Integration
    +icon=https://assets.production.truefoundry.com/slack.svg
    """

    type: typing.Literal["integration/notification-channel/slack-webhook"] = pydantic.Field(
        default="integration/notification-channel/slack-webhook"
    )
    """
    +value=integration/notification-channel/slack-webhook
    """

    name: str = pydantic.Field()
    """
    +label=Display Name
    +usage=The name of the integration that will be displayed in the TrueFoundry UI.
    +uiProps={"disableEdit":false}
    +sort=100
    +message=3 to 32 lower case characters long alphanumeric word, may contain - in between, cannot start with a number
    """

    auth_data: SlackWebhookAuth
    authorized_subjects: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    +label=Access Control
    +usage=List of subjects that are authorized to access this integration. List of user fqn in format <user_type>:<username>.
    +sort=10005
    +uiType=AuthorizedSubjects
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow")  # type: ignore # Pydantic v2
    else:

        class Config:
            smart_union = True
            extra = pydantic.Extra.allow
