Ë
    €Ïþ  ã                   óŠ   — d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ dZdZ	d	Z
d
ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zy)z/Utils for manipulating transfer resource names.é    )Úabsolute_import)Údivision)Úunicode_literalsN)Ú
propertiesz^transferJobs/.+z^transferOperations/.+z!^projects\/(.+)\/agentPools\/(.+)ztransferJobs/ztransferOperations/c                 ó<   — t        j                  | |«      r|S ||z   S )z0Adds prefix to one resource string if necessary.)ÚreÚmatch)Úprefix_to_checkÚprefix_to_addÚresource_strings      ú4lib/googlecloudsdk/command_lib/transfer/name_util.pyÚ_add_single_transfer_prefixr   !   s#   € ô ‡XXˆo˜Ô/ØÐØ	˜Ñ	(Ð(ó    c                 ó²   — t        |t        «      rt        | ||«      S t        |t        «      r|D cg c]  }t        | ||«      ‘Œ c}S t	        d«      ‚c c}w )zCAdds prefix to one resource string or list of strings if necessary.z+Argument must be string or list of strings.)Ú
isinstanceÚstrr   ÚlistÚ
ValueError)r
   r   Úresource_string_or_listr   s       r   Ú_add_transfer_prefixr   )   ss   € ô Ð'¬Ô-Ü& ¸Ø'>ó@ð @äÐ)¬4Ô0ñ  7óñ  7ˆOô 	$ O°]Ø$3õ	5à6ñð ô
 	Ð@ÓAÐAùòs   ²Ac                 ó,   — t        t        t        | «      S )z,Adds prefix to transfer job(s) if necessary.)r   Ú_JOBS_PREFIX_REGEXÚ_JOBS_PREFIX_STRING)Újob_name_string_or_lists    r   Úadd_job_prefixr   8   s   € ä	Ô0Ô2EØ5ó
7ð 7r   c                 ó,   — t        t        t        | «      S )z2Adds prefix to transfer operation(s) if necessary.)r   Ú_OPERATIONS_PREFIX_REGEXÚ_OPERATIONS_PREFIX_STRING)Újob_operation_string_or_lists    r   Úadd_operation_prefixr    >   s   € ä	Ô6Ü7Ø:ó
<ð <r   c                 óÒ   — t         j                  j                  j                  j	                  «       }dj                  |«      }t        t        || «      }|s|| k7  rt        d«      ‚|S )z3Adds prefix to transfer agent pool(s) if necessary.zprojects/{}/agentPools/z›Project ID not found. Please set a gcloud-wide project, or use full agent pool names (e.g. "projects/[your project ID]/agentPools/[your agent pool name]").)	r   ÚVALUESÚcoreÚprojectÚGetÚformatr   Ú_AGENT_POOLS_PREFIX_REGEXr   )Úagent_pool_string_or_listÚ
project_idr   Úresults       r   Úadd_agent_pool_prefixr+   E   sh   € ä× Ñ ×%Ñ%×-Ñ-×1Ñ1Ó3€*Ø+×2Ñ2°:Ó>€-ÜÔ 9¸=Ø 9ó;€&á	˜Ð";Ò;Ü
ð	ó ð  ð 
€-r   c                 óT   — | j                  t        «      r| t        t        «      d S | S )z.Removes prefix from transfer job if necessary.N)Ú
startswithr   Úlen)Ú
job_strings    r   Úremove_job_prefixr0   S   s+   € à×ÑÔ.Ô/Ø”cÔ-Ó.Ð/Ð0Ð0Ø	Ðr   c                 óT   — | j                  t        «      r| t        t        «      d S | S )z4Removes prefix from transfer operation if necessary.N)r-   r   r.   )Úoperation_strings    r   Úremove_operation_prefixr3   Z   s+   € à× Ñ Ô!:Ô;ØœCÔ 9Ó:Ð;Ð<Ð<Ø	Ðr   c                 ó`   — t        j                  t        | «      }|r|j                  d«      S | S )z5Removes prefix from transfer agent pool if necessary.é   )r   Úsearchr'   Úgroup©Úagent_pool_stringÚprefix_search_results     r   Úremove_agent_pool_prefixr;   a   s/   € äŸ™Ô#<Ð>OÓPÐÙØ×%Ñ% aÓ(Ð(Ø	Ðr   c                 ór   — t        j                  t        | «      }|r|j                  d«      S t	        d«      ‚)Né   ztFull agent pool prefix required to extract project from string (e.g. "projects/[project ID]/agentPools/[pool name]).)r   r6   r'   r7   r   r8   s     r   Ú"get_agent_pool_project_from_stringr>   i   s=   € ÜŸ™Ô#<Ð>OÓPÐÙØ×%Ñ% aÓ(Ð(Üð?ó	@ð @r   )Ú__doc__Ú
__future__r   r   r   r   Úgooglecloudsdk.corer   r   r   r'   r   r   r   r   r   r    r+   r0   r3   r;   r>   © r   r   Ú<module>rC      sf   ðñ 6å &Ý Ý 'ã 	å *à(Ð Ø4Ð Ø@Ð à%Ð Ø1Ð ò)òBò7ò<òòòòó@r   