
                            d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlm	Z	 ddl
mZ dd	l
mZ ej                   ej                  ej                  j                          G d
 dej"                                      Zd Zy)z$The gcloud run presets list command.    )absolute_import)division)unicode_literalsN)base)presets_printer)
exceptions)yamlc                   @    e Zd ZdZdddZed        Zed        Zd Zy)	ListzDList available Cloud Run presets. Currently only available in alpha.z
          {description}
      zN
          To list all available presets, run:

            $ {command}
      )DESCRIPTIONEXAMPLESc                 |    |j                   j                  d       |j                   j                  dt        i       y)z/Adds the display format for the command output.z$table(name, category(), description)categoryN)display_info	AddFormatAddTransforms_TransformCategoryclsparsers     lib/surface/run/presets/list.py
CommonArgszList.CommonArgs-   s3     !!"HI
%%z3E&FG    c                 &    | j                  |       y )N)r   r   s     r   Argsz	List.Args3   s    NN6r   c                     	 t        j                  dd      }t        j                  |      }|d   S # t        $ r t        j                  d      w xY w)z>Reads a Preset YAML file and returns its contents for display.zgooglecloudsdk.command_lib.runzpresets.yamlzPresets file not found.presets)pkgutilget_datar	   loadIOErrorr   Error)self_presets_yaml_contentspresets_datas       r   RunzList.Run7   s\    8%..
*N<YY45l 	""  86778s	   +2 AN)	__name__
__module____qualname____doc__detailed_helpclassmethodr   r   r'    r   r   r   r      sH     M

		- H H
  
#r   r   c                 ^    t         j                  j                  | j                  d            S )Nr   )r   PRESETS_ENUM_MAPget)rs    r   r   r   D   s"    		)	)	-	-aeeJ.?	@@r   )r+   
__future__r   r   r   r   googlecloudsdk.callioper   'googlecloudsdk.command_lib.run.printersr   googlecloudsdk.corer   r	   UniverseCompatibleReleaseTracksReleaseTrackALPHAListCommandr   r   r.   r   r   <module>r<      sq    + &  '  ( C * $ D%%++,"#4 "# - "#JAr   