from ...tl.mtproto_request import MTProtoRequest


class LangPackString(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. TL definition below.
    langPackString#cad181f6 key:string value:string = LangPackString"""

    # Telegram's constructor (U)ID for this class
    constructor_id = 0xcad181f6
    # Also the ID of its resulting type for fast checks
    subclass_of_id = 0xdc179ab9

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

        Constructor for LangPackString: Instance of either LangPackString, LangPackStringPluralized, LangPackStringDeleted.
        """
        super().__init__()

        self.key = key
        self.value = value

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

    def on_send(self, writer):
        writer.write_int(LangPackString.constructor_id, signed=False)
        writer.tgwrite_string(self.key)
        writer.tgwrite_string(self.value)

    @staticmethod
    def empty():
        """Returns an "empty" instance (attributes=None)"""
        return LangPackString(None, None)

    def on_response(self, reader):
        self.key = reader.tgread_string()
        self.value = reader.tgread_string()

    def __repr__(self):
        return 'langPackString#cad181f6 key:string value:string = LangPackString'

    def __str__(self):
        return '(langPackString (ID: 0xcad181f6) = (key={}, value={}))'.format(str(self.key), str(self.value))
