python-terminusgps 36.9.0__py3-none-any.whl → 36.9.2__py3-none-any.whl
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-36.9.0.dist-info → python_terminusgps-36.9.2.dist-info}/METADATA +1 -1
- {python_terminusgps-36.9.0.dist-info → python_terminusgps-36.9.2.dist-info}/RECORD +9 -9
- terminusgps/authorizenet/utils.py +0 -55
- terminusgps/wialon/items/base.py +22 -2
- terminusgps/wialon/items/resource.py +1 -0
- terminusgps/wialon/items/unit.py +1 -0
- terminusgps/wialon/utils.py +1 -5
- {python_terminusgps-36.9.0.dist-info → python_terminusgps-36.9.2.dist-info}/WHEEL +0 -0
- {python_terminusgps-36.9.0.dist-info → python_terminusgps-36.9.2.dist-info}/licenses/COPYING +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-terminusgps
|
|
3
|
-
Version: 36.9.
|
|
3
|
+
Version: 36.9.2
|
|
4
4
|
Summary: Provides abstractions/utilities for working with Wialon API, Authorize.NET API, AWS API, and more.
|
|
5
5
|
Project-URL: Documentation, https://docs.terminusgps.com
|
|
6
6
|
Project-URL: Repository, https://github.com/terminusgps/python-terminusgps
|
|
@@ -3,7 +3,7 @@ terminusgps/authorizenet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
3
3
|
terminusgps/authorizenet/auth.py,sha256=g2tJPxP9V1nXnUcKzhHSRSs6ruSIHej5_hcf8P7bod8,1262
|
|
4
4
|
terminusgps/authorizenet/constants.py,sha256=xmulPmiBLhFfZoc7Il3l-DZA9Nq5HSaJmJKU-v-5X-Y,420
|
|
5
5
|
terminusgps/authorizenet/controllers.py,sha256=9t62qdGpmAkP4tNyPefd7vBRutXvMWsxql6z_pg52Bg,2146
|
|
6
|
-
terminusgps/authorizenet/utils.py,sha256=
|
|
6
|
+
terminusgps/authorizenet/utils.py,sha256=vxUTLT4rheWDd_2UprpcI8qo_Gw_zl0oiVHnUwHpNfE,6283
|
|
7
7
|
terminusgps/authorizenet/profiles/__init__.py,sha256=IG4XCEEYtHKqXOatlZlob6J3ukAgF7cFR-RXxOSMS1c,161
|
|
8
8
|
terminusgps/authorizenet/profiles/addresses.py,sha256=5GudJStBa4P0Hd7G_hRFH2C-WpICAH_k3MT9YJkicKw,6305
|
|
9
9
|
terminusgps/authorizenet/profiles/base.py,sha256=Pu1NGrvC5Ox2W1oZuVcPqUw3aUoSK191Evexw1U6_3k,3940
|
|
@@ -38,21 +38,21 @@ terminusgps/wialon/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
|
|
|
38
38
|
terminusgps/wialon/constants.py,sha256=05pLc_0S-x0tT87cQcxOmr8plesjOQxoXfUdjIHwI90,7732
|
|
39
39
|
terminusgps/wialon/flags.py,sha256=M50EdhxQ8IMnJnU0mrHK7-h8Asc6tvNiTOOfd1dBW6A,12815
|
|
40
40
|
terminusgps/wialon/session.py,sha256=eWRAWEikYdGr-0xa6yGHfTAxlCx9-1vsZDNwNZUJjZM,13771
|
|
41
|
-
terminusgps/wialon/utils.py,sha256=
|
|
41
|
+
terminusgps/wialon/utils.py,sha256=D08bX2QK6vHQv7JAa03Xl0T8BU2BKJIuM1gU2lbYrJ4,10932
|
|
42
42
|
terminusgps/wialon/validators.py,sha256=j5vrtcfClAzRdRkWTvRRAmrne1t0R6cKkmYdE7fAkSs,4247
|
|
43
43
|
terminusgps/wialon/items/__init__.py,sha256=3BVthghekMvhMQSzQgBMlD_phxmKSmp3Zvmo-z0O8Bs,211
|
|
44
|
-
terminusgps/wialon/items/base.py,sha256=
|
|
45
|
-
terminusgps/wialon/items/resource.py,sha256=
|
|
44
|
+
terminusgps/wialon/items/base.py,sha256=vS8xIo5WLiwzpB81i7aHFnwOHzCf4lQG6azjq79HDM4,11775
|
|
45
|
+
terminusgps/wialon/items/resource.py,sha256=Rhy2ig-yxznNhi6ZSaUBbu8ViVx0Sg4n_XS08ijgXsA,18280
|
|
46
46
|
terminusgps/wialon/items/retranslator.py,sha256=2J1x7lNxRck-IEXrmJ7RM9bVL60mrZkfmczOSiUhiO8,3873
|
|
47
47
|
terminusgps/wialon/items/route.py,sha256=2dEUK9o8nwutPE03W-5GUcZrjGvbwLoExVnFV9LyedE,1326
|
|
48
|
-
terminusgps/wialon/items/unit.py,sha256=
|
|
48
|
+
terminusgps/wialon/items/unit.py,sha256=ELHiyCtUGfrxklLoYLqQRpTdBV-zH86m2YmUojJZq78,11944
|
|
49
49
|
terminusgps/wialon/items/unit_group.py,sha256=HhYMZ9b7UATXeEgHkXN9r5-M_w82fabjDYADCUwBtxQ,4442
|
|
50
50
|
terminusgps/wialon/items/user.py,sha256=pR6OTrm6f7Zo0J8eLvKtWVsdhGi430OxMsMMthGh8YE,5382
|
|
51
51
|
terminusgps/wialon/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
52
52
|
terminusgps/wialon/tests/test_items.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
53
53
|
terminusgps/wialon/tests/test_session.py,sha256=9mBlYchMo9NeqRIZsmxYzrM1zBHorqu4ooxqSNppLpI,1336
|
|
54
54
|
terminusgps/wialon/tests/test_utils.py,sha256=SK4PxJQGECFnzx_EQeRAQfsQ5_3FLaVcis2W9u_ibuI,1730
|
|
55
|
-
python_terminusgps-36.9.
|
|
56
|
-
python_terminusgps-36.9.
|
|
57
|
-
python_terminusgps-36.9.
|
|
58
|
-
python_terminusgps-36.9.
|
|
55
|
+
python_terminusgps-36.9.2.dist-info/METADATA,sha256=e1KQ_v9YYhjAxwlBKbTvvEr6lNHRkc1ze4N1G5jcl4I,1264
|
|
56
|
+
python_terminusgps-36.9.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
57
|
+
python_terminusgps-36.9.2.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
58
|
+
python_terminusgps-36.9.2.dist-info/RECORD,,
|
|
@@ -21,61 +21,6 @@ def get_days_between(start_date: datetime.date, end_date: datetime.date) -> int:
|
|
|
21
21
|
"""
|
|
22
22
|
return (end_date - start_date).days
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
def get_payment_profile_transactions(
|
|
26
|
-
customer_profile_id: int | str,
|
|
27
|
-
payment_profile_id: int | str,
|
|
28
|
-
descending: bool = False,
|
|
29
|
-
limit: int = 100,
|
|
30
|
-
offset: int = 0,
|
|
31
|
-
) -> dict | None:
|
|
32
|
-
"""
|
|
33
|
-
Returns a transaction list for a customer payment profile.
|
|
34
|
-
|
|
35
|
-
`getTransactionListForCustomerRequest <https://developer.authorize.net/api/reference/index.html#transaction-reporting-get-customer-profile-transaction-list>`_
|
|
36
|
-
|
|
37
|
-
:param customer_profile_id: A customer profile id.
|
|
38
|
-
:type customer_profile_id: :py:obj:`int` | :py:obj:`str`
|
|
39
|
-
:param payment_profile_id: A customer payment profile id.
|
|
40
|
-
:type payment_profile_id: :py:obj:`int` | :py:obj:`str`
|
|
41
|
-
:param descending: Whether or not to sort the response in descending order. Default is :py:obj:`False`.
|
|
42
|
-
:type descending: :py:obj:`bool`
|
|
43
|
-
:param limit: Maximum amount of transactions to return in the response. Default is :py:obj:`100` .
|
|
44
|
-
:type limit: :py:obj:`int`
|
|
45
|
-
:param offset: Offsets the response for pagination. Default is :py:obj:`0` for page 0.
|
|
46
|
-
:type offset: :py:obj:`int`
|
|
47
|
-
:raises ValueError: If ``customer_profile_id`` was provided as a string containing non-digits.
|
|
48
|
-
:raises ValueError: If ``payment_profile_id`` was provided as a string containing non-digits.
|
|
49
|
-
:raises AuthorizenetControllerExecutionError: If the API call fails.
|
|
50
|
-
:returns: A merchant details object, if found.
|
|
51
|
-
:rtype: :py:obj:`dict` | :py:obj:`None`
|
|
52
|
-
|
|
53
|
-
"""
|
|
54
|
-
raise NotImplementedError
|
|
55
|
-
|
|
56
|
-
if isinstance(customer_profile_id, str) and not customer_profile_id.isdigit():
|
|
57
|
-
raise ValueError(
|
|
58
|
-
f"'customer_profile_id' can only contain digits, got '{customer_profile_id}'."
|
|
59
|
-
)
|
|
60
|
-
if isinstance(payment_profile_id, str) and not payment_profile_id.isdigit():
|
|
61
|
-
raise ValueError(
|
|
62
|
-
f"'payment_profile_id' can only contain digits, got '{payment_profile_id}'."
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
request = apicontractsv1.getTransactionListForCustomerRequest(
|
|
66
|
-
merchantAuthentication=get_merchant_auth(),
|
|
67
|
-
customerProfileId=str(customer_profile_id),
|
|
68
|
-
customerPaymentProfileId=str(payment_profile_id),
|
|
69
|
-
sorting={
|
|
70
|
-
"orderBy": "submitTimeUTC",
|
|
71
|
-
"orderDescending": str(descending).lower(),
|
|
72
|
-
},
|
|
73
|
-
paging={"limit": limit, "offset": offset},
|
|
74
|
-
)
|
|
75
|
-
controller = apicontrollers.getTransactionListForCustomerController(request)
|
|
76
|
-
return AuthorizenetControllerExecutor.execute_controller(controller)
|
|
77
|
-
|
|
78
|
-
|
|
79
24
|
def get_merchant_details() -> dict | None:
|
|
80
25
|
"""
|
|
81
26
|
Returns Authorizenet merchant details.
|
terminusgps/wialon/items/base.py
CHANGED
|
@@ -151,13 +151,23 @@ class WialonBase:
|
|
|
151
151
|
:type key: :py:obj:`str`
|
|
152
152
|
:param value: A string.
|
|
153
153
|
:type value: :py:obj:`str`
|
|
154
|
+
:raises ValueError: If the admin field key was longer than 128 characters.
|
|
155
|
+
:raises ValueError: If the admin field value was longer than 128 characters.
|
|
154
156
|
:raises WialonError: If something went wrong with a Wialon API call.
|
|
155
157
|
:returns: Nothing.
|
|
156
158
|
:rtype: :py:obj:`None`
|
|
157
159
|
|
|
158
160
|
"""
|
|
159
|
-
|
|
161
|
+
if len(key) > 128:
|
|
162
|
+
raise ValueError(
|
|
163
|
+
f"'key' cannot be greater than 128 characters in length, got {len(key)}."
|
|
164
|
+
)
|
|
165
|
+
if len(value) > 128:
|
|
166
|
+
raise ValueError(
|
|
167
|
+
f"'value' cannot be greater than 128 characters in length, got {len(value)}."
|
|
168
|
+
)
|
|
160
169
|
|
|
170
|
+
field_id: int | None = self._get_afield_id(key)
|
|
161
171
|
if field_id is not None:
|
|
162
172
|
self.session.wialon_api.item_update_admin_field(
|
|
163
173
|
**{
|
|
@@ -181,13 +191,23 @@ class WialonBase:
|
|
|
181
191
|
:type key: :py:obj:`str`
|
|
182
192
|
:param value: A string.
|
|
183
193
|
:type value: :py:obj:`str`
|
|
194
|
+
:raises ValueError: If the custom field key was longer than 128 characters.
|
|
195
|
+
:raises ValueError: If the custom field value was longer than 128 characters.
|
|
184
196
|
:raises WialonError: If something went wrong with a Wialon API call.
|
|
185
197
|
:returns: Nothing.
|
|
186
198
|
:rtype: :py:obj:`None`
|
|
187
199
|
|
|
188
200
|
"""
|
|
189
|
-
|
|
201
|
+
if len(key) > 128:
|
|
202
|
+
raise ValueError(
|
|
203
|
+
f"'key' cannot be greater than 128 characters in length, got {len(key)}."
|
|
204
|
+
)
|
|
205
|
+
if len(value) > 128:
|
|
206
|
+
raise ValueError(
|
|
207
|
+
f"'value' cannot be greater than 128 characters in length, got {len(value)}."
|
|
208
|
+
)
|
|
190
209
|
|
|
210
|
+
field_id: int | None = self._get_cfield_id(key)
|
|
191
211
|
if field_id is not None:
|
|
192
212
|
self.session.wialon_api.item_update_custom_field(
|
|
193
213
|
**{
|
|
@@ -9,6 +9,7 @@ class WialonResource(WialonBase):
|
|
|
9
9
|
"""A Wialon `resource/account <https://help.wialon.com/en/wialon-hosting/user-guide/management-system/accounts-and-resources>`_."""
|
|
10
10
|
|
|
11
11
|
def __init__(self, *args, **kwargs) -> None:
|
|
12
|
+
"""Sets :py:attr:`_is_account` to :py:obj:`None`."""
|
|
12
13
|
super().__init__(*args, **kwargs)
|
|
13
14
|
self._is_account = None
|
|
14
15
|
|
terminusgps/wialon/items/unit.py
CHANGED
|
@@ -11,6 +11,7 @@ class WialonUnit(WialonBase):
|
|
|
11
11
|
"""A Wialon `unit <https://help.wialon.com/en/wialon-hosting/user-guide/management-system/units>`_."""
|
|
12
12
|
|
|
13
13
|
def __init__(self, *args, **kwargs) -> None:
|
|
14
|
+
"""Sets :py:attr:`_imei_number`, :py:attr:`_active` and :py:attr:`_image_uri` to :py:obj:`None`."""
|
|
14
15
|
super().__init__(*args, **kwargs)
|
|
15
16
|
self._imei_number = None
|
|
16
17
|
self._active = None
|
terminusgps/wialon/utils.py
CHANGED
|
@@ -204,8 +204,6 @@ def get_unit_by_imei(imei: str, session: WialonSession) -> WialonUnit | None:
|
|
|
204
204
|
:param session: A valid Wialon API session.
|
|
205
205
|
:type session: :py:obj:`~terminusgps.wialon.session.WialonSession`
|
|
206
206
|
:raises ValueError: If ``imei`` contains non-digit characters.
|
|
207
|
-
:raises ValueError: If ``imei`` points to multiple Wialon units.
|
|
208
|
-
:raises WialonError: If something goes wrong during a Wialon API call.
|
|
209
207
|
:returns: A Wialon object id, if it was found.
|
|
210
208
|
:rtype: :py:obj:`str` | :py:obj:`None`
|
|
211
209
|
|
|
@@ -230,9 +228,7 @@ def get_unit_by_imei(imei: str, session: WialonSession) -> WialonUnit | None:
|
|
|
230
228
|
}
|
|
231
229
|
)
|
|
232
230
|
|
|
233
|
-
if results is not None and results.get("totalItemsCount", 0)
|
|
234
|
-
raise ValueError(f"Multiple units found with IMEI #: '{imei}'.")
|
|
235
|
-
elif results is not None and results.get("totalItemsCount", 0) == 1:
|
|
231
|
+
if results is not None and results.get("totalItemsCount", 0) == 1:
|
|
236
232
|
return WialonUnit(id=results["items"][0].get("id"), session=session)
|
|
237
233
|
|
|
238
234
|
|
|
File without changes
|
{python_terminusgps-36.9.0.dist-info → python_terminusgps-36.9.2.dist-info}/licenses/COPYING
RENAMED
|
File without changes
|