
    ohb                         d dl Z d dlmZ d dlmZ d dlmZ  e j                  d      Z G d de      Z	ded	ee	   fd
Z
dZdede	d	dfdZy)    N)Path)Optional)	BaseModelfastapi_clic                   "    e Zd ZU eed<   eed<   y)	AppConfigapp_idteam_idN)__name__
__module____qualname__str__annotations__     n/var/www/pru.catia.catastroantioquia-mas.com/tasa/lib/python3.12/site-packages/fastapi_cloud_cli/utils/apps.pyr   r   
   s    KLr   r   path_to_deployreturnc                     | dz  }t         j                  d|       |j                         st         j                  d       y t         j                  d       t        j	                  |j                  d            S )N.fastapicloud/cloud.jsonzLooking for app config at: %szApp config file doesn't existzApp config loaded successfullyutf-8encoding)loggerdebugexistsr   model_validate_json	read_text)r   config_paths     r   get_app_configr       sd     #==K
LL0+>45
LL12(()>)>)>)PQQr   u&  
> Why do I have a folder named ".fastapicloud" in my project? 🤔
The ".fastapicloud" folder is created when you link a directory to a FastAPI Cloud project.

> What does the "cloud.json" file contain?
The "cloud.json" file contains:
- The ID of the FastAPI app that you linked ("app_id")
- The ID of the team your FastAPI Cloud project is owned by ("team_id")

> Should I commit the ".fastapicloud" folder?
No, you should not commit the ".fastapicloud" folder to your version control system.
That's why there's a ".gitignore" file in this folder.

app_configc                 p   | dz  }| dz  }| dz  }t         j                  d|       t         j                  d|       |j                  j                  dd       |j	                  |j                         d	       |j	                  t        d	       |j	                  d
       t         j                  d       y )Nr   z.fastapicloud/README.mdz.fastapicloud/.gitignorezWriting app config to: %szApp config data: %sT)parentsexist_okr   r   *z%App config files written successfully)r   r   parentmkdir
write_textmodel_dump_jsonREADME)r   r!   r   readme_pathgitignore_paths        r   write_app_configr-   *   s     #==K #<<K#&@@N
LL,k:
LL&
3TD9""$   6G4c"
LL89r   )loggingpathlibr   typingr   pydanticr   	getLoggerr   r   r    r*   r-   r   r   r   <module>r3      sk       			=	)	 
	R4 	RHY,? 	R
:T :y :T :r   