
                            S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSK	Jr  SS	K	Jr  SS
K	Jr  SSKJr  SSKJr  \R"                  " \R$                  R&                  5       " S S\R(                  5      5       r\R"                  " \R$                  R,                  \R$                  R.                  5       " S S\5      5       rg)z2Command to list persistent resources in Vertex AI.    )absolute_import)division)unicode_literals)client)base)	constants)endpoint_util)flags)region_util)persistent_resource_util)
validationc                   F    \ rS rSrSr\R                  r\S 5       r	S r
Srg)ListGA   Lists the active persistent resources.

## EXAMPLES

To list the persistent resources of project ``example'' in region
``us-central1'', run:

  $ {command} --project=example --region=us-central1
c                     [         R                  " US[        R                  " [        R
                  5      S9  [         R                  " U[        R                  [        R                  U R                     S9  g)zMethod called by Calliope to set up arguments for this command.

Args:
  parser: A argparse.Parser to register accepted arguments in command input.
zto list persistent resources)prompt_func)
collectionapi_versionN)r
   AddRegionResourceArgr   GetPromptForRegionFuncr   SUPPORTED_TRAINING_REGIONSAddUriFlagsr   PERSISTENT_RESOURCE_COLLECTIONAI_PLATFORM_API_VERSION_api_version)clsparsers     +lib/surface/ai/persistent_resources/list.pyArgsListGA.Args,   s`     
&660023
 
+JJ55c6F6FGI    c                     UR                   R                  R                  5       nUR                  5       S   n[        R
                  " U5        [        R                  " U R                  US9   [        R                  " U R                  S9R                  UR                  5       S9nU Vs/ s H+  nUR                  b  UR                  R                  b  M)  UPM-     nnUsSSS5        $ s  snf ! , (       d  f       g= f)zExecutes the list command.

Args:
  args: an argparse.Namespace, it contains all arguments that this command
    was invoked with.

Returns:
  The list of resources
locationsId)versionregion)r%   )r&   N)CONCEPTSr&   ParseAsDictr   ValidateRegionr	   AiplatformEndpointOverridesr   r   PersistentResourcesClientListRelativeNameresourceRuntimeSpecraySpec)selfargs
region_refr&   responseresources         r   Run
ListGA.Run=   s     %%++-J /Ff%		2	2!!&
211##%%)T,,. &* &0  ,4 ;8x''/''// 8h ; 
2 
2;
2 
2s$   ->C/+(C*C*C/*C//
C= N)__name__
__module____qualname____firstlineno____doc__r   
GA_VERSIONr   classmethodr    r6   __static_attributes__r8   r"   r   r   r      s-     %%,I I r"   r   c                   0    \ rS rSrSr\R                  rSrg)	ListPreGAY   r   r8   N)	r9   r:   r;   r<   r=   r   BETA_VERSIONr   r@   r8   r"   r   rB   rB   Y   s     '',r"   rB   N)r=   
__future__r   r   r   .googlecloudsdk.api_lib.ai.persistent_resourcesr   googlecloudsdk.callioper   googlecloudsdk.command_lib.air   r	   r
   r   2googlecloudsdk.command_lib.ai.persistent_resourcesr   r   ReleaseTracksReleaseTrackGAListCommandr   ALPHABETArB   r8   r"   r   <module>rP      s    9 &  ' A ( 3 7 / 5 W I D%%(()6T 6 *6r D%%++T->->-C-CD
( 
( E
(r"   