
                         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\	5      r
g)	z)Base client for Eventarc API interaction.    )
exceptions)apis)waiter)	resourcesc                   8    \ rS rSrSrS rSS jr\S 5       rSr	g)	EventarcClientBase   z1Base Client for interaction with of Eventarc API.c                 ^    [         R                  " X5      nUR                  U l        X0l        g )N)r   GetClientInstanceprojects_locations_operations_operation_service_resource_label)selfapi_nameapi_versionresource_labelclients        +lib/googlecloudsdk/api_lib/eventarc/base.py__init__EventarcClientBase.__init__   s&    ##H:F$BBD)    c                    [         R                  " U R                  5      n[        R                  R                  UR                  SS9nUR                  5       nUR                  5       R                  5       R                  5       nUR                  5       R                  5       n	SR                  X R                  XxU	5      n
U(       a  SR                  X5      n
 [         R                  " XVU
SS9$ ! [        R                   aJ  nSR                  U R                  Xy5      nSU R                  < S	U< S
3n[        R                   " XS9eSnAff = f)a  Waits until the given long-running operation is complete.

Args:
  operation: the long-running operation to wait for.
  operation_type: str, the type of operation (Creating, Updating or
    Deleting).
  resource_ref: Resource to reference.
  loading_msg: str, the message prompt to the user for a long-running
    operation.

Returns:
  The long-running operation's response.

Raises:
  HttpException: when failing to pull the long-running operation's status.
z&eventarc.projects.locations.operations)
collectionz){} {} [{}] in project [{}], location [{}]z{}, {}i N  )wait_ceiling_msz,gcloud eventarc {} describe {} --location={}zFailed to poll status of the operation, but the operation may have succeeded. {status_message} After fixing the permission issue, either check the z by running `z!`, or rerun the original command.)error_formatN)r   CloudOperationPollerNoResourcesr   r   REGISTRYParsenameNameParentformatr   WaitForapitools_exceptionsHttpForbiddenError_resource_label_pluralr   HttpException)r   	operationoperation_typeresource_refloading_msgpolleroperation_refresource_nameproject_namelocation_namemessageedesc_cmderror_messages                 r   r#   EventarcClientBase.WaitFor!   s4   " 33D4K4KLF&&,,#K - MM %%'M&&(//1668L '')..0M &~7K7K'4'4!6  5gD^^
%  11 
D?FF

%
%}h +m $$QCC
Ds   C/ /EAEEc                 8    SR                  U R                  5      $ )Nz{}s)r"   r   )r   s    r   r&   )EventarcClientBase._resource_label_pluralN   s    <<,,--r   )r   r   N) )
__name__
__module____qualname____firstlineno____doc__r   r#   propertyr&   __static_attributes__ r   r   r   r      s%    9*
+DZ . .r   r   N)r=   apitools.base.pyr   r$   googlecloudsdk.api_lib.utilr   r   googlecloudsdk.corer   objectr   r@   r   r   <module>rE      s'    0 ? , 2 . )7. 7.r   