
    fa                     b   d Z ddlZddlZddlZddlZddlZddlmZ ddlmZ ddlmZ dZ	d Z
d dZd d	Zd d
Zd dZd!dZd!dZd Zd Zd Zd Z G d d          Z G d d          Z G d d          Z G d de          Z G d de          Z G d d          Z G d d          ZdS )"zFirebase Project Management module.

This module enables management of resources in Firebase projects, such as Android and iOS apps.
    N)
exceptions)_http_client)_utils_project_managementc                 B    t          j        | t          t                    S N)r   get_app_service_PROJECT_MANAGEMENT_ATTRIBUTE_ProjectManagementServiceapps    [/var/www/html/Alfredo/env/lib/python3.11/site-packages/firebase_admin/project_management.py_get_project_management_servicer   #   s    !#'DF_```    c                 >    t          | t          |                    S )zObtains a reference to an Android app in the associated Firebase project.

    Args:
        app_id: The app ID that identifies this Android app.
        app: An App instance (optional).

    Returns:
        AndroidApp: An ``AndroidApp`` instance.
    app_idservice)
AndroidAppr   r   r   s     r   android_appr   '   s      V-LS-Q-QRRRRr   c                 >    t          | t          |                    S )zObtains a reference to an iOS app in the associated Firebase project.

    Args:
        app_id: The app ID that identifies this iOS app.
        app: An App instance (optional).

    Returns:
        IOSApp: An ``IOSApp`` instance.
    r   )IOSAppr   r   s     r   ios_appr   4   s      )H)M)MNNNNr   c                 D    t          |                                           S )zLists all Android apps in the associated Firebase project.

    Args:
        app: An App instance (optional).

    Returns:
        list: a list of ``AndroidApp`` instances referring to each Android app in the Firebase
        project.
    )r   list_android_appsr   s    r   r   r   A   s     +3//AACCCr   c                 D    t          |                                           S )zLists all iOS apps in the associated Firebase project.

    Args:
        app: An App instance (optional).

    Returns:
        list: a list of ``IOSApp`` instances referring to each iOS app in the Firebase project.
    )r   list_ios_appsr   s    r   r   r   N   s     +3//==???r   c                 H    t          |                              | |          S )al  Creates a new Android app in the associated Firebase project.

    Args:
        package_name: The package name of the Android app to be created.
        display_name: A nickname for this Android app (optional).
        app: An App instance (optional).

    Returns:
        AndroidApp: An ``AndroidApp`` instance that is a reference to the newly created app.
    )r   create_android_app)package_namedisplay_namer   s      r   r    r    Z   s#     +3//BB<Q]^^^r   c                 H    t          |                              | |          S )aR  Creates a new iOS app in the associated Firebase project.

    Args:
        bundle_id: The bundle ID of the iOS app to be created.
        display_name: A nickname for this iOS app (optional).
        app: An App instance (optional).

    Returns:
        IOSApp: An ``IOSApp`` instance that is a reference to the newly created app.
    )r   create_ios_app)	bundle_idr"   r   s      r   r$   r$   h   s"     +3//>>y,WWWr   c                 x    | t          | t                    r| S t          d                    |                    )Nz{0} must be a string.
isinstancestr
ValueErrorformatobj
field_names     r   _check_is_string_or_noner/   v   s7    
{jc**{

,33J??
@
@@r   c                 x    t          | t                    r| r| S t          d                    |                    )Nz{0} must be a non-empty string.r'   r,   s     r   _check_is_nonempty_stringr1   |   s=    #s  

6==jII
J
JJr   c                 *    | d S t          | |          S r   )r1   r,   s     r   !_check_is_nonempty_string_or_noner3      s    
{t$S*555r   c                 N    | "t          d                    |                    | S )Nz{0} cannot be None.)r*   r+   r,   s     r   _check_not_noner5      s)    
{.55jAABBBJr   c                   R    e Zd ZdZd Zed             Zd Zd Zd Z	d Z
d Zd	 Zd
S )r   a!  A reference to an Android app within a Firebase project.

    Note: Unless otherwise specified, all methods defined in this class make an RPC.

    Please use the module-level function ``android_app(app_id)`` to obtain instances of this class
    instead of instantiating it directly.
    c                 "    || _         || _        d S r   _app_id_serviceselfr   r   s      r   __init__zAndroidApp.__init__       r   c                     | j         S )zReturns the app ID of the Android app to which this instance refers.

        Note: This method does not make an RPC.

        Returns:
            string: The app ID of the Android app to which this instance refers.
        r9   r<   s    r   r   zAndroidApp.app_id        |r   c                 @    | j                             | j                  S )a&  Retrieves detailed information about this Android app.

        Returns:
            AndroidAppMetadata: An ``AndroidAppMetadata`` instance.

        Raises:
            FirebaseError: If an error occurs while communicating with the Firebase Project
                Management Service.
        )r:   get_android_app_metadatar9   rA   s    r   get_metadatazAndroidApp.get_metadata   s     }55dlCCCr   c                 B    | j                             | j        |          S )ah  Updates the display name attribute of this Android app to the one given.

        Args:
            new_display_name: The new display name for this Android app.

        Returns:
            NoneType: None.

        Raises:
            FirebaseError: If an error occurs while communicating with the Firebase Project
                Management Service.
        )r:   set_android_app_display_namer9   r<   new_display_names     r   set_display_namezAndroidApp.set_display_name   s     }99$,HXYYYr   c                 @    | j                             | j                  S )zFRetrieves the configuration artifact associated with this Android app.)r:   get_android_app_configr9   rA   s    r   
get_configzAndroidApp.get_config   s    }33DLAAAr   c                 @    | j                             | j                  S )a5  Retrieves the entire list of SHA certificates associated with this Android app.

        Returns:
            list: A list of ``SHACertificate`` instances.

        Raises:
            FirebaseError: If an error occurs while communicating with the Firebase Project
                Management Service.
        )r:   get_sha_certificatesr9   rA   s    r   rO   zAndroidApp.get_sha_certificates        }11$,???r   c                 B    | j                             | j        |          S )aw  Adds a SHA certificate to this Android app.

        Args:
            certificate_to_add: The SHA certificate to add.

        Returns:
            NoneType: None.

        Raises:
            FirebaseError: If an error occurs while communicating with the Firebase Project
                Management Service. (For example, if the certificate_to_add already exists.)
        )r:   add_sha_certificater9   )r<   certificate_to_adds     r   rR   zAndroidApp.add_sha_certificate   s     }00?QRRRr   c                 6    | j                             |          S )a  Removes a SHA certificate from this Android app.

        Args:
            certificate_to_delete: The SHA certificate to delete.

        Returns:
            NoneType: None.

        Raises:
            FirebaseError: If an error occurs while communicating with the Firebase Project
                Management Service. (For example, if the certificate_to_delete is not found.)
        )r:   delete_sha_certificate)r<   certificate_to_deletes     r   rU   z!AndroidApp.delete_sha_certificate   s     }334IJJJr   N)__name__
__module____qualname____doc__r=   propertyr   rE   rJ   rM   rO   rR   rU    r   r   r   r      s                 X
D 
D 
DZ Z ZB B B
@ 
@ 
@S S SK K K K Kr   r   c                   @    e Zd ZdZd Zed             Zd Zd Zd Z	dS )r   a  A reference to an iOS app within a Firebase project.

    Note: Unless otherwise specified, all methods defined in this class make an RPC.

    Please use the module-level function ``ios_app(app_id)`` to obtain instances of this class
    instead of instantiating it directly.
    c                 "    || _         || _        d S r   r8   r;   s      r   r=   zIOSApp.__init__   r>   r   c                     | j         S )zReturns the app ID of the iOS app to which this instance refers.

        Note: This method does not make an RPC.

        Returns:
            string: The app ID of the iOS app to which this instance refers.
        r@   rA   s    r   r   zIOSApp.app_id   rB   r   c                 @    | j                             | j                  S )a  Retrieves detailed information about this iOS app.

        Returns:
            IOSAppMetadata: An ``IOSAppMetadata`` instance.

        Raises:
            FirebaseError: If an error occurs while communicating with the Firebase Project
                Management Service.
        )r:   get_ios_app_metadatar9   rA   s    r   rE   zIOSApp.get_metadata  rP   r   c                 B    | j                             | j        |          S )a`  Updates the display name attribute of this iOS app to the one given.

        Args:
            new_display_name: The new display name for this iOS app.

        Returns:
            NoneType: None.

        Raises:
            FirebaseError: If an error occurs while communicating with the Firebase Project
                Management Service.
        )r:   set_ios_app_display_namer9   rH   s     r   rJ   zIOSApp.set_display_name  s     }55dlDTUUUr   c                 @    | j                             | j                  S )zBRetrieves the configuration artifact associated with this iOS app.)r:   get_ios_app_configr9   rA   s    r   rM   zIOSApp.get_config#  s    }//===r   N)
rW   rX   rY   rZ   r=   r[   r   rE   rJ   rM   r\   r   r   r   r      s{                 X
@ 
@ 
@V V V> > > > >r   r   c                   `    e Zd ZdZd Zed             Zed             Zed             Zd Z	dS )_AppMetadataz9Detailed information about a Firebase Android or iOS app.c                     t          |d          | _        t          |d          | _        t          |d          | _        t          |d          | _        d S )Nnamer   r"   
project_id)r1   _namer9   r/   _display_name_project_id)r<   ri   r   r"   rj   s        r   r=   z_AppMetadata.__init__+  sP     /tV<<
0BB5lNSS4ZNNr   c                     | j         S )zThe globally unique, Firebase-assigned identifier of this Android or iOS app.

        This ID is unique even across apps of different platforms.
        r@   rA   s    r   r   z_AppMetadata.app_id3  s     |r   c                     | j         S )zThe user-assigned display name of this Android or iOS app.

        Note that the display name can be None if it has never been set by the user.)rl   rA   s    r   r"   z_AppMetadata.display_name;  s    
 !!r   c                     | j         S )zPThe permanent, globally unique, user-assigned ID of the parent Firebase project.)rm   rA   s    r   rj   z_AppMetadata.project_idB  s     r   c                     t          |t          |                     sdS | j        |j        k    o/| j        |j        k    o| j        |j        k    o| j        |j        k    S NF)r(   typerk   r   r"   rj   r<   others     r   __eq__z_AppMetadata.__eq__G  si    %d,, 	5
ek) `dkU\.I `!U%77`<@OuO_<_	ar   N)
rW   rX   rY   rZ   r=   r[   r   r"   rj   rv   r\   r   r   rg   rg   (  s        CCO O O   X " " X"     X a a a a ar   rg   c                   N     e Zd ZdZ fdZed             Z fdZd Zd Z	 xZ
S )AndroidAppMetadataz;Android-specific information about an Android Firebase app.c                     t          t          |                               ||||           t          |d          | _        dS )3Clients should not instantiate this class directly.r!   N)superrx   r=   r1   _package_name)r<   r!   ri   r   r"   rj   	__class__s         r   r=   zAndroidAppMetadata.__init__S  s@     $''00v|ZXXX6|^TTr   c                     | j         S )zTThe canonical package name of this Android app as it would appear in the Play Store.)r|   rA   s    r   r!   zAndroidAppMetadata.package_nameX  s     !!r   c                 t    t          t          |                               |          o| j        |j        k    S r   )r{   rx   rv   r!   r<   ru   r}   s     r   rv   zAndroidAppMetadata.__eq__]  s7    ($//66u== 8!U%77	9r   c                 .    |                      |           S r   rv   rt   s     r   __ne__zAndroidAppMetadata.__ne__a      ;;u%%%%r   c                 \    t          | j        | j        | j        | j        | j        f          S r   )hashrk   r   r"   rj   r!   rA   s    r   __hash__zAndroidAppMetadata.__hash__d  s1    Zd&7$J[\^ ^ 	^r   )rW   rX   rY   rZ   r=   r[   r!   rv   r   r   __classcell__r}   s   @r   rx   rx   P  s        EEU U U U U
 " " X"9 9 9 9 9& & &^ ^ ^ ^ ^ ^ ^r   rx   c                   N     e Zd ZdZ fdZed             Z fdZd Zd Z	 xZ
S )IOSAppMetadataz3iOS-specific information about an iOS Firebase app.c                     t          t          |                               ||||           t          |d          | _        dS )rz   r%   N)r{   r   r=   r1   
_bundle_id)r<   r%   ri   r   r"   rj   r}   s         r   r=   zIOSAppMetadata.__init__l  s<    nd##,,T6<TTT3I{KKr   c                     | j         S )zOThe canonical bundle ID of this iOS app as it would appear in the iOS AppStore.)r   rA   s    r   r%   zIOSAppMetadata.bundle_idq  s     r   c                 t    t          t          |                               |          o| j        |j        k    S r   )r{   r   rv   r%   r   s     r   rv   zIOSAppMetadata.__eq__v  s/    ^T**11%88^T^u=^^r   c                 .    |                      |           S r   r   rt   s     r   r   zIOSAppMetadata.__ne__y  r   r   c                 \    t          | j        | j        | j        | j        | j        f          S r   )r   rk   r   r"   rj   r%   rA   s    r   r   zIOSAppMetadata.__hash__|  s(    TZd.?RVR`abbbr   )rW   rX   rY   rZ   r=   r[   r%   rv   r   r   r   r   s   @r   r   r   i  s        ==L L L L L
   X_ _ _ _ _& & &c c c c c c cr   r   c                       e Zd ZdZdZdZ ej        d          Z ej        d          Z	ddZ
ed             Zed	             Zed
             Zd Zd Zd ZdS )SHACertificatezIRepresents a SHA-1 or SHA-256 certificate associated with an Android app.SHA_1SHA_256z^[0-9A-Fa-f]{40}$z^[0-9A-Fa-f]{64}$Nc                 h   t          |d           t          |d           || _        |                                | _        t
          j                            |          rt
          j        | _	        dS t
          j
                            |          rt
          j        | _	        dS t          d          )a  Creates a new SHACertificate instance.

        Args:
            sha_hash: A string; the certificate hash for the Android app.
            name: The fully qualified resource name of this certificate; note that this field should
                be omitted if the instance is being constructed for the purpose of calling the
                add_sha_certificate() method on an ``AndroidApp``.

        Raises:
            ValueError: If the sha_hash is not a valid SHA-1 or SHA-256 certificate hash.
        sha_hashri   zHThe supplied certificate hash is neither a valid SHA-1 nor SHA_256 hash.N)r1   r3   rk   lower	_sha_hashr   	_SHA_1_REmatchr   
_cert_type_SHA_256_REr   r*   )r<   r   ri   s      r   r=   zSHACertificate.__init__  s     	"(J777)$777
!))#))(33 	\,2DOOO'--h77 	\,4DOOOZ\ \ \r   c                     | j         S )zReturns the fully qualified resource name of this certificate, if known.

        Returns:
            string: The fully qualified resource name of this certificate, if known; otherwise, the
            empty string.
        )rk   rA   s    r   ri   zSHACertificate.name  s     zr   c                     | j         S )zbReturns the certificate hash.

        Returns:
            string: The certificate hash.
        )r   rA   s    r   r   zSHACertificate.sha_hash  s     ~r   c                     | j         S )zReturns the type of the SHA certificate encoded in the hash.

        Returns:
            string: One of 'SHA_1' or 'SHA_256'.
        )r   rA   s    r   	cert_typezSHACertificate.cert_type  s     r   c                     t          |t                    sdS | j        |j        k    o| j        |j        k    o| j        |j        k    S rr   )r(   r   ri   r   r   rt   s     r   rv   zSHACertificate.__eq__  sK    %00 	5	UZ' 2DMU^,K 2%/1	3r   c                 .    |                      |           S r   r   rt   s     r   r   zSHACertificate.__ne__  r   r   c                 D    t          | j        | j        | j        f          S r   )r   ri   r   r   rA   s    r   r   zSHACertificate.__hash__  s    TYt~>???r   r   )rW   rX   rY   rZ   r   r   recompiler   r   r=   r[   ri   r   r   rv   r   r   r\   r   r   r   r     s        SSEG
.//I"*011K\ \ \ \0   X   X   X3 3 3& & &@ @ @ @ @r   r   c                       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d Zd Zd Zd Zd Zd Zd"dZd"dZd Zd Zd Zd Zd Zd Zd Zd Z d"d Z!d"d!Z"dS )#r   zNProvides methods for interacting with the Firebase Project Management Service.zhttps://firebase.googleapis.comd      g      ?g      ?androidAppspackageNameiosAppsbundleIdc                 L   |j         }|st          d          || _        d                    t          j                  }|j                            dt          j	                  }t          j
        |j                                        t          j        d|i|          | _        d S )NzProject ID is required to access the Firebase Project Management Service. Either set the projectId option, or use service account credentials. Alternatively, set the GOOGLE_CLOUD_PROJECT environment variable.zPython/Admin/{0}httpTimeoutzX-Client-Version)
credentialbase_urlheaderstimeout)rj   r*   rm   r+   firebase_admin__version__optionsgetr   DEFAULT_TIMEOUT_SECONDSJsonHttpClientr   get_credentialr   BASE_URL_client)r<   r   rj   version_headerr   s        r   r=   z"_ProjectManagementService.__init__  s    ^
 	BAB B B &+22>3MNN+//-1UVV#2~4466.7'8	  r   c                 f    |                      t          j        t          j        t          |          S N)platform_resource_nameidentifier_namemetadata_classr   )_get_app_metadatar   ANDROID_APPS_RESOURCE_NAMEANDROID_APP_IDENTIFIER_NAMErx   r<   r   s     r   rD   z2_ProjectManagementService.get_android_app_metadata  s1    %%#<#W5Q-	 &   	r   c                 f    |                      t          j        t          j        t          |          S r   )r   r   IOS_APPS_RESOURCE_NAMEIOS_APP_IDENTIFIER_NAMEr   r   s     r   ra   z._ProjectManagementService.get_ios_app_metadata  s1    %%#<#S5M)	 &   	r   c                     t          |d           d                    ||          }|                     d|          } |||         |d         |d         |                    d          pd|d         	          S )
z;Retrieves detailed information about an Android or iOS app.r   z/v1beta1/projects/-/{0}/{1}r   ri   appIddisplayNameN	projectId)ri   r   r"   rj   )r1   r+   _make_requestr   )r<   r   r   r   r   pathresponses          r   r   z+_ProjectManagementService._get_app_metadata  s    !&(333,334JFSS%%eT22~_%&!G$!m44<,. . . 	.r   c                 J    |                      ||t          j                   d S N)r   rI   r   )_set_display_namer   r   r<   r   rI   s      r   rG   z6_ProjectManagementService.set_android_app_display_name  s:    -#<#W 	 	Y 	Y 	Y 	Y 	Yr   c                 J    |                      ||t          j                   d S r   )r   r   r   r   s      r   rc   z2_ProjectManagementService.set_ios_app_display_name  s:    -#<#S 	 	U 	U 	U 	U 	Ur   c                 j    d                     ||          }d|i}|                     d||           dS )z/Sets the display name of an Android or iOS app.z2/v1beta1/projects/-/{0}/{1}?updateMask=displayNamer   patchjsonN)r+   r   )r<   r   rI   r   r   request_bodys         r   r   z+_ProjectManagementService._set_display_name  sH    CJJ"F, ,%'787D|<<<<<r   c                 N    |                      t          j        t                    S N)r   	app_class)
_list_appsr   r   r   rA   s    r   r   z+_ProjectManagementService.list_android_apps  s&    #<#W   " " 	"r   c                 N    |                      t          j        t                    S r   )r   r   r   r   rA   s    r   r   z'_ProjectManagementService.list_ios_apps  s&    #<#S    	r   c                     d                      j        |t          j                  }                     d|          }g }	 |                    d          }|snx|                     fd|D                        |                    d          }|sn>d                      j        ||t          j                  }                     d|          }|S )z>Lists all the Android or iOS apps within the Firebase project.z&/v1beta1/projects/{0}/{1}?pageSize={2}r   Tappsc              3   >   K   | ]} |d                    V  dS )r   r   Nr\   ).0r   r   r<   s     r   	<genexpr>z7_ProjectManagementService._list_apps.<locals>.<genexpr>+  s6      ZZcYYc'lDIIIZZZZZZr   nextPageTokenz4/v1beta1/projects/{0}/{1}?pageToken={2}&pageSize={3})r+   rm   r   MAXIMUM_LIST_APPS_PAGE_SIZEr   r   extend)r<   r   r   r   r   	apps_listr   next_page_tokens   ` `     r   r   z$_ProjectManagementService._list_apps  s    7>>"%AC C %%eT22		7<<''D ZZZZZUYZZZZZZ&ll?;;O" IPP &)E	G GD
 ))%66H	7 r   Nc                 h    |                      t          j        t          j        ||t                    S N)r   r   
identifierr"   r   )_create_appr   r   r   r   )r<   r!   r"   s      r   r    z,_ProjectManagementService.create_android_app8  s4    #<#W5Q#%    " " 	"r   c                 h    |                      t          j        t          j        ||t                    S r   )r   r   r   r   r   )r<   r%   r"   s      r   r$   z(_ProjectManagementService.create_ios_app@  s4    #<#S5M %     	r   c                     t          |d           d                    | j        |          }||i}|r||d<   |                     d||          }|d         }	|                     |	          }
 ||
d         |           S )	zCreates an Android or iOS app.r"   z/v1beta1/projects/{0}/{1}r   postr   ri   r   r   )r/   r+   rm   r   _poll_app_creation)r<   r   r   r   r"   r   r   r   r   operation_namepoll_responses              r   r   z%_ProjectManagementService._create_appH  s     	!~>>>*11$2BDZ[['4 	7*6L'%%fd%FF!&)//??yg 6EEEEr   c                    t          t          j                  D ]}t          t          j        |          }|t          j        z  }t          j        |           d                    |          }| 	                    d|          \  }}|
                    d          }|r1|
                    d          }	|	r|	c S t          j        d|          t          j        d          )zVPolls the Long-Running Operation repeatedly until it is done with exponential backoff.z/v1/{0}r   doner   z;Polling finished, but the operation terminated in an error.)http_responsezPolling deadline exceeded.)ranger   MAXIMUM_POLLING_ATTEMPTSpowPOLL_EXPONENTIAL_BACKOFF_FACTORPOLL_BASE_WAIT_TIME_SECONDStimesleepr+   _body_and_responser   r   UnknownErrorDeadlineExceededError)
r<   r   current_attemptdelay_factorwait_time_secondsr   r   r   r   r   s
             r   r   z,_ProjectManagementService._poll_app_creationZ  s    $%>%WXX 	1 	1O)I?\ \L ,/H/d dJ()))##N33D+/+B+B5$+O+O(M= $$V,,D 1(,,Z88 $#OOO -Q"/1 1 1 11 ./KLLLr   c                 D    |                      t          j        |          S N)r   r   )_get_app_configr   r   r   s     r   rL   z0_ProjectManagementService.get_android_app_confign  s(    ###<#W $   	r   c                 D    |                      t          j        |          S r  )r  r   r   r   s     r   re   z,_ProjectManagementService.get_ios_app_configs  s+    ###<#S\b $ d d 	dr   c                     d                     ||          }|                     d|          }t          j        |d                                       d          S )Nz"/v1beta1/projects/-/{0}/{1}/configr   configFileContentszutf-8)encoding)r+   r   base64standard_b64decodedecode)r<   r   r   r   r   s        r   r  z)_ProjectManagementService._get_app_configw  sY    3::;QSYZZ%%eT22 (2F)GHHOOY`Oaaar   c                     d                     |          }|                     d|          }|                    d          pg }d |D             S )N'/v1beta1/projects/-/androidApps/{0}/shar   certificatesc                 H    g | ]}t          |d          |d                    S )shaHashri   )r   ri   )r   )r   certs     r   
<listcomp>zB_ProjectManagementService.get_sha_certificates.<locals>.<listcomp>  s.    bbbPTYd6lKKKbbbr   )r+   r   r   )r<   r   r   r   	cert_lists        r   rO   z._ProjectManagementService.get_sha_certificates~  sU    8??GG%%eT22LL006B	bbXabbbbr   c                     d                     |          }t          |d          j        }|j        }||d}|                     d||           d S )Nr  rS   )r  certTyper   r   )r+   r5   r   r   r   )r<   r   rS   r   r   r   r   s          r   rR   z-_ProjectManagementService.add_sha_certificate  s_    8??GG"#57KLLU&0	#+CC64l;;;;;r   c                     t          |d          j        }d                    |          }|                     d|           d S )NrV   z/v1beta1/{0}delete)r5   ri   r+   r   )r<   rV   ri   r   s       r   rU   z0_ProjectManagementService.delete_sha_certificate  sE    46MNNS$$T**8T*****r   c                 :    |                      |||          \  }}|S r   )r   )r<   methodurlr   body_s         r   r   z'_ProjectManagementService._make_request  s"    ))&#t<<ar   c                     	 | j                             |||          S # t          j        j        $ r}t          j        |          d }~ww xY w)N)r  r  r   )r   body_and_responserequestsr   RequestExceptionr   #handle_platform_error_from_requests)r<   r  r  r   errors        r   r   z,_ProjectManagementService._body_and_response  s_    	D<11St1TTT"3 	D 	D 	D<UCCC	Ds    AAAr   )#rW   rX   rY   rZ   r   r   r   r   r   r   r   r   r   r=   rD   ra   r   rG   rc   r   r   r   r   r    r$   r   r   rL   re   r  rO   rR   rU   r   r   r\   r   r   r   r     s       XX0H"% "%&)#!."/&(       
. 
. 
.Y Y YU U U= = =" " "
  
  2" " " "   F F F$M M M(  
d d db b bc c c< < <+ + +
   D D D D D Dr   r   r   )NN)rZ   r  r   r   r!  r   r   r   r   r
   r   r   r   r   r   r    r$   r/   r1   r3   r5   r   r   rg   rx   r   r   r   r\   r   r   <module>r%     s   
  				       % % % % % % ' ' ' ' ' ' ! ! ! ! ! ! !6 a a a
S 
S 
S 
S
O 
O 
O 
O
D 
D 
D 
D	@ 	@ 	@ 	@_ _ _ _X X X XA A AK K K6 6 6  _K _K _K _K _K _K _K _KD5> 5> 5> 5> 5> 5> 5> 5>p$a $a $a $a $a $a $a $aP^ ^ ^ ^ ^ ^ ^ ^2c c c c c\ c c c.G@ G@ G@ G@ G@ G@ G@ G@TND ND ND ND ND ND ND ND ND NDr   