
    /                     :   S r SSKJrJr  SSKJr  SSKJr  SSKJ	r	  \R                  r
S\\\4   S\4S jrS\\\4   S\4S	 jr\\S
.rSSS.r\R                   \R"                  " \R$                  R&                  5       " S S\R(                  5      5       5       rg)z!'vmware datastores list' command.    )AnyDict)
datastores)base)flagsrreturnc                 
   U R                  S5      (       am  U S   R                  S5      (       a:  U S   S   R                  S5      (       a  gU S   S   R                  S5      (       a  gU S   R                  S5      (       a  gg	)
zGets the service type from a datastore resource.

Args:
  r: The datastore resource.

Returns:
  A string representing the service type, or an empty string if not found.
nfsDatastoregoogleFileServicenetappVolumeNETAPPfilestoreInstance	FILESTOREthirdPartyFileServiceTHIRD_PARTY )get)r   s    %lib/surface/vmware/datastores/list.py_GetServiceTyper      s     UU>011	
>	.	/	3	3N	C	C	
>	.	/	3	34G	H	H455	    c                    U R                  S5      (       a  U S   nUR                  S5      (       a_  US   nUR                  S5      (       a  US   R                  S5      S   $ UR                  S5      (       a  US   R                  S5      S   $ UR                  S5      (       aI  US   nUR                  SS	5      nUR                  S
/ 5      nU(       a  SR                  U5      S-   U-   $ U$ g	)zGets the volume information from a datastore resource.

Args:
  r: The datastore resource.

Returns:
  A string representing the volume, or an empty string if not found.
r   r   r   /r   r   	fileSharer   servers,:)r   splitjoin)r   nfsgfstfs
file_sharer   s         r   
_GetVolumer%   /   s     UU>
N
C
ww"###$c		 	 >"((-b11	$	%	%&'--c2266
ww&'''(c77;+j	2&g	xx 3&33	r   )service_typevolumez$
          List datastores.
        a$  
          To list datastores in location `us-west2-a`, run:

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

          Or:

          $ {command}

          In the second example, the project and location are taken from gcloud properties core/project and compute/zone.
    )DESCRIPTIONEXAMPLESc                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)List]   zList datastores.c                     [         R                  " U 5        U R                  R                  [        5        U R                  R                  S5        g)z Register flags for this command.ztable(name.segment(-1):label=NAME,name.segment(-5):label=PROJECT,name.segment(-3):label=LOCATION,createTime,state,service_type():label=SERVICE_TYPE,volume():label=VOLUME)N)r   AddLocationArgToParserdisplay_infoAddTransforms
TRANSFORMS	AddFormat)parsers    r   Args	List.Argsd   s?     
  (
%%j1
!! #; <r   c                     UR                   R                  R                  5       n[        5       nUR	                  U5      $ )N)CONCEPTSlocationParseDatastoresClientr+   )selfargsr8   clients       r   RunList.Runp   s1    }}%%++-HF;;x  r    N)__name__
__module____qualname____firstlineno____doc__DETAILED_HELPdetailed_helpstaticmethodr4   r>   __static_attributes__r@   r   r   r+   r+   ]   s#     -	< 	<!r   r+   N)rE   typingr   r   googlecloudsdk.api_lib.vmwarer   googlecloudsdk.callioper   !googlecloudsdk.command_lib.vmwarer   r:   strr   r%   r1   rF   DefaultUniverseOnlyReleaseTracksReleaseTrackGAListCommandr+   r@   r   r   <module>rT      s    (  4 ( 3.. tCH~ # ($sCx. S 6 .D

	$ D%%(()!4 ! * !r   