Skip to content

Commit d37ba32

Browse files
🔧 chore(endpoints): add new endpoints for DNS records and file moving
- Introduced MOVE_FILE and DNSRECORDS endpoints. - Updated FILES_CREATE endpoint method from POST to PUT.
1 parent 31d0c02 commit d37ba32

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

squarecloud/http/endpoints.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@ class Endpoint:
2727
'PATH': '/apps/{app_id}/files/read?path={path}',
2828
},
2929
'FILES_CREATE': {
30-
'METHOD': 'POST',
31-
'PATH': '/apps/{app_id}/files/create',
30+
'METHOD': 'PUT',
31+
'PATH': '/apps/{app_id}/files',
3232
},
3333
'FILES_DELETE': {
3434
'METHOD': 'DELETE',
3535
'PATH': '/apps/{app_id}/files/delete?path={path}',
3636
},
37+
'MOVE_FILE': {'METHOD': 'PATCH', 'PATH': '/apps/{app_id}/files'},
3738
'LAST_DEPLOYS': {
3839
'METHOD': 'GET',
3940
'PATH': '/apps/{app_id}/deployments',
@@ -54,6 +55,7 @@ class Endpoint:
5455
'METHOD': 'GET',
5556
'PATH': '/apps/{app_id}/network/analytics',
5657
},
58+
'DNSRECORDS': {'METHOD': 'GET', 'PATH': '/apps/{app_id}/network/dns'},
5759
}
5860

5961
def __init__(self, name: str) -> None:
@@ -262,6 +264,22 @@ def current_webhook(cls) -> Endpoint:
262264
"""
263265
return cls('CURRENT_WEBHOOK')
264266

267+
@classmethod
268+
def move_file(cls) -> Endpoint:
269+
"""
270+
Returns an Endpoint object that represents the
271+
/apps/{app_id}/files
272+
"""
273+
return cls('MOVE_FILE')
274+
275+
@classmethod
276+
def dns_records(cls) -> Endpoint:
277+
"""
278+
Returns an Endpoint object that represents the
279+
/apps/{app_id}/network/dns
280+
"""
281+
return cls('DNSRECORDS')
282+
265283

266284
# pylint: disable=too-few-public-methods
267285
class Router:

0 commit comments

Comments
 (0)