a
    ]ŠÝg	  ã                   @  st   d Z ddlmZ ddlZdZG dd„ deƒZG dd„ deƒZG d	d
„ d
eƒZ	G dd„ dee
ƒZG dd„ dee
ƒZdS )z1Exception classes for marshmallow-related errors.é    )ÚannotationsNZ_schemac                   @  s   e Zd ZdZdS )ÚMarshmallowErrorz.Base class for all marshmallow-related errors.N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r	   r	   úd/var/www/html/cobodadashboardai.evdpl.com/venv/lib/python3.9/site-packages/marshmallow/exceptions.pyr      s   r   c                      sN   e Zd ZdZeddfdddddœ‡ fdd	„Zd
d„ Zeddœdd„ƒZ‡  Z	S )ÚValidationErroraæ  Raised when validation fails on a field or schema.

    Validators and custom fields should raise this exception.

    :param message: An error message, list of error messages, or dict of
        error messages. If a dict, the keys are subitems and the values are error messages.
    :param field_name: Field name to store the error on.
        If `None`, the error is stored as schema-level error.
    :param data: Raw input data.
    :param valid_data: Valid (de)serialized data.
    Nzstr | list | dictÚstrzYtyping.Mapping[str, typing.Any] | typing.Iterable[typing.Mapping[str, typing.Any]] | Nonez:list[dict[str, typing.Any]] | dict[str, typing.Any] | None)ÚmessageÚ
field_nameÚdataÚ
valid_datac                   sB   t |ttfƒr|gn|| _|| _|| _|| _|| _tƒ  	|¡ d S ©N)
Ú
isinstancer   ÚbytesÚmessagesr   r   r   ÚkwargsÚsuperÚ__init__)Úselfr   r   r   r   r   ©Ú	__class__r	   r
   r      s    
zValidationError.__init__c                 C  s(   | j tkrt| jtƒr| jS | j | jiS r   )r   ÚSCHEMAr   r   Údict©r   r	   r	   r
   Únormalized_messages-   s    z#ValidationError.normalized_messageszdict[str, typing.Any])Úreturnc                 C  s&   t | jtƒs tdt| jƒj ƒ‚| jS )Nz9cannot access 'messages_dict' when 'messages' is of type )r   r   r   Ú	TypeErrorÚtyper   r   r	   r	   r
   Úmessages_dict2   s    
ÿÿzValidationError.messages_dict)
r   r   r   r   r   r   r   Úpropertyr"   Ú__classcell__r	   r	   r   r
   r      s   ùr   c                   @  s   e Zd ZdZdS )ÚRegistryErrorzXRaised when an invalid operation is performed on the serializer
    class registry.
    Nr   r	   r	   r	   r
   r%   <   s   r%   c                   @  s   e Zd ZdZdS )ÚStringNotCollectionErrorzBRaised when a string is passed when a list of strings is expected.Nr   r	   r	   r	   r
   r&   B   s   r&   c                   @  s   e Zd ZdZdS )ÚFieldInstanceResolutionErrorzLRaised when schema to instantiate is neither a Schema class nor an instance.Nr   r	   r	   r	   r
   r'   F   s   r'   )r   Ú
__future__r   Útypingr   Ú	Exceptionr   r   Ú	NameErrorr%   r    r&   r'   r	   r	   r	   r
   Ú<module>   s   -