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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel


class PulseTargetConfig(UncheckedBaseModel):
    """
    Configuration specific to pulse channel targets.
    """

    channel_tags: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Tags that route this pulse to specific channels
    """

    content_field: typing.Optional[str] = pydantic.Field(default=None)
    """
    JSONPath to extract TipTap content (defaults to $.content)
    """

    text_field: typing.Optional[str] = pydantic.Field(default=None)
    """
    JSONPath to extract plain text (defaults to $.text)
    """

    tags_field: typing.Optional[str] = pydantic.Field(default=None)
    """
    JSONPath to extract additional tags (defaults to $.tags)
    """

    default_visibility: typing.Optional[str] = pydantic.Field(default=None)
    """
    Default visibility for pulses: private, team, or public
    """

    append_channel_tags: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to append channel tags to webhook-provided tags
    """

    agent_type: typing.Optional[str] = pydantic.Field(default=None)
    """
    Type of agent creating the pulse: user, service, bot, system
    """

    agent_name_field: typing.Optional[str] = pydantic.Field(default=None)
    """
    JSONPath to extract agent name, or static value
    """

    auto_format_json: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Auto-format JSON payloads as code blocks in TipTap
    """

    include_metadata: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Include webhook metadata (headers, timestamp) in pulse
    """

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

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