Skip to content

Commit 02b44d1

Browse files
committed
light_webhook: new webhook object
Signed-off-by: Victor Lee <victorlee0505@gmail.com>
1 parent f5e262a commit 02b44d1

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import json
2+
from aries_cloudagent.messaging.models.base_record import BaseExchangeRecord
3+
4+
5+
class LightWeightWebhook:
6+
__acceptable_keys_list = [
7+
"connection_id",
8+
"credential_exchange_id",
9+
"cred_ex_id",
10+
"cred_def_id",
11+
"role",
12+
"initiator",
13+
"revoc_reg_id",
14+
"revocation_id",
15+
"auto_offer",
16+
"auto_issue",
17+
"auto_remove",
18+
"error_msg",
19+
"thread_id",
20+
"parent_thread_id",
21+
"state",
22+
"credential_definition_id",
23+
"schema_id",
24+
"credential_id",
25+
"trace",
26+
"public_did",
27+
"cred_id_stored",
28+
"conn_id",
29+
]
30+
31+
def __init__(
32+
self,
33+
version, # 2 = V20CredExRecord ; 1 = V10CredentialExchange
34+
**kwargs,
35+
):
36+
[
37+
self.__setattr__(key, kwargs.get(key))
38+
for key in self.__acceptable_keys_list
39+
if kwargs.get(key) != None
40+
]
41+
if version == 2:
42+
self.cred_ex_id = kwargs.get("_id")
43+
else:
44+
self.credential_exchange_id = kwargs.get("_id")

0 commit comments

Comments
 (0)