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

from ...core.unchecked_base_model import UncheckedBaseModel
import pydantic
from .slack_credential import SlackCredential
import typing
from ...core.pydantic_utilities import IS_PYDANTIC_V2


class NotificationsSlack(UncheckedBaseModel):
    """
    Configuration for Slack.

    [Configuration guide](https://docs.synqly.com/guides/provider-configuration/slack-notification-setup)
    """

    channel: str = pydantic.Field()
    """
    Channel to send notifications to. Must be a valid existing channel.
    """

    credential: SlackCredential
    url: typing.Optional[str] = pydantic.Field(default=None)
    """
    Base URL for the Slack API.
    """

    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
