
                         j   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rSr " S	 S
\5      r\R                   " \R"                  R$                  5       " S S\\R&                  5      5       r\R                   " \R"                  R*                  5       " S S\\R&                  5      5       rg)z?Command to create connection profiles for a database migration.    )resource_args)base)flags)create_helper)
console_ioACreate a Database Migration Service connection profile for MySQL.a      To create a connection profile for MySQL:

        $ {{command}} my-profile --region=us-central1 --password=123456
        --username=my-user --host=1.2.3.4 --port=3306

    If the source is a Cloud SQL database, run:

        $ {{command}} my-profile --region=us-central1 --password=123456
        --username=my-user --host=1.2.3.4 --port=3306
        --{instance}=my-instance --provider=CLOUDSQL
    c                   .    \ rS rSrSr\S 5       rS rSrg)_MySQL)   r   c                    [         R                  " U S5        [        R                  " U 5        [        R                  " U 5        [        R
                  " U SS9  [        R                  " U 5        [        R                  " U 5        g)zArgs is called by calliope to gather arguments for this command.

Args:
  parser: An argparse parser that you can use to add arguments that go on
    the command line after this command. Positional arguments are allowed.
z	to createF)require_passwordN)	r   AddConnectionProfileResourceArgcp_flagsAddNoAsyncFlagAddDisplayNameFlagAddDatabaseParamsFlagsAddProviderFlagr   AddLabelsCreateFlagsparsers    Blib/surface/database_migration/connection_profiles/create/mysql.pyArgs_MySQL.Args,   s\     11&+FF#'##FUCV$	v&    c                 L   UR                   R                  R                  5       nUR                  5       R	                  5       nUR
                  (       a  [        R                  " S5      Ul        [        R                  " 5       nUR                  U R                  5       UX!S5      $ )a  Create a Database Migration Service connection profile.

Args:
  args: argparse.Namespace, The arguments that this command was invoked
    with.

Returns:
  A dict object representing the operations resource describing the create
  operation if the create was successful.
zPlease Enter Password: MYSQL)CONCEPTSconnection_profileParseParentRelativeNameprompt_for_passwordr   PromptPasswordpasswordr   CreateHelpercreateReleaseTrack)selfargsconnection_profile_ref
parent_refhelpers        r   Run
_MySQL.Run<   s     "]]==CCE'..0==?J //0IJdm'')F==**,j/w@ @r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r-   __static_attributes__r/   r   r   r
   r
   )   s    I' '@r   r
   c                   L    \ rS rSrSr\\R                  SS9S.r\	S 5       r
Srg)	
MySQLAlphaR   r   instancer:   DESCRIPTIONEXAMPLESc                     [         R                  U 5        [        R                  " U [        R
                  R                  5        [        R                  " U 5        g N)r
   r   r   AddSslConfigGroupr   r'   ALPHAAddInstanceFlagr   s    r   r   MySQLAlpha.Args[   s8    
KKvt'8'8'>'>?V$r   r/   Nr0   r1   r2   r3   r4   r=   r>   formatdetailed_helpr5   r   r6   r/   r   r   r8   r8   R   s3    I !//:/6-
 % %r   r8   c                   L    \ rS rSrSr\\R                  SS9S.r\	S 5       r
Srg)	MySQLGAb   r   zcloudsql-instancer;   r<   c                     [         R                  U 5        [        R                  " U [        R
                  R                  5        [        R                  " U 5        [        R                  " U 5        g r@   )	r
   r   r   rA   r   r'   GAAddCloudSQLInstanceFlagAddRoleFlagr   s    r   r   MySQLGA.Argsk   sF    
KKvt'8'8';';<$$V, r   r/   NrE   r/   r   r   rI   rI   b   s4    I !//+>/?-
 ! !r   rI   N)r4   )googlecloudsdk.api_lib.database_migrationr   googlecloudsdk.callioper   -googlecloudsdk.command_lib.database_migrationr   Agooglecloudsdk.command_lib.database_migration.connection_profilesr   r   googlecloudsdk.core.consoler   r=   r>   objectr
   ReleaseTracksr'   rB   Commandr8   rL   rI   r/   r   r   <module>rX      s    F D ( ? [ _ 2&@V &@R D%%++,% % -% D%%(()!fdll ! *!r   