
    8                         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r\
R                   " S S\
R                   5      5       rSSS.\l        g
)zBCommand for replacing the rules of organization firewall policies.    )absolute_import)division)unicode_literals)base_classes)client)base)firewall_policies_utils)flagsNc                   2    \ rS rSrSrSr\S 5       rS rSr	g)
CloneRules   a  Replace the rules of a Compute Engine organization firewall policy with rules from another policy.

*{command}* is used to replace the rules of organization firewall policies. An
 organization 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
   FirewallPolicyArgumentFIREWALL_POLICY_ARGAddArgumentAddArgsCloneRules)clsparsers     4lib/surface/compute/firewall_policies/clone_rules.pyArgsCloneRules.Args(   sD    #::!5C ''}'M	F#    c           	         [         R                  " U R                  5       5      nU R                  R	                  XR
                  SS9n[        R                  " UUR                  UR
                  [        R                  " U R                  5       5      R                  5       S9n[        R                  " XCR                  5       UR                  S9nUR                  SUUR                   S9$ )NF)with_project)refcompute_client	resourcesversion)organization)only_generate_request
dest_fp_idsource_firewall_policy)r   ComputeApiHolderReleaseTrackr   ResolveAsResourcer    r   OrgFirewallPolicysix	text_typelowerr	   GetFirewallPolicyIdNamer"   r   r%   )selfargsholderr   org_firewall_policyr$   s         r   RunCloneRules.Run0   s    **4+<+<+>?F

"
"
4
4U 5 C !22}}""d//1288:	 )<<XXZd6G6GJ ))##:: *  r    )
__name__
__module____qualname____firstlineno____doc__r   classmethodr   r3   __static_attributes__r5   r   r   r   r      s&     $ $r   r   z    To clone the rules of an organization firewall policy with ID ``123456789",
    from another organization firewall policy with ID ``987654321", run:

      $ {command} 123456789 --source-firewall-policy=987654321
    a       To clone rules to a firewall policy, the user must have the following
    permission: *`compute.firewallPolicies.cloneRules`.

    To find predefined roles that contain those permissions, see the [Compute
    Engine IAM roles](https://cloud.google.com/compute/docs/access/iam).
      )EXAMPLESzIAM PERMISSIONS)r:   
__future__r   r   r   googlecloudsdk.api_lib.computer   0googlecloudsdk.api_lib.compute.firewall_policiesr   googlecloudsdk.callioper   4googlecloudsdk.command_lib.compute.firewall_policiesr	   r
   r*   DefaultUniverseOnlyUpdateCommandr   detailed_helpr5   r   r   <module>rF      sb    I &  ' 7 C ( X F 
 $## $ $P

 r   