
    zi,                    2   d dl mZ d dlZd dlmZ d dlmZmZm	Z	m
Z
 d dlmZ d dlmZmZ ddlmZmZmZmZmZ dd	lmZ dd
lmZ eseZerddlmZ dZ G d d          Z G d d          Z ed#i dddddddddd dddddddddddddddddd d!dd"d#d$d d%dd&dd'd(d)d*d+d,d-dd.dd/d0d1dd2dd3dd4dd5dd6dd7dd8dd9d:d;dZdFd@Z  e!ej"        #                                          Z$h dAZ%ddddd"dddd%d-dB
Z&dGdEZ'dS )H    )annotationsN)contextmanager)TYPE_CHECKINGAnyCallablecast)core_schema)LiteralSelf   )
ConfigDictExtraValuesJsonDictJsonEncoderJsonSchemaExtraCallable)PydanticUserError)PydanticDeprecatedSince20)GenerateSchemazGSupport for class-based `config` is deprecated, use ConfigDict instead.c                     e Zd ZU dZ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/<   d0ed1<   ded2<   d3ed4<   ded5<   d6ed7<   ded8<   d9d:dPd>ZedQdF            Ze	sdRdJZ
dSdMZdN ZdOS )TConfigWrapperzIInternal wrapper for Config which exposes ConfigDict items as attributes.)config_dictr   r   z
str | Nonetitle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] | 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']ser_json_bytesvalidate_defaultvalidate_returnztuple[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_causeTcheckconfig.ConfigDict | dict[str, Any] | type[Any] | Noner>   c               j    |rt          |          | _        d S t          t          |          | _        d S N)prepare_configr   r   r   )selfr?   r>   s      e/var/www/tmov.alphamb/tmov_inventario/venv/lib/python3.11/site-packages/pydantic/_internal/_config.py__init__zConfigWrapper.__init__T   s8     	8-f55D#J77D    basestuple[type[Any], ...]	namespacedict[str, Any]kwargsreturnr   c                   t                      }|D ]<}t          |dd          }|r'|                    |                                           =|                    d          }|                    d          }|r|rt          dd          |pt          |          }	|                    |	           t          |                                          D ]#}
|
t          v r|
                    |
          ||
<   $ | |          S )a  Build a new `ConfigWrapper` instance for a `BaseModel`.

        The config wrapper built based on (in descending order of priority):
        - options from `kwargs`
        - options from the `namespace`
        - options from the base classes (`bases`)

        Args:
            bases: A tuple of base classes.
            namespace: The namespace of the class being created.
            kwargs: The kwargs passed to the class being created.

        Returns:
            A `ConfigWrapper` instance for `BaseModel`.
        model_configNConfigz3"Config" and "model_config" cannot be used togetherzconfig-both)code)r   getattrupdatecopygetr   rC   listkeysconfig_keyspop)clsrH   rJ   rL   
config_newbaser?   config_class_from_namespaceconfig_dict_from_namespaceconfig_from_namespaceks              rE   	for_modelzConfigWrapper.for_modelZ   s   "  \\
 	1 	1DT>488F 1!!&++--000&/mmH&=&=#%.]]>%B%B"& 	o+E 	o#$Y`mnnnn : inMh>i>i/000fkkmm$$ 	. 	.AK &

1
1s:rG   namestrr   c                    	 | j         |         S # t          $ r2 	 t          |         cY S # t          $ r t          d|          d w xY ww xY w)NzConfig has no attribute )r   KeyErrorconfig_defaultsAttributeError)rD   rb   s     rE   __getattr__zConfigWrapper.__getattr__   s    X'-- X X XX*40000 X X X()LD)L)LMMSWWXXs    
A)AAAobjcore_schema.CoreConfigc                   dd}t          j        di  |di d| j                            d          p|o|j        d| j                            d          d| j                            d          d	| j                            d	          d
| j                            d
          d| j                            d          d| j                            d          d| j                            d          d| j                            d          d| j                            d          d| j                            d          d| j                            d          d| j                            d          d| j                            d          d| j                            d          d| j                            d          d| j                            d          d| j                            d          d| j                            d          d| j                            d          }|S )a  Create a pydantic-core config, `obj` is just used to populate `title` if not set in config.

        Pass `obj=None` if you do not want to attempt to infer the `title`.

        We don't use getattr here since we don't want to populate with defaults.

        Args:
            obj: An object used to populate `title` if not set in config.

        Returns:
            A `CoreConfig` object created from config.
        rL   r   rM   c                 >    d |                                  D             S )Nc                    i | ]
\  }}|||S rB    .0r`   vs      rE   
<dictcomp>zDConfigWrapper.core_config.<locals>.dict_not_none.<locals>.<dictcomp>   s    EEETQq}Aq}}}rG   )items)rL   s    rE   dict_not_nonez0ConfigWrapper.core_config.<locals>.dict_not_none   s    EEV\\^^EEEErG   r   extra_fields_behaviorr    r*   r"   r   r   r   r-   r/   r0   r&   r'   r.   r1   r   r   r4   r:   r;   r<   )rL   r   rM   r   rn   )r	   
CoreConfigr   rU   __name__)rD   ri   rt   core_configs       rE   rx   zConfigWrapper.core_config   s   	F 	F 	F 	F ", 
 
m   &**733M8L&*&6&:&:7&C&C&C #.22?CCC "&!1!5!56H!I!I!I	
 &*%5%9%9:P%Q%Q%Q "-11.AAA "-11.AAA '++H555 $(#3#7#78L#M#M#M  $/334DEEE !% 0 4 45F G G G "-11.AAA &*%5%9%9:P%Q%Q%Q "&!1!5!56H!I!I!I  $/334DEEE   $/334DEEE!" &*%5%9%9:P%Q%Q%Q#$ '+&6&:&:;R&S&S&S%& "-11.AAA'( (,'7';';<T'U'U'U)
 
0 rG   c                z    d                     d | j                                        D                       }d| dS )Nz, c              3  *   K   | ]\  }}| d |V  dS )=Nrn   ro   s      rE   	<genexpr>z)ConfigWrapper.__repr__.<locals>.<genexpr>   s0      HHtq!llQllHHHHHHrG   zConfigWrapper())joinr   rs   )rD   cs     rE   __repr__zConfigWrapper.__repr__   sB    IIHHt/?/E/E/G/GHHHHH$$$$$rG   N)r?   r@   r>   r   )rH   rI   rJ   rK   rL   rK   rM   r   )rb   rc   rM   r   )ri   r   rM   rj   )rw   
__module____qualname____doc__	__slots____annotations__rF   classmethodra   r   rh   rx   r   rn   rG   rE   r   r   !   sZ        SS I LLL!!!! 0000####@@@@9999 LLLJJJJ3333----))))----11115555KKKK4444    `d 8 8 8 8 8 8 $ $ $ [$N  	X	X 	X 	X 	X) ) ) )V% % % % %rG   r   c                  J    e Zd ZdZd
dZedd            Zedd            Zd	S )ConfigWrapperStackz%A stack of `ConfigWrapper` instances.config_wrapperr   c                    |g| _         d S rB   _config_wrapper_stackrD   r   s     rE   rF   zConfigWrapperStack.__init__   s    ;I:J"""rG   rM   c                    | j         d         S )Nr   )rD   s    rE   tailzConfigWrapperStack.tail   s    )"--rG   !ConfigWrapper | ConfigDict | Nonec              #    K   |d V  d S t          |t                    st          |d          }| j                            |           	 d V  | j                                         d S # | j                                         w xY w)NFr=   )
isinstancer   r   appendrY   r   s     rE   pushzConfigWrapperStack.push   s      !EEEF.-88 	H*>GGGN")).999	-EEE&**,,,,,D&**,,,,s   A+ +BN)r   r   )rM   r   )r   r   )	rw   r   r   r   rF   propertyr   r   r   rn   rG   rE   r   r      sr        //K K K K . . . X. - - - ^- - -rG   r   r   r   Fr   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   Tr(   r)   rn   r*   r+   r-   r.   neverr/   iso8601r0   utf8r1   r2   r3   )model_r4   r,   r5   r6   r7   r8   r9   r:   r;   z
rust-regexr<   r?   r@   rM   r   c                     t                      S t           t                    s:t          j        t
          t                      fdt                     D              t          t                      }t          |           |S )zCreate a `ConfigDict` instance from an existing dict, a class (e.g. old class-based config) or None.

    Args:
        config: The input config.

    Returns:
        A ConfigDict object created from config.
    Nc                \    i | ](}|                     d           |t          |          )S )__)
startswithrR   )rp   r`   r?   s     rE   rr   z"prepare_config.<locals>.<dictcomp>  s7    WWWAALLQUDVDVW!WVQ''WWWrG   )
r   r   dictwarningswarnDEPRECATION_MESSAGEDeprecationWarningdirr   check_deprecated)r?   r   s   ` rE   rC   rC      s}     ~||fd## X)+=>>>WWWWVWWWz6**K[!!!rG   >
   fields
json_dumps
json_loadsgetter_dictsmart_unionallow_mutationpost_init_callerror_msg_templatescopy_on_model_validationunderscore_attrs_are_private)
allow_population_by_field_nameanystr_loweranystr_strip_whitespaceanystr_upperkeep_untouchedmax_anystr_lengthmin_anystr_lengthorm_modeschema_extravalidate_allr   Nonec                   t           |                                 z  }t                                          |                                 z  }|s|rd t          |          D             }d |                                D             }d t          |          D             }d                    dg|z   |z             }t          j        |t                     dS dS )zjCheck for deprecated config keys and warn the user.

    Args:
        config_dict: The input config.
    c                *    i | ]}|t           |         S rn   )V2_RENAMED_KEYSrp   r`   s     rE   rr   z$check_deprecated.<locals>.<dictcomp>:  s    TTTqQ*TTTrG   c                $    g | ]\  }}d |d|S )* z has been renamed to rn   ro   s      rE   
<listcomp>z$check_deprecated.<locals>.<listcomp>;  s-    ^^^DAq???!??^^^rG   c                    g | ]}d |d	S )r   z has been removedrn   r   s     rE   r   z$check_deprecated.<locals>.<listcomp><  s$    ```16666```rG   
z%Valid config keys have changed in V2:N)	V2_REMOVED_KEYSrW   r   sortedrs   r~   r   r   UserWarning)r   deprecated_removed_keysdeprecated_renamed_keys	renamingsrenamed_bulletsremoved_bulletsmessages          rE   r   r   1  s     .0@0@0B0BB-2244{7G7G7I7II ,"9 ,TTF;R4S4STTT	^^IOOL]L]^^^``G^@_@_```))DEWZiijjg{+++++, ,rG   )r?   r@   rM   r   )r   r   rM   r   )(
__future__r   _annotationsr   
contextlibr   typingr   r   r   r   pydantic_corer	   typing_extensionsr
   r   r?   r   r   r   r   r   errorsr   r   r   #_internal._schema_generation_sharedr   r   r   r   rf   rC   setr   rW   rX   r   r   r   rn   rG   rE   <module>r      s   2 2 2 2 2 2  % % % % % %            & % % % % %       
 ] \ \ \ \ \ \ \ \ \ \ \ \ \ & & & & & & 0 0 0 0 0 0 3 3 EDDDDDD_ Y% Y% Y% Y% Y% Y% Y% Y%x- - - - - - - -4 * % % %
$%% % 	%
 1% 4% $% 5% U% E% % "E% E% %  D!%" "#%$ $%%& d'%( 5)%* !+%, !y-%. 6/%0 U1%2 E3%4 %5%6 7%8 $9%: ;%< D=%> T?%@ 16A%B #dC%D  %E%F G%H !5I%P   * c*,113344   '9"5"%))!'& , , , , , ,rG   