
                            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  \
R                  " \
R                  R                  \
R                  R                   5      \
R"                   " S	 S
\
R$                  5      5       5       r\
R                  " \
R                  R(                  5      \
R"                   " S S\
R$                  5      5       5       rg)z0Command to list tasks for a specified Batch job.    )absolute_import)division)unicode_literals)
list_pager)tasks)base)resource_argsc                   .    \ rS rSrSr\S 5       rS rSrg)List   	  List tasks for a specified Batch job.

Currently, since Batch only supports one taskGroup, group0, the command
takes --job as the required argument and will list all tasks
in group0 of the job.

This command can fail for the following reasons:
* The job specified does not exist.
* The active account does not have permission to access the given job

## EXAMPLES

To print all tasks in the job with name
`projects/foo/locations/us-central1/jobs/bar`, run:

  $ {command} --job projects/foo/locations/us-central1/jobs/bar
c                     [         R                  " U 5        [        R                  R	                  U 5        U R
                  R                  S5        g Nztable(name, status.state)r	   AddJobFlagResourceArgsr   URI_FLAGRemoveFromParserdisplay_info	AddFormatparsers    lib/surface/batch/tasks/list.pyArgs	List.Args1   7    ((0MM""6*
!!"=>    c           	         U R                  5       n[        R                  " U5      nUR                  R                  R                  5       n[        R                  " UR                  UR                  R                  UR                  5       S-   UR                  UR                  S9UR                  SUR                  SS9$ )N/taskGroups/group0)parentpageSizefilterr   r    
batch_sizefieldlimitbatch_size_attribute)ReleaseTrackr   TasksClientCONCEPTSjobParser   YieldFromListservicemessages4BatchProjectsLocationsJobsTaskGroupsTasksListRequestRelativeName	page_sizer!   r%   selfargsrelease_trackclientjob_refs        r   RunList.Run7   s    %%'M}-Fmm%%'G##LL''),@@^^;; 	M 	

 >>jj' r    N	__name__
__module____qualname____firstlineno____doc__staticmethodr   r8   __static_attributes__r:   r   r   r   r      s     $ ? ?
r   r   c                   .    \ rS rSrSr\S 5       rS rSrg)	ListAlphaK   r   c                     [         R                  " U 5        [        R                  R	                  U 5        U R
                  R                  S5        g r   r   r   s    r   r   ListAlpha.Args`   r   r   c           	      j   U R                  5       n[        R                  " U5      nUR                  R                  R                  5       n[        R                  " UR                  UR                  R                  UR                  5       S-   UR                  S9UR                  SUR                  SS9$ )zAlpha version method to list tasks for a specified Batch job.

Args:
  args: The command line arguments of the list command including job
    resource, page size, filter, limit and sort-by.
Returns:
  The list of tasks for the job.

r   )r   r    r   r    r"   )r'   r   r(   r)   r*   r+   r   r,   r-   r.   r/   r0   r1   r%   r2   s        r   r8   ListAlpha.Runf   s     %%'M}-Fmm%%'G##LL''),@@^^ 	M 	
 >>jj'
 
r   r:   Nr;   r:   r   r   rD   rD   K   s     $ ? ?
r   rD   N)r@   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.batchr   googlecloudsdk.callioper    googlecloudsdk.command_lib.batchr	   ReleaseTracksr'   GABETAUniverseCompatibleListCommandr   ALPHArD   r:   r   r   <module>rU      s     7 &  ' ' . ( : D%%(($*;*;*@*@A*4 *  B*Z D%%++,2   2  -2r   