@@ -475,7 +475,7 @@ def update_target(
475
475
width : Optional [Union [int , float ]] = None ,
476
476
image : Optional [io .BytesIO ] = None ,
477
477
active_flag : Optional [bool ] = None ,
478
- application_metadata : Optional [bytes ] = None ,
478
+ application_metadata : Optional [str ] = None ,
479
479
) -> None :
480
480
"""
481
481
Add a target to a Vuforia Web Services database.
@@ -491,8 +491,11 @@ def update_target(
491
491
image: The image of the target.
492
492
active_flag: Whether or not the target is active for query.
493
493
application_metadata: The application metadata of the target.
494
- This will be base64 encoded. Giving ``None`` will not change
495
- the application metadata.
494
+ This must be base64 encoded, for example by using::
495
+
496
+ base64.b64encode('input_string').decode('ascii')
497
+
498
+ Giving ``None`` will not change the application metadata.
496
499
497
500
Raises:
498
501
~vws.exceptions.AuthenticationFailure: The secret key is not
@@ -528,9 +531,7 @@ def update_target(
528
531
data ['active_flag' ] = active_flag
529
532
530
533
if application_metadata is not None :
531
- metadata_encoded_str = base64 .b64encode (application_metadata )
532
- metadata_encoded = metadata_encoded_str .decode ('ascii' )
533
- data ['application_metadata' ] = metadata_encoded
534
+ data ['application_metadata' ] = application_metadata
534
535
535
536
content = bytes (json .dumps (data ), encoding = 'utf-8' )
536
537
0 commit comments