
    	                     ^    S r SSKJr  SSKJr  SSKJr  SSKrSSKJr  SSKJ	r	  S r
S	 rS
 rg)z4Utilities for constructing CloudQuotas API messages.    )absolute_import)division)unicode_literalsN)
exceptions)
propertiesc                 h    [         R                  " SU5      (       d  [        R                  " X5      eg)zValidates the container.

Args:
  container_type: str, The container type.
  flag_value: str, The flag value.

Raises:
  exceptions.InvalidArgumentException: If the flag value is invalid.
z^[a-z0-9-:]+$N)rematchr   InvalidArgumentException)container_type
flag_values     1lib/googlecloudsdk/api_lib/quotas/message_util.py_ValidateContainerr      s+     
/:	.	.

-
-n
II 
/    c                 .   U (       a9   [         R                  R                  R                  R	                  U 5        SU -   $ U(       a  [        SU5        SU-   $ U(       a  [        SU5        SU-   $ g! [
         a    [        R                  " SU 5      ef = f)a&  Creates a consumer string based on project, folder or organization.

Args:
  project: str, The project ID.
  folder: str, The folder ID.
  organization: str, The organization ID.

Returns:
  The consumer string in projects/{project}, folders/{folder}, or
  organizations/{organization} format.
project	projects/folderzfolders/organizationzorganizations/N)	r   VALUEScorer   Validate	Exceptionr   r   r   )r   r   r   s      r   CreateConsumerr   )   s     D$$--g6   x(~|4l**	  D//	7CCDs   3A2 2"Bc                 $    [        SU 5        SU -   $ )zCreates a project consumer string.

Args:
  project: str, The project ID.

Returns:
  The consumer string in projects/{project} format.
r   r   )r   )r   s    r   CreateProjectConsumerr   D   s     Y(	w	r   )__doc__
__future__r   r   r   r	   googlecloudsdk.callioper   googlecloudsdk.corer   r   r   r    r   r   <module>r"      s,    ; &  ' 	 . *J6
r   