
                         z    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SKJ
r
  SSKJr   SS	\S
\\   4S jjrg)z$Utilities for enabling service APIs.    )Optional)
enable_api)
exceptions)api_enablement)log)
properties)
console_ioservice_nameenable_by_defaultc                    [         R                  R                  R                  R	                  5       n [
        R                  " X 5      (       a  g[        R                  " 5       (       a  [        R                  " X US9  g[        R                  " SR                  U 5      5        g! [        R                   a(    [        R                   " SR                  U 5      5         gf = f)zPrompts to enable the API if it's not enabled.

Args:
  service_name: The name of the service to enable.
  enable_by_default: default choice for the enablement prompt.
N)r   z:Service {} is not enabled. This operation may not succeed.zZCould not verify if service {} is enabled: missing permission 'serviceusage.services.get'.)r   VALUEScoreproject	GetOrFailr   IsServiceEnabledr	   	CanPromptr   PromptToEnableApir   warningformatr   #GetServicePermissionDeniedExceptioninfo)r
   r   
project_ids      6lib/googlecloudsdk/api_lib/functions/api_enablement.pyPromptToEnableApiIfDisabledr      s       %%--779*"":<<&&
6G 
kk
F
M
M
 
	7	7 HH	((.|(<s   B& /B&  %B& &9C"!C"N)F)__doc__typingr   googlecloudsdk.api_lib.servicesr   r   googlecloudsdk.api_lib.utilr   googlecloudsdk.corer   r   googlecloudsdk.core.consoler	   strboolr        r   <module>r%      s@    +  6 6 6 # * 2 <A*24.r$   