
    >	                         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\R                  5      r
 " S	 S
5      rS rS rg)z0Functions that directly interact with Cloud Run.    )connection_context)	platforms)serverless_operations)
exceptions)
console_ioc                       \ rS rSrSrSrg)ServiceAlreadyExistsError   zCError thrown if the service already exists and overwrite denied.
   N)__name__
__module____qualname____firstlineno____doc____static_attributes__r       5lib/googlecloudsdk/command_lib/code/cloud/cloudrun.pyr	   r	      s    r   r	   c                        \ rS rSrS rS rSrg)_ServiceResource   c                     Xl         X l        g )Nprojectservice_name)selfr   r   s      r   __init___ServiceResource.__init__    s    L$r   c                 N    SR                  U R                  U R                  5      $ )Nznamespaces/{}/services/{})formatr   r   )r   s    r   RelativeName_ServiceResource.RelativeName$   s    &--dllD<M<MNNr   r   N)r   r   r   r   r   r    r   r   r   r   r   r      s    %Or   r   c                     [         R                  " U U[        R                  US9n[        R
                  " U5       nUR                  [        X5      5      sSSS5        $ ! , (       d  f       g= f)z?Check to see if the service with the given name already exists.)release_trackplatformregion_labelN)r   GetConnectionContextr   PLATFORM_MANAGEDr   Connect
GetServicer   )argsr   r   regionr#   contextclients          r   ServiceExistsr.   (   sV    33
!))	' $$W--gDE .--s   A  
A.c                 0   [        U UR                  UR                  UR                  U5      (       ad  [        R
                  " 5       (       a?  [        R                  " SR                  UR                  UR                  5      SS9(       a  g[        S5      eg)zBIf the service already exists, prompt the user before overwriting.z'Serivce {} already exists in project {}zDo you want to overwrite it?)messageprompt_stringNzService already exists.)	r.   r   r   r+   r   	CanPromptPromptContinuer   r	   )r*   settingsr#   s      r   PromptToOverwriteCloudr5   4   s    
oo  *";";9@@!!8#3#3
 5	# 
#$=
>>r   N)r   googlecloudsdk.command_lib.runr   r   r   googlecloudsdk.corer   googlecloudsdk.core.consoler   Errorr	   r   r.   r5   r   r   r   <module>r:      sD    7 > 4 @ * 2
 0 0 
O O	F?r   