
                         $   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  SS
KJr  SSKJr  SSS.r\R&                  " \R(                  R*                  5      \R,                   " S S\R.                  5      5       5       rg)z=Command to test connection profiles for a database migration.    )absolute_import)division)unicode_literals)Any)api_util)connection_profiles)resource_args)base)flags)logzL
        Validates a Database Migration Service connection profile.
        zg        To test a connection profile:

            $ {command} my-profile --region=us-central1
        )DESCRIPTIONEXAMPLESc                   B    \ rS rSrSr\r\S	S j5       rS\	S\	4S jr
Srg)
Test+   z5Test a Database Migration Service connection profile.returnNc                 ^    [         R                  " U S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 testN)r	   AddConnectionProfileResourceArgcp_flagsAddNoAsyncFlag)parsers    :lib/surface/database_migration/connection_profiles/test.pyArgs	Test.Args2   s"     11&)DF#    argsc                    UR                   R                  R                  5       n[        R                  " U R                  5       5      nUR                  UR                  5       5      n[        R                  " U R                  5       5      n[        R                  " U R                  5       5      n[        R                  " U R                  5       5      nUR                  S5      (       a  [        R                  R                  SR!                  UR"                  UR$                  5      5        [        R&                  " XTUR(                  5        [        R                  R                  SR!                  UR"                  UR$                  5      5        gUR+                  SUR$                  UR,                  UR.                  S9nUR0                  R3                  UR5                  UR6                  S95      $ )zTest 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 test
  operation.
no_asyncz8Waiting for connection profile [{}] to be test with [{}]z!Tested connection profile {} [{}]Nz+datamigration.projects.locations.operations)operationsId
projectsIdlocationsId)name)CONCEPTSconnection_profileParser   ConnectionProfilesClientReleaseTrackr   RelativeNamer   GetClientInstanceGetMessagesModuleGetResourceParserIsKnownAndSpecifiedr   statusPrintformatconnectionProfilesIdr"   	HandleLRO%projects_locations_connectionProfilesCreater    r!   projects_locations_operationsGet2DatamigrationProjectsLocationsOperationsGetRequestr   )	selfr   connection_profile_ref	cp_clientresult_operationclientmessagesresource_parseroperation_refs	            r   RunTest.Run=   s    "]]==CCE#<<I !~~&<&I&I&KL''(9(9(;<F))$*;*;*=>H001B1B1DEO
++	jj
D
K
K$99;K;P;P 
F$P$P 
jj
-
4
4$99;K;P;P
 #**5%**)44*66	 + M //33CC++ 	D 	
 r    )r   N)__name__
__module____qualname____firstlineno____doc__DETAILED_HELPdetailed_helpstaticmethodr   r   r?   __static_attributes__rA   r   r   r   r   +   s1     >-$ $3c 3c 3r   r   N)rF   
__future__r   r   r   typingr   )googlecloudsdk.api_lib.database_migrationr   r   r	   googlecloudsdk.callioper
   Agooglecloudsdk.command_lib.database_migration.connection_profilesr   r   googlecloudsdk.corer   rG   ReleaseTracksr'   GADefaultUniverseOnlyCommandr   rA   r   r   <module>rU      s    D &  '  > I C ( _ #		 D%%(()C4<< C  *Cr   