mpt-extension-sdk 5.14.0__py3-none-any.whl → 5.15__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.
@@ -35,9 +35,8 @@ def _paginated(mpt_client, url, limit=10):
35
35
  @wrap_mpt_http_error
36
36
  def get_agreement(mpt_client, agreement_id):
37
37
  """Retrieve an agreement by ID."""
38
- response = mpt_client.get(
39
- f"/commerce/agreements/{agreement_id}?select=seller,buyer,listing,product,subscriptions"
40
- )
38
+ query = "select=seller,buyer,listing,product,subscriptions,assets,lines,parameters"
39
+ response = mpt_client.get(f"/commerce/agreements/{agreement_id}?{query}")
41
40
  response.raise_for_status()
42
41
  return response.json()
43
42
 
@@ -241,16 +240,17 @@ def get_product_template_or_default(mpt_client, product_id, status, name=None):
241
240
  response = mpt_client.get(url)
242
241
  response.raise_for_status()
243
242
  templates = response.json()
244
- return templates["data"][0]
243
+ return templates["data"][0] if templates["data"] else None
245
244
 
246
245
 
246
+ @wrap_mpt_http_error
247
247
  def get_template_by_name(mpt_client, product_id, template_name):
248
248
  """Retrieve a product template by name."""
249
249
  url = f"/catalog/products/{product_id}/templates?eq(name,{template_name})"
250
250
  response = mpt_client.get(url)
251
251
  response.raise_for_status()
252
252
  templates = response.json()
253
- return templates["data"][0]
253
+ return templates["data"][0] if templates["data"] else None
254
254
 
255
255
 
256
256
  @wrap_mpt_http_error
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mpt-extension-sdk
3
- Version: 5.14.0
3
+ Version: 5.15
4
4
  Summary: Extensions SDK for SoftwareONE Marketplace Platform
5
5
  Author: SoftwareOne AG
6
6
  License: Apache-2.0 license
@@ -16,7 +16,7 @@ mpt_extension_sdk/key_vault/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMp
16
16
  mpt_extension_sdk/key_vault/base.py,sha256=OnlBEhof_NMRToPQUO4Nrq-dnT_FPxr5FuSn3CRBQF0,3869
17
17
  mpt_extension_sdk/mpt_http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  mpt_extension_sdk/mpt_http/base.py,sha256=PbaicrynWLo-plMNC7urIO_iAR5u97tgYrPxrpTn5mI,1514
19
- mpt_extension_sdk/mpt_http/mpt.py,sha256=diHS02_boyQh70V_L4ZRSvFMDdFsin2--5bqgYtU6U8,17640
19
+ mpt_extension_sdk/mpt_http/mpt.py,sha256=adqG6eFQ2xw-TnXKYxSB3BGKiAPwlJEf3KCdLBXWHYY,17755
20
20
  mpt_extension_sdk/mpt_http/utils.py,sha256=Ek2D4efcJNhQlOyXd4ZeBhwqDjFpvcbBEqxuCqRQ7cU,166
21
21
  mpt_extension_sdk/mpt_http/wrap_http_error.py,sha256=bFaIH-VG1laWlVqnOudzKsJgKItJLI4D56phn5xGQdw,2148
22
22
  mpt_extension_sdk/runtime/__init__.py,sha256=YY7ChHKTXXv0a6_PG1F4pVASDzleSWMv_Zf7uX0UDyc,244
@@ -47,8 +47,8 @@ mpt_extension_sdk/runtime/events/utils.py,sha256=GybK8Qs9Xj03Qqm98ulKeZzPiz92L-G
47
47
  mpt_extension_sdk/swo_rql/__init__.py,sha256=QrvRDYhpK-Pd3OF-U2aMeazuKm_kbvXwLRIjd9Mm6ok,104
48
48
  mpt_extension_sdk/swo_rql/constants.py,sha256=39BZ78OzdU_dIQtoy-Z_5utXqEXRweIFvM9Zfxg9j5M,171
49
49
  mpt_extension_sdk/swo_rql/query_builder.py,sha256=CG1dm7uJNPPCwWcf9sRD5zLbz-dtgECkQ_pX4QXpJPw,10825
50
- mpt_extension_sdk-5.14.0.dist-info/METADATA,sha256=xIdXDFve1amIo0eaeZHYz5ciZiZ7UrcSXHjKoMMqK1Q,1359
51
- mpt_extension_sdk-5.14.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
52
- mpt_extension_sdk-5.14.0.dist-info/entry_points.txt,sha256=N8T9gBssEOm_UeBf9ABbGqtlnethrumfMoL4hNYWVFA,146
53
- mpt_extension_sdk-5.14.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
54
- mpt_extension_sdk-5.14.0.dist-info/RECORD,,
50
+ mpt_extension_sdk-5.15.dist-info/METADATA,sha256=pW0Jy1BmZBBPkA9NVwTbzyoPORw-ruqSFHHSk7Bq_1k,1357
51
+ mpt_extension_sdk-5.15.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
52
+ mpt_extension_sdk-5.15.dist-info/entry_points.txt,sha256=N8T9gBssEOm_UeBf9ABbGqtlnethrumfMoL4hNYWVFA,146
53
+ mpt_extension_sdk-5.15.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
54
+ mpt_extension_sdk-5.15.dist-info/RECORD,,