
    L                     $   d Z ddlmZ ddlmZ ddlmZ dZej                  j                  dej                  j                  dej                  j                  diZdd	Zej                  j                  fd
Zej                  j                  fdZy)z5Utilities for Cloud Quotas API QuotaAdjusterSettings.    )message_util)apis)basez%s/locations/globalv1alphav1betav1c                 \    t         j                  |       }t        j                  d||      S )Ncloudquotas)no_http)VERSION_MAPgetr   GetClientInstance)release_trackr   api_versions      <lib/googlecloudsdk/api_lib/quotas/quota_adjuster_settings.py_GetClientInstancer      s%    .+			{G	LL    c                 
   t        j                  | j                  | j                  | j                        }t        |      }|j                  }t        |z  dz   }| j                  r-|j                  |      }|j                  j                  |      S | j                  r-|j                  |      }|j                  j                  |      S | j                  r-|j                  |      }|j                  j                  |      S y)a  Retrieve the QuotaAdjusterSettings for a project, folder, or organization.

  Args:
    args: argparse.Namespace, The arguments that this command was invoked with.
    release_track: base.ReleaseTrack, The release track to use.

  Returns:
    The requested QuotaAdjusterSettings.
  /quotaAdjusterSettings)nameN)r   CreateConsumerprojectfolderorganizationr   MESSAGES_MODULE_CONSUMER_LOCATION_RESOURCEPCloudquotasProjectsLocationsQuotaAdjusterSettingsGetQuotaAdjusterSettingsRequest(projects_locations_quotaAdjusterSettingsGetQuotaAdjusterSettingsOCloudquotasFoldersLocationsQuotaAdjusterSettingsGetQuotaAdjusterSettingsRequest'folders_locations_quotaAdjusterSettingsUCloudquotasOrganizationsLocationsQuotaAdjusterSettingsGetQuotaAdjusterSettingsRequest-organizations_locations_quotaAdjusterSettings)argsr   consumerclientmessagesr   requests          r   r   r   $   s    ((
llDKK!2!2( m,&##(	$	14L	L$	\\gg h G ::SS  
[[ff g G 	66OO	
 
ll m G ??XX 	 r   c                    t        j                  | j                  | j                  | j                        }t        |      }|j                  }t        |z  dz   }| j                  dk(  rd}d}n5d}|j                  j                  | j                  j                               }|j                  |||      }| j                  r9|j                  ||| j                        }	|j                  j                  |	      S | j                  r9|j!                  ||| j                        }	|j"                  j                  |	      S | j                  r9|j%                  ||| j                        }	|j&                  j                  |	      S y)a  Updates the QuotaAdjusterSettings of a project, folder, or organization.

  Args:
    args: argparse.Namespace, The arguments that this command was invoked with.
    release_track: base.ReleaseTrack, The release track to use.

  Returns:
    The updated QuotaAdjusterSettings.
  r   	inheritedTNF)r   
enablementr*   )r   quotaAdjusterSettingsvalidateOnly)r   r   r   r   r   r   r   r   r+   QuotaAdjusterSettingsEnablementValueValuesEnumupperSCloudquotasProjectsLocationsQuotaAdjusterSettingsUpdateQuotaAdjusterSettingsRequestvalidate_onlyr   UpdateQuotaAdjusterSettingsRCloudquotasFoldersLocationsQuotaAdjusterSettingsUpdateQuotaAdjusterSettingsRequestr!   XCloudquotasOrganizationsLocationsQuotaAdjusterSettingsUpdateQuotaAdjusterSettingsRequestr#   )
r$   r   r%   r&   r'   r   r*   r+   quota_adjuster_settingsr(   s
             r   r3   r3   O   s    ((
llDKK!2!2( m,&##(	$	14L	L$	__#IJI//IIJ %:: ;  
\\jj5'' k G
 ::VV  
[[ii5'' j G
 99UU  
oo5'' p G
 ??[[  r   N)F)__doc__googlecloudsdk.api_lib.quotasr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   r   ReleaseTrackALPHABETAGAr   r   r   r3    r   r   <module>r@      s    < 6 , ( 4  	YH$M
 261B1B1H1H (V 594E4E4K4K 9r   