
    H                         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SK
Jr  SS	K
Jr  S
\\   4S jrS rS rg)z2Common flags for workload identity pools commands.    )absolute_import)division)unicode_literalsN)
Collection)util)arg_parsers)
exceptions	arg_valuec           	         [         R                  " 5       u  p#[        R                  " S[        R                  5      n/ nU H~  nUR                  U5      nU(       d&  [        R                  " U SR                  U5      5      eUR                  UR                  UR                  S5      UR                  S5      S95        M     U$ )z,Parses a single attribute selector argument.z([^=]+)(?:=)(.+)zInvalid flag value [{0}]      )	attributevalue)r   GetClientAndMessagesrecompileDOTALLmatchgcloud_exceptionsInvalidArgumentExceptionformatappendSingleAttributeSelectorgroup)arg_namer
   _messages!single_attribute_selector_matchersingle_attribute_selectorsargr   s           Clib/googlecloudsdk/command_lib/iam/workload_identity_pools/flags.pyParseSingleAttributeSelectorArgr"      s    ))++!&(jj1CRYY&O#!c-33C8E66
.55c:  %%((kk!nEKKN 	) 	
  
$#    c                     U R                  S[        R                  " 5       SSS9  U R                  S[        R                  " 5       SSS9  g )Nz--resourcesz4A list of allowed resources for the workload source.RESOURCEtypehelpmetavarz--attached-service-accountszDA list of allowed attached_service_accounts for the workload source.SERVICE_ACCOUNTadd_argumentr   ArgListparsers    r!   AddGcpWorkloadSourceFlagsr0   1   sT     A	   	# 
P  r#   c                 p   U R                  S[        R                  " 5       SSS9  U R                  S[        R                  " 5       SSS9  U R                  S[        R                  " 5       S	SS9  U R                  S
[        R                  " 5       SSS9  U R                  SSSS9  U R                  SSSS9  g)z2Adds the flags for update workload source command.z--add-resourcesz:A list of allowed resources to add to the workload source.r%   r&   z--add-attached-service-accountszJA list of allowed attached_service_accounts to add to the workload source.r*   z--remove-resourcesz?A list of allowed resources to remove from the workload source.z"--remove-attached-service-accountszOA list of allowed attached_service_accounts to remove from the workload source.z--clear-resourcesz9Remove all the allowed resources for the workload source.
store_true)r(   actionz!--clear-attached-service-accountszIRemove all the allowed attached_service_accounts for the workload source.Nr+   r.   s    r!   AddUpdateWorkloadSourceFlagsr4   C   s     G	   	'      	 L	   	*      	F  
 	)   r#   )__doc__
__future__r   r   r   r   typingr   googlecloudsdk.api_lib.iamr   googlecloudsdk.callioper   r	   r   strr"   r0   r4    r#   r!   <module>r<      s<    9 &  ' 	  + / C$C $($,r#   