2025-08-04 20:48:45 -05:00

41 lines
1.4 KiB
Python

from pyironscales.endpoints.base.base_endpoint import IronscalesEndpoint
from pyironscales.endpoints.ironscales.SettingsIdAccountTakeoverEndpoint import SettingsIdAccountTakeoverEndpoint
from pyironscales.interfaces import (
IGettable,
)
from pyironscales.models.ironscales import CompanyLicense
from pyironscales.types import (
JSON,
IronscalesRequestParams,
)
class SettingsIdEndpoint(
IronscalesEndpoint,
IGettable[CompanyLicense, IronscalesRequestParams],
):
def __init__(self, client, parent_endpoint=None) -> None:
IronscalesEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint)
IGettable.__init__(self, CompanyLicense)
self.account_takeover = self._register_child_endpoint(SettingsIdAccountTakeoverEndpoint(client, parent_endpoint=self))
def get(
self,
data: JSON | None = None,
params: IronscalesRequestParams | None = None,
) -> CompanyLicense:
"""
Performs a GET request against the /emails/{id} 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:
CompanyLicense: The parsed response data.
"""
return self._parse_one(
CompanyLicense,
super()._make_request("GET", data=data, params=params).json(),
)