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

from __future__ import annotations

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .action_schema import ActionSchema
from .payable_action_schema import PayableActionSchema


class RootSchemaOutput_ApprovalPolicy(UniversalBaseModel):
    object_type: typing.Literal["approval_policy"] = "approval_policy"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_ApprovalRequest(UniversalBaseModel):
    object_type: typing.Literal["approval_request"] = "approval_request"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_Comment(UniversalBaseModel):
    object_type: typing.Literal["comment"] = "comment"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_Counterpart(UniversalBaseModel):
    object_type: typing.Literal["counterpart"] = "counterpart"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_CounterpartVatId(UniversalBaseModel):
    object_type: typing.Literal["counterpart_vat_id"] = "counterpart_vat_id"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_DeliveryNote(UniversalBaseModel):
    object_type: typing.Literal["delivery_note"] = "delivery_note"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_Entity(UniversalBaseModel):
    object_type: typing.Literal["entity"] = "entity"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_EntityBankAccount(UniversalBaseModel):
    object_type: typing.Literal["entity_bank_account"] = "entity_bank_account"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_EntityUser(UniversalBaseModel):
    object_type: typing.Literal["entity_user"] = "entity_user"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_EntityVatIds(UniversalBaseModel):
    object_type: typing.Literal["entity_vat_ids"] = "entity_vat_ids"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_Export(UniversalBaseModel):
    object_type: typing.Literal["export"] = "export"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_Mailbox(UniversalBaseModel):
    object_type: typing.Literal["mailbox"] = "mailbox"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_OcrTask(UniversalBaseModel):
    object_type: typing.Literal["ocr_task"] = "ocr_task"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_Onboarding(UniversalBaseModel):
    object_type: typing.Literal["onboarding"] = "onboarding"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_OverdueReminder(UniversalBaseModel):
    object_type: typing.Literal["overdue_reminder"] = "overdue_reminder"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_Payable(UniversalBaseModel):
    object_type: typing.Literal["payable"] = "payable"
    actions: typing.Optional[typing.List[PayableActionSchema]] = None

    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


class RootSchemaOutput_PayablesPurchaseOrder(UniversalBaseModel):
    object_type: typing.Literal["payables_purchase_order"] = "payables_purchase_order"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_PaymentRecord(UniversalBaseModel):
    object_type: typing.Literal["payment_record"] = "payment_record"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_PaymentReminder(UniversalBaseModel):
    object_type: typing.Literal["payment_reminder"] = "payment_reminder"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_Person(UniversalBaseModel):
    object_type: typing.Literal["person"] = "person"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_Product(UniversalBaseModel):
    object_type: typing.Literal["product"] = "product"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_Project(UniversalBaseModel):
    object_type: typing.Literal["project"] = "project"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_Receivable(UniversalBaseModel):
    object_type: typing.Literal["receivable"] = "receivable"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_Reconciliation(UniversalBaseModel):
    object_type: typing.Literal["reconciliation"] = "reconciliation"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_Role(UniversalBaseModel):
    object_type: typing.Literal["role"] = "role"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_Tag(UniversalBaseModel):
    object_type: typing.Literal["tag"] = "tag"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_TodoTask(UniversalBaseModel):
    object_type: typing.Literal["todo_task"] = "todo_task"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_TodoTaskMute(UniversalBaseModel):
    object_type: typing.Literal["todo_task_mute"] = "todo_task_mute"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_Transaction(UniversalBaseModel):
    object_type: typing.Literal["transaction"] = "transaction"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


class RootSchemaOutput_Workflow(UniversalBaseModel):
    object_type: typing.Literal["workflow"] = "workflow"
    actions: typing.Optional[typing.List[ActionSchema]] = None

    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


RootSchemaOutput = typing.Union[
    RootSchemaOutput_ApprovalPolicy,
    RootSchemaOutput_ApprovalRequest,
    RootSchemaOutput_Comment,
    RootSchemaOutput_Counterpart,
    RootSchemaOutput_CounterpartVatId,
    RootSchemaOutput_DeliveryNote,
    RootSchemaOutput_Entity,
    RootSchemaOutput_EntityBankAccount,
    RootSchemaOutput_EntityUser,
    RootSchemaOutput_EntityVatIds,
    RootSchemaOutput_Export,
    RootSchemaOutput_Mailbox,
    RootSchemaOutput_OcrTask,
    RootSchemaOutput_Onboarding,
    RootSchemaOutput_OverdueReminder,
    RootSchemaOutput_Payable,
    RootSchemaOutput_PayablesPurchaseOrder,
    RootSchemaOutput_PaymentRecord,
    RootSchemaOutput_PaymentReminder,
    RootSchemaOutput_Person,
    RootSchemaOutput_Product,
    RootSchemaOutput_Project,
    RootSchemaOutput_Receivable,
    RootSchemaOutput_Reconciliation,
    RootSchemaOutput_Role,
    RootSchemaOutput_Tag,
    RootSchemaOutput_TodoTask,
    RootSchemaOutput_TodoTaskMute,
    RootSchemaOutput_Transaction,
    RootSchemaOutput_Workflow,
]
