
    
                     f    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S
 rS rg)    )absolute_import)division)unicode_literalsN)
exceptions)
propertiesc                     U R                  SS9nUR                  SSS9  UR                  SSS9  UR                  SS	S9  g
)z<Add args for the parent resource of a request to the parser.F)requiredz	--projectzProject number or id. Only one of --project, --folder, or --organization can be provided. If none are provided then it uses config property [core/project].)helpz--folderzFolder number. Only one of --project, --folder, or --organization can be provided. If none are provided then it uses config property [core/project].z--organizationzOrganization number. Either --project, --folder, or --organization must be provided. If none are provided then it uses config property [core/project].N)add_mutually_exclusive_groupadd_argument)parserparent_groups     8lib/googlecloudsdk/command_lib/access_approval/parent.pyArgsr      sm    44e4D, i    b    d      c                 
   S[        S U R                  U R                  U R                  4 5       5      :X  a7  [        R
                  R                  R                  R                  5       U l        SnU R                  (       a&  [        U R                  5        SU R                  -  nU$ U R                  (       a&  [        U R                  5        SU R                  -  nU$ [        U R                  5        SU R                  -  nU$ )zCReturns the parent resource from args or the active gcloud project.r   c              3   8   #    U  H  n[        U5      v   M     g 7f)N)bool).0xs     r   	<genexpr>GetParent.<locals>.<genexpr>-   s     NM!d1ggMs   Nzprojects/%sz
folders/%szorganizations/%s)sumprojectfolderorganizationr   VALUEScore	GetOrFail_ValidateProject_ValidateFolder_ValidateOrganization)argsparents     r   	GetParentr%   +   s    #Ndkk4;L;LMN
NN $$))11;;=DL&	\\T\\"T\\)F 
- {{DKK DKK'F
 
- $++,$"3"33F	-r   c                 j    [         R                  " SU 5      (       d  [        R                  " SU 5      eg )Nz^[a-z0-9-]+$r   rematchr   InvalidArgumentException
flag_values    r   r    r    @   s+    	.*	-	-

-
-i
DD 
.r   c                 j    [         R                  " SU 5      (       d  [        R                  " SU 5      eg )N^[0-9]+$r   r'   r+   s    r   r!   r!   E   s+    	*j	)	)

-
-h

CC 
*r   c                 j    [         R                  " SU 5      (       d  [        R                  " SU 5      eg )Nr.   r   r'   r+   s    r   r"   r"   J   s+    	*j	)	)

-
-nj
II 
*r   )
__future__r   r   r   r(   googlecloudsdk.callioper   googlecloudsdk.corer   r   r%   r    r!   r"    r   r   <module>r4      s5     '  ' 	 . *"*E
D
Jr   