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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .notification_report_request_content import NotificationReportRequestContent
from .notification_report_request_frequency import NotificationReportRequestFrequency
from .notification_report_request_method import NotificationReportRequestMethod
from .ownerid import Ownerid
from .ownertype import Ownertype
from .statusnotification import Statusnotification


class NotificationReportRequest(UniversalBaseModel):
    """
    Information about the report notification configuration (report-email, report-web).
    """

    content: NotificationReportRequestContent
    frequency: NotificationReportRequestFrequency
    method: NotificationReportRequestMethod = pydantic.Field()
    """
    Automated reporting lets you gather critical reports without manually filtering and exporting the data. Get automated daily, weekly, and monthly report for daily sales, ACH returns, settlements, and more. You can send these reports via email or via webhook. See [Automated Reports](/developers/developer-guides/notifications-and-webhooks-overview#automated-reports) for more.
    """

    owner_id: typing_extensions.Annotated[typing.Optional[Ownerid], FieldMetadata(alias="ownerId")] = None
    owner_type: typing_extensions.Annotated[Ownertype, FieldMetadata(alias="ownerType")]
    status: typing.Optional[Statusnotification] = None
    target: str = pydantic.Field()
    """
    Specify the notification target.
    
    For method=report-email the expected value is a list of email addresses separated by semicolon.
    
    For method=report-web the expected value is a valid and complete URL. Webhooks support only standard HTTP ports: 80, 443, 8080, or 4443.
    """

    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
