Ë
    €ÏÁ  ã                   ó<   — d Z ddlZddlmZ dedefd„Zdedefd„Zy)	z1BQ CLI helper functions for IDs for the frontend.é    N)ÚutilsÚtransfer_identifierÚreturnc                 ó¼   — |}t        j                  d|«      }|s+dt        j                  | ¬«      j                  z   dz   |z   }|S |j                  d«      | _        |S )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                 ój   — |}t        j                  d|«      }|r|j                  d«      }|| _        |S )a   Formats 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   '   s:   € ð $ÐÜ
)‰)Ð'¨Ó
4€%Ù
Ø Ÿ;™; q›>Ðà,€FÔà	Ðr   )Ú__doc__r   Úclientsr   r   Ústrr   r   © r   r   Ú<module>r      s4   ðá 7ã 	Ý ,ð¸sð Àsó ð>°ð ¸ô r   