Ë
    ©2Úi@  ã                  óÞ   — U d Z ddlmZ ddlmZmZ ddlmZmZm	Z	 ddl
mZmZ dZdZded	<    G d
„ de«      Z G d„ de«      Z G d„ dee«      Z G d„ dee«      ZdZded<    G d„ dee«      Zy)z…Usage docs: https://docs.pydantic.dev/2.4/concepts/plugins#build-a-plugin

Plugin interface for Pydantic plugins, and related types.
é    )Úannotations)ÚAnyÚCallable)Ú
CoreConfigÚ
CoreSchemaÚValidationError)ÚProtocolÚ	TypeAlias)ÚPydanticPluginProtocolÚBaseValidateHandlerProtocolÚValidatePythonHandlerProtocolÚValidateJsonHandlerProtocolÚValidateStringsHandlerProtocolÚNewSchemaReturnsúvtuple[ValidatePythonHandlerProtocol | None, ValidateJsonHandlerProtocol | None, ValidateStringsHandlerProtocol | None]r
   r   c                  ó(   — e Zd ZdZ	 	 	 	 	 	 	 	 dd„Zy)r   z5Protocol defining the interface for Pydantic plugins.c                ó   — t        d«      ‚)az  This method is called for each plugin every time a new [`SchemaValidator`][pydantic_core.SchemaValidator]
        is created.

        It should return an event handler for each of the three validation methods, or `None` if the plugin does not
        implement that method.

        Args:
            schema: The schema to validate against.
            config: The config to use for validation.
            plugin_settings: Any plugin settings.

        Returns:
            A tuple of optional event handlers for each of the three validation methods -
                `validate_python`, `validate_json`, `validate_strings`.
        z9Pydantic plugins should implement `new_schema_validator`.)ÚNotImplementedError)ÚselfÚschemaÚconfigÚplugin_settingss       úO/var/www/html/acx/venv/lib/python3.12/site-packages/pydantic/plugin/__init__.pyÚnew_schema_validatorz+PydanticPluginProtocol.new_schema_validator   s   € ô. "Ð"]Ó^Ð^ó    N)r   r   r   zCoreConfig | Noner   zdict[str, object]Úreturnr   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   © r   r   r   r      s5   „ Ù?ð_àð_ð "ð_ð +ð	_ð

ô_r   r   c                  ó.   — e Zd ZU dZded<   	 dd„Zdd„Zy)	r   z»Base class for plugin callbacks protocols.

    You shouldn't implement this protocol directly, instead use one of the subclasses with adds the correctly
    typed `on_error` method.
    zCallable[..., None]Úon_enterc                 ó   — y)z{Callback to be notified of successful validation.

        Args:
            result: The result of the validation.
        Nr!   )r   Úresults     r   Ú
on_successz&BaseValidateHandlerProtocol.on_success?   ó   € ð 	r   c                 ó   — y)znCallback to be notified of validation errors.

        Args:
            error: The validation error.
        Nr!   )r   Úerrors     r   Úon_errorz$BaseValidateHandlerProtocol.on_errorG   r'   r   N)r%   r   r   ÚNone)r)   r   r   r+   )r   r   r   r    Ú__annotations__r&   r*   r!   r   r   r   r   5   s   … ñð "Ó!ØEóôr   r   c                  ó:   — e Zd ZdZdddddœ	 	 	 	 	 	 	 	 	 	 	 dd„Zy)r   z4Event handler for `SchemaValidator.validate_python`.N)ÚstrictÚfrom_attributesÚcontextÚself_instancec                ó   — y)aT  Callback to be notified of validation start, and create an instance of the event handler.

        Args:
            input: The input to be validated.
            strict: Whether to validate the object in strict mode.
            from_attributes: Whether to validate objects as inputs by extracting attributes.
            context: The context to use for validation, this is passed to functional validators.
            self_instance: An instance of a model to set attributes on from validation, this is used when running
                validation from the `__init__` method of a model.
        Nr!   )r   Úinputr.   r/   r0   r1   s         r   r#   z&ValidatePythonHandlerProtocol.on_enterS   s   € ð& 	r   )r3   r   r.   úbool | Noner/   r4   r0   údict[str, Any] | Noner1   ú
Any | Noner   r+   ©r   r   r   r    r#   r!   r   r   r   r   P   sR   „ Ù>ð #Ø'+Ø)-Ø$(ñàðð ð	ð
 %ðð 'ðð "ðð 
ôr   r   c                  ó4   — e Zd ZdZddddœ	 	 	 	 	 	 	 	 	 dd„Zy)r   z2Event handler for `SchemaValidator.validate_json`.N)r.   r0   r1   c                ó   — y)aû  Callback to be notified of validation start, and create an instance of the event handler.

        Args:
            input: The JSON data to be validated.
            strict: Whether to validate the object in strict mode.
            context: The context to use for validation, this is passed to functional validators.
            self_instance: An instance of a model to set attributes on from validation, this is used when running
                validation from the `__init__` method of a model.
        Nr!   )r   r3   r.   r0   r1   s        r   r#   z$ValidateJsonHandlerProtocol.on_enterl   s   € ð" 	r   )
r3   zstr | bytes | bytearrayr.   r4   r0   r5   r1   r6   r   r+   r7   r!   r   r   r   r   i   sE   „ Ù<ð #Ø)-Ø$(ñà&ðð ð	ð
 'ðð "ðð 
ôr   r   zdict[str, StringInput]ÚStringInputc                  ó.   — e Zd ZdZdddœ	 	 	 	 	 	 	 dd„Zy)r   z5Event handler for `SchemaValidator.validate_strings`.N)r.   r0   c                ó   — y)aI  Callback to be notified of validation start, and create an instance of the event handler.

        Args:
            input: The string data to be validated.
            strict: Whether to validate the object in strict mode.
            context: The context to use for validation, this is passed to functional validators.
        Nr!   )r   r3   r.   r0   s       r   r#   z'ValidateStringsHandlerProtocol.on_enter†   s   € ð 	r   )r3   r:   r.   r4   r0   r5   r   r+   r7   r!   r   r   r   r   ƒ   s3   „ Ù?ð <@Ðbfñ
Ø ð
Ø-8ð
ØJ_ð
à	ô
r   r   N)r    Ú
__future__r   Útypingr   r   Úpydantic_corer   r   r   Útyping_extensionsr	   r
   Ú__all__r   r,   r   r   r   r   r:   r   r!   r   r   ú<module>rB      s†   ðòõ #ç  ç AÑ Aß 1ð€ð WÐ �)ó  Wô_˜Xô _ô: (ô ô6Ð$?Àô ô2Ð"=¸xô ð. 2€ˆYÓ 1ôÐ%@À(õ r   