From 1e9077c3a837d00c793ee50c5cbd754d5f0ec58a Mon Sep 17 00:00:00 2001 From: Artur Borecki Date: Tue, 3 Mar 2026 18:09:53 +0100 Subject: [PATCH] refactor(message.py): use `ActionType` instead of `Enum` --- src/judas_protocol/message.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/judas_protocol/message.py b/src/judas_protocol/message.py index 426c13f..0139619 100644 --- a/src/judas_protocol/message.py +++ b/src/judas_protocol/message.py @@ -3,10 +3,9 @@ from __future__ import annotations import json import uuid -from enum import Enum from typing import Any, override -from judas_protocol.types import Category, ControlAction +from judas_protocol.types import ActionType, Category, ControlAction class Message: @@ -16,7 +15,7 @@ class Message: self, id_: str | None, category: Category, - action: Enum, + action: ActionType, payload: dict[str, Any] | None = None, *, acknowledged: bool = False, @@ -27,14 +26,14 @@ class Message: Args: id_ (str | None): The ID of the message. If None, a new UUID will be generated. category (Category): The category of the message. - action (Enum): The action of the message. + action (ActionType): The action of the message. payload (dict[str, Any] | None): The payload of the message. acknowledged (bool): Whether the message has been acknowledged. Defaults to False. ack_required (bool): Whether the message requires an acknowledgment. Defaults to False. """ self.id: str = id_ or str(uuid.uuid4()) self.category: Category = category - self.action: Enum = action + self.action: ActionType = action self.payload: dict[str, Any] = payload or {} self.acknowledged: bool = acknowledged