"""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 TypeAccountDaysTTL, TypeAutoDownloadSettings, TypeAutoSaveSettings, TypeBaseTheme, TypeBirthday, TypeBusinessWorkHours, TypeCodeSettings, TypeEmailVerification, TypeEmailVerifyPurpose, TypeEmojiStatus, TypeGlobalPrivacySettings, TypeInputBusinessAwayMessage, TypeInputBusinessBotRecipients, TypeInputBusinessChatLink, TypeInputBusinessGreetingMessage, TypeInputBusinessIntro, TypeInputChannel, TypeInputCheckPasswordSRP, TypeInputDocument, TypeInputFile, TypeInputGeoPoint, TypeInputNotifyPeer, TypeInputPeer, TypeInputPeerNotifySettings, TypeInputPhoto, TypeInputPrivacyKey, TypeInputPrivacyRule, TypeInputSecureValue, TypeInputTheme, TypeInputThemeSettings, TypeInputUser, TypeInputWallPaper, TypeReactionsNotifySettings, TypeReportReason, TypeSecureCredentialsEncrypted, TypeSecureValueHash, TypeSecureValueType, TypeWallPaperSettings from ...tl.types.account import TypePasswordInputSettings class AcceptAuthorizationRequest(TLRequest): CONSTRUCTOR_ID = 0xf3ed4c73 SUBCLASS_OF_ID = 0xf5b399ac def __init__(self, bot_id: int, scope: str, public_key: str, value_hashes: List['TypeSecureValueHash'], credentials: 'TypeSecureCredentialsEncrypted'): """ :returns Bool: This type has no constructors. """ self.bot_id = bot_id self.scope = scope self.public_key = public_key self.value_hashes = value_hashes self.credentials = credentials def to_dict(self): return { '_': 'AcceptAuthorizationRequest', 'bot_id': self.bot_id, 'scope': self.scope, 'public_key': self.public_key, 'value_hashes': [] if self.value_hashes is None else [x.to_dict() if isinstance(x, TLObject) else x for x in self.value_hashes], 'credentials': self.credentials.to_dict() if isinstance(self.credentials, TLObject) else self.credentials } def _bytes(self): return b''.join(( b'sL\xed\xf3', struct.pack(': This type has no constructors. """ self.wallpapers = wallpapers def to_dict(self): return { '_': 'GetMultiWallPapersRequest', 'wallpapers': [] if self.wallpapers is None else [x.to_dict() if isinstance(x, TLObject) else x for x in self.wallpapers] } def _bytes(self): return b''.join(( b'\xdcq\xade', b'\x15\xc4\xb5\x1c',struct.pack(': This type has no constructors. """ self.types = types def to_dict(self): return { '_': 'GetSecureValueRequest', 'types': [] if self.types is None else [x.to_dict() if isinstance(x, TLObject) else x for x in self.types] } def _bytes(self): return b''.join(( b'\xc2[fs', b'\x15\xc4\xb5\x1c',struct.pack('', self.serialize_bytes(self.username), )) @classmethod def from_reader(cls, reader): _username = reader.tgread_string() return cls(username=_username) class UploadRingtoneRequest(TLRequest): CONSTRUCTOR_ID = 0x831a83a2 SUBCLASS_OF_ID = 0x211fe820 def __init__(self, file: 'TypeInputFile', file_name: str, mime_type: str): """ :returns Document: Instance of either DocumentEmpty, Document. """ self.file = file self.file_name = file_name self.mime_type = mime_type def to_dict(self): return { '_': 'UploadRingtoneRequest', 'file': self.file.to_dict() if isinstance(self.file, TLObject) else self.file, 'file_name': self.file_name, 'mime_type': self.mime_type } def _bytes(self): return b''.join(( b'\xa2\x83\x1a\x83', self.file._bytes(), self.serialize_bytes(self.file_name), self.serialize_bytes(self.mime_type), )) @classmethod def from_reader(cls, reader): _file = reader.tgread_object() _file_name = reader.tgread_string() _mime_type = reader.tgread_string() return cls(file=_file, file_name=_file_name, mime_type=_mime_type) class UploadThemeRequest(TLRequest): CONSTRUCTOR_ID = 0x1c3db333 SUBCLASS_OF_ID = 0x211fe820 def __init__(self, file: 'TypeInputFile', file_name: str, mime_type: str, thumb: Optional['TypeInputFile']=None): """ :returns Document: Instance of either DocumentEmpty, Document. """ self.file = file self.file_name = file_name self.mime_type = mime_type self.thumb = thumb def to_dict(self): return { '_': 'UploadThemeRequest', 'file': self.file.to_dict() if isinstance(self.file, TLObject) else self.file, 'file_name': self.file_name, 'mime_type': self.mime_type, 'thumb': self.thumb.to_dict() if isinstance(self.thumb, TLObject) else self.thumb } def _bytes(self): return b''.join(( b'3\xb3=\x1c', struct.pack('