
                            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	rS
r " S S5      r\R$                  " SSS9\R&                  " \R(                  R*                  5       " S S\\R,                  5      5       5       r\R&                  " \R(                  R0                  5       " S S\\R,                  5      5       rg)z9Command to discover connection profiles for a datastream.    )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.Args-   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.Run?   sj     $$,,00$0?G}}H2J#<<>Ij*;*;*=tDDr    N)__name__
__module____qualname____firstlineno____doc__r   r   detailed_helpstaticmethodr   r.   __static_attributes__r0   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)DiscoverBetaR   )Discover a Datastream connection profile.r0   Nr1   r2   r3   r4   r5   r8   r0   r   r   r<   r<   R   s     2r   r<   c                       \ rS rSrSrSrg)r(   \   r>   r0   Nr?   r0   r   r   r(   r(   \   s    1r   r(   N)r5   !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(   r0   r   r   <module>rM      s    @ B 2 ( ? W D * L 	'E 'ET I
 D%%**+29dll 2 ,2 D%%(()2y$,, 2 *2r   