"""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, TypeInputFile, TypeInputGroupCall, TypeInputPeer, TypeInputPhoneCall, TypeInputUser, TypePhoneCallDiscardReason, TypePhoneCallProtocol class AcceptCallRequest(TLRequest): CONSTRUCTOR_ID = 0x3bd2b4a0 SUBCLASS_OF_ID = 0xd48afe4f def __init__(self, peer: 'TypeInputPhoneCall', g_b: bytes, protocol: 'TypePhoneCallProtocol'): """ :returns phone.PhoneCall: Instance of PhoneCall. """ self.peer = peer self.g_b = g_b self.protocol = protocol def to_dict(self): return { '_': 'AcceptCallRequest', 'peer': self.peer.to_dict() if isinstance(self.peer, TLObject) else self.peer, 'g_b': self.g_b, 'protocol': self.protocol.to_dict() if isinstance(self.protocol, TLObject) else self.protocol } def _bytes(self): return b''.join(( b'\xa0\xb4\xd2;', self.peer._bytes(), self.serialize_bytes(self.g_b), self.protocol._bytes(), )) @classmethod def from_reader(cls, reader): _peer = reader.tgread_object() _g_b = reader.tgread_bytes() _protocol = reader.tgread_object() return cls(peer=_peer, g_b=_g_b, protocol=_protocol) class CheckGroupCallRequest(TLRequest): CONSTRUCTOR_ID = 0xb59cf977 SUBCLASS_OF_ID = 0x5026710f def __init__(self, call: 'TypeInputGroupCall', sources: List[int]): """ :returns Vector: This type has no constructors. """ self.call = call self.sources = sources async def resolve(self, client, utils): self.call = utils.get_input_group_call(self.call) def to_dict(self): return { '_': 'CheckGroupCallRequest', 'call': self.call.to_dict() if isinstance(self.call, TLObject) else self.call, 'sources': [] if self.sources is None else self.sources[:] } def _bytes(self): return b''.join(( b'w\xf9\x9c\xb5', self.call._bytes(), b'\x15\xc4\xb5\x1c',struct.pack('