from ....tl.tlobject import TLObject


class GetDhConfigRequest(TLObject):
    """Class generated by TLObjects' generator. All changes will be ERASED. TL definition below.
    messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig"""

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

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

        :returns messages.DhConfig: Instance of either DhConfigNotModified, DhConfig.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.version = version
        self.random_length = random_length

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

    def on_send(self, writer):
        writer.write_int(GetDhConfigRequest.constructor_id, signed=False)
        writer.write_int(self.version)
        writer.write_int(self.random_length)

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

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

    def __repr__(self):
        return 'messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig'

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

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