
    ܖi}                        d dl mZmZ d dlmZ d dlmZ d dlmZ d dlm	Z	m
Z
mZ d dlmZmZ d dlmZ d dlZd d	lmZ d
dlmZ d
dlmZ d
dlmZmZ d
dlmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z& d
dl'm(Z( ddl)m*Z*m+Z+m,Z, ddl-m.Z. ddl/m0Z0 ddl1m2Z2m3Z3 ddl4m5Z5 ddl6m7Z7m8Z8 ddl9m:Z:m;Z;m<Z<m=Z= ddl>m?Z?m@Z@mAZA ddlBmCZC ddlDmEZEmFZFmGZG ddlHmIZI e	rd dlJmKZK ej                   G d deMe             ZN ej                  d        G d! d"             ZP ej                  d        G d# d$             ZQ ej                  h d%d&       G d' d(             ZRy))    )	GeneratorIterable)datetime)Enum)chain)TYPE_CHECKINGOptionalUnion)UUIDuuid4)warnN)	SortedSet   )ComparableTuple)get_now_utc))LicenseExpressionAlongWithOthersException#UnknownComponentDependencyException)SchemaVersion1Dot0SchemaVersion1Dot1SchemaVersion1Dot2SchemaVersion1Dot3SchemaVersion1Dot4SchemaVersion1Dot5SchemaVersion1Dot6SchemaVersion1Dot7)UrnUuidHelper   )_BOM_LINK_PREFIXExternalReferenceProperty)BomRef)	Component)OrganizationalContactOrganizationalEntity)Definitions)
Dependable
Dependency)LicenseLicenseExpressionLicenseRepository%_LicenseRepositorySerializationHelper)	LifecycleLifecycleRepository_LifecycleRepositoryHelper)Service)ToolToolRepository_ToolRepositoryHelper)Vulnerability)
PackageURLc                   $    e Zd ZdZdZdZdZdZdZy)TlpClassificationaT  
    Enum object that defines the Traffic Light Protocol (TLP) classification that controls the sharing and distribution
    of the data that the BOM describes.

    .. note::
        Introduced in CycloneDX v1.7

    .. note::
        See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_tlpClassificationType
    CLEARGREENAMBERAMBER_AND_STRICTREDN)	__name__
__module____qualname____doc__r7   r8   r9   r:   r;        W/var/www/html/content-pipeline/venv/lib/python3.12/site-packages/cyclonedx/model/bom.pyr6   r6   <   s#    	 EEE)
CrA   r6   T)%ignore_unknown_during_deserializationc                       e Zd ZdZdddee   ddfdZe ej                  d      defd              Z
e
j                  deddfd	       Z
defd
ZdedefdZdedefdZdefdZdefdZy)DistributionConstraintsam  
    Our internal representation of the `distributionConstraints` complex type.
    Conditions and constraints governing the sharing and distribution of the data or components described by this BOM.

    .. note::
        Introduced in CycloneDX v1.7

    .. note::
        See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_metadata
    NtlprG   returnc                6    |xs t         j                  | _        y N)r6   r7   rG   selfrG   s     rB   __init__z DistributionConstraints.__init__]   s     1+11rA   r   c                     | j                   S )z
        The Traffic Light Protocol (TLP) classification that controls the sharing and distribution of the data that the
        BOM describes.

        Returns:
            `TlpClassification` enum value
        _tlprL   s    rB   rG   zDistributionConstraints.tlpc   s     yyrA   c                     || _         y rJ   rO   rK   s     rB   rG   zDistributionConstraints.tlpo   s	    	rA   c                 ,    t        | j                        S rJ   )_ComparableTuplerG   rQ   s    rB   __comparable_tuplez*DistributionConstraints.__comparable_tuples   s    ))rA   otherc                 f    t        |t              r!| j                         |j                         k(  S yNF)
isinstancerE   *_DistributionConstraints__comparable_tuplerL   rV   s     rB   __eq__zDistributionConstraints.__eq__v   s-    e45**,0H0H0JJJrA   c                 p    t        |t              r!| j                         |j                         k  S t        S rJ   )rY   rE   rZ   NotImplementedr[   s     rB   __lt__zDistributionConstraints.__lt__{   s0    e45**,u/G/G/IIIrA   c                 4    t        | j                               S rJ   )hashrZ   rQ   s    rB   __hash__z DistributionConstraints.__hash__       D++-..rA   c                 "    d| j                    dS )Nz<DistributionConstraints tlp=>rF   rQ   s    rB   __repr__z DistributionConstraints.__repr__   s    .txxj::rA   )r<   r=   r>   r?   r	   r6   rM   propertyserializablexml_sequencerG   setterrT   rZ   objectboolr\   r_   intrb   strrf   r@   rA   rB   rE   rE   P   s    	 ,02'(2 
2 \q!&  "  	ZZ( T  *$4 *F t 
F t 
/# /;# ;rA   rE   c                   :   e Zd ZdZdddddddddddddeeee   ef      deee	      dee
   dee   deee      d	eee      d
ee   dee   deee      dee   dee   ddfdZe ej(                  ej*                  j,                         ej.                  d      defd                     Zej2                  d
eddfd       Ze ej4                  e       ej4                  e       ej4                  e       ej(                  e       ej.                  d      defd                                          Z e j2                  dee   ddfd       Z e ej(                  e!       ej.                  d      defd                     Z"e"j2                  deee   ef   ddfd       Z"e ejF                  ejH                  jJ                  d       ej.                  d      d:d                     Z&e&j2                  dee	   ddfd       Z&e ej.                  d      dee
   fd              Z'e'j2                  dee
   ddfd        Z'e ej4                  e(       ej4                  e)       ej4                  e*       ej4                  e       ej4                  e       ej4                  e       ej.                  d!      dee   fd"                                                        Z+e+j2                  dee   ddfd#       Z+e ej4                  e       ej4                  e       ej.                  d$      dee   fd%                            Z,e,j2                  dee   ddfd&       Z,e ej.                  d'      dee   fd(              Z-e-j2                  dee   ddfd)       Z-e ej4                  e)       ej4                  e*       ej4                  e       ej4                  e       ej4                  e       ej(                  e.       ej.                  d*      de/fd+                                                        Z0e0j2                  dee   ddfd,       Z0e ej4                  e)       ej4                  e*       ej4                  e       ej4                  e       ej4                  e       ejF                  ejH                  jJ                  d-       ej.                  d.      d;d/                                                        Z1e1j2                  d	ee   ddfd0       Z1e ej4                  e       ej.                  d1      dee   fd2                     Z2e2j2                  dee   ddfd3       Z2de3fd4Z4d5e5de6fd6Z7d5e5de6fd7Z8de9fd8Z:de;fd9Z<y)<BomMetaDataz
    This is our internal representation of the metadata complex type within the CycloneDX standard.

    .. note::
        See the CycloneDX Schema for Bom metadata: https://cyclonedx.org/docs/1.7/xml/#type_metadata
    N)toolsauthors	componentsupplierlicenses
properties	timestampmanufacturer
lifecyclesdistribution_constraintsmanufacturerq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   rH   c                    |xs
 t               | _        |xs g | _        |xs g | _        || _        || _        |xs g | _        |xs g | _        || _        |	xs g | _	        |
| _
        || _        y rJ   )_get_now_utcrw   rq   rr   rs   rt   ru   rv   rx   ry   rz   r{   )rL   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   s               rB   rM   zBomMetaData.__init__   sq     #4ln[b
}""  B$*($*(@%&rA   r   c                     | j                   S )z
        The date and time (in UTC) when this BomMetaData was created.

        Returns:
            `datetime` instance in UTC timezone
        
_timestamprQ   s    rB   rw   zBomMetaData.timestamp   s     rA   c                     || _         y rJ   r   )rL   rw   s     rB   rw   zBomMetaData.timestamp   s	    #rA   r   c                     | j                   S )zl
        An optional list of BOM lifecycle stages.

        Returns:
            Set of `Lifecycle`
        )_lifecyclesrQ   s    rB   ry   zBomMetaData.lifecycles   s     rA   c                 $    t        |      | _        y rJ   )r-   r   )rL   ry   s     rB   ry   zBomMetaData.lifecycles   s    .z:rA      c                     | j                   S )zn
        Tools used to create this BOM.

        Returns:
            :class:`ToolRepository` object.
        )_toolsrQ   s    rB   rq   zBomMetaData.tools   s     {{rA   c                 V    t        |t              r|| _        y t        |      | _        y )N)rq   )rY   r1   r   )rL   rq   s     rB   rq   zBomMetaData.tools   s&     %0 e, 	rA   author   c                     | j                   S )z
        The person(s) who created the BOM.

        Authors are common in BOMs created through manual processes.

        BOMs created through automated means may not have authors.

        Returns:
            Set of `OrganizationalContact`
        )_authorsrQ   s    rB   rr   zBomMetaData.authors   s     }}rA   c                 $    t        |      | _        y rJ   )r   r   )rL   rr   s     rB   rr   zBomMetaData.authors   s    !'*rA      c                     | j                   S )z
        The (optional) component that the BOM describes.

        Returns:
            `cyclonedx.model.component.Component` instance for this Bom Metadata.
        
_componentrQ   s    rB   rs   zBomMetaData.component   s     rA   c                     || _         y)z
        The (optional) component that the BOM describes.

        Args:
            component
                `cyclonedx.model.component.Component` instance to add to this Bom Metadata.

        Returns:
            None
        Nr   rL   rs   s     rB   rs   zBomMetaData.component   s     $rA      c                     | j                   S )z
        The organization that manufactured the component that the BOM describes.

        Returns:
            `OrganizationalEntity` if set else `None`
        )_manufacturerQ   s    rB   r{   zBomMetaData.manufacture  s        rA   c                 6    |t        dt               || _        y)z
        @todo Based on https://github.com/CycloneDX/specification/issues/346,
              we should set this data on `.component.manufacturer`.
        Nz`bom.metadata.manufacture` is deprecated from CycloneDX v1.6 onwards. Please use `bom.metadata.component.manufacturer` instead.)r   DeprecationWarningr   )rL   r{   s     rB   r{   zBomMetaData.manufacture  s%     "L"$ (rA      c                     | j                   S )a  
        The organization that created the BOM.
        Manufacturer is common in BOMs created through automated processes. BOMs created through manual means may have
        `@.authors` instead.

        Returns:
            `OrganizationalEntity` if set else `None`
        _manufacturerrQ   s    rB   rx   zBomMetaData.manufacturer,  s     !!!rA   c                     || _         y rJ   r   )rL   rx   s     rB   rx   zBomMetaData.manufacturer;  s
    )rA      c                     | j                   S )a   
        The organization that supplied the component that the BOM describes.

        The supplier may often be the manufacturer, but may also be a distributor or repackager.

        Returns:
            `OrganizationalEntity` if set else `None`
        	_supplierrQ   s    rB   rt   zBomMetaData.supplier?  s     ~~rA   c                     || _         y rJ   r   )rL   rt   s     rB   rt   zBomMetaData.supplierL  	    !rA   	   c                     | j                   S )z
        A optional list of statements about how this BOM is licensed.

        Returns:
            Set of `LicenseChoice`
        )	_licensesrQ   s    rB   ru   zBomMetaData.licensesP  s     ~~rA   c                 $    t        |      | _        y rJ   )r*   r   )rL   ru   s     rB   ru   zBomMetaData.licensesa  s    *84rA   rg   
   c                     | j                   S )a  
        Provides the ability to document properties in a key/value store. This provides flexibility to include data not
        officially supported in the standard without having to use additional namespaces or create extensions.

        Property names of interest to the general public are encouraged to be registered in the CycloneDX Property
        Taxonomy - https://github.com/CycloneDX/cyclonedx-property-taxonomy. Formal registration is OPTIONAL.

        Return:
            Set of `Property`
        _propertiesrQ   s    rB   rv   zBomMetaData.propertiese  s    & rA   c                 $    t        |      | _        y rJ   r   r   rL   rv   s     rB   rv   zBomMetaData.propertiesz      $Z0rA      c                     | j                   S )z
        Conditions and constraints governing the sharing and distribution of the data or components described by this
        BOM.

        Returns:
            `DistributionConstraints` or `None`
        _distribution_constraintsrQ   s    rB   rz   z$BomMetaData.distribution_constraints~  s     ---rA   c                     || _         y rJ   r   )rL   rz   s     rB   rz   z$BomMetaData.distribution_constraints  s
    )A&rA   c                 R   t        t        | j                        | j                  t        | j                        | j                  t        | j
                        | j                  t        | j                        | j                  | j                  | j                  | j                  f      S rJ   )rT   rr   rs   ru   r{   rv   rz   ry   rt   rw   rq   rx   rQ   s    rB   rU   zBomMetaData.__comparable_tuple  sv    T\\*DNN<LT]]<[]a]m]mT__-t/L/LT__-t}}dnndjjZ^ZkZk!
  	rA   rV   c                 f    t        |t              r!| j                         |j                         k(  S yrX   )rY   rp   _BomMetaData__comparable_tupler[   s     rB   r\   zBomMetaData.__eq__  s,    e[)**,0H0H0JJJrA   c                 p    t        |t              r!| j                         |j                         k(  S t        S rJ   )rY   rp   r   r^   r[   s     rB   r_   zBomMetaData.__lt__  s/    e[)**,0H0H0JJJrA   c                 4    t        | j                               S rJ   )ra   r   rQ   s    rB   rb   zBomMetaData.__hash__  rc   rA   c                 <    d| j                    d| j                   dS )Nz<BomMetaData timestamp=z, component=re   )rw   rs   rQ   s    rB   rf   zBomMetaData.__repr__  s"    ((8T^^DTTUVVrA   )rH   z SortedSet[OrganizationalContact]rH   zSortedSet[Property])=r<   r=   r>   r?   r	   r
   r   r0   r1   r#   r"   r$   r(   r    r   r,   rE   rM   rg   rh   type_mappinghelpersXsdDateTimeri   rw   rj   viewr   r   r   r.   r-   ry   r2   rq   	xml_arrayXmlArraySerializationTypeNESTEDrr   rs   r   r   r   r{   rx   rt   r+   r*   ru   rv   rz   rT   r   rk   rl   r\   r_   rm   rb   rn   rf   r@   rA   rB   rp   rp      s    BF=A)-370437(,7;48FJ6:'htnn<=>' (#89:' I&	'
 /0' 8G,-' Xh/0' H%' 34' Xi01' #++B"C' 23' 
'8 \|33??@\q!8  " A  $8 $ $ $ \)*\)*\)*\9:\q! /   " ; + + +   ;Xi%8 ;T ; ; \45\q!~  " 6  \\-5$!?@ -T - -
 \LBBII8T\q! " U  ^^+x(=> +4 + + \q!8I.  "  $8I#6 $4 $ $ \)*\)*\)*\)*\)*\)*\q!!X&:; ! " + + + + + + ! 
(x0D'E 
($ 
( 
( \)*\)*\q!	"h';< 	" " + + 	" *2F)G *D * * \q!	(#78 	 " 	 __"*>!? "D " " \)*\)*\)*\)*\)*\DE\q!+  " F + + + + +  __5'!2 5t 5 5 \)*\)*\)*\)*\)*\LBBII:V\r"  # W + + + + +   1Xh%7 1D 1 1 \)*\r".(3J*K . # + . $$BJaAb Bgk B %B$4 F t 
F t 
/# /W# WrA   rp   >   $schema
bom_formatspec_version)ignore_during_deserializationrC   c                      e Zd ZdZddddddddddd
deee      deee      deee      dee	   d	e
d
ee   deee      deee      deee      dee   ddfdZe ej&                  e       ej*                  e       ej*                  e       ej*                  e       ej*                  e       ej*                  e       ej*                  e       ej*                  e       ej:                         de	fd                                                                      Zej>                  de	ddfd       Ze ej:                         de
fd              Z e j>                  d	e
ddfd       Z e ej*                  e       ej*                  e       ej*                  e       ej*                  e       ej*                  e       ej*                  e       ejB                  d      defd                                                        Z"e"j>                  d
eddfd       Z"e ejF                  e$       ejF                  e       ejJ                  ejL                  jN                  d       ejB                  d      dGd                                   Z(e(j>                  dee   ddfd       Z(e ej*                  e       ej*                  e       ej*                  e       ej*                  e       ej*                  e       ej*                  e       ejJ                  ejL                  jN                  d       ejB                  d      dHd                                                               Z)e)j>                  dee   ddfd       Z)e ej*                  e       ej*                  e       ej*                  e       ej*                  e       ej*                  e       ej*                  e       ej*                  e       ejJ                  ejL                  jN                  d        ejB                  d!      dId"                                                                      Z*e*j>                  dee   ddfd#       Z*e ej*                  e       ej*                  e       ej*                  e       ej*                  e       ej*                  e       ej*                  e       ejJ                  ejL                  jN                  d$       ejB                  d%      dJd&                                                               Z+e+j>                  dee   ddfd'       Z+e ej*                  e       ej*                  e       ej*                  e       ejJ                  ejL                  jN                  d(       ejB                  d)      dKd*                                          Z,e,j>                  dee   ddfd+       Z,e ej*                  e       ej*                  e       ej*                  e       ej*                  e       ejJ                  ejL                  jN                  d,       ejB                  d-      dLd/                                                 Z-e-j>                  dee   ddfd0       Z-e ej*                  e       ej*                  e       ejB                  d1      dee   fd2                            Z.e.j>                  deddfd3       Z.d4ed5   dee   fd6Z/de0fd7Z1dede2fd8Z3de4eddf   fd9Z5d:e6dd.fd;Z7de2fd<Z8dMd=e9d>eee9      ddfd?Z:de0fd@Z;de2fdAZ<de=fdBZ>dCe?de2fdDZ@de
fdEZAde0fdFZBy)NBoma!  
    This is our internal representation of a bill-of-materials (BOM).

    Once you have an instance of `cyclonedx.model.bom.Bom`, you can pass this to an instance of
    `cyclonedx.output.BaseOutput` to produce a CycloneDX document according to a specific schema version and format.
    Nr   )

componentsservicesexternal_referencesserial_numberversionmetadatadependenciesvulnerabilitiesrv   definitionsr   r   r   r   r   r   r   r   rv   r   rH   c       
            |xs
 t               | _        || _        |xs
 t               | _        |xs g | _        |xs g | _        |xs g | _        |xs g | _        |xs g | _	        |	xs g | _
        |
xs
 t               | _        y)z
        Create a new Bom that you can manually/programmatically add data to later.

        Returns:
            New, empty `cyclonedx.model.bom.Bom` instance.
        N)r   r   r   rp   r   r   r   r   r   r   rv   r%   r   )rL   r   r   r   r   r   r   r   r   rv   r   s              rB   rM   zBom.__init__  s    & +5eg 1KM$* B#6#<" .4"(.B$*&7+-rA   c                     | j                   S )zt
        Unique UUID for this BOM

        Returns:
            `UUID` instance
            `UUID` instance
        _serial_numberrQ   s    rB   r   zBom.serial_number  s    $ """rA   c                     || _         y rJ   r   )rL   r   s     rB   r   zBom.serial_number  s
    +rA   c                     | j                   S rJ   _versionrQ   s    rB   r   zBom.version  s     }}rA   c                     || _         y rJ   r   )rL   r   s     rB   r   zBom.version  s	    rA   r   c                     | j                   S )a  
        Get our internal metadata object for this Bom.

        Returns:
            Metadata object instance for this Bom.

        .. note::
            See the CycloneDX Schema for Bom metadata: https://cyclonedx.org/docs/1.7/xml/#type_metadata
        	_metadatarQ   s    rB   r   zBom.metadata  s    $ ~~rA   c                     || _         y rJ   r   )rL   r   s     rB   r   zBom.metadata  r   rA   rs      c                     | j                   S )z}
        Get all the Components currently in this Bom.

        Returns:
             Set of `Component` in this Bom
        )_componentsrQ   s    rB   r   zBom.components  s     rA   c                 $    t        |      | _        y rJ   )r   r   )rL   r   s     rB   r   zBom.components  r   rA   service   c                     | j                   S )zy
        Get all the Services currently in this Bom.

        Returns:
             Set of `Service` in this BOM
        )	_servicesrQ   s    rB   r   zBom.services  s      ~~rA   c                 $    t        |      | _        y rJ   )r   r   )rL   r   s     rB   r   zBom.services0  s    "8,rA   	reference(   c                     | j                   S )z
        Provides the ability to document external references related to the BOM or to the project the BOM describes.

        Returns:
            Set of `ExternalReference`
        )_external_referencesrQ   s    rB   r   zBom.external_references4  s    " (((rA   c                 $    t        |      | _        y rJ   )r   r   )rL   r   s     rB   r   zBom.external_referencesG  s    $-.A$B!rA   
dependency2   c                     | j                   S rJ   )_dependenciesrQ   s    rB   r   zBom.dependenciesK  s     !!!rA   c                 $    t        |      | _        y rJ   )r   r   )rL   r   s     rB   r   zBom.dependenciesW  s    &|4rA   rg   F   c                     | j                   S )a  
        Provides the ability to document properties in a name/value store. This provides flexibility to include data
        not officially supported in the standard without having to use additional namespaces or create extensions.
        Property names of interest to the general public are encouraged to be registered in the CycloneDX Property
        Taxonomy - https://github.com/CycloneDX/cyclonedx-property-taxonomy. Formal registration is OPTIONAL.

        Return:
            Set of `Property`
        r   rQ   s    rB   rv   zBom.propertiesh  s    $ rA   c                 $    t        |      | _        y rJ   r   r   s     rB   rv   zBom.properties|  r   rA   vulnerabilityP   SortedSet[Vulnerability]c                     | j                   S )zp
        Get all the Vulnerabilities in this BOM.

        Returns:
             Set of `Vulnerability`
        )_vulnerabilitiesrQ   s    rB   r   zBom.vulnerabilities  s     $$$rA   c                 $    t        |      | _        y rJ   )r   r   )rL   r   s     rB   r   zBom.vulnerabilities  s     )/ :rA   n   c                 b    t        | j                  j                        dkD  r| j                  S dS )z\
        The repository for definitions

        Returns:
            `Definitions`
        r   N)len_definitions	standardsrQ   s    rB   r   zBom.definitions  s-     %((9(9(C(C$Dq$Ht  RdRrA   c                     || _         y rJ   )r   )rL   r   s     rB   r   zBom.definitions  s
    'rA   purlr4   c                     |r<| j                   D cg c]  }|j                  |k(  s| }}t        |      dk(  r|d   S yc c}w )a	  
        Get a Component already in the Bom by its PURL

        Args:
             purl:
                An instance of `packageurl.PackageURL` to look and find `Component`.

        Returns:
            `Component` or `None`

        .. deprecated:: next
        r   r   N)r   r  r   )rL   r  xfounds       rB   get_component_by_purlzBom.get_component_by_purl  sE      $B1166T>QBEB5zQQx	 Cs
   A A c                 .    | j                   j                  S )z
        Get the unique reference for this Bom.

        Returns:
            URN formatted UUID that uniquely identified this Bom instance.

        .. deprecated:: next
        )r   urnrQ   s    rB   get_urn_uuidzBom.get_urn_uuid  s     !!%%%rA   c                     || j                   v S )ab  
        Check whether this Bom contains the provided Component.

        Args:
            component:
                The instance of `cyclonedx.model.component.Component` to check if this Bom contains.

        Returns:
            `bool` - `True` if the supplied Component is part of this Bom, `False` otherwise.

        .. deprecated:: next
        )r   r   s     rB   has_componentzBom.has_component  s     DOO++rA   c              #      K   | j                   j                  r.| j                   j                  j                  d      E d {    | j                  D ]  }|j                  d      E d {     y 7 07 	w)NTinclude_self)r   rs   get_all_nested_componentsr   )rL   cs     rB   _get_all_componentszBom._get_all_components  sk     ==""}}..HHVZH[[[ 	FA222EEE	F \Es$   A A7A3(A7+A5,A75A7bom_refc                     t               }| j                  D ]>  }|j                  D ]-  }|j                  |j                  k(  s|j                  |       / @ |S )a	  
        Get all known Vulnerabilities that affect the supplied bom_ref.

        Args:
            bom_ref: `BomRef`

        Returns:
            `SortedSet` of `Vulnerability`

        .. deprecated:: next
            Deprecated without any replacement.
        )r   r   affectsrefvalueadd)rL   r  r   vtargets        rB   get_vulnerabilities_for_bom_refz#Bom.get_vulnerabilities_for_bom_ref  sY     5>K%% 	+A)) +::.#''*+	+ rA   c                 ,    t        | j                        S )a  
        Check whether this Bom has any declared vulnerabilities.

        Returns:
            `bool` - `True` if this Bom has at least one Vulnerability, `False` otherwise.

        .. deprecated:: next
            Deprecated without any replacement.
        )rl   r   rQ   s    rB   has_vulnerabilitieszBom.has_vulnerabilities  s     D(())rA   r  
depends_onc           	      Z   t        t        fd| j                        d       }|r)|rf|j                  j                  t	        d |             n?| j
                  j                  t        j                  |rt	        d |      ng              |r|D ]  }| j                  |d         y y )Nc                 6    | j                   j                  k(  S rJ   )r  r  )_dr  s    rB   <lambda>z)Bom.register_dependency.<locals>.<lambda>  s    BFFfnn$< rA   c                 .    t        | j                        S Nr  r'   r  )r  s    rB   r   z)Bom.register_dependency.<locals>.<lambda>  s    jRZZ6P rA   c                 .    t        | j                        S r"  r$  )_deps    rB   r   z)Bom.register_dependency.<locals>.<lambda>  s    jT\\.J rA   )r  r   )r  r  )
nextfilterr   updatemapr   r  r'   r  register_dependency)rL   r  r  r  _d2s    `   rB   r+  zBom.register_dependency  s    &<d>O>OPRVW&&s+PR\']^ "":NN[eS!JJWkm$ 
 ! F(((EF rA   c                 D    t          | j                   d| j                   S )zV
        .. deprecated:: next
            Deprecated without any replacement.
        /)r   r   r   rQ   s    rB   r  zBom.urn!  s%     ##D$6$6#7qGGrA   c           	           j                   j                  r& j                   j                   j                          j                  D ]  } j                  |         j                  D ]  } j                  |        t        t        d  j                                     t        t        d  j                              z  }t        t        d  j                  D        t        j                  d  j                  D                          }||z
  }t        |      dkD  rt        d|        j                   j                  rnt         j                        dkD  rVt        t         fd j                              s4t        d	 j                   j                  j                   d
t         d       t         j                   g j                   j                  r& j                   j                  j#                  d      ng t        j                  d  j                  D               j                        D ]E  }t        |j$                        dkD  st        d |j$                  D              s9t'        d|       y)a
  
        Perform data-model level validations to make sure we have some known data integrity prior to attempting output
        of this `Bom`

        Returns:
             `bool`

        .. deprecated:: next
            Deprecated without any replacement.
        )r  c                     | j                   S rJ   r  )r  s    rB   r   zBom.validate.<locals>.<lambda>>  s
    qyy rA   c                     | j                   S rJ   r1  )ss    rB   r   zBom.validate.<locals>.<lambda>?  s
    !)) rA   c              3   4   K   | ]  }|j                     y wrJ   r#  .0ds     rB   	<genexpr>zBom.validate.<locals>.<genexpr>A  s     .qQUU.s   c              3   <   K   | ]  }|j                           y wrJ   )dependencies_as_bom_refsr5  s     rB   r8  zBom.validate.<locals>.<genexpr>B  s     X : : <X   r   zsOne or more Components have Dependency references to Components/Services that are not known in this BOM. They are: c                     | j                   j                  j                  j                  k(  xr t	        | j
                        dkD  S )Nr   )r  r   rs   r  r   r   )r7  rL   s    rB   r   zBom.validate.<locals>.<lambda>M  s4    aeet}}66>>>Z3q~~CVYZCZ rA   z%The Component this BOM is describing z has no defined dependencies which means the Dependency Graph is incomplete - you should add direct dependencies to this "root" Component to complete the Dependency Graph data.r   )category
stacklevelTr  c              3   @   K   | ]  }|j                  d         yw)Tr  N)r  )r6  r  s     rB   r8  zBom.validate.<locals>.<genexpr>]  s     hST ; ; ; Nhs   c              3   <   K   | ]  }t        |t                y wrJ   )rY   r)   )r6  lis     rB   r8  zBom.validate.<locals>.<genexpr>`  s     -hTVj=N.O-hr;  z7Found LicenseExpression along with others licenses in: )r   rs   r+  r   r   setr*  r  r   r   from_iterabler   r   anyr   r  UserWarningr  ru   r   )rL   _c_scomponent_bom_refsdependency_bom_refsdependency_diffelems   `      rB   validatezBom.validate)  sF    ==""$$DMM,C,C$D// 	0B$$B$/	0-- 	0B$$B$/	0 !%8$:R:R:T!UVY\#T]]3Z5 5!%.D--.XdFWFWXX#
  .0BB!#5""1!245 5 ==""s4??';a'?CZM
 I 78O8O8T8T7U VJ J %	 ]]OTXTaTaTkTkDMM##==4=PqshX\XgXghhMM	
 	XD 4==!A%#-hZ^ZgZg-h*h?MdXVX X	X rA   c                 J   t        | j                  | j                  | j                  t        | j                        t        | j
                        t        | j                        t        | j                        t        | j                        t        | j                        f	      S rJ   )
rT   r   r   r   r   r   r   r   rv   r   rQ   s    rB   rU   zBom.__comparable_tuplef  s}    dmm=M>!"24=="AT5568H!!9#$4T__$ET112!
  	rA   rV   c                 f    t        |t              r!| j                         |j                         k(  S yrX   )rY   r   _Bom__comparable_tupler[   s     rB   r\   z
Bom.__eq__o  s,    eS!**,0H0H0JJJrA   c                 4    t        | j                               S rJ   )ra   rO  rQ   s    rB   rb   zBom.__hash__t  rc   rA   c                 :    d| j                    dt        |        dS )Nz
<Bom uuid=z, hash=re   )r   ra   rQ   s    rB   rf   zBom.__repr__w  s"    D../wtDzl!DDrA   )rH   zSortedSet[Component])rH   zSortedSet[Service])rH   zSortedSet[ExternalReference])rH   zSortedSet[Dependency]r   )rH   r   rJ   )Cr<   r=   r>   r?   r	   r   r"   r/   r   r   rm   rp   r'   r3   r    r%   rM   rg   rh   r   r   r   r   r   r   r   r   r   r   xml_attributer   rj   r   ri   r   include_noner   r   r   r   r   r   r   r   rv   r   r   r  rn   r  rl   r
  r   r  r!   r  r  r&   r+  r  rL  rT   rO  rk   r\   rb   rf   r@   rA   rB   r   r     s	    5904EI(,*.7;=A37-18Xi018 8G,-8 &h/@&AB	8
  ~8 8 ;'8 x
348 "(="9:8 Xh/08 k*8 
8< \}-\)*\)*\)*\)*\)*\)*\)*\!#t # " + + + + + + + . # ,4 ,D , , \!  "  ^^ s  t     \)*\)*\)*\)*\)*\)*\r"
+ 
 # + + + + + + 
 __" " " " \12\12\LBBII;W\r"  # X 3 3 
  1Xi%8 1T 1 1 \)*\)*\)*\)*\)*\)*\LBBII9U\r" # V + + + + + +  __-'!2 -t - - \)*\)*\)*\)*\)*\)*\)*\LBBII;W\r") # X + + + + + + + ) Cx@Q7R CW[ C  C \)*\)*\)*\)*\)*\)*\LBBII<X\r"" # Y + + + + + + " 5*)= 5$ 5 5   \)*\)*\)*\LBBII:V\r"
  # W + + + 
  1Xh%7 1D 1 1 \)*\)*\)*\)*\LBBII?[\r"% # \ + + + + % ;x/F ;4 ; ;2 \)*\)*\s#SXk2 S $ + + S ({ (t ( ((<*@ XiEX (	&c 	&,y ,T ,FYy$/D%E Fv B\ (
*T 
*F* F(8T^K_B` Flp F$HS H;$ ;z$4 F t 
/# /E# ErA   r   )Scollections.abcr   r   r   enumr   	itertoolsr   typingr   r	   r
   uuidr   r   warningsr   py_serializablerh   sortedcontainersr   _internal.comparer   rT   _internal.timer   r}   exception.modelr   r   schema.schemar   r   r   r   r   r   r   r   serializationr    r   r   r    r  r!   rs   r"   contactr#   r$   
definitionr%   r   r&   r'   licenser(   r)   r*   r+   	lifecycler,   r-   r.   r   r/   toolr0   r1   r2   r   r3   
packageurlr4   serializable_enumrn   r6   serializable_classrE   rp   r   r@   rA   rB   <module>rj     s$  & 0    1 1   & & C 8 l	 	 	 * ; ;    @ # . i i Q Q  = = (% T   & !  tL3; 3; M3;l !  tL\W \W M\W~ !  # +/	KE KEKErA   