
                             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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.    )absolute_import)division)unicode_literals)
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-   2   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   _ParseCertificateMapEntryr2   <   s2    			 !:
 5 
 
6 6r   c                 J    [        5       R                  U [        SS.[        S9$ r   )r   r%   r&   _CERTIFICATES_COLLECTION)certificates    r   _ParseCertificater6   G   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>   Q   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-   r8   SelfLinkresources    r   CertificateMapUriFuncrI   f   s    	hmm	,	5	5	77r   c                 H    [        U R                  5      R                  5       $ rE   )r2   r8   rF   rG   s    r   CertificateMapEntryUriFuncrK   j   s    	"8==	1	:	:	<<r   c                 H    [        U R                  5      R                  5       $ rE   )r6   r8   rF   rG   s    r   CertificateUriFuncrM   n   s    	8==	)	2	2	44r   N)F)__doc__
__future__r   r   r   *googlecloudsdk.api_lib.certificate_managerr   r   googlecloudsdk.corer   r	   r
   r'   r+   r0   r4   r&   r   r)   r-   r2   r6   r>   rI   rK   rM   r   r   r   <module>rR      sl    : &  ' A A # * )K V &s #O D)/6+*8=5r   