
                             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  \	R                   " S
 S\	R                  5      5       rg)z$Command to update fleet information.    )absolute_import)division)unicode_literals)client)util)base)	resources)labels_utilc                   .    \ rS rSrSr\S 5       rS rSrg)Update   a  Update a fleet scope RBAC RoleBinding.

This command can fail for the following reasons:
* The RoleBinding does not exist in the project.
* The caller does not have permission to access the RoleBinding.

## EXAMPLES

To update the RBAC RoleBinding `RBRB` in scope `SCOPE` in the active
project to the `viewer` role:

  $ {command} RBRB --scope=SCOPE --role=viewer

To update the RBAC RoleBinding `RBRB` in scope `SCOPE` in the active
project to the custom role `custom-role`:

  $ {command} RBRB --scope=SCOPE --custom-role=custom-role

To update the RBAC RoleBinding `RBRB` in scope `SCOPE` in the active
project to the user `someone@google.com`:

  $ {command} RBRB --scope=SCOPE --user=someone@google.com
c                 ~   [         R                  " U[        R                  U R	                  5          SS9  UR                  5       nUR                  S[        SS9  UR                  S[        SS9  UR                  5       nUR                  S/ S	QS
S9  UR                  S[        SS9  [        R                  " U5        g )NzqName of the RBAC RoleBinding to be updated. Must comply with RFC 1123 (up to 63 characters, alphanumeric and '-'))api_versionrbacrb_helpz--userz*User for the RBACRoleBinding to update to.)typehelpz--groupz+Group for the RBACRoleBinding to update to.z--role)admineditviewz;Predefined role to assign to principal (admin, edit, view).)choicesr   z--custom-rolez#Custom role to assign to principal.)
r	   AddScopeRBACResourceArgr   VERSION_MAPReleaseTrackadd_mutually_exclusive_groupadd_argumentstrr
   AddUpdateLabelsFlags)clsparsergrouproledefs       =lib/surface/container/fleet/scopes/rbacrolebindings/update.pyArgsUpdate.Args6   s    %%$$S%5%5%78$	 //1E	9  
 
:  
 113G)J  
 2  
 $$V,    c                    [         R                  " U R                  5       S9n/ nUR                  [        R
                  " U5      5      nS HK  nUR                  U5      (       d  M  US:X  d  US:X  a  UR                  S5        M:  UR                  U5        MM     [        R                  R                  U5      nUR                  UR                  R                  R                  UR                  5      R!                  5       nU(       a  UR                  S5        U(       d  g UR"                  nUR%                  [        R
                  " U5      UR&                  UR(                  UR*                  UUSR-                  U5      S9$ )N)release_track)rolecustom_roleuserr    r(   r)   labels,)r*   r    r(   r)   r+   mask)r   FleetClientr   GetScopeRBACRoleBindingr	   RBACResourceNameIsKnownAndSpecifiedappendr
   DiffFromUpdateArgsApplymessagesRBACRoleBindingLabelsValuer+   	GetOrNoner)   UpdateScopeRBACRoleBindingr*   r    r(   join)	selfargsfleetclientr-   current_rbac_rolebindingflaglabels_diff
new_labelsr)   s	            r"   Run
Update.RunY   sD   $$43D3D3FGKD*BB""4(  9		!	!$	'	'6>T]2
++f

++d
 9 ""11$7K"",,88 '' ik  
kk( ""K11""4(YYjjYYXXd^ 2  r%    N)	__name__
__module____qualname____firstlineno____doc__classmethodr#   rC   __static_attributes__rE   r%   r"   r   r      s!    0  -  -D%r%   r   N)rJ   
__future__r   r   r   &googlecloudsdk.api_lib.container.fleetr   r   googlecloudsdk.callioper   *googlecloudsdk.command_lib.container.fleetr	   $googlecloudsdk.command_lib.util.argsr
   DefaultUniverseOnlyUpdateCommandr   rE   r%   r"   <module>rT      sL    + &  ' 9 7 ( @ < aT a ar%   