"""Represents a Transaction Job to send message."""
from marshmallow import EXCLUDE, fields
from .....messaging.agent_message import AgentMessage, AgentMessageSchema
from ..message_types import PROTOCOL_PACKAGE, TRANSACTION_JOB_TO_SEND
HANDLER_CLASS = (
f"{PROTOCOL_PACKAGE}.handlers"
".transaction_job_to_send_handler.TransactionJobToSendHandler"
)
[docs]class TransactionJobToSend(AgentMessage):
"""Class representing a transaction job to send."""
def __init__(
self,
*,
job: str = None,
**kwargs,
):
"""Initialize transaction job to send.
Args:
job: The job that needs to be send
"""
super().__init__(**kwargs)
self.job = job
[docs]class TransactionJobToSendSchema(AgentMessageSchema):
"""Transaction Job to send schema class."""
job = fields.Str(
required=True,
metadata={
"description": "Transaction job that is sent to the other agent",
"example": "TRANSACTION_AUTHOR",
},
)