
                            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	d
Z G d de      ZddZd Zd Zej"                   ej$                  ej&                  j(                         G d dej*                                      Zy)z$'vmware announcements list' command.    )absolute_import)division)unicode_literals)announcements)base)flagsz<
          List announcements in a VMware Engine.
          aE  
          To list maintanance announcements run:

            $ {command} --type=maintenance --location=us-west2-a --project=my-project

            Or:

            $ {command} --type=maintenance

          In the second example, the project and location are taken from gcloud properties core/project and compute/zone.
    )DESCRIPTIONEXAMPLESc                       e Zd Zd Zy)_MissingKeyHandlerc                     d| dS )N{{}} )selfkeys     (lib/surface/vmware/announcements/list.py__missing__z_MissingKeyHandler.__missing__.   s    #d    N)__name__
__module____qualname__r   r   r   r   r   r   ,   s    r   r   c                     | r	|| v r| |   S |S )zBReturns the value of the key in the metadata or the default value.r   )metadatar   defaults      r   _value_or_defaultr   2   s    #/C=	.r   c                     | d   j                  dd      j                  dd      }t        | d         }|j                  |      S )z,Formats the description of the announcement.descriptionr   {r   }r   )replacer   
format_map)resourcedescription_templatedescription_argss      r   _format_descriptionr&   9   sO     }%%dC088sC  ((<=		(	()9	::r   c                 0    | j                  dddgd       y)z6Adds a type argument to filter the announcements list.z--typeTmaintenancez!The type of announcement to list.)requiredchoiceshelpN)add_argumentparsers    r   _add_type_argumentr/   B   s#    o.	  r   c                   *    e Zd ZdZeZed        Zd Zy)Listz3List announcements in a Google Cloud VMware Engine.c                     t        j                  |        t        |        | j                  j	                  t
        t        d       | j                  j                  d       y)z Register flags for this command.)value_or_defaultformat_descriptiona5  table(name.segment(-1):label=NAME,name.segment(-3):label=LOCATION,metadata.value_or_default(target):label=TARGET,format_description():label=DESCRIPTION,code:label=CODE,metadata.value_or_default(upgrade_start_date):label=UPGRADE_START_DATE,metadata.value_or_default(upgrade_type):label=UPGRADE_TYPE,createTime)N)r   AddLocationArgToParserr/   display_infoAddTransformsr   r&   	AddFormatr-   s    r   Argsz	List.ArgsS   sT     
  (v
%%-1'  !!		r   c                     |j                   j                  j                         }t        j                         j                  ||j                  j                               S )N)CONCEPTSlocationParser   AnnouncementsClientr1   typeupper)r   argsr<   s      r   RunzList.Rung   sA    }}%%++-H,,.33Hdiioo>OPPr   N)	r   r   r   __doc__DETAILED_HELPdetailed_helpstaticmethodr9   rB   r   r   r   r1   r1   L   s$     <- &Qr   r1   N)zN/A)rC   
__future__r   r   r   googlecloudsdk.api_lib.vmwarer   googlecloudsdk.callioper   !googlecloudsdk.command_lib.vmwarer   rD   dictr   r   r&   r/   DefaultUniverseOnlyReleaseTracksReleaseTrackGAListCommandr1   r   r   r   <module>rQ      s    + &  ' 7 ( 3
	$ ; D%%(()Q4 Q * Qr   