Ë
    ¨Ü–i7  ã                   ób  — d dl mZmZ d dlmZ d dlmZmZmZm	Z	m
Z
mZmZ ddlmZ erddlmZ ddlmZ dd	lmZ  G d
„ d«      Z G d„ de
«      Z G d„ dee«      Zedeej.                     ddddfd„«       Zedeej2                     ddddfd„«       Zededdded   fd„«       Zdeddddfd„Zy)é    )ÚABCÚabstractmethod)ÚIterable)ÚTYPE_CHECKINGÚAnyÚLiteralÚOptionalÚProtocolÚUnionÚoverloadé   )ÚOutputFormat)ÚSchemaVersioné   ©ÚJsonValidator©ÚXmlValidatorc                   óF   — e Zd ZU dZeed<   	 deddfd„Zdefd„Zdefd„Z	y)ÚValidationErrorz^Validation failed with this specific error.

    Use :attr:`~data` to access the content.
    ÚdataÚreturnNc                 ó   — || _         y ©N)r   )Úselfr   s     úa/var/www/html/content-pipeline/venv/lib/python3.12/site-packages/cyclonedx/validation/__init__.pyÚ__init__zValidationError.__init__(   s	   € Øˆ	ó    c                 ó,   — t        | j                  «      S r   )Úreprr   ©r   s    r   Ú__repr__zValidationError.__repr__+   s   € ÜD—I‘I‹Ðr   c                 ó,   — t        | j                  «      S r   )Ústrr   r!   s    r   Ú__str__zValidationError.__str__.   s   € Ü4—9‘9‹~Ðr   )
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__annotations__r   r$   r"   r%   © r   r   r   r      s<   … ñð
 ƒIØGð˜Sð  Tó ð˜#ó ð˜ô r   r   c                   óœ   — e Zd ZdZeddœdeded   dee   fd„«       Z	ededed	   dee
e      fd
„«       Z	ddœdedededee
e   f   fd„Z	y)ÚSchemabasedValidatorzSchema-based Validator protocol.)Ú
all_errorsr   r.   Fr   c                 ó   — y)a$  Validate a string

        :param data: the data string to validate
        :param all_errors: whether to return all errors or only (any)one - if any
        :return: validation error
        :retval None: if ``data`` is valid
        :retval ValidationError:  if ``data`` is invalid
        Nr+   ©r   r   r.   s      r   Úvalidate_strz!SchemabasedValidator.validate_str5   ó   € ð 	r   Tc                 ó   — y)a.  Validate a string

        :param data: the data string to validate
        :param all_errors: whether to return all errors or only (any)one - if any
        :return: validation error
        :retval None: if ``data`` is valid
        :retval Iterable[ValidationError]:  if ``data`` is invalid
        Nr+   r0   s      r   r1   z!SchemabasedValidator.validate_strA   r2   r   Nc                 ó   — y)a¦  Validate a string

        :param data: the data string to validate
        :param all_errors: whether to return all errors or only (any)one - if any
        :return: validation error
        :retval None: if ``data`` is valid
        :retval ValidationError:  if ``data`` is invalid and ``all_errors`` is ``False``
        :retval Iterable[ValidationError]:  if ``data`` is invalid and ``all_errors`` is ``True``
        Nr+   r0   s      r   r1   z!SchemabasedValidator.validate_strM   s   € ð 	r   )r&   r'   r(   r)   r   r$   r   r	   r   r1   r   Úboolr   r+   r   r   r-   r-   2   s§   „ Ù)àØFIò 	 ð 	°W¸U±^ð 	ÈhÐWfÑNgò 	ó ð	ð ð	 ð 	°W¸T±]ð 	ÀxÐPXÐYhÑPiÑGjò 	ó ð	ð !òØðàðð 
ˆt_ h¨Ñ&?Ð?Ñ	@ôr   r-   c                   óp   — e Zd ZdZdd„Zed	d„«       Zeedefd„«       «       Z	eede
e   fd„«       «       Zy)
ÚBaseSchemabasedValidatorzBase Schema-based Validatorr   Nc                 óF   — || _         | j                  st        d|›«      ‚y )NzUnsupported schema_version: )Ú)_BaseSchemabasedValidator__schema_versionÚ_schema_fileÚ
ValueError)r   Úschema_versions     r   r   z!BaseSchemabasedValidator.__init__`   s,   € Ø .ˆÔØ× Ò ÜÐ;¸NÐ;MÐNÓOÐOð !r   c                 ó   — | j                   S )zGet the schema version.)r9   r!   s    r   r<   z'BaseSchemabasedValidator.schema_versione   s   € ð ×$Ñ$Ð$r   c                  ó   — y)zGet the format.Nr+   r!   s    r   Úoutput_formatz&BaseSchemabasedValidator.output_formatj   ó   € ð 	r   c                  ó   — y)z0Get the schema file according to schema version.Nr+   r!   s    r   r:   z%BaseSchemabasedValidator._schema_filep   r@   r   )r<   r   r   N)r   r   )r&   r'   r(   r)   r   Úpropertyr<   r   r   r?   r	   r$   r:   r+   r   r   r7   r7   ]   si   „ Ù%óPð
 ò%ó ð%ð Øð˜|ò ó ó ðð Øð˜h s™mò ó ó ñr   r7   r?   r<   r   r   r   c                  ó   — y r   r+   ©r?   r<   s     r   Úmake_schemabased_validatorrE   w   ó   € ð r   r   c                  ó   — y r   r+   rD   s     r   rE   rE   }   rF   r   )r   r   c                  ó   — y r   r+   rD   s     r   rE   rE   ƒ   rF   r   c                 óž   — t         r t        j                  | u rddlm} n't        j
                  | u rddlm} nt        d| ›«      ‚ ||«      S )z‚Get the default Schema-based Validator for a certain :class:`OutputFormat`.

    Raises error when no instance could be made.
    r   r   r   zUnexpected output_format: )	r   r   ÚJSONÚjsonr   ÚXMLÚxmlr   r;   )r?   r<   Ú	Validators      r   rE   rE   ‰   sH   € õ ä×Ñ˜MÑ)Þ4Ü	×	Ñ	˜]Ñ	*Þ2äÐ5°mÐ5FÐGÓHÐHÙ^Ó$Ð$r   N)Úabcr   r   Úcollections.abcr   Útypingr   r   r   r	   r
   r   r   Úschemar   r   rK   r   rM   r   r   r-   r7   rJ   rE   rL   r+   r   r   ú<module>rS      s  ð÷& $Ý $ß S× SÑ Så !áÝ&Ý#Ý!÷ñ ô&(˜8ô (ôV˜sÐ$8ô ð4 
ð¨g°l×6GÑ6GÑ.Hð ÐZið Ø$3òó 
ðð
 
ð¨g°l×6FÑ6FÑ.Gð ÐYhð Ø$2òó 
ðð
 
ð¨lð ÈOð Ø$)Ð*IÑ$Jòó 
ðð
%¨lð %ÈOð %Ø$>ô%r   