from telethon.tl.mtproto_request import MTProtoRequest


class ExportAuthorizationRequest(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization"""

    # Telegram's constructor ID (and unique identifier) for this class
    constructor_id = 0xe5bfffcd

    def __init__(self, dc_id):
        """
        :param dc_id: Telegram type: «int».
        """
        super().__init__()
        self.result = None
        self.confirmed = True  # Confirmed by default

        self.dc_id = dc_id

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

    @staticmethod
    def empty():
        """Returns an "empty" instance (all attributes are None)"""
        return ExportAuthorizationRequest(None)

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

    def __repr__(self):
        return 'auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization'

    def __str__(self):
        return '(auth.exportAuthorization (ID: 0xe5bfffcd) = (dc_id={}))'.format(str(self.dc_id))
