+
    7*i  c                  s,  a  0 t $ R t^ RIHt ^ RIHtHtHtHt ^ RI	H
t
HtHt ^ RIHtHt ^ RIHt RtRtR]R&    ! R R]4      t]R,          tR]R&    ! R R]4      t ! R R]4      t ! R R]]4      t ! R R	]]4      tRtR]R&    ! R R
]]4      tR# )z!!! abstract "Usage Documentation"
    [Build a Plugin](../concepts/plugins.md#build-a-plugin)

Plugin interface for Pydantic plugins, and related types.
)annotations)AnyCallableLiteral
NamedTuple)
CoreConfig
CoreSchemaValidationError)Protocol	TypeAlias)ExtraValuesPydanticPluginProtocolBaseValidateHandlerProtocolValidatePythonHandlerProtocolValidateJsonHandlerProtocolValidateStringsHandlerProtocolNewSchemaReturnsSchemaTypePath
SchemaKindvtuple[ValidatePythonHandlerProtocol | None, ValidateJsonHandlerProtocol | None, ValidateStringsHandlerProtocol | None]r	   c                  s0    ] tR t^t$ RtR]R&   R]R&   RtR# )r   zQPath defining where `schema_type` was defined, or where `TypeAdapter` was called.ZstrZmoduleZname N)__name__
__module____qualname____firstlineno____doc____annotations____static_attributes__r       =/usr/lib/python3.14/site-packages/pydantic/plugin/__init__.pyr   r      s    [K
Ir   c                  s&    ] tR t^(tRtR R ltRtR# )r   z5Protocol defining the interface for Pydantic plugins.c               s4    V ^8  d   QhRRRRRRRRR	R
RRRR/# )   schemar   schema_typer   schema_type_pathr   schema_kindr   configzCoreConfig | Noneplugin_settingszdict[str, object]returnr   r   Zformat   "r   __annotate__Z#PydanticPluginProtocol.__annotate__+   sY     _ __ _ )	_
  _ "_ +_
_r   c                s    \        R4      h)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`.)ZNotImplementedError)selfr   r    r!   r"   r#   r$   s   &&&&&&&r   new_schema_validatorZ+PydanticPluginProtocol.new_schema_validator+   s    : ""]^^r   r   N)r   r   r   r   r   r*   r   r   r   r   r   r   (   s    ?_ _r   c                  sL    ] tR t^Kt$ RtR]R&    R R ltR R ltR R	 ltR
t	R# )r   zBase 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                    V ^8  d   QhRRRR/# )r   resultr   r%   Noner   r&   r'   r   r(   (BaseValidateHandlerProtocol.__annotate__U   s        r   c                    R# )zcCallback to be notified of successful validation.

Args:
    result: The result of the validation.
Nr   )r)   r-      &&r   
on_successZ&BaseValidateHandlerProtocol.on_successU        	r   c               r,   )r   errorr   r%   r.   r   r&   r'   r   r(   r/   ]   s      o $ r   c                r0   )zVCallback to be notified of validation errors.

Args:
    error: The validation error.
Nr   )r)   r4   r1   r   on_errorZ$BaseValidateHandlerProtocol.on_error]   r3   r   c               r,   )r   	exceptionZ	Exceptionr%   r.   r   r&   r'   r   r(   r/   e   s      i D r   c                r0   )zpCallback to be notified of validation exceptions.

Args:
    exception: The exception raised during validation.
Nr   )r)   r6   r1   r   on_exceptionZ(BaseValidateHandlerProtocol.on_exceptione   r3   r   r   N)
r   r   r   r   r   r   r2   r5   r7   r   r   r   r   r   r   K   s&     "!E r   c                  sF    ] tR t^ntRtRRRRRRRRRRRRR	R/R
 R lltRtR# )r   z4Event handler for `SchemaValidator.validate_python`.strictNextrafrom_attributescontextself_instanceby_aliasby_namec               s<    V ^8  d   QhRRRRRRRRRR	R
R	RRRRRR/	# )r   inputr   r8   bool | Noner9   ExtraValues | Noner:   r;   
Any | Noner<   r=   r>   r%   r.   r   r&   r'   r   r(   Z*ValidatePythonHandlerProtocol.__annotate__q   sd       	
 " %  "   
r   c               r0   )a  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.
    extra: Whether to ignore, allow, or forbid extra data during model validation.
    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.
    by_alias: Whether to use the field's alias to match the input data to an attribute.
    by_name: Whether to use the field's name to match the input data to an attribute.
Nr   )	r)   r?   r8   r9   r:   r;   r<   r=   r>   s	   &&$$$$$$$r   r+   Z&ValidatePythonHandlerProtocol.on_enterq       r   r   r   r   r   r   r   r+   r   r   r   r   r   r   n   sU    > #	
 %) (, # %) !%  $ r   c                  sB    ] tR t^tRtRRRRRRRRRRRR/R	 R
 lltRtR# )r   z2Event handler for `SchemaValidator.validate_json`.r8   Nr9   r;   r<   r=   r>   c               s8    V ^8  d   QhRRRRRRRRR	RR
RRRRR/# )r   r?   zstr | bytes | bytearrayr8   r@   r9   rA   r;   rB   r<   r=   r>   r%   r.   r   r&   r'   r   r(   Z(ValidateJsonHandlerProtocol.__annotate__   sZ      & 	
 "  "   
r   c               r0   )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.
    extra: Whether to ignore, allow, or forbid extra data during model validation.
    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.
    by_alias: Whether to use the field's alias to match the input data to an attribute.
    by_name: Whether to use the field's name to match the input data to an attribute.
Nr   )r)   r?   r8   r9   r;   r<   r=   r>   s   &&$$$$$$r   r+   Z$ValidateJsonHandlerProtocol.on_enter   rC   r   r   rD   r   r   r   r   r      sK    < #	
 %) # %) !%  $ r   zdict[str, StringInput]StringInputc            
      s>    ] tR t^tRtRRRRRRRRRR/R R	 lltR
tR# )r   z5Event handler for `SchemaValidator.validate_strings`.r8   Nr9   r;   r=   r>   c               s4    V ^8  d   QhRRRRRRRRR	RR
RRR/# )r   r?   rE   r8   r@   r9   rA   r;   rB   r=   r>   r%   r.   r   r&   r'   r   r(   Z+ValidateStringsHandlerProtocol.__annotate__   sP       	
 "    
r   c               r0   )a"  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.
    extra: Whether to ignore, allow, or forbid extra data during model validation.
    context: The context to use for validation, this is passed to functional validators.
    by_alias: Whether to use the field's alias to match the input data to an attribute.
    by_name: Whether to use the field's name to match the input data to an attribute.
Nr   )r)   r?   r8   r9   r;   r=   r>   s   &&$$$$$r   r+   Z'ValidateStringsHandlerProtocol.on_enter   rC   r   r   rD   r   r   r   r   r      sA    ? #	
 %) # !%  $ r   N)r   r   r   r   r   r   r   r   )Z	BaseModelZTypeAdapterZ	dataclassZcreate_modelZvalidate_call)__conditional_annotations__r   Z
__future__r    Ztypingr   r   r   r   Zpydantic_corer   r   r   Ztyping_extensionsr   r	   Zpydantic.configr
   Z__all__r   r   r   r   r   r   r   r   rE   r   )rF   s   @r   <module>rG      s    # 5 5 A A 1 '	 W )  WZ    hi
I i _X  _F (  F$? <"=x 8 2Y 1%@( r   