
    	                        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	 dd	lmZ dd
lmZ ej"                   ej$                  ej&                  j(                         G d dej*                                      Zy)z(The gcloud run presets describe command.    )absolute_import)division)unicode_literalsN)base)
exceptions)presets_printer)yaml)resource_printerc                   0    e Zd ZdZdddZed        Zd Zy)Describez?Describe a Cloud Run preset. Currently only available in alpha.z
          {description}
      zS
          To describe a preset, run:

            $ {command} <preset-name>
      )DESCRIPTIONEXAMPLESc                     | j                  dd       t        j                  t        j                  t        j
                  d       | j                  j                  t        j                         y )Nnamez#The name of the preset to describe.)helpT)hidden)add_argumentr
   RegisterFormatterr   PRESETS_PRINTER_FORMATPresetsPrinterdisplay_info	AddFormat)parsers    #lib/surface/run/presets/describe.pyArgszDescribe.Args/   s\    
2  4 &&..&&
 !!/"H"HI    c                 V   	 t        j                  dd      }t        j                  |      }|j                  dg       D ]$  }|j                  d      |j                  k(  s"|c S  t        j                  d|j                   d      # t        $ r t        j                  d      w xY w)z>Returns the preset metadata details for the given preset name.zgooglecloudsdk.command_lib.runzpresets.yamlzPresets file not found.presetsr   zPreset 'z' not found.)pkgutilget_datar	   loadIOErrorr   Errorgetr   run_exceptionsArgumentError)selfargspresets_yaml_contentspresets_datapresets        r   RunzDescribe.Run;   s    8%..
*N<YY45l
 ""9b1	F	tyy	( 2 
&
&$))L'I
JJ  86778s   +B	 	B(N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r,    r   r   r   r      s5     H

		- 	J 	JKr   r   )r0   
__future__r   r   r   r   googlecloudsdk.callioper   googlecloudsdk.command_lib.runr   r%   'googlecloudsdk.command_lib.run.printersr   googlecloudsdk.corer	   googlecloudsdk.core.resourcer
   UniverseCompatibleReleaseTracksReleaseTrackALPHADescribeCommandr   r3   r   r   <module>r?      ss    / &  '  ( G C * $ 9 D%%++,)Kt## )K - )Kr   