Skip to content

Commit d3abae3

Browse files
Added a few missing methods and properties
1 parent 42da915 commit d3abae3

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

CHANGES.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# Connect SDK Changes History
22

3+
## v17.3
4+
5+
* HTTP timeout request to Connect platform should be not less than 300 seconds.
6+
* Accept Usage File is sending wrong parameter in post request.
7+
* Usage processor filter "product__id" is not filtering by product id.
8+
9+
## v17.2
10+
11+
* external_id is sometimes returned as an integer by Connect API, which breaks Python SDK parsing.
12+
13+
## v17.1
14+
15+
* Add custom loggers to the automation classes, that automatically add relevant info of the request being processed. Legacy global logger still working in order to have a context-independent logger.
16+
* Get product templates and configuration params.
17+
* Put each model in its own Python file, to reduce the chance of having circular references on imports.
18+
* Tier requests are not filtering by product id by default.
19+
* Fulfillment assignee not receiving the right type.
20+
321
## v17.0
422

523
* Fixed bugs when listing and working with usage files.

connect/models/asset.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ class Asset(BaseModel):
5757
- suspended: Asset becomes suspended once 'suspend' request type is fulfilled.
5858
"""
5959

60+
events = None # type: Events
61+
""" (:py:class:`.Events`) Events occurred on this asset. """
62+
6063
external_id = None # type: str
6164
""" (str) Identification for asset object on eCommerce. """
6265

connect/models/schemas.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ def make_object(self, data):
536536
class AssetSchema(BaseSchema):
537537
status = fields.Str()
538538
external_id = ExternalIdField()
539+
events = fields.Nested(EventsSchema, allow_none=True)
539540
external_uid = fields.Str(allow_none=True)
540541
external_name = fields.Str(allow_none=True)
541542
product = fields.Nested(ProductSchema, only=('id', 'name'))

connect/models/tier_config.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@
1717
from .tier_account import TierAccount
1818
from .schemas import TierConfigSchema
1919

20+
def get_param_by_id(self, param_id):
21+
"""
22+
:param str param_id: Id of the parameter.
23+
:return: A Param by ID, or None if it was not found.
24+
:rtype: Param
25+
"""
26+
try:
27+
return list(filter(lambda p: p.id == param_id, self.params))[0]
28+
except IndexError:
29+
return None
30+
2031

2132
class TierConfig(BaseModel):
2233
""" Full representation of Tier object. """

0 commit comments

Comments
 (0)