
                         @    S r SSKrSSKJr  S\S\4S jrS\S\4S jrg)	z1BQ CLI helper functions for IDs for the frontend.    N)utilstransfer_identifierreturnc                     Un[         R                  " SU5      nU(       d)  S[        R                  " U S9R                  -   S-   U-   nU$ UR                  S5      U l        U$ )a  Formats a transfer config or run identifier.

Transfer configuration/run commands should be able to support different
formats of how the user could input the project information. This function
will take the user input and create a uniform transfer config or
transfer run reference that can be used for various commands.

This function will also set the client's project id to the specified
project id.

Returns:
  The formatted transfer config or run.
projects/([^/]+)z	projects/)id_fallbacks/   )researchbq_client_utilsGetProjectReference	projectIdgroup
project_id)clientr   formatted_identifiermatchs        platform/bq/frontend/utils_id.pyFormatDataTransferIdentifiersr      ss     -
))')<
=%	

-
-6
B
L
L	M
	 	  
 AF	    r   c                 t    Un[         R                  " SU5      nU(       a  UR                  S5      nX l        U$ )zFormats a project identifier.

If the user specifies a project with "projects/${PROJECT_ID}", isolate the
project id and return it.

This function will also set the client's project id to the specified
project id.

Returns:
  The project is.
r   r
   )r   r   r   r   )r   r   r   r   s       r   FormatProjectIdentifierr   '   s8     $
))'
4%
 ;;q>,	r   )__doc__r   clientsr   r   strr   r    r   r   <module>r      s4    7 	 ,s s >  r   