# This file was generated by liblab | https://liblab.com/

from enum import Enum
from typing import Union
from typing import List
from .utils.json_map import JsonMap
from .base import BaseModel
from .base import OneOfBaseModel


@JsonMap({})
class Data12(BaseModel):
    """Text type

    :param value: value, defaults to None
    :type value: str, optional
    """

    def __init__(self, value: str = None):
        if value is not None:
            self.value = value


@JsonMap({})
class Data22(BaseModel):
    """Number type

    :param value: value, defaults to None
    :type value: float, optional
    """

    def __init__(self, value: float = None):
        if value is not None:
            self.value = value


@JsonMap({})
class Data32(BaseModel):
    """Date type: YYYY-MM-DD

    :param value: value, defaults to None
    :type value: str, optional
    """

    def __init__(self, value: str = None):
        if value is not None:
            self.value = value


@JsonMap({})
class Data42(BaseModel):
    """Percentage type

    :param value: value, defaults to None
    :type value: float, optional
    """

    def __init__(self, value: float = None):
        if value is not None:
            self.value = value


class Data5Currency2(Enum):
    """An enumeration representing different categories.

    :cvar USD: "USD"
    :vartype USD: str
    :cvar EUR: "EUR"
    :vartype EUR: str
    :cvar JPY: "JPY"
    :vartype JPY: str
    :cvar GBP: "GBP"
    :vartype GBP: str
    :cvar AUD: "AUD"
    :vartype AUD: str
    :cvar CAD: "CAD"
    :vartype CAD: str
    :cvar CHF: "CHF"
    :vartype CHF: str
    :cvar CNY: "CNY"
    :vartype CNY: str
    :cvar SEK: "SEK"
    :vartype SEK: str
    :cvar NZD: "NZD"
    :vartype NZD: str
    :cvar BRL: "BRL"
    :vartype BRL: str
    """

    USD = "USD"
    EUR = "EUR"
    JPY = "JPY"
    GBP = "GBP"
    AUD = "AUD"
    CAD = "CAD"
    CHF = "CHF"
    CNY = "CNY"
    SEK = "SEK"
    NZD = "NZD"
    BRL = "BRL"

    def list():
        """Lists all category values.

        :return: A list of all category values.
        :rtype: list
        """
        return list(map(lambda x: x.value, Data5Currency2._member_map_.values()))


@JsonMap({})
class Data52(BaseModel):
    """Currency type

    :param amount: amount, defaults to None
    :type amount: float, optional
    :param currency: Important: When currency type is fixed, the currency field is ignored. , defaults to None
    :type currency: Data5Currency2, optional
    """

    def __init__(self, amount: float = None, currency: Data5Currency2 = None):
        if amount is not None:
            self.amount = amount
        if currency is not None:
            self.currency = self._enum_matching(
                currency, Data5Currency2.list(), "currency"
            )


@JsonMap({})
class Data62(BaseModel):
    """List type

    :param option: option, defaults to None
    :type option: str, optional
    """

    def __init__(self, option: str = None):
        if option is not None:
            self.option = option


@JsonMap({})
class Data72(BaseModel):
    """Multiselect type

    :param options: options, defaults to None
    :type options: List[str], optional
    """

    def __init__(self, options: List[str] = None):
        if options is not None:
            self.options = options


class CustomFieldToUpdateContainerDataGuard(OneOfBaseModel):
    class_list = {
        "Data12": Data12,
        "Data22": Data22,
        "Data32": Data32,
        "Data42": Data42,
        "Data52": Data52,
        "Data62": Data62,
        "Data72": Data72,
    }


CustomFieldToUpdateContainerData = Union[
    Data12, Data22, Data32, Data42, Data52, Data62, Data72
]


@JsonMap({"id_": "id"})
class CustomFieldToUpdateContainer(BaseModel):
    """CustomFieldToUpdateContainer

    :param id_: UUID for the custom field value.
    :type id_: str
    :param data: data
    :type data: CustomFieldToUpdateContainerData
    """

    def __init__(self, id_: str, data: CustomFieldToUpdateContainerData):
        self.id_ = id_
        self.data = CustomFieldToUpdateContainerDataGuard.return_one_of(data)
