diff --git a/cryptlex/lexactivator/lexactivator.py b/cryptlex/lexactivator/lexactivator.py index aab049f..e68be75 100644 --- a/cryptlex/lexactivator/lexactivator.py +++ b/cryptlex/lexactivator/lexactivator.py @@ -45,12 +45,18 @@ def __init__(self, address_line1, address_line2, city, state, country, postal_co self.country = country self.postal_code = postal_code +class Metadata(object): + def __init__(self, metadata_dict): + self.key = metadata_dict.get("key") + self.value = metadata_dict.get("value") + class UserLicense(object): - def __init__(self, user_license): - self.allowed_activations = user_license.get("allowedActivations") - self.allowed_deactivations = user_license.get("allowedDeactivations") - self.key = user_license.get("key") - self.type = user_license.get("type") + def __init__(self, user_license_dict): + self.allowed_activations = user_license_dict.get("allowedActivations") + self.allowed_deactivations = user_license_dict.get("allowedDeactivations") + self.key = user_license_dict.get("key") + self.type = user_license_dict.get("type") + self.metadata = [Metadata(metadata_dict) for metadata_dict in user_license_dict.get("metadata", [])] class LexActivator: @staticmethod