from typing import Optional

from api_graphql.abc.input_abc import InputABC
from data.schemas.permission.permission import Permission


class ApiKeyCreateInput(InputABC):

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

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

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

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