o
    #1 i                     @   s   d dl Z d dlmZ d dlmZ d dlmZ d dlmZm	Z	 e 
dZG dd deZd	ed
ee fddZdZd	eded
dfddZdS )    N)Path)Optional)	BaseModel)model_dump_jsonmodel_validate_jsonZfastapi_clic                   @   s   e Zd ZU eed< eed< dS )	AppConfigZapp_idZteam_idN)__name__
__module____qualname__str__annotations__ r   r   h/home/app/PaddleOCR-VL-test/.venv_paddleocr/lib/python3.10/site-packages/fastapi_cloud_cli/utils/apps.pyr      s   
 r   path_to_deployreturnc                 C   sF   | d }t d| | st d d S t d tt|jd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   r   	read_text)r   config_pathr   r   r   get_app_config   s   

r   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                 C   sx   | d }| d }| d }t d| t d| |jjddd |jt|dd	 |jtdd	 |d
 t d d S )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_textr   README)r   r   r   Zreadme_pathZgitignore_pathr   r   r   write_app_config,   s   
r#   )loggingpathlibr   typingr   Zpydanticr   Z'fastapi_cloud_cli.utils.pydantic_compatr   r   	getLoggerr   r   r   r"   r#   r   r   r   r   <module>   s    
