Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Muneeb/add metadata user licenses #43

Merged
merged 5 commits into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions cryptlex/lexactivator/lexactivator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down