
    	                         d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlmZ ddl	m
Z
 dd	lmZ e
j                   G d
 de
j                               Zy)z(Implementation of list command for HMAC.    )absolute_import)division)unicode_literalsN)api_factory)	cloud_api)base)storage_urlc                   0    e Zd ZdZdddZed        Zd Zy)ListzList service account HMAC keys.zW
       *{command}* lists the HMAC key metadata for keys in the current project.
      a/  
       To show metadata for all keys, including recently deleted keys:

         $ {command} --all --long

       To list only HMAC keys belonging to the service account
       ``test.sa@test.iam.gserviceaccount.com'':

         $ {command} --service-account=test.sa@test.iam.gserviceaccount.com
      )DESCRIPTIONEXAMPLESc                     | j                  dddd       | j                  dddt        j                  d             | j                  d	d
d       y )Nz-az--all
store_truez0Shows all keys, including recently deleted keys.)actionhelpz-lz--longzm            Use long listing format, showing the full metadata for each key
            excluding the secret.z-uz--service-accountz3Filter keys for the provided service account email.)r   )add_argumenttextwrapdedent)parsers     lib/surface/storage/hmac/list.pyArgsz	List.Args1   sp    
?	  A
 __ % &	  ' B  D    c              #   ^  K   |j                   rt        j                  j                  }nt        j                  j                  }t        j                  t        j                  j                        }|j                  |j                  |j                  |      D ]  }|j                    y w)N)service_account_emailshow_deleted_keysfields_scope)longr   FieldsScopeFULLSHORTr   get_apir	   ProviderPrefixGCSlist_hmac_keysservice_accountallmetadata)selfargsr   apihmac_keys        r   RunzList.RunD   s     yy**//l**00l


k88<<
=C&&"22((! ' 
 s   B+B-N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r,    r   r   r   r      s1    '
	
	-  D D$r   r   )r0   
__future__r   r   r   r   googlecloudsdk.api_lib.storager   r   googlecloudsdk.callioper   "googlecloudsdk.command_lib.storager	   UniverseCompatibleListCommandr   r3   r   r   <module>r:      sI    / &  '  6 4 ( : 24 2 2r   