
                             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dZdZ e	j$                  e	j&                  j(                         G d de	j*                               Zy)z.'Marketplace Solutions instances list command.    )absolute_import)division)unicode_literalsN)	MpsClient)base)flags)
properties)resource_projectorzF
          List Marketplace Solutions instances in a project.
        z
          To list instances in the region within the project ``us-central1'', run:

            $ {command} --region=us-central1

          Or:

          To list all instances in the project, run:

            $ {command}
    )DESCRIPTIONEXAMPLESz table(
        name.segment(-1):label=NAME,
        name.segment(-5):label=PROJECT,
        name.segment(-3):label=REGION,
        systemType,
        virtualCpuCores,
        memoryGib,
        osImage,
        state
    )c                   0    e Zd ZdZeZed        Zd Zd Z	y)Listz1List Marketplace Solution instances in a project.c                 d   t         j                  j                  |        t         j                  j                  |        t         j                  j                  |        t         j
                  j                  |        t        j                  |        | j                  j                  t               y)z Register flags for this command.N)r   FILTER_FLAGRemoveFromParserPAGE_SIZE_FLAGSORT_BY_FLAGURI_FLAGr   AddRegionArgToParserdisplay_info	AddFormatINSTANCE_LIST_FORMAT)parsers    !lib/surface/mps/instances/list.pyArgsz	List.ArgsB   sw     	%%f-((0&&v.MM""6*	v&
 !!"67    c                     |j                   j                  j                         }t               }t        j
                  j                  j                  j                  d      }|[t        j
                  j                  j                  j                  d      } fd|j                  |||j                        D        S  fd|j                  ||      D        S )NT)requiredc              3   @   K   | ]  }j                  |        y wNsynthesizesInstanceInfo.0insselfs     r   	<genexpr>zList.Run.<locals>.<genexpr>Z   s(      76# **3/6   )limitc              3   @   K   | ]  }j                  |        y wr    r!   r#   s     r   r'   zList.Run.<locals>.<genexpr>]   s$      >< ((-<r(   )CONCEPTSregionParser   r	   VALUESmpsproductGetcoreprojectAggregateListInstancesr)   ListInstances)r&   argsr,   clientr0   r3   s   `     r   RunzList.RunR   s    ]]!!'')F[F##++///>G~!!&&..22D2Ag7667$** 7 67 7>++GV<> >r   c                     t        j                  |      }|j                  j                  |d<   t	        j
                  |d         |d<   |S )NosImage)r
   MakeSerializabler:   versionjsondumps)r&   r%   outs      r   r"   zList.synthesizesInstanceInfo`   sB    

-
-c
2C[[((C	N ZZI/C	NJr   N)
__name__
__module____qualname____doc__DETAILED_HELPdetailed_helpstaticmethodr   r8   r"    r   r   r   r   =   s&    9-8 8>r   r   )rC   
__future__r   r   r   r=   %googlecloudsdk.api_lib.mps.mps_clientr   googlecloudsdk.callioper   googlecloudsdk.command_lib.mpsr   googlecloudsdk.corer	   googlecloudsdk.core.resourcer
   rD   r   ReleaseTracksReleaseTrackALPHAListCommandr   rG   r   r   <module>rR      sx     5 &  '  ; ( 0 * ;	
	&		  D%%++,(4 ( -(r   