
    
                     2   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	  \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.
    )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.Args2   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.RunB   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   r1   __static_attributes__r3   r   r   r	   r	      s2    
 %
- $ $Hr   r	   N)r8   googlecloudsdk.api_lib.alloydbr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.alloydbr   r   googlecloudsdk.corer   ReleaseTracksr    ALPHABETAGADefaultUniverseOnlyCreateCommandr	   r3   r   r   <module>rF      s    4 ( 4 : * T..33T5F5F5I5I 6HT 6H 6Hr   