
                             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)z1Command to create a fleet scope RBAC RoleBinding.    )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)Create   a  Create an RBAC RoleBinding.

This command can fail for the following reasons:
* The RBAC RoleBinding already exists.
* The caller does not have permission to access the given scope.

## EXAMPLES

To create an admin RBAC RoleBinding `RBRB` in scope `SCOPE` for user
`person@google.com`, run:

  $ {command} RBRB --scope=SCOPE --role=admin
  --user=person@google.com

To create a viewer RBAC RoleBinding `RBRB` in scope `SCOPE` for group
`people@google.com`, run:

  $ {command} RBRB --scope=SCOPE --role=viewer
  --group=people@google.com

To create an RBAC RoleBinding with a custom role `custom-role` in scope
`SCOPE` for user `person@google.com`, run:

  $ {command} RBRB --scope=SCOPE --role=admin
  --user=person@google.com
  --custom-role=custom-role
c                 z   [         R                  " U[        R                  U R	                  5          SS9  UR                  SS9nUR                  S[        SS9  UR                  S[        S	S9  UR                  SS9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 created. Must comply with RFC 1123 (up to 63 characters, alphanumeric and '-'))api_versionrbacrb_helpT)requiredz--userzUser for the RoleBinding.)typehelpz--groupzGroup for the RoleBinding.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
   AddCreateLabelsFlags)clsparsergrouproledefs       =lib/surface/container/fleet/scopes/rbacrolebindings/create.pyArgsCreate.Args:   s    %%$$S%5%5%78$	 ///>E	(  
 
)  
 1141@G)J  
 2  
 $$V,    c           	         [         R                  " U R                  5       S9n[        R                  " UR
                  S9nUR                  UR                  R                  R                  S 5      R                  5       nUR                  nUR                  [        R                  " U5      UR                  UUR                   UR"                  US9$ )N)release_track)	additions)rolecustom_roleuserr!   labels)r   FleetClientr   r
   Diffr-   ApplymessagesRBACRoleBindingLabelsValue	GetOrNoner+   CreateScopeRBACRoleBindingr	   RBACResourceNamer*   r,   r!   )selfargsfleetclientlabels_diffr-   r+   s         r#   Run
Create.Run]   s    $$43D3D3FGK""T[[9K,,88$ik  ""K11""4(YYYYjj 2  r&    N)	__name__
__module____qualname____firstlineno____doc__classmethodr$   r;   __static_attributes__r=   r&   r#   r   r      s!    8  -  -Dr&   r   N)rB   
__future__r   r   r   &googlecloudsdk.api_lib.container.fleetr   r   googlecloudsdk.callioper   *googlecloudsdk.command_lib.container.fleetr	   $googlecloudsdk.command_lib.util.argsr
   DefaultUniverseOnlyCreateCommandr   r=   r&   r#   <module>rL      sL    8 &  ' 9 7 ( @ < OT O Or&   