
                            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rSr " S S5      r\	R,                  " SSS9\	R.                  " \	R0                  R2                  5       " S S\\	R4                  5      5       5       r\	R.                  " \	R0                  R8                  5       " S S\\	R4                  5      5       rg)z9Command to discover connection profiles for a datastream.    )absolute_import)division)unicode_literals)connection_profiles)util)base)resource_args)flags)concept_parsers)
propertieszEDiscover data objects accessible from a Datastream connection profileaT      To discover an existing connection profile:

        $ {command} CONNECTION_PROFILE --location=us-central1 --connection-profile-name=some-cp --recursive=true

    To discover a non-existing connection profile:

        $ {command} CONNECTION_PROFILE --location=us-central1 --connection-profile-object-file=path/to/yaml/or/json/file

   c                   8    \ rS rSrSr\\S.r\S 5       r	S r
Srg)	_Discover+   z:Base class for discovering Datastream connection profiles.)DESCRIPTIONEXAMPLESc                 8   [         R                  R                  S[        R                  " 5       SSS9R                  U 5        [        R                  " U 5        [        R                  " U 5        [        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
--locationz:The location you want to list the connection profiles for.T)
group_helprequiredN)r   ConceptParserForResourcer	   GetLocationResourceSpecAddToParser'AddConnectionProfileDiscoverResourceArgcp_flagsAddDepthGroupAddRdbmsGroupAddHierarchyGroup)parsers    6lib/surface/datastream/connection_profiles/discover.pyArgs_Discover.Args0   sv     !!----/O	 .  #{6*99&A6"6"v&    c                    [         R                  R                  R                  R	                  SS9nUR
                  n[        R                  " X#5      n[        R                  " 5       nUR                  X@R                  5       U5      $ )a  Discover a Datastream connection profile.

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

Returns:
  A dict object representing the operations resource describing the discover
  operation if the discover was successful.
T)r   )r   VALUEScoreprojectGetlocationr   	ParentRefr   ConnectionProfilesClientDiscoverReleaseTrack)selfargsr&   r(   
parent_ref	cp_clients         r   Run_Discover.RunB   sj     $$,,00$0?G}}H2J#<<>Ij*;*;*=tDDr"    N)__name__
__module____qualname____firstlineno____doc__r   r   detailed_helpstaticmethodr    r1   __static_attributes__r3   r"   r   r   r   +   s'    B"-8D-' '"Er"   r   FzrDatastream beta version is deprecated. Please use`gcloud datastream connection-profiles discover` command instead.)
is_removedwarningc                       \ rS rSrSrSrg)DiscoverBetaU   )Discover a Datastream connection profile.r3   Nr4   r5   r6   r7   r8   r;   r3   r"   r   r?   r?   U   s     2r"   r?   c                       \ rS rSrSrSrg)r+   _   rA   r3   NrB   r3   r"   r   r+   r+   _   s    1r"   r+   N)r8   
__future__r   r   r   !googlecloudsdk.api_lib.datastreamr   r   googlecloudsdk.callioper   %googlecloudsdk.command_lib.datastreamr	   9googlecloudsdk.command_lib.datastream.connection_profilesr
   r   (googlecloudsdk.command_lib.util.conceptsr   googlecloudsdk.corer   r   r   r   	DeprecateReleaseTracksr,   BETACommandr?   GAr+   r3   r"   r   <module>rQ      s    @ &  ' A 2 ( ? W D * L 	'E 'ET I
 D%%**+29dll 2 ,2 D%%(()2y$,, 2 *2r"   