Module mydata_did.v1_0.handlers.data_agreement_qr_code_initiate_handler
Expand source code
import json
from aries_cloudagent.messaging.base_handler import BaseHandler, BaseResponder, RequestContext
from dexa_sdk.managers.ada_manager import V2ADAManager
from ..messages.data_agreement_qr_code_initiate import DataAgreementQrCodeInitiateMessage
class DataAgreementQrCodeInitiateHandler(BaseHandler):
"""Handler for qr code initiate message"""
async def handle(self, context: RequestContext, responder: BaseResponder):
"""
Handler function for qr code initiate message.
"""
# Assert if received message is of type DataAgreementQrCodeInitiateMessage
assert isinstance(context.message, DataAgreementQrCodeInitiateMessage)
self._logger.info(
"Received data-agreement-qr-code/1.0/initiate message: \n%s",
json.dumps(context.message.serialize(), indent=4)
)
# Initialize ADA manager
mgr = V2ADAManager(context)
# Call the function
await mgr.process_data_agreement_qr_code_initiate_message(
context.message,
context.message_receipt,
)
Classes
class DataAgreementQrCodeInitiateHandler
-
Handler for qr code initiate message
Initialize a BaseHandler instance.
Expand source code
class DataAgreementQrCodeInitiateHandler(BaseHandler): """Handler for qr code initiate message""" async def handle(self, context: RequestContext, responder: BaseResponder): """ Handler function for qr code initiate message. """ # Assert if received message is of type DataAgreementQrCodeInitiateMessage assert isinstance(context.message, DataAgreementQrCodeInitiateMessage) self._logger.info( "Received data-agreement-qr-code/1.0/initiate message: \n%s", json.dumps(context.message.serialize(), indent=4) ) # Initialize ADA manager mgr = V2ADAManager(context) # Call the function await mgr.process_data_agreement_qr_code_initiate_message( context.message, context.message_receipt, )
Ancestors
- aries_cloudagent.messaging.base_handler.BaseHandler
- abc.ABC
Methods
async def handle(self, context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)
-
Handler function for qr code initiate message.
Expand source code
async def handle(self, context: RequestContext, responder: BaseResponder): """ Handler function for qr code initiate message. """ # Assert if received message is of type DataAgreementQrCodeInitiateMessage assert isinstance(context.message, DataAgreementQrCodeInitiateMessage) self._logger.info( "Received data-agreement-qr-code/1.0/initiate message: \n%s", json.dumps(context.message.serialize(), indent=4) ) # Initialize ADA manager mgr = V2ADAManager(context) # Call the function await mgr.process_data_agreement_qr_code_initiate_message( context.message, context.message_receipt, )