
    ܖi+4                     <   d dl mZ d dlmZmZ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mZ d	d
lmZ d	dlmZ  ej0                  d       G d d             Z ej0                  d       G d d             Z ej0                  d       G d d             Zy)    )Iterable)AnyOptionalUnionN)	SortedSet   )bom_ref_from_str)ComparableTuple)SchemaVersion1Dot5SchemaVersion1Dot6SchemaVersion1Dot7   )XsUri)BomRefT)%ignore_unknown_during_deserializationc                   Z   e Zd ZdZdddddddd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dfdZe	 e
j                  e       e
j                          e
j                  d       e
j                  d      de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      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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)'PostalAddressa  
    This is our internal representation of the `postalAddressType` complex type that can be used in multiple places
    within a CycloneDX BOM document.

    .. note::
        See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_postalAddressType
    N)bom_refcountryregionlocalitypost_office_box_numberpostal_codestreet_addressr   r   r   r   r   r   r   returnc                x    t        |      | _        || _        || _        || _        || _        || _        || _        y N)_bom_ref_from_str_bom_refr   r   r   r   r   r   )selfr   r   r   r   r   r   r   s           [/var/www/html/content-pipeline/venv/lib/python3.12/site-packages/cyclonedx/model/contact.py__init__zPostalAddress.__init__*   s=     *'2 &<#&,    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   r    s    r!   r   zPostalAddress.bom_ref<   s     }}r#   
   c                     | j                   S )z|
        The country name or the two-letter ISO 3166-1 country code.

        Returns:
             `str` or `None`
        _countryr(   s    r!   r   zPostalAddress.countryK   s     }}r#   c                     || _         y r   r+   )r    r   s     r!   r   zPostalAddress.countryV   	    r#      c                     | j                   S )zx
        The region or state in the country. For example, Texas.

        Returns:
             `str` or `None`
        _regionr(   s    r!   r   zPostalAddress.regionZ   s     ||r#   c                     || _         y r   r1   )r    r   s     r!   r   zPostalAddress.regione   s	    r#      c                     | j                   S )z~
        The locality or city within the country. For example, Austin.

        Returns:
             `str` or `None`
        	_localityr(   s    r!   r   zPostalAddress.localityi   s     ~~r#   c                     || _         y r   r6   )r    r   s     r!   r   zPostalAddress.localityt   s	    !r#   (   c                     | j                   S )zn
        The post office box number. For example, 901.

        Returns:
             `str` or `None`
        _post_office_box_numberr(   s    r!   r   z$PostalAddress.post_office_box_numberx   s     +++r#   c                     || _         y r   r;   )r    r   s     r!   r   z$PostalAddress.post_office_box_number   s
    '=$r#   <   c                     | j                   S )ze
        The postal code. For example, 78758.

        Returns:
             `str` or `None`
        _postal_coder(   s    r!   r   zPostalAddress.postal_code   s        r#   c                     || _         y r   r@   )r    r   s     r!   r   zPostalAddress.postal_code   s
    'r#   F   c                     | j                   S )zr
        The street address. For example, 100 Main Street.

        Returns:
             `str` or `None`
        _street_addressr(   s    r!   r   zPostalAddress.street_address   s     ###r#   c                     || _         y r   rE   )r    r   s     r!   r   zPostalAddress.street_address   s
    -r#   c           	          t        | j                  | j                  | j                  | j                  | j
                  | j                  | j                  j                  f      S r   )	_ComparableTupler   r   r   r   r   r   r   valuer(   s    r!   __comparable_tuplez PostalAddress.__comparable_tuple   sN    LL$++t}}d6F6F''MM	!
  	r#   otherc                 f    t        |t              r!| j                         |j                         k(  S yNF)
isinstancer    _PostalAddress__comparable_tupler    rL   s     r!   __eq__zPostalAddress.__eq__   s,    e]+**,0H0H0JJJr#   c                 p    t        |t              r!| j                         |j                         k  S t        S r   )rO   r   rP   NotImplementedrQ   s     r!   __lt__zPostalAddress.__lt__   s/    e]+**,u/G/G/IIIr#   c                 4    t        | j                               S r   )hashrP   r(   s    r!   __hash__zPostalAddress.__hash__       D++-..r#   c                 V    d| j                    d| j                   d| j                   dS )Nz<PostalAddress bom-ref=z, street_address=z
, country=>)r   r   r   r(   s    r!   __repr__zPostalAddress.__repr__   s3    (6GH[H[G\\fgkgsgsfttuvvr#   )"__name__
__module____qualname____doc__r   r   strr   r"   propertyserializabletype_mappingxml_attributexml_name	json_namer   xml_sequencer   setterr   r   r   r   r   rI   rP   objectboolrR   r   rU   intrX   r\    r#   r!   r   r       s    15!% $"&04%)(,-%V,-- #- 	-
 3-- !)- c]- !- 
-$ \v&\!\9%\I&  ' & " ' 
 \r"#  #  ^^ x}       \r"  #  ]]Xc] t   \r"(3-  #  __"# "4 " " \r", , # , "">Xc] >t > #> \r"!Xc] ! # ! (x} ( ( ( \r"$ $ # $ .Xc] .t . .$4 F t 
C D 
/# /w# wr#   r   c                   <   e Zd ZdZddddddeeeef      dee   d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
j"                  d
       e
j$                  d
      defd                                                        Ze	 e
j(                  d       e
j*                  e
j,                  j.                        dee   fd                     Zej2                  dee   ddfd       Ze	 e
j(                  d       e
j*                  e
j,                  j.                        dee   fd                     Zej2                  dee   ddfd       Ze	 e
j(                  d       e
j*                  e
j,                  j.                        dee   fd                     Zej2                  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)OrganizationalContacta  
    This is our internal representation of the `organizationalContact` complex type that can be used in multiple places
    within a CycloneDX BOM document.

    .. note::
        See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_organizationalContact
    N)r   namephoneemailr   rp   rq   rr   r   c                N    t        |      | _        || _        || _        || _        y r   )r   r   rp   rr   rq   )r    r   rp   rq   rr   s        r!   r"   zOrganizationalContact.__init__   s%     *'2	

r#   r$   c                     | j                   S r&   r'   r(   s    r!   r   zOrganizationalContact.bom_ref         }}r#   r   c                     | j                   S )ze
        Get the name of the contact.

        Returns:
            `str` if set else `None`
        _namer(   s    r!   rp   zOrganizationalContact.name        zzr#   c                     || _         y r   rw   r    rp   s     r!   rp   zOrganizationalContact.name   	    
r#   r   c                     | j                   S )zf
        Get the email of the contact.

        Returns:
            `str` if set else `None`
        _emailr(   s    r!   rr   zOrganizationalContact.email        {{r#   c                     || _         y r   r~   )r    rr   s     r!   rr   zOrganizationalContact.email  	    r#      c                     | j                   S )zf
        Get the phone of the contact.

        Returns:
            `str` if set else `None`
        _phoner(   s    r!   rq   zOrganizationalContact.phone  r   r#   c                     || _         y r   r   )r    rq   s     r!   rq   zOrganizationalContact.phone  r   r#   c                     t        | j                  | j                  | j                  | j                  j
                  f      S r   )rI   rp   rr   rq   r   rJ   r(   s    r!   rK   z(OrganizationalContact.__comparable_tuple  s4    IItzz4::MM!
  	r#   rL   c                 f    t        |t              r!| j                         |j                         k(  S yrN   )rO   ro   (_OrganizationalContact__comparable_tuplerQ   s     r!   rR   zOrganizationalContact.__eq__  s-    e23**,0H0H0JJJr#   c                 p    t        |t              r!| j                         |j                         k  S t        S r   )rO   ro   r   rT   rQ   s     r!   rU   zOrganizationalContact.__lt__!  s0    e23**,u/G/G/IIIr#   c                 4    t        | j                               S r   )rW   r   r(   s    r!   rX   zOrganizationalContact.__hash__&  rY   r#   c                 V    d| j                    d| j                   d| j                   dS )Nz<OrganizationalContact name=z, email=z, phone=r[   )rp   rr   rq   r(   s    r!   r\   zOrganizationalContact.__repr__)  s.    -dii[HUYU_U_T``abbr#   )&r]   r^   r_   r`   r   r   ra   r   r"   rb   rc   viewr   r   r   rd   re   rf   rg   r   rh   
xml_stringXmlStringSerializationTypeNORMALIZED_STRINGrp   ri   rr   rq   rI   r   rj   rk   rR   r   rU   rl   rX   r\   rm   r#   r!   ro   ro      s    15"##
%V,-
 sm
 }	

 }
 

 \)*\)*\)*\v&\!\9%\I&  ' & " ' + + +  \q!\\DDVVWhsm  X "  
[[# 4   \q!\\DDVVWx}  X "  \\8C= T   \q!\\DDVVWx}  X "  \\8C= T  $4 F t 
C D 
/# /c# cr#   ro   c                   f   e Zd ZdZdddddddeeeef      d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j*                  d       ej,                  d      d	efd                                                        Ze ej0                  d       ej2                  ej4                  j6                        d	ee   fd                     Zej:                  dee   d	dfd       Ze ej                  e       ej                  e       ej0                  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@                  jB                  d       ej0                  d      d!d                            Z"e"j:                  dee	   d	dfd       Z"e ej,                  d       ej>                  ej@                  jB                  d       ej0                  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)#OrganizationalEntitya  
    This is our internal representation of the `organizationalEntity` complex type that can be used in multiple places
    within a CycloneDX BOM document.

    .. note::
        See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_organizationalEntity
    N)r   rp   urlscontactsaddressr   rp   r   r   r   r   c                l    t        |      | _        || _        || _        |xs g | _        |xs g | _        y r   )r   r   rp   r   r   r   )r    r   rp   r   r   r   s         r!   r"   zOrganizationalEntity.__init__7  s4     *'2	JB	 Br#   r$   c                     | j                   S r&   r'   r(   s    r!   r   zOrganizationalEntity.bom_refE  ru   r#   r)   c                     | j                   S )zj
        Get the name of the organization.

        Returns:
            `str` if set else `None`
        rw   r(   s    r!   rp   zOrganizationalEntity.nameW  ry   r#   c                     || _         y r   rw   r{   s     r!   rp   zOrganizationalEntity.namec  r|   r#   r/   c                     | j                   S )z~
        The physical address (location) of the organization.

        Returns:
            `PostalAddress` or `None`
        _addressr(   s    r!   r   zOrganizationalEntity.addressg  s     }}r#   c                     || _         y r   r   )r    r   s     r!   r   zOrganizationalEntity.addresst  r.   r#   urlr4   c                     | j                   S )z
        Get a list of URLs of the organization. Multiple URLs are allowed.

        Returns:
            Set of `XsUri`
        )_urlsr(   s    r!   r   zOrganizationalEntity.urlsx  s     zzr#   c                 $    t        |      | _        y r   )r   r   )r    r   s     r!   r   zOrganizationalEntity.urls  s    t_
r#   contactr9   c                     | j                   S )z
        Get a list of contact person at the organization. Multiple contacts are allowed.

        Returns:
            Set of `OrganizationalContact`
        )	_contactsr(   s    r!   r   zOrganizationalEntity.contacts  s     ~~r#   c                 $    t        |      | _        y r   )r   r   )r    r   s     r!   r   zOrganizationalEntity.contacts  s    "8,r#   c                     t        | j                  t        | j                        t        | j                        | j                  j
                  f      S r   )rI   rp   r   r   r   rJ   r(   s    r!   rK   z'OrganizationalEntity.__comparable_tuple  s@    II'		24DT]]4SMM!
  	r#   rL   c                 f    t        |t              r!| j                         |j                         k(  S yrN   )rO   r   '_OrganizationalEntity__comparable_tuplerQ   s     r!   rR   zOrganizationalEntity.__eq__  s-    e12**,0H0H0JJJr#   c                 p    t        |t              r!| j                         |j                         k  S t        S r   )rO   r   r   rT   rQ   s     r!   rU   zOrganizationalEntity.__lt__  s0    e12**,u/G/G/IIIr#   c                 4    t        | j                               S r   )rW   r   r(   s    r!   rX   zOrganizationalEntity.__hash__  rY   r#   c                 "    d| j                    dS )Nz<OrganizationalEntity name=r[   )rp   r(   s    r!   r\   zOrganizationalEntity.__repr__  s    ,TYYKq99r#   )r   zSortedSet[XsUri])r   z SortedSet[OrganizationalContact]).r]   r^   r_   r`   r   r   ra   r   r   r   ro   r   r"   rb   rc   r   r   r   r   rd   re   rf   rg   r   rh   r   r   r   rp   ri   r   	xml_arrayXmlArraySerializationTypeFLATr   r   rI   r   rj   rk   rR   r   rU   rl   rX   r\   rm   r#   r!   r   r   -  s    15"*.>B+/'%V,-' sm' x'	'
 8$9:;' -(' 
' \)*\)*\)*\v&\!\9%\I&  ' & " ' + + +  \r"\\DDVVWhsm  X #  
[[# 4   \)*\)*\r"-0  # + +  ^^ x6  4     \E"\LBBGGO\r" # P #  
[[%% %T % % \I&\LBBGGS\r" # T '  __-*?!@ -T - -$4 F t 
C D 
/# /:# :r#   r   )collections.abcr   typingr   r   r   py_serializablerc   sortedcontainersr   _internal.bom_refr	   r   _internal.comparer
   rI   schema.schemar   r   r    r   r   r   serializable_classr   ro   r   rm   r#   r!   <module>r      s   & % ' ' & & E C V V   !  tLZw Zw MZwz !  tLkc kc Mkc\ !  tL@: @: M@:r#   