Skip to content

Commit

Permalink
light_webhook: new webhook object
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlee0505 committed Feb 8, 2023
1 parent 4fa99ea commit bc37a3d
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions aries_cloudagent/messaging/models/light_webhook.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import json
from aries_cloudagent.messaging.models.base_record import BaseExchangeRecord


class LightWeightWebhook:
__acceptable_keys_list = [
"connection_id",
"credential_exchange_id",
"cred_ex_id",
"cred_def_id",
"role",
"initiator",
"revoc_reg_id",
"revocation_id",
"auto_offer",
"auto_issue",
"auto_remove",
"error_msg",
"thread_id",
"parent_thread_id",
"state",
"credential_definition_id",
"schema_id",
"credential_id",
"trace",
"public_did",
"cred_id_stored",
"conn_id",
]

def __init__(
self,
version, # 2 = V20CredExRecord ; 1 = V10CredentialExchange
**kwargs,
):
[
self.__setattr__(key, kwargs.get(key))
for key in self.__acceptable_keys_list
if kwargs.get(key) != None
]
if version == 2:
self.cred_ex_id = kwargs.get("_id")
else:
self.credential_exchange_id = kwargs.get("_id")

0 comments on commit bc37a3d

Please sign in to comment.