
    ܖiq                     $   d dl Z d dl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 ej                  dk\  rd dl
mZ n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 d
dl m!Z!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l0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8 ddl9m:Z: ddl;m<Z<m=Z= ddl>m?Z?m@Z@ ddlAmBZB ddlCmDZD ddlEmFZF ddlGmHZHmIZImJZJ ddlKmLZL  ej                  d       G d d             ZNej                   G d d ePe             ZQ G d! d"ej                  j                        ZTej                   G d# d$ePe             ZU G d% d&ej                  j                        ZV ej                  d       G d' d(             ZWej                   G d) d*ePe             ZX ej                  d       G d+ d,             ZY ej                  d       G d- d.             ZZ ej                  d       G d/ d0             Z[ ej                  d       G d1 d2ej                  j                               Z\ ej                  d       G d3 d4ej                  j                               Z] ej                  d       G d5 d6eD             Z^y)7    N)Iterable)Enum)AnyOptionalUnion)warn)      )
deprecated)
PackageURL)	SortedSet   )bom_ref_from_str)ComparablePackageURLComparableTuple)InvalidOmniBorIdExceptionInvalidSwhidException)!CycloneDxDeserializationException'SerializationOfUnexpectedValueException0SerializationOfUnsupportedComponentTypeException)SchemaVersion1Dot0SchemaVersion1Dot1SchemaVersion1Dot2SchemaVersion1Dot3SchemaVersion1Dot4SchemaVersion1Dot5SchemaVersion1Dot6SchemaVersion1Dot7)
PackageUrl   )AttachedTextExternalReferenceHashAlgorithmHashTypeIdentifiableActionPropertyXsUri&_HashTypeRepositorySerializationHelper)BomRef)ComponentEvidence%_ComponentEvidenceSerializationHelper)OrganizationalContactOrganizationalEntity)CryptoProperties)
Dependable)	IssueType)LicenseLicenseRepository%_LicenseRepositorySerializationHelper)ReleaseNotesT)%ignore_unknown_during_deserializationc                      e Zd ZdZdddddddee   dee   dee   dee   dee   d	dfd
Ze	 e
j                  d       e
j                  e
j                  j                        d	ee   fd                     Zej                   dee   d	dfd       Ze	 e
j                  d      d	ee   fd              Zej                   dee   d	dfd       Ze	 e
j                  d      d	ee   fd              Zej                   dee   d	dfd       Ze	 e
j                  d      d	ee   fd              Zej                   dee   d	dfd       Ze	 e
j                  d       e
j                  e
j                  j                        d	ee   fd                     Zej                   de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) Commitz
    Our internal representation of the `commitType` complex type.

    .. note::
        See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_commitType
    Nuidurlauthor	committermessager9   r:   r;   r<   r=   returnc                J    || _         || _        || _        || _        || _        y Nr8   )selfr9   r:   r;   r<   r=   s         ]/var/www/html/content-pipeline/venv/lib/python3.12/site-packages/cyclonedx/model/component.py__init__zCommit.__init__S   s'     "    r    c                     | j                   S )z
        A unique identifier of the commit. This may be version control specific. For example, Subversion uses revision
        numbers whereas git uses commit hashes.

        Returns:
            `str` if set else `None`
        _uidrA   s    rB   r9   z
Commit.uida   s     yyrD   c                     || _         y r@   rF   )rA   r9   s     rB   r9   z
Commit.uidn   	    	rD   r   c                     | j                   S )z
        The URL to the commit. This URL will typically point to a commit in a version control system.

        Returns:
             `XsUri` if set else `None`
        _urlrH   s    rB   r:   z
Commit.urlr   s     yyrD   c                     || _         y r@   rL   rA   r:   s     rB   r:   z
Commit.url}   rJ   rD   r	   c                     | j                   S )z
        The author who created the changes in the commit.

        Returns:
            `IdentifiableAction` if set else `None`
        _authorrH   s    rB   r;   zCommit.author        ||rD   c                     || _         y r@   rQ   rA   r;   s     rB   r;   zCommit.author   	    rD      c                     | j                   S )z
        The person who committed or pushed the commit

        Returns:
            `IdentifiableAction` if set else `None`
        
_committerrH   s    rB   r<   zCommit.committer   s     rD   c                     || _         y r@   rY   )rA   r<   s     rB   r<   zCommit.committer   	    #rD      c                     | j                   S )z|
        The text description of the contents of the commit.

        Returns:
            `str` if set else `None`
        _messagerH   s    rB   r=   zCommit.message   s     }}rD   c                     || _         y r@   r_   )rA   r=   s     rB   r=   zCommit.message   	    rD   c                     t        | j                  | j                  | j                  | j                  | j
                  f      S r@   )_ComparableTupler9   r:   r;   r<   r=   rH   s    rB   __comparable_tuplezCommit.__comparable_tuple   s5    HHdhhKKLL!
  	rD   otherc                 f    t        |t              r!| j                         |j                         k(  S yNF)
isinstancer7   _Commit__comparable_tuplerA   rf   s     rB   __eq__zCommit.__eq__   s,    eV$**,0H0H0JJJrD   c                 p    t        |t              r!| j                         |j                         k  S t        S r@   )ri   r7   rj   NotImplementedrk   s     rB   __lt__zCommit.__lt__   s/    eV$**,u/G/G/IIIrD   c                 4    t        | j                               S r@   )hashrj   rH   s    rB   __hash__zCommit.__hash__       D++-..rD   c                 V    d| j                    d| j                   d| j                   dS )Nz<Commit uid=z, url=z
, message=>)r9   r:   r=   rH   s    rB   __repr__zCommit.__repr__   s)    dhhZvdhhZz$,,qQQrD   )__name__
__module____qualname____doc__r   strr'   r%   rC   propertyserializablexml_sequence
xml_stringXmlStringSerializationTypeNORMALIZED_STRINGr9   setterr:   r;   r<   r=   rd   rj   objectboolrl   r   ro   intrr   rv    rD   rB   r7   r7   J   s    "#/326!%c] e_ +,	
 ./ # 
 \q!\\DDVVWXc]  X "  	ZZx}    \q!Xe_  "  	ZZx 4   \q!!34  "  ]]X&89 d   \q!8$67  "  $8,>#? $D $ $ \q!\\DDVVW#  X "  ^^ x}      $4 F t 
C D 
/# /R# RrD   r7   c                       e Zd ZdZdZdZdZy)ComponentScopez
    Enum object that defines the permissable 'scopes' for a Component according to the CycloneDX schema.

    .. note::
        See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_scope
    requiredoptionalexcludedN)rw   rx   ry   rz   REQUIREDOPTIONALEXCLUDEDr   rD   rB   r   r      s     HHHrD   r   c            
       
   e Zd ZU dZ e       Zeeej                     e	e
   f   ed<    e	e
j                  e
j                  h      ee<   ee   e
j                  hz  ee<   ee   ee<   ee   ee<   ee   ee<   ee   ee<   ee   ee<   ee   ee<   ede
deej                     dee   fd       Zededeeej                        dedee   fd	       Zededeeej                        dedee   fd
       Zedede
fd       Zy)"_ComponentScopeSerializationHelper   THIS CLASS IS NON-PUBLIC API  )_ComponentScopeSerializationHelper__CASEScsviewr>   c                 Z    || j                   j                  |d      v r|j                  S d S )Nr   )r   getvalue)clsr   r   s      rB   __normalizez._ComponentScopeSerializationHelper.__normalize   s1     S[[__T2.. xx 		rD   o__c                .    |J | j                  ||      S r@   -_ComponentScopeSerializationHelper__normalizer   r   r   r   s       rB   json_normalizez1_ComponentScopeSerializationHelper.json_normalize   !     q$''rD   c                .    |J | j                  ||      S r@   r   r   s       rB   xml_normalizez0_ComponentScopeSerializationHelper.xml_normalize   r   rD   c                     t        |      S r@   )r   r   r   s     rB   deserializez._ComponentScopeSerializationHelper.deserialize   s    a  rD   N)rw   rx   ry   rz   dictr   typer}   ViewType	frozensetr   __annotations__r   r   r   r   r   r   r   r   r   r   r   classmethodr   r{   r   r   r   r   r   r   rD   rB   r   r      s   *LPFGT$|,,-y/HHIR"+- #G #**<"=A #G #**<"=G")*<"=G")*<"=G")*<"=G")*<"=G")*<"=G^ 48M8M3N S[\_S`  
 (s (%d<+@+@&AB( (%-c]( ( (c ($T,*?*?%@A(($,SM( ( !C !N ! !rD   r   c                   D    e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdZy)ComponentTypez
    Enum object that defines the permissible 'types' for a Component according to the CycloneDX schema.

    .. note::
        See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_classification
    application	containerzcryptographic-assetdatadevicezdevice-driverfilefirmware	frameworklibraryzmachine-learning-modelzoperating-systemplatformN)rw   rx   ry   rz   APPLICATION	CONTAINERCRYPTOGRAPHIC_ASSETDATADEVICEDEVICE_DRIVERFILEFIRMWARE	FRAMEWORKLIBRARYMACHINE_LEARNING_MODELOPERATING_SYSTEMPLATFORMr   rD   rB   r   r      sM      KI/DF#MDHIG5)HrD   r   c            
          e Zd ZU dZ e       Zeeej                     e	e
   f   ed<    e	e
j                  e
j                  e
j                  e
j                  e
j                   h      ee<   ee   e
j$                  hz  ee<   ee   e
j(                  e
j*                  hz  ee<   ee   ee<   ee   ee<   ee   e
j2                  e
j4                  e
j6                  e
j8                  hz  ee<   ee   e
j<                  hz  ee<   ee   ee <   e!de
deej                     de"e#   fd       Z$e!de%de"eej                        de%de"e#   fd	       Z&e!de%de"eej                        de%de"e#   fd
       Z'e!de%de
fd       Z(y)!_ComponentTypeSerializationHelperr   (_ComponentTypeSerializationHelper__CASESctr   r>   c                 x    || j                   j                  |d      v r|j                  S t        d|d|      )Nr   zunsupported z
 for view )r   r   r   r   )r   r   r   s      rB   r   z-_ComponentTypeSerializationHelper.__normalize7  s=    r**88O>bVS]^b]e?fggrD   r   r   c                .    |J | j                  ||      S r@   ,_ComponentTypeSerializationHelper__normalizer   s       rB   r   z0_ComponentTypeSerializationHelper.json_normalize=  r   rD   c                .    |J | j                  ||      S r@   r   r   s       rB   r   z/_ComponentTypeSerializationHelper.xml_normalizeD  r   rD   c                     t        |      S r@   )r   r   s     rB   r   z-_ComponentTypeSerializationHelper.deserializeK  s    QrD   N))rw   rx   ry   rz   r   r   r   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r{   r   r   r   r   r   r   rD   rB   r   r     sP   *KO6GT$|,,-y/GGHQ"+!!&&- #G #**<"=A #G #**<"=A #G #**<"=G")*<"=G")*<"=##,,	A #G #**<"=))A #G #**<"=Gh] h$|7L7L2M hRZ[^R_ h h
 (s (%d<+@+@&AB( (%-c]( ( (c ($T,*?*?%@A(($,SM( (  C  M    rD   r   c                      e Zd ZdZddddee   dee   ddfdZedee   fd       Z	e	j                  dee   ddfd	       Z	edee   fd
       Zej                  de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)Diffz
    Our internal representation of the `diffType` complex type.

    .. note::
        See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_diffType
    Ntextr:   r   r:   r>   c                     || _         || _        y r@   r   )rA   r   r:   s      rB   rC   zDiff.__init__Y  s    
 	rD   c                     | j                   S )zz
        Specifies the optional text of the diff.

        Returns:
            `AttachedText` if set else `None`
        _textrH   s    rB   r   z	Diff.texta       zzrD   c                     || _         y r@   r   rA   r   s     rB   r   z	Diff.textk  	    
rD   c                     | j                   S )zi
        Specifies the URL to the diff.

        Returns:
            `XsUri` if set else `None`
        rL   rH   s    rB   r:   zDiff.urlo       yyrD   c                     || _         y r@   rL   rO   s     rB   r:   zDiff.urly  rJ   rD   c                 D    t        | j                  | j                  f      S r@   )rd   r:   r   rH   s    rB   re   zDiff.__comparable_tuple}  s"    HHII!
  	rD   rf   c                 f    t        |t              r!| j                         |j                         k(  S yrh   )ri   r   _Diff__comparable_tuplerk   s     rB   rl   zDiff.__eq__  ,    eT"**,0H0H0JJJrD   c                 p    t        |t              r!| j                         |j                         k  S t        S r@   )ri   r   r   rn   rk   s     rB   ro   zDiff.__lt__  /    eT"**,u/G/G/IIIrD   c                 4    t        | j                               S r@   )rq   r   rH   s    rB   rr   zDiff.__hash__  rs   rD   c                 "    d| j                    dS )Nz
<Diff url=ru   )r:   rH   s    rB   rv   zDiff.__repr__  s    DHH:Q''rD   )rw   rx   ry   rz   r   r!   r'   rC   r|   r   r   r:   rd   r   r   r   rl   r   ro   r   rr   r{   rv   r   rD   rB   r   r   P  s    (,#|$ e_ 
	 h|,   
[[,/ D   Xe_   	ZZx 4  $4 F t 
C D 
/# /(# (rD   r   c                        e Zd ZdZdZdZdZdZy)PatchClassificationz
    Enum object that defines the permissible `patchClassification`s.

    .. note::
        See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_patchClassification
    backportzcherry-pickmonkey
unofficialN)rw   rx   ry   rz   BACKPORTCHERRY_PICKMONKEY
UNOFFICIALr   rD   rB   r   r     s     HKFJrD   r   c            	          e Zd ZdZddddedee   deee      ddfdZ	e
 ej                         defd	              Zej                  deddfd
       Ze
dee   fd       Zej                  dee   ddfd       Ze
 ej                   ej"                  j$                  d      dd              Zej                  de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)Patchz
    Our internal representation of the `patchType` complex type.

    .. note::
        See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_patchType
    N)diffresolvesr   r   r   r>   c                6    || _         || _        |xs g | _        y r@   )r   r   r   )rA   r   r   r   s       rB   rC   zPatch.__init__  s     		 BrD   c                     | j                   S )z
        Specifies the purpose for the patch including the resolution of defects, security issues, or new behavior or
        functionality.

        Returns:
            `PatchClassification`
        _typerH   s    rB   r   z
Patch.type       zzrD   c                     || _         y r@   r   rA   r   s     rB   r   z
Patch.type  r   rD   c                     | j                   S )z
        The patch file (or diff) that show changes.

        .. note::
            Refer to https://en.wikipedia.org/wiki/Diff.

        Returns:
            `Diff` if set else `None`
        _diffrH   s    rB   r   z
Patch.diff  s     zzrD   c                     || _         y r@   r   )rA   r   s     rB   r   z
Patch.diff  r   rD   issuec                     | j                   S )zr
        Optional list of issues resolved by this patch.

        Returns:
            Set of `IssueType`
        )	_resolvesrH   s    rB   r   zPatch.resolves  s     ~~rD   c                 $    t        |      | _        y r@   )r   r   )rA   r   s     rB   r   zPatch.resolves      "8,rD   c                 l    t        | j                  | j                  t        | j                        f      S r@   )rd   r   r   r   rH   s    rB   re   zPatch.__comparable_tuple  s-    IItyyT]]+!
  	rD   rf   c                 f    t        |t              r!| j                         |j                         k(  S yrh   )ri   r   _Patch__comparable_tuplerk   s     rB   rl   zPatch.__eq__  s,    eU#**,0H0H0JJJrD   c                 p    t        |t              r!| j                         |j                         k  S t        S r@   )ri   r   r  rn   rk   s     rB   ro   zPatch.__lt__  s/    eU#**,u/G/G/IIIrD   c                 4    t        | j                               S r@   )rq   r  rH   s    rB   rr   zPatch.__hash__  rs   rD   c                 :    d| j                    dt        |        dS )Nz<Patch type=z, id=ru   )r   idrH   s    rB   rv   zPatch.__repr__  s    dii[bhZq99rD   )r>   zSortedSet[IssueType])rw   rx   ry   rz   r   r   r   r   r0   rC   r|   r}   xml_attributer   r   r   	xml_arrayXmlArraySerializationTypeNESTEDr   rd   r  r   r   rl   r   ro   r   rr   r{   rv   r   rD   rB   r   r     s     $26	'!' tn' 8I./	'
 
' \!)  "  
[[,    
htn 
 
 
[[$ D   \LBBII7S T  __-)!4 - - -$4 F t 
C D 
/# /:# :rD   r   c                      e Zd ZdZddddddddeed      deed      deed      deee      d	eee      d
ee   ddfdZ	e
 ej                  ej                  j                  d       ej                  d      d(d                     Zej"                  ded   ddfd       Ze
 ej                  ej                  j                  d       ej                  d      d(d                     Zej"                  ded   ddfd       Ze
 ej                  ej                  j                  d       ej                  d      d(d                     Zej"                  ded   ddfd       Ze
 ej                  ej                  j                  d       ej                  d      d)d                     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j                  j                  d       ej                  d      d*d                                                               Zej"                  d	ee   ddfd       Ze
 ej                  d      dee   fd               Zej"                  d
e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)+Pedigreea8  
    Our internal representation of the `pedigreeType` complex type.

    Component pedigree is a way to document complex supply chain scenarios where components are created, distributed,
    modified, redistributed, combined with other components, etc. Pedigree supports viewing this complex chain from the
    beginning, the end, or anywhere in the middle. It also provides a way to document variants where the exact relation
    may not be known.

    .. note::
        See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_pedigreeType
    N	ancestorsdescendantsvariantscommitspatchesnotesr  	Componentr  r  r  r  r  r>   c                    |xs g | _         |xs g | _        |xs g | _        |xs g | _        |xs g | _        || _        y r@   r  )rA   r  r  r  r  r  r  s          rB   rC   zPedigree.__init__
  sD     #b&," B}"}"
rD   	componentr    c                     | j                   S )ao  
        Describes zero or more components in which a component is derived from. This is commonly used to describe forks
        from existing projects where the forked version contains a ancestor node containing the original component it
        was forked from.

        For example, Component A is the original component. Component B is the component being used and documented in
        the BOM. However, Component B contains a pedigree node with a single ancestor documenting Component A - the
        original component from which Component B is derived from.

        Returns:
            Set of `Component`
        )
_ancestorsrH   s    rB   r  zPedigree.ancestors  s      rD   c                 $    t        |      | _        y r@   )r   r  )rA   r  s     rB   r  zPedigree.ancestors,  s    #I.rD   r   c                     | j                   S )z
        Descendants are the exact opposite of ancestors. This provides a way to document all forks (and their forks) of
        an original or root component.

        Returns:
            Set of `Component`
        )_descendantsrH   s    rB   r  zPedigree.descendants0  s        rD   c                 $    t        |      | _        y r@   )r   r  )rA   r  s     rB   r  zPedigree.descendants=      %k2rD   r	   c                     | j                   S )ae  
        Variants describe relations where the relationship between the components are not known. For example, if
        Component A contains nearly identical code to Component B. They are both related, but it is unclear if one is
        derived from the other, or if they share a common ancestor.

        Returns:
            Set of `Component`
        )	_variantsrH   s    rB   r  zPedigree.variantsA  s     ~~rD   c                 $    t        |      | _        y r@   )r   r"  )rA   r  s     rB   r  zPedigree.variantsO  r  rD   commitrW   c                     | j                   S )z
        A list of zero or more commits which provide a trail describing how the component deviates from an ancestor,
        descendant, or variant.

        Returns:
            Set of `Commit`
        )_commitsrH   s    rB   r  zPedigree.commitsS  s     }}rD   c                 $    t        |      | _        y r@   )r   r&  )rA   r  s     rB   r  zPedigree.commits`      !'*rD   patchr]   c                     | j                   S )a  
        A list of zero or more patches describing how the component deviates from an ancestor, descendant, or variant.
        Patches may be complimentary to commits or may be used in place of commits.

        Returns:
            Set of `Patch`
        )_patchesrH   s    rB   r  zPedigree.patchesd      " }}rD   c                 $    t        |      | _        y r@   )r   r+  )rA   r  s     rB   r  zPedigree.patchesw  r(  rD      c                     | j                   S )z
        Notes, observations, and other non-structured commentary describing the components pedigree.

        Returns:
            `str` if set else `None`
        _notesrH   s    rB   r  zPedigree.notes{       {{rD   c                     || _         y r@   r0  )rA   r  s     rB   r  zPedigree.notes  	    rD   c           	          t        t        | j                        t        | j                        t        | j                        t        | j                        t        | j
                        | j                  f      S r@   )rd   r  r  r  r  r  r  rH   s    rB   re   zPedigree.__comparable_tuple  sY    T^^,T--.T]]+T\\*T\\*JJ!
  	rD   rf   c                 f    t        |t              r!| j                         |j                         k(  S yrh   )ri   r  _Pedigree__comparable_tuplerk   s     rB   rl   zPedigree.__eq__  s,    eX&**,0H0H0JJJrD   c                 p    t        |t              r!| j                         |j                         k  S t        S r@   )ri   r  r7  rn   rk   s     rB   ro   zPedigree.__lt__  s/    eX&**,u/G/G/IIIrD   c                 4    t        | j                               S r@   )rq   r7  rH   s    rB   rr   zPedigree.__hash__  rs   rD   c                 8    dt        |        dt        |        dS )Nz<Pedigree id=z, hash=ru   )r	  rq   rH   s    rB   rv   zPedigree.__repr__  s    r$xjT
|1==rD   r>   zSortedSet['Component'])r>   zSortedSet[Commit])r>   zSortedSet[Patch])'rw   rx   ry   rz   r   r   r7   r   r{   rC   r|   r}   r  r  r  r~   r  r   r  r  r  r   r   r   r   r   r   r   r  r  rd   r7  r   r   rl   ro   r   rr   rv   r   rD   rB   r  r    s!   
 6:7;48.2-1#H[12 h{34 8K01	
 (6*+ (5/* } 
  \LBBII;W\q! " X  /8K#8 /T / / \LBBII;W\q!! " X ! 3x'< 3 3 3 \LBBII;W\q!	 " X 	 __-+!6 -4 - - \LBBII8T\q! " U  ^^+x/ +D + + \)*\)*\)*\)*\)*\)*\LBBII7S\q! " T + + + + + +  ^^+x +4 + + \q!x}  "  \\8C= T  $4 F t 
F t 
/# /># >rD   r  c                      e Zd ZdZdddddddededee   dee   dee   d	ee   d
e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                         defd              Zej                  deddfd       Ze ej                         dee   fd              Zej                  dee   ddfd       Ze ej                         dee   fd              Zej                  dee   ddfd       Ze ej                         dee   fd              Zej                  dee   ddfd       Zedee   fd       Zej                  d	ee   ddfd       Zedee	   fd       Zej                  d
e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)!Swidz
    Our internal representation of the `swidType` complex type.

    .. note::
        See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_swidType
    N)versiontag_versionr)  r   r:   tag_idnamer>  r?  r)  r   r:   r>   c                f    || _         || _        || _        || _        || _        || _        || _        y r@   )r@  rA  r>  r?  r)  r   r:   )rA   r@  rA  r>  r?  r)  r   r:   s           rB   rC   zSwid.__init__  s6     	&
	rD   c                     | j                   S )z^
        Maps to the tagId of a SoftwareIdentity.

        Returns:
            `str`
        _tag_idrH   s    rB   r@  zSwid.tag_id  rS   rD   c                     || _         y r@   rD  )rA   r@  s     rB   r@  zSwid.tag_id  rV   rD   c                     | j                   S )z^
        Maps to the name of a SoftwareIdentity.

        Returns:
             `str`
        _namerH   s    rB   rA  z	Swid.name  s     zzrD   c                     || _         y r@   rH  rA   rA  s     rB   rA  z	Swid.name  r   rD   c                     | j                   S )zu
        Maps to the version of a SoftwareIdentity.

        Returns:
             `str` if set else `None`.
        _versionrH   s    rB   r>  zSwid.version  s     }}rD   c                     || _         y r@   rM  rA   r>  s     rB   r>  zSwid.version  rb   rD   c                     | j                   S )zv
        Maps to the tagVersion of a SoftwareIdentity.

        Returns:
            `int` if set else `None`
        _tag_versionrH   s    rB   r?  zSwid.tag_version  s        rD   c                     || _         y r@   rR  )rA   r?  s     rB   r?  zSwid.tag_version  
    'rD   c                     | j                   S )zs
        Maps to the patch of a SoftwareIdentity.

        Returns:
             `bool` if set else `None`
        _patchrH   s    rB   r)  z
Swid.patch  r2  rD   c                     || _         y r@   rW  )rA   r)  s     rB   r)  z
Swid.patch  r4  rD   c                     | j                   S )z}
        Specifies the full content of the SWID tag.

        Returns:
            `AttachedText` if set else `None`
        r   rH   s    rB   r   z	Swid.text  r   rD   c                     || _         y r@   r   r   s     rB   r   z	Swid.text  r   rD   c                     | j                   S )zd
        The URL to the SWID file.

        Returns:
            `XsUri` if set else `None`
        rL   rH   s    rB   r:   zSwid.url  r   rD   c                     || _         y r@   rL   rO   s     rB   r:   zSwid.url#  rJ   rD   c           	          t        | j                  | j                  | j                  | j                  | j
                  | j                  | j                  f      S r@   )rd   r@  rA  r>  r?  r)  r:   r   rH   s    rB   re   zSwid.__comparable_tuple'  sF    KKIIt||JJHHII!
  	rD   rf   c                 f    t        |t              r!| j                         |j                         k(  S yrh   )ri   r=  _Swid__comparable_tuplerk   s     rB   rl   zSwid.__eq__1  r   rD   c                 p    t        |t              r!| j                         |j                         k  S t        S r@   )ri   r=  r`  rn   rk   s     rB   ro   zSwid.__lt__6  r   rD   c                 4    t        | j                               S r@   )rq   r`  rH   s    rB   rr   zSwid.__hash__;  rs   rD   c                 V    d| j                    d| j                   d| j                   dS )Nz<Swid tagId=, name=
, version=ru   )r@  rA  r>  rH   s    rB   rv   zSwid.__repr__>  s*    dkk]'$))Jt||nTUVVrD   )rw   rx   ry   rz   r{   r   r   r   r!   r'   rC   r|   r}   r
  r@  r   rA  r>  r?  r)  r   r:   rd   r`  r   rl   ro   rr   rv   r   rD   rB   r=  r=    s    "&%) $'+#  #	
 c] ~ |$ e_ 
$ \!  "  ]]S T   \!c  "  
[[    \!#  "  ^^ x}       \!!Xc] ! " ! (x} ( ( ( \!x~  "  \\8D> d   h|,   
[[,/ D   Xe_   	ZZx 4  $4 F t 
F t 
/# /W# WrD   r=  c                   &   e Zd ZdZ ej
                  d      ZdeddfdZe	 e
j                  d       e
j                  d      defd                     Zed	edefd
       Zed	edd 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defdZy)	OmniborIdz
    Helper class that allows us to perform validation on data strings that must conform to
    https://www.iana.org/assignments/uri-schemes/prov/gitoid.

    z6^gitoid:(blob|tree|commit|tag):sha(1|256):([a-z0-9]+)$r	  r>   Nc                 n    t         j                  j                  |      t        d| d      || _        y NzSupplied value "z$ does not meet format specification.)rg  _VALID_OMNIBOR_ID_REGEXmatchr   _idrA   r	  s     rB   rC   zOmniborId.__init__L  s<    ,,2226>+"2$&JK  rD   .c                     | j                   S r@   rl  rH   s    rB   r	  zOmniborId.idS       xxrD   r   c                 T    t        |t              rt        |      S t        d|      )Nz&Attempt to serialize a non-OmniBorId: )ri   rg  r{   r   r   s     rB   	serializezOmniborId.serializeY  s,    a#q6M54QE:< 	<rD   c                 n    	 t        t        |            S # t        $ r}t        d|      |d }~ww xY w)Nr	  z*OmniBorId string supplied does not parse: )rg  r{   
ValueErrorr   r   r   errs      rB   r   zOmniborId.deserialize`  s@    	A'' 	3<QEB	    	4/4rf   c                 V    t        |t              r| j                  |j                  k(  S yrh   )ri   rg  rl  rk   s     rB   rl   zOmniborId.__eq__i  s"    eY'88uyy((rD   c                 `    t        |t              r| j                  |j                  k  S t        S r@   )ri   rg  rl  rn   rk   s     rB   ro   zOmniborId.__lt__n  s%    eY'88eii''rD   c                 ,    t        | j                        S r@   rq   rl  rH   s    rB   rr   zOmniborId.__hash__s      DHH~rD   c                 "    d| j                    dS )Nz<OmniBorId ru   rp  rH   s    rB   rv   zOmniborId.__repr__v  s    TXXJa((rD   c                     | j                   S r@   rp  rH   s    rB   __str__zOmniborId.__str__y      xxrD   )rw   rx   ry   rz   recompilerj  r{   rC   r|   r}   	json_namexml_namer	  r   r   rs  r   r   rl   ro   r   rr   rv   r  r   rD   rB   rg  rg  B  s    )bjj)bc3 4  \C \3C    !  <# <# < < C K  C D 
C D 
# )# ) rD   rg  c                   &   e Zd ZdZ ej
                  d      ZdeddfdZe	 e
j                  d       e
j                  d      defd                     Zed	edefd
       Zed	edd 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defdZy)Swhidz
    Helper class that allows us to perform validation on data strings that must conform to
    https://docs.softwareheritage.org/devel/swh-model/persistent-identifiers.html.

    z1^swh:1:(cnp|rel|rev|dir|cnt):([0-9a-z]{40})(.*)?$r	  r>   Nc                 n    t         j                  j                  |      t        d| d      || _        y ri  )r  _VALID_SWHID_REGEXrk  r   rl  rm  s     rB   rC   zSwhid.__init__  s<    ##))"-5'"2$&JK  rD   rn  c                     | j                   S r@   rp  rH   s    rB   r	  zSwhid.id  rq  rD   r   c                 T    t        |t              rt        |      S t        d|      )Nz"Attempt to serialize a non-Swhid: )ri   r  r{   r   r   s     rB   rs  zSwhid.serialize  s,    aq6M5068 	8rD   c                 n    	 t        t        |            S # t        $ r}t        d|      |d }~ww xY w)Nru  z&Swhid string supplied does not parse: )r  r{   rv  r   rw  s      rB   r   zSwhid.deserialize  s@    	CF## 	38>	ry  rf   c                 V    t        |t              r| j                  |j                  k(  S yrh   )ri   r  rl  rk   s     rB   rl   zSwhid.__eq__  s"    eU#88uyy((rD   c                 `    t        |t              r| j                  |j                  k  S t        S r@   )ri   r  rl  rn   rk   s     rB   ro   zSwhid.__lt__  s%    eU#88eii''rD   c                 ,    t        | j                        S r@   r}  rH   s    rB   rr   zSwhid.__hash__  r~  rD   c                 "    d| j                    dS )Nz<Swhid ru   rp  rH   s    rB   rv   zSwhid.__repr__  s    
!$$rD   c                     | j                   S r@   rp  rH   s    rB   r  zSwhid.__str__  r  rD   )rw   rx   ry   rz   r  r  r  r{   rC   r|   r}   r  r  r	  r   r   rs  r   r   rl   ro   r   rr   rv   r  r   rD   rB   r  r  }  s    $$XY3 4  \C \3C    !  8# 8# 8 8 C G  C D 
C D 
# %# % rD   r  c            ?       ,#   e Zd ZdZe ed      dedee   dd fd              Ze	j                  ddddddddddddddddddddddddddddd	d
ede	dee   deeeef      dee   dee   dee   d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e      dee   dee   dee   dee   deed       dee   d ed!ee   d"eee      d#eee      d$eee      d%ee   d&eee      d'ee   ddf>d(Ze e jB                  e"       e jF                         de	fd)                     Z$e$jJ                  de	ddfd*       Z$e e jL                  e jN                  jP                        dee   fd+              Z)e)jJ                  dee   ddfd,       Z)e e jT                  d-       e jB                  e       e jV                  e,       e jV                  e-       e jV                  e.       e jV                  e/       e jV                  e0       e jV                  e1       e jV                  e2       e jF                          e jf                  d-      defd.                                                                                    Z4e e jV                  e-       e jV                  e.       e jV                  e/       e jV                  e0       e jV                  e1       e jV                  e2       e jj                  d/      dee   fd0                                                        Z6e6jJ                  dee   ddfd1       Z6e e jV                  e1       e jV                  e2       e jj                  d2      dee   fd3                            Z7e7jJ                  d!ee   ddfd4       Z7e e jV                  e1       e jV                  e2       e jp                  e jr                  jt                  d'       e jj                  d5      dd6                                   Z;e;jJ                  d"ee   ddfd7       Z;e e jV                  e-       e jV                  e.       e jV                  e/       e jV                  e0       e jV                  e1       e jV                  e2       e jj                  d8       e jL                  e jN                  jx                        dee   fd9                                                               Z=e=jJ                  d'ee   ddfd:       Z=e e jj                  d;       e jL                  e jN                  jx                        dee   fd<                     Z>e>jJ                  dee   ddfd=       Z>e e jj                  d>       e jL                  e jN                  jx                        dee   fd?                     Z?e?jJ                  dee   ddfd@       Z?e e jj                  dA       e jL                  e jN                  jx                        defdB                     Z@e@jJ                  d
eddfdC       Z@e e j                  eBdD       e j                  e,dD       e j                  e-dD       e j                  e.dD       e jj                  dE       e jL                  e jN                  jx                        dee   fdF                                                 ZCeCjJ                  dee   ddfdG       ZCe e jj                  dH       e jL                  e jN                  jx                        dee   fdI                     ZDeDjJ                  dee   ddfdJ       ZDe e jB                  eE       e jj                  dK      dee   fdL                     ZFeFjJ                  dee   ddfdM       ZFe e jB                  eG       e jj                  dN      ddO                     ZHeHjJ                  dee   ddfdP       ZHe e jV                  e,       e jV                  e-       e jV                  e.       e jV                  e/       e jV                  e0       e jV                  e1       e jV                  e2       e jB                  eI       e jj                  dQ      deJfdR                                                                      ZKeKjJ                  dee   ddfdS       ZKe e jj                  dT       e jL                  e jN                  jx                        dee   fdU                     ZLeLjJ                  dee   ddfdV       ZLe e jj                  dW      dee   fdX              ZMeMjJ                  dee   ddfdY       ZMe e jB                  eN       e jj                  dZ      dee   fd[                     ZOeOjJ                  dee   ddfd\       ZOe e jT                  d]       e jV                  e1       e jV                  e2       e jp                  e jr                  j                  d]^       e jj                  d_      dd`                                          ZQeQjJ                  d#ee   ddfda       ZQe e jT                  db       e jV                  e1       e jV                  e2       e jp                  e jr                  j                  db^       e jj                  dc      ddd                                          ZReRjJ                  d$ee   ddfde       ZRe e jV                  e-       e jV                  e.       e jV                  e/       e jV                  e0       e jV                  e1       e jV                  e2       e jj                  df      dee   fdg                                                        ZSeSjJ                  dee   ddfdh       ZSe e jV                  eB       e jj                  di      defdj                     ZTeTjJ                  d eddfdk       ZTe e jV                  e,       e jV                  e-       e jV                  e.       e jV                  e/       e jV                  e0       e jV                  e1       e jV                  e2       e jj                  dl      dee   fdm                                                               ZUeUjJ                  dee   ddfdn       ZUe e jV                  e,       e jV                  e-       e jV                  e.       e jV                  e/       e jV                  e0       e jV                  e1       e jV                  e2       e jp                  e jr                  jt                  do       e jj                  dp      ddq                                                                      ZVeVjJ                  dee   ddfdr       ZVe e jV                  e.       e jV                  e/       e jV                  e0       e jV                  e1       e jV                  e2       e jp                  e jr                  jt                  ds       e jj                  dt      ddu                                                        ZWeWjJ                  dee   ddfdv       ZWe e jp                  e jr                  jt                  dw       e jj                  dx      ddy                     ZXeXjJ                  ded    ddfdz       ZXe e jV                  e.       e jV                  e/       e jV                  e0       e jV                  e1       e jV                  e2       e jj                  d{       e jB                  eY      dee   fd|                                                        ZZeZjJ                  dee   ddfd}       ZZe e jV                  e/       e jV                  e0       e jV                  e1       e jV                  e2       e jj                  d~      dee   fd                                          Z[e[jJ                  dee   ddfd       Z[e e jV                  e1       e jV                  e2       e jj                  d      dee   fd                            Z\e\jJ                  d%ee   ddfd       Z\e e jV                  e1       e jV                  e2       e jp                  e jr                  jt                  d       e jj                  d      dd                                   Z]e]jJ                  d&ee   ddfd       Z]ddede^d    fdZ_defdZ`deafdZbdecdefdZddeedefdZfdegfdZhdefdZiy)r  z
    This is our internal representation of a Component within a Bom.

    .. note::
        See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_component
    z`Deprecated - use cyclonedx.contrib.component.builders.ComponentBuilder().make_for_file() insteadabsolute_file_pathpath_for_bomr>   c                     ddl m}  |       j                  | |      }t        d |j                  D        d      }|J d|dd  |_        t        d	|r|n| d|dd  
      |_        |S )uW  Deprecated — Wrapper of :func:`cyclonedx.contrib.component.builders.ComponentBuilder.make_for_file`.

        Helper method to create a Component that represents the provided local file as a Component.

        .. deprecated:: next
            Use ``cyclonedx.contrib.component.builders.ComponentBuilder().make_for_file()`` instead.
        r   )ComponentBuilder)rA  c              3   n   K   | ]-  }|j                   t        j                  u s |j                   / y wr@   )algr#   SHA_1content).0hs     rB   	<genexpr>z%Component.for_file.<locals>.<genexpr>  s%     ^-J]J]A]!))^s   !55Nz0.0.0-r      generic)r   rA  r>  )contrib.component.buildersr  make_for_filenexthashesr>  r   purl)r  r  r  r  	sha1_hashs        rB   for_filezComponent.for_file  s     	B$&445Gl4[	^Y-=-=^`de	$$$$Yq_$56	#CUYq_-.
	 rD   NF)r   	mime_typebom_refsupplier	publishergroupr>  descriptionscoper  licenses	copyrightr  external_references
propertiesrelease_notescpeswidpedigree
componentsevidencemodifiedmanufacturerauthorsomnibor_idsswhidscrypto_propertiestagsr;   rA  r   r  r  r  r  r  r>  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r;   c                   || _         || _        t        |      | _        || _        || _        |xs g | _        || _        || _        || _	        |	| _
        |
| _        |xs g | _        |xs g | _        || _        || _        || _        |xs g | _        |xs g | _        || _        || _        |xs g | _        |xs g | _        |xs g | _        || _        || _        || _        |xs g | _        || _        || _        || _        y r@   )r   r  _bom_ref_from_str_bom_refr  r  r  r  r  rA  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r;   r  r>  )rA   rA  r   r  r  r  r  r  r>  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r;   s                                  rB   rC   zComponent.__init__  s
   D 	")'2 (}""
	&
l B"	&,"l	 #6#<" $*$* *!2JB	 rD   c                     | j                   S )z
        Get the type of this Component.

        Returns:
            Declared type of this Component as `ComponentType`.
        r   rH   s    rB   r   zComponent.type  r   rD   c                     || _         y r@   r   r   s     rB   r   zComponent.type%  r   rD   c                     | j                   S )aw  
        Get any declared mime-type for this Component.

        When used on file components, the mime-type can provide additional context about the kind of file being
        represented such as an image, font, or executable. Some library or framework components may also have an
        associated mime-type.

        Returns:
            `str` if set else `None`
        
_mime_typerH   s    rB   r  zComponent.mime_type)  s     rD   c                     || _         y r@   r  )rA   r  s     rB   r  zComponent.mime_type8  r\   rD   zbom-refc                     | j                   S )z
        An optional identifier which can be used to reference the component elsewhere in the BOM. Every bom-ref MUST be
        unique within the BOM.

        Returns:
            `BomRef`
        )r  rH   s    rB   r  zComponent.bom_ref<  s    ( }}rD   r    c                     | j                   S )z
        The organization that supplied the component. The supplier may often be the manufacture, but may also be a
        distributor or repackager.

        Returns:
            `OrganizationalEntity` if set else `None`
        	_supplierrH   s    rB   r  zComponent.supplierR  s      ~~rD   c                     || _         y r@   r  )rA   r  s     rB   r  zComponent.supplierd  	    !rD   r   c                     | j                   S )a&  
        The organization that created the component.
        Manufacturer is common in components created through automated processes.
        Components created through manual means may have `@.authors` instead.

        Returns:
            `OrganizationalEntity` if set else `None`
        _manufacturerrH   s    rB   r  zComponent.manufacturerh  s     !!!rD   c                     || _         y r@   r  )rA   r  s     rB   r  zComponent.manufacturerw  s
    )rD   r	   c                     | j                   S )a.  
        The person(s) who created the component.
        Authors are common in components created through manual processes.
        Components created through automated means may have `@.manufacturer` instead.

        Returns:
            `Iterable[OrganizationalContact]` if set else `None`
        )_authorsrH   s    rB   r  zComponent.authors{  s     }}rD   c                 $    t        |      | _        y r@   )r   r  )rA   r  s     rB   r  zComponent.authors  r(  rD   rW   c                     | j                   S )z
        The person(s) or organization(s) that authored the component.

        Returns:
            `str` if set else `None`
        rQ   rH   s    rB   r;   zComponent.author  s      ||rD   c                 6    |t        dt               || _        y )Nzi`@.author` is deprecated from CycloneDX v1.6 onwards. Please use `@.authors` or `@.manufacturer` instead.)r   DeprecationWarningrR   rU   s     rB   r;   zComponent.author  s!     GHZ\rD   r]   c                     | j                   S )z
        The person(s) or organization(s) that published the component

        Returns:
            `str` if set else `None`
        
_publisherrH   s    rB   r  zComponent.publisher  s     rD   c                     || _         y r@   r  )rA   r  s     rB   r  zComponent.publisher  r\   rD   r.  c                     | j                   S )a  
        The grouping name or identifier. This will often be a shortened, single name of the company or project that
        produced the component, or the source package or domain name. Whitespace and special characters should be
        avoided.

        Examples include: `apache`, `org.apache.commons`, and `apache.org`.

        Returns:
            `str` if set else `None`
        _grouprH   s    rB   r  zComponent.group  s     {{rD   c                     || _         y r@   r  )rA   r  s     rB   r  zComponent.group  r4  rD      c                     | j                   S )z
        The name of the component.

        This will often be a shortened, single name of the component.

        Examples: `commons-lang3` and `jquery`.

        Returns:
            `str`
        rH  rH   s    rB   rA  zComponent.name  s     zzrD   c                     || _         y r@   rH  rK  s     rB   rA  zComponent.name  r   rD       c                     | j                   S )a}  
        The component version. The version should ideally comply with semantic versioning but is not enforced.

        This is NOT optional for CycloneDX Schema Version < 1.4 but was agreed to default to an empty string where a
        version was not supplied for schema versions < 1.4

        Returns:
            Declared version of this Component as `str` or `None`
        rM  rH   s    rB   r>  zComponent.version  r,  rD   c                 R    |rt        |      dkD  rt        dt               || _        y )Ni   zD`@.version`has a maximum length of 1024 from CycloneDX v1.6 onwards.)lenr   UserWarningrN  rP  s     rB   r>  zComponent.version  s#    s7|d*WYderD   	   c                     | j                   S )zq
        Get the description of this Component.

        Returns:
            `str` if set, else `None`.
        _descriptionrH   s    rB   r  zComponent.description  s        rD   c                     || _         y r@   r  )rA   r  s     rB   r  zComponent.description  rU  rD   
   c                     | j                   S )z
        Specifies the scope of the component.

        If scope is not specified, 'required' scope should be assumed by the consumer of the BOM.

        Returns:
            `ComponentScope` or `None`
        _scoperH   s    rB   r  zComponent.scope	  s     {{rD   c                     || _         y r@   r  )rA   r  s     rB   r  zComponent.scope  r4  rD      c                     | j                   S )z
        Optional list of hashes that help specify the integrity of this Component.

        Returns:
             Set of `HashType`
        )_hashesrH   s    rB   r  zComponent.hashes  s     ||rD   c                 $    t        |      | _        y r@   )r   r  )rA   r  s     rB   r  zComponent.hashes'       (rD   r  c                     | j                   S )z
        A optional list of statements about how this Component is licensed.

        Returns:
            Set of `LicenseChoice`
        )	_licensesrH   s    rB   r  zComponent.licenses+      " ~~rD   c                 $    t        |      | _        y r@   )r2   r  )rA   r  s     rB   r  zComponent.licenses>  s    *84rD   r
   c                     | j                   S )z
        An optional copyright notice informing users of the underlying claims to copyright ownership in a published
        work.

        Returns:
            `str` or `None`
        
_copyrightrH   s    rB   r  zComponent.copyrightB  s     rD   c                     || _         y r@   r  )rA   r  s     rB   r  zComponent.copyrightO  r\   rD      c                     | j                   S )z
        Specifies a well-formed CPE name that conforms to the CPE 2.2 or 2.3 specification.
        See https://nvd.nist.gov/products/cpe

        Returns:
            `str` if set else `None`
        _cperH   s    rB   r  zComponent.cpeS  s     yyrD   c                     || _         y r@   r  )rA   r  s     rB   r  zComponent.cpe_  rJ   rD      c                     | j                   S )z
        Specifies the package-url (PURL).

        The purl, if specified, must be valid and conform to the specification defined at:
        https://github.com/package-url/purl-spec

        Returns:
            `PackageURL` or `None`
        _purlrH   s    rB   r  zComponent.purlc       zzrD   c                     || _         y r@   r  )rA   r  s     rB   r  zComponent.purlr  r   rD   	omniborId)
child_name   c                     | j                   S )a  
        Specifies the OmniBOR Artifact ID. The OmniBOR, if specified, MUST be valid and conform to the specification
        defined at: https://www.iana.org/assignments/uri-schemes/prov/gitoid

        Returns:
            `Iterable[str]` or `None`
        )_omnibor_idsrH   s    rB   r  zComponent.omnibor_idsv  s        rD   c                 $    t        |      | _        y r@   )r   r  )rA   r  s     rB   r  zComponent.omnibor_ids  r   rD   swhid   c                     | j                   S )aE  
        Specifies the Software Heritage persistent identifier (SWHID). The SWHID, if specified, MUST be valid and
        conform to the specification defined at:
        https://docs.softwareheritage.org/devel/swh-model/persistent-identifiers.html

        Returns:
            `Iterable[Swhid]` if set else `None`
        )_swhidsrH   s    rB   r  zComponent.swhids  s     ||rD   c                 $    t        |      | _        y r@   )r   r  )rA   r  s     rB   r  zComponent.swhids  r  rD      c                     | j                   S )z
        Specifies metadata and content for ISO-IEC 19770-2 Software Identification (SWID) Tags.

        Returns:
            `Swid` if set else `None`
        _swidrH   s    rB   r  zComponent.swid  s     zzrD   c                     || _         y r@   r  )rA   r  s     rB   r  zComponent.swid  r   rD      c                     | j                   S r@   )	_modifiedrH   s    rB   r  zComponent.modified  s     ~~rD   c                 6    |rt        dt               || _        y )NzX`@.modified` is deprecated from CycloneDX v1.3 onwards. Please use `@.pedigree` instead.)r   r  r  )rA   r  s     rB   r  zComponent.modified  s     45GI!rD      c                     | j                   S )a  
        Component pedigree is a way to document complex supply chain scenarios where components are created,
        distributed, modified, redistributed, combined with other components, etc.

        Returns:
            `Pedigree` if set else `None`
        	_pedigreerH   s    rB   r  zComponent.pedigree  r  rD   c                     || _         y r@   r"  )rA   r  s     rB   r  zComponent.pedigree  r  rD   	reference   c                     | j                   S )z
        Provides the ability to document external references related to the component or to the project the component
        describes.

        Returns:
            Set of `ExternalReference`
        )_external_referencesrH   s    rB   r  zComponent.external_references  s    $ (((rD   c                 $    t        |      | _        y r@   )r   r(  )rA   r  s     rB   r  zComponent.external_references  s    $-.A$B!rD   r|      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.

        Return:
            Set of `Property`
        )_propertiesrH   s    rB   r  zComponent.properties  s      rD   c                 $    t        |      | _        y r@   )r   r,  )rA   r  s     rB   r  zComponent.properties      $Z0rD   r     c                     | j                   S )a^  
        A list of software and hardware components included in the parent component. This is not a dependency tree. It
        provides a way to specify a hierarchical representation of component assemblies, similar to system -> subsystem
        -> parts assembly in physical supply chains.

        Returns:
            Set of `Component`
        )_componentsrH   s    rB   r  zComponent.components  s     rD   c                 $    t        |      | _        y r@   )r   r1  )rA   r  s     rB   r  zComponent.components  r.  rD      c                     | j                   S )z
        Provides the ability to document evidence collected through various forms of extraction or analysis.

        Returns:
            `ComponentEvidence` if set else `None`
        	_evidencerH   s    rB   r  zComponent.evidence  s     ~~rD   c                     || _         y r@   r5  )rA   r  s     rB   r  zComponent.evidence*  r  rD      c                     | j                   S )zj
        Specifies optional release notes.

        Returns:
            `ReleaseNotes` or `None`
        _release_notesrH   s    rB   r  zComponent.release_notes.  s     """rD   c                     || _         y r@   r:  )rA   r  s     rB   r  zComponent.release_notes=  s
    +rD      c                     | j                   S )ae  
        Cryptographic assets have properties that uniquely define them and that make them actionable for further
        reasoning. As an example, it makes a difference if one knows the algorithm family (e.g. AES) or the specific
        variant or instantiation (e.g. AES-128-GCM). This is because the security level and the algorithm primitive
        (authenticated encryption) is only defined by the definition of the algorithm variant. The presence of a weak
        cryptographic algorithm like SHA1 vs. HMAC-SHA1 also makes a difference.

        Returns:
            `CryptoProperties` or `None`
        _crypto_propertiesrH   s    rB   r  zComponent.crypto_propertiesW  s     &&&rD   c                     || _         y r@   r?  )rA   r  s     rB   r  zComponent.crypto_propertiesh  s
    "3rD   tag   c                     | j                   S )a  
        Textual strings that aid in discovery, search, and retrieval of the associated object.
        Tags often serve as a way to group or categorize similar or related objects by various attributes.

        Returns:
            `Iterable[str]`
        )_tagsrH   s    rB   r  zComponent.tagsl  r
  rD   c                 $    t        |      | _        y r@   )r   rE  )rA   r  s     rB   r  zComponent.tags{  s    t_
rD   include_selfc                     t               }|r|j                  |        | j                  D ]#  }|j                  |j	                  d             % |S )NT)rG  )setaddr  updateget_all_nested_components)rA   rG  r  cs       rB   rL  z#Component.get_all_nested_components  sQ    U
NN4  	NAa99t9LM	N rD   c                 p    | j                   rd| j                   d| j                    S d| j                   S )Nzhttps://pypi.org/project//)r>  rA  rH   s    rB   get_pypi_urlzComponent.get_pypi_url  s5    <<.tyyk4<<.II.tyyk::rD   c           "         t        | j                  | j                  | j                  | j                  | j
                  j                  | j                  d nt        | j                        | j                  | j                  t        | j                        | j                  | j                  | j                  | j                  | j                   | j"                  t        | j$                        t        | j&                        | j(                  | j*                  t        | j,                        t        | j.                        t        | j0                        | j2                  | j4                  | j6                  t        | j8                        t        | j:                        | j<                  | j>                  t        | j@                        f      S r@   )!rd   r   r  rA  r>  r  r   r  _ComparablePackageURLr  r  r  r  r;   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  rH   s    rB   re   zComponent.__comparable_tuple  s.   IItzz499dllLLII%D+@+KIItxx!1$++!>MM4;;NNDJJ(8(ET]]+T^^MMT5568H8YT__-t}}d>P>PRVR_R_T\\*,<T=M=M,NPTPaPa""$4TYY$?!
  	rD   rf   c                 f    t        |t              r!| j                         |j                         k(  S yrh   )ri   r  _Component__comparable_tuplerk   s     rB   rl   zComponent.__eq__  s,    eY'**,0H0H0JJJrD   c                 p    t        |t              r!| j                         |j                         k  S t        S r@   )ri   r  rT  rn   rk   s     rB   ro   zComponent.__lt__  s/    eY'**,u/G/G/IIIrD   c                 4    t        | j                               S r@   )rq   rT  rH   s    rB   rr   zComponent.__hash__  rs   rD   c                     d| j                   d| j                   d| j                   d| j                   d| j                   dS )Nz<Component bom-ref=z, group=rd  re  z, type=ru   )r  r  rA  r>  r   rH   s    rB   rv   zComponent.__repr__  sJ    $T\\$4HTZZLPTPYPY{ [||nGDII;a9 	9rD   )r>   z SortedSet[OrganizationalContact])r>   zSortedSet[HashType])r>   zSortedSet[OmniborId])r>   zSortedSet[Swhid])r>   zSortedSet[ExternalReference])r>   zSortedSet[Property]r;  )r>   zSortedSet[str])F)jrw   rx   ry   rz   staticmethodr   r{   r   r  r   r   r   r)   r-   r   r   r$   r1   r   r"   r&   r4   r=  r  r*   r   r,   rg  r  r.   rC   r|   r}   type_mappingr   r
  r   r   r   r   TOKENr  r  r   r   r   r   r   r   r   r   r  r  r~   r  r  r  r  r  r  r   r;   r  r  rA  include_noner   r>  r  r   r  r(   r  r3   r2   r  r  r  PackageUrlSHr  FLATr  r  r  r  r  r  r  r  r+   r  r  r  r  rI  rL  rP  rd   rT  r   rl   r   ro   r   rr   rv   r   rD   rB   r  r    sT    rsS  +  t . ,33#'0437#'#!%%)*./304#'%)EI3704!#'+6:047;=A59,08<(, $A@@ @ C=	@
 %V,-@ /0@ C=@ }@ #@ c]@ '@ (+,@ 8G,-@ C=@ z"@  &h/@&AB!@" Xh/0#@$  -%@& c]'@( tn)@* 8$+@, Xk23-@. ,-/@0 1@2 343@4 (#89:5@6 hy127@8 %)9@: $$45;@< x}%=@@ A@B 
C@D \@A\!m  " B  
[[ 4   \\DDJJK8C=  L  $8C= $T $ $ \I&\v&\)*\)*\)*\)*\)*\)*\)*\!\9%  & " + + + + + + + ' '  \)*\)*\)*\)*\)*\)*\q!(#78  " + + + + + +  __"*>!? "D " " \)*\)*\q!	"h';< 	" " + + 	" *2F)G *D * * \)*\)*\LBBII8T\q!	 " U + + 
	 ^^+x(=> +4 + + \)*\)*\)*\)*\)*\)*\q!\\DDVVW  X " + + + + + +  ]]Xc] t   \q!\\DDVVW8C=  X "  $8C= $T $ $ \q!\\DDVVWx}  X "  \\8C= T   \q!\\DDVVWc  X "  
[[    \126\126\126\126\q!\\DDVVW
# 
 X " 7 7 7 7 
 ^^ x}      
 \q!\\DDVVW!Xc] ! X " ! (x} ( ( ( \AB\r"	x/ 	 # C 	 \\8N3    \EF\r" # G  ]])Xh/ )D ) ) \)*\)*\)*\)*\)*\)*\)*\DE\r"+  # F + + + + + + +  __5'!2 5t 5 5 \r"\\DDVVW8C=  X #  $8C= $T $ $ \r"Xc]  #  	ZZx}    \|,\r"
hz* 
 # - 
 
[[*- $   \K(\)*\)*\LBBGGT_`\r"	! # a + + ) 	! 3x	': 3t 3 3 \G$\)*\)*\LBBGGT[\\r"	 # ] + + % 	 ]])Xe_ ) ) ) \)*\)*\)*\)*\)*\)*\r"htn  # + + + + + +  
[[$ D   \)*\r"$  # +  __" "$ " " \)*\)*\)*\)*\)*\)*\)*\r"(8,  # + + + + + + +  __"(!3 " " " \)*\)*\)*\)*\)*\)*\)*\LBBII;W\r") # X + + + + + + + ) Cx@Q7R CW[ C  C \)*\)*\)*\)*\)*\LBBII:V\r"  # W + + + + +   1Xh%7 1D 1 1 \LBBII;W\r"	  # X 	  1Xk%: 1t 1 1 \)*\)*\)*\)*\)*\r"\DE(#45  F # + + + + +  __"*;!< " " " \)*\)*\)*\)*\r"#x5 # # + + + + # ,8L+A ,d , ,2 \)*\)*\r"'8,<#= ' # + + ' 48<L3M 4RV 4 4 \)*\)*\LBBII5Q\r" # R + + 
 
[[%# %4 % %d s;GW ;c ;$4 "F t 
C D 
/# /9# 9rD   r  )_r  syscollections.abcr   enumr   typingr   r   r   warningsr   version_infor   typing_extensionspy_serializabler}   
packageurlr   sortedcontainersr   _internal.bom_refr   r  _internal.comparer   rR  r   rd   exception.modelr   r   exception.serializationr   r   r   schema.schemar   r   r   r   r   r   r   r   serializationr   r\  r  r!   r"   r#   r$   r%   r&   r'   r(   r  r)   component_evidencer*   r+   contactr,   r-   cryptor.   
dependencyr/   r   r0   licenser1   r2   r3   release_noter4   serializable_classr7   serializable_enumr{   r   helpers
BaseHelperr   r   r   r   r   r   r  r=  rg  r  r  r   rD   rB   <module>rx     s  $ 
 
 $  ' ' w#, ' ! & E r N 
	 	 	 7	 	 	  X @ $ "  V V & !  tLyR yR MyRx 
S$ 
  
(!)=)=)H)H (!V C   .5 (<(<(G(G 5 p !  tL@( @( M@(F 
#t 
  
 !  tLV: V: MV:r !  tLe> e> Me>P !  tLYW YW MYWx !  tL7$$// 7 M7t !  tL7L  ++ 7 M7t !  tLv9
 v9 Mv9rD   