# 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 .is_success import IsSuccess
from .page_identifier import PageIdentifier
from .payabli_api_response_notifications_response_data import PayabliApiResponseNotificationsResponseData
from .response_text import ResponseText
from .responsecode import Responsecode


class PayabliApiResponseNotifications(UniversalBaseModel):
    is_success: typing_extensions.Annotated[
        typing.Optional[IsSuccess],
        FieldMetadata(alias="isSuccess"),
        pydantic.Field(
            alias="isSuccess",
            description="\nIf `isSuccess` = true, `responseData` contains the notification identifier.\n\nIf `isSuccess` = false, `responseData` contains the reason for the error.",
        ),
    ] = None
    page_identifier: typing_extensions.Annotated[
        typing.Optional[PageIdentifier], FieldMetadata(alias="pageIdentifier"), pydantic.Field(alias="pageIdentifier")
    ] = None
    response_code: typing_extensions.Annotated[
        typing.Optional[Responsecode], FieldMetadata(alias="responseCode"), pydantic.Field(alias="responseCode")
    ] = None
    response_data: typing_extensions.Annotated[
        typing.Optional[PayabliApiResponseNotificationsResponseData],
        FieldMetadata(alias="responseData"),
        pydantic.Field(
            alias="responseData",
            description="When the request was successful, this contains the notification ID, or `nID` used to manage the notification.",
        ),
    ] = None
    response_text: typing_extensions.Annotated[
        ResponseText, FieldMetadata(alias="responseText"), pydantic.Field(alias="responseText")
    ]

    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
