
                             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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0\l        g)zBCommand for replacing the rules of organization firewall policies.    )absolute_import)division)unicode_literals)base_classes)client)region_client)base)scope)flagsc                   2    \ rS rSrSrSr\S 5       rS rSr	g)
CloneRules   zReplace the rules of a Compute Engine network firewall policy with rules from another policy.

*{command}* is used to replace the rules of network firewall policies. A
 network firewall policy is a set of rules that controls access to
 various resources.
Nc                     [         R                  " SSS9U l        U R                  R                  USS9  [         R                  " U5        g )NTzclone the rules to)required	operationzclone-rules)operation_type)r   NetworkFirewallPolicyArgumentNETWORK_FIREWALL_POLICY_ARGAddArgumentAddArgsCloneRules)clsparsers     <lib/surface/compute/network_firewall_policies/clone_rules.pyArgsCloneRules.Args'   sG    &+&I&I!5'7C###//} 0 .	F#    c                 ,   [         R                  " U R                  5       5      nU R                  R	                  XR
                  5      n[        R                  R                  n[        R                  " X2R                  S9n[        US5      (       a8  [        R                  " X2R                  S9n[        R                  R                  n[        R                   " 5       R	                  XR
                  US9nUR#                  UR%                  5       SS9$ )N)compute_clientregion)default_scopeF)source_firewall_policyonly_generate_request)r   ComputeApiHolderReleaseTrackr   ResolveAsResource	resourcescompute_scope	ScopeEnumGLOBALr   NetworkFirewallPolicyhasattrr   RegionNetworkFirewallPolicyREGIONr   $NetworkSrcFirewallPolicyRuleArgumentr   SelfLink)selfargsholderrefr
   network_firewall_policysrc_firewall_policy_refs          r   RunCloneRules.Run/   s    **4+<+<+>?F

*
*
<
< C##**E$::MM+sH - I I
mm!-%%,,e#HH e  5  #--6??A# . % %r    )
__name__
__module____qualname____firstlineno____doc__r   classmethodr   r6   __static_attributes__r8   r   r   r   r      s&     !%$ $%r   r   EXAMPLESa0      To clone the rules of a global network firewall policy with NAME
    ``my-policy'',
    from another network firewall policy with NAME
    ``source-policy'', run:

      $ {command} my-policy --source-firewall-policy=source-policy --global

    To clone the rules of a region network firewall policy with NAME
    ``my-region-policy'', in region ``region-a'',
    from another network firewall policy with NAME
    ``source-policy'', run:

      $ {command} my-region-policy           --source-firewall-policy=source-policy           --region=region-a
    N)r=   
__future__r   r   r   googlecloudsdk.api_lib.computer   8googlecloudsdk.api_lib.compute.network_firewall_policiesr   r   googlecloudsdk.callioper	   "googlecloudsdk.command_lib.computer
   r'   <googlecloudsdk.command_lib.compute.network_firewall_policiesr   UpdateCommandr   detailed_helpr8   r   r   <module>rI      sM    I &  ' 7 K R ( E N$%## $%N 	
 r   