a
    ~g                     @  sX  U d Z ddlmZ ddlmZ ddlmZmZm	Z	m
Z
mZmZmZmZ ddlmZmZmZ ddlmZ ddlmZ dd	lmZ erdd
lmZ ddlmZmZ dZee e!e"e#ded df Z$de%d< e
e"e$f Z&de%d< e	egef Z'ee	e&gdf e	e&ee gdf f Z(de%d< ed Z)G dd deddZ*ede+dZ,dddddZ-ee.Z/dS )z"Configuration for Pydantic models.    )annotations)Pattern)TYPE_CHECKINGAnyCallableDictListTypeTypeVarUnion)Literal	TypeAlias	TypedDict   )getattr_migration)AliasGenerator)PydanticUserError)GenerateSchema)ComputedFieldInfo	FieldInfo)
ConfigDictwith_configN	JsonValueJsonDictr   JsonSchemaExtraCallable)allowignoreforbidc                   @  sZ  e Zd ZU dZded< ded< ded< ded	< ded
< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< d ed!< ded"< d#ed$< d%ed&< d'ed(< d'ed)< d*ed+< ded,< ded-< d.ed/< ded0< ded1< d2ed3< d4ed5< ded6< d7ed8< ded9< d:ed;< ded<< ded=< d>ed?< d@S )Ar   z/A TypedDict for configuring Pydantic behaviour.z
str | NonetitlezCallable[[type], str] | Nonemodel_title_generatorz:Callable[[str, FieldInfo | ComputedFieldInfo], str] | Nonefield_title_generatorboolstr_to_lowerstr_to_upperstr_strip_whitespaceintstr_min_lengthz
int | Nonestr_max_lengthzExtraValues | Noneextrafrozenpopulate_by_nameuse_enum_valuesvalidate_assignmentarbitrary_types_allowedfrom_attributesloc_by_aliasz,Callable[[str], str] | AliasGenerator | Nonealias_generatorztuple[type, ...]ignored_typesallow_inf_nanz)JsonDict | JsonSchemaExtraCallable | Nonejson_schema_extraz&dict[type[object], JsonEncoder] | Nonejson_encodersstrictz0Literal['always', 'never', 'subclass-instances']revalidate_instanceszLiteral['iso8601', 'float']ser_json_timedeltaz Literal['utf8', 'base64', 'hex']ser_json_bytesval_json_bytesz'Literal['null', 'constants', 'strings']ser_json_inf_nanvalidate_defaultvalidate_returnztuple[str | Pattern[str], ...]protected_namespaceshide_input_in_errorsdefer_buildzdict[str, object] | Noneplugin_settingsztype[_GenerateSchema] | Noneschema_generator+json_schema_serialization_defaults_requiredz,Literal['validation', 'serialization', None]json_schema_mode_overridecoerce_numbers_to_strz"Literal['rust-regex', 'python-re']regex_enginevalidation_error_causeuse_attribute_docstringsz%bool | Literal['all', 'keys', 'none']cache_stringsN)__name__
__module____qualname____doc____annotations__ rN   rN   T/var/www/html/emsaiapi.evdpl.com/venv/lib/python3.9/site-packages/pydantic/config.pyr   "   sV   
A
'47;	


^,
'7&%&r   F)total_TypeT)boundzCallable[[_TypeT], _TypeT])configreturnc                   s   ddd fdd}|S )a)  Usage docs: https://docs.pydantic.dev/2.10/concepts/config/#configuration-with-dataclass-from-the-standard-library-or-typeddict

    A convenience decorator to set a [Pydantic configuration](config.md) on a `TypedDict` or a `dataclass` from the standard library.

    Although the configuration can be set using the `__pydantic_config__` attribute, it does not play well with type checkers,
    especially with `TypedDict`.

    !!! example "Usage"

        ```python
        from typing_extensions import TypedDict

        from pydantic import ConfigDict, TypeAdapter, with_config

        @with_config(ConfigDict(str_to_lower=True))
        class Model(TypedDict):
            x: str

        ta = TypeAdapter(Model)

        print(ta.validate_python({'x': 'ABC'}))
        #> {'x': 'abc'}
        ```
    rQ   )class_rT   c                  s4   ddl m} || r*td| j ddd | _| S )Nr   )is_model_classzCannot use `with_config` on z as it is a Pydantic modelzwith-config-on-model)code)Z_internal._utilsrV   r   rI   __pydantic_config__)rU   rV   rS   rN   rO   inner  s    zwith_config.<locals>.innerrN   )rS   rZ   rN   rY   rO   r     s    r   )0rL   
__future__r   _annotationsrer   typingr   r   r   r   r   r	   r
   r   typing_extensionsr   r   r   
_migrationr   aliasesr   errorsr   Z_internal._generate_schemar   Z_GenerateSchemafieldsr   r   __all__r%   floatstrr!   r   rM   r   JsonEncoderr   ExtraValuesr   typerQ   r   rI   __getattr__rN   rN   rN   rO   <module>   s>   ("       P+