
    	                         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\R                  5      r
 " S	 S
\R                  5      rg)zIAM completers.    )absolute_import)division)unicode_literals)
completers)	resourcesc                   <   ^  \ rS rSrSrSU 4S jjrS rS rSrU =r	$ )IamRolesCompleter   a  An IAM role completer for a resource argument.

The Complete() method override bypasses the completion cache.

Attributes:
  _resource_dest: The argparse Namespace dest string for the resource
    argument that has the roles.
  _resource_collection: The resource argument collection.
c                 F   > [         [        U ]
  " S0 UD6  Xl        X l        g )N )superr	   __init___resource_dest_resource_collection)selfresource_destresource_collectionkwargs	__class__s       0lib/googlecloudsdk/command_lib/iam/completers.pyr   IamRolesCompleter.__init__%   s"    	
T+5f5' 3    c                     [         R                  R                  UR                  U R                  5      U R
                  UR                  S9nUR                  5       nSSSSSSU/$ )N)
collectiondefault_resolverbetaiamzlist-grantable-rolesz--quietz--flatten=namez--format=disable)r   REGISTRYParseGetValuer   r   SelfLink)r   parameter_inforesource_refresource_uris       r   GetListCommand IamRolesCompleter.GetListCommand*   sq    %%++ 3 34,,'00 , 2L  ((*LE190,@ @r   c                     U R                  U5      nU R                  X25      nU=(       d    /  Vs/ s H"  nUc  M  UR                  U5      (       d  M   UPM$     sn$ s  snf )z;Bypasses the cache and returns completions matching prefix.)r%   GetAllItems
startswith)r   prefixr"   commanditemsitems         r   CompleteIamRolesCompleter.Complete3   s`    !!.1GW5E"$ 	 $ 7 	  s   AAA)r   r   )NN)
__name__
__module____qualname____firstlineno____doc__r   r%   r.   __static_attributes____classcell__r   s   @r   r	   r	      s    4
@ r   r	   c                   (   ^  \ rS rSrU 4S jrSrU =r$ )IamServiceAccountCompleter=   c                 2   > [         [        U ]
  " SSS0UD6  g )Nlist_commandzBiam service-accounts list --quiet --flatten=email --format=disabler   )r   r9   r   )r   r   r   s     r   r   #IamServiceAccountCompleter.__init__?   s'    	
$d4 9 r   r   )r0   r1   r2   r3   r   r5   r6   r7   s   @r   r9   r9   =   s     r   r9   N)r4   
__future__r   r   r   googlecloudsdk.command_lib.utilr   googlecloudsdk.corer   ListCommandCompleterr	   r9   r   r   r   <module>rB      s>      &  ' 6 ) 
77  F!@!@ r   