U nf@sdZddlmZddlmZmZmZddlm Z er`ddl m Z m Z ee j e je je je jfZdZGdd d ZGd d d Zd S) z_Type annotations to use with `__get_pydantic_core_schema__` and `__get_pydantic_json_schema__`.) annotations) TYPE_CHECKINGAnyUnion) core_schema)JsonSchemaModeJsonSchemaValue)GetJsonSchemaHandlerGetCoreSchemaHandlerc@s:eZdZUdZded<dddddZddd d d Zd S) r zHandler to call into the next JSON schema generation function. Attributes: mode: Json schema mode, can be `validation` or `serialization`. rmodeCoreSchemaOrFieldr )rreturncCstdS)aCall 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. NNotImplementedError)selfrrI/opt/hc_python/lib/python3.8/site-packages/pydantic/annotated_handlers.py__call__ szGetJsonSchemaHandler.__call__)maybe_ref_json_schemarcCstdS)aGet 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`. Nr)rrrrrresolve_ref_schema0sz'GetJsonSchemaHandler.resolve_ref_schemaN)__name__ __module__ __qualname____doc____annotations__rrrrrrr s r c@s`eZdZdZdddddZdddddZddd d d Zed d ddZdd ddZ dS)r zDHandler to call into the next CoreSchema schema generation function.rzcore_schema.CoreSchema) source_typercCstdS)aCall 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. NrrrrrrrDs zGetCoreSchemaHandler.__call__cCstdS)aGenerate 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. Nrrrrrgenerate_schemaSs z$GetCoreSchemaHandler.generate_schema)maybe_ref_schemarcCstdS)aGet 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`. Nr)rrrrrrbsz'GetCoreSchemaHandler.resolve_ref_schemaz str | None)rcCstdS)z4Get the name of the closest field to this validator.Nrrrrr field_namerszGetCoreSchemaHandler.field_namezdict[str, Any] | NonecCstdS)zGInternal method used during type resolution for serializer annotations.Nrr rrr_get_types_namespacewsz)GetCoreSchemaHandler._get_types_namespaceN) rrrrrrrpropertyr!r"rrrrr Asr N)r __future__rZ _annotationstypingrrrZ pydantic_corerZ json_schemarr Z CoreSchemaZ ModelFieldZDataclassFieldZTypedDictFieldZ ComputedFieldr __all__r r rrrrs   *