Source code for aries_cloudagent.protocols.trustping.v1_0.messages.ping_response

"""Represents an response to a trust ping message."""

from marshmallow import EXCLUDE, fields

from .....messaging.agent_message import AgentMessage, AgentMessageSchema
from ..message_types import PING_RESPONSE, PROTOCOL_PACKAGE

HANDLER_CLASS = f"{PROTOCOL_PACKAGE}.handlers.ping_response_handler.PingResponseHandler"


[docs]class PingResponse(AgentMessage): """Class representing a ping response."""
[docs] class Meta: """PingResponse metadata.""" handler_class = HANDLER_CLASS message_type = PING_RESPONSE schema_class = "PingResponseSchema"
def __init__(self, *, comment: str = None, **kwargs): """Initialize a PingResponse message instance. Args: comment: An optional comment string to include in the message """ super().__init__(**kwargs) self.comment = comment
[docs]class PingResponseSchema(AgentMessageSchema): """PingResponse schema."""
[docs] class Meta: """PingResponseSchema metadata.""" model_class = PingResponse unknown = EXCLUDE
comment = fields.Str( required=False, allow_none=True, metadata={"description": "Optional comment to include", "example": "Hello"}, )