
    g                       % S r SSKJr  SSKJrJrJr  SSKJrJ	r	J
r
  SSKJrJrJr  SrSrS\S	'    " S
 S\5      r\S   rS\S'    " S S\5      r " S S\5      r " S S\\5      r " S S\\5      rSrS\S'    " S S\\5      rg)zUsage 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
SchemaKindvtuple[ValidatePythonHandlerProtocol | None, ValidateJsonHandlerProtocol | None, ValidateStringsHandlerProtocol | None]r   r   c                  .    \ rS rSr% SrS\S'   S\S'   Srg)r      zQPath defining where `schema_type` was defined, or where `TypeAdapter` was called.strmodulename N)__name__
__module____qualname____firstlineno____doc____annotations____static_attributes__r       Q/home/matz/Project1/venv/lib/python3.13/site-packages/pydantic/plugin/__init__.pyr   r      s    [K
Ir#   r   )	BaseModelTypeAdapter	dataclasscreate_modelvalidate_callr   c                  >    \ rS rSrSr              SS jrSrg)r   %   z5Protocol defining the interface for Pydantic plugins.c                    [        S5      e)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)selfschemaschema_typeschema_type_pathschema_kindconfigplugin_settingss          r$   new_schema_validator+PydanticPluginProtocol.new_schema_validator(   s    : ""]^^r#   r   N)r/   r   r0   r   r1   r   r2   r   r3   zCoreConfig | Noner4   zdict[str, object]returnr   )r   r   r   r   r    r5   r"   r   r#   r$   r   r   %   sV    ?__ _ )	_
  _ "_ +_
_r#   r   c                  D    \ rS rSr% SrS\S'    S
S jrSS jrSS jrSr	g	)r   H   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                    g)zcCallback to be notified of successful validation.

Args:
    result: The result of the validation.
Nr   )r.   results     r$   
on_success&BaseValidateHandlerProtocol.on_successR        	r#   c                    g)zVCallback to be notified of validation errors.

Args:
    error: The validation error.
Nr   )r.   errors     r$   on_error$BaseValidateHandlerProtocol.on_errorZ   r?   r#   c                    g)zpCallback to be notified of validation exceptions.

Args:
    exception: The exception raised during validation.
Nr   )r.   	exceptions     r$   on_exception(BaseValidateHandlerProtocol.on_exceptionb   r?   r#   r   N)r<   r   r7   None)rA   r	   r7   rH   )rE   	Exceptionr7   rH   )
r   r   r   r   r    r!   r=   rB   rF   r"   r   r#   r$   r   r   H   s!     "!Er#   r   c                  F    \ rS rSrSrSSSSS.           SS jjrSrg)r   k   z4Event handler for `SchemaValidator.validate_python`.N)strictfrom_attributescontextself_instancec                   g)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.
    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.   inputrL   rM   rN   rO   s         r$   r:   &ValidatePythonHandlerProtocol.on_entern   s    & 	r#   r   )rQ   r   rL   bool | NonerM   rS   rN   dict[str, Any] | NonerO   
Any | Noner7   rH   r   r   r   r   r    r:   r"   r   r#   r$   r   r   k   sW    > #'+)-$( 	
 % ' " 
 r#   r   c                  @    \ rS rSrSrSSSS.         SS jjrSrg)r      z2Event handler for `SchemaValidator.validate_json`.N)rL   rN   rO   c                   g)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.   rQ   rL   rN   rO   s        r$   r:   $ValidateJsonHandlerProtocol.on_enter   s    " 	r#   r   )
rQ   zstr | bytes | bytearrayrL   rS   rN   rT   rO   rU   r7   rH   rV   r   r#   r$   r   r      sJ    < #)-$(& 	
 ' " 
 r#   r   zdict[str, StringInput]StringInputc                  :    \ rS rSrSrSSS.       SS jjrSrg)r      z5Event handler for `SchemaValidator.validate_strings`.N)rL   rN   c                   g)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.
    context: The context to use for validation, this is passed to functional validators.
Nr   )r.   rQ   rL   rN   s       r$   r:   'ValidateStringsHandlerProtocol.on_enter   s     	r#   r   )rQ   r[   rL   rS   rN   rT   r7   rH   rV   r   r#   r$   r   r      s8    ? <@bf
 
-8
J_
	
 
r#   r   N)r    
__future__r   typingr   r   r   pydantic_corer   r   r	   typing_extensionsr
   r   r   __all__r   r!   r   r   r   r   r   r   r[   r   r   r#   r$   <module>re      s   
 # , , A A : :	 W )  WZ    hi
I i _X  _F (  F$? 2"=x . 2Y 1%@( r#   