"""File generated by TLObjects' generator. All changes will be ERASED"""
from ...tl.tlobject import TLObject


class GetDifferenceRequest(TLObject):
    constructor_id = 0xb2e4d7d
    subclass_of_id = 0x52662d55

    def __init__(self, from_version):
        """
        :param from_version: Telegram type: "int".

        :returns LangPackDifference: Instance of LangPackDifference.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.from_version = from_version

    def to_dict(self):
        return {
            'from_version': self.from_version,
        }

    def on_send(self, writer):
        writer.write_int(GetDifferenceRequest.constructor_id, signed=False)
        writer.write_int(self.from_version)

    @staticmethod
    def empty():
        return GetDifferenceRequest(None)

    def on_response(self, reader):
        self.result = reader.tgread_object()

    def __repr__(self):
        return 'langpack.getDifference#0b2e4d7d from_version:int = LangPackDifference'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)



class GetLangPackRequest(TLObject):
    constructor_id = 0x9ab5c58e
    subclass_of_id = 0x52662d55

    def __init__(self, lang_code):
        """
        :param lang_code: Telegram type: "string".

        :returns LangPackDifference: Instance of LangPackDifference.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.lang_code = lang_code

    def to_dict(self):
        return {
            'lang_code': self.lang_code,
        }

    def on_send(self, writer):
        writer.write_int(GetLangPackRequest.constructor_id, signed=False)
        writer.tgwrite_string(self.lang_code)

    @staticmethod
    def empty():
        return GetLangPackRequest(None)

    def on_response(self, reader):
        self.result = reader.tgread_object()

    def __repr__(self):
        return 'langpack.getLangPack#9ab5c58e lang_code:string = LangPackDifference'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)



class GetLanguagesRequest(TLObject):
    constructor_id = 0x800fd57d
    subclass_of_id = 0x280912c9

    def __init__(self):
        super().__init__()
        self.result = None
        self.content_related = True

    @staticmethod
    def to_dict():
        return {}

    def on_send(self, writer):
        writer.write_int(GetLanguagesRequest.constructor_id, signed=False)

    @staticmethod
    def empty():
        return GetLanguagesRequest()

    def on_response(self, reader):
        self.result = reader.tgread_vector()

    def __repr__(self):
        return 'langpack.getLanguages#800fd57d = Vector<LangPackLanguage>'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)



class GetStringsRequest(TLObject):
    constructor_id = 0x2e1ee318
    subclass_of_id = 0xc7b7353d

    def __init__(self, lang_code, keys):
        """
        :param lang_code: Telegram type: "string".
        :param keys: Telegram type: "string". Must be a list.

        :returns Vector<LangPackString>: This type has no constructors.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.lang_code = lang_code
        self.keys = keys

    def to_dict(self):
        return {
            'lang_code': self.lang_code,
            'keys': [] if self.keys is None else self.keys[:],
        }

    def on_send(self, writer):
        writer.write_int(GetStringsRequest.constructor_id, signed=False)
        writer.tgwrite_string(self.lang_code)
        writer.write_int(0x1cb5c415, signed=False)  # Vector's constructor ID
        writer.write_int(len(self.keys))
        for _x in self.keys:
            writer.tgwrite_string(_x)

    @staticmethod
    def empty():
        return GetStringsRequest(None, None)

    def on_response(self, reader):
        self.result = reader.tgread_vector()

    def __repr__(self):
        return 'langpack.getStrings#2e1ee318 lang_code:string keys:Vector<string> = Vector<LangPackString>'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)

