from typing import Optional

from api_graphql.abc.input_abc import InputABC
from service.permission.permissions_enum import Permissions


class RoleUpdateInput(InputABC):

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

        self._id = self.option("id", int, required=True)
        self._name = self.option("name", str)
        self._description = self.option("description", str)
        self._permissions = self.option("permissions", list[int])

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

    @property
    def name(self) -> Optional[str]:
        return self._name

    @property
    def description(self) -> Optional[str]:
        return self._description

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