From 14402cf302cf761e9118001980c9a8e55c60bf4f Mon Sep 17 00:00:00 2001 From: Jhonatan-Jeferson Date: Tue, 10 Jun 2025 16:38:49 -0300 Subject: [PATCH] Fixing some examples --- examples/backup/with_application.py | 2 +- examples/backup/with_client.py | 2 +- examples/capture_listener.py | 2 +- examples/deployments/create_integration/with_application.py | 2 +- examples/deployments/create_integration/with_client.py | 2 +- examples/deployments/current_integration/with_application.py | 2 +- examples/deployments/current_integration/with_client.py | 2 +- examples/deployments/deploy_list/with_application.py | 2 +- examples/deployments/deploy_list/with_client.py | 2 +- examples/domain_analytics/with_application.py | 2 +- examples/domain_analytics/with_client.py | 2 +- examples/file_list/with_application.py | 2 +- examples/file_list/with_client.py | 2 +- examples/get_app_list.py | 2 +- examples/getting_application_status/with_application.py | 3 +-- examples/getting_application_status/with_client.py | 3 +-- examples/getting_logs/with_application.py | 2 +- examples/getting_logs/with_client.py | 2 +- examples/moving_files/with_application.py | 2 +- examples/moving_files/with_client.py | 2 +- examples/obtaining_app.py | 2 +- examples/read_file/with_application.py | 2 +- examples/read_file/with_client.py | 2 +- examples/request_listener.py | 4 ++-- examples/restarting_app/with_application.py | 2 +- examples/restarting_app/with_client.py | 2 +- examples/starting_app/with_application.py | 2 +- examples/starting_app/with_client.py | 2 +- examples/stopping_app/with_application.py | 2 +- examples/stopping_app/with_client.py | 2 +- examples/upload_app/with_client.py | 2 +- 31 files changed, 32 insertions(+), 34 deletions(-) diff --git a/examples/backup/with_application.py b/examples/backup/with_application.py index 080b92f..3b51966 100644 --- a/examples/backup/with_application.py +++ b/examples/backup/with_application.py @@ -8,7 +8,7 @@ async def example() -> None: app = await client.app('application_id') backup = await app.backup() - print(backup.downloadURL) # https://squarecloud.app/dashboard/backup/f.zip + print(backup.url) # https://squarecloud.app/dashboard/backup/f.zip asyncio.run(example()) diff --git a/examples/backup/with_client.py b/examples/backup/with_client.py index cfe8afc..a59e1a3 100644 --- a/examples/backup/with_client.py +++ b/examples/backup/with_client.py @@ -7,7 +7,7 @@ async def example() -> None: backup = await client.backup('application_id') - print(backup.downloadURL) # https://squarecloud.app/dashboard/backup/f.zip + print(backup.url) # https://squarecloud.app/dashboard/backup/f.zip asyncio.run(example()) diff --git a/examples/capture_listener.py b/examples/capture_listener.py index 6f6050c..e058226 100644 --- a/examples/capture_listener.py +++ b/examples/capture_listener.py @@ -3,7 +3,7 @@ import squarecloud as square from squarecloud import Endpoint -client = square.Client('API_KEY', debug=False) +client = square.Client('API_KEY') async def example() -> None: diff --git a/examples/deployments/create_integration/with_application.py b/examples/deployments/create_integration/with_application.py index 75adb14..2d702b6 100644 --- a/examples/deployments/create_integration/with_application.py +++ b/examples/deployments/create_integration/with_application.py @@ -11,4 +11,4 @@ async def example() -> None: print(webhook_url) -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/deployments/create_integration/with_client.py b/examples/deployments/create_integration/with_client.py index 2f1c0f4..1bc6f0a 100644 --- a/examples/deployments/create_integration/with_client.py +++ b/examples/deployments/create_integration/with_client.py @@ -12,4 +12,4 @@ async def example() -> None: print(webhook_url) -asyncio.run(example) +asyncio.run(example()) \ No newline at end of file diff --git a/examples/deployments/current_integration/with_application.py b/examples/deployments/current_integration/with_application.py index 150599f..a6caf7a 100644 --- a/examples/deployments/current_integration/with_application.py +++ b/examples/deployments/current_integration/with_application.py @@ -11,4 +11,4 @@ async def example() -> None: print(webhook_url) -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/deployments/current_integration/with_client.py b/examples/deployments/current_integration/with_client.py index 77ed1c2..ec9bdb3 100644 --- a/examples/deployments/current_integration/with_client.py +++ b/examples/deployments/current_integration/with_client.py @@ -12,4 +12,4 @@ async def example() -> None: print(webhook_url) -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/deployments/deploy_list/with_application.py b/examples/deployments/deploy_list/with_application.py index 86a17e4..04f7829 100644 --- a/examples/deployments/deploy_list/with_application.py +++ b/examples/deployments/deploy_list/with_application.py @@ -11,4 +11,4 @@ async def example() -> None: print(deploys) # [[DeployData(...), DeployData(...), DeployData(...)]] -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/deployments/deploy_list/with_client.py b/examples/deployments/deploy_list/with_client.py index b573afb..81e97a9 100644 --- a/examples/deployments/deploy_list/with_client.py +++ b/examples/deployments/deploy_list/with_client.py @@ -10,4 +10,4 @@ async def example() -> None: print(deploys) # [[DeployData(...), DeployData(...), DeployData(...)]] -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/domain_analytics/with_application.py b/examples/domain_analytics/with_application.py index cc34658..dc1bdce 100644 --- a/examples/domain_analytics/with_application.py +++ b/examples/domain_analytics/with_application.py @@ -11,4 +11,4 @@ async def example() -> None: print(analytics) # DomainAnalytics(...) -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/domain_analytics/with_client.py b/examples/domain_analytics/with_client.py index 8157177..fc90e27 100644 --- a/examples/domain_analytics/with_client.py +++ b/examples/domain_analytics/with_client.py @@ -10,4 +10,4 @@ async def example() -> None: print(analytics) # DomainAnalytics(...) -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/file_list/with_application.py b/examples/file_list/with_application.py index e6b5abd..e9fbffa 100644 --- a/examples/file_list/with_application.py +++ b/examples/file_list/with_application.py @@ -19,4 +19,4 @@ async def example() -> None: print(file.lastModified) # 1677112835000 -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/file_list/with_client.py b/examples/file_list/with_client.py index f8e4c48..a094e1f 100644 --- a/examples/file_list/with_client.py +++ b/examples/file_list/with_client.py @@ -18,4 +18,4 @@ async def example() -> None: print(file.lastModified) # 1677112835000 -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/get_app_list.py b/examples/get_app_list.py index 3ea2163..803449a 100644 --- a/examples/get_app_list.py +++ b/examples/get_app_list.py @@ -10,4 +10,4 @@ async def example() -> None: print(apps) # list[] -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/getting_application_status/with_application.py b/examples/getting_application_status/with_application.py index c8005fc..bbf2913 100644 --- a/examples/getting_application_status/with_application.py +++ b/examples/getting_application_status/with_application.py @@ -11,10 +11,9 @@ async def example() -> None: print(status.ram) # '70MB' print(status.cpu) # '5%' - print(status.requests) # 0 print(status.network) # {'total': '0 KB ↑ 0 KB ↓', 'now': '0 KB ↑ 0 KB ↓'} print(status.running) # True | False print(status.storage) # '0MB' -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/getting_application_status/with_client.py b/examples/getting_application_status/with_client.py index 0bef265..9c3abdd 100644 --- a/examples/getting_application_status/with_client.py +++ b/examples/getting_application_status/with_client.py @@ -10,10 +10,9 @@ async def example() -> None: print(status.ram) # '70MB' print(status.cpu) # '5%' - print(status.requests) # 0 print(status.network) # {'total': '0 KB ↑ 0 KB ↓', 'now': '0 KB ↑ 0 KB ↓'} print(status.running) # True | False print(status.storage) # '0MB' -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/getting_logs/with_application.py b/examples/getting_logs/with_application.py index 5503ef9..cdcb47b 100644 --- a/examples/getting_logs/with_application.py +++ b/examples/getting_logs/with_application.py @@ -13,4 +13,4 @@ async def example() -> None: print(logs.logs) # 'Hello World' -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/getting_logs/with_client.py b/examples/getting_logs/with_client.py index de94ead..7c7145b 100644 --- a/examples/getting_logs/with_client.py +++ b/examples/getting_logs/with_client.py @@ -12,4 +12,4 @@ async def example() -> None: print(logs.logs) # 'Hello World' -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/moving_files/with_application.py b/examples/moving_files/with_application.py index d09aa93..400a2a8 100644 --- a/examples/moving_files/with_application.py +++ b/examples/moving_files/with_application.py @@ -12,4 +12,4 @@ async def example() -> None: ) -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/moving_files/with_client.py b/examples/moving_files/with_client.py index a188508..4eaf402 100644 --- a/examples/moving_files/with_client.py +++ b/examples/moving_files/with_client.py @@ -13,4 +13,4 @@ async def example() -> None: ) -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/obtaining_app.py b/examples/obtaining_app.py index ea9489f..05da4ca 100644 --- a/examples/obtaining_app.py +++ b/examples/obtaining_app.py @@ -10,4 +10,4 @@ async def example() -> None: print(app) # -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/read_file/with_application.py b/examples/read_file/with_application.py index 884afa4..dcff726 100644 --- a/examples/read_file/with_application.py +++ b/examples/read_file/with_application.py @@ -12,4 +12,4 @@ async def example() -> None: print(file_bytes) # b'01101000 01101001' -asyncio.run(example) +asyncio.run(example()) \ No newline at end of file diff --git a/examples/read_file/with_client.py b/examples/read_file/with_client.py index 765e1ba..2413c95 100644 --- a/examples/read_file/with_client.py +++ b/examples/read_file/with_client.py @@ -13,4 +13,4 @@ async def example() -> None: print(file_bytes) # b'01101000 01101001' -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/request_listener.py b/examples/request_listener.py index 845d268..e50e30b 100644 --- a/examples/request_listener.py +++ b/examples/request_listener.py @@ -3,7 +3,7 @@ import squarecloud as square from squarecloud import Endpoint -client = square.Client('API_KEY', debug=False) +client = square.Client('API_KEY') @client.on_request(endpoint=Endpoint.logs()) @@ -22,4 +22,4 @@ async def example() -> None: await client.user(avoid_listener=True) # the listener is not called -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/restarting_app/with_application.py b/examples/restarting_app/with_application.py index 90ba6c9..939bda9 100644 --- a/examples/restarting_app/with_application.py +++ b/examples/restarting_app/with_application.py @@ -10,4 +10,4 @@ async def example() -> None: await app.restart() -asyncio.run(example) +asyncio.run(example()) \ No newline at end of file diff --git a/examples/restarting_app/with_client.py b/examples/restarting_app/with_client.py index 1bd79bb..b3b38a9 100644 --- a/examples/restarting_app/with_client.py +++ b/examples/restarting_app/with_client.py @@ -9,4 +9,4 @@ async def example() -> None: await client.restart_app('application_id') -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/starting_app/with_application.py b/examples/starting_app/with_application.py index 6402a5d..49082e8 100644 --- a/examples/starting_app/with_application.py +++ b/examples/starting_app/with_application.py @@ -10,4 +10,4 @@ async def example() -> None: await app.start() -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/starting_app/with_client.py b/examples/starting_app/with_client.py index 5a12604..a32c028 100644 --- a/examples/starting_app/with_client.py +++ b/examples/starting_app/with_client.py @@ -9,4 +9,4 @@ async def example() -> None: await client.start_app('application_id') -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/stopping_app/with_application.py b/examples/stopping_app/with_application.py index d7fe420..e2bedd6 100644 --- a/examples/stopping_app/with_application.py +++ b/examples/stopping_app/with_application.py @@ -10,4 +10,4 @@ async def example() -> None: await app.stop() -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/stopping_app/with_client.py b/examples/stopping_app/with_client.py index e3d3bb7..57050ba 100644 --- a/examples/stopping_app/with_client.py +++ b/examples/stopping_app/with_client.py @@ -9,4 +9,4 @@ async def example() -> None: await client.stop_app('application_id') -asyncio.run(example) +asyncio.run(example()) diff --git a/examples/upload_app/with_client.py b/examples/upload_app/with_client.py index 7ec2141..704ebac 100644 --- a/examples/upload_app/with_client.py +++ b/examples/upload_app/with_client.py @@ -10,4 +10,4 @@ async def example() -> None: await client.upload_app(file=file) -asyncio.run(example) +asyncio.run(example())