
    a                         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KJ
r  SSS.r " S S\	R$                  5      r\\l        g)z$Update endpoint association command.    )absolute_import)division)unicode_literalsN)association_api)base)
exceptions)association_flags)labels_utila
  
          Update a firewall endpoint association. Check the progress of
          association update by using
            `gcloud network-security firewall-endpoint-associations describe`.

          For more examples, refer to the EXAMPLES section below.

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

            $ {command} my-assoc --zone=us-central1-a --project=my-proj --update-labels=k1=v1,k2=v2

          To remove labels k3 and k4, run:

            $ {command} my-assoc --zone=us-central1-a --project=my-proj --remove-labels=k3,k4

          To clear all labels from the firewall endpoint association, run:

            $ {command} my-assoc --zone=us-central1-a --project=my-proj --clear-labels
        )DESCRIPTIONEXAMPLESc                   6    \ rS rSrSr/ SQr\S 5       rS rSr	g)Update7   z,Update a Firewall Plus endpoint association.)z--clear-labelsz--remove-labelsz--update-labelsz--[no-]tls-inspection-policyz--[no-]disabledc                 (   [         R                  " U R                  5       U5        [         R                  " US5        [        R
                  R                  U5        [        R
                  R                  US5        UR                  5       n[         R                  " U5        UR                  5       n[        R                  " U5        UR                  5       n[         R                  " U R                  5       U5        [         R                  " U5        g )N60mT)r	   AddAssociationResourceReleaseTrack
AddMaxWaitr   
ASYNC_FLAGAddToParser
SetDefaultadd_mutually_exclusive_groupAddDisabledArg	add_groupr
   AddUpdateLabelsFlagsAddTLSInspectionPolicyAddNoTLSInspectionPolicyArg)clsparserouter_grouptls_and_labels_group	tls_groups        Elib/surface/network_security/firewall_endpoint_associations/update.pyArgsUpdate.ArgsB   s    ,,S-=-=-?H  /OO'OOvt,557K$$[1&002$$%9:$AACI,,S-=-=-?K11)<    c                 0   [         R                  " U R                  5       5      n0 nUR                  R                  R                  5       nUR                  UR                  5       5      nUc  [        R                  " SS5      eUR                  S5      (       a  [        USS5      US'   UR                  S5      (       aQ  UR                  R                  R                  5       nUc  [        R                  " S5      eUR                  5       US'   O[        USS5      (       a  SUS'   [        R                   R#                  U5      nUR%                  5       (       ai  UR&                  US	'   UR)                  UR*                  R,                  R.                  UR&                  5      nUR0                  (       a  UR&                  US	'   U(       d   [        R2                  " U R4                  5      eUR6                  n	[8        R:                  " UR<                  S
9n
UR?                  UR                  5       US9nU	(       a  UR                  S5      (       d  SUl         U$ URC                  URE                  U5      SRA                  UR                  5       5      SU
S9$ )zUpdates an association with labels and TLS inspection policy.

Args:
  args: argparse.Namespace, the parsed arguments.

Returns:
  A long running operation if async is set, None otherwise.
zfirewall-endpoint-associationz-Firewall endpoint association does not exist.disabledFtls_inspection_policyzTLS Inspection Policy resource path is either empty, malformed, or missing necessary flag `--tls-inspection-policy-region`.
NOTE: TLS Inspection Policy needs to be in the same region as Firewall Plus endpoint resource.no_tls_inspection_policy labels)seconds)nameupdate_fieldsformatdefaultz<waiting for firewall endpoint association [{}] to be updatedT)operation_refmessage
has_resultmax_wait)#r   Clientr   CONCEPTSfirewall_endpoint_associationParseDescribeAssociationRelativeNamer   InvalidArgumentExceptionIsSpecifiedgetattrr)   core_exceptionsErrorr
   DiffFromUpdateArgsMayHaveUpdatesr,   ApplymessagesFirewallEndpointAssociationLabelsValueneeds_updateMinimumArgumentException_valid_argumentsasync_datetime	timedeltar5   UpdateAssociationr0   WaitForOperationGetOperationRef)selfargsclientr/   associationoriginalparsed_policylabels_difflabels_updateis_asyncr5   	operations               r#   Run
Update.RunT   sK    ##D$5$5$78FM--==CCEK))+*B*B*DEH//
)
9 
 
##")$
E"BmJ/00mm99??Am		##
 	
 0=/I/I/Km+,	15	9	9/1m+,""11$7K!!## (mH!''
//
5
5
A
A
//m 
	#	#"/"6"6h//0E0EFF{{H!!$--8H((%%'# ) I
  h''"",,Y7JVK,,./ #  r&    N)
__name__
__module____qualname____firstlineno____doc__rJ   classmethodr$   r[   __static_attributes__r]   r&   r#   r   r   7   s'    4 = ="Hr&   r   )rb   
__future__r   r   r   rL   Fgooglecloudsdk.api_lib.network_security.firewall_endpoint_associationsr   googlecloudsdk.callioper   r   +googlecloudsdk.command_lib.network_securityr	   $googlecloudsdk.command_lib.util.argsr
   googlecloudsdk.corer?   DETAILED_HELPUpdateCommandr   detailed_helpr]   r&   r#   <module>rn      sX    + &  '  b ( . I < =2eT eP % r&   