
    t                        S 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.    )
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.Args.   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.Run4   s    %%'M}-Fmm%%'G##LL''),@@^^;; 	M 	

 >>jj' r    N	__name__
__module____qualname____firstlineno____doc__staticmethodr   r5   __static_attributes__r7   r   r   r   r      s     $ ? ?
r   r   c                   .    \ rS rSrSr\S 5       rS rSrg)	ListAlphaH   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,   r-   r.   r"   r/   s        r   r5   ListAlpha.Runc   s     %%'M}-Fmm%%'G##LL''),@@^^ 	M 	
 >>jj'
 
r   r7   Nr8   r7   r   r   rA   rA   H   s     $ ? ?
r   rA   N)r=   apitools.base.pyr   googlecloudsdk.api_lib.batchr   googlecloudsdk.callioper    googlecloudsdk.command_lib.batchr   ReleaseTracksr$   GABETAUniverseCompatibleListCommandr   ALPHArA   r7   r   r   <module>rQ      s     7 ( . ( : D%%(($*;*;*@*@A*4 *  B*Z D%%++,2   2  -2r   