
    8                     l    S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  S rS r	SS
 jr
S rS rS rg	)zResource parsing helpers.    )absolute_import)division)unicode_literals)
properties)	resourcesc                  d    [         R                  R                  R                  R	                  SS9$ )zReturns the value of the core/project config property.

Config properties can be overridden with command line flags. If the --project
flag was provided, this will return the value provided with the flag.
T)required)r   VALUEScoreprojectGet     3lib/googlecloudsdk/command_lib/metastore/parsers.py
GetProjectr      s*     
					'	'	+	+T	+	::r   c                 h    [         R                  R                  U S[        0SS9R	                  5       $ )zParses a network name using configuration properties for fallback.

Args:
  network: str, the network's ID, fully-qualified URL, or relative name

Returns:
  str: the relative name of the network resource
r   zcompute.networksparams
collection)r   REGISTRYParser   RelativeName)networks    r   ParseNetworkr   "   s;     
			!	!
Z& 
" 
( )57r   Nc                 |    [         R                  R                  U [        Uc  [        OUS.SS9R                  5       $ )zParses a subnetwork name using configuration properties for fallback.

Args:
  subnetwork: str, the subnetwork's ID, fully-qualified URL, or relative name
  location: str, the location ID

Returns:
  str: the relative name of the network resource
)r   regionzcompute.subnetworksr   )r   r   r   r   _GetConfigLocationPropertyr   )
subnetworklocations     r   ParseSubnetworkr    1   sF     
			!	!2:2B. ' 
" 
( )57r   c                 Z    [         R                  R                  U SS9R                  5       $ )zParses a secret manager secret version name using configuration properties for fallback.

Args:
  secret_manager_version: str, fully-qualified URL, or relative name

Returns:
  str: the relative name of the secret version resource
z'secretmanager.projects.secrets.versionsr   r   r   r   r   )secret_manager_versions    r   ParseSecretManagerSecretVersionr%   D   s0     
			!	!: 
" 
<<HLNKr   c                 Z    [         R                  R                  U SS9R                  5       $ )zParses a Cloud KMS key using configuration properties for fallback.

Args:
  cloud_kms_key: str, fully-qualified URL, or relative name

Returns:
  str: the relative name of the Cloud KMS key resource
z/cloudkms.projects.locations.keyRings.cryptoKeysr"   r#   )cloud_kms_keys    r   ParseCloudKmsKeyr(   R   s1     
			!	!B 
" 
 LNr   c                  f    [         R                  R                  R                  R	                  5       $ )z<Returns the value of the metastore/location config property.)r   r
   	metastorer   	GetOrFailr   r   r   r   r   a   s#    				$	$	-	-	7	7	99r   )N)__doc__
__future__r   r   r   googlecloudsdk.corer   r   r   r   r    r%   r(   r   r   r   r   <module>r/      s8      &  ' * );77&K:r   