
    N[i
                     D    d dl mZ d dlZd dlmZ d dlmZ  G d d      Zy)    )UnionN)raw)typesc                   >    e Zd Z	 	 	 d
dddeeef   dedededefdZy	)
AddContactselfzpyrogram.Clientuser_id
first_name	last_namephone_numbershare_phone_numberc           	      $  K   | j                  t        j                  j                  j	                  | j                  |       d{   ||||             d{   }t        j                  j                  | |j                  d         S 7 F7 3w)a  Add an existing Telegram user as contact, even without a phone number.

        .. include:: /_includes/usable-by/users.rst

        Parameters:
            user_id (``int`` | ``str``):
                Unique identifier (int) or username (str) of the target user.

            first_name (``str``):
                User's first name.

            last_name (``str``, *optional*):
                User's last name.

            phone_number (``str``, *optional*):
                User's phone number.

            share_phone_number (``bool``, *optional*):
                Whether or not to share the phone number with the user.
                Defaults to False.

        Returns:
            :obj:`~pyrogram.types.User`: On success the user is returned.

        Example:
            .. code-block:: python

                # Add contact by id
                await app.add_contact(12345678, "Foo")

                # Add contact by username
                await app.add_contact("username", "Bar")
        N)idr
   r   phoneadd_phone_privacy_exceptionr   )
invoker   	functionscontactsr   resolve_peerr   User_parseusers)r   r	   r
   r   r   r   rs          X/var/www/files/kim/lib/python3.12/site-packages/pyrogram/methods/contacts/add_contact.pyadd_contactzAddContact.add_contact   s     R ++MM""--**733%#",> . 
 
 zz  qwwqz22 4
s$   ABBBB2BBN) r   F)__name__
__module____qualname__r   intstrboolr        r   r   r      sR    
 #(3333sCx33 33 	33
 33 !33r$   r   )typingr   pyrogramr   r   r   r#   r$   r   <module>r'      s   &    43 43r$   