
    
                         d Z ddlZddlmZ ddlmZ ddlmZ  ej                  d      Z	d Z
de
iZej                   ej                  ej                  j                         G d	 d
ej                                       Zy)z;Implementation of list command for Insights dataset config.    N)insights_api)base)flagszlocations/(.*)/.*/c                     t        j                  t        | d         }|r"|j                  d      |j                  d      S y)Nname   zN/A-Misformated Value)researchLOCATION_REGEX_PATTERNgroup)dataset_configmatched_results     4lib/surface/storage/insights/dataset_configs/list.py_transform_locationr      s?    993^F5KL.,,Q/;"""    location_transformc                   0    e Zd ZdZdddZed        Zd Zy)ListzAList returns all the Insights dataset configs for given location.z:
      List Cloud storage Insights dataset configs.
      a  

      List all dataset configs in all locations:

          $ {command}

      List all dataset configs for location "us-central1":

          $ {command} --location=us-central1

      List all dataset configs with a page size of "20":

          $ {command} --location=us-central1 --page-size=20

      List all dataset configs with JSON formatting:

          $ {command} --location=us-central1 --format=json
      )DESCRIPTIONEXAMPLESc                     t        j                  | d       | j                  j                  d       | j                  j	                  t
               y )NF)is_requireda  
        table(
            uid:label=DATASET_CONFIG_ID,
            name.basename():label=DATASET_CONFIG_NAME,
            location_transform():label=LOCATION,
            sourceProjects.projectNumbers:label=SOURCE_PROJECTS,
            organizationNumber:label=ORGANIZATION_NUMBER,
            retentionPeriodDays:label=RETENTION_PERIOD_DAYS,
            datasetConfigState:label=STATE
        )
        )r    add_dataset_config_location_flagdisplay_info	AddFormatAddTransforms_TRANSFORMS)parsers    r   Argsz	List.ArgsC   sA    	**6uE
!! 
# 
 %%k2r   c                 t    t        j                         j                  |j                  |j                        S )N)location	page_size)r   InsightsApilist_dataset_configr!   r"   )selfargss     r   RunzList.RunS   s0    ##%99$.. :  r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r'    r   r   r   r   &   s2     J

	-0 3 3r   r   )r+   r	   googlecloudsdk.api_lib.storager   googlecloudsdk.callioper   "googlecloudsdk.command_lib.storager   compiler   r   r   DefaultUniverseOnlyReleaseTracksReleaseTrackALPHAListCommandr   r.   r   r   <module>r8      s     B 	 7 ( 4#$9: # $%89 D%%++,.4 . - .r   