Skip to content

Commit 1a9aba5

Browse files
added "delete_file" method to square.Application
1 parent d59daaf commit 1a9aba5

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

squarecloud/app.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,19 @@ async def read_file(self, path: str, **kwargs):
303303
response=response)
304304
return response
305305

306-
async def create_file(self, path: str, **kwargs):
307-
response: None = await self.client.read_app_file(self.id, path)
306+
async def create_file(self, file: File, path: str, **kwargs):
307+
response: Response = await self.client.create_app_file(self.id, file,
308+
path)
308309
if not kwargs.get('avoid_listener'):
309310
endpoint: Endpoint = Endpoint.files_read()
310311
await self._listener.on_capture(endpoint=endpoint,
311312
response=response)
312313
return response
314+
315+
async def delete_file(self, path: str, **kwargs):
316+
response: Response = await self.client.delete_app_file(self.id, path)
317+
if not kwargs.get('avoid_listener'):
318+
endpoint: Endpoint = Endpoint.files_delete()
319+
await self._listener.on_capture(endpoint=endpoint,
320+
response=response)
321+
return response

0 commit comments

Comments
 (0)