from pyironscales.endpoints.base.base_endpoint import IronscalesEndpoint
from pyironscales.interfaces import (
    IGettable,
)
from pyironscales.models.ironscales import IntegrationStatus
from pyironscales.types import (
    JSON,
    IronscalesRequestParams,
)


class IntegrationsIdIntegrationStatusEndpoint(
    IronscalesEndpoint,
    IGettable[IntegrationStatus, IronscalesRequestParams],
):
    def __init__(self, client, parent_endpoint=None) -> None:
        IronscalesEndpoint.__init__(self, client, "integration-status/", parent_endpoint=parent_endpoint)
        IGettable.__init__(self, IntegrationStatus)

    def get(
        self,
        data: JSON | None = None,
        params: IronscalesRequestParams | None = None,
    ) -> IntegrationStatus:
        """
        Performs a GET request against the /integrations/{id}/integration-status/ endpoint.

        Parameters:
            data (dict[str, Any]): The data to send in the request body.
            params (dict[str, int | str]): The parameters to send in the request query string.
        Returns:
            IntegrationStatus: The parsed response data.
        """
        return self._parse_one(
            IntegrationStatus,
            super()._make_request("GET", data=data, params=params).json(),
        )
