python-terminusgps 28.5.1__py3-none-any.whl → 28.6.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: 28.5.1
3
+ Version: 28.6.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
@@ -9,7 +9,7 @@ terminusgps/authorizenet/profiles/addresses.py,sha256=7yrOrb9kIsiiazgWbeH8v_YUBi
9
9
  terminusgps/authorizenet/profiles/base.py,sha256=TOUHr22QRQBLErdysOkfcpJBusTjrUTqOmWEyNvMacA,2240
10
10
  terminusgps/authorizenet/profiles/customers.py,sha256=-F8IsQEn2CyHpfxyVZjKayHSuVe4ENNUj_ck7SE8LO0,8568
11
11
  terminusgps/authorizenet/profiles/payments.py,sha256=ohhZrs9MB7GkCi7jQvPVvELNKnR9BwzMd607jJmT4n4,11316
12
- terminusgps/authorizenet/profiles/subscriptions.py,sha256=eg64XiDg37Lv9J0lyYMCbj9WHNcYqztahPuChlvyCTs,12607
12
+ terminusgps/authorizenet/profiles/subscriptions.py,sha256=MtinTBTtbCmzYcE30emF_Dvd1BkEp_koZf89K11Dwnw,13113
13
13
  terminusgps/aws/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  terminusgps/aws/connect.py,sha256=TWf2bVz6LqSNQfVD7FKRn3K71VuLOwBj05Gs-9BsROg,693
15
15
  terminusgps/aws/secrets.py,sha256=MxQEmmBLpMUQ2tYAsHdCYf-7RZ84LiogdKcTsACX5dw,361
@@ -30,7 +30,7 @@ terminusgps/wialon/items/route.py,sha256=8SzlqNmpYVdt-ZAY--B_KHoDIHgN0Zb7KBsBWAz
30
30
  terminusgps/wialon/items/unit.py,sha256=i7sQiRu3N0XxyTHVN2RnmjYy9X48KdnZLSB18ic37w8,9363
31
31
  terminusgps/wialon/items/unit_group.py,sha256=YsYh34l2DjSKcv5SIZkEVi5FSjveGB1gxU2fwdLyvl4,4101
32
32
  terminusgps/wialon/items/user.py,sha256=PFYBie04F16YE2B5364PLxkmlTmQr4sZXpItvRBxsDc,7143
33
- python_terminusgps-28.5.1.dist-info/METADATA,sha256=NjEa3mini_ON-oFC-sFa0gQ5IJ5yjwUkNGwZR_1otY4,946
34
- python_terminusgps-28.5.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
35
- python_terminusgps-28.5.1.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
36
- python_terminusgps-28.5.1.dist-info/RECORD,,
33
+ python_terminusgps-28.6.0.dist-info/METADATA,sha256=yVsNBGbxWlPjLRFo7I7rjfmVGSQqXi2NsCynF2okGx4,946
34
+ python_terminusgps-28.6.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
35
+ python_terminusgps-28.6.0.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
36
+ python_terminusgps-28.6.0.dist-info/RECORD,,
@@ -91,52 +91,60 @@ class SubscriptionProfile(ControllerExecutionMixin):
91
91
 
92
92
  def update(
93
93
  self,
94
- name: str,
95
- amount: decimal.Decimal,
96
- profile_id: int | str,
97
- payment_id: int | str,
98
- address_id: int | str,
94
+ name: str | None = None,
95
+ amount: decimal.Decimal | None = None,
96
+ profile_id: int | str | None = None,
97
+ payment_id: int | str | None = None,
98
+ address_id: int | str | None = None,
99
99
  ) -> None:
100
100
  """
101
101
  Updates a subscription in Authorizenet.
102
102
 
103
103
  :param name: A name for the subscription.
104
- :type name: :py:obj:`str`
104
+ :type name: :py:obj:`str` | :py:obj:`None`
105
105
  :param amount: An amount of money paid per occurrence of the subscription.
106
- :type amount: :py:obj:`~decimal.Decimal`
106
+ :type amount: :py:obj:`~decimal.Decimal` | :py:obj:`None`
107
107
  :param profile_id: An Authorizenet customer profile id.
108
- :type profile_id: :py:obj:`int` | :py:obj:`str`
108
+ :type profile_id: :py:obj:`int` | :py:obj:`str` | :py:obj:`None`
109
109
  :param payment_id: An Authorizenet customer payment profile id.
110
- :type payment_id: :py:obj:`int` | :py:obj:`str`
110
+ :type payment_id: :py:obj:`int` | :py:obj:`str` | :py:obj:`None`
111
111
  :param address_id: An Authorizenet customer address profile id.
112
- :type address_id: :py:obj:`int` | :py:obj:`str`
112
+ :type address_id: :py:obj:`int` | :py:obj:`str` | :py:obj:`None`
113
113
  :raises ControllerExecutionError: If something goes wrong during an Authorizenet API call.
114
- :raises ValueError: If ``profile_id`` wasn't a digit.
115
- :raises ValueError: If ``payment_id`` wasn't a digit.
116
- :raises ValueError: If ``address_id`` wasn't a digit.
117
- :raises ValueError: If the Authorizenet API response was not retrieved.
118
- :returns: An Authorizenet subscription id.
119
- :rtype: :py:obj:`int`
114
+ :raises ValueError: If no arguments were provided.
115
+ :raises ValueError: If ``profile_id`` was provided but wasn't a digit.
116
+ :raises ValueError: If ``payment_id`` was provided but wasn't a digit.
117
+ :raises ValueError: If ``address_id`` was provided but wasn't a digit.
118
+ :returns: Nothing.
119
+ :rtype: :py:obj:`None`
120
120
 
121
121
  """
122
- if isinstance(profile_id, str) and not profile_id.isdigit():
122
+ if not any([name, amount, profile_id, payment_id, address_id]):
123
+ raise ValueError("At least one argument is required.")
124
+ if profile_id and isinstance(profile_id, str) and not profile_id.isdigit():
123
125
  raise ValueError(f"'profile_id' must be a digit, got '{profile_id}'.")
124
- if isinstance(payment_id, str) and not payment_id.isdigit():
126
+ if payment_id and isinstance(payment_id, str) and not payment_id.isdigit():
125
127
  raise ValueError(f"'payment_id' must be a digit, got '{payment_id}'.")
126
- if isinstance(address_id, str) and not address_id.isdigit():
128
+ if address_id and isinstance(address_id, str) and not address_id.isdigit():
127
129
  raise ValueError(f"'address_id' must be a digit, got '{address_id}'.")
128
130
 
129
131
  subscription: apicontractsv1.ARBSubscriptionType = (
130
- apicontractsv1.ARBSubscriptionType(
131
- name=name,
132
- amount=amount,
133
- profile=apicontractsv1.customerProfileIdType(
134
- customerProfileId=str(profile_id),
135
- customerPaymentProfileId=str(payment_id),
136
- customerAddressId=str(address_id),
137
- ),
138
- )
132
+ apicontractsv1.ARBSubscriptionType()
139
133
  )
134
+
135
+ if name:
136
+ subscription.name = name
137
+ if amount:
138
+ subscription.amount = amount
139
+ if any([profile_id, payment_id, address_id]):
140
+ profile = apicontractsv1.customerProfileIdType()
141
+ if profile_id:
142
+ profile.customerProfileId = profile_id
143
+ if payment_id:
144
+ profile.customerPaymentProfileId = payment_id
145
+ if address_id:
146
+ profile.customerAddressId = address_id
147
+
140
148
  self._authorizenet_update_subscription(subscription)
141
149
 
142
150
  @property