
                             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rSr	S	r
S
rS rS rS rS rS rS rSS jrS rS rS rg)z3General utilities for Certificate Manager commands.    )
api_client)
operations)log)
properties)	resourcesz0certificatemanager.projects.locations.operationsz5certificatemanager.projects.locations.certificateMapszKcertificatemanager.projects.locations.certificateMaps.certificateMapEntriesz2certificatemanager.projects.locations.certificatesc                  d    [         R                  R                  R                  R	                  SS9$ )NT)required)r   VALUEScoreprojectGet     :lib/googlecloudsdk/command_lib/certificate_manager/util.py<lambda>r      s$    :$$))1155t5Dr   c                      [         R                  R                  5       n U R                  S[        R
                  5        U $ )Ncertificatemanager)r   REGISTRYCloneRegisterApiByNamer   API_VERSION)registrys    r   _GetRegistryr      s2    %%'(
1:3I3IJ	/r   c                 J    [        5       R                  U [        SS.[        S9$ Nglobal)
projectsIdlocationsIdparams
collection)r   Parse_PROJECT_OPERATIONS_COLLECTION)	operations    r   _ParseOperationr&   %   s/    			 ! ( 
 
) )r   c                 J    [        5       R                  U [        SS.[        S9$ r   )r   r"   r#   _CERTIFICATE_MAPS_COLLECTION)certificate_maps    r   _ParseCertificateMapr*   /   s/    			 ! . 
 
/ /r   c                 T    [        5       R                  U [        S[        S.[        S9$ )Nr   )r   r   certificateMapIdr   )r   r"   r#   r(   #_CERTIFICATE_MAP_ENTRIES_COLLECTION)certificate_map_entrys    r   _ParseCertificateMapEntryr/   9   s2    			 !:
 5 
 
6 6r   c                 J    [        5       R                  U [        SS.[        S9$ r   )r   r"   r#   _CERTIFICATES_COLLECTION)certificates    r   _ParseCertificater3   D   s/    			 ! * 
 
+ +r   c                 D   [        U R                  5      nU(       a>  [        R                  R	                  SR                  UR                  5       5      5        U $ Sn[        R                  " 5       nUR                  X#R                  UR                  5       5      5      n U $ )zHandles waiting for the operation and printing information about it.

Args:
  response: Response from the API call
  is_async: If true, do not wait for the operation

Returns:
  The last information about the operation.
zStarted '{}'zWaiting for '{}' to complete)
r&   namer   statusPrintformatNamer   OperationClientWaitForOperation)responseis_asyncoperation_refmessageoperations_clients        r   r;   r;   N   s     "(--0-JJ%,,]-?-?-ABC 
/	 /G"224 11~~m&8&8&:;=H	/r   c                 H    [        U R                  5      R                  5       $ N)r*   r5   SelfLinkresources    r   CertificateMapUriFuncrF   c   s    	hmm	,	5	5	77r   c                 H    [        U R                  5      R                  5       $ rB   )r/   r5   rC   rD   s    r   CertificateMapEntryUriFuncrH   g   s    	"8==	1	:	:	<<r   c                 H    [        U R                  5      R                  5       $ rB   )r3   r5   rC   rD   s    r   CertificateUriFuncrJ   k   s    	8==	)	2	2	44r   N)F)__doc__*googlecloudsdk.api_lib.certificate_managerr   r   googlecloudsdk.corer   r   r   r$   r(   r-   r1   r#   r   r&   r*   r/   r3   r;   rF   rH   rJ   r   r   r   <module>rN      sf    : B A # * )K V &s #O D)/6+*8=5r   