python-terminusgps 34.0.0__py3-none-any.whl → 34.1.0__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-terminusgps
3
- Version: 34.0.0
3
+ Version: 34.1.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://docs.terminusgps.com
6
6
  Project-URL: Repository, https://github.com/terminusgps/python-terminusgps
@@ -15,7 +15,7 @@ terminusgps/authorizenet/tests/test_auth.py,sha256=sdByYrcv8RKjcJckOHbyHH1z_M4qr
15
15
  terminusgps/authorizenet/tests/test_profiles.py,sha256=tvLBY0iSAC33RlWiBP_NSnPskUQBjfrf0YHMpR-m22k,7566
16
16
  terminusgps/authorizenet/tests/test_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  terminusgps/aws/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
- terminusgps/aws/notifications.py,sha256=N5p9EqN4wqBRJAMEFOjyseVatpwsxlB0QrHyqFDK5SI,5698
18
+ terminusgps/aws/notifications.py,sha256=tYU1VMmkq9Bg0CBCirVtUcNBLNkl5XnCBwzQgYIlDQU,5836
19
19
  terminusgps/aws/secrets.py,sha256=MxQEmmBLpMUQ2tYAsHdCYf-7RZ84LiogdKcTsACX5dw,361
20
20
  terminusgps/aws/utils.py,sha256=68GWcllu4h41qzFiKdUkWOAA4LDsTPqRY446VRMxYsY,116
21
21
  terminusgps/aws/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -26,7 +26,7 @@ terminusgps/django/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
26
26
  terminusgps/django/mixins.py,sha256=Q9ZJuzpk3d9lDnlVA8ZTVvnZWxB13p08EQ8yVJcztn4,1034
27
27
  terminusgps/django/settings.py,sha256=yJIcBE0xjY60AXF_gonY5hS3ofseqPW2k9uSoELgoho,639
28
28
  terminusgps/django/utils.py,sha256=SYDQyHA5tTuVwdpZGsCtf0LpTTD0ilRKoxa8StfSTpQ,156
29
- terminusgps/django/validators.py,sha256=dnENfniiHRJjZhQQ76dIcjfwuq-mkjQahKegZYgmryc,3342
29
+ terminusgps/django/validators.py,sha256=Gx-bpWkfI0fM4WXVRUpoC2ihPqs7agjdHAFO6gralCs,3341
30
30
  terminusgps/django/forms/__init__.py,sha256=hh8Z9AC_u2m2bu3h6sdmPyndfQneCEVovENPHmoTDC0,21
31
31
  terminusgps/django/forms/fields.py,sha256=BfuPzOZyGvWsEzONW2h4i01fhoL0IS0-gDdBKW4jHgI,2225
32
32
  terminusgps/django/forms/forms.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -54,7 +54,7 @@ terminusgps/wialon/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
54
54
  terminusgps/wialon/tests/test_items.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
55
  terminusgps/wialon/tests/test_session.py,sha256=9mBlYchMo9NeqRIZsmxYzrM1zBHorqu4ooxqSNppLpI,1336
56
56
  terminusgps/wialon/tests/test_utils.py,sha256=SK4PxJQGECFnzx_EQeRAQfsQ5_3FLaVcis2W9u_ibuI,1730
57
- python_terminusgps-34.0.0.dist-info/METADATA,sha256=OLumu5xwbGDw-7yR3niZdmytYWiKwS80xQMazYTcy5g,1616
58
- python_terminusgps-34.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
59
- python_terminusgps-34.0.0.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
60
- python_terminusgps-34.0.0.dist-info/RECORD,,
57
+ python_terminusgps-34.1.0.dist-info/METADATA,sha256=rSD4YC5vTMvT3ML8Yi9sM5zVFSQU5NJI_Y9kR8nIgyA,1616
58
+ python_terminusgps-34.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
59
+ python_terminusgps-34.1.0.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
60
+ python_terminusgps-34.1.0.dist-info/RECORD,,
@@ -99,12 +99,7 @@ class AsyncNotificationManager:
99
99
 
100
100
  """
101
101
  await asyncio.gather(
102
- *[
103
- self.send_push(
104
- target_arn=arn, message=message, message_id=str(uuid.uuid4())
105
- )
106
- for arn in target_arns
107
- ]
102
+ *[self.send_push(target_arn=arn, message=message) for arn in target_arns]
108
103
  )
109
104
 
110
105
  async def send_sms_batch(self, to_numbers: Sequence[str], message: str) -> None:
@@ -124,15 +119,12 @@ class AsyncNotificationManager:
124
119
  validate_e164_phone_number(to_number)
125
120
 
126
121
  await asyncio.gather(
127
- *[
128
- self.send_sms(
129
- to_number=num, message=message, message_id=str(uuid.uuid4())
130
- )
131
- for num in to_numbers
132
- ]
122
+ *[self.send_sms(to_number=num, message=message) for num in to_numbers]
133
123
  )
134
124
 
135
- async def send_sms(self, to_number: str, message: str, message_id: str) -> None:
125
+ async def send_sms(
126
+ self, to_number: str, message: str, message_id: str | None = None
127
+ ) -> None:
136
128
  """
137
129
  Sends an sms to ``to_number``.
138
130
 
@@ -140,8 +132,8 @@ class AsyncNotificationManager:
140
132
  :type to_number: :py:obj:`str`
141
133
  :param message: A message body.
142
134
  :type message: :py:obj:`str`
143
- :param message_id: A message deduplication id.
144
- :type message_id: :py:obj:`str`
135
+ :param message_id: A message deduplication id. :py:func:`~uuid.uuid4` is used if ``message_id`` was not provided.
136
+ :type message_id: :py:obj:`str` | :py:obj:`None`
145
137
  :raises ValidationError: If ``to_number`` wasn't a valid E.164 formatted phone number.
146
138
  :returns: Nothing.
147
139
  :rtype: :py:obj:`None`
@@ -149,6 +141,9 @@ class AsyncNotificationManager:
149
141
  """
150
142
  validate_e164_phone_number(to_number)
151
143
 
144
+ if not message_id:
145
+ message_id = str(uuid.uuid4())
146
+
152
147
  await self._sns_client.publish(
153
148
  **{
154
149
  "PhoneNumber": to_number,
@@ -158,7 +153,9 @@ class AsyncNotificationManager:
158
153
  }
159
154
  )
160
155
 
161
- async def send_push(self, target_arn: str, message: str, message_id: str) -> None:
156
+ async def send_push(
157
+ self, target_arn: str, message: str, message_id: str | None = None
158
+ ) -> None:
162
159
  """
163
160
  Sends a push notification to ``target_arn``.
164
161
 
@@ -166,12 +163,15 @@ class AsyncNotificationManager:
166
163
  :type target_arn: :py:obj:`str`
167
164
  :param message: A message body.
168
165
  :type message: :py:obj:`str`
169
- :param message_id: A message deduplication id.
170
- :type message_id: :py:obj:`str`
166
+ :param message_id: A message deduplication id. :py:func:`~uuid.uuid4` is used if ``message_id`` was not provided.
167
+ :type message_id: :py:obj:`str` | :py:obj:`None`
171
168
  :returns: Nothing.
172
169
  :rtype: :py:obj:`None`
173
170
 
174
171
  """
172
+ if not message_id:
173
+ message_id = str(uuid.uuid4())
174
+
175
175
  await self._sns_client.publish(
176
176
  **{
177
177
  "TargetArn": target_arn,
@@ -5,7 +5,7 @@ VALID_COUNTRY_CODES = ("+1", "+52")
5
5
 
6
6
 
7
7
  def validate_e164_phone_number(value: str) -> None:
8
- """Raises :py:exec:`~django.core.exceptions.ValidationError` if the value is not a valid `E.164 <https://en.wikipedia.org/wiki/E.164>`_ formatted phone number."""
8
+ """Raises :py:exc:`~django.core.exceptions.ValidationError` if the value is not a valid `E.164 <https://en.wikipedia.org/wiki/E.164>`_ formatted phone number."""
9
9
  if not value.startswith("+"):
10
10
  raise ValidationError(
11
11
  _("E.164 phone number must begin with a '+', got '%(char)s'."),