
    	                     F   d Z ddlmZ ddlmZ ddlmZ ddl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 ej$                  ej&                   ej(                  ej*                  j,                         G d dej.                                             Zddie_        y)z&Command for updating network policies.    )absolute_import)division)unicode_literalsN)ClassVar)base_classes)client)base)flagsc                       e Zd ZU dZeej                     ed<   ede	j                  fd       Zde	j                  fdZy)UpdatezUpdate a Compute Engine network policy.

  *{command}* is used to update network policies. A network
  policy is a set of rules that classifies network traffic.
  NETWORK_POLICY_ARGparserc                     t        j                  dd      | _        | j                  j                  |d       t        j                  |       y )NTupdate)required	operation)operation_type)r
   NetworkPolicyArgumentr   AddArgumentAddArgsUpdateNetworkPolicy)clsr   s     .lib/surface/compute/network_policies/update.pyArgszUpdate.Args+   sC    "88C &&vh&G	$$V,    argsc                 Z   t        j                  | j                               }| j                  j	                  ||j
                        }t        j                  ||j                        }|j                  j                  j                  |j                        }|j                  |      S )N)compute_client)description)network_policy)r   ComputeApiHolderReleaseTrackr   ResolveAsResource	resourcesr   NetworkPolicymessagesr   r   )selfr   holderrefnetwork_policy_clientnew_network_policys         r   Runz
Update.Run3   s    **4+<+<+>?F

!
!
3
3D&:J:J
KC"00FMM  //==$$ >  !''7I'JJr   N)__name__
__module____qualname____doc__r   compute_flagsResourceArgument__annotations__classmethodargparseArgumentParserr   	Namespacer+    r   r   r   r      sM     }==>>-// - -Kh(( Kr   r   EXAMPLESz    To update a network policy with name ``my-policy'',
    to change the description to ``New description'', run:

      $ {command} my-policy           --description='New description'           --region=my-region
    )r/   
__future__r   r   r   r4   typingr   googlecloudsdk.api_lib.computer   /googlecloudsdk.api_lib.compute.network_policiesr   googlecloudsdk.callioper	   "googlecloudsdk.command_lib.computer
   r0   3googlecloudsdk.command_lib.compute.network_policiesHiddenUniverseCompatibleReleaseTracksr!   ALPHAUpdateCommandr   detailed_helpr7   r   r   <module>rF      s    - &  '   7 B ( E E D%%++,KT K -  K@  	 r   