from typing import Optional

from api_graphql.abc.input_abc import InputABC


class ApiKeyUpdateInput(InputABC):

    def __init__(self, src: dict):
        InputABC.__init__(self, src)

        self._id = self.option("id", int, required=True)
        self._identifier = self.option("identifier", str)
        self._permissions = self.option("permissions", list[int])

    @property
    def id(self) -> int:
        return self._id

    @property
    def identifier(self) -> Optional[str]:
        return self._identifier

    @property
    def permissions(self) -> Optional[list[int]]:
        return self._permissions
