
    `                     p   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                  \
R                   " \
R"                  R$                  \
R"                  R&                  \
R"                  R(                  5       " S S\
R*                  5      5       5       rSS0\l        g
)z<Command for replace rules of organization security policies.    )absolute_import)division)unicode_literals)base_classes)client)base)flags)org_security_policies_utilsNc                   2    \ rS rSrSrSr\S 5       rS rSr	g)	CopyRules   a  Replace the rules of a Compute Engine organization security policy with rules from another policy.

*{command}* is used to replace the rules of organization security policies. An
 organization security 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copy the rules to)required	operationz
copy-rules)operation_type)r	   OrgSecurityPolicyArgumentORG_SECURITY_POLICY_ARGAddArgumentAddArgsCopyRules)clsparsers     7lib/surface/compute/org_security_policies/copy_rules.pyArgsCopyRules.Args+   sB    "'"A"A!4#6C++F<+P	6"    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_sp_idsource_security_policy)r   ComputeApiHolderReleaseTrackr   ResolveAsResourcer    r   OrgSecurityPolicysix	text_typelowerr
   GetSecurityPolicyIdNamer"   r   r%   )selfargsholderr   org_security_policyr$   s         r   RunCopyRules.Run2   s    **4+<+<+>?F

&
&
8
8U 9 4C 22}}""d//1288:	<
 -@@XXZd6G6GIJ((##:: ) < <r    )
__name__
__module____qualname____firstlineno____doc__r   classmethodr   r3   __static_attributes__r5   r   r   r   r      s&    
 !# #<r   r   EXAMPLESz    To copy the rules of an organization security policy with ID ``123456789'',
    from another organization security policy with ID ``987654321'', run:

      $ {command} 123456789 --source-security-policy=987654321
    )r:   
__future__r   r   r   googlecloudsdk.api_lib.computer   4googlecloudsdk.api_lib.compute.org_security_policiesr   googlecloudsdk.callioper   8googlecloudsdk.command_lib.compute.org_security_policiesr	   r
   r*   UniverseCompatibleReleaseTracksr'   ALPHABETAGAUpdateCommandr   detailed_helpr5   r   r   <module>rJ      s    C &  ' 7 G ( J ` 
 T..33T5F5F5I5I<"" < <F 		 r   