
    L                         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  G d dej                         Zddie_        y)z5Command for describing network firewall policy rules.    )absolute_import)division)unicode_literals)base_classes)firewall_policy_rule_utils)client)region_client)base)flagsc                   *    e Zd ZdZdZed        Zd Zy)Describez}Describes a Compute Engine network firewall policy rule.

  *{command}* is used to describe network firewall policy rules.
  Nc                     t        j                  dd      | _        | j                  j                  |       t        j                  |d       y )NTdescribe)required	operation	described)r   )r   !NetworkFirewallPolicyRuleArgumentNETWORK_FIREWALL_POLICY_ARGAddArgumentAddRulePriority)clsparsers     ?lib/surface/compute/network_firewall_policies/rules/describe.pyArgszDescribe.Args%   s>    &+&M&M'-C###//7	&K8    c                    t        j                  | j                               }| j                  j	                  ||j
                        }t        j                  ||j                        }t        |d      r!t        j                  ||j                        }|j                  t        j                  |j                        |j                  d      S )N)refcompute_clientregion)r   F)priorityfirewall_policyonly_generate_request)r   ComputeApiHolderReleaseTrackr   ResolveAsResource	resourcesr   NetworkFirewallPolicyRulehasattrr	   RegionNetworkFirewallPolicyRuleDescribeRule
rule_utilsConvertPriorityToIntr    r!   )selfargsholderr   #network_firewall_policy_rule_clients        r   RunzDescribe.Run,   s    **4+<+<+>?F

*
*
<
<f C*0*J*J+/'sH,9,Y,Y
fmm--) /;;00?,,# < % %r   )__name__
__module____qualname____doc__r   classmethodr   r1    r   r   r   r      s&    
 !%9 9%r   r   EXAMPLESa      To describe a rule with priority ``10'' in a global network firewall policy
    with name ``my-policy'', run:

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

    To describe a rule with priority ``10'' in a regional network firewall
    policy with name ``my-policy'', in region ``region-a'', run:

      $ {command} 10           --firewall-policy=my-policy --firewall-policy-region=region-a
    N)r5   
__future__r   r   r   googlecloudsdk.api_lib.computer   r   r+   8googlecloudsdk.api_lib.compute.network_firewall_policiesr   r	   googlecloudsdk.callioper
   <googlecloudsdk.command_lib.compute.network_firewall_policiesr   DescribeCommandr   detailed_helpr7   r   r   <module>r@      sL    < &  ' 7 S K R ( N%t## %@ 	 r   