python-terminusgps 1.15.3__tar.gz → 1.17.1__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.
Potentially problematic release.
This version of python-terminusgps might be problematic. Click here for more details.
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/PKG-INFO +1 -1
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/pyproject.toml +1 -1
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/wialon/items/__init__.py +1 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/wialon/items/base.py +23 -18
- python_terminusgps-1.17.1/terminusgps/wialon/items/notification.py +4 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/wialon/items/unit_group.py +10 -43
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/wialon/session.py +8 -22
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/wialon/utils.py +48 -26
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/uv.lock +1 -1
- python_terminusgps-1.15.3/terminusgps/wialon/items/notification.py +0 -33
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/.gitignore +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/COPYING +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/README.md +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/__init__.py +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/authorizenet/__init__.py +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/authorizenet/auth.py +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/authorizenet/profiles/__init__.py +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/authorizenet/profiles/addresses.py +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/authorizenet/profiles/base.py +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/authorizenet/profiles/customers.py +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/authorizenet/profiles/payments.py +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/authorizenet/subscriptions.py +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/aws/__init__.py +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/aws/secrets.py +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/aws/ses.py +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/settings.py +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/twilio/__init__.py +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/twilio/caller.py +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/wialon/__init__.py +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/wialon/constants.py +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/wialon/errors.py +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/wialon/flags.py +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/wialon/items/resource.py +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/wialon/items/retranslator.py +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/wialon/items/route.py +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/wialon/items/unit.py +0 -0
- {python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/wialon/items/user.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-terminusgps
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.17.1
|
|
4
4
|
Summary: Provides abstractions/utilities for working with Wialon API, Authorize.NET API, AWS API, and more.
|
|
5
5
|
Project-URL: Documentation, https://app.terminusgps.com/docs/apps/python-terminusgps/index.html
|
|
6
6
|
Project-URL: Repository, https://github.com/terminusgps/python-terminusgps
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "python-terminusgps"
|
|
3
|
-
version = "1.
|
|
3
|
+
version = "1.17.1"
|
|
4
4
|
description = "Provides abstractions/utilities for working with Wialon API, Authorize.NET API, AWS API, and more."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [ {name = "Blake Nall", email = "blake@terminusgps.com" } ]
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from abc import abstractmethod
|
|
2
|
+
from typing import Type
|
|
2
3
|
|
|
3
4
|
from terminusgps.wialon import flags
|
|
4
5
|
from terminusgps.wialon.session import WialonSession
|
|
@@ -24,6 +25,7 @@ class WialonBase:
|
|
|
24
25
|
return str(self.id)
|
|
25
26
|
|
|
26
27
|
def populate(self) -> None:
|
|
28
|
+
"""Retrieves and saves the latest data for the item from Wialon."""
|
|
27
29
|
response = self.session.wialon_api.core_search_item(
|
|
28
30
|
**{"id": str(self.id), "flags": 0x1}
|
|
29
31
|
).get("item", {})
|
|
@@ -53,7 +55,7 @@ class WialonBase:
|
|
|
53
55
|
|
|
54
56
|
return int(self._id) if self._id else None
|
|
55
57
|
|
|
56
|
-
def has_access(self, other: "WialonBase") -> bool:
|
|
58
|
+
def has_access(self, other: Type["WialonBase"]) -> bool:
|
|
57
59
|
"""
|
|
58
60
|
Checks if this Wialon object has access to ``other``.
|
|
59
61
|
|
|
@@ -74,7 +76,7 @@ class WialonBase:
|
|
|
74
76
|
"""
|
|
75
77
|
Renames the Wialon object to the new name.
|
|
76
78
|
|
|
77
|
-
:param new_name: A new name
|
|
79
|
+
:param new_name: A new name.
|
|
78
80
|
:type new_name: :py:obj:`str`
|
|
79
81
|
:returns: Nothing.
|
|
80
82
|
:rtype: :py:obj:`None`
|
|
@@ -215,24 +217,27 @@ class WialonBase:
|
|
|
215
217
|
|
|
216
218
|
self.session.wialon_api.item_delete_item(**{"itemId": self.id})
|
|
217
219
|
|
|
218
|
-
def _get_cfields(self) -> dict:
|
|
219
|
-
response = self.session.wialon_api.core_search_item(
|
|
220
|
-
**{"id": self.id, "flags": flags.DATAFLAG_UNIT_CUSTOM_FIELDS}
|
|
221
|
-
)
|
|
222
|
-
return response["item"]["flds"]
|
|
223
|
-
|
|
224
|
-
def _get_afields(self) -> dict:
|
|
225
|
-
response = self.session.wialon_api.core_search_item(
|
|
226
|
-
**{"id": self.id, "flags": flags.DATAFLAG_UNIT_ADMIN_FIELDS}
|
|
227
|
-
)
|
|
228
|
-
return response["item"]["aflds"]
|
|
229
|
-
|
|
230
220
|
@property
|
|
231
221
|
def cfields(self) -> dict:
|
|
232
|
-
fields
|
|
233
|
-
|
|
222
|
+
"""Custom fields associated with the Wialon object."""
|
|
223
|
+
fields = (
|
|
224
|
+
self.session.wialon_api.core_search_item(
|
|
225
|
+
**{"id": self.id, "flags": flags.DATAFLAG_UNIT_CUSTOM_FIELDS}
|
|
226
|
+
)
|
|
227
|
+
.get("item", {})
|
|
228
|
+
.get("cfields")
|
|
229
|
+
)
|
|
230
|
+
|
|
231
|
+
return {field["n"]: field["v"] for _, field in fields.items()} if fields else {}
|
|
234
232
|
|
|
235
233
|
@property
|
|
236
234
|
def afields(self) -> dict:
|
|
237
|
-
fields
|
|
238
|
-
|
|
235
|
+
"""Admin fields associated with the Wialon object."""
|
|
236
|
+
fields = (
|
|
237
|
+
self.session.wialon_api.core_search_item(
|
|
238
|
+
**{"id": self.id, "flags": flags.DATAFLAG_UNIT_ADMIN_FIELDS}
|
|
239
|
+
)
|
|
240
|
+
.get("item", {})
|
|
241
|
+
.get("afields")
|
|
242
|
+
)
|
|
243
|
+
return {field["n"]: field["v"] for _, field in fields.items()} if fields else {}
|
{python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/wialon/items/unit_group.py
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
from
|
|
1
|
+
from typing import Type
|
|
2
|
+
from terminusgps.wialon import flags
|
|
2
3
|
from terminusgps.wialon.items.base import WialonBase
|
|
3
4
|
|
|
4
5
|
|
|
@@ -31,7 +32,7 @@ class WialonUnitGroup(WialonBase):
|
|
|
31
32
|
)
|
|
32
33
|
return response.get("item", {}).get("id")
|
|
33
34
|
|
|
34
|
-
def
|
|
35
|
+
def set_items(self, new_items: list[str]) -> None:
|
|
35
36
|
"""
|
|
36
37
|
Sets this group's members to a list of Wialon unit ids.
|
|
37
38
|
|
|
@@ -47,7 +48,7 @@ class WialonUnitGroup(WialonBase):
|
|
|
47
48
|
**{"itemId": self.id, "units": new_items}
|
|
48
49
|
)
|
|
49
50
|
|
|
50
|
-
def is_member(self, item: WialonBase) -> bool:
|
|
51
|
+
def is_member(self, item: Type[WialonBase]) -> bool:
|
|
51
52
|
"""
|
|
52
53
|
Determines whether or not ``item`` is a member of the group.
|
|
53
54
|
|
|
@@ -60,43 +61,9 @@ class WialonUnitGroup(WialonBase):
|
|
|
60
61
|
"""
|
|
61
62
|
return True if str(item.id) in self.items else False
|
|
62
63
|
|
|
63
|
-
def
|
|
64
|
-
self, item: WialonBase, access_mask: int = constants.ACCESSMASK_UNIT_BASIC
|
|
65
|
-
) -> None:
|
|
64
|
+
def add_item(self, item: Type[WialonBase]) -> None:
|
|
66
65
|
"""
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
:param item: A Wialon object.
|
|
70
|
-
:type item: :py:obj:`~terminusgps.wialon.items.base.WialonBase`
|
|
71
|
-
:param access_mask: A Wialon access mask.
|
|
72
|
-
:type access_mask: :py:obj:`int`
|
|
73
|
-
:raises WialonError: If something goes wrong with Wialon.
|
|
74
|
-
:returns: Nothing.
|
|
75
|
-
:rtype: :py:obj:`None`
|
|
76
|
-
|
|
77
|
-
"""
|
|
78
|
-
self.session.wialon_api.user_update_item_access(
|
|
79
|
-
**{"userId": item.id, "itemId": self.id, "accessMask": access_mask}
|
|
80
|
-
)
|
|
81
|
-
|
|
82
|
-
def revoke_access(self, item: WialonBase) -> None:
|
|
83
|
-
"""
|
|
84
|
-
Revokes ``item``'s access from the group, if it had access.
|
|
85
|
-
|
|
86
|
-
:param item: A Wialon object.
|
|
87
|
-
:type item: :py:obj:`~terminusgps.wialon.items.base.WialonBase`
|
|
88
|
-
:raises WialonError: If something goes wrong with Wialon.
|
|
89
|
-
:returns: Nothing.
|
|
90
|
-
:rtype: :py:obj:`None`
|
|
91
|
-
|
|
92
|
-
"""
|
|
93
|
-
self.session.wialon_api.user_update_item_access(
|
|
94
|
-
**{"userId": item.id, "itemId": self.id, "accessMask": 0}
|
|
95
|
-
)
|
|
96
|
-
|
|
97
|
-
def add_item(self, item: WialonBase) -> None:
|
|
98
|
-
"""
|
|
99
|
-
Adds a Wialon unit to the group.
|
|
66
|
+
Adds a Wialon item to the group.
|
|
100
67
|
|
|
101
68
|
:param item: A Wialon object.
|
|
102
69
|
:type item: :py:obj:`~terminusgps.wialon.items.base.WialonBase`
|
|
@@ -106,9 +73,9 @@ class WialonUnitGroup(WialonBase):
|
|
|
106
73
|
|
|
107
74
|
"""
|
|
108
75
|
new_items: list[str] = self.items.copy() + [str(item.id)]
|
|
109
|
-
self.
|
|
76
|
+
self.set_items(new_items)
|
|
110
77
|
|
|
111
|
-
def rm_item(self, item: WialonBase) -> None:
|
|
78
|
+
def rm_item(self, item: Type[WialonBase]) -> None:
|
|
112
79
|
"""
|
|
113
80
|
Removes a Wialon unit from the group, if it's a member of the group.
|
|
114
81
|
|
|
@@ -123,7 +90,7 @@ class WialonUnitGroup(WialonBase):
|
|
|
123
90
|
assert self.is_member(item), f"Cannot remove {item}, it's not in the group"
|
|
124
91
|
new_items: list[str] = self.items.copy()
|
|
125
92
|
new_items.remove(str(item.id))
|
|
126
|
-
self.
|
|
93
|
+
self.set_items(new_items)
|
|
127
94
|
|
|
128
95
|
@property
|
|
129
96
|
def items(self) -> list[str]:
|
|
@@ -149,4 +116,4 @@ class WialonUnitGroup(WialonBase):
|
|
|
149
116
|
"to": 0,
|
|
150
117
|
}
|
|
151
118
|
)
|
|
152
|
-
return [
|
|
119
|
+
return [unit_id for unit_id in response.get("items")[0].get("u", [])]
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import threading
|
|
2
2
|
import logging
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
from datetime import datetime
|
|
3
|
+
import typing
|
|
4
|
+
import dataclasses
|
|
5
|
+
import datetime
|
|
7
6
|
|
|
8
7
|
from wialon.api import WialonError
|
|
9
8
|
from wialon.api import Wialon as WialonAPI
|
|
10
9
|
from django.conf import settings
|
|
11
10
|
from django.utils import timezone
|
|
12
11
|
|
|
13
|
-
from .errors import WialonLogoutError, WialonLoginError
|
|
12
|
+
from terminusgps.wialon.errors import WialonLogoutError, WialonLoginError
|
|
14
13
|
|
|
15
14
|
|
|
16
|
-
@dataclass
|
|
15
|
+
@dataclasses.dataclass
|
|
17
16
|
class WialonAPICall:
|
|
18
17
|
action: str
|
|
19
|
-
timestamp: datetime
|
|
18
|
+
timestamp: datetime.datetime
|
|
20
19
|
args: tuple
|
|
21
20
|
kwargs: dict
|
|
22
|
-
result: Any = None
|
|
21
|
+
result: typing.Any = None
|
|
23
22
|
error: Exception | None = None
|
|
24
23
|
|
|
25
24
|
|
|
@@ -45,7 +44,7 @@ class Wialon(WialonAPI):
|
|
|
45
44
|
def failure_rate(self) -> float:
|
|
46
45
|
return len(self.failed_calls) / self.total_calls
|
|
47
46
|
|
|
48
|
-
def call(self, action_name: str, *argc, **kwargs) -> Any:
|
|
47
|
+
def call(self, action_name: str, *argc, **kwargs) -> typing.Any:
|
|
49
48
|
self.logger.info(f"Executing '{action_name}'...")
|
|
50
49
|
self.logger.debug(f"Executing '{action_name}' using: '{kwargs}'")
|
|
51
50
|
call_record = WialonAPICall(
|
|
@@ -368,16 +367,3 @@ class WialonSessionManager:
|
|
|
368
367
|
if not self._session:
|
|
369
368
|
self._session = WialonSession(sid=sid, log_level=log_level)
|
|
370
369
|
return self._session
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
def main() -> None:
|
|
374
|
-
from terminusgps.wialon.items import WialonUnit
|
|
375
|
-
|
|
376
|
-
with WialonSession(log_level=logging.DEBUG) as session:
|
|
377
|
-
unit = WialonUnit(id="28082258", session=session)
|
|
378
|
-
unit.add_cfield(("to_number", "+17133049421"))
|
|
379
|
-
return
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
if __name__ == "__main__":
|
|
383
|
-
main()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import secrets
|
|
2
2
|
import string
|
|
3
3
|
import warnings
|
|
4
|
-
|
|
4
|
+
import typing
|
|
5
5
|
|
|
6
6
|
from terminusgps.wialon import items, flags
|
|
7
7
|
from terminusgps.wialon.items.base import WialonBase
|
|
@@ -67,7 +67,7 @@ def get_id_from_iccid(iccid: str, session: WialonSession) -> str | None:
|
|
|
67
67
|
return response["items"][0].get("id")
|
|
68
68
|
|
|
69
69
|
|
|
70
|
-
def get_wialon_cls(items_type: str) -> Type[WialonBase]:
|
|
70
|
+
def get_wialon_cls(items_type: str) -> typing.Type[WialonBase]:
|
|
71
71
|
"""
|
|
72
72
|
Returns a Wialon object class based on items_type.
|
|
73
73
|
|
|
@@ -91,6 +91,29 @@ def get_wialon_cls(items_type: str) -> Type[WialonBase]:
|
|
|
91
91
|
return wialon_cls
|
|
92
92
|
|
|
93
93
|
|
|
94
|
+
def get_vin_info(vin_number: str, session: WialonSession) -> dict:
|
|
95
|
+
"""
|
|
96
|
+
Retrieves vehicle data from a VIN number.
|
|
97
|
+
|
|
98
|
+
:param value: A vehicle's VIN number.
|
|
99
|
+
:type value: :py:obj:`str`
|
|
100
|
+
:param session: A valid Wialon API session.
|
|
101
|
+
:type session: :py:obj:`~terminusgps.wialon.session.WialonSession`
|
|
102
|
+
:returns: A dictionary of vehicle information, if any was found.
|
|
103
|
+
:rtype: :py:obj:`dict`
|
|
104
|
+
|
|
105
|
+
"""
|
|
106
|
+
response = session.wialon_api.unit_get_vin_info(**{"vin": vin_number}).get(
|
|
107
|
+
"vin_lookup_result"
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
{field.get("n"): field.get("v") for field in response.get("pflds")}
|
|
112
|
+
if "error" not in response.keys()
|
|
113
|
+
else {}
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
|
|
94
117
|
def is_unique(value: str, session: WialonSession, items_type: str = "avl_unit") -> bool:
|
|
95
118
|
"""
|
|
96
119
|
Determines if the value is unique among Wialon objects of type 'items_type'.
|
|
@@ -104,7 +127,6 @@ def is_unique(value: str, session: WialonSession, items_type: str = "avl_unit")
|
|
|
104
127
|
:returns: Whether or not the value is unique among 'items_type'.
|
|
105
128
|
:rtype: :py:obj:`bool`
|
|
106
129
|
|
|
107
|
-
|
|
108
130
|
"""
|
|
109
131
|
result = session.wialon_api.core_check_unique(
|
|
110
132
|
**{"type": items_type, "value": value.strip()}
|
|
@@ -112,29 +134,6 @@ def is_unique(value: str, session: WialonSession, items_type: str = "avl_unit")
|
|
|
112
134
|
return not bool(result)
|
|
113
135
|
|
|
114
136
|
|
|
115
|
-
def gen_wialon_password(length: int = 32) -> str:
|
|
116
|
-
"""
|
|
117
|
-
DEPRECATED: Use :py:func:`~terminusgps.wialon.utils.generate_wialon_password` instead.
|
|
118
|
-
|
|
119
|
-
Generates a Wialon compliant password of random characters.
|
|
120
|
-
|
|
121
|
-
Password length can be between ``8`` and ``64`` characters.
|
|
122
|
-
|
|
123
|
-
:param length: Length of the generated password. Default is ``32``.
|
|
124
|
-
:type length: :py:obj:`int`
|
|
125
|
-
:raises ValueError: If the provided length is invalid.
|
|
126
|
-
:returns: A Wialon compliant password.
|
|
127
|
-
:rtype: :py:obj:`str`
|
|
128
|
-
|
|
129
|
-
"""
|
|
130
|
-
warnings.warn(
|
|
131
|
-
"gen_wialon_password is deprecated and will be removed in a future version. Use generate_wialon_password instead.",
|
|
132
|
-
DeprecationWarning,
|
|
133
|
-
stacklevel=2,
|
|
134
|
-
)
|
|
135
|
-
return generate_wialon_password(length)
|
|
136
|
-
|
|
137
|
-
|
|
138
137
|
def generate_wialon_password(length: int = 32) -> str:
|
|
139
138
|
"""
|
|
140
139
|
Generates a Wialon compliant password of random characters.
|
|
@@ -173,3 +172,26 @@ def generate_wialon_password(length: int = 32) -> str:
|
|
|
173
172
|
):
|
|
174
173
|
break
|
|
175
174
|
return password
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def gen_wialon_password(length: int = 32) -> str:
|
|
178
|
+
"""
|
|
179
|
+
DEPRECATED: Use :py:func:`~terminusgps.wialon.utils.generate_wialon_password` instead.
|
|
180
|
+
|
|
181
|
+
Generates a Wialon compliant password of random characters.
|
|
182
|
+
|
|
183
|
+
Password length can be between ``8`` and ``64`` characters.
|
|
184
|
+
|
|
185
|
+
:param length: Length of the generated password. Default is ``32``.
|
|
186
|
+
:type length: :py:obj:`int`
|
|
187
|
+
:raises ValueError: If the provided length is invalid.
|
|
188
|
+
:returns: A Wialon compliant password.
|
|
189
|
+
:rtype: :py:obj:`str`
|
|
190
|
+
|
|
191
|
+
"""
|
|
192
|
+
warnings.warn(
|
|
193
|
+
"gen_wialon_password is deprecated and will be removed in a future version. Use generate_wialon_password instead.",
|
|
194
|
+
DeprecationWarning,
|
|
195
|
+
stacklevel=2,
|
|
196
|
+
)
|
|
197
|
+
return generate_wialon_password(length)
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
from terminusgps.wialon.items.base import WialonBase
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class WialonNotification(WialonBase):
|
|
5
|
-
def create(
|
|
6
|
-
self,
|
|
7
|
-
resource_id: str | int,
|
|
8
|
-
name: str,
|
|
9
|
-
activation_time: int,
|
|
10
|
-
deactivation_time: int,
|
|
11
|
-
text: str | None = None,
|
|
12
|
-
max_alarms: int = 0,
|
|
13
|
-
interval: int = 0,
|
|
14
|
-
lang: str = "en",
|
|
15
|
-
) -> int | None:
|
|
16
|
-
if isinstance(resource_id, str) and not resource_id.isdigit():
|
|
17
|
-
raise ValueError(f"'resource_id' must be a digit, got '{resource_id}'.")
|
|
18
|
-
|
|
19
|
-
response = self.session.wialon_api.resource_update_notification(
|
|
20
|
-
**{
|
|
21
|
-
"itemId": resource_id,
|
|
22
|
-
"id": 0,
|
|
23
|
-
"callMode": "create",
|
|
24
|
-
"n": name,
|
|
25
|
-
"txt": text if text else name,
|
|
26
|
-
"ta": activation_time,
|
|
27
|
-
"td": deactivation_time,
|
|
28
|
-
"ma": max_alarms,
|
|
29
|
-
"mmtd": interval,
|
|
30
|
-
"la": lang,
|
|
31
|
-
}
|
|
32
|
-
)
|
|
33
|
-
return int(response[0].get("id")) if response else None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/authorizenet/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/authorizenet/profiles/base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/authorizenet/subscriptions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/wialon/items/resource.py
RENAMED
|
File without changes
|
{python_terminusgps-1.15.3 → python_terminusgps-1.17.1}/terminusgps/wialon/items/retranslator.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|