
    L                     V   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                  " \R                  R                   \R                  R"                  \R                  R$                  5      \R&                   " S
 S\R(                  5      5       5       rg)zsCreates a user in a given cluster.

Creates a user in a given cluster with specified username, type, and password.
    )absolute_import)division)unicode_literals)api_util)base)flags)user_helper)
propertiesc                   8    \ rS rSrSrSSS.r\S 5       rS rSr	g	)
Create!   zCreates a user in a given cluster.

Creates a user in a given cluster with specified username, cluster, region,
type, and password.
z{description}z      To create a new user, run:

        $ {command} my-username --cluster=my-cluster --region=us-central1 --password=postgres
      )DESCRIPTIONEXAMPLESc                 f   [         R                  " U 5        [         R                  " U S5        [         R                  " U 5        [         R                  " U 5        [         R
                  " U 5        [         R                  " U 5        [         R                  " U 5        [         R                  " U 5        g)zlSpecifies additional command flags.

Args:
  parser: argparse.Parser: Parser object for command line inputs
FN)	r   AddUsername
AddCluster	AddRegionAddUserPasswordAddUserTypeAddCreateSuperuser
AddDBRolesAddKeepExtraRoles)parsers    #lib/surface/alloydb/users/create.pyArgsCreate.Args5   st     
f	VU#	OOF	&!	f	V$	V	F#    c                    [         R                  " U R                  5       5      nUR                  nUR                  nUR
                  R                  S[        R                  R                  R                  R                  UR                  UR                  S9n[        R                  " X$XQ5      nUR                   R                  U5      $ )zConstructs and sends request.

Args:
  args: argparse.Namespace, An object that contains the values for the
    arguments specified in the .Args() method.

Returns:
  ProcessHttpResponse of the request made.
z#alloydb.projects.locations.clusters)
projectsIdlocationsId
clustersId)r   AlloyDBClientReleaseTrackalloydb_clientalloydb_messagesresource_parserr   r
   VALUEScoreproject	GetOrFailregionclusterr	   ConstructCreateRequestFromArgs!projects_locations_clusters_users)selfargsclientr$   r%   cluster_refreqs          r   Run
Create.RunE   s     ##D$5$5$78F**N..((//-$$))11;;KK<<	 0 K 
4
4+C ;;BB3GGr    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r4   __static_attributes__r6   r   r   r   r   !   s2    
 %
- $ $Hr   r   N)r;   
__future__r   r   r   googlecloudsdk.api_lib.alloydbr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.alloydbr   r	   googlecloudsdk.corer
   ReleaseTracksr#   ALPHABETAGADefaultUniverseOnlyCreateCommandr   r6   r   r   <module>rJ      s    '  ' 4 ( 4 : * T..33T5F5F5I5I 6HT 6H 6Hr   