
                            d Z ddlZddlmZmZmZ ddlmZ ddlm	Z	 ddl
mZ ddl
mZ dZ e	j                  e	j                   j"                        e	j$                   G d	 d
ej&                  e	j(                                      Zy)zACommand to commit conversion workspaces for a database migration.    N)AnyDict	Generator)resource_args)base)command_mixin)flagsd   c                       e Zd ZdZdddZedej                  ddfd       Zd	ej                  de
eeef   ddf   fd
Zy)DescribeEntitieszHDescribe database entities in a Database Migration conversion workspace.zX
        Describe database entities in a Database Migration conversion workspace.
      z        To describe the database entities of the source tree in a conversion
        workspace in a project and location `us-central1`, run:

            $ {command} my-conversion-workspace --region=us-central1 --tree-type=SOURCE
      )DESCRIPTIONEXAMPLESparserreturnNc                 0   t        j                  | d       t        j                  | d       t        j                  |        t        j
                  |        t        j                  j                  | t               | j                  j                  d       y )Nzdescribe entitiesT)requiredz
          table(
            tree:label=TREE_TYPE,
            entityType:label=ENTITY_TYPE,
            parentEntity:label=PARENT,
            shortName:label=NAME,
            status:label=STATUS
          )
        )r   !AddConversionWorkspaceResourceArgcw_flagsAddTreeTypeFlagAddCommitIdFlagAddUncommittedFlagr   PAGE_SIZE_FLAG
SetDefault_DEFAULT_PAGE_SIZEdisplay_info	AddFormat)r   s    Ilib/surface/database_migration/conversion_workspaces/describe_entities.pyArgszDescribeEntities.Args0   so    33F<OPVd3V$'""6+=>
!! #     argsc           
      4   |j                   j                  j                         }| j                  j                  j                  |j                         |j                  |j                  |j                  | j                  |      |j                  d            S )a  Describe database entities for a DMS conversion workspace.

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

    Returns:
      A list of entities for the specified conversion workspace and arguments.
    	page_size)name	commit_iduncommitted	tree_typefilter_exprr"   )CONCEPTSconversion_workspaceParsecliententitiesr   RelativeNamer$   r%   r&   ExtractBackendFilterGetValue)selfr    conversion_workspace_refs      r   RunzDescribeEntities.RunB   s|      $}}AAGGI;;00%224..$$..--d3--, 1  r   )__name__
__module____qualname____doc__detailed_helpstaticmethodargparseArgumentParserr   	Namespacer   r   strr   r2    r   r   r   r      sr     Q

	
- 8** t  " c3ht+,r   r   )r6   r9   typingr   r   r   )googlecloudsdk.api_lib.database_migrationr   googlecloudsdk.callioper   Cgooglecloudsdk.command_lib.database_migration.conversion_workspacesr   r	   r   r   ReleaseTracksReleaseTrackGADefaultUniverseOnly ConversionWorkspacesCommandMixinListCommandr   r=   r   r   <module>rH      sx    H  ' ' C ( ] a  D%%(()9229  *9r   