
                         J   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lmZ dd	lmZ e
j                   e
j                   e
j"                  j$                  e
j"                  j&                        e
j(                   G d
 de
j*                                             Zy)zList Workflows.    )absolute_import)division)unicode_literals)
list_pager)client_util)base)	run_flags)
propertiesc                   &    e Zd ZdZed        Zd Zy)Listz4List all Cloud Build runs in a Google Cloud project.c                 f    t        j                  | d       | j                  j                  d       y )NFz
        table(
            name.segment(5):label=ID,
            name.segment(3):label=REGION,
            createTime.date('%Y-%m-%dT%H:%M:%S%Oz', undefined='-')
        )
    )r	   AddsRegionResourceArgdisplay_info	AddFormat)parsers    $lib/surface/builds/workflows/list.pyArgsz	List.Args"   s+    ##FE2
!! # 	    c                 
   t        j                         }t        j                         }|j                  j                  j                         }|r|j                         }nQ|j                  xs2 t        j                  j                  j                  j                         }dj                  |      }t        j                  |j                  |j!                  ||j"                        d|j$                  d|j&                        S )z9This is what gets called when the user runs this command.zprojects/{}/locations/-)parentfilter	workflowspageSize)field
batch_sizebatch_size_attributelimit)r   GetClientInstanceGetMessagesModuleCONCEPTSregionParseRelativeNameprojectr
   VALUEScore	GetOrFailformatr   YieldFromListprojects_locations_workflows/CloudbuildProjectsLocationsWorkflowsListRequestr   	page_sizer   )selfargsclientmessages
region_refr   r$   s          r   RunzList.Run-   s    **,F,,.H%%++-J&&(fJ
 1 1 6 6 > > H H Jg(//8f##++@@$++ 	A 	/>>'jj r   N)__name__
__module____qualname____doc__staticmethodr   r2    r   r   r   r      s     =	 	r   r   N)r6   
__future__r   r   r   apitools.base.pyr   $googlecloudsdk.api_lib.cloudbuild.v2r   googlecloudsdk.callioper   %googlecloudsdk.command_lib.cloudbuildr	   googlecloudsdk.corer
   HiddenReleaseTracksReleaseTrackALPHABETAUniverseCompatibleListCommandr   r8   r   r   <module>rF      s     &  ' ' < ( ; * D%%++T->->-C-CD!4 !  E !r   