ó
    €ÏZ  ã                   ó¼   • S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr	  SSK
Jr  SSKJr  SS	Kr " S
 S\5      r " S S\5      r " S S\5      r " S S\5      rg	)z(Common utilities for deleting resources.é    )Úabsolute_import)Údivision)Úunicode_literals)Úoperations_util)Úutil)Úbase)ÚlogNc                   óX   • \ rS rSrSr\R                  R                  4S jrS r	S r
Srg)ÚServiceDeletionWaiteré   zCClass for waiting for synchronous deletion of one or more Services.c                 ó   • / U l         Xl        g ©N©Úpending_deletesÚrelease_track©Úselfr   s     Ú7lib/googlecloudsdk/command_lib/metastore/delete_util.pyÚ__init__ÚServiceDeletionWaiter.__init__   ó   € Ø€DÔØ&Õó    c                 óL   • U R                   R                  [        X5      5        g)zíAdds a service whose deletion to track.

Args:
  service_name: str, the relative resource name of the service being deleted
  operation: Operation, the longrunning operation object returned by the API
    when the deletion was initiated
N)r   ÚappendÚ_PendingServiceDelete©r   Úservice_nameÚ	operations      r   ÚAddPendingDeleteÚ&ServiceDeletionWaiter.AddPendingDelete#   s   € ð 	×Ñ×ÑÔ 5°lÓ NÕOr   c           
      ój  • SnU R                    HG  n [        R                  " UR                  SR	                  UR
                  5      U R                  S9  MI     U$ ! [        R                   aB  nSn[        R                  " UR
                  SS[        R                  " U5      S9   SnAMž  SnAff = f)ú;Polls pending deletions and returns when they are complete.FúWaiting for [{}] to be deleted©r   TÚservice©ÚkindÚis_asyncÚfailedN)r   Úoperations_api_utilÚWaitForOperationr   Úformatr   r   Úapi_utilÚOperationErrorr	   ÚDeletedResourceÚsixÚ	text_type©r   Úencountered_errorsÚpending_deleteÚes       r   ÚWaitÚServiceDeletionWaiter.Wait-   s¨   € àÐØ×.Ô.ˆð%Ü×,Ò,Ø×$Ñ$Ø,×3Ñ3Ø×+Ñ+ó-à×,Ñ,ô		.ñ /ð Ðøô ×$Ñ$ó %Ø!ÐÜ×ÒØ×'Ñ'ØØÜ—=’= Ó#÷		%ð 	%ûð%úó   “AAÁB2Á07B-Â-B2r   N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   ÚReleaseTrackÚGAr   r   r6   Ú__static_attributes__© r   r   r   r      s$   † ÙKà#'×#4Ñ#4×#7Ñ#7ô 'òPõr   r   c                   ó   • \ rS rSrSrS rSrg)r   éA   z@Data class holding information about a pending service deletion.c                 ó   • Xl         X l        g r   )r   r   r   s      r   r   Ú_PendingServiceDelete.__init__D   s   € Ø$ÔØ…Nr   )r   r   N©r:   r;   r<   r=   r>   r   rA   rB   r   r   r   r   A   s
   † ÙHõr   r   c                   óX   • \ rS rSrSr\R                  R                  4S jrS r	S r
Srg)ÚFederationDeletionWaiteréI   zFClass for waiting for synchronous deletion of one or more Federations.c                 ó   • / U l         Xl        g r   r   r   s     r   r   Ú!FederationDeletionWaiter.__init__L   r   r   c                 óL   • U R                   R                  [        X5      5        g)zúAdds a federation whose deletion to track.

Args:
  federation_name: str, the relative resource name of the federation being
    deleted
  operation: Operation, the longrunning operation object returned by the API
    when the deletion was initiated
N)r   r   Ú_PendingFederationDelete©r   Úfederation_namer   s      r   r   Ú)FederationDeletionWaiter.AddPendingDeleteP   s    € ð 	×Ñ×ÑÜ  Ó<õ>r   c           
      ój  • SnU R                    HG  n [        R                  " UR                  SR	                  UR
                  5      U R                  S9  MI     U$ ! [        R                   aB  nSn[        R                  " UR
                  SS[        R                  " U5      S9   SnAMž  SnAff = f)r"   Fr#   r$   TÚ
federationr&   N)r   r*   r+   r   r,   rP   r   r-   r.   r	   r/   r0   r1   r2   s       r   r6   ÚFederationDeletionWaiter.Wait\   s¨   € àÐØ×.Ô.ˆð%Ü×,Ò,Ø×$Ñ$Ø,×3Ñ3Ø×.Ñ.ó0à×,Ñ,ô		.ñ /ð Ðøô ×$Ñ$ó %Ø!ÐÜ×ÒØ×*Ñ*ØØÜ—=’= Ó#÷		%ð 	%ûð%úr8   r   Nr9   rB   r   r   rI   rI   I   s#   † ÙNà#'×#4Ñ#4×#7Ñ#7ô 'ò
>õr   rI   c                   ó   • \ rS rSrSrS rSrg)rN   ép   zCData class holding information about a pending federation deletion.c                 ó   • Xl         X l        g r   ©rP   r   rO   s      r   r   Ú!_PendingFederationDelete.__init__s   s   € Ø*ÔØ…Nr   rX   NrG   rB   r   r   rN   rN   p   s
   † ÙKõr   rN   )r>   Ú
__future__r   r   r   Ú googlecloudsdk.api_lib.metastorer   r*   r   r-   Úgooglecloudsdk.callioper   Úgooglecloudsdk.corer	   r0   Úobjectr   r   rI   rN   rB   r   r   Ú<module>r_      sT   ðñ /å &Ý Ý 'å SÝ =Ý (Ý #Û 
ô"˜Fô "ôJ˜Fô ô$˜vô $ôN˜võ r   