-
Notifications
You must be signed in to change notification settings - Fork 1
/
update_event_example.py
37 lines (28 loc) · 1.15 KB
/
update_event_example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import os
import argparse
import fingerprint_pro_server_api_sdk
from fingerprint_pro_server_api_sdk.rest import ApiException
from fingerprint_pro_server_api_sdk.models import EventsUpdateRequest
from dotenv import load_dotenv
load_dotenv()
parser = argparse.ArgumentParser(description='Update an event in the Fingerprint Pro Server API')
parser.add_argument('--linked_id', type=str)
parser.add_argument('--tag', type=str)
parser.add_argument('--suspect', type=bool)
args = parser.parse_args()
print(f'args: {args.linked_id}, {args.tag}, {args.suspect}')
# configure
configuration = fingerprint_pro_server_api_sdk.Configuration(
api_key=os.environ["PRIVATE_KEY"], region=os.environ.get("REGION", "us"))
# create an instance of the API class
api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration)
request_id = os.environ["REQUEST_ID_TO_UPDATE"]
try:
updateBody = EventsUpdateRequest(**vars(args))
print(f'updateBody: {updateBody}')
api_instance.update_event(updateBody, request_id)
except ApiException as e:
print("Exception when calling DefaultApi->update_event: %s\n" % e)
exit(1)
print("Visitor data updated!")
exit(0)