Ë
    €Ïr  ã                   óV   — d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ d„ Z	d„ Z
d	„ Zy
)z"Common code for operation pooling.é    )Úabsolute_import)Údivision)Úunicode_literals)Úpoller)Úwaiterc                   ó   — y)Núcompute.regionOperations© r
   ó    ú9lib/googlecloudsdk/command_lib/compute/operation_utils.pyÚGetRegionalOperationsCollectionr      ó   € Ø	#r   c                   ó   — y)Nzcompute.globalOperationsr
   r
   r   r   ÚGetGlobalOperationsCollectionr      r   r   c                 óÜ   — d|j                   i}|dk(  r|j                  |d<   | j                  |j                  ||¬«      }t	        j
                  ||«      }t        j                  |||«      S )aŒ  Waits for the operation to finish.

  Args:
    resources: The resource parser.
    service: apitools.base.py.base_api.BaseApiService, the service representing
      the target of the operation.
    operation: The operation to wait for.
    collection: The operations collection.
    resource_ref: The resource reference.
    message: The message to show.

  Returns:
    The operation result.
  Úprojectr	   Úregion)ÚparamsÚ
collection)r   r   ÚParseÚnamer   ÚPollerr   ÚWaitFor)	Ú	resourcesÚserviceÚ	operationr   Úresource_refÚmessager   Úoperation_refÚoperation_pollers	            r   ÚWaitForOperationr!   !   sp   € ð  |×+Ñ+Ð,€&ØÐ-Ò-Ø#×*Ñ*€Fˆ8Ñà—/‘/Ø‡nn˜V°
ð "ó <€-ä—]‘] 7¨LÓ9ÐÜ	‰Ð(¨-¸Ó	AÐAr   N)Ú__doc__Ú
__future__r   r   r   Ú)googlecloudsdk.api_lib.compute.operationsr   Úgooglecloudsdk.api_lib.utilr   r   r   r!   r
   r   r   Ú<module>r&      s)   ðñ )å &Ý Ý 'å <Ý .ò$ò$óBr   