
    v
                     R   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                    e
j"                  e
j$                  j&                  e
j$                  j(                  e
j$                  j*                         G d
 de
j,                                      Zy)z9Command to delete a policy on the given attachment point.    )absolute_import)division)unicode_literalsN)policies)base)policies_flags)logc                   N    e Zd ZdZd ej
                  d      iZed        Zd Z	y)DeletezBDelete a policy on the given attachment point with the given name.EXAMPLESaO            The following command deletes the IAM policy defined at the resource
          project ``123'' of kind ``denypolicies'' and id ``my-deny-policy'',
          with etag ``abc'':

            $ {command} my-deny-policy --attachment-point=cloudresourcemanager.googleapis.com/projects/123 --kind=denypolicies --etag=abc
          c                    t        j                         j                  |        t        j                         j                  |        t        j                         j                  |        t        j
                         j                  |        y )N)flagsGetAttachmentPointFlagAddToParserGetKindFlagGetPolicyIDFlagGetEtagFlag)parsers    "lib/surface/iam/policies/delete.pyArgszDelete.Args.   s^    	  "..v6	##F+	''/	##F+    c           	         |j                   j                         }t        j                  |      }t        j                  |      }|j
                  j                  dd      }dddd}|j                  j                  |j                  dj                  ||j                  |j                        |j                              }t        j                  |j                   ||j                     d	
       |S )N/z%2F
denyPolicyprincipalAccessBoundaryPolicyaccessboundaryPolicy)denypoliciesprincipalaccessboundarypoliciesaccessboundarypolicieszpolicies/{}/{}/{})nameetagT)is_async)calliope_commandReleaseTrackapisGetClientInstanceGetMessagesModuleattachment_pointreplacer   r   IamPoliciesDeleteRequestformatkind	policy_idr!   r	   DeletedResourcer    )selfargsrelease_trackclientmessagesr(   kindsresults           r   Runz
Delete.Run5   s    ))668M##M2F%%m4H,,44S%@$+J"8E
 __##))$++,<dii,0NN< 	* 	F
 U499%5EMr   N)
__name__
__module____qualname____doc__textwrapdedentdetailed_helpstaticmethodr   r6    r   r   r   r      s@     K 
(//  	- , ,r   r   )r:   
__future__r   r   r   r;   googlecloudsdk.api_lib.iamr   r%   googlecloudsdk.callioper   googlecloudsdk.command_lib.iamr   r   googlecloudsdk.corer	   UniverseCompatibleReleaseTracksr$   ALPHABETAGADeleteCommandr   r?   r   r   <module>rK      s    @ &  '  7 ( B # D%%++T->->-C-C%%((*%T %* %r   