HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/pydantic/plugin/__pycache__/__init__.cpython-310.pyc
o

|��g��@s�UdZddlmZddlmZmZmZddlmZm	Z	m
Z
ddlmZm
Z
mZdZdZded	<Gd
d�de�ZedZded
<Gdd�de
�ZGdd�de
�ZGdd�dee
�ZGdd�dee
�ZdZded<Gdd�dee
�ZdS)z�Usage docs: https://docs.pydantic.dev/2.10/concepts/plugins#build-a-plugin

Plugin interface for Pydantic plugins, and related types.
�)�annotations)�Any�Callable�
NamedTuple)�
CoreConfig�
CoreSchema�ValidationError)�Literal�Protocol�	TypeAlias)�PydanticPluginProtocol�BaseValidateHandlerProtocol�ValidatePythonHandlerProtocol�ValidateJsonHandlerProtocol�ValidateStringsHandlerProtocol�NewSchemaReturns�SchemaTypePath�
SchemaKind�vtuple[ValidatePythonHandlerProtocol | None, ValidateJsonHandlerProtocol | None, ValidateStringsHandlerProtocol | None]rrc@s"eZdZUdZded<ded<dS)rzQPath defining where `schema_type` was defined, or where `TypeAdapter` was called.�str�module�nameN)�__name__�
__module__�__qualname__�__doc__�__annotations__�rr�C/usr/local/lib/python3.10/dist-packages/pydantic/plugin/__init__.pyrs
r)�	BaseModel�TypeAdapter�	dataclass�create_model�
validate_callrc@seZdZdZddd�ZdS)rz5Protocol defining the interface for Pydantic plugins.�schemar�schema_typer�schema_type_pathr�schema_kindr�config�CoreConfig | None�plugin_settings�dict[str, object]�returnrcCstd��)a�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.
            schema_type: The original type which the schema was created from, e.g. the model class.
            schema_type_path: Path defining where `schema_type` was defined, or where `TypeAdapter` was called.
            schema_kind: The kind of 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)�selfr$r%r&r'r(r*rrr�new_schema_validator(sz+PydanticPluginProtocol.new_schema_validatorN)r$rr%rr&rr'rr(r)r*r+r,r)rrrrr/rrrrr%src@s:eZdZUdZded<	ddd	�Zddd
�Zddd�ZdS)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.
    zCallable[..., None]�on_enter�resultrr,�NonecC�dS)z{Callback to be notified of successful validation.

        Args:
            result: The result of the validation.
        Nr)r.r1rrr�
on_successR�z&BaseValidateHandlerProtocol.on_success�errorrcCr3)znCallback to be notified of validation errors.

        Args:
            error: The validation error.
        Nr)r.r6rrr�on_errorZr5z$BaseValidateHandlerProtocol.on_error�	exception�	ExceptioncCr3)z�Callback to be notified of validation exceptions.

        Args:
            exception: The exception raised during validation.
        Nr)r.r8rrr�on_exceptionbr5z(BaseValidateHandlerProtocol.on_exceptionN)r1rr,r2)r6rr,r2)r8r9r,r2)rrrrrr4r7r:rrrrr
Hs


r
c@s&eZdZdZddddd�ddd�ZdS)rz4Event handler for `SchemaValidator.validate_python`.N)�strict�from_attributes�context�
self_instance�inputrr;�bool | Noner<r=�dict[str, Any] | Noner>�
Any | Noner,r2cCr3)aTCallback 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.r?r;r<r=r>rrrr0nsz&ValidatePythonHandlerProtocol.on_enter)r?rr;r@r<r@r=rAr>rBr,r2�rrrrr0rrrrrks�rc@s$eZdZdZdddd�ddd�ZdS)rz2Event handler for `SchemaValidator.validate_json`.N)r;r=r>r?�str | bytes | bytearrayr;r@r=rAr>rBr,r2cCr3)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.r?r;r=r>rrrr0�sz$ValidateJsonHandlerProtocol.on_enter)
r?rDr;r@r=rAr>rBr,r2rCrrrrr�s�rzdict[str, StringInput]�StringInputc@s"eZdZdZddd�ddd
�ZdS)rz5Event handler for `SchemaValidator.validate_strings`.N)r;r=r?rEr;r@r=rAr,r2cCr3)aICallback 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.r?r;r=rrrr0�s
z'ValidateStringsHandlerProtocol.on_enter)r?rEr;r@r=rAr,r2rCrrrrr�s�rN)r�
__future__r�typingrrr�
pydantic_corerrr�typing_extensionsr	r
r�__all__rrrrrr
rrrErrrrr�<module>s##