
                         R   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ dd	lmZ dd
lmZ ddlZej"                   ej$                  ej&                  j(                  ej&                  j*                         G d dej,                                      Zddie_        y)z8Command for deleting organization security policy rules.    )absolute_import)division)unicode_literals)base_classes)org_security_policy_rule_utils)client)base)flags)org_security_policies_utilsNc                   *    e Zd ZdZdZed        Zd Zy)DeletezDelete a Compute Engine organization security policy rule.

  *{command}* is used to delete organization security policy rule.
  Nc                     t        j                  dd      | _        | j                  j                  |       t        j                  |d       t        j
                  |d       |j                  j                  t         j                         y )NTdelete)required	operationdeleted)r   F)r   )	r
   OrgSecurityPolicyRuleArgumentORG_SECURITY_POLICY_ARGAddArgumentAddSecurityPolicyIdAddOrganizationdisplay_infoAddCacheUpdaterOrgSecurityPoliciesCompleter)clsparsers     9lib/surface/compute/org_security_policies/rules/delete.pyArgszDelete.Args(   sh    "'"E"E#+C++F3	f	:	&51
''(J(JK    c           	         t        j                  | j                               }| j                  j	                  ||j
                  d      }t        j                  ||j                  |j
                  t        j                  | j                               j                               }t        j                  ||j                  |j                        }|j                  t!        j"                  |j%                               |d      S )NF)with_project)refcompute_client	resourcesversion)organization)prioritysecurity_policy_idonly_generate_request)r   ComputeApiHolderReleaseTrackr   ResolveAsResourcer$   r   OrgSecurityPolicyRulesix	text_typelowerr   GetSecurityPolicyIdsecurity_policyr&   r   
rule_utilsConvertPriorityToIntName)selfargsholderr"   security_policy_rule_clientr(   s         r   Runz
Delete.Run1   s    **4+<+<+>?F

&
&
8
8fU 9 4C"(">">}}""d//1288:	#<
 5HH#&&( '--00<-# . % %r   )__name__
__module____qualname____doc__r   classmethodr   r:    r   r   r   r      s(    
 !L L%r   r   EXAMPLESz    To delete a rule with priority ``10'' in an organization security policy with
    ID ``123456789'', run:

      $ {command} 10 --security-policy=123456789
    )r>   
__future__r   r   r   googlecloudsdk.api_lib.computer   r   r3   4googlecloudsdk.api_lib.compute.org_security_policiesr   googlecloudsdk.callioper	   8googlecloudsdk.command_lib.compute.org_security_policiesr
   r   r.   UniverseCompatibleReleaseTracksr+   ALPHABETADeleteCommandr   detailed_helpr@   r   r   <module>rM      s    ? &  ' 7 W G ( J ` 
 D%%++T->->-C-CD!%T !% E !%J 	 r   