
                         @   S r SSKJr  SSKJr  SSKJr  SSK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$                  \	R                   R&                  5       " S S\	R(                  5      5       rg)z2Command to create a service account for a project.    )absolute_import)division)unicode_literalsN)util)base)iam_util)log)
propertiesc                   V    \ rS rSrSrS\R                  " S5      0r\S 5       r	S r
Srg)	Create   zCreate a service account for a project.

This command creates a service account with the provided name. For
subsequent commands regarding service accounts, this service account should
be referred to by the email account in the response.
EXAMPLESa.  
          To create a service account for your project, run:

            $ {command} some-account-name --display-name="My Service Account"

          To work with this service account in subsequent IAM commands, use the
          email resulting from this call as the IAM_ACCOUNT argument.
          c                 f    U R                  SSS9  U R                  SSS9  U R                  SSSS	9  g )
Nz--display-namez*A textual name to display for the account.)helpz--descriptionz&A textual description for the account.nameNAMEzThe internal name of the new service account. Used to generate an IAM_ACCOUNT (an IAM internal email address used as an identifier of service account), which must be passed to subsequent commands.)metavarr   )add_argument)parsers    *lib/surface/iam/service_accounts/create.pyArgsCreate.Args5   sX    
K  M F  H       c                    [         R                  R                  R                  R	                  SS9n[
        R                  " 5       u  p4UR                  R                  UR                  [        R                  " U5      UR                  UR                  UR                  UR                  UR                   S9S9S95      n["        R$                  " UR                  SS9  U$ )NT)required)displayNamedescription)	accountIdserviceAccount)r   createServiceAccountRequestzservice account)kind)r
   VALUEScoreprojectGetr   GetClientAndMessagesprojects_serviceAccountsr   'IamProjectsServiceAccountsCreateRequestr   ProjectToProjectResourceNameCreateServiceAccountRequestr   ServiceAccountdisplay_namer   r	   CreatedResource)selfargsr$   clientmessagesresults         r   Run
Create.RunF   s    $$,,00$0?G002F,,338866w?(0(L(L))'66 $ 1 1 $ 0 0  7  2 )M )3 	9 	45F 		(9:Mr    N)__name__
__module____qualname____firstlineno____doc__textwrapdedentdetailed_helpstaticmethodr   r3   __static_attributes__r5   r   r   r   r      s=     
//  
-   r   r   )r:   
__future__r   r   r   r;   googlecloudsdk.api_lib.iamr   googlecloudsdk.callioper   googlecloudsdk.command_lib.iamr   googlecloudsdk.corer	   r
   ReleaseTracksReleaseTrackALPHABETAGACreateCommandr   r5   r   r   <module>rK      s|     9 &  '  + ( 3 # * D%%++T->->-C-C%%((*2T 2*2r   