
    k                         S r SSKrS rg)z"Utilities for unit kinds commands.    Nc                    A ASn[        US5      (       a  UR                  nOJ[        US5      (       a9  [        R                  " SUR                  5      nU(       a  UR                  S5      nU(       a  [        US5      (       a  [        UR                  S5      (       ai  UR                  R                   HO  n[        US5      (       d  M  UR                  R                  S5      (       a  M8  U S	UR                   3nXel        MQ     U$ )
zRequest hook to add parent to dependencies if missing.

Args:
  ref: A resource ref to the parsed resource.
  args: Parsed args namespace containing the flags.
  request: The request message to be modified.

Returns:
  The modified request message.
Nparentnamez (projects/[^/]+/locations/[^/]+)   unitKinddependenciesz	projects/z/unitKinds/)	hasattrr   rematchr   groupr   r   
startswith)refargsrequestr   r   
dependencyfull_uris          9lib/googlecloudsdk/command_lib/saas_runtime/unit_kinds.pyAddParentToDependenciesr      s     
4&Wh^^FwHH8',,GE{{1~f
':
&
&
'""N
3
3&&33
	Z	(	(""--k::x{:+>+>*?@( (
	 4
 
.    )__doc__r
   r    r   r   <module>r      s    ) 	r   