"""File generated by TLObjects' generator. All changes will be ERASED""" from ...tl.tlobject import TLObject from ...tl.tlobject import TLRequest from typing import Optional, List, Union, TYPE_CHECKING import os import struct from datetime import datetime if TYPE_CHECKING: from ...tl.types import TypeInputFileLocation, TypeInputWebFileLocation class GetCdnFileRequest(TLRequest): CONSTRUCTOR_ID = 0x395f69da SUBCLASS_OF_ID = 0xf5ccf928 def __init__(self, file_token: bytes, offset: int, limit: int): """ :returns upload.CdnFile: Instance of either CdnFileReuploadNeeded, CdnFile. """ self.file_token = file_token self.offset = offset self.limit = limit def to_dict(self): return { '_': 'GetCdnFileRequest', 'file_token': self.file_token, 'offset': self.offset, 'limit': self.limit } def _bytes(self): return b''.join(( b'\xdai_9', self.serialize_bytes(self.file_token), struct.pack(': This type has no constructors. """ self.file_token = file_token self.offset = offset def to_dict(self): return { '_': 'GetCdnFileHashesRequest', 'file_token': self.file_token, 'offset': self.offset } def _bytes(self): return b''.join(( b'1?\xdc\x91', self.serialize_bytes(self.file_token), struct.pack(': This type has no constructors. """ self.location = location self.offset = offset def to_dict(self): return { '_': 'GetFileHashesRequest', 'location': self.location.to_dict() if isinstance(self.location, TLObject) else self.location, 'offset': self.offset } def _bytes(self): return b''.join(( b'*\x98V\x91', self.location._bytes(), struct.pack(': This type has no constructors. """ self.file_token = file_token self.request_token = request_token def to_dict(self): return { '_': 'ReuploadCdnFileRequest', 'file_token': self.file_token, 'request_token': self.request_token } def _bytes(self): return b''.join(( b"\xa8T'\x9b", self.serialize_bytes(self.file_token), self.serialize_bytes(self.request_token), )) @classmethod def from_reader(cls, reader): _file_token = reader.tgread_bytes() _request_token = reader.tgread_bytes() return cls(file_token=_file_token, request_token=_request_token) class SaveBigFilePartRequest(TLRequest): CONSTRUCTOR_ID = 0xde7b673d SUBCLASS_OF_ID = 0xf5b399ac def __init__(self, file_id: int, file_part: int, file_total_parts: int, bytes: bytes): """ :returns Bool: This type has no constructors. """ self.file_id = file_id self.file_part = file_part self.file_total_parts = file_total_parts self.bytes = bytes def to_dict(self): return { '_': 'SaveBigFilePartRequest', 'file_id': self.file_id, 'file_part': self.file_part, 'file_total_parts': self.file_total_parts, 'bytes': self.bytes } def _bytes(self): return b''.join(( b'=g{\xde', struct.pack('