
    I                     `   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KJr  SS	KJr  S
SS.r\R                   \R"                  " \R$                  R&                  \R$                  R(                  \R$                  R*                  5       " S S\R,                  5      5       5       rg)z8Update command to update a new Custom Intercept profile.    )absolute_import)division)unicode_literals)intercept_api)base)sp_flags)labels_util)logz

          Update a Custom Intercept Security Profile.

          The supported fields for update are `description` and `labels`.

        a(  
          To update the description of a Custom Intercept Security Profile named `intercept-profile`, run:

              $ {command} intercept-profile --description="A new description"               --organization=1234567890 --location=global

          To change the labels of a Custom Intercept Security Profile named `intercept-profile`, run:

              $ {command} intercept-profile
              --update-labels=key1=value1,key2=value2                --delete-labels=key3,key4               --organization=1234567890 --location=glob
        )DESCRIPTIONEXAMPLESc                   8    \ rS rSrSr\r\S 5       rS r	S r
Srg)Update3   z#Updates a Custom Intercept Profile.c                 "   [         R                  " XR                  5       5        [         R                  " U5        [        R
                  R                  U5        [        R
                  R                  US5        [        R                  " U5        g )NF)
r   AddSecurityProfileResourceReleaseTrackAddProfileDescriptionr   
ASYNC_FLAGAddToParser
SetDefaultr	   AddUpdateLabelsFlags)clsparsers     Ilib/surface/network_security/security_profiles/custom_intercept/update.pyArgsUpdate.Args<   s[    ''0@0@0BC""6*OO'OOvu-$$V,    c                 z  ^ ^^ [         R                  " T R                  5       5      mUR                  R                  R                  5       mUR                  nUR                  n[        R                  " UTR                  R                  R                  UUU 4S jS9nTR                  TR                  5       UUR                  5       S9nU(       a.  UR                   n["        R$                  R'                  SU5        U$ TR)                  TR+                  U5      SR-                  TR                  5       5      SS9$ )Nc                  (   > TR                  T T5      $ N)	getLabels)clientsecurity_profileselfs   r   <lambda>Update.Run.<locals>.<lambda>M   s    $..9I"Jr   )orig_labels_thunk)namedescriptionlabelsz9Check for operation completion status using operation ID:z/Waiting for security-profile [{}] to be updatedT)operation_refmessage
has_result)r   Clientr   CONCEPTSr#   Parser)   async_r	   ProcessUpdateArgsLazymessagesSecurityProfileLabelsValueUpdateSecurityProfileRelativeName	GetOrNoner(   r
   statusPrintWaitForOperationGetOperationsRefformat)	r$   argsr)   is_asynclabels_updateresponseoperation_idr"   r#   s	   `      @@r   Run
Update.RunD   s   !!$"3"3"56F}}55;;=""K{{H55''33JM ++**,&&( , H ]]l	jj
E
 o ""--h7AHH))+
  #  r   c                 T    UR                  UR                  5       5      R                  $ r    )GetSecurityProfiler7   r*   )r$   r"   r#   s      r   r!   Update.getLabelsh   s#    $$%5%B%B%DELLLr    N)__name__
__module____qualname____firstlineno____doc__DETAILED_HELPdetailed_helpclassmethodr   rC   r!   __static_attributes__rH   r   r   r   r   3   s*    
 ,-- -"HMr   r   N)rM   
__future__r   r   r   9googlecloudsdk.api_lib.network_security.security_profilesr   googlecloudsdk.callioper   +googlecloudsdk.command_lib.network_securityr   $googlecloudsdk.command_lib.util.argsr	   googlecloudsdk.corer
   rN   DefaultUniverseOnlyReleaseTracksr   ALPHABETAGAUpdateCommandr   rH   r   r   <module>r^      s    ? &  ' S ( @ < #0 T..33T5F5F5I5I2MT 2M 2Mr   