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

from __future__ import annotations

import typing

from ...core.pydantic_utilities import pydantic_v1
from ...payment_method_types.types.currency_code import CurrencyCode
from .entity_id import EntityId


class Trigger_Amount(pydantic_v1.BaseModel):
    type: typing.Literal["amount"] = "amount"
    amount: float
    currency: CurrencyCode

    class Config:
        frozen = True
        smart_union = True


class Trigger_Vendor(pydantic_v1.BaseModel):
    type: typing.Literal["vendor"] = "vendor"
    vendor_ids: typing.List[EntityId] = pydantic_v1.Field(alias="vendorIds")

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True
        populate_by_name = True


class Trigger_Metadata(pydantic_v1.BaseModel):
    type: typing.Literal["metadata"] = "metadata"
    key: str
    value: str

    class Config:
        frozen = True
        smart_union = True


Trigger = typing.Union[Trigger_Amount, Trigger_Vendor, Trigger_Metadata]
