
    
                         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\
R                  5      rg)zKCommand to list resource allowances for a specified Batch project/location.    )absolute_import)division)unicode_literals)
list_pager)resource_allowances)base)resource_args)
propertiesc                   .    \ rS rSrSr\S 5       rS rSrg)List   a  List resource allowances for a specified Batch project/location.

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

## EXAMPLES
To print all the resource allowances under all available locations for the
default project,
run:

  $ {command}

To print all the resource allowances under projects/location
`projects/foo/locations/us-central1`, run:

  $ {command} --project=foo --location=us-central1
c                     [         R                  " U 5        [        R                  R	                  U 5        U R
                  R                  S5        g )NzPtable(name, name.segment(3):label=LOCATION, usageResourceAllowance.status.state))r	   AddLocationResourceArgsr   URI_FLAGRemoveFromParserdisplay_info	AddFormat)parsers    -lib/surface/batch/resource_allowances/list.pyArgs	List.Args2   s;    ))&1MM""6*
!!	0    c           	      h   U R                  5       n[        R                  " U5      nUR                  =(       d2    [        R
                  R                  R                  R                  5       nUR                  =(       d2    [        R
                  R                  R                  R                  5       nU(       a  SR                  XT5      nOSR                  US5      n[        R                  " UR                  UR                  R!                  XaR"                  S9UR"                  SUR$                  SS9$ )Nzprojects/{}/locations/{}-)parentpageSizeresourceAllowancesr   )
batch_sizefieldlimitbatch_size_attribute)ReleaseTrackr   ResourceAllowancesClientlocationr
   VALUESbatchGetprojectcore	GetOrFailformatr   YieldFromListservicemessages3BatchProjectsLocationsResourceAllowancesListRequest	page_sizer    )selfargsrelease_trackclientr$   r(   r   s          r   RunList.Run;   s    %%'M 99-HF}}F
 1 1 7 7 @ @ D D FHllHj//44<<FFHG)00Cf)00#>f##KKNN 	L 	
 >>"jj'	 	r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r5   __static_attributes__r7   r   r   r   r      s     (  r   r   N)r<   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.batchr   googlecloudsdk.callioper    googlecloudsdk.command_lib.batchr	   googlecloudsdk.corer
   ListCommandr   r7   r   r   <module>rF      s5     R &  ' ' < ( : *24 2r   