docs: replace list[dict] with list type hint and add missing type hints

This commit is contained in:
lucasheld 2022-12-29 01:09:44 +01:00
parent 10a22c8bc2
commit 9e3cbe7d59
2 changed files with 16 additions and 16 deletions

View file

@ -185,7 +185,7 @@ def _build_maintenance_data(
intervalDay: int = 1, intervalDay: int = 1,
weekdays: list[int] = None, weekdays: list[int] = None,
daysOfMonth: list[Union[int, str]] = None, daysOfMonth: list[Union[int, str]] = None,
timeRange: list[dict] = None timeRange: list = None
) -> dict: ) -> dict:
if not dateRange: if not dateRange:
dateRange = [ dateRange = [
@ -1078,8 +1078,8 @@ class UptimeKumaApi(object):
""" """
Delete a tag from a monitor. Delete a tag from a monitor.
:param id tag_id: Id of the tag to remove. :param int tag_id: Id of the tag to remove.
:param id monitor_id: Id of monitor to remove the tag from. :param int monitor_id: Id of monitor to remove the tag from.
:param str, optional value: Value of the tag., defaults to "" :param str, optional value: Value of the tag., defaults to ""
:return: The server response. :return: The server response.
:rtype: dict :rtype: dict
@ -2711,7 +2711,7 @@ class UptimeKumaApi(object):
""" """
Get a maintenance. Get a maintenance.
:param id_: Id of the maintenance to get. :param int id_: Id of the maintenance to get.
:return: The maintenance. :return: The maintenance.
:rtype: dict :rtype: dict
:raises UptimeKumaException: If the server returns an error. :raises UptimeKumaException: If the server returns an error.
@ -2937,7 +2937,7 @@ class UptimeKumaApi(object):
""" """
Edits a maintenance. Edits a maintenance.
:param id_: Id of the maintenance to edit. :param int id_: Id of the maintenance to edit.
:return: The server response. :return: The server response.
:rtype: dict :rtype: dict
:raises UptimeKumaException: If the server returns an error. :raises UptimeKumaException: If the server returns an error.
@ -2982,7 +2982,7 @@ class UptimeKumaApi(object):
""" """
Deletes a maintenance. Deletes a maintenance.
:param id_: Id of the maintenance to delete. :param int id_: Id of the maintenance to delete.
:return: The server response. :return: The server response.
:rtype: dict :rtype: dict
:raises UptimeKumaException: If the server returns an error. :raises UptimeKumaException: If the server returns an error.
@ -3000,7 +3000,7 @@ class UptimeKumaApi(object):
""" """
Pauses a maintenance. Pauses a maintenance.
:param id_: Id of the maintenance to pause. :param int id_: Id of the maintenance to pause.
:return: The server response. :return: The server response.
:rtype: dict :rtype: dict
:raises UptimeKumaException: If the server returns an error. :raises UptimeKumaException: If the server returns an error.
@ -3018,7 +3018,7 @@ class UptimeKumaApi(object):
""" """
Resumes a maintenance. Resumes a maintenance.
:param id_: Id of the maintenance to resume. :param int id_: Id of the maintenance to resume.
:return: The server response. :return: The server response.
:rtype: dict :rtype: dict
:raises UptimeKumaException: If the server returns an error. :raises UptimeKumaException: If the server returns an error.
@ -3036,7 +3036,7 @@ class UptimeKumaApi(object):
""" """
Gets all monitors of a maintenance. Gets all monitors of a maintenance.
:param id_: Id of the maintenance to get the monitors from. :param int id_: Id of the maintenance to get the monitors from.
:return: All monitors of the maintenance. :return: All monitors of the maintenance.
:rtype: dict :rtype: dict
:raises UptimeKumaException: If the server returns an error. :raises UptimeKumaException: If the server returns an error.
@ -3060,13 +3060,13 @@ class UptimeKumaApi(object):
def add_monitor_maintenance( def add_monitor_maintenance(
self, self,
id_: int, id_: int,
monitors: list[dict], monitors: list,
) -> dict: ) -> dict:
""" """
Adds monitors to a maintenance. Adds monitors to a maintenance.
:param id_: Id of the maintenance to add the monitors to. :param int id_: Id of the maintenance to add the monitors to.
:param monitors: The list of monitors to add to the maintenance. :param list monitors: The list of monitors to add to the maintenance.
:return: The server response. :return: The server response.
:rtype: dict :rtype: dict
:raises UptimeKumaException: If the server returns an error. :raises UptimeKumaException: If the server returns an error.
@ -3094,7 +3094,7 @@ class UptimeKumaApi(object):
""" """
Gets all status pages of a maintenance. Gets all status pages of a maintenance.
:param id_: Id of the maintenance to get the status pages from. :param int id_: Id of the maintenance to get the status pages from.
:return: All status pages of the maintenance. :return: All status pages of the maintenance.
:rtype: dict :rtype: dict
:raises UptimeKumaException: If the server returns an error. :raises UptimeKumaException: If the server returns an error.
@ -3119,8 +3119,8 @@ class UptimeKumaApi(object):
""" """
Adds status pages to a maintenance. Adds status pages to a maintenance.
:param id_: Id of the maintenance to add the monitors to. :param int id_: Id of the maintenance to add the monitors to.
:param status_pages: The list of status pages to add to the maintenance. :param list status_pages: The list of status pages to add to the maintenance.
:return: The server response. :return: The server response.
:rtype: dict :rtype: dict
:raises UptimeKumaException: If the server returns an error. :raises UptimeKumaException: If the server returns an error.

View file

@ -246,5 +246,5 @@ def maintenance_docstring(mode) -> str:
:param int, optional intervalDay: Interval (Run once every day), defaults to ``1`` :param int, optional intervalDay: Interval (Run once every day), defaults to ``1``
:param list[int], optional weekdays: List that contains the days of the week on which the maintenance is enabled (Sun = ``0``, Mon = ``1``, ..., Sat = ``6``). Required for ``strategy`` :attr:`~.MaintenanceStrategy.RECURRING_WEEKDAY`., defaults to ``[]``. :param list[int], optional weekdays: List that contains the days of the week on which the maintenance is enabled (Sun = ``0``, Mon = ``1``, ..., Sat = ``6``). Required for ``strategy`` :attr:`~.MaintenanceStrategy.RECURRING_WEEKDAY`., defaults to ``[]``.
:param list[Union[int, str]], optional daysOfMonth: List that contains the days of the month on which the maintenance is enabled (Day 1 = ``1``, Day 2 = ``2``, ..., Day 31 = ``31``) and the last day of the month (Last Day of Month = ``"lastDay1"``, 2nd Last Day of Month = ``"lastDay2"``, 3rd Last Day of Month = ``"lastDay3"``, 4th Last Day of Month = ``"lastDay4"``). Required for ``strategy`` :attr:`~.MaintenanceStrategy.RECURRING_DAY_OF_MONTH`., defaults to ``[]``. :param list[Union[int, str]], optional daysOfMonth: List that contains the days of the month on which the maintenance is enabled (Day 1 = ``1``, Day 2 = ``2``, ..., Day 31 = ``31``) and the last day of the month (Last Day of Month = ``"lastDay1"``, 2nd Last Day of Month = ``"lastDay2"``, 3rd Last Day of Month = ``"lastDay3"``, 4th Last Day of Month = ``"lastDay4"``). Required for ``strategy`` :attr:`~.MaintenanceStrategy.RECURRING_DAY_OF_MONTH`., defaults to ``[]``.
:param list[dict], optional timeRange: Maintenance Time Window of a Day, defaults to ``[{{"hours": 2, "minutes": 0}}, {{"hours": 3, "minutes": 0}}]``. :param list, optional timeRange: Maintenance Time Window of a Day, defaults to ``[{{"hours": 2, "minutes": 0}}, {{"hours": 3, "minutes": 0}}]``.
""" """