"""Configuration model for RabbitMQ transport connections."""

from typing import Any

from pydantic import Field

from .baseconfig import BaseConfig


class RabbitMQConfig(BaseConfig):
    """
    Configuration model for RabbitMQLine.
    Inherits 'name' from BaseConfig and defines RabbitMQ-specific parameters.

    Attributes:
        host (str): The hostname or IP address of the RabbitMQ server.
        port (int): The port number for connecting to RabbitMQ.
        username (str): The username for RabbitMQ authentication.
        password (str): The password for RabbitMQ authentication.
        virtual_host (str): The virtual host to connect to.
        exchange_type (str): The type of exchange to use (default: "topic").
        exchange_name (Optional[str]): The name of the exchange to publish/consume from.
                                       If None, a default might be used or dynamically created.
        routing_key (Optional[str]): The routing key to use for publishing messages.
                                     If None, a default might be used.
        queue_name (Optional[str]): The name of the queue to consume from.
                                    If None, a default or exclusive queue might be used.
        connection_properties (Dict[str, Any]): Additional properties for the AMQP connection.
                                                 Defaults to an empty dictionary.
        message_properties (Dict[str, Any]): Additional properties for published messages
                                              (e.g., headers, delivery_mode).
                                              Defaults to an empty dictionary.
    """

    host: str
    port: int
    username: str
    password: str
    virtual_host: str
    exchange_type: str = "topic"
    exchange_name: str | None = None
    routing_key: str | None = None
    queue_name: str | None = None
    connection_properties: dict[str, Any] = Field(default_factory=dict)
    message_properties: dict[str, Any] = Field(default_factory=dict)
