mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
20 lines
553 B
Python
20 lines
553 B
Python
import json
|
|
from typing import Any
|
|
|
|
|
|
class SqsClient:
|
|
def __init__(self, boto_sqs_client: Any, queue_url: str) -> None:
|
|
self._client = boto_sqs_client
|
|
self._queue_url = queue_url
|
|
|
|
@property
|
|
def queue_url(self) -> str:
|
|
return self._queue_url
|
|
|
|
def send(self, body: dict[str, Any]) -> str:
|
|
response: dict[str, Any] = self._client.send_message(
|
|
QueueUrl=self._queue_url,
|
|
MessageBody=json.dumps(body),
|
|
)
|
|
message_id: str = response["MessageId"]
|
|
return message_id
|