"""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 TypeDataJSON, TypeInputAppEvent, TypeInputPeer, TypeInputUser, TypeMessageEntity class AcceptTermsOfServiceRequest(TLRequest): CONSTRUCTOR_ID = 0xee72f79a SUBCLASS_OF_ID = 0xf5b399ac def __init__(self, id: 'TypeDataJSON'): """ :returns Bool: This type has no constructors. """ self.id = id def to_dict(self): return { '_': 'AcceptTermsOfServiceRequest', 'id': self.id.to_dict() if isinstance(self.id, TLObject) else self.id } def _bytes(self): return b''.join(( b'\x9a\xf7r\xee', self.id._bytes(), )) @classmethod def from_reader(cls, reader): _id = reader.tgread_object() return cls(id=_id) class DismissSuggestionRequest(TLRequest): CONSTRUCTOR_ID = 0xf50dbaa1 SUBCLASS_OF_ID = 0xf5b399ac def __init__(self, peer: 'TypeInputPeer', suggestion: str): """ :returns Bool: This type has no constructors. """ self.peer = peer self.suggestion = suggestion async def resolve(self, client, utils): self.peer = utils.get_input_peer(await client.get_input_entity(self.peer)) def to_dict(self): return { '_': 'DismissSuggestionRequest', 'peer': self.peer.to_dict() if isinstance(self.peer, TLObject) else self.peer, 'suggestion': self.suggestion } def _bytes(self): return b''.join(( b'\xa1\xba\r\xf5', self.peer._bytes(), self.serialize_bytes(self.suggestion), )) @classmethod def from_reader(cls, reader): _peer = reader.tgread_object() _suggestion = reader.tgread_string() return cls(peer=_peer, suggestion=_suggestion) class EditUserInfoRequest(TLRequest): CONSTRUCTOR_ID = 0x66b91b70 SUBCLASS_OF_ID = 0x5c53d7d8 def __init__(self, user_id: 'TypeInputUser', message: str, entities: List['TypeMessageEntity']): """ :returns help.UserInfo: Instance of either UserInfoEmpty, UserInfo. """ self.user_id = user_id self.message = message self.entities = entities async def resolve(self, client, utils): self.user_id = utils.get_input_user(await client.get_input_entity(self.user_id)) def to_dict(self): return { '_': 'EditUserInfoRequest', 'user_id': self.user_id.to_dict() if isinstance(self.user_id, TLObject) else self.user_id, 'message': self.message, 'entities': [] if self.entities is None else [x.to_dict() if isinstance(x, TLObject) else x for x in self.entities] } def _bytes(self): return b''.join(( b'p\x1b\xb9f', self.user_id._bytes(), self.serialize_bytes(self.message), b'\x15\xc4\xb5\x1c',struct.pack('