from __future__ import annotations

from typing import TYPE_CHECKING

from ..objects.connect_request import ConnectRequest

if TYPE_CHECKING:
    from ..client import WhatsrbCloud
    from ..connection import Connection


class Connects:
    def __init__(self, *, client: WhatsrbCloud, connection: Connection):
        self._client = client
        self._connection = connection

    def retrieve(self, id: str) -> ConnectRequest:
        response = self._connection.get(f"/connects/{id}")
        return ConnectRequest(response["data"], client=self._client)
