"""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 TypeInputContact, TypeInputGeoPoint, TypeInputPeer, TypeInputUser, TypeTextWithEntities, TypeTopPeerCategory class AcceptContactRequest(TLRequest): CONSTRUCTOR_ID = 0xf831a20f SUBCLASS_OF_ID = 0x8af52aac def __init__(self, id: 'TypeInputUser'): """ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage. """ self.id = id async def resolve(self, client, utils): self.id = utils.get_input_user(await client.get_input_entity(self.id)) def to_dict(self): return { '_': 'AcceptContactRequest', 'id': self.id.to_dict() if isinstance(self.id, TLObject) else self.id } def _bytes(self): return b''.join(( b'\x0f\xa21\xf8', self.id._bytes(), )) @classmethod def from_reader(cls, reader): _id = reader.tgread_object() return cls(id=_id) class AddContactRequest(TLRequest): CONSTRUCTOR_ID = 0xd9ba2e54 SUBCLASS_OF_ID = 0x8af52aac def __init__(self, id: 'TypeInputUser', first_name: str, last_name: str, phone: str, add_phone_privacy_exception: Optional[bool]=None, note: Optional['TypeTextWithEntities']=None): """ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage. """ self.id = id self.first_name = first_name self.last_name = last_name self.phone = phone self.add_phone_privacy_exception = add_phone_privacy_exception self.note = note async def resolve(self, client, utils): self.id = utils.get_input_user(await client.get_input_entity(self.id)) def to_dict(self): return { '_': 'AddContactRequest', 'id': self.id.to_dict() if isinstance(self.id, TLObject) else self.id, 'first_name': self.first_name, 'last_name': self.last_name, 'phone': self.phone, 'add_phone_privacy_exception': self.add_phone_privacy_exception, 'note': self.note.to_dict() if isinstance(self.note, TLObject) else self.note } def _bytes(self): return b''.join(( b'T.\xba\xd9', struct.pack(': This type has no constructors. """ self.hash = hash def to_dict(self): return { '_': 'GetContactIDsRequest', 'hash': self.hash } def _bytes(self): return b''.join(( b'\x9df\xdcz', struct.pack('