
                             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  G d
 dej                        Zddie_        y)z/Command for updating network firewall policies.    )absolute_import)division)unicode_literals)base_classes)client)region_client)base)flagsc                   *    e Zd ZdZdZed        Zd Zy)UpdatezUpdate a Compute Engine network firewall policy.

  *{command}* is used to update network firewall policies. A network
  firewall policy is a set of rules that controls access to various resources.
  Nc                     t        j                  dd      | _        | j                  j                  |d       t        j                  |       y )NTupdate)required	operation)operation_type)r
   NetworkFirewallPolicyArgumentNETWORK_FIREWALL_POLICY_ARGAddArgument"AddArgsUpdateNetworkFirewallPolicy)clsparsers     7lib/surface/compute/network_firewall_policies/update.pyArgszUpdate.Args%   sA    &+&I&I'+C###//x/P	,,V4    c                    t        j                  | j                               }| j                  j	                  ||j
                        }t        j                  ||j                        }t        |d      r!t        j                  ||j                        }|j                  d      d   }|j                  j                  j                  |j                  |j                        }|j!                  |d      S )N)compute_clientregionF)only_generate_requestr   )descriptionfingerprint)firewall_policyr   )r   ComputeApiHolderReleaseTrackr   ResolveAsResource	resourcesr   NetworkFirewallPolicyhasattrr   RegionNetworkFirewallPolicyDescribemessagesFirewallPolicyr   r    r   )selfargsholderrefnetwork_firewall_policyexisting_firewall_policyr!   s          r   Runz
Update.Run,   s    **4+<+<+>?F

*
*
<
<f C %::FMM+sH - I I
fmm!-  7??#  @  %%& (mm,,;;$$,88 < :O #))'u * F Fr   )__name__
__module____qualname____doc__r   classmethodr   r2    r   r   r   r      s'     !%5 5Fr   r   EXAMPLESa      To update a global network firewall policy with name ``my-policy'',
    to change the description to ``New description'', run:

      $ {command} my-policy           --description='New description'           --global

    To update a regional network firewall policy with name ``my-policy'',
    in region ``my-region'',
    to change the description to ``New description'', run:

      $ {command} my-policy           --description='New description'           --region=my-region
    N)r6   
__future__r   r   r   googlecloudsdk.api_lib.computer   8googlecloudsdk.api_lib.compute.network_firewall_policiesr   r   googlecloudsdk.callioper	   <googlecloudsdk.command_lib.compute.network_firewall_policiesr
   UpdateCommandr   detailed_helpr8   r   r   <module>rA      sK    6 &  ' 7 K R ( N!FT !FJ 	 r   