
    tnib                         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dS )    N)Path)Optional)	BaseModelfastapi_clic                   $    e Zd ZU eed<   eed<   dS )	AppConfigapp_idteam_idN)__name__
__module____qualname__str__annotations__     Y/var/www/html/gpu-tools/venv/lib/python3.11/site-packages/fastapi_cloud_cli/utils/apps.pyr   r   
   s"         KKKLLLLLr   r   path_to_deployreturnc                 2   | dz  }t                               d|           |                                st                               d           d S t                               d           t                              |                    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       s     #==K
LL0+>>> 4555t
LL1222(()>)>)>)P)PQ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                    | dz  }| dz  }| dz  }t                               d|           t                               d|           |j                            dd           |                    |                                d	           |                    t          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_textmodel_dump_jsonREADME)r   r!   r   readme_pathgitignore_paths        r   write_app_configr-   *   s     #==K #<<K#&@@N
LL,k:::
LL&
333TD999""$$     6G444c"""
LL899999r   )loggingpathlibr   typingr   pydanticr   	getLoggerr   r   r    r*   r-   r   r   r   <module>r3      s                      		=	)	)    	   
	R4 	RHY,? 	R 	R 	R 	R
:T :y :T : : : : : :r   