
    |                     p   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KJr  SSKJr  SSKJr  \R(                  \R*                  " \R,                  R.                  \R,                  R0                  5       " S S\R2                  5      5       5       rSSS.\l        g)zCommand for updating groups.    )absolute_import)division)unicode_literals)networkconnectivity_api)networkconnectivity_util)waiter)base)flags)labels_util)repeated)log)	resourcesc                   :    \ rS rSrSr\S 5       rS rS rS r	Sr
g)	Update!   z0Update a group.

Update the details of a group.
c           	          [         R                  " U S5        [         R                  " U S5        [         R                  " U 5        [        R
                  " U 5        [        R                  " U SSSSSS9  g )	Nz	to updatezNew description of the group.groupzauto-accept-projectszauto-accept projectszpThis controls the list of project ids or
        project numbers for which auto-accept is enabled for the group.F)additional_helpinclude_set)r
   AddGroupResourceArgAddDescriptionFlagAddAsyncFlagr   AddUpdateLabelsFlagsr   AddPrimitiveArgs)parsers    6lib/surface/network_connectivity/hubs/groups/update.pyArgsUpdate.Args)   sb    	fk2	V%DE	v$$V,K    c                   ^ / nUR                   nUb  UR                  S5        S n[        R                  R	                  U5      nUR                  U5      mUR                  5       (       ah  UR                  UR                  R                  R                  TR                  5      nUR                  (       a  UR                  nUR                  S5        U4S jn	[        R                  " USU	5      n
S nU
b*  UR                  R                  U
S9nUR                  S5        UR                  R                  XVUS9nUR!                  X,U5      $ )Ndescriptionlabelsc                  N   > T R                   c  / $ T R                   R                  $ N
autoAcceptautoAcceptProjectsoriginal_groups   r   !_get_current_auto_accept_projectsAUpdate.UpdateGroupBeta.<locals>._get_current_auto_accept_projectsL   &    		"	"	*	&&999r   auto_accept_projectsr'    auto_accept.auto_accept_projectsr!   r"   r&   )r!   appendr   DiffFromUpdateArgsGetMayHaveUpdatesApplymessages)GoogleCloudNetworkconnectivityV1betaGroupLabelsValuer"   needs_updater   ParsePrimitiveArgs.GoogleCloudNetworkconnectivityV1betaAutoAcceptUpdateGroupBetaselfclient	group_refargsupdate_maskr!   r"   labels_difflabels_updater*   r-   auto_acceptr   r)   s                @r   r=   Update.UpdateGroupBeta9   sD   K""K'F""11$7KZZ	*N!!##!''
//
C
C
O
O


m 
	#	#%%8$:
 $66$&G K'
//
H
H!5 I  
 ;< OOEE; F E !!)K@@r   c                   ^ / nUR                   nUb  UR                  S5        S n[        R                  R	                  U5      nUR                  U5      mUR                  5       (       ah  UR                  UR                  R                  R                  TR                  5      nUR                  (       a  UR                  nUR                  S5        U4S jn	[        R                  " USU	5      n
S nU
b*  UR                  R                  U
S9nUR                  S5        UR                  R                  XVUS9nUR!                  X,U5      $ )Nr!   r"   c                  N   > T R                   c  / $ T R                   R                  $ r$   r%   r(   s   r   r*   ?Update.UpdateGroupGA.<locals>._get_current_auto_accept_projectsv   r,   r   r-   r.   r/   r0   )r!   r1   r   r2   r3   r4   r5   r6   r7   Groupr9   r"   r:   r   r;   
AutoAcceptUpdateGroupr>   s                @r   UpdateGroupGAUpdate.UpdateGroupGAd   s>   K""K'F""11$7KZZ	*N!!##!''
//


+
+^-B-Bm 
	#	#%%8$:
 $66$&G K'OO..1 / k ;< OO!!; " E i<<r   c                 <   [         R                  " U R                  5       S9nUR                  R                  R                  5       nU R                  5       [        R                  R                  :X  a  U R                  X#U5      nOU R                  X#U5      n[        R                  R                  SR                  UR                  5       5      5        UR                  (       a%  [        R                   " UR                  5       SS9  U$ UR"                  (       a:  [        R                  R                  SR                  UR$                  5      5        U$ [&        R(                  R+                  UR$                  S[,        R.                  U R                  5          S9n[0        R2                  " UR4                  UR6                  5      n[0        R8                  " UUSR                  UR$                  5      5      n[        R                   " UR                  5       SS9  U$ )	N)release_trackzUpdate request issued for: [{}]r   )kindz Check operation [{}] for status.z1networkconnectivity.projects.locations.operations)
collectionapi_versionz&Waiting for operation [{}] to complete)r   GroupsClientReleaseTrackCONCEPTSr   Parser	   BETAr=   rN   r   statusPrintformatNamedoneUpdatedResourceasync_namer   REGISTRYParseRelativeNamer   VERSION_MAPr   CloudOperationPollergroup_serviceoperation_serviceWaitFor)r?   rB   r@   rA   op_refop_resourcepollerress           r   Run
Update.Run   s   $11'')F ##))+Id//444##Ft<f!!&T:fJJ6==inn>NOP{{	)..*9m{{	jj9@@MNm$$66F,889J9J9LM 7 K
 ((f66F ..077DC
 	(w7Jr    N)__name__
__module____qualname____firstlineno____doc__staticmethodr   r=   rN   rm   __static_attributes__ro   r   r   r   r   !   s-    
  )AV&=P"r   r   aj    To update the description of a group named ``my-group'', in the hub ``my-hub'', run:

    $ {command} my-group --hub=my-hub --description="new group description"

  To add the project ``my-project'' to the auto-accept list of a group named ``my-group'' in the hub ``my-hub'', run:

    $ {command} my-group --hub=my-hub --add-auto-accept-projects=my-project
  z   This command uses the networkconnectivity/v1 API. The full documentation
  for this API can be found at:
  https://cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest
  )EXAMPLESzAPI REFERENCEN)rt   
__future__r   r   r   +googlecloudsdk.api_lib.network_connectivityr   r   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper	   /googlecloudsdk.command_lib.network_connectivityr
   $googlecloudsdk.command_lib.util.argsr   r   googlecloudsdk.corer   r   DefaultUniverseOnlyReleaseTracksrV   rY   GACommandr   detailed_helpro   r   r   <module>r      s     # &  ' O P . ( A < 9 # ) D%%**D,=,=,@,@AKT\\ K B K^ r   