
    k                         d Z ddlZd Zy)z"Utilities for unit kinds commands.    Nc                    ~ ~d}t        |d      r|j                  }n?t        |d      r3t        j                  d|j                        }|r|j                  d      }|r~t        |d      rrt        |j                  d      r\|j                  j                  D ]C  }t        |d      s|j                  j                  d      r,| d	|j                   }||_        E |S )
a  Request 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
	Z	(""--k:x{:+>+>*?@( (*
	 4
 
.    )__doc__r
   r    r   r   <module>r      s    ) 	r   