Source code for aries_cloudagent.protocols.introduction.messages.invitation_request

"""Represents an request for an invitation from the introduction service."""

from marshmallow import fields

from ....messaging.agent_message import AgentMessage, AgentMessageSchema

from ..message_types import INVITATION_REQUEST, PROTOCOL_PACKAGE

HANDLER_CLASS = (
    f"{PROTOCOL_PACKAGE}.handlers.invitation_request_handler.InvitationRequestHandler"
)


[docs]class InvitationRequest(AgentMessage): """Class representing an invitation request."""
[docs] class Meta: """Metadata for an invitation request.""" handler_class = HANDLER_CLASS message_type = INVITATION_REQUEST schema_class = "InvitationRequestSchema"
def __init__(self, *, responder: str = None, message: str = None, **kwargs): """ Initialize invitation request object. Args: responder: The name of the agent initiating the introduction message: Comments on the introduction """ super(InvitationRequest, self).__init__(**kwargs) self.responder = responder self.message = message
[docs]class InvitationRequestSchema(AgentMessageSchema): """Invitation request schema class."""
[docs] class Meta: """Invitation request schema metadata.""" model_class = InvitationRequest
responder = fields.Str( required=True, description="Agent name initiating the introduction", example="Alice's agent", ) message = fields.Str( required=False, allow_none=True, description="Comments on the introduction", example="Hello Bob, it's Alice", )