
    @                     z    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	\R                  5      rg
)z%Surface for creating a firewall rule.    )appengine_firewall_api_client)base)
exceptions)firewall_rules_util)flags)logc                   8    \ rS rSrSrSSS.r\S 5       rS rSr	g	)
Create   zCreates a firewall rule.z{description}z          To create a new App Engine firewall rule, run:

              $ {command} 1234
                --source-range='2001:db8::/32'
                --action=deny
                --description='block traffic from the example range.'
          )DESCRIPTIONEXAMPLESc                 l    [         R                  R                  U 5        [         R                  " U SS9  g )NT)required)r   FIREWALL_PRIORITY_FLAGAddToParserAddFirewallRulesFlags)parsers    (lib/surface/app/firewall_rules/create.pyArgsCreate.Args+   s&    	  ,,V4	6    c                    [         R                  " U R                  5       5      n[        R                  " UR
                  5      nU[        R                  :X  a  [        R                  " SS5      e[        R                  " UR                  UR                  5      nUR                  X1R                  XAR                  5      n[        R                   " UR
                  5        U$ )Npriorityz/The `default` can not be created, only updated.)
api_clientGetApiClientForTrackReleaseTrackr   ParsePriorityr   DEFAULT_RULE_PRIORITYr   InvalidArgumentExceptionParseActionmessagesactionr
   source_rangedescriptionr   CreatedResource)selfargsclientr   r"   rules         r   Run
Create.Run0   s    ,,T->->-@AF"00?H&<<<//
GI I !,,V__dkkJF==#4#4f>N>NOD&Kr    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r*   __static_attributes__r,   r   r   r
   r
      s/      	- 7 7r   r
   N)r1   googlecloudsdk.api_lib.app.apir   r   googlecloudsdk.callioper   r   googlecloudsdk.command_lib.appr   r   googlecloudsdk.corer   CreateCommandr
   r,   r   r   <module>r:      s1    , W ( . > 0 #"T "r   