squarecloud-api 3.5.0__tar.gz → 3.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. {squarecloud_api-3.5.0 → squarecloud_api-3.6.0}/PKG-INFO +2 -3
  2. {squarecloud_api-3.5.0 → squarecloud_api-3.6.0}/pyproject.toml +4 -16
  3. {squarecloud_api-3.5.0 → squarecloud_api-3.6.0}/squarecloud/__init__.py +7 -2
  4. {squarecloud_api-3.5.0 → squarecloud_api-3.6.0}/squarecloud/app.py +26 -13
  5. {squarecloud_api-3.5.0 → squarecloud_api-3.6.0}/squarecloud/client.py +51 -9
  6. {squarecloud_api-3.5.0 → squarecloud_api-3.6.0}/squarecloud/data.py +39 -8
  7. {squarecloud_api-3.5.0 → squarecloud_api-3.6.0}/squarecloud/http/endpoints.py +84 -45
  8. {squarecloud_api-3.5.0 → squarecloud_api-3.6.0}/squarecloud/http/http_client.py +26 -1
  9. {squarecloud_api-3.5.0 → squarecloud_api-3.6.0}/squarecloud/listeners/__init__.py +1 -1
  10. {squarecloud_api-3.5.0 → squarecloud_api-3.6.0}/squarecloud/listeners/capture_listener.py +2 -2
  11. squarecloud_api-3.5.0/squarecloud/cli/__init__.py +0 -22
  12. squarecloud_api-3.5.0/squarecloud/cli/app.py +0 -442
  13. squarecloud_api-3.5.0/squarecloud/cli/files.py +0 -197
  14. squarecloud_api-3.5.0/squarecloud/cli/main.py +0 -172
  15. {squarecloud_api-3.5.0 → squarecloud_api-3.6.0}/LICENSE +0 -0
  16. {squarecloud_api-3.5.0 → squarecloud_api-3.6.0}/README.md +0 -0
  17. {squarecloud_api-3.5.0 → squarecloud_api-3.6.0}/squarecloud/errors.py +0 -0
  18. {squarecloud_api-3.5.0 → squarecloud_api-3.6.0}/squarecloud/file.py +0 -0
  19. {squarecloud_api-3.5.0 → squarecloud_api-3.6.0}/squarecloud/http/__init__.py +0 -0
  20. {squarecloud_api-3.5.0 → squarecloud_api-3.6.0}/squarecloud/listeners/request_listener.py +0 -0
  21. {squarecloud_api-3.5.0 → squarecloud_api-3.6.0}/squarecloud/logging.py +0 -0
  22. {squarecloud_api-3.5.0 → squarecloud_api-3.6.0}/squarecloud/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: squarecloud-api
3
- Version: 3.5.0
3
+ Version: 3.6.0
4
4
  Summary: SquareCloud API wrapper
5
5
  Home-page: https://github.com/squarecloudofc/wrapper-api-py
6
6
  License: MIT
@@ -13,10 +13,9 @@ Classifier: Programming Language :: Python :: 3.9
13
13
  Classifier: Programming Language :: Python :: 3.10
14
14
  Classifier: Programming Language :: Python :: 3.11
15
15
  Classifier: Programming Language :: Python :: 3.12
16
- Requires-Dist: aiohttp (==3.9.3)
16
+ Requires-Dist: aiohttp (==3.9.5)
17
17
  Requires-Dist: click (>=8.1.6,<9.0.0)
18
18
  Requires-Dist: pydantic (>=2.5.2,<3.0.0)
19
- Requires-Dist: pypi (>=2.1,<3.0)
20
19
  Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
21
20
  Requires-Dist: rich (>=13.5.2,<14.0.0)
22
21
  Project-URL: Documentation, https://docs.squarecloud.app/sdks/py
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = 'squarecloud-api'
3
- version = '3.5.0'
3
+ version = '3.6.0'
4
4
  description = 'SquareCloud API wrapper'
5
5
  authors = ['Robert Nogueira <robertlucasnogueira@gmail.com>']
6
6
  repository = 'https://github.com/squarecloudofc/wrapper-api-py'
@@ -11,31 +11,24 @@ packages = [{ include = 'squarecloud' }]
11
11
 
12
12
  [tool.poetry.dependencies]
13
13
  python = '^3.9'
14
- aiohttp = '3.9.3'
14
+ aiohttp = "3.9.5"
15
15
  click = '^8.1.6'
16
16
  rich = '^13.5.2'
17
17
  pydantic = '^2.5.2'
18
18
  python-dotenv = '^1.0.0'
19
- pypi = "^2.1"
20
19
 
21
20
  [tool.poetry.group.dev.dependencies]
22
21
  pytest = '^7.4.3'
23
22
  pytest-cov = '^4.1.0'
24
23
  blue = '^0.9.1'
25
24
  isort = '^5.12.0'
26
- taskipy = '^1.12.0'
27
25
  pytest-asyncio = '^0.21.1'
28
26
  pre-commit = '^3.3.3'
29
27
  ruff = '^0.0.289'
30
28
  memory-profiler = '^0.61.0'
31
29
  requests = '^2.31.0'
32
30
  pytest-rerunfailures = "^13.0"
33
-
34
-
35
- [[tool.poetry.source]]
36
- name = 'pypi-test'
37
- url = 'https://test.pypi.org/simple/'
38
- priority = 'primary'
31
+ taskipy = "^1.13.0"
39
32
 
40
33
  [build-system]
41
34
  requires = ['poetry-core']
@@ -60,17 +53,12 @@ line_length = 79
60
53
  [tool.taskipy.tasks]
61
54
  lint = 'isort . && blue . && ruff .'
62
55
  pre_test = 'task lint'
63
- test = 'pytest -vv -s --reruns 5 --only-rerun TooManyRequests --reruns-delay 60 -x --cov=tests tests'
56
+ test = 'pytest -vv -s --reruns 5 --only-rerun TooManyRequests --reruns-delay 90 -x --cov=tests tests'
64
57
  post_test = 'coverage html'
65
- cli = 'python -m squarecloud.cli.main'
66
58
  publish-test = 'poetry publish -r pypi-test --build'
67
59
  install-test = 'pip install -i https://test.pypi.org/pypi/ --extra-index-url https://pypi.org/simple --upgrade squarecloud-api'
68
- docs = 'mkdocs serve'
69
60
  clear-test-apps = 'python -m scripts.clear_test_apps'
70
61
 
71
- [tool.poetry.scripts]
72
- squarecloud = 'squarecloud.cli.main:safe_entry_point'
73
-
74
62
  [tool.ruff]
75
63
  line-length = 79
76
64
  exclude = ['env']
@@ -5,15 +5,20 @@ from .app import Application
5
5
  from .client import Client
6
6
  from .data import (
7
7
  AppData,
8
- BackupData,
8
+ Backup,
9
+ BackupInfo,
10
+ DeployData,
11
+ DomainAnalytics,
9
12
  FileInfo,
10
13
  LogsData,
11
14
  PlanData,
12
15
  StatusData,
13
16
  UploadData,
14
17
  UserData,
18
+ ResumedStatus,
19
+ DNSRecord,
15
20
  )
16
21
  from .file import File
17
22
  from .http.endpoints import Endpoint
18
23
 
19
- __version__ = '3.5.0'
24
+ __version__ = '3.6.0'
@@ -10,8 +10,10 @@ from squarecloud import errors
10
10
 
11
11
  from .data import (
12
12
  AppData,
13
- BackupData,
13
+ Backup,
14
+ BackupInfo,
14
15
  DeployData,
16
+ DNSRecord,
15
17
  DomainAnalytics,
16
18
  FileInfo,
17
19
  LogsData,
@@ -46,7 +48,7 @@ class AppCache:
46
48
  """
47
49
  self._status: StatusData | None = None
48
50
  self._logs: LogsData | None = None
49
- self._backup: BackupData | None = None
51
+ self._backup: Backup | None = None
50
52
  self._app_data: AppData | None = None
51
53
 
52
54
  @property
@@ -72,13 +74,13 @@ class AppCache:
72
74
  return self._logs
73
75
 
74
76
  @property
75
- def backup(self) -> BackupData:
77
+ def backup(self) -> Backup:
76
78
  """
77
- The backup method is a property that returns the cached BackupData of
79
+ The backup method is a property that returns the cached Backup of
78
80
  the application.
79
81
 
80
82
  :return: The value of the _backup attribute
81
- :rtype: BackupData
83
+ :rtype: Backup
82
84
  """
83
85
  return self._backup
84
86
 
@@ -111,7 +113,7 @@ class AppCache:
111
113
  The update method is used to update the data of a given instance.
112
114
  It takes in an arbitrary number of arguments, and updates the
113
115
  corresponding data if it is one of the following types:
114
- StatusData, LogsData, BackupData or AppData.
116
+ StatusData, LogsData, Backup or AppData.
115
117
  If any other type is provided as an argument to this function,
116
118
  a SquareException will be raised.
117
119
 
@@ -123,7 +125,7 @@ class AppCache:
123
125
  self._status = arg
124
126
  elif isinstance(arg, LogsData):
125
127
  self._logs = arg
126
- elif isinstance(arg, BackupData):
128
+ elif isinstance(arg, Backup):
127
129
  self._backup = arg
128
130
  elif isinstance(arg, AppData):
129
131
  self._app_data = arg
@@ -133,7 +135,7 @@ class AppCache:
133
135
  for i in [
134
136
  StatusData,
135
137
  LogsData,
136
- BackupData,
138
+ Backup,
137
139
  AppData,
138
140
  ]
139
141
  ]
@@ -223,7 +225,7 @@ class Application(CaptureListenerManager):
223
225
  :return: The class name, tag and id of the element
224
226
  :rtype: str
225
227
  """
226
- return f'<{self.__class__.__name__} tag={self.tag} id={self.id}>'
228
+ return f'<{self.__class__.__name__} tag={self.name} id={self.id}>'
227
229
 
228
230
  @property
229
231
  def client(self) -> 'Client':
@@ -463,15 +465,15 @@ class Application(CaptureListenerManager):
463
465
 
464
466
  @_update_cache
465
467
  @_notify_listener(Endpoint.backup())
466
- async def backup(self, *_args, **__kwargs) -> BackupData:
468
+ async def backup(self, *_args, **__kwargs) -> Backup:
467
469
  """
468
470
  The backup function is used to create a backup of the application.
469
471
 
470
472
  :param self: Refer to the class instance
471
- :return: A BackupData object
472
- :rtype: BackupData
473
+ :return: A Backup object
474
+ :rtype: Backup
473
475
  """
474
- backup: BackupData = await self.client.backup(self.id)
476
+ backup: Backup = await self.client.backup(self.id)
475
477
  return backup
476
478
 
477
479
  async def start(self) -> Response:
@@ -647,3 +649,14 @@ class Application(CaptureListenerManager):
647
649
  self.id, custom_domain, avoid_listener=True
648
650
  )
649
651
  return response
652
+
653
+ async def all_backups(self):
654
+ backups: list[BackupInfo] = await self.client.all_app_backups(self.id)
655
+ return backups
656
+
657
+ async def move_file(self, origin: str, dest: str):
658
+ return await self.client.move_app_file(self.id, origin, dest)
659
+
660
+ @_notify_listener(Endpoint.dns_records())
661
+ async def dns_records(self) -> list[DNSRecord]:
662
+ return await self.client.dns_records(self.id)
@@ -3,18 +3,21 @@ from __future__ import annotations
3
3
 
4
4
  from functools import wraps
5
5
  from io import BytesIO
6
- from typing import Any, Callable, Literal, TextIO
6
+ from typing import Any, Callable, Literal, ParamSpec, TextIO, TypeVar
7
7
 
8
8
  from typing_extensions import deprecated
9
9
 
10
10
  from .app import Application
11
11
  from .data import (
12
12
  AppData,
13
- BackupData,
13
+ Backup,
14
+ BackupInfo,
14
15
  DeployData,
16
+ DNSRecord,
15
17
  DomainAnalytics,
16
18
  FileInfo,
17
19
  LogsData,
20
+ ResumedStatus,
18
21
  StatusData,
19
22
  UploadData,
20
23
  UserData,
@@ -27,6 +30,9 @@ from .listeners import Listener, ListenerConfig
27
30
  from .listeners.request_listener import RequestListenerManager
28
31
  from .logging import logger
29
32
 
33
+ P = ParamSpec('P')
34
+ R = TypeVar('R')
35
+
30
36
 
31
37
  @deprecated(
32
38
  'create_config_file is deprecated, '
@@ -180,10 +186,12 @@ class Client(RequestListenerManager):
180
186
  :return: a callable
181
187
  """
182
188
 
183
- def wrapper(func: Callable):
189
+ def wrapper(func: Callable[P, R]) -> Callable[P, R]:
184
190
  @wraps(func)
185
- async def decorator(self: Client, *args, **kwargs) -> Response:
186
- result: Any
191
+ async def decorator(
192
+ self: Client, *args: P.args, **kwargs: P.kwargs
193
+ ) -> R:
194
+ # result: Any
187
195
  response: Response
188
196
  result = await func(self, *args, **kwargs)
189
197
  response = self._http.last_response
@@ -324,14 +332,14 @@ class Client(RequestListenerManager):
324
332
  return await self._http.restart_application(app_id)
325
333
 
326
334
  @_notify_listener(Endpoint.backup())
327
- async def backup(self, app_id: str, **_kwargs) -> BackupData:
335
+ async def backup(self, app_id: str, **_kwargs) -> Backup:
328
336
  """
329
337
  The backup method is used to backup an application.
330
338
 
331
339
  :param app_id: Specify the application id
332
340
  :param _kwargs: Keyword arguments
333
- :return: A BackupData object
334
- :rtype: BackupData
341
+ :return: A Backup object
342
+ :rtype: Backup
335
343
 
336
344
  :raises NotFoundError: Raised when the request status code is 404
337
345
  :raises BadRequestError: Raised when the request status code is 400
@@ -342,7 +350,9 @@ class Client(RequestListenerManager):
342
350
  """
343
351
  response: Response = await self._http.backup(app_id)
344
352
  payload: dict[str, Any] = response.response
345
- return BackupData(**payload)
353
+ return Backup(**payload)
354
+
355
+ # async def app_backups(self) -> list[BackupInfo]:
346
356
 
347
357
  @_notify_listener(Endpoint.delete_app())
348
358
  async def delete_app(self, app_id: str, **_kwargs) -> Response:
@@ -730,3 +740,35 @@ class Client(RequestListenerManager):
730
740
  app_id=app_id,
731
741
  )
732
742
  return DomainAnalytics(**response.response)
743
+
744
+ @_notify_listener(Endpoint.all_backups())
745
+ async def all_app_backups(
746
+ self, app_id: str, **_kwargs
747
+ ) -> list[BackupInfo]:
748
+ response: Response = await self._http.get_all_app_backups(
749
+ app_id=app_id
750
+ )
751
+ return [BackupInfo(**backup_data) for backup_data in response.response]
752
+
753
+ @_notify_listener(Endpoint.all_apps_status())
754
+ async def all_apps_status(self, **_kwargs) -> list[ResumedStatus]:
755
+ response: Response = await self._http.all_apps_status()
756
+ all_status = []
757
+ for status in response.response:
758
+ if status['running'] is True:
759
+ all_status.append(ResumedStatus(**status))
760
+ return all_status
761
+
762
+ @_notify_listener(Endpoint.move_file())
763
+ async def move_app_file(
764
+ self, app_id: str, origin: str, dest: str, **_kwargs
765
+ ) -> Response:
766
+ response: Response = await self._http.move_app_file(
767
+ app_id=app_id, origin=origin, dest=dest
768
+ )
769
+ return response
770
+
771
+ @_notify_listener(Endpoint.dns_records())
772
+ async def dns_records(self, app_id: str) -> list[DNSRecord]:
773
+ response: Response = await self._http.dns_records(app_id)
774
+ return [DNSRecord(**data) for data in response.response]
@@ -6,9 +6,6 @@ from typing import Any, Dict, Literal, Optional
6
6
  from pydantic import confloat, conint
7
7
  from pydantic.dataclasses import dataclass
8
8
 
9
- # pylint: disable=too-many-instance-attributes
10
- # pylint: disable=invalid-name
11
-
12
9
 
13
10
  @dataclass(frozen=True)
14
11
  class PlanData:
@@ -78,6 +75,14 @@ class StatusData:
78
75
  return self.__dict__.copy()
79
76
 
80
77
 
78
+ @dataclass(frozen=True)
79
+ class ResumedStatus:
80
+ id: str
81
+ running: bool
82
+ cpu: str
83
+ ram: str
84
+
85
+
81
86
  @dataclass(frozen=True)
82
87
  class AppData:
83
88
  """
@@ -197,16 +202,27 @@ class LogsData:
197
202
 
198
203
 
199
204
  @dataclass(frozen=True)
200
- class BackupData:
205
+ class BackupInfo:
206
+ name: str
207
+ size: int
208
+ modified: datetime
209
+ key: str
210
+
211
+
212
+ @dataclass(frozen=True)
213
+ class Backup:
201
214
  """
202
215
  Backup data class
203
216
 
204
- :ivar downloadURL: Url for download your backup
217
+ :ivar url: Url for download your backup
218
+ :ivar key: The backup's key
205
219
 
206
- :type downloadURL: str
220
+ :type url: str
221
+ :type key: str
207
222
  """
208
223
 
209
- downloadURL: str
224
+ url: str
225
+ key: str
210
226
 
211
227
  def to_dict(self):
212
228
  return self.__dict__.copy()
@@ -285,10 +301,17 @@ class DeployData:
285
301
  return self.__dict__.copy()
286
302
 
287
303
 
304
+ @dataclass(frozen=True)
305
+ class AnalyticsTotal:
306
+ visits: int
307
+ megabytes: float
308
+ bytes: int
309
+
310
+
288
311
  @dataclass(frozen=True)
289
312
  class DomainAnalytics:
290
313
  hostname: str
291
- total: list[Any]
314
+ total: list[AnalyticsTotal]
292
315
  countries: list[Any]
293
316
  methods: list[Any]
294
317
  referers: list[Any]
@@ -301,3 +324,11 @@ class DomainAnalytics:
301
324
 
302
325
  def to_dict(self):
303
326
  return self.__dict__.copy()
327
+
328
+
329
+ @dataclass(frozen=True)
330
+ class DNSRecord:
331
+ type: str
332
+ name: str
333
+ value: str
334
+ status: str
@@ -2,20 +2,22 @@ from __future__ import annotations
2
2
 
3
3
 
4
4
  class Endpoint:
5
- """Endpoint"""
5
+ """Class representing an API endpoint."""
6
6
 
7
7
  ENDPOINTS_V2 = {
8
- 'USER': {'METHOD': 'GET', 'PATH': '/user'},
8
+ 'USER': {'METHOD': 'GET', 'PATH': '/users/me'},
9
9
  'APP_DATA': {'METHOD': 'GET', 'PATH': '/apps/{app_id}'},
10
10
  'APP_STATUS': {'METHOD': 'GET', 'PATH': '/apps/{app_id}/status'},
11
+ 'ALL_APPS_STATUS': {'METHOD': 'GET', 'PATH': '/apps/status'},
12
+ 'ALL_BACKUPS': {'METHOD': 'GET', 'PATH': '/apps/{app_id}/backups'},
11
13
  'LOGS': {'METHOD': 'GET', 'PATH': '/apps/{app_id}/logs'},
12
14
  'START': {'METHOD': 'POST', 'PATH': '/apps/{app_id}/start'},
13
15
  'STOP': {'METHOD': 'POST', 'PATH': '/apps/{app_id}/stop'},
14
16
  'RESTART': {'METHOD': 'POST', 'PATH': '/apps/{app_id}/restart'},
15
- 'BACKUP': {'METHOD': 'GET', 'PATH': '/apps/{app_id}/backup'},
17
+ 'BACKUP': {'METHOD': 'POST', 'PATH': '/apps/{app_id}/backups'},
16
18
  'COMMIT': {'METHOD': 'POST', 'PATH': '/apps/{app_id}/commit'},
17
- 'DELETE_APP': {'METHOD': 'DELETE', 'PATH': '/apps/{app_id}/delete'},
18
- 'UPLOAD_APP': {'METHOD': 'POST', 'PATH': '/apps/upload'},
19
+ 'DELETE_APP': {'METHOD': 'DELETE', 'PATH': '/apps/{app_id}'},
20
+ 'UPLOAD_APP': {'METHOD': 'POST', 'PATH': '/apps'},
19
21
  'FILES_LIST': {
20
22
  'METHOD': 'GET',
21
23
  'PATH': '/apps/{app_id}/files/list?path={path}',
@@ -25,43 +27,43 @@ class Endpoint:
25
27
  'PATH': '/apps/{app_id}/files/read?path={path}',
26
28
  },
27
29
  'FILES_CREATE': {
28
- 'METHOD': 'POST',
29
- 'PATH': '/apps/{app_id}/files/create',
30
+ 'METHOD': 'PUT',
31
+ 'PATH': '/apps/{app_id}/files',
30
32
  },
31
33
  'FILES_DELETE': {
32
34
  'METHOD': 'DELETE',
33
35
  'PATH': '/apps/{app_id}/files/delete?path={path}',
34
36
  },
37
+ 'MOVE_FILE': {'METHOD': 'PATCH', 'PATH': '/apps/{app_id}/files'},
35
38
  'LAST_DEPLOYS': {
36
39
  'METHOD': 'GET',
37
- 'PATH': '/apps/{app_id}/deploy/list',
40
+ 'PATH': '/apps/{app_id}/deployments',
41
+ },
42
+ 'CURRENT_WEBHOOK': {
43
+ 'METHOD': 'GET',
44
+ 'PATH': '/apps/{app_id}/deployments/current',
38
45
  },
39
46
  'GITHUB_INTEGRATION': {
40
47
  'METHOD': 'POST',
41
- 'PATH': '/apps/{app_id}/deploy/git-webhook',
48
+ 'PATH': '/apps/{app_id}/deploy/webhook',
42
49
  },
43
50
  'CUSTOM_DOMAIN': {
44
51
  'METHOD': 'POST',
45
- 'PATH': '/apps/{app_id}/network/custom/{custom_domain}',
52
+ 'PATH': '/apps/{app_id}/network/custom',
46
53
  },
47
54
  'DOMAIN_ANALYTICS': {
48
55
  'METHOD': 'GET',
49
56
  'PATH': '/apps/{app_id}/network/analytics',
50
57
  },
58
+ 'DNSRECORDS': {'METHOD': 'GET', 'PATH': '/apps/{app_id}/network/dns'},
51
59
  }
52
60
 
53
61
  def __init__(self, name: str) -> None:
54
62
  """
55
- The __init__ function is called when the class is instantiated.
56
- It sets up the instance of the class, and defines its attributes.
57
- The __init__ function takes in a name parameter, which it uses to look
58
- up an endpoint from ENDPOINTS_V2.
59
- ENDPOINTS_V2 is a dictionary that contains all of our endpoints for
60
- version 2 of our API.
63
+ Initialize an Endpoint instance with the given name.
61
64
 
62
- :param self: Represent the instance of the class
63
- :param name: str: Set the name of the endpoint
64
- :return: None
65
+ :param name: The name of the endpoint.
66
+ :raises ValueError: If the endpoint name is invalid.
65
67
  """
66
68
  if not (endpoint := self.ENDPOINTS_V2.get(name)):
67
69
  raise ValueError(f"Invalid endpoint: '{name}'")
@@ -69,38 +71,36 @@ class Endpoint:
69
71
  self.method: str = endpoint['METHOD']
70
72
  self.path: str = endpoint['PATH']
71
73
 
72
- def __eq__(self, other: Endpoint):
74
+ def __eq__(self, other: object) -> bool:
73
75
  """
74
- The __eq__ function is used to compare two objects of the same class.
75
- It returns True if they are equal, and False otherwise.
76
+ Compare two Endpoint instances for equality.
76
77
 
77
- :param self: Refer to the current instance of the class
78
- :param other: Endpoint: Check if the other object is an instance of
79
- endpoint
80
- :return: A boolean value
78
+ :param other: The other Endpoint instance to compare.
79
+ :return: True if both instances have the same name, otherwise False.
81
80
  """
82
81
  return isinstance(other, Endpoint) and self.name == other.name
83
82
 
84
- def __repr__(self):
83
+ def __repr__(self) -> str:
85
84
  """
86
- The __repr__ function is used to compute the &quot;official&quot;
87
- string representation of an object.
88
- This is how you would make an object of the class. The goal of
85
+ Return the official string representation of the Endpoint instance.
89
86
 
90
- :param self: Represent the instance of the class
91
- :return: A string that is the representation of an object
87
+ :return: A string representation of the Endpoint instance.
92
88
  """
93
89
  return f"{Endpoint.__name__}('{self.name}')"
94
90
 
95
91
  @classmethod
96
92
  def user(cls) -> Endpoint:
97
- """Returns an Endpoint object that represents the /user endpoint."""
93
+ """
94
+ Returns an Endpoint object that represents the
95
+ /user endpoint.
96
+ """
98
97
  return cls('USER')
99
98
 
100
99
  @classmethod
101
100
  def app_data(cls) -> Endpoint:
102
101
  """
103
- Returns an Endpoint object that represents the /apps/{app_id} endpoint.
102
+ Returns an Endpoint object that represents the
103
+ /apps/{app_id} endpoint.
104
104
  """
105
105
  return cls('APP_DATA')
106
106
 
@@ -148,7 +148,7 @@ class Endpoint:
148
148
  def backup(cls) -> Endpoint:
149
149
  """
150
150
  Returns an Endpoint object that represents the
151
- /apps/{app_id}/backup endpoint.
151
+ /apps/{app_id}/backups endpoint.
152
152
  """
153
153
  return cls('BACKUP')
154
154
 
@@ -164,7 +164,7 @@ class Endpoint:
164
164
  def delete_app(cls) -> Endpoint:
165
165
  """
166
166
  Returns an Endpoint object that represents the
167
- /apps/{app_id}/delete endpoint.
167
+ /apps/{app_id} endpoint.
168
168
  """
169
169
  return cls('DELETE_APP')
170
170
 
@@ -172,7 +172,7 @@ class Endpoint:
172
172
  def upload(cls) -> Endpoint:
173
173
  """
174
174
  Returns an Endpoint object that represents the
175
- /apps/upload endpoint.
175
+ /apps endpoint.
176
176
  """
177
177
  return cls('UPLOAD_APP')
178
178
 
@@ -209,24 +209,23 @@ class Endpoint:
209
209
  return cls('FILES_DELETE')
210
210
 
211
211
  @classmethod
212
- def last_deploys(cls):
212
+ def last_deploys(cls) -> Endpoint:
213
213
  """
214
214
  Returns an Endpoint object that represents the
215
- /apps/{app_id}/deploy/list endpoint.
215
+ /apps/{app_id}/deployments endpoint.
216
216
  """
217
-
218
217
  return cls('LAST_DEPLOYS')
219
218
 
220
219
  @classmethod
221
- def github_integration(cls):
220
+ def github_integration(cls) -> Endpoint:
222
221
  """
223
222
  Returns an Endpoint object that represents the
224
- /apps/{app_id}/deploy/git-webhook endpoint.
223
+ /apps/{app_id}/deploy/webhook endpoint.
225
224
  """
226
225
  return cls('GITHUB_INTEGRATION')
227
226
 
228
227
  @classmethod
229
- def domain_analytics(cls):
228
+ def domain_analytics(cls) -> Endpoint:
230
229
  """
231
230
  Returns an Endpoint object that represents the
232
231
  /apps/{app_id}/network/analytics endpoint.
@@ -234,13 +233,53 @@ class Endpoint:
234
233
  return cls('DOMAIN_ANALYTICS')
235
234
 
236
235
  @classmethod
237
- def custom_domain(cls):
236
+ def custom_domain(cls) -> Endpoint:
238
237
  """
239
238
  Returns an Endpoint object that represents the
240
- /apps/{app_id}/network/custom/{custom_domain} endpoint.
239
+ /apps/{app_id}/network/custom endpoint.
241
240
  """
242
241
  return cls('CUSTOM_DOMAIN')
243
242
 
243
+ @classmethod
244
+ def all_backups(cls) -> Endpoint:
245
+ """
246
+ Returns an Endpoint object that represents the
247
+ /apps/{app_id}/backups endpoint.
248
+ """
249
+ return cls('ALL_BACKUPS')
250
+
251
+ @classmethod
252
+ def all_apps_status(cls) -> Endpoint:
253
+ """
254
+ Returns an Endpoint object that represents the
255
+ /apps/status endpoint.
256
+ """
257
+ return cls('ALL_APPS_STATUS')
258
+
259
+ @classmethod
260
+ def current_webhook(cls) -> Endpoint:
261
+ """
262
+ Returns an Endpoint object that represents the
263
+ /apps/{app_id}/deployments/current endpoint.
264
+ """
265
+ return cls('CURRENT_WEBHOOK')
266
+
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
+
244
283
 
245
284
  # pylint: disable=too-few-public-methods
246
285
  class Router: