
    z"                         S r SSKJr  SSKJr  SSKJr  SSK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S.r\	R                   R"                  4r\	R&                  " \	R                   R(                  \	R                   R*                  5      \	R,                   " S S\	R.                  5      5       5       r\	R&                  " \	R                   R"                  5      \	R,                   " S S\5      5       5       r\\l        g)zUpdate endpoint command.    )absolute_import)division)unicode_literalsN)activation_api)base)
exceptions)activation_flags)labels_utilz
          Update a firewall endpoint. Check the progress of endpoint update
          by using `gcloud network-security firewall-endpoints describe`.

          For more examples, refer to the EXAMPLES section below.

        a  
            To update labels k1 and k2, run:

            $ {command} my-endpoint --zone=us-central1-a --organization=1234 --update-labels=k1=v1,k2=v2

            To remove labels k3 and k4, run:

            $ {command} my-endpoint --zone=us-central1-a --organization=1234 --remove-labels=k3,k4

            To clear all labels from the firewall endpoint, run:

            $ {command} my-endpoint --zone=us-central1-a --organization=1234 --clear-labels
        )DESCRIPTIONEXAMPLESc                   .    \ rS rSrSr\S 5       rS rSrg)Update8   zYUpdate a Firewall Plus endpoint.

This command is used to update labels on the endpoint.
c                    U R                  5       [        ;   n[        R                  " U R                  5       UU5        [        R                  " US5        [        R
                  " U5        [        R                  " U5        [        R                  R                  U5        [        R                  R                  US5        [        R                  " U5        g )N60mT)ReleaseTrack_PROJECT_SCOPE_SUPPORTED_TRACKSr	   AddEndpointResource
AddMaxWaitAddDescriptionArgAddUpdateBillingProjectArgr   
ASYNC_FLAGAddToParser
SetDefaultr
   AddUpdateLabelsFlags)clsparserproject_scope_supporteds      9lib/surface/network_security/firewall_endpoints/update.pyArgsUpdate.Args@   s     	==  ((
 .&&v.//7OO'OOvt,$$V,    c                 ,
   UR                   R                  R                  5       nUR                  nUR                  R
                  [        R                  :H  n[        R                  " U R                  5       U5      nUR                  UR                  5       5      nUc  [        R                  " SS5      e/ nS n[        R                   R#                  U5      n	U	R%                  5       (       at  UR'                  S5        UR(                  nU	R+                  UR,                  R.                  R0                  UR(                  5      n
U
R2                  (       a  U
R(                  nUR4                  nU(       a  UR'                  S5        [7        US5      (       a'  UR9                  S5      (       a  UR'                  S5        [7        US5      (       a'  UR9                  S5      (       a  UR'                  S5        [7        US	5      (       a'  UR9                  S	5      (       a  UR'                  S
5        [7        US5      (       a'  UR9                  S5      (       a  UR'                  S5        [7        US5      (       a'  UR9                  S5      (       a  UR'                  S5        [7        US5      (       a'  UR9                  S5      (       a  UR'                  S5        [7        US5      (       a'  UR9                  S5      (       a  UR'                  S5        [7        US5      (       a'  UR9                  S5      (       a  UR'                  S5        [7        US5      (       a'  UR9                  S5      (       a  UR'                  S5        U(       d\  U R                  5       [:        R                  R<                  :X  a  [        R>                  " / SQ5      e[        R>                  " / SQ5      eUR@                  n[B        RD                  " URF                  S9nURI                  UR                  5       [K        USS 5      SRM                  U5      UU[K        USS 5      [K        USS 5      [K        US	S 5      [K        USS 5      [K        USS 5      [K        USS 5      [K        USS 5      [K        USS 5      [K        USS 5      S9nU(       a  UR9                  S5      (       d  SUl'        U$ URQ                  URS                  U5      SRO                  UR                  5       5      S US!9$ )"Nzfirewall-endpointz!Firewall endpoint does not exist.labelsbilling_project_idenable_wildfirezwildfire_settings.enabledwildfire_regionz!wildfire_settings.wildfire_regioncontent_cloud_regionz&endpoint_settings.content_cloud_regionwildfire_lookup_timeoutz3wildfire_settings.wildfire_realtime_lookup_durationwildfire_lookup_actionz9wildfire_settings.wildfire_realtime_lookup_timeout_actionwildfire_analysis_timeoutzOwildfire_settings.wildfire_inline_cloud_analysis_settings.max_analysis_durationwildfire_analysis_actionzHwildfire_settings.wildfire_inline_cloud_analysis_settings.timeout_action enable_wildfire_analysis_loggingz]wildfire_settings.wildfire_inline_cloud_analysis_settings.submission_timeout_logging_disabledblock_partial_httpz/endpoint_settings.http_partial_response_blocked)--clear-labels--remove-labels--update-labels--update-billing-projectz--enable-wildfirez--wildfire-regionz--content-cloud-regionz--wildfire-lookup-timeoutz--wildfire-lookup-actionz--wildfire-analysis-timeoutz--wildfire-analysis-actionz"--enable-wildfire-analysis-loggingz--block-partial-http)r/   r0   r1   r2   )secondsdescription,)namer4   update_maskr$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   formatdefaultz0waiting for firewall endpoint [{}] to be updatedT)operation_refmessage
has_resultmax_wait)*CONCEPTSfirewall_endpointParseresultconcept_typer6   r	   $PROJECT_ENDPOINT_RESOURCE_COLLECTIONr   Clientr   DescribeEndpointRelativeNamer   InvalidArgumentExceptionr
   DiffFromUpdateArgsMayHaveUpdatesappendr$   ApplymessagesFirewallEndpointLabelsValueneeds_updateupdate_billing_projecthasattrIsSpecifiedr   ALPHAMinimumArgumentExceptionasync_datetime	timedeltar=   UpdateEndpointgetattrjoinr8   WaitForOperationGetOperationRef)selfargsrA   endpointproject_scopedclientoriginalr7   r$   labels_difflabels_updater%   is_asyncr=   	operations                  r   Run
Update.RunQ   s   ]],,224F}}H 	  @@	A 
 ""4#4#4#6GF&&x'<'<'>?H//

-/ / KF""11$7K!!##"f!''
//
*
*
6
6
//m 
	#	#%%44-.t&''D,<,<=N,O,O45t&''D,<,<=N,O,O<=t+,,1A1A2 2 ABt.//D4D4D!5 5 NOt-..43C3C 4 4 
E t011d6F6F#7 7 
[ t/00T5E5E"6 6 
T 0 


=
>
>
i t)**t/?/?0 0 JK				 1 1 7 7	711 3
  	  11 3
  	 {{H!!$--8H%%""$D-6HH[)-&7>&7>$T+A4H '.G N&t-EtL")-t#
 "),d"
 *14d*
 #4)=tD) & I.  h''"",,Y7BII!!#
  #  r"    N)	__name__
__module____qualname____firstlineno____doc__classmethodr    rh   __static_attributes__rj   r"   r   r   r   8   s!    
 - - Lr"   r   c                   6   ^  \ rS rSrSr\U 4S j5       rSrU =r$ )UpdateAlpha   z Update a Firewall Plus endpoint.c                   > [         [        U ]  U5        [        R                  " U5        [        R
                  " U5        [        R                  " U5        [        R                  " U5        [        R                  " U5        [        R                  " U5        [        R                  " U5        [        R                  " U5        [        R                  " U5        g )N)superrs   r    r	   AddEnableWildfireArgAddWildfireRegionArgAddContentCloudRegionArgAddWildfireLookupTimeoutArgAddWildfireLookupActionArgAddWildfireAnalysisTimeoutArgAddWildfireAnalysisActionArg#AddEnableWildfireAnalysisLoggingArgAddBlockPartialHttpArg)r   r   	__class__s     r   r    UpdateAlpha.Args   s    	+s ())&1))&1--f5008//7226:11&988@++F3r"   rj   )	rk   rl   rm   rn   ro   rp   r    rq   __classcell__)r   s   @r   rs   rs      s     )
4 
4r"   rs   )ro   
__future__r   r   r   rW   :googlecloudsdk.api_lib.network_security.firewall_endpointsr   googlecloudsdk.callioper   r   +googlecloudsdk.command_lib.network_securityr	   $googlecloudsdk.command_lib.util.argsr
   DETAILED_HELPr   rT   r   ReleaseTracksBETAGADefaultUniverseOnlyUpdateCommandr   rs   detailed_helprj   r"   r   <module>r      s     &  '  U ( . H <0 	# 
 D%%**D,=,=,@,@AcT c  BcL D%%++,4& 4  -4" % r"   