-
Notifications
You must be signed in to change notification settings - Fork 1
/
examples.py
196 lines (126 loc) · 3.98 KB
/
examples.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
#!/usr/bin/env python
import datetime
from identixone.api import Client
from identixone.base.choices import (
Conf, NotificationHTTPMethod, NotificationTransport)
token = 'token'
client = Client(token=token, version=1)
def sources_list():
r = client.sources.list()
print(r.json())
def sources_get():
r = client.sources.get(source_id=1)
print(r.json())
def sources_create():
r = client.sources.create(name='source_name')
print(r.json())
def sources_update():
r = client.sources.update(source_id=1, name='source_name')
print(r.json())
def sources_delete():
r = client.sources.delete(source_id=1)
print(r.status_code)
def utility_asm(photo):
r = client.utility.asm(photo=photo)
print(r.json())
def utility_liveness(photo):
r = client.utility.liveness(photo=photo)
print(r.json())
def utility_compare(photo1, photo2):
r = client.utility.compare(
photo1, photo2,
liveness_photo1=False, liveness_photo2=False,
conf=Conf.JUNK)
print(r.json())
def utility_customer():
r = client.utility.customer('source_name', offset=10)
print(r.json())
def persons_create(photo):
r = client.persons.create(photo=photo, source='source_name')
print(r.json())
def persons_search(photo):
r = client.persons.search(photo=photo)
print(r.json())
def persons_reinit_image(photo):
r = client.persons.reinit_image(
idxid='idxid', photo=photo,
source='source_name', conf=Conf.EXACT)
print(r.json())
def persons_reinit_id():
r = client.persons.reinit_id(id=1)
print(r.json())
def persons_entry():
r = client.persons.entry(id=1)
print(r.json())
def persons_delete():
r = client.persons.delete(idxid='idxid')
print(r.json())
def get_token():
r = client.users.get_token(token)
print(r.json())
def update_token():
r = client.users.update_token(token, is_active=True)
print(r.json())
r = client.users.update_token(token, is_active=False)
print(r.json())
def delete_token():
r = client.users.delete_token(token)
print(r.json())
def bulk_delete_tokens():
r = client.users.bulk_delete()
print(r.status_code)
def bulk_delete_permanent_tokens():
r = client.users.bulk_delete(permanent=True)
print(r.status_code)
def bulk_delete_temporary_tokens():
r = client.users.bulk_delete(permanent=False)
print(r.status_code)
def auth_create_token():
r = client.auth.create_token()
print(r.json())
def auth_create_permanent_token():
r = client.auth.create_permanent_token()
print(r.json())
def list_notifications():
r = client.notifications.list()
print(r.json())
def delete_notifications():
r = client.notifications.delete(notification_id=1)
print(r.status_code)
def create_notifications():
r = client.notifications.create(
name='exact_and_ha', is_active=True,
transport=NotificationTransport.WEBHOOK,
http_method=NotificationHTTPMethod.POST,
conf_thresholds=[Conf.EXACT, Conf.HA])
print(r.json())
def update_notifications():
r = client.notifications.update(notification_id=1, name='hello')
print(r.json())
def create_token():
r = client.auth.create_token(permanent=True)
print(r.json())
def users_me():
r = client.users.me()
print(r.json())
def users_change_password():
r = client.users.change_password('pwd', 'pwd', reset_tokens=False)
print(r.json())
def users_list_tokens():
r = client.users.list_tokens(permanent=True)
print(r.json())
r = client.users.list_tokens(permanent=False)
print(r.json())
r = client.users.list_tokens()
print(r.json())
def users_get_token():
r = client.users.get_token(token, permanent=True)
print(r.json())
def users_update_token():
r = client.users.update_token(token, is_active=False)
print(r.json())
r = client.users.update_token(token, is_active=True)
print(r.json())
def users_delete_token():
r = client.users.delete_token(token)
print(r.json())