
                            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  SSKJr  \R$                  \R&                  " \R(                  R*                  \R(                  R,                  5       " S S\R.                  5      5       5       r\R&                  " \R(                  R0                  5       " S S\5      5       r\R                   \l         g)z'Command for listing available services.    )global_methods)base)commands)connection_context)flags)	platforms)pretty_print)resource_args)serverless_operations)concept_parsers)presentation_specs)logc                   `    \ rS rSrSrSSS.r\S 5       r\S 5       r    SS jr	S	 r
S
 rSrg)List    List available services.z"          {description}
          zK          To list available services:

              $ {command}
          )DESCRIPTIONEXAMPLESc           	          [         R                  " S[        R                  " 5       SSSSS9n[        R
                  " U/5      R                  U5        UR                  R                  U R                  5        g )Nz--namespacezNamespace to list services in.TF)requiredprefixeshidden)
r   ResourcePresentationSpecr
   GetNamespaceResourceSpecr   ConceptParserAddToParserdisplay_info
AddUriFunc_GetResourceUri)clsparsernamespace_presentations       lib/surface/run/services/list.py
CommonArgsList.CommonArgs2   sl     0HH..0( !!#9 #$ %%0[%8
""3#6#67    c                 &    U R                  U5        g Nr$   r    r!   s     r#   Args	List.ArgsA       NN6r&   c                    [         R                  S/nU(       a)  UR                  SR                  U(       a  SOS5      5        U(       a  UR                  S5        U(       a  UR                  S5        UR	                  / SQ5        UR                  5       R                  SR                  S	R                  U5      [        R                  S
95        g)aW  Set display format for output.

Args:
  args: Namespace, the args namespace
  show_region: bool, True to show region of listed services
  show_namespace: bool, True to show namespace of listed services
  show_description: bool, True to show description of listed services
  is_multi_region: bool, True if the list is for multi-region services
z'firstof(id,metadata.name):label=SERVICEzregion:label={}REGIONSREGIONznamespace:label=NAMESPACEzdescription:label=DESCRIPTION)zdomain:label=URLz&last_modifier:label="LAST DEPLOYED BY"z-last_transition_time:label="LAST DEPLOYED AT"ztable({columns}):({alias}),)columnsaliasN)
r	   READY_COLUMNappendformatextendGetDisplayInfo	AddFormatjoinr   SATISFIES_PZS_ALIAS)selfargsshow_regionshow_namespaceshow_descriptionis_multi_regionr2   s          r#   
_SetFormatList._SetFormatE   s      	!!1G nn&f/YxHJnn01nn45NN  
 	##$++HHW%X-I-I 	, 	
r&   c                 N    U R                  USS9  [        R                  " U5      $ )z1Provides the method to provide a regionless list.T)r>   )rB   r   ListServices)r<   clientr=   s      r#   _GlobalListList._GlobalListj   s#    OODdO+&&v..r&   c           	         [         R                  " 5       [         R                  :H  nU(       a  UR                  S5      (       dy  [        R
                  " 5       nU R                  UR                  5        UR                  R                  R                  5         [        R                  " U R                  X15      5      $ [        R                  " U[         R"                  R$                  U R'                  5       5      nU R)                  XU(       + S9  UR                  R                  R                  5       n[*        R,                  " U5       nU R/                  UR0                  5        U(       d  SnSn[3        US5      (       a  SR5                  UR6                  5      n[3        US5      (       a  SR5                  UR8                  5      n[:        R<                  R?                  SR5                  UR@                  UUS	95        [        R                  " URC                  U5      5      sS
S
S
5        $ ! , (       d  f       g
= f)r   region)r>   r?    cluster_locationz in [{}]cluster_projectz in project [{}]z'For cluster [{cluster}]{zone}{project}:)clusterzoneprojectN)"r   GetPlatformPLATFORM_MANAGEDIsSpecifiedr   GetServerlessClientInstanceSetPartialApiEndpointurlCONCEPTS	namespaceParser   
SortByNamerG   r   GetConnectionContextr   ProductRUNReleaseTrackrB   r   ConnectSetCompleteApiEndpointendpointhasattrr6   rL   rM   r   statusPrintcluster_namerE   )r<   r=   
is_managedrF   conn_contextnamespace_reflocation_msgproject_msgs           r#   RunList.Runo   s   &&(I,F,FFJ$**84499;f
  ,
mm##%  !1!1&!?@@'<<
!!4#4#4#68l
oo
J  Imm--335m ((6&##L$9$9:,+\#566%,,\-J-JKL\#455,33,,.K
**

DKK"//! L # $ ""6#6#6}#EF 766s   
CH//
H= N)FFFF)__name__
__module____qualname____firstlineno____doc__detailed_helpclassmethodr$   r+   rB   rG   rk   __static_attributes__rm   r&   r#   r   r       s_     !- 8 8  
 # %"'!&#J/
Gr&   r   c                   (    \ rS rSrSr\S 5       rSrg)	AlphaList   r   c                 &    U R                  U5        g r(   r)   r*   s     r#   r+   AlphaList.Args   r-   r&   rm   N)rn   ro   rp   rq   rr   rt   r+   ru   rm   r&   r#   rw   rw      s      r&   rw   N)rr   googlecloudsdk.api_lib.runr   googlecloudsdk.callioper   googlecloudsdk.command_lib.runr   r   r   r   r	   r
   r   (googlecloudsdk.command_lib.util.conceptsr   r   googlecloudsdk.corer   UniverseCompatibleReleaseTracksr^   BETAGAr   ALPHArw   rm   r&   r#   <module>r      s    . 6 ( 3 = 0 4 7 8 @ D G # D%%**D,=,=,@,@AjG8== jG B jGZ D%%++,  - LL	 r&   