Skip to content

Commit 18398be

Browse files
committed
feat: added GetHostProductMetadata
1 parent 3647c0f commit 18398be

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

cryptlex/lexfloatclient/lexfloatclient.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,29 @@ def GetHostFeatureEntitlement(feature_name):
353353
else:
354354
raise LexFloatClientException(status)
355355

356+
@staticmethod
357+
def GetHostProductMetadata(key):
358+
"""Get the value of the product metadata field associated with the
359+
product metadata key.
360+
361+
Args:
362+
key (str): metadata key to retrieve the value
363+
364+
Raises:
365+
LexFloatClientException
366+
367+
Returns:
368+
str: value of metadata for the key
369+
"""
370+
cstring_key = LexFloatClientNative.get_ctype_string(key)
371+
buffer_size = 4096
372+
buffer = LexFloatClientNative.get_ctype_string_buffer(buffer_size)
373+
status = LexFloatClientNative.GetHostProductMetadata(
374+
cstring_key, buffer, buffer_size)
375+
if status != LexFloatStatusCodes.LF_OK:
376+
raise LexFloatClientException(status)
377+
return LexFloatClientNative.byte_to_string(buffer.value)
378+
356379
@staticmethod
357380
def GetHostLicenseMetadata(key):
358381
"""Get the value of the license metadata field associated with the

cryptlex/lexfloatclient/lexfloatclient_native.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ def byte_to_string(input):
171171
GetHostFeatureEntitlement.argtypes = [CSTRTYPE, STRTYPE, c_uint32]
172172
GetHostFeatureEntitlement.restype = c_int
173173

174+
GetHostProductMetadata = library.GetHostProductMetadata
175+
GetHostProductMetadata.argtypes = [CSTRTYPE, STRTYPE, c_uint32]
176+
GetHostProductMetadata.restype = c_int
177+
174178
GetHostLicenseMetadata = library.GetHostLicenseMetadata
175179
GetHostLicenseMetadata.argtypes = [CSTRTYPE, STRTYPE, c_uint32]
176180
GetHostLicenseMetadata.restype = c_int

0 commit comments

Comments
 (0)