o
    }j6h7                     @  s   d Z ddlmZ ddlmZmZmZ ddlm	Z	 er6ddl
mZ ddlmZmZ ee	je	je	je	je	jf ZdZG d	d
 d
ZG dd dZdS )z_Type annotations to use with `__get_pydantic_core_schema__` and `__get_pydantic_json_schema__`.    )annotations)TYPE_CHECKINGAnyUnion)core_schema   )NamespacesTuple)JsonSchemaModeJsonSchemaValue)GetJsonSchemaHandlerGetCoreSchemaHandlerc                   @  s.   e Zd ZU dZded< ddd	ZdddZdS )r   zHandler to call into the next JSON schema generation function.

    Attributes:
        mode: Json schema mode, can be `validation` or `serialization`.
    r	   moder   CoreSchemaOrFieldreturnr
   c                C     t )a  Call the inner handler and get the JsonSchemaValue it returns.
        This will call the next JSON schema modifying function up until it calls
        into `pydantic.json_schema.GenerateJsonSchema`, which will raise a
        `pydantic.errors.PydanticInvalidForJsonSchema` error if it cannot generate
        a JSON schema.

        Args:
            core_schema: A `pydantic_core.core_schema.CoreSchema`.

        Returns:
            JsonSchemaValue: The JSON schema generated by the inner JSON schema modify
            functions.
        NotImplementedError)selfr    r   j/var/www/html/chefvision.cloud.itp360.com/venv/lib/python3.10/site-packages/pydantic/annotated_handlers.py__call__!      zGetJsonSchemaHandler.__call__maybe_ref_json_schemac                C  r   )a  Get the real schema for a `{"$ref": ...}` schema.
        If the schema given is not a `$ref` schema, it will be returned as is.
        This means you don't have to check before calling this function.

        Args:
            maybe_ref_json_schema: A JsonSchemaValue which may be a `$ref` schema.

        Raises:
            LookupError: If the ref is not found.

        Returns:
            JsonSchemaValue: A JsonSchemaValue that has no `$ref`.
        r   )r   r   r   r   r   resolve_ref_schema1   r   z'GetJsonSchemaHandler.resolve_ref_schemaN)r   r   r   r
   )r   r
   r   r
   )__name__
__module____qualname____doc____annotations__r   r   r   r   r   r   r      s
   
 
r   c                   @  sF   e Zd ZdZdddZddd	ZdddZedddZdddZ	dS )r   zDHandler to call into the next CoreSchema schema generation function.source_typer   r   core_schema.CoreSchemac                C  r   )a  Call the inner handler and get the CoreSchema it returns.
        This will call the next CoreSchema modifying function up until it calls
        into Pydantic's internal schema generation machinery, which will raise a
        `pydantic.errors.PydanticSchemaGenerationError` error if it cannot generate
        a CoreSchema for the given source type.

        Args:
            source_type: The input type.

        Returns:
            CoreSchema: The `pydantic-core` CoreSchema generated.
        r   r   r   r   r   r   r   E      zGetCoreSchemaHandler.__call__c                C  r   )a  Generate a schema unrelated to the current context.
        Use this function if e.g. you are handling schema generation for a sequence
        and want to generate a schema for its items.
        Otherwise, you may end up doing something like applying a `min_length` constraint
        that was intended for the sequence itself to its items!

        Args:
            source_type: The input type.

        Returns:
            CoreSchema: The `pydantic-core` CoreSchema generated.
        r   r!   r   r   r   generate_schemaT   r"   z$GetCoreSchemaHandler.generate_schemamaybe_ref_schemac                C  r   )a  Get the real schema for a `definition-ref` schema.
        If the schema given is not a `definition-ref` schema, it will be returned as is.
        This means you don't have to check before calling this function.

        Args:
            maybe_ref_schema: A `CoreSchema`, `ref`-based or not.

        Raises:
            LookupError: If the `ref` is not found.

        Returns:
            A concrete `CoreSchema`.
        r   )r   r$   r   r   r   r   c   r   z'GetCoreSchemaHandler.resolve_ref_schema
str | Nonec                 C  r   )z4Get the name of the closest field to this validator.r   r   r   r   r   
field_names   s   zGetCoreSchemaHandler.field_namer   c                 C  r   )zGInternal method used during type resolution for serializer annotations.r   r&   r   r   r   _get_types_namespacex   s   z)GetCoreSchemaHandler._get_types_namespaceN)r   r   r   r    )r$   r    r   r    )r   r%   )r   r   )
r   r   r   r   r   r#   r   propertyr'   r(   r   r   r   r   r   B   s    


r   N)r   
__future__r   _annotationstypingr   r   r   pydantic_corer   _internal._namespace_utilsr   json_schemar	   r
   
CoreSchema
ModelFieldDataclassFieldTypedDictFieldComputedFieldr   __all__r   r   r   r   r   r   <module>   s$    *