
                            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
KJr  SSS.r\R$                  R&                  \R$                  R(                  4r\R,                  \R.                  " \R$                  R&                  \R$                  R(                  \R$                  R0                  5       " S S\R2                  5      5       5       r\\l        g)z;Update command to update a security profile group resource.    )absolute_import)division)unicode_literals)spg_api)base)	spg_flags)labels_util)
exceptions)logzA

          Update details of a Security Profile Group.

        a  
          To update a Security Profile Group with new threat prevention profile `my-new-security-profile`, run:

              $ {command} my-security-profile-group --organization=1234 --location=global --threat-prevention-profile=`organizations/1234/locations/global/securityProfiles/my-new-security-profile` --description='New Security Profile of type threat prevention'

        )DESCRIPTIONEXAMPLESc                   4    \ rS rSrSr\S 5       rS rS rSr	g)UpdateProfileGroup/   z Update a Security Profile Group.c           	         [         R                  " XR                  5       5        [         R                  " U5        S nU R                  5       [        ;   a   UR                  SS9nUR                  SSSS9  [         R                  " UU R                  5       SUSS	/S
9  U R                  5       [        ;   aF  UR                  SS9nUR                  SSSS9  [         R                  " UU R                  5       SUSS9  [        R                  " U5        [        R                  R                  U5        [        R                  R                  US5        g )NT)mutexz!--clear-threat-prevention-profile
store_truezA            Clear the threat-prevention-profile field.
          )actionhelpzthreat-prevention-profileFzsecurity-profile)grouprequiredarg_aliasesz--clear-url-filtering-profilez=            Clear the url-filtering-profile field.
          zurl-filtering-profile)r   r   )r   AddSecurityProfileGroupResourceReleaseTrackAddProfileGroupDescription_URL_FILTERING_SUPPORTED	add_groupadd_argumentAddSecurityProfileResourcer	   AddUpdateLabelsFlagsr   
ASYNC_FLAGAddToParser
SetDefault)clsparserthreat_prevention_groupurl_filtering_groups       >lib/surface/network_security/security_profile_groups/update.pyArgsUpdateProfileGroup.Args6   sC   --f6F6F6HI((0"
55 & 0 0t 0 <**
- +  ((#%'( 55",,4,8&&
) '  **





!# $$V,OO'OOvu-    c                 T    UR                  UR                  5       5      R                  $ N)GetSecurityProfileGroupRelativeNamelabels)selfclientsecurity_profile_groups      r(   getLabelUpdateProfileGroup.getLabelb   s&    ))++-fr+   c           	        ^ ^
^ [         R                  " T R                  5       5      m
UR                  R                  R                  5       mUR                  (       a$  UR                  R                  R                  5       OS nT R                  5       [        ;   a6  UR                  (       a%  UR                  R                  R                  5       nOS nUR                  nUR                  n[        R                  " UT
R                  R                  R                  U
UU 4S jS9nUR                   S:w  a#  ["        R$                  " SUR                   -  5      e/ nUc)  T R                  5       [        ;   a"  UR&                  (       a  UR)                  S5        Uc)  T R                  5       [        ;   a"  UR*                  (       a  UR)                  S5        Ub  UR)                  S5        U(       d  ["        R$                  " S5      eT
R-                  TR/                  5       Ub  UOS Ub  UR/                  5       OS Ub  UR/                  5       OS S	R1                  U5      UR3                  5       S
9nU(       a.  UR4                  n	[6        R8                  R;                  SU	5        U$ T
R=                  T
R?                  U5      SRA                  TR/                  5       5      SS9$ )Nc                  (   > TR                  T T5      $ r-   )r4   )r2   r3   r1   s   r(   <lambda>(UpdateProfileGroup.Run.<locals>.<lambda>|   s    $--8N"Or+   )orig_labels_thunkglobalz0Only `global` location is supported, but got: %sthreatPreventionProfileurlFilteringProfiledescriptionzOperation failed to satisfy minimum qualification. Please specify the attribute which needs an update. `description` and/or `security profile` can be updated.,)security_profile_group_namer>   threat_prevention_profileurl_filtering_profileupdate_maskr0   z9Check for operation completion status using operation ID:z5Waiting for security-profile-group [{}] to be updatedT)operation_refmessage
has_result)!r   Clientr   CONCEPTSr3   ParserA   r   rB   r>   async_r	   ProcessUpdateArgsLazymessagesSecurityProfileGroupLabelsValuelocationcore_exceptionsErrorclear_threat_prevention_profileappendclear_url_filtering_profileUpdateSecurityProfileGroupr/   join	GetOrNonenamer   statusPrintWaitForOperationGetOperationsRefformat)r1   argsrA   rB   r>   is_asynclabels_updaterC   responseoperation_idr2   r3   s   `         @@r(   RunUpdateProfileGroup.Rung   s   ^^D--/0F!]]AAGGI )) 	//557  	77&&"mmAAGGI"""K{{H55,,88OM }} !!
<t}}
L  K!-"::0023)"::,,./'!!&  00$:$G$G$I#.#:K$0 #<"H"H"J , 4@@BHH[)&&( 1 H ]]l	jj
E
 o ""--h7GNN"//1
  #  r+    N)
__name__
__module____qualname____firstlineno____doc__classmethodr)   r4   rc   __static_attributes__re   r+   r(   r   r   /   s%    
 )). ).V
Nr+   r   N)rj   
__future__r   r   r   ?googlecloudsdk.api_lib.network_security.security_profile_groupsr   googlecloudsdk.callioper   +googlecloudsdk.command_lib.network_securityr   $googlecloudsdk.command_lib.util.argsr	   googlecloudsdk.corer
   rP   r   _detailed_helpr   ALPHABETAr   DefaultUniverseOnlyReleaseTracksGAUpdateCommandr   detailed_helpre   r+   r(   <module>r{      s    B &  ' S ( A < = #
 	T..33 
 T..33T5F5F5I5IB++ B BJ $2   r+   