
                            d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ dd	lmZ dd
lmZ ddlmZ dZdZ G d d      Z e	j,                  dd       e	j.                  e	j0                  j2                         G d dee	j4                                      Z e	j.                  e	j0                  j8                         G d dee	j4                               Zy)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                   0    e Zd ZdZeedZed        Zd Z	y)	_Discoverz:Base class for discovering Datastream connection profiles.)DESCRIPTIONEXAMPLESc                 4   t         j                  j                  dt        j                         dd      j                  |        t        j                  |        t        j                  |        t        j                  |        t        j                  |        y)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Argsz_Discover.Args0   sv     !!----/O	 .  #{6*99&A6"6"v&    c                    t         j                  j                  j                  j	                  d      }|j
                  }t        j                  ||      }t        j                         }|j                  || j                         |      S )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   Runz_Discover.RunB   sn     $$,,00$0?G}}H2J#<<>Ij$*;*;*=tDDr    N)
__name__
__module____qualname____doc__r   r   detailed_helpstaticmethodr   r/    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                       e Zd ZdZy)DiscoverBeta)Discover a Datastream connection profile.Nr0   r1   r2   r3   r6   r    r   r:   r:   U   s     2r    r:   c                       e Zd ZdZy)r)   r;   Nr<   r6   r    r   r)   r)   _   s    1r    r)   N)r3   
__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)   r6   r    r   <module>rJ      s    @ &  ' A 2 ( ? W D * L 	'E 'ET I
 D%%**+29dll 2 ,2 D%%(()2y$,, 2 *2r    