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

from __future__ import annotations
from typing import Union
from .utils.json_map import JsonMap
from .base import BaseModel
from .base import OneOfBaseModel
from .validation_type_enum import ValidationTypeEnum


class ValueGuard(OneOfBaseModel):
    class_list = {"str": str, "float": float}


Value = Union[str, float]


@JsonMap({"type_": "type"})
class ValidationType(BaseModel):
    """ValidationType

    :param type_: type_, defaults to None
    :type type_: ValidationTypeEnum, optional
    :param value: Validation value., defaults to None
    :type value: Value, optional
    """

    def __init__(self, type_: ValidationTypeEnum = None, value: Value = None):
        if type_ is not None:
            self.type_ = self._enum_matching(type_, ValidationTypeEnum.list(), "type_")
        if value is not None:
            self.value = ValueGuard.return_one_of(value)
