
    p                         S r SSKJr  SSKJr  SSKJr  SSK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\	R"                  5      rg)z+Command for deleting a service account key.    )absolute_import)division)unicode_literalsN)util)base)iam_util)log)	resources)
console_ioc                   V    \ rS rSrSrS\R                  " S5      0r\S 5       r	S r
Srg)	Delete    zxDelete a service account key.

If the service account does not exist, this command returns a
`PERMISSION_DENIED` error.
EXAMPLESa  
          To delete a key with ID `b4f1037aeef9ab37deee9` for the service
          account `my-iam-account@my-project.iam.gserviceaccount.com`, run:

            $ {command} b4f1037aeef9ab37deee9 --iam-account=my-iam-account@my-project.iam.gserviceaccount.com
      c                 p    U R                  SS[        R                  " 5       SS9  U R                  SSSS9  g )	Nz--iam-accountTz                          The service account from which to delete a key.

                          To list all service accounts in the project, run:

                            $ gcloud iam service-accounts list
                        )requiredtypehelpkeyzKEY-IDzThe key to delete.)metavarr   )add_argumentr   GetIamAccountFormatValidator)parsers    /lib/surface/iam/service_accounts/keys/delete.pyArgsDelete.Args0   sH    
!%%BBD  	  (1  3    c                    [         R                  R                  UR                  SUR                  SS.S9nUR
                  n[        R                  " SR                  UR                  UR                  5      SS9  [        R                  " 5       u  pEUR                  R                  UR                  UR                  5       S95        [        R                   R#                  S	R                  UR                  U5      5        g )
Nz!iam.projects.serviceAccounts.keys-)serviceAccountsId
projectsId)
collectionparamsz<You are about to delete key [{0}] for service account [{1}].T)messagecancel_on_no)namez+deleted key [{1}] for service account [{0}])r
   REGISTRYParser   iam_accountkeysIdr   PromptContinueformatr   GetClientAndMessagesprojects_serviceAccounts_keysr   +IamProjectsServiceAccountsKeysDeleteRequestRelativeNamer	   statusPrint)selfargskey_refr   clientmessagess         r   Run
Delete.RunA   s      &&6!%!1!1
 ' G ..C$*:*:;
 002F
((//<<%%' 	= 	)* JJBII#  r    N)__name__
__module____qualname____firstlineno____doc__textwrapdedentdetailed_helpstaticmethodr   r7   __static_attributes__r9   r   r   r   r       s<     (// #
 - 3 3  r   r   )r>   
__future__r   r   r   r?   googlecloudsdk.api_lib.iamr   googlecloudsdk.callioper   googlecloudsdk.command_lib.iamr   googlecloudsdk.corer	   r
   googlecloudsdk.core.consoler   Commandr   r9   r   r   <module>rK      s8     2 &  '  + ( 3 # ) 25 T\\ 5 r   