paddle-python-sdk 1.19.0__py3-none-any.whl → 1.19.1__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.
- paddle_billing/Client.py +1 -1
- paddle_billing/Resources/Products/Operations/ListProducts.py +8 -2
- {paddle_python_sdk-1.19.0.dist-info → paddle_python_sdk-1.19.1.dist-info}/METADATA +1 -1
- {paddle_python_sdk-1.19.0.dist-info → paddle_python_sdk-1.19.1.dist-info}/RECORD +8 -8
- tests/Functional/Resources/Products/test_ProductsClient.py +27 -1
- {paddle_python_sdk-1.19.0.dist-info → paddle_python_sdk-1.19.1.dist-info}/WHEEL +0 -0
- {paddle_python_sdk-1.19.0.dist-info → paddle_python_sdk-1.19.1.dist-info}/licenses/LICENSE +0 -0
- {paddle_python_sdk-1.19.0.dist-info → paddle_python_sdk-1.19.1.dist-info}/top_level.txt +0 -0
paddle_billing/Client.py
CHANGED
|
@@ -247,7 +247,7 @@ class Client:
|
|
|
247
247
|
"Authorization": f"Bearer {self.__api_key}",
|
|
248
248
|
"Content-Type": "application/json",
|
|
249
249
|
"Paddle-Version": str(self.use_api_version),
|
|
250
|
-
"User-Agent": "PaddleSDK/python 1.19.
|
|
250
|
+
"User-Agent": "PaddleSDK/python 1.19.1",
|
|
251
251
|
}
|
|
252
252
|
)
|
|
253
253
|
|
|
@@ -17,6 +17,10 @@ ProductIncludes = _ProductIncludes
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class ListProducts(HasParameters):
|
|
20
|
+
"""
|
|
21
|
+
Deprecated: `product_ids` is deprecated, use `ids` instead. It is merged into the `id` filter.
|
|
22
|
+
"""
|
|
23
|
+
|
|
20
24
|
def __init__(
|
|
21
25
|
self,
|
|
22
26
|
pager: Pager | None = None,
|
|
@@ -38,6 +42,7 @@ class ListProducts(HasParameters):
|
|
|
38
42
|
# Validation
|
|
39
43
|
validations: list[tuple[str, list[Any], type]] = [
|
|
40
44
|
("ids", self.ids, str),
|
|
45
|
+
("product_ids", self.product_ids, str),
|
|
41
46
|
("includes", self.includes, ProductIncludes),
|
|
42
47
|
("statuses", self.statuses, Status),
|
|
43
48
|
("tax_categories", self.tax_categories, TaxCategory),
|
|
@@ -54,8 +59,9 @@ class ListProducts(HasParameters):
|
|
|
54
59
|
parameters = {}
|
|
55
60
|
if self.pager:
|
|
56
61
|
parameters.update(self.pager.get_parameters())
|
|
57
|
-
|
|
58
|
-
|
|
62
|
+
ids = list(dict.fromkeys([*self.ids, *self.product_ids]))
|
|
63
|
+
if ids:
|
|
64
|
+
parameters["id"] = ",".join(ids)
|
|
59
65
|
if self.includes:
|
|
60
66
|
parameters["include"] = ",".join(map(enum_stringify, self.includes))
|
|
61
67
|
if self.statuses:
|
|
@@ -5,7 +5,7 @@ examples/event_polling.py,sha256=580dg_8CFrSCA89Mr1ny4V1gtB3-hk-LfePTbI7DT5w,217
|
|
|
5
5
|
examples/get_products.py,sha256=9jLvKZlWLCpyYEt3voWjy50961-Uhdr0JlWD34ILxeQ,2176
|
|
6
6
|
examples/logger.py,sha256=nt7COp_4ChaIP-dhJ4rGHmj981-N4O41FDFzI8VlAFc,1041
|
|
7
7
|
examples/webhook_verification.py,sha256=qkNscNdNZUAgxEIk83tCiljN2VmfePZ_k8zTliKz2QY,1205
|
|
8
|
-
paddle_billing/Client.py,sha256=
|
|
8
|
+
paddle_billing/Client.py,sha256=tSluMZY6v9cbv9CEyW1Knd5NMvVMSFrE9zcwKN9e80Y,12581
|
|
9
9
|
paddle_billing/EnumStringify.py,sha256=iDvKULZat3jx9A-_PhvoN6CbFGf2pyxrQeYZxqX9n8M,48
|
|
10
10
|
paddle_billing/Environment.py,sha256=3e53sNcXjV4Rfr3pC9mqNvkBPBEW_Xbu4hUVYWF7J1s,506
|
|
11
11
|
paddle_billing/FiltersNone.py,sha256=ErOjaTfxtELXrXdxUvFF9DJI_Yl31iseO4K56qTDR54,303
|
|
@@ -784,7 +784,7 @@ paddle_billing/Resources/PricingPreviews/Operations/__init__.py,sha256=Y7qNPI3MA
|
|
|
784
784
|
paddle_billing/Resources/Products/ProductsClient.py,sha256=40xe4DzkBXUdtZvmY3XqwZlETr5taa9G4K_4jZLeO8o,2856
|
|
785
785
|
paddle_billing/Resources/Products/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
786
786
|
paddle_billing/Resources/Products/Operations/CreateProduct.py,sha256=8Wb3XLQGtlfq6OLSD7hYXJ-PCSFh7RTZKvDYpLkoDWE,607
|
|
787
|
-
paddle_billing/Resources/Products/Operations/ListProducts.py,sha256=
|
|
787
|
+
paddle_billing/Resources/Products/Operations/ListProducts.py,sha256=k55aHpaXAOUPPgKP4Fk336eKnZXX4vZdKYa1yrMqgts,3177
|
|
788
788
|
paddle_billing/Resources/Products/Operations/UpdateProduct.py,sha256=oCQiTXVNyzewp_kglGj4Egb6ywdHT9-ggpFS8-OGAq0,726
|
|
789
789
|
paddle_billing/Resources/Products/Operations/__init__.py,sha256=pdO4Lige6stnCZeabiNPyGp5alHg1OBGzvPy4S8CnL0,620
|
|
790
790
|
paddle_billing/Resources/Products/Operations/List/Includes.py,sha256=2csOBO16QA3WrqLoziVmieN8MW1reIekL42N5OaQLEw,251
|
|
@@ -955,7 +955,7 @@ paddle_billing/Resources/Verifications/VerificationsClient.py,sha256=IIcxBVwa_WX
|
|
|
955
955
|
paddle_billing/Resources/Verifications/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
956
956
|
paddle_billing/Resources/Verifications/Operations/ListVerifications.py,sha256=x7L98i9lMNb1xRnC0mCNIsHHY5g5J3fswlIYKE7-XQY,1485
|
|
957
957
|
paddle_billing/Resources/Verifications/Operations/__init__.py,sha256=07Ir5TPNA8sOz0WTVH48fBClRW6XaIZW0-cPmGIpt28,119
|
|
958
|
-
paddle_python_sdk-1.19.
|
|
958
|
+
paddle_python_sdk-1.19.1.dist-info/licenses/LICENSE,sha256=e5Sn9mzCdpjnqCLxXpGHNKdYB6JlRSTLhN_CD4WSO6w,10770
|
|
959
959
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
960
960
|
tests/conftest.py,sha256=K_rWFm4jOBGVpoQP9llOwQwyYrXThbF3CBvood_hNRU,127
|
|
961
961
|
tests/Functional/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -1012,7 +1012,7 @@ tests/Functional/Resources/Prices/test_PricesClient.py,sha256=sx-oCO0w2OOYXQB2KO
|
|
|
1012
1012
|
tests/Functional/Resources/PricingPreviews/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1013
1013
|
tests/Functional/Resources/PricingPreviews/test_PricingPreviewsClient.py,sha256=MGmfdNlNJTqeVeZmq2jHcHLt2508srJDiULtsWC2phQ,4085
|
|
1014
1014
|
tests/Functional/Resources/Products/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1015
|
-
tests/Functional/Resources/Products/test_ProductsClient.py,sha256=
|
|
1015
|
+
tests/Functional/Resources/Products/test_ProductsClient.py,sha256=y1TNP-Wwbo_tp7SIjQ-pVLef9ES73xF3tHy-B0kMLYg,12596
|
|
1016
1016
|
tests/Functional/Resources/Reports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1017
1017
|
tests/Functional/Resources/Reports/test_ReportsClient.py,sha256=bv9hTMENg8n-M73pKNFEnfEouGeCHiunt9zppEEu3RM,18985
|
|
1018
1018
|
tests/Functional/Resources/Settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -1048,7 +1048,7 @@ tests/Utils/ReadsFixture.py,sha256=3CQ_8XHji3kuR28Ktlmw1Kip565UycocUytldWtuAyw,1
|
|
|
1048
1048
|
tests/Utils/TestClient.py,sha256=-wc7hJMuR6WC-ukw0c7I59b5-8hj_-nzq__-2M81elg,1453
|
|
1049
1049
|
tests/Utils/TestLogger.py,sha256=pFO9x711buRmg-8DAqpzIJP_hr21JPty1_ZQRcwoGKk,554
|
|
1050
1050
|
tests/Utils/__init__.py,sha256=JtqJNPKqbNZ9exlpXlF3yj_9cfylPGlvopjQYi7yYTA,37
|
|
1051
|
-
paddle_python_sdk-1.19.
|
|
1052
|
-
paddle_python_sdk-1.19.
|
|
1053
|
-
paddle_python_sdk-1.19.
|
|
1054
|
-
paddle_python_sdk-1.19.
|
|
1051
|
+
paddle_python_sdk-1.19.1.dist-info/METADATA,sha256=0nwkDgwXlCkALlww0DqUMz9QHRoNiJ8Vj_fkncTKJb8,9232
|
|
1052
|
+
paddle_python_sdk-1.19.1.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
1053
|
+
paddle_python_sdk-1.19.1.dist-info/top_level.txt,sha256=9a07VPng7o5wK8VAXkl6NC30xrNbW9zff_02jHyHi4c,30
|
|
1054
|
+
paddle_python_sdk-1.19.1.dist-info/RECORD,,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
from json import loads
|
|
2
|
-
from pytest import mark
|
|
2
|
+
from pytest import mark, raises
|
|
3
3
|
from urllib.parse import unquote
|
|
4
4
|
|
|
5
5
|
from paddle_billing.Entities.Collections import ProductCollection
|
|
6
6
|
from paddle_billing.Entities.Product import Product
|
|
7
7
|
from paddle_billing.Entities.Shared import CustomData, Status, TaxCategory
|
|
8
8
|
|
|
9
|
+
from paddle_billing.Exceptions.SdkExceptions.InvalidArgumentException import InvalidArgumentException
|
|
9
10
|
from paddle_billing.Resources.Products.Operations import CreateProduct, ListProducts, UpdateProduct, ProductIncludes
|
|
10
11
|
from paddle_billing.Resources.Shared.Operations import Pager
|
|
11
12
|
|
|
@@ -179,6 +180,24 @@ class TestProductsClient:
|
|
|
179
180
|
200,
|
|
180
181
|
"/products?id=pro_01gsz4s0w61y0pp88528f1wvvb,pro_01h1vjes1y163xfj1rh1tkfb65",
|
|
181
182
|
),
|
|
183
|
+
(
|
|
184
|
+
ListProducts(product_ids=["pro_01gsz4s0w61y0pp88528f1wvvb"]),
|
|
185
|
+
200,
|
|
186
|
+
"/products?id=pro_01gsz4s0w61y0pp88528f1wvvb",
|
|
187
|
+
),
|
|
188
|
+
(
|
|
189
|
+
ListProducts(ids=["pro_01gsz4s0w61y0pp88528f1wvvb"], product_ids=["pro_01h1vjes1y163xfj1rh1tkfb65"]),
|
|
190
|
+
200,
|
|
191
|
+
"/products?id=pro_01gsz4s0w61y0pp88528f1wvvb,pro_01h1vjes1y163xfj1rh1tkfb65",
|
|
192
|
+
),
|
|
193
|
+
(
|
|
194
|
+
ListProducts(
|
|
195
|
+
ids=["pro_01gsz4s0w61y0pp88528f1wvvb", "pro_01h1vjes1y163xfj1rh1tkfb65"],
|
|
196
|
+
product_ids=["pro_01h1vjes1y163xfj1rh1tkfb65", "pro_01gsz4s0w61y0pp88528f1wvvb", "pro_02new"],
|
|
197
|
+
),
|
|
198
|
+
200,
|
|
199
|
+
"/products?id=pro_01gsz4s0w61y0pp88528f1wvvb,pro_01h1vjes1y163xfj1rh1tkfb65,pro_02new",
|
|
200
|
+
),
|
|
182
201
|
(
|
|
183
202
|
ListProducts(tax_categories=[TaxCategory.DigitalGoods, TaxCategory.Standard]),
|
|
184
203
|
200,
|
|
@@ -193,6 +212,9 @@ class TestProductsClient:
|
|
|
193
212
|
"List products filtered by status",
|
|
194
213
|
"List products filtered by id",
|
|
195
214
|
"List products filtered by multiple ids",
|
|
215
|
+
"List products filtered by product_ids",
|
|
216
|
+
"List products filtered by ids and product_ids",
|
|
217
|
+
"List products merges duplicate ids and product_ids preserving order",
|
|
196
218
|
"List products filtered by tax categories",
|
|
197
219
|
"List products with includes",
|
|
198
220
|
],
|
|
@@ -219,6 +241,10 @@ class TestProductsClient:
|
|
|
219
241
|
unquote(last_request.url) == expected_url
|
|
220
242
|
), "The URL does not match the expected URL, verify the query string is correct"
|
|
221
243
|
|
|
244
|
+
def test_list_products_rejects_non_string_product_ids(self):
|
|
245
|
+
with raises(InvalidArgumentException):
|
|
246
|
+
ListProducts(product_ids=[123]) # type: ignore[list-item]
|
|
247
|
+
|
|
222
248
|
@mark.parametrize(
|
|
223
249
|
"product_id, includes, expected_response_status, expected_response_body, expected_url",
|
|
224
250
|
[
|
|
File without changes
|
|
File without changes
|
|
File without changes
|