Ë
    daºiÖ  ã                   ól   — d dl Z ddlmZ  e j                  e«      ZdZ G d„ de«      Z G d„ de«      Zy)	é    Né   )ÚAtlassianRestAPIzhttps://api.atlassian.comc                   óN   ‡ — e Zd Zˆ fd„Zd„ Zd„ Zdd„Z	 	 	 	 	 	 	 	 	 	 dd„Zˆ xZS )ÚCloudAdminOrgsc                 óV   •— ||d<   d|d<   d|d<   t        t        | �
  |dt        i|¤Ž y )NÚtokenÚadminÚapi_rootÚv1Úapi_versionÚurl)Úsuperr   Ú__init__Ú	ADMIN_URL©ÚselfÚadmin_api_keyÚargsÚkwargsÚ	__class__s       €úM/var/www/timesheet/venv/lib/python3.12/site-packages/atlassian/cloud_admin.pyr   zCloudAdminOrgs.__init__   s9   ø€ Ø'ˆˆw‰Ø$ˆˆzÑØ $ˆˆ}ÑÜŒn˜dÑ,¸TÐL´ÐLÀVÓLó    c                 óF   — | j                  d«      }| j                  |«      S )z`
        Returns a list of your organizations (based on your API key).
        :return:
        Úorgs©Úresource_urlÚget)r   r   s     r   Úget_organizationsz CloudAdminOrgs.get_organizations   s"   € ð
 ×Ñ Ó'ˆØ�x‰x˜‹}Ðr   c                 óL   — | j                  d|› �«      }| j                  |«      S )zo
        Returns information about a single organization by ID
        :param org_id:
        :return:
        úorgs/r   )r   Úorg_idr   s      r   Úget_organizationzCloudAdminOrgs.get_organization   s)   € ð ×Ñ %¨ xÐ 0Ó1ˆØ�x‰x˜‹}Ðr   c                 ód   — | j                  d|› d�«      }i }|r||d<   | j                  ||¬«      S )z‡
        Returns a list of accounts managed by the organization
        :param org_id:
        :param cursor:
        :return:
        r    z/usersÚcursor©Úparamsr   )r   r!   r$   r   r&   s        r   Ú$get_managed_accounts_in_organizationz3CloudAdminOrgs.get_managed_accounts_in_organization#   sB   € ð ×Ñ %¨ x¨vÐ 6Ó7ˆØˆÙØ%ˆF�8ÑØ�x‰x˜ FˆxÓ+Ð+r   c                 óâ   — | j                  d|› d�«      }i }|	r|	|d<   |
r|
|d<   |r||d<   |r||d<   |r||d<   |r||d<   |r||d	<   |r||d
<   |r||d<   |r||d<   | j                  ||¬«      S )af  
        Returns a list of accounts in the organization that match the search criteria.
        The API is available for customers using the new user management experience only.
        How the new user management experience works
        Returns a list of users within an organization,
        offering search functionality through multiple parameters for more precise results.
        :param org_id:
        :param account_ids: Unique ID of the users account. The format is [a-zA-Z0-9_|-:]{1,128}
        :param account_types: The type of account Valid values: atlassian, customer, app
        :param account_statuses: The lifecycle status of the account
        :param name_or_nicknames:
        :param email_usernames:
        :param email_domains:
        :param is_suspended: Suspended users with no access. This is independent of the user account status
        :param cursor: Starting point marker for page result retrieval
        :param limit: The number of items to return. Default = max = 10000
        :param expand: Valid values: NAME, EMAIL, EMAIL_VERIFIED, PRODUCT_LAST_ACCESS, GROUPS
        :return:
        r    z/users/searchr$   ÚlimitÚ
accountIdsÚaccountTypesÚaccountStatusesÚnameOrNicknamesÚemailUsernamesÚemailDomainsÚisSuspendedÚexpandr%   r   )r   r!   Úaccount_idsÚaccount_typesÚaccount_statusesÚname_or_nicknamesÚemail_usernamesÚemail_domainsÚis_suspendedr$   r)   r1   r   r&   s                 r   Úsearch_users_in_organizationz+CloudAdminOrgs.search_users_in_organization0   sº   € ðD ×Ñ %¨ x¨}Ð =Ó>ˆØˆÙØ%ˆF�8ÑÙØ#ˆF�7‰OÙØ#.ˆF�<Ñ ÙØ%2ˆF�>Ñ"ÙØ(8ˆFÐ$Ñ%ÙØ(9ˆFÐ$Ñ%ÙØ'6ˆFÐ#Ñ$ÙØ%2ˆF�>Ñ"ÙØ$0ˆF�=Ñ!ÙØ%ˆF�8Ñà�x‰x˜ FˆxÓ+Ð+r   )N)
NNNNNNNNi'  N)	Ú__name__Ú
__module__Ú__qualname__r   r   r"   r'   r9   Ú__classcell__©r   s   @r   r   r      s=   ø„ ôMòòó,ð  ØØØØØØØØØ÷9,r   r   c                   ó$   ‡ — e Zd Zˆ fd„Zd„ Zˆ xZS )ÚCloudAdminUsersc                 óZ   •— ||d<   d|d<   d |d<   t        t        | �
  t        g|¢­i |¤Ž y )Nr   Úusersr
   r   )r   r@   r   r   r   s       €r   r   zCloudAdminUsers.__init__m   s9   ø€ Ø'ˆˆw‰Ø$ˆˆzÑØ $ˆˆ}ÑÜŒo˜tÑ-¬iÐI¸$ÒIÀ&ÓIr   c                 óL   — | j                  |› d�«      }| j                  |«      S )Nz/manage/profiler   )r   Ú
account_idr   s      r   Úget_profilezCloudAdminUsers.get_profiles   s'   € Ø×Ñ : ,¨oÐ >Ó?ˆØ�x‰x˜‹}Ðr   )r:   r;   r<   r   rE   r=   r>   s   @r   r@   r@   l   s   ø„ ôJör   r@   )	ÚloggingÚrest_clientr   Ú	getLoggerr:   Úlogr   r   r@   © r   r   ú<module>rK      s?   ðã å )à€g×Ñ˜Ó!€à'€	ô^,Ð%ô ^,ôB	Ð&õ 	r   