from typing import Optional

from api_graphql.abc.input_abc import InputABC


class ShortUrlCreateInput(InputABC):

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

        self._user_space_id = self.option("userSpaceId", int, required=True)
        self._short_url = self.option("shortUrl", str, required=True)
        self._target_url = self.option("targetUrl", str, required=True)
        self._description = self.option("description", str)
        self._group_id = self.option("groupId", int)
        self._domain_id = self.option("domainId", int)
        self._loading_screen = self.option("loadingScreen", bool)

    @property
    def user_space_id(self) -> int:
        return self._user_space_id

    @property
    def short_url(self) -> str:
        return self._short_url

    @property
    def target_url(self) -> str:
        return self._target_url

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

    @property
    def group_id(self) -> Optional[int]:
        return self._group_id

    @property
    def domain_id(self) -> Optional[int]:
        return self._domain_id

    @property
    def loading_screen(self) -> Optional[str]:
        return self._loading_screen
