
                         :   S r SSKJr  SSKJr  SSKJr  SSKJr  Sr	Sr
\R                  R                  S\R                  R                  S	\R                  R                  S
0rSS jr\R                  R                  4S jr\R                  R                  4S jrg)z)Utilities for Cloud Quotas API QuotaInfo.    )
list_pager)message_util)apis)base
   z%s/locations/global/services/%sv1alphav1betav1c                 V    [         R                  U 5      n[        R                  " SX!S9$ )Ncloudquotas)no_http)VERSION_MAPgetr   GetClientInstance)release_trackr   api_versions      /lib/googlecloudsdk/api_lib/quotas/quota_info.py_GetClientInstancer   !   s#    .+			{	LL    c                    [         R                  " XU5      n[        U5      nUR                  n[        Xc4-  SU-  -   n	U (       a*  UR                  U	S9n
UR                  R                  U
5      $ U(       a*  UR                  U	S9n
UR                  R                  U
5      $ U(       a*  UR                  U	S9n
UR                  R                  U
5      $ g)aD  Retrieve the QuotaInfo of a quota for a project, folder or organization.

Args:
  project: str, The project ID.
  folder: str, The folder ID.
  organization: str, The organization ID.
  service: str, The service name.
  quota_id: str, The quota ID.
  release_track: str, The release track.

Returns:
  The request QuotaInfo
z/quotaInfos/%s)nameN)r   CreateConsumerr   MESSAGES_MODULE#_CONSUMER_LOCATION_SERVICE_RESOURCE8CloudquotasProjectsLocationsServicesQuotaInfosGetRequest&projects_locations_services_quotaInfosGet7CloudquotasFoldersLocationsServicesQuotaInfosGetRequest%folders_locations_services_quotaInfos=CloudquotasOrganizationsLocationsServicesQuotaInfosGetRequest+organizations_locations_services_quotaInfos)projectfolderorganizationservicequota_idr   consumerclientmessagesr   requests              r   GetQuotaInfor+   &   s    * ((,G(m,&##()X,??8#$ 
 OO P G 88<<WEENN O G 77;;GDDNN 	O 	
 
 ==AA'JJ r   c           	         [         R                  " U R                  U R                  U R                  5      n[        U5      nUR                  n[        X R                  4-  nU R                  (       ad  UR                  UU R                  S9n[        R                  " UR                  USU R                  b  U R                  O[        SU R                  S9$ U R                  (       ad  UR!                  UU R                  S9n[        R                  " UR"                  USU R                  b  U R                  O[        SU R                  S9$ U R                  (       ad  UR%                  UU R                  S9n[        R                  " UR&                  USU R                  b  U R                  O[        SU R                  S9$ g)zLists info for all quotas for a given project, folder or organization.

Args:
  args: argparse.Namespace, The arguments that this command was invoked with.
  release_track: str, The release track.

Returns:
  List of QuotaInfo
)parentpageSizer.   N
quotaInfos)batch_size_attribute
batch_sizefieldlimit)r   r   r"   r#   r$   r   r   r   r%   9CloudquotasProjectsLocationsServicesQuotaInfosListRequest	page_sizer   YieldFromListr   	PAGE_SIZEr3   8CloudquotasFoldersLocationsServicesQuotaInfosListRequestr   >CloudquotasOrganizationsLocationsServicesQuotaInfosListRequestr!   )argsr   r'   r(   r)   r-   r*   s          r   ListQuotaInfor;   X   s    ((
llDKK!2!2( m,&##(.(LL1II&	\\JJ^^ 	K 	
  ##55'%)^^%?4>>Yjj  
[[OO P G ##44'%)^^%?4>>Yjj  
OO^^ 	P 	
  ##::'%)^^%?4>>Yjj  r   N)F)__doc__apitools.base.pyr   googlecloudsdk.api_lib.quotasr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   r7   r   ReleaseTrackALPHABETAGAr   r   r+   r;    r   r   <module>rF      s    0 ' 6 , (	&G # 	YH$M ##&&/Kd '+&7&7&:&: =r   