python-terminusgps 20.4.1__tar.gz → 20.5.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.
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/PKG-INFO +1 -1
- python_terminusgps-20.5.0/docs/source/authorizenet/auth.rst +33 -0
- python_terminusgps-20.5.0/docs/source/authorizenet/index.rst +11 -0
- python_terminusgps-20.5.0/docs/source/authorizenet/profiles.rst +2 -0
- python_terminusgps-20.5.0/docs/source/aws/index.rst +10 -0
- python_terminusgps-20.5.0/docs/source/aws/secrets.rst +17 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/docs/source/conf.py +9 -1
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/docs/source/index.rst +3 -5
- python_terminusgps-20.5.0/docs/source/twilio/caller.rst +47 -0
- python_terminusgps-20.5.0/docs/source/twilio/index.rst +10 -0
- python_terminusgps-20.5.0/docs/source/wialon/constants.rst +19 -0
- python_terminusgps-20.5.0/docs/source/wialon/errors.rst +8 -0
- python_terminusgps-20.5.0/docs/source/wialon/flags.rst +188 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/docs/source/wialon/index.rst +3 -6
- python_terminusgps-20.5.0/docs/source/wialon/items.rst +537 -0
- python_terminusgps-20.5.0/docs/source/wialon/session.rst +155 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/pyproject.toml +1 -1
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/uv.lock +1 -1
- python_terminusgps-20.4.1/docs/source/authorizenet/index.rst +0 -0
- python_terminusgps-20.4.1/docs/source/aws/index.rst +0 -0
- python_terminusgps-20.4.1/docs/source/twilio/index.rst +0 -0
- python_terminusgps-20.4.1/docs/source/wialon/constants.rst +0 -6
- python_terminusgps-20.4.1/docs/source/wialon/flags.rst +0 -6
- python_terminusgps-20.4.1/docs/source/wialon/glossary.rst +0 -2
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/.gitignore +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/COPYING +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/README.md +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/docs/Makefile +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/docs/make.bat +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/docs/source/wialon/utils.rst +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/__init__.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/authorizenet/__init__.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/authorizenet/auth.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/authorizenet/profiles/__init__.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/authorizenet/profiles/addresses.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/authorizenet/profiles/base.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/authorizenet/profiles/customers.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/authorizenet/profiles/payments.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/authorizenet/subscriptions.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/aws/__init__.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/aws/secrets.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/aws/ses.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/settings.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/twilio/__init__.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/twilio/caller.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/wialon/__init__.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/wialon/constants.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/wialon/flags.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/wialon/items/__init__.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/wialon/items/base.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/wialon/items/geofence.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/wialon/items/notification.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/wialon/items/resource.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/wialon/items/retranslator.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/wialon/items/route.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/wialon/items/unit.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/wialon/items/unit_group.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/wialon/items/user.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/wialon/logger.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/wialon/session.py +0 -0
- {python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/wialon/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-terminusgps
|
|
3
|
-
Version: 20.
|
|
3
|
+
Version: 20.5.0
|
|
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
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Authorizenet API Authentication
|
|
2
|
+
===============================
|
|
3
|
+
|
|
4
|
+
To authorize with the Authorizenet API, use these utility functions to provide data to each API call.
|
|
5
|
+
|
|
6
|
+
.. currentmodule:: terminusgps.authorizenet.auth
|
|
7
|
+
|
|
8
|
+
.. py:function:: get_merchant_auth() -> merchantAuthenticationType
|
|
9
|
+
|
|
10
|
+
Generates and returns a :py:obj:`~authorizenet.apicontractsv1.merchantAuthenticationType` object.
|
|
11
|
+
|
|
12
|
+
This object is generated using :confval:`MERCHANT_AUTH_LOGIN_ID` and :confval:`MERCHANT_AUTH_TRANSACTION_KEY`.
|
|
13
|
+
|
|
14
|
+
:returns: A merchant authentication object.
|
|
15
|
+
:rtype: :py:obj:`~authorizenet.apicontractsv1.merchantAuthenticationType`
|
|
16
|
+
|
|
17
|
+
.. py:function:: get_environment() -> str
|
|
18
|
+
|
|
19
|
+
Gets the current application environment for Authorizenet API calls.
|
|
20
|
+
|
|
21
|
+
This string is generated using :confval:`DEBUG`.
|
|
22
|
+
|
|
23
|
+
:returns: The current Authorizenet API environment.
|
|
24
|
+
:rtype: :py:obj:`str`
|
|
25
|
+
|
|
26
|
+
.. py:function:: get_validation_mode() -> str
|
|
27
|
+
|
|
28
|
+
Gets the current application validation mode for Authorizenet API calls.
|
|
29
|
+
|
|
30
|
+
This string is generated using :confval:`DEBUG`.
|
|
31
|
+
|
|
32
|
+
:returns: The current Authorizenet API validation mode.
|
|
33
|
+
:rtype: :py:obj:`str`
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Authorizenet API
|
|
2
|
+
================
|
|
3
|
+
|
|
4
|
+
:py:mod:`terminusgps` offers the :py:mod:`authorizenet` package; a Python library that makes it simple to operate within the Authorizenet API.
|
|
5
|
+
|
|
6
|
+
.. toctree::
|
|
7
|
+
:maxdepth: 2
|
|
8
|
+
:caption: Contents:
|
|
9
|
+
|
|
10
|
+
auth.rst
|
|
11
|
+
profiles.rst
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Secrets
|
|
2
|
+
=======
|
|
3
|
+
|
|
4
|
+
.. currentmodule:: terminusgps.aws.secrets
|
|
5
|
+
|
|
6
|
+
.. py:function:: get_secret(name, [region="us-east-1"]) -> dict[str, str]
|
|
7
|
+
|
|
8
|
+
Logs into the default AWS CLI session and returns a secret value by name.
|
|
9
|
+
|
|
10
|
+
:param name: An AWS `secretsmanager`_ secret name.
|
|
11
|
+
:type name: :py:obj:`str`
|
|
12
|
+
:param region: An AWS region name. Default is ``"us-east-1"``.
|
|
13
|
+
:type region: :py:obj:`str`
|
|
14
|
+
:returns: The secret as a dictionary.
|
|
15
|
+
:rtype: :py:obj:`dict`
|
|
16
|
+
|
|
17
|
+
.. _secretsmanager: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/secretsmanager.html
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
project = "python-terminusgps"
|
|
10
10
|
copyright = "2025, Terminus GPS, LLC"
|
|
11
11
|
author = "Terminus GPS, LLC"
|
|
12
|
-
release = "20.
|
|
12
|
+
release = "20.5.0"
|
|
13
13
|
|
|
14
14
|
# -- General configuration ---------------------------------------------------
|
|
15
15
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
|
@@ -21,6 +21,14 @@ extensions = [
|
|
|
21
21
|
"sphinx.ext.viewcode",
|
|
22
22
|
]
|
|
23
23
|
|
|
24
|
+
intersphinx_mapping = {
|
|
25
|
+
"python": ("https://docs.python.org/3", None),
|
|
26
|
+
"django": (
|
|
27
|
+
"http://docs.djangoproject.com/en/stable/",
|
|
28
|
+
"http://docs.djangoproject.com/en/stable/_objects/",
|
|
29
|
+
),
|
|
30
|
+
}
|
|
31
|
+
|
|
24
32
|
templates_path = ["_templates"]
|
|
25
33
|
exclude_patterns = []
|
|
26
34
|
|
|
@@ -6,13 +6,11 @@
|
|
|
6
6
|
python-terminusgps documentation
|
|
7
7
|
================================
|
|
8
8
|
|
|
9
|
-
Add your content using ``reStructuredText`` syntax. See the
|
|
10
|
-
`reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
|
|
11
|
-
documentation for details.
|
|
12
|
-
|
|
13
|
-
|
|
14
9
|
.. toctree::
|
|
15
10
|
:maxdepth: 2
|
|
16
11
|
:caption: Contents:
|
|
17
12
|
|
|
13
|
+
authorizenet/index.rst
|
|
14
|
+
aws/index.rst
|
|
15
|
+
twilio/index.rst
|
|
18
16
|
wialon/index.rst
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
Caller object
|
|
2
|
+
=============
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
.. currentmodule:: terminusgps.twilio.caller
|
|
6
|
+
|
|
7
|
+
.. py:class:: TwilioCaller
|
|
8
|
+
|
|
9
|
+
An asyncronous phone messager/caller.
|
|
10
|
+
|
|
11
|
+
.. py:method:: create_notification(to_number, message, [method="sms"]) -> asyncio.Task
|
|
12
|
+
|
|
13
|
+
Creates a task that must be awaited in an asyncronous event loop in order to be executed.
|
|
14
|
+
|
|
15
|
+
:meta async:
|
|
16
|
+
:param to_number: A phone number, starting with a '+' and country code.
|
|
17
|
+
:type to_number: :py:obj:`str`
|
|
18
|
+
:param message: A message to send to `to_number`.
|
|
19
|
+
:type message: :py:obj:`str`
|
|
20
|
+
:param method: Notification method to use. Default is ``"sms"``.
|
|
21
|
+
:type method: :py:obj:`str`
|
|
22
|
+
:returns: An awaitable notification task.
|
|
23
|
+
:rtype: :py:obj:`asyncio.Task`
|
|
24
|
+
|
|
25
|
+
.. py:method:: create_call(to_number, message) -> None
|
|
26
|
+
|
|
27
|
+
Creates a phone call task.
|
|
28
|
+
|
|
29
|
+
:meta async:
|
|
30
|
+
:param to_number: A phone number, starting with a '+' and country code.
|
|
31
|
+
:type to_number: :py:obj:`str`
|
|
32
|
+
:param message: A message to send to `to_number`.
|
|
33
|
+
:type message: :py:obj:`str`
|
|
34
|
+
:returns: Nothing.
|
|
35
|
+
:rtype: :py:obj:`None`
|
|
36
|
+
|
|
37
|
+
.. py:method:: create_sms(to_number, message) -> None
|
|
38
|
+
|
|
39
|
+
Creates an sms message task.
|
|
40
|
+
|
|
41
|
+
:meta async:
|
|
42
|
+
:param to_number: A phone number, starting with a '+' and country code.
|
|
43
|
+
:type to_number: :py:obj:`str`
|
|
44
|
+
:param message: A message to send to `to_number`.
|
|
45
|
+
:type message: :py:obj:`str`
|
|
46
|
+
:returns: Nothing.
|
|
47
|
+
:rtype: :py:obj:`None`
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Constants
|
|
2
|
+
=========
|
|
3
|
+
|
|
4
|
+
.. currentmodule:: terminusgps.wialon.constants
|
|
5
|
+
|
|
6
|
+
.. py:data:: ACCESSMASK_RESOURCE_BASIC
|
|
7
|
+
|
|
8
|
+
:type: :py:obj:`int`
|
|
9
|
+
:value: ``17604054880353``
|
|
10
|
+
|
|
11
|
+
.. py:data:: ACCESSMASK_UNIT_BASIC
|
|
12
|
+
|
|
13
|
+
:type: :py:obj:`int`
|
|
14
|
+
:value: ``3540009843``
|
|
15
|
+
|
|
16
|
+
.. py:data:: ACCESSMASK_UNIT_MIGRATION
|
|
17
|
+
|
|
18
|
+
:type: :py:obj:`int`
|
|
19
|
+
:value: ``9437197``
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
Flags
|
|
2
|
+
=====
|
|
3
|
+
|
|
4
|
+
.. currentmodule:: terminusgps.wialon.flags
|
|
5
|
+
|
|
6
|
+
============
|
|
7
|
+
Access Flags
|
|
8
|
+
============
|
|
9
|
+
|
|
10
|
+
-------
|
|
11
|
+
General
|
|
12
|
+
-------
|
|
13
|
+
|
|
14
|
+
`Wialon API Reference <https://sdk.wialon.com/wiki/en/sidebar/remoteapi/apiref/core/check_items_billing#general>`_
|
|
15
|
+
|
|
16
|
+
.. py:data:: ACCESSFLAG_VIEW_ITEM_BASIC
|
|
17
|
+
.. py:data:: ACCESSFLAG_VIEW_ITEM_DETAILED
|
|
18
|
+
.. py:data:: ACCESSFLAG_MANAGE_ITEM_ACCESS
|
|
19
|
+
.. py:data:: ACCESSFLAG_DELETE_ITEM
|
|
20
|
+
.. py:data:: ACCESSFLAG_RENAME_ITEM
|
|
21
|
+
.. py:data:: ACCESSFLAG_VIEW_CUSTOM_FIELDS
|
|
22
|
+
.. py:data:: ACCESSFLAG_MANAGE_CUSTOM_FIELDS
|
|
23
|
+
.. py:data:: ACCESSFLAG_MANAGE_UNMENTIONED_FIELDS
|
|
24
|
+
.. py:data:: ACCESSFLAG_MANAGE_ICON
|
|
25
|
+
.. py:data:: ACCESSFLAG_QUERY_REPORTS
|
|
26
|
+
.. py:data:: ACCESSFLAG_MANAGE_ACL
|
|
27
|
+
.. py:data:: ACCESSFLAG_MANAGE_ITEM_LOG
|
|
28
|
+
.. py:data:: ACCESSFLAG_VIEW_ADMIN_FIELDS
|
|
29
|
+
.. py:data:: ACCESSFLAG_MANAGE_ADMIN_FIELDS
|
|
30
|
+
.. py:data:: ACCESSFLAG_VIEW_ATTACHED_FILES
|
|
31
|
+
.. py:data:: ACCESSFLAG_MANAGE_ATTACHED_FILES
|
|
32
|
+
|
|
33
|
+
---------------
|
|
34
|
+
Unit/Unit Group
|
|
35
|
+
---------------
|
|
36
|
+
|
|
37
|
+
`Wialon API Reference <https://sdk.wialon.com/wiki/en/sidebar/remoteapi/apiref/core/check_items_billing#units_and_unit_groups>`_
|
|
38
|
+
|
|
39
|
+
.. py:data:: ACCESSFLAG_UNIT_MANAGE_CONNECTIVITY
|
|
40
|
+
.. py:data:: ACCESSFLAG_UNIT_MANAGE_SENSORS
|
|
41
|
+
.. py:data:: ACCESSFLAG_UNIT_MANAGE_COUNTERS
|
|
42
|
+
.. py:data:: ACCESSFLAG_UNIT_DELETE_MESSAGES
|
|
43
|
+
.. py:data:: ACCESSFLAG_UNIT_EXECUTE_COMMANDS
|
|
44
|
+
.. py:data:: ACCESSFLAG_UNIT_REGISTER_EVENTS
|
|
45
|
+
.. py:data:: ACCESSFLAG_UNIT_VIEW_CONNECTIVITY
|
|
46
|
+
.. py:data:: ACCESSFLAG_UNIT_VIEW_SERVICE_INTERVALS
|
|
47
|
+
.. py:data:: ACCESSFLAG_UNIT_MANAGE_SERVICE_INTERVALS
|
|
48
|
+
.. py:data:: ACCESSFLAG_UNIT_IMPORT_MESSAGES
|
|
49
|
+
.. py:data:: ACCESSFLAG_UNIT_EXPORT_MESSAGES
|
|
50
|
+
.. py:data:: ACCESSFLAG_UNIT_VIEW_COMMANDS
|
|
51
|
+
.. py:data:: ACCESSFLAG_UNIT_MANAGE_COMMANDS
|
|
52
|
+
.. py:data:: ACCESSFLAG_UNIT_MANAGE_TRIP_DETECTOR
|
|
53
|
+
.. py:data:: ACCESSFLAG_UNIT_MANAGE_ASSIGNMENTS
|
|
54
|
+
|
|
55
|
+
----
|
|
56
|
+
User
|
|
57
|
+
----
|
|
58
|
+
|
|
59
|
+
`Wialon API Reference <https://sdk.wialon.com/wiki/en/sidebar/remoteapi/apiref/core/check_items_billing#users>`_
|
|
60
|
+
|
|
61
|
+
.. py:data:: ACCESSFLAG_USER_MANAGE_ACCESS_RIGHTS
|
|
62
|
+
.. py:data:: ACCESSFLAG_USER_ACT_AS_OTHER
|
|
63
|
+
.. py:data:: ACCESSFLAG_USER_MANAGE_FLAGS
|
|
64
|
+
.. py:data:: ACCESSFLAG_USER_VIEW_PUSH_MESSAGES
|
|
65
|
+
.. py:data:: ACCESSFLAG_USER_MANAGE_PUSH_MESSAGES
|
|
66
|
+
|
|
67
|
+
------------
|
|
68
|
+
Retranslator
|
|
69
|
+
------------
|
|
70
|
+
|
|
71
|
+
`Wialon API Reference <https://sdk.wialon.com/wiki/en/sidebar/remoteapi/apiref/core/check_items_billing#retranslators>`_
|
|
72
|
+
|
|
73
|
+
.. py:data:: ACCESSFLAG_RETRANSLATOR_MANAGE_PROPERTIES
|
|
74
|
+
.. py:data:: ACCESSFLAG_RETRANSLATOR_MANAGE_UNITS
|
|
75
|
+
|
|
76
|
+
------------------
|
|
77
|
+
Resources/Accounts
|
|
78
|
+
------------------
|
|
79
|
+
|
|
80
|
+
`Wialon API Reference <https://sdk.wialon.com/wiki/en/sidebar/remoteapi/apiref/core/check_items_billing#resources_accounts>`_
|
|
81
|
+
|
|
82
|
+
.. py:data:: ACCESSFLAG_RESOURCE_VIEW_NOTIFICATIONS
|
|
83
|
+
.. py:data:: ACCESSFLAG_RESOURCE_MANAGE_NOTIFICATIONS
|
|
84
|
+
.. py:data:: ACCESSFLAG_RESOURCE_VIEW_POIS
|
|
85
|
+
.. py:data:: ACCESSFLAG_RESOURCE_MANAGE_POIS
|
|
86
|
+
.. py:data:: ACCESSFLAG_RESOURCE_VIEW_GEOFENCES
|
|
87
|
+
.. py:data:: ACCESSFLAG_RESOURCE_MANAGE_GEOFENCES
|
|
88
|
+
.. py:data:: ACCESSFLAG_RESOURCE_VIEW_JOBS
|
|
89
|
+
.. py:data:: ACCESSFLAG_RESOURCE_MANAGE_JOBS
|
|
90
|
+
.. py:data:: ACCESSFLAG_RESOURCE_VIEW_REPORT_TEMPLATES
|
|
91
|
+
.. py:data:: ACCESSFLAG_RESOURCE_MANAGE_REPORT_TEMPLATES
|
|
92
|
+
.. py:data:: ACCESSFLAG_RESOURCE_VIEW_DRIVERS
|
|
93
|
+
.. py:data:: ACCESSFLAG_RESOURCE_MANAGE_DRIVERS
|
|
94
|
+
.. py:data:: ACCESSFLAG_RESOURCE_MANAGE_ACCOUNT
|
|
95
|
+
.. py:data:: ACCESSFLAG_RESOURCE_VIEW_ORDERS
|
|
96
|
+
.. py:data:: ACCESSFLAG_RESOURCE_MANAGE_ORDERS
|
|
97
|
+
.. py:data:: ACCESSFLAG_RESOURCE_VIEW_TRAILERS
|
|
98
|
+
.. py:data:: ACCESSFLAG_RESOURCE_MANAGE_TRAILERS
|
|
99
|
+
|
|
100
|
+
------
|
|
101
|
+
Routes
|
|
102
|
+
------
|
|
103
|
+
|
|
104
|
+
`Wialon API Reference <https://sdk.wialon.com/wiki/en/sidebar/remoteapi/apiref/core/check_items_billing#routes>`_
|
|
105
|
+
|
|
106
|
+
.. py:data:: ACCESSFLAG_ROUTE_MANAGE_ROUTE
|
|
107
|
+
|
|
108
|
+
-----
|
|
109
|
+
Other
|
|
110
|
+
-----
|
|
111
|
+
|
|
112
|
+
`Wialon API Reference <https://sdk.wialon.com/wiki/en/sidebar/remoteapi/apiref/core/check_items_billing#other>`_
|
|
113
|
+
|
|
114
|
+
.. py:data:: ACCESSFLAG_FULL_ACCESS
|
|
115
|
+
|
|
116
|
+
==========
|
|
117
|
+
Data Flags
|
|
118
|
+
==========
|
|
119
|
+
|
|
120
|
+
------------
|
|
121
|
+
Retranslator
|
|
122
|
+
------------
|
|
123
|
+
|
|
124
|
+
`Wialon API Reference <https://sdk.wialon.com/wiki/en/sidebar/remoteapi/apiref/format/retranslator>`_
|
|
125
|
+
|
|
126
|
+
.. py:data:: DATAFLAG_RETRANSLATOR_BASE
|
|
127
|
+
.. py:data:: DATAFLAG_RETRANSLATOR_CUSTOM_PROPERTIES
|
|
128
|
+
.. py:data:: DATAFLAG_RETRANSLATOR_BILLING_PROPERTIES
|
|
129
|
+
.. py:data:: DATAFLAG_RETRANSLATOR_GUID
|
|
130
|
+
.. py:data:: DATAFLAG_RETRANSLATOR_ADMIN_FIELDS
|
|
131
|
+
.. py:data:: DATAFLAG_RETRANSLATOR_CONFIGURATION
|
|
132
|
+
.. py:data:: DATAFLAG_RETRANSLATOR_UNITS
|
|
133
|
+
.. py:data:: DATAFLAG_RETRANSLATOR_ALL
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
-----------------
|
|
137
|
+
Resource/Accounts
|
|
138
|
+
-----------------
|
|
139
|
+
|
|
140
|
+
`Wialon API Reference <https://sdk.wialon.com/wiki/en/sidebar/remoteapi/apiref/format/resource>`_
|
|
141
|
+
|
|
142
|
+
.. py:data:: DATAFLAG_RESOURCE_BASE
|
|
143
|
+
.. py:data:: DATAFLAG_RESOURCE_CUSTOM_PROPERTIES
|
|
144
|
+
.. py:data:: DATAFLAG_RESOURCE_BILLING_PROPERTIES
|
|
145
|
+
.. py:data:: DATAFLAG_RESOURCE_CUSTOM_FIELDS
|
|
146
|
+
.. py:data:: DATAFLAG_RESOURCE_MESSAGES
|
|
147
|
+
.. py:data:: DATAFLAG_RESOURCE_GUID
|
|
148
|
+
.. py:data:: DATAFLAG_RESOURCE_ADMIN_FIELDS
|
|
149
|
+
.. py:data:: DATAFLAG_RESOURCE_DRIVERS
|
|
150
|
+
.. py:data:: DATAFLAG_RESOURCE_JOBS
|
|
151
|
+
.. py:data:: DATAFLAG_RESOURCE_NOTIFICATIONS
|
|
152
|
+
.. py:data:: DATAFLAG_RESOURCE_POIS
|
|
153
|
+
.. py:data:: DATAFLAG_RESOURCE_GEOFENCES
|
|
154
|
+
.. py:data:: DATAFLAG_RESOURCE_REPORT_TEMPLATES
|
|
155
|
+
.. py:data:: DATAFLAG_RESOURCE_DRIVER_ATTACHABLE_UNITS
|
|
156
|
+
.. py:data:: DATAFLAG_RESOURCE_DRIVER_GROUPS
|
|
157
|
+
.. py:data:: DATAFLAG_RESOURCE_TRAILERS
|
|
158
|
+
.. py:data:: DATAFLAG_RESOURCE_TRAILER_GROUPS
|
|
159
|
+
.. py:data:: DATAFLAG_RESOURCE_TRAILER_ATTACHABLE_UNITS
|
|
160
|
+
.. py:data:: DATAFLAG_RESOURCE_ORDERS
|
|
161
|
+
.. py:data:: DATAFLAG_RESOURCE_GEOFENCE_GROUPS
|
|
162
|
+
.. py:data:: DATAFLAG_RESOURCE_TAGS
|
|
163
|
+
.. py:data:: DATAFLAG_RESOURCE_TAG_ATTACHABLE_UNITS
|
|
164
|
+
.. py:data:: DATAFLAG_RESOURCE_TAG_GROUPS
|
|
165
|
+
.. py:data:: DATAFLAG_RESOURCE_ALL
|
|
166
|
+
|
|
167
|
+
-----
|
|
168
|
+
Route
|
|
169
|
+
-----
|
|
170
|
+
|
|
171
|
+
`Wialon API Reference <https://sdk.wialon.com/wiki/en/sidebar/remoteapi/apiref/format/route>`_
|
|
172
|
+
|
|
173
|
+
.. py:data:: DATAFLAG_ROUTE_BASE
|
|
174
|
+
.. py:data:: DATAFLAG_ROUTE_CUSTOM_PROPERTIES
|
|
175
|
+
.. py:data:: DATAFLAG_ROUTE_BILLING_PROPERTIES
|
|
176
|
+
.. py:data:: DATAFLAG_ROUTE_GUID
|
|
177
|
+
.. py:data:: DATAFLAG_ROUTE_ADMIN_FIELDS
|
|
178
|
+
.. py:data:: DATAFLAG_ROUTE_CONFIGURATION
|
|
179
|
+
.. py:data:: DATAFLAG_ROUTE_CHECKPOINTS
|
|
180
|
+
.. py:data:: DATAFLAG_ROUTE_SCHEDULES
|
|
181
|
+
.. py:data:: DATAFLAG_ROUTE_ROUNDS
|
|
182
|
+
.. py:data:: DATAFLAG_ROUTE_ALL
|
|
183
|
+
|
|
184
|
+
---------------
|
|
185
|
+
Unit/Unit Group
|
|
186
|
+
---------------
|
|
187
|
+
|
|
188
|
+
`Wialon API Reference <https://sdk.wialon.com/wiki/en/sidebar/remoteapi/apiref/format/unit>`_
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
.. python-terminusgps documentation master file, created by
|
|
2
|
-
sphinx-quickstart on Wed Feb 19 10:39:57 2025.
|
|
3
|
-
You can adapt this file completely to your liking, but it should at least
|
|
4
|
-
contain the root `toctree` directive.
|
|
5
|
-
|
|
6
1
|
Wialon API
|
|
7
2
|
==========
|
|
8
3
|
|
|
@@ -13,6 +8,8 @@ Wialon API
|
|
|
13
8
|
:caption: Contents:
|
|
14
9
|
|
|
15
10
|
constants.rst
|
|
11
|
+
errors.rst
|
|
16
12
|
flags.rst
|
|
17
|
-
|
|
13
|
+
items.rst
|
|
14
|
+
session.rst
|
|
18
15
|
utils.rst
|
|
@@ -0,0 +1,537 @@
|
|
|
1
|
+
Items
|
|
2
|
+
=====
|
|
3
|
+
|
|
4
|
+
.. currentmodule:: terminusgps.wialon.items.base
|
|
5
|
+
|
|
6
|
+
.. py:class:: WialonBase
|
|
7
|
+
|
|
8
|
+
Base class for Wialon API objects.
|
|
9
|
+
|
|
10
|
+
.. py:method:: create() -> int | None
|
|
11
|
+
|
|
12
|
+
Creates a Wialon object and returns its id.
|
|
13
|
+
|
|
14
|
+
:meta abstract:
|
|
15
|
+
:returns: The new object's id.
|
|
16
|
+
:rtype: :py:obj:`int` | :py:obj:`None`
|
|
17
|
+
|
|
18
|
+
.. py:method:: rename(new_name) -> None
|
|
19
|
+
|
|
20
|
+
Renames the Wialon object to the new name.
|
|
21
|
+
|
|
22
|
+
:param new_name: A new name.
|
|
23
|
+
:type new_name: :py:obj:`str`
|
|
24
|
+
:returns: Nothing.
|
|
25
|
+
:rtype: :py:obj:`None`
|
|
26
|
+
|
|
27
|
+
.. py:method:: add_afield(field) -> None
|
|
28
|
+
|
|
29
|
+
Adds an admin field to the Wialon object.
|
|
30
|
+
|
|
31
|
+
:param field: A tuple containing the name of the field and the value of the field.
|
|
32
|
+
:type field: :py:obj:`tuple`
|
|
33
|
+
:returns: Nothing.
|
|
34
|
+
:rtype: :py:obj:`None`
|
|
35
|
+
|
|
36
|
+
.. py:method:: update_afield(field_id, field) -> None
|
|
37
|
+
|
|
38
|
+
Updates an admin field by id to the Wialon object.
|
|
39
|
+
|
|
40
|
+
:param field_id: The admin field id.
|
|
41
|
+
:type field_id: :py:obj:`int`
|
|
42
|
+
:param field: A tuple containing the name of the field and the value of the field.
|
|
43
|
+
:type field: :py:obj:`tuple`
|
|
44
|
+
:returns: Nothing.
|
|
45
|
+
:rtype: :py:obj:`None`
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
.. py:method:: add_cfield(field) -> None
|
|
49
|
+
|
|
50
|
+
Adds a custom field to the Wialon object.
|
|
51
|
+
|
|
52
|
+
:param field: A tuple containing the name of the field and the value of the field.
|
|
53
|
+
:type field: :py:obj:`tuple`
|
|
54
|
+
:returns: Nothing.
|
|
55
|
+
:rtype: :py:obj:`None`
|
|
56
|
+
|
|
57
|
+
.. py:method:: update_cfield(field_id, field) -> None
|
|
58
|
+
|
|
59
|
+
Updates a custom field by id.
|
|
60
|
+
|
|
61
|
+
:param field_id: The admin field id.
|
|
62
|
+
:type field_id: :py:obj:`int`
|
|
63
|
+
:param field: A tuple containing the name of the field and the value of the field.
|
|
64
|
+
:type field: :py:obj:`tuple`
|
|
65
|
+
:returns: Nothing.
|
|
66
|
+
:rtype: :py:obj:`None`
|
|
67
|
+
|
|
68
|
+
.. py:method:: add_cproperty(property) -> None
|
|
69
|
+
|
|
70
|
+
Adds a custom property to the Wialon object.
|
|
71
|
+
|
|
72
|
+
:param property: A tuple containing the name of the property and the value of the property.
|
|
73
|
+
:type property: :py:obj:`tuple`
|
|
74
|
+
:returns: Nothing.
|
|
75
|
+
:rtype: :py:obj:`None`
|
|
76
|
+
|
|
77
|
+
.. py:method:: add_profile_field(field) -> None
|
|
78
|
+
|
|
79
|
+
Adds a profile field to the Wialon object.
|
|
80
|
+
|
|
81
|
+
:param field: A tuple containing the name of the field and the value of the field.
|
|
82
|
+
:type field: :py:obj:`tuple`
|
|
83
|
+
:returns: Nothing.
|
|
84
|
+
:rtype: :py:obj:`None`
|
|
85
|
+
|
|
86
|
+
.. py:method:: delete() -> None
|
|
87
|
+
|
|
88
|
+
Deletes the Wialon object.
|
|
89
|
+
|
|
90
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
91
|
+
:returns: Nothing.
|
|
92
|
+
:rtype: :py:obj:`None`
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
.. currentmodule:: terminusgps.wialon.items.geofence
|
|
96
|
+
|
|
97
|
+
.. py:class:: WialonGeofence
|
|
98
|
+
|
|
99
|
+
.. currentmodule:: terminusgps.wialon.items.notification
|
|
100
|
+
|
|
101
|
+
.. py:class:: WialonNotification
|
|
102
|
+
|
|
103
|
+
.. currentmodule:: terminusgps.wialon.items.resource
|
|
104
|
+
|
|
105
|
+
.. py:class:: WialonResource
|
|
106
|
+
|
|
107
|
+
.. py:method:: create(creator_id, name) -> int | None
|
|
108
|
+
|
|
109
|
+
Creates a new Wialon resource.
|
|
110
|
+
|
|
111
|
+
:param creator_id: A Wialon user id.
|
|
112
|
+
:type creator_id: :py:obj:`int` | :py:obj:`str`
|
|
113
|
+
:param name: A name for the resource.
|
|
114
|
+
:type name: :py:obj:`str`
|
|
115
|
+
:raises ValueError: If ``creator_id`` is not a digit.
|
|
116
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
117
|
+
:returns: The Wialon id for the new resource, if it was created.
|
|
118
|
+
:rtype: :py:obj:`int` | :py:obj:`None`
|
|
119
|
+
|
|
120
|
+
.. py:method:: delete() -> None
|
|
121
|
+
|
|
122
|
+
Deletes all micro-objects assigned to the resource.
|
|
123
|
+
|
|
124
|
+
If the resource is an account, instead deletes all macro-objects and micro-objects assigned to the account.
|
|
125
|
+
|
|
126
|
+
:returns: Nothing.
|
|
127
|
+
:rtype: :py:obj:`None`
|
|
128
|
+
|
|
129
|
+
.. py:method:: is_migrated(unit) -> None
|
|
130
|
+
|
|
131
|
+
Checks if a unit is migrated into the account.
|
|
132
|
+
|
|
133
|
+
:param unit: A Wialon object.
|
|
134
|
+
:type unit: :py:obj:`~terminusgps.wialon.items.base.WialonBase`
|
|
135
|
+
:returns: Whether or not the unit is migrated into the account.
|
|
136
|
+
:rtype: :py:obj:`bool`
|
|
137
|
+
|
|
138
|
+
.. py:method:: set_dealer_rights(enabled) -> None
|
|
139
|
+
|
|
140
|
+
Sets dealer rights on the account.
|
|
141
|
+
|
|
142
|
+
You **probably don't** need to use this method.
|
|
143
|
+
|
|
144
|
+
:param enabled: :py:obj:`True` to enable dealer rights, :py:obj:`False` to disable dealer rights. Default is :py:obj:`False`.
|
|
145
|
+
:type enabled: :py:obj:`bool`
|
|
146
|
+
:raises AssertionError: If the resource is not an account.
|
|
147
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
148
|
+
:returns: Nothing.
|
|
149
|
+
:rtype: :py:obj:`None`
|
|
150
|
+
|
|
151
|
+
.. py:method:: migrate_unit(unit) -> None
|
|
152
|
+
|
|
153
|
+
Migrates a :py:obj:`WialonUnit` into the account.
|
|
154
|
+
|
|
155
|
+
:param unit: A Wialon object.
|
|
156
|
+
:type unit: :py:obj:`~terminusgps.wialon.items.base.WialonBase`
|
|
157
|
+
:raises AssertionError: If the resource is not an account.
|
|
158
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
159
|
+
:returns: Nothing.
|
|
160
|
+
:rtype: :py:obj:`None`
|
|
161
|
+
|
|
162
|
+
.. py:method:: update_plan(new_plan) -> None
|
|
163
|
+
|
|
164
|
+
Updates the account billing plan.
|
|
165
|
+
|
|
166
|
+
:param new_plan: The name of a billing plan.
|
|
167
|
+
:type new_plan: :py:obj:`str`
|
|
168
|
+
:raises AssertionError: If the resource is not an account.
|
|
169
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
170
|
+
:returns: Nothing.
|
|
171
|
+
:rtype: :py:obj:`None`
|
|
172
|
+
|
|
173
|
+
.. py:method:: create_account(billing_plan) -> None
|
|
174
|
+
|
|
175
|
+
Transforms the resource into an account.
|
|
176
|
+
|
|
177
|
+
:param billing_plan: The name of a billing plan.
|
|
178
|
+
:type billing_plan: :py:obj:`str`
|
|
179
|
+
:raises AssertionError: If the resource is already account.
|
|
180
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
181
|
+
:returns: Nothing.
|
|
182
|
+
:rtype: :py:obj:`None`
|
|
183
|
+
|
|
184
|
+
.. py:method:: delete_account() -> None
|
|
185
|
+
|
|
186
|
+
Deletes the account if it exists, as well as any micro-objects and macro-objects it contains.
|
|
187
|
+
|
|
188
|
+
:raises AssertionError: If the resource is not an account.
|
|
189
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
190
|
+
:returns: Nothing.
|
|
191
|
+
:rtype: :py:obj:`None`
|
|
192
|
+
|
|
193
|
+
.. py:method:: enable_account() -> None
|
|
194
|
+
|
|
195
|
+
Enables the Wialon account.
|
|
196
|
+
|
|
197
|
+
:raises AssertionError: If the resource is not an account.
|
|
198
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
199
|
+
:returns: Nothing.
|
|
200
|
+
:rtype: :py:obj:`None`
|
|
201
|
+
|
|
202
|
+
.. py:method:: disable_account() -> None
|
|
203
|
+
|
|
204
|
+
Disables the Wialon account.
|
|
205
|
+
|
|
206
|
+
:raises AssertionError: If the resource is not an account.
|
|
207
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
208
|
+
:returns: Nothing.
|
|
209
|
+
:rtype: :py:obj:`None`
|
|
210
|
+
|
|
211
|
+
.. py:method:: set_minimum_days([days=0]) -> None
|
|
212
|
+
|
|
213
|
+
Sets the minimum days counter value to ``days``.
|
|
214
|
+
|
|
215
|
+
:param days: Number of days to set the counter to. Default is ``0``.
|
|
216
|
+
:type days: :py:obj:`int`
|
|
217
|
+
:raises AssertionError: If the resource is not an account.
|
|
218
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
219
|
+
:returns: Nothing.
|
|
220
|
+
:rtype: :py:obj:`None`
|
|
221
|
+
|
|
222
|
+
.. py:method:: add_days([days=30]) -> None
|
|
223
|
+
|
|
224
|
+
Adds days to the account.
|
|
225
|
+
|
|
226
|
+
:param days: Number of days to add to the account. Default is ``30``.
|
|
227
|
+
:type days: :py:obj:`int`
|
|
228
|
+
:raises AssertionError: If the resource is not an account.
|
|
229
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
230
|
+
:returns: Nothing.
|
|
231
|
+
:rtype: :py:obj:`None`
|
|
232
|
+
|
|
233
|
+
.. py:method:: set_settings_flags([flags=0x20, block_balance_val=0.00, deny_balance_val=0.00]) -> None
|
|
234
|
+
|
|
235
|
+
Sets account settings flags.
|
|
236
|
+
|
|
237
|
+
:param flags: A flag integer to set on the account.
|
|
238
|
+
:type flags: :py:obj:`int`
|
|
239
|
+
:param block_balance_val: Minimum amount on the account's balance before blocking the account.
|
|
240
|
+
:type block_balance_val: :py:obj:`float`
|
|
241
|
+
:param deny_balance_val: Minimum amount on the account's balance before denying the account.
|
|
242
|
+
:type deny_balance_val: :py:obj:`float`
|
|
243
|
+
:raises AssertionError: If the resource is not an account.
|
|
244
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
245
|
+
:returns: Nothing.
|
|
246
|
+
:rtype: :py:obj:`None`
|
|
247
|
+
|
|
248
|
+
.. py:property:: is_dealer
|
|
249
|
+
|
|
250
|
+
Whether or not the resource/account has dealer rights.
|
|
251
|
+
|
|
252
|
+
:type: :py:obj:`bool`
|
|
253
|
+
|
|
254
|
+
.. py:property:: is_account
|
|
255
|
+
|
|
256
|
+
Whether or not the resource is an account.
|
|
257
|
+
|
|
258
|
+
:type: :py:obj:`bool`
|
|
259
|
+
|
|
260
|
+
.. currentmodule:: terminusgps.wialon.items.retranslator
|
|
261
|
+
|
|
262
|
+
.. py:class:: WialonRetranslator
|
|
263
|
+
|
|
264
|
+
.. py:method:: create(creator_id, name) -> int | None
|
|
265
|
+
|
|
266
|
+
Creates a new Wialon route.
|
|
267
|
+
|
|
268
|
+
:param creator_id: A Wialon user id.
|
|
269
|
+
:type creator_id: :py:obj:`str` | :py:obj:`int`
|
|
270
|
+
:param name: A name for the route.
|
|
271
|
+
:type name: :py:obj:`str`
|
|
272
|
+
:raises ValueError: If ``creator_id`` is not a digit.
|
|
273
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
274
|
+
:returns: The Wialon id for the new route, if it was created.
|
|
275
|
+
:rtype: :py:obj:`int` | :py:obj:`None`
|
|
276
|
+
|
|
277
|
+
.. currentmodule:: terminusgps.wialon.items.unit
|
|
278
|
+
|
|
279
|
+
.. py:class:: WialonUnit
|
|
280
|
+
|
|
281
|
+
.. py:method:: create(creator_id, name, hw_type_id) -> int | None
|
|
282
|
+
|
|
283
|
+
Creates a new Wialon unit.
|
|
284
|
+
|
|
285
|
+
:param creator_id: A Wialon user id.
|
|
286
|
+
:type creator_id: :py:obj:`str` | :py:obj:`int`
|
|
287
|
+
:param name: A name for the unit.
|
|
288
|
+
:type name: :py:obj:`str`
|
|
289
|
+
:param hw_type_id: A Wialon hardware type ID.
|
|
290
|
+
:type hw_type_id: :py:obj:`str` | :py:obj:`int`
|
|
291
|
+
:returns: The Wialon id for the new unit.
|
|
292
|
+
:rtype: :py:obj:`int` | :py:obj:`None`
|
|
293
|
+
|
|
294
|
+
.. py:method:: execute_command(name, link_type, [timeout=5, flags=0, param=None]) -> None
|
|
295
|
+
|
|
296
|
+
Executes a command on this Wialon unit.
|
|
297
|
+
|
|
298
|
+
:param name: A Wialon command name.
|
|
299
|
+
:type name: :py:obj:`str`
|
|
300
|
+
:param link_type: A protocol to use for the Wialon command.
|
|
301
|
+
:type link_type: :py:obj:`str`
|
|
302
|
+
:param timeout: How long (in seconds) to wait before timing out command execution. Default is ``5``.
|
|
303
|
+
:type timeout: :py:obj:`int`
|
|
304
|
+
:param flags: Flags to pass to the Wialon command execution.
|
|
305
|
+
:type flags: :py:obj:`int`
|
|
306
|
+
:param param: Additional parameters to execute the command with.
|
|
307
|
+
:type param: :py:obj:`dict` | :py:obj:`None`
|
|
308
|
+
:returns: Nothing.
|
|
309
|
+
:rtype: :py:obj:`None`
|
|
310
|
+
|
|
311
|
+
.. py:method:: set_access_password(password) -> None
|
|
312
|
+
|
|
313
|
+
Sets a new access password for this Wialon unit.
|
|
314
|
+
|
|
315
|
+
:param password: A new access password.
|
|
316
|
+
:type name: :py:obj:`str`
|
|
317
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
318
|
+
:returns: Nothing.
|
|
319
|
+
:rtype: :py:obj:`None`
|
|
320
|
+
|
|
321
|
+
.. py:method:: activate() -> None
|
|
322
|
+
|
|
323
|
+
Activates the Wialon unit.
|
|
324
|
+
|
|
325
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
326
|
+
:returns: Nothing.
|
|
327
|
+
:rtype: :py:obj:`None`
|
|
328
|
+
|
|
329
|
+
.. py:method:: deactivate() -> None
|
|
330
|
+
|
|
331
|
+
Deactivates the Wialon unit.
|
|
332
|
+
|
|
333
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
334
|
+
:returns: Nothing.
|
|
335
|
+
:rtype: :py:obj:`None`
|
|
336
|
+
|
|
337
|
+
.. py:method:: assign_phone(phone) -> None
|
|
338
|
+
|
|
339
|
+
Assigns a phone number to the Wialon unit.
|
|
340
|
+
|
|
341
|
+
:param phone: A phone number beginning with a country code.
|
|
342
|
+
:type phone: :py:obj:`str`
|
|
343
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
344
|
+
:returns: Nothing.
|
|
345
|
+
:rtype: :py:obj:`None`
|
|
346
|
+
|
|
347
|
+
.. py:method:: get_phone_numbers() -> list[str]
|
|
348
|
+
|
|
349
|
+
Retrieves all phone numbers assigned to the unit.
|
|
350
|
+
|
|
351
|
+
This includes any attached drivers, custom/admin fields, or otherwise assigned phone numbers.
|
|
352
|
+
|
|
353
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
354
|
+
:returns: A list of phone numbers.
|
|
355
|
+
:rtype: :py:obj:`list`
|
|
356
|
+
|
|
357
|
+
.. py:property:: imei_number
|
|
358
|
+
|
|
359
|
+
Unique id for the unit.
|
|
360
|
+
|
|
361
|
+
:type: :py:obj:`int` | :py:obj:`None`
|
|
362
|
+
|
|
363
|
+
.. py:property:: image_uri
|
|
364
|
+
|
|
365
|
+
Unit image universal resource identifier.
|
|
366
|
+
|
|
367
|
+
:type: :py:obj:`str`
|
|
368
|
+
|
|
369
|
+
.. py:property:: active
|
|
370
|
+
|
|
371
|
+
Whether or not the unit is activated in Wialon.
|
|
372
|
+
|
|
373
|
+
:type: :py:obj:`bool`
|
|
374
|
+
|
|
375
|
+
.. currentmodule:: terminusgps.wialon.items.unit_group
|
|
376
|
+
|
|
377
|
+
.. py:class:: WialonUnitGroup
|
|
378
|
+
|
|
379
|
+
.. py:method:: create(creator_id, name) -> int | None
|
|
380
|
+
|
|
381
|
+
Creates a new Wialon unit group.
|
|
382
|
+
|
|
383
|
+
:param creator_id: A Wialon user id.
|
|
384
|
+
:type creator_id: :py:obj:`str` | :py:obj:`int`
|
|
385
|
+
:param name: A name for the group.
|
|
386
|
+
:type name: :py:obj:`str`
|
|
387
|
+
:raises ValueError: If ``creator_id`` is not a digit.
|
|
388
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
389
|
+
:returns: The Wialon id for the new group, if it was created.
|
|
390
|
+
:rtype: :py:obj:`int` | :py:obj:`None`
|
|
391
|
+
|
|
392
|
+
.. py:method:: set_items(new_items) -> None
|
|
393
|
+
|
|
394
|
+
Sets this group's members to a list of Wialon unit ids.
|
|
395
|
+
|
|
396
|
+
:param new_items: A list of Wialon unit ids.
|
|
397
|
+
:type new_items: :py:obj:`list`
|
|
398
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
399
|
+
:returns: Nothing.
|
|
400
|
+
:rtype: :py:obj:`None`
|
|
401
|
+
|
|
402
|
+
.. py:method:: is_member(item) -> bool
|
|
403
|
+
|
|
404
|
+
Determines whether or not ``item`` is a member of the group.
|
|
405
|
+
|
|
406
|
+
:param item: A Wialon object.
|
|
407
|
+
:type item: :py:obj:`~terminusgps.wialon.items.base.WialonBase`
|
|
408
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
409
|
+
:returns: :py:obj:`True` if ``item`` is a member of the group, else :py:obj:`False`.
|
|
410
|
+
:rtype: :py:obj:`bool`
|
|
411
|
+
|
|
412
|
+
.. py:method:: add_item(item) -> bool
|
|
413
|
+
|
|
414
|
+
Adds a Wialon item to the group.
|
|
415
|
+
|
|
416
|
+
:param item: A Wialon object.
|
|
417
|
+
:type item: :py:obj:`~terminusgps.wialon.items.base.WialonBase`
|
|
418
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
419
|
+
:returns: Nothing.
|
|
420
|
+
:rtype: :py:obj:`None`
|
|
421
|
+
|
|
422
|
+
.. py:method:: rm_item(item) -> bool
|
|
423
|
+
|
|
424
|
+
Removes a Wialon unit from the group, if it's a member of the group.
|
|
425
|
+
|
|
426
|
+
:param item: A Wialon object.
|
|
427
|
+
:type item: :py:obj:`~terminusgps.wialon.items.base.WialonBase`
|
|
428
|
+
:raises AssertionError: If the item wasn't in the group.
|
|
429
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
430
|
+
:returns: Nothing.
|
|
431
|
+
:rtype: :py:obj:`None`
|
|
432
|
+
|
|
433
|
+
.. py:property:: items
|
|
434
|
+
|
|
435
|
+
A list of Wialon object ids in the group.
|
|
436
|
+
|
|
437
|
+
:type: :py:obj:`list`
|
|
438
|
+
|
|
439
|
+
.. currentmodule:: terminusgps.wialon.items.user
|
|
440
|
+
|
|
441
|
+
.. py:class:: WialonUser
|
|
442
|
+
|
|
443
|
+
.. py::method:: create(creator_id, name, password) -> int | None
|
|
444
|
+
|
|
445
|
+
Creates a new Wialon user.
|
|
446
|
+
|
|
447
|
+
:param creator_id: A Wialon user id.
|
|
448
|
+
:type creator_id: :py:obj:`str` | :py:obj:`int`
|
|
449
|
+
:param name: A name for the user.
|
|
450
|
+
:type name: :py:obj:`str`
|
|
451
|
+
:param password: A password for the user.
|
|
452
|
+
:type password: :py:obj:`str`
|
|
453
|
+
:raises ValueError: If ``creator_id`` is not a digit.
|
|
454
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
455
|
+
:returns: The Wialon id for the new user, if it was created.
|
|
456
|
+
:rtype: :py:obj:`int` | :py:obj:`None`
|
|
457
|
+
|
|
458
|
+
.. py::method:: has_access(other) -> bool
|
|
459
|
+
|
|
460
|
+
Checks if the user has access to ``other``.
|
|
461
|
+
|
|
462
|
+
:param other: A Wialon object.
|
|
463
|
+
:type phone: :py:obj:`~terminusgps.wialon.items.base.WialonBase`
|
|
464
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
465
|
+
:returns: :py:obj:`True` if the user can access ``other``, else :py:obj:`False`.
|
|
466
|
+
:rtype: :py:obj:`bool`
|
|
467
|
+
|
|
468
|
+
.. py::method:: assign_phone(phone) -> None
|
|
469
|
+
|
|
470
|
+
Assigns a phone number to the user.
|
|
471
|
+
|
|
472
|
+
:param phone: A phone number, including country code.
|
|
473
|
+
:type phone: :py:obj:`str`
|
|
474
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
475
|
+
:returns: Nothing.
|
|
476
|
+
:rtype: :py:obj:`None`
|
|
477
|
+
|
|
478
|
+
.. py::method:: assign_email(email) -> None
|
|
479
|
+
|
|
480
|
+
Assigns an email address to the user.
|
|
481
|
+
|
|
482
|
+
:param phone: An email address.
|
|
483
|
+
:type phone: :py:obj:`str`
|
|
484
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
485
|
+
:returns: Nothing.
|
|
486
|
+
:rtype: :py:obj:`None`
|
|
487
|
+
|
|
488
|
+
.. py::method:: grant_access(item) -> None
|
|
489
|
+
|
|
490
|
+
Grants the user access to ``item``.
|
|
491
|
+
|
|
492
|
+
:param item: A Wialon object.
|
|
493
|
+
:type item: :py:obj:`~terminusgps.wialon.items.base.WialonBase`
|
|
494
|
+
:param access_mask: A Wialon access mask integer.
|
|
495
|
+
:type access_mask: :py:obj:`int`
|
|
496
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
497
|
+
:returns: Nothing.
|
|
498
|
+
:rtype: :py:obj:`None`
|
|
499
|
+
|
|
500
|
+
.. py::method:: set_settings_flags(flags, flags_mask) -> None
|
|
501
|
+
|
|
502
|
+
Sets the user's settings flags.
|
|
503
|
+
|
|
504
|
+
:param flags: The new user settings flags.
|
|
505
|
+
:type flags: :py:obj:`int`
|
|
506
|
+
:param flags_mask: A user settings flag mask.
|
|
507
|
+
:type flags_mask: :py:obj:`int`
|
|
508
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
509
|
+
:returns: Nothing.
|
|
510
|
+
:rtype: :py:obj:`None`
|
|
511
|
+
|
|
512
|
+
.. py::method:: update_password(old_password, new_password) -> None
|
|
513
|
+
|
|
514
|
+
Updates the password of the user.
|
|
515
|
+
|
|
516
|
+
:param old_password: The user's original password.
|
|
517
|
+
:type old_password: :py:obj:`str`
|
|
518
|
+
:param new_password: A new password.
|
|
519
|
+
:type new_password: :py:obj:`str`
|
|
520
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
521
|
+
:returns: Nothing.
|
|
522
|
+
:rtype: :py:obj:`None`
|
|
523
|
+
|
|
524
|
+
.. py::method:: verify_auth(destination, [method="email"]) -> None
|
|
525
|
+
|
|
526
|
+
Sends an authentication code to ``destination`` via ``method``.
|
|
527
|
+
|
|
528
|
+
``Method`` can be ``"email"`` or ``"sms"``.
|
|
529
|
+
|
|
530
|
+
:param destination: The email or phone number to send an auth code to.
|
|
531
|
+
:type destination: :py:obj:`str`
|
|
532
|
+
:param method: Email or sms. Default is ``"email"``.
|
|
533
|
+
:type method: :py:obj:`str`
|
|
534
|
+
:raises ValueError: If the method isn't ``"email"`` or ``"sms"``.
|
|
535
|
+
:raises WialonError: If something goes wrong with Wialon.
|
|
536
|
+
:returns: An auth code.
|
|
537
|
+
:rtype: :py:obj:`str`
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
Wialon API Sessions
|
|
2
|
+
===================
|
|
3
|
+
|
|
4
|
+
.. currentmodule:: terminusgps.wialon.session
|
|
5
|
+
|
|
6
|
+
.. py:class:: WialonSession
|
|
7
|
+
|
|
8
|
+
Starts or continues a Wialon API session.
|
|
9
|
+
|
|
10
|
+
:param token: An optional Wialon API token. Default is :confval:`WIALON_TOKEN`.
|
|
11
|
+
:type token: :py:obj:`str` | :py:obj:`None`
|
|
12
|
+
:param sid: An optional Wialon API session id. If provided, the session is continued.
|
|
13
|
+
:type sid: :py:obj:`str` | :py:obj:`None`
|
|
14
|
+
:param scheme: HTTP request scheme to use. Default is ``"https"``.
|
|
15
|
+
:type scheme: :py:obj:`str`
|
|
16
|
+
:param host: Wialon API host url. Default is ``"hst-api.wialon.com"``.
|
|
17
|
+
:type host: :py:obj:`str`
|
|
18
|
+
:param port: Wialon API host port. Default is ``443``.
|
|
19
|
+
:type port: :py:obj:`int`
|
|
20
|
+
:param log_level: Severity level at which log messages should be handled. Default is ``20`` (logging.INFO).
|
|
21
|
+
:type log_level: :py:obj:`int`
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
.. py:property:: gis_geocode
|
|
25
|
+
|
|
26
|
+
GIS geocode URL.
|
|
27
|
+
|
|
28
|
+
:type: :py:obj:`str` | :py:obj:`None`
|
|
29
|
+
:value: :py:obj:`None`
|
|
30
|
+
|
|
31
|
+
.. py:property:: gis_render
|
|
32
|
+
|
|
33
|
+
GIS renderer URL.
|
|
34
|
+
|
|
35
|
+
:type: :py:obj:`str` | :py:obj:`None`
|
|
36
|
+
:value: :py:obj:`None`
|
|
37
|
+
|
|
38
|
+
.. py:property:: gis_routing
|
|
39
|
+
|
|
40
|
+
GIS routing URL.
|
|
41
|
+
|
|
42
|
+
:type: :py:obj:`str` | :py:obj:`None`
|
|
43
|
+
:value: :py:obj:`None`
|
|
44
|
+
|
|
45
|
+
.. py:property:: gis_search
|
|
46
|
+
|
|
47
|
+
GIS searching URL.
|
|
48
|
+
|
|
49
|
+
:type: :py:obj:`str` | :py:obj:`None`
|
|
50
|
+
:value: :py:obj:`None`
|
|
51
|
+
|
|
52
|
+
.. py:property:: gis_sid
|
|
53
|
+
|
|
54
|
+
GIS session id.
|
|
55
|
+
|
|
56
|
+
:type: :py:obj:`str` | :py:obj:`None`
|
|
57
|
+
:value: :py:obj:`None`
|
|
58
|
+
|
|
59
|
+
.. py:property:: host
|
|
60
|
+
|
|
61
|
+
Client IP address.
|
|
62
|
+
|
|
63
|
+
:type: :py:obj:`str` | :py:obj:`None`
|
|
64
|
+
:value: :py:obj:`None`
|
|
65
|
+
|
|
66
|
+
.. py:property:: hw_gw_ip
|
|
67
|
+
|
|
68
|
+
Hardware gateway ip.
|
|
69
|
+
|
|
70
|
+
:type: :py:obj:`str` | :py:obj:`None`
|
|
71
|
+
:value: :py:obj:`None`
|
|
72
|
+
|
|
73
|
+
.. py:property:: hw_gw_dns
|
|
74
|
+
|
|
75
|
+
Hardware gateway domain name.
|
|
76
|
+
|
|
77
|
+
:type: :py:obj:`str` | :py:obj:`None`
|
|
78
|
+
:value: :py:obj:`None`
|
|
79
|
+
|
|
80
|
+
.. py:property:: wsdk_version
|
|
81
|
+
|
|
82
|
+
Wialon Source Developer Kit (wsdk) version.
|
|
83
|
+
|
|
84
|
+
:type: :py:obj:`str` | :py:obj:`None`
|
|
85
|
+
:value: :py:obj:`None`
|
|
86
|
+
|
|
87
|
+
.. py:property:: uid
|
|
88
|
+
|
|
89
|
+
Wialon user id the session is operating as.
|
|
90
|
+
|
|
91
|
+
:type: :py:obj:`str` | :py:obj:`None`
|
|
92
|
+
:value: :py:obj:`None`
|
|
93
|
+
|
|
94
|
+
.. py:property:: username
|
|
95
|
+
|
|
96
|
+
Wialon username the session is operating as.
|
|
97
|
+
|
|
98
|
+
:type: :py:obj:`str` | :py:obj:`None`
|
|
99
|
+
:value: :py:obj:`None`
|
|
100
|
+
|
|
101
|
+
.. py:property:: token
|
|
102
|
+
|
|
103
|
+
A Wialon API token set during :py:meth:`~WialonSession.__init__`.
|
|
104
|
+
|
|
105
|
+
:type: :py:obj:`str` | :py:obj:`None`
|
|
106
|
+
:value: :py:obj:`None`
|
|
107
|
+
|
|
108
|
+
.. py:method:: login(token, [flags,]) -> str
|
|
109
|
+
|
|
110
|
+
Logs into the Wialon API, sets session attributes, and returns a session id.
|
|
111
|
+
|
|
112
|
+
:param token: An activated Wialon API token.
|
|
113
|
+
:type token: :py:obj:`str`
|
|
114
|
+
:param flags: A login response flag integer. Default is ``35``.
|
|
115
|
+
:type flags: :py:obj:`int`
|
|
116
|
+
:raises WialonError: If the login fails.
|
|
117
|
+
:raises AssertionError: If the login token was not set.
|
|
118
|
+
:returns: The new session id.
|
|
119
|
+
:rtype: :py:obj:`str`
|
|
120
|
+
|
|
121
|
+
.. py:method:: logout() -> None
|
|
122
|
+
|
|
123
|
+
Logs out of the Wialon API session.
|
|
124
|
+
|
|
125
|
+
:raises WialonError: If something goes wrong during a Wialon API call.
|
|
126
|
+
:returns: Nothing.
|
|
127
|
+
:rtype: :py:obj:`None`
|
|
128
|
+
|
|
129
|
+
=====
|
|
130
|
+
Usage
|
|
131
|
+
=====
|
|
132
|
+
|
|
133
|
+
.. code:: python
|
|
134
|
+
|
|
135
|
+
from terminusgps.wialon.session import WialonSession
|
|
136
|
+
|
|
137
|
+
# Create a session and login to it
|
|
138
|
+
session = WialonSession()
|
|
139
|
+
session.login(token="my_secure_token")
|
|
140
|
+
|
|
141
|
+
# Use the logged in session to perform API actions
|
|
142
|
+
session.wialon_api.core_search_item(**{"id": "123", "flags": 1})
|
|
143
|
+
|
|
144
|
+
# Don't forget to logout of the session
|
|
145
|
+
# Sessions are destroyed after 5min of inactivity
|
|
146
|
+
session.logout()
|
|
147
|
+
|
|
148
|
+
# Alternatively, use a context manager
|
|
149
|
+
# The context manager handles logging in and out of the session.
|
|
150
|
+
with WialonSession() as session:
|
|
151
|
+
session.wialon_api.core_search_item(**{"id": "123", "flags": 1})
|
|
152
|
+
|
|
153
|
+
# If you already have a session id, no need to login again
|
|
154
|
+
session = WialonSession(sid="my_valid_session_id")
|
|
155
|
+
session.wialon_api.core_search_item(**{"id": "123", "flags": 1})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "python-terminusgps"
|
|
3
|
-
version = "20.
|
|
3
|
+
version = "20.5.0"
|
|
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" } ]
|
|
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-20.4.1 → python_terminusgps-20.5.0}/terminusgps/authorizenet/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/authorizenet/profiles/base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/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
|
{python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/wialon/items/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/wialon/items/geofence.py
RENAMED
|
File without changes
|
{python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/wialon/items/notification.py
RENAMED
|
File without changes
|
{python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/wialon/items/resource.py
RENAMED
|
File without changes
|
{python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/wialon/items/retranslator.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_terminusgps-20.4.1 → python_terminusgps-20.5.0}/terminusgps/wialon/items/unit_group.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|