
    ȇh                        S r SSKJr  SSKJrJrJrJrJr  \(       a   SSK	J
r
Jr  SSKrSSKJr  SSKJr  SSKrSSKr\ " S S	\5      5       rg)
z4
typing.Protocol classes for jsonschema interfaces.
    )annotations)TYPE_CHECKINGAnyClassVarProtocolruntime_checkable)IterableMappingN)_typing)ValidationErrorc                      \ rS rSr% SrS\S'   S\S'   S\S'   S\S	'   S
\S'   S\S'    S       SS jjr\SS j5       rSS jr	SS jr
SS jrSS jrSS jrSrg)	Validator'   aS  
The protocol to which all validator classes adhere.

Arguments:

    schema:

        The schema that the validator object will validate with.
        It is assumed to be valid, and providing
        an invalid schema can lead to undefined behavior. See
        `Validator.check_schema` to validate a schema first.

    registry:

        a schema registry that will be used for looking up JSON references

    resolver:

        a resolver that will be used to resolve :kw:`$ref`
        properties (JSON references). If unprovided, one will be created.

        .. deprecated:: v4.18.0

            `RefResolver <_RefResolver>` has been deprecated in favor of
            `referencing`, and with it, this argument.

    format_checker:

        if provided, a checker which will be used to assert about
        :kw:`format` properties present in the schema. If unprovided,
        *no* format validation is done, and the presence of format
        within schemas is strictly informational. Certain formats
        require additional packages to be installed in order to assert
        against instances. Ensure you've installed `jsonschema` with
        its `extra (optional) dependencies <index:extras>` when
        invoking ``pip``.

.. deprecated:: v4.12.0

    Subclassing validator classes now explicitly warns this is not part of
    their public API.

zClassVar[Mapping]META_SCHEMA
VALIDATORSz ClassVar[jsonschema.TypeChecker]TYPE_CHECKERz"ClassVar[jsonschema.FormatChecker]FORMAT_CHECKERz_typing.id_ofID_OFMapping | boolschemaNc                    g N )selfr   registryformat_checkers       lC:\Users\julio\OneDrive\Documentos\Trabajo\IdeasFrscas\Cabanna\env\Lib\site-packages\jsonschema/protocols.py__init__Validator.__init__l   s     	    c                    g)z
Validate the given schema against the validator's `META_SCHEMA`.

Raises:

    `jsonschema.exceptions.SchemaError`:

        if the schema is invalid

Nr   )clsr   s     r   check_schemaValidator.check_schemat       r    c                    g)aC  
Check if the instance is of the given (JSON Schema) type.

Arguments:

    instance:

        the value to check

    type:

        the name of a known (JSON Schema) type

Returns:

    whether the instance is of the given type

Raises:

    `jsonschema.exceptions.UnknownType`:

        if ``type`` is not a known type

Nr   )r   instancetypes      r   is_typeValidator.is_type   r%   r    c                    g)z
Check if the instance is valid under the current `schema`.

Returns:

    whether the instance is valid or not

>>> schema = {"maxItems" : 2}
>>> Draft202012Validator(schema).is_valid([2, 3, 4])
False

Nr   r   r'   s     r   is_validValidator.is_valid   r%   r    c                    g)a  
Lazily yield each of the validation errors in the given instance.

>>> schema = {
...     "type" : "array",
...     "items" : {"enum" : [1, 2, 3]},
...     "maxItems" : 2,
... }
>>> v = Draft202012Validator(schema)
>>> for error in sorted(v.iter_errors([2, 3, 4]), key=str):
...     print(error.message)
4 is not one of [1, 2, 3]
[2, 3, 4] is too long

.. deprecated:: v4.0.0

    Calling this function with a second schema argument is deprecated.
    Use `Validator.evolve` instead.
Nr   r,   s     r   iter_errorsValidator.iter_errors   r%   r    c                    g)a>  
Check if the instance is valid under the current `schema`.

Raises:

    `jsonschema.exceptions.ValidationError`:

        if the instance is invalid

>>> schema = {"maxItems" : 2}
>>> Draft202012Validator(schema).validate([2, 3, 4])
Traceback (most recent call last):
    ...
ValidationError: [2, 3, 4] is too long

Nr   r,   s     r   validateValidator.validate   r%   r    c                    g)a  
Create a new validator like this one, but with given changes.

Preserves all other attributes, so can be used to e.g. create a
validator with a different schema but with the same :kw:`$ref`
resolution behavior.

>>> validator = Draft202012Validator({})
>>> validator.evolve(schema={"type": "number"})
Draft202012Validator(schema={'type': 'number'}, format_checker=None)

The returned object satisfies the validator protocol, but may not
be of the same concrete class! In particular this occurs
when a :kw:`$ref` occurs to a schema with a different
:kw:`$schema` than this one (i.e. for a different draft).

>>> validator.evolve(
...     schema={"$schema": Draft7Validator.META_SCHEMA["$id"]}
... )
Draft7Validator(schema=..., format_checker=None)
Nr   )r   kwargss     r   evolveValidator.evolve   r%   r    r   r   )r   r   r   z%referencing.jsonschema.SchemaRegistryr   zjsonschema.FormatChecker | NonereturnNone)r   r   r9   r:   )r'   r   r(   strr9   bool)r'   r   r9   r<   )r'   r   r9   zIterable[ValidationError])r'   r   r9   r:   )r9   r   )__name__
__module____qualname____firstlineno____doc____annotations__r   classmethodr#   r)   r-   r0   r3   r7   __static_attributes__r   r    r   r   r   '   s    *\ #"
 "! 32 76   ;?	 8 8	
 
 
 
4*$r    r   )rA   
__future__r   typingr   r   r   r   r   collections.abcr	   r
   referencing.jsonschemareferencing
jsonschemar   jsonschema.exceptionsr   jsonschema.validatorsr   r   r    r   <module>rM      sJ    # L L 1!"5  } } }r    