"""File generated by TLObjects' generator. All changes will be ERASED"""
from ..._misc.tlobject import TLObject, TLRequest
from typing import Optional, List, Union, TYPE_CHECKING
import os
import struct
import dataclasses
from datetime import datetime


@dataclasses.dataclass(init=False, frozen=True)
class GetDifference(TLRequest):
    """
    :returns LangPackDifference: Instance of LangPackDifference.
    """
    __slots__ = ('lang_pack', 'lang_code', 'from_version',)
    CONSTRUCTOR_ID = 0xcd984aa5
    SUBCLASS_OF_ID = 0x52662d55

    lang_pack: str
    lang_code: str
    from_version: int
    def __init__(self, lang_pack: str, lang_code: str, from_version: int):
        object.__setattr__(self, 'lang_pack', lang_pack)
        object.__setattr__(self, 'lang_code', lang_code)
        object.__setattr__(self, 'from_version', from_version)

    def _bytes(self):
        return b''.join((
            b'\xa5J\x98\xcd',
            self._serialize_bytes(self.lang_pack),
            self._serialize_bytes(self.lang_code),
            struct.pack('<i', self.from_version),
        ))

    @classmethod
    def _from_reader(cls, reader):
        _lang_pack = reader.tgread_string()
        _lang_code = reader.tgread_string()
        _from_version = reader.read_int()
        return cls(lang_pack=_lang_pack, lang_code=_lang_code, from_version=_from_version)


@dataclasses.dataclass(init=False, frozen=True)
class GetLangPack(TLRequest):
    """
    :returns LangPackDifference: Instance of LangPackDifference.
    """
    __slots__ = ('lang_pack', 'lang_code',)
    CONSTRUCTOR_ID = 0xf2f2330a
    SUBCLASS_OF_ID = 0x52662d55

    lang_pack: str
    lang_code: str
    def __init__(self, lang_pack: str, lang_code: str):
        object.__setattr__(self, 'lang_pack', lang_pack)
        object.__setattr__(self, 'lang_code', lang_code)

    def _bytes(self):
        return b''.join((
            b'\n3\xf2\xf2',
            self._serialize_bytes(self.lang_pack),
            self._serialize_bytes(self.lang_code),
        ))

    @classmethod
    def _from_reader(cls, reader):
        _lang_pack = reader.tgread_string()
        _lang_code = reader.tgread_string()
        return cls(lang_pack=_lang_pack, lang_code=_lang_code)


@dataclasses.dataclass(init=False, frozen=True)
class GetLanguage(TLRequest):
    """
    :returns LangPackLanguage: Instance of LangPackLanguage.
    """
    __slots__ = ('lang_pack', 'lang_code',)
    CONSTRUCTOR_ID = 0x6a596502
    SUBCLASS_OF_ID = 0xabac89b7

    lang_pack: str
    lang_code: str
    def __init__(self, lang_pack: str, lang_code: str):
        object.__setattr__(self, 'lang_pack', lang_pack)
        object.__setattr__(self, 'lang_code', lang_code)

    def _bytes(self):
        return b''.join((
            b'\x02eYj',
            self._serialize_bytes(self.lang_pack),
            self._serialize_bytes(self.lang_code),
        ))

    @classmethod
    def _from_reader(cls, reader):
        _lang_pack = reader.tgread_string()
        _lang_code = reader.tgread_string()
        return cls(lang_pack=_lang_pack, lang_code=_lang_code)


@dataclasses.dataclass(init=False, frozen=True)
class GetLanguages(TLRequest):
    """
    :returns Vector<LangPackLanguage>: This type has no constructors.
    """
    __slots__ = ('lang_pack',)
    CONSTRUCTOR_ID = 0x42c6978f
    SUBCLASS_OF_ID = 0x280912c9

    lang_pack: str
    def __init__(self, lang_pack: str):
        object.__setattr__(self, 'lang_pack', lang_pack)

    def _bytes(self):
        return b''.join((
            b'\x8f\x97\xc6B',
            self._serialize_bytes(self.lang_pack),
        ))

    @classmethod
    def _from_reader(cls, reader):
        _lang_pack = reader.tgread_string()
        return cls(lang_pack=_lang_pack)


@dataclasses.dataclass(init=False, frozen=True)
class GetStrings(TLRequest):
    """
    :returns Vector<LangPackString>: This type has no constructors.
    """
    __slots__ = ('lang_pack', 'lang_code', 'keys',)
    CONSTRUCTOR_ID = 0xefea3803
    SUBCLASS_OF_ID = 0xc7b7353d

    lang_pack: str
    lang_code: str
    keys: List[str]
    def __init__(self, lang_pack: str, lang_code: str, keys: List[str]):
        object.__setattr__(self, 'lang_pack', lang_pack)
        object.__setattr__(self, 'lang_code', lang_code)
        object.__setattr__(self, 'keys', keys)

    def _bytes(self):
        return b''.join((
            b'\x038\xea\xef',
            self._serialize_bytes(self.lang_pack),
            self._serialize_bytes(self.lang_code),
            b'\x15\xc4\xb5\x1c',struct.pack('<i', len(self.keys)),b''.join(self._serialize_bytes(x) for x in self.keys),
        ))

    @classmethod
    def _from_reader(cls, reader):
        _lang_pack = reader.tgread_string()
        _lang_code = reader.tgread_string()
        reader.read_int()
        _keys = []
        for _ in range(reader.read_int()):
            _x = reader.tgread_string()
            _keys.append(_x)

        return cls(lang_pack=_lang_pack, lang_code=_lang_code, keys=_keys)

