Skip to content

Commit d7b84dd

Browse files
author
Michael Brewer
committed
chore: add some missing docs
1 parent 7c8a205 commit d7b84dd

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

aws_lambda_powertools/utilities/data_classes/active_mq.py renamed to aws_lambda_powertools/utilities/data_classes/active_mq_event.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
class ActiveMQMessage(DictWrapper):
99
@property
1010
def message_id(self) -> str:
11+
"""Unique identifier for the message"""
1112
return self["messageID"]
1213

1314
@property
@@ -34,18 +35,22 @@ def connection_id(self) -> str:
3435

3536
@property
3637
def redelivered(self) -> bool:
38+
"""true if the message is being resent to the consumer"""
3739
return self["redelivered"]
3840

3941
@property
4042
def timestamp(self) -> int:
43+
"""Time in milliseconds."""
4144
return self["timestamp"]
4245

4346
@property
4447
def broker_in_time(self) -> int:
48+
"""Time stamp (in milliseconds) for when the message arrived at the broker."""
4549
return self["brokerInTime"]
4650

4751
@property
4852
def broker_out_time(self) -> int:
53+
"""Time stamp (in milliseconds) for when the message left the broker."""
4954
return self["brokerOutTime"]
5055

5156
@property
@@ -54,26 +59,41 @@ def destination_physicalname(self) -> str:
5459

5560
@property
5661
def delivery_mode(self) -> Optional[int]:
62+
"""persistent or non-persistent delivery"""
5763
return self.get("deliveryMode")
5864

5965
@property
6066
def correlation_id(self) -> Optional[str]:
67+
"""User defined correlation id"""
6168
return self.get("correlationID")
6269

6370
@property
6471
def reply_to(self) -> Optional[str]:
72+
"""User defined reply to"""
6573
return self.get("replyTo")
6674

6775
@property
6876
def get_type(self) -> Optional[str]:
77+
"""User defined message type"""
6978
return self.get("type")
7079

7180
@property
7281
def expiration(self) -> Optional[int]:
82+
"""Expiration attribute whose value is given in milliseconds"""
7383
return self.get("expiration")
7484

7585
@property
7686
def priority(self) -> Optional[int]:
87+
"""
88+
JMS defines a ten-level priority value, with 0 as the lowest priority and 9
89+
as the highest. In addition, clients should consider priorities 0-4 as
90+
gradations of normal priority and priorities 5-9 as gradations of expedited
91+
priority.
92+
93+
JMS does not require that a provider strictly implement priority ordering
94+
of messages; however, it should do its best to deliver expedited messages
95+
ahead of normal messages.
96+
"""
7797
return self.get("priority")
7898

7999

aws_lambda_powertools/utilities/data_classes/rabbit_mq_event.py

Whitespace-only changes.

tests/functional/data_classes/test_amazon_mq.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
from aws_lambda_powertools.utilities.data_classes.active_mq import ActiveMQEvent, ActiveMQMessage
1+
from aws_lambda_powertools.utilities.data_classes.active_mq_event import ActiveMQEvent, ActiveMQMessage
22
from tests.functional.utils import load_event
33

44

5-
def test_cloud_watch_trigger_event():
5+
def test_activate_mq_event():
66
event = ActiveMQEvent(load_event("activeMQEvent.json"))
77

88
assert event.event_source == "aws:amq"

0 commit comments

Comments
 (0)