"""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, TypeInputInvoice, TypeInputMedia, TypeInputPaymentCredentials, TypeInputPeer, TypeInputStorePaymentPurpose, TypeInputUser, TypePaymentRequestedInfo class ApplyGiftCodeRequest(TLRequest): CONSTRUCTOR_ID = 0xf6e26854 SUBCLASS_OF_ID = 0x8af52aac def __init__(self, slug: str): """ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage. """ self.slug = slug def to_dict(self): return { '_': 'ApplyGiftCodeRequest', 'slug': self.slug } def _bytes(self): return b''.join(( b'Th\xe2\xf6', self.serialize_bytes(self.slug), )) @classmethod def from_reader(cls, reader): _slug = reader.tgread_string() return cls(slug=_slug) class AssignAppStoreTransactionRequest(TLRequest): CONSTRUCTOR_ID = 0x80ed747d SUBCLASS_OF_ID = 0x8af52aac def __init__(self, receipt: bytes, purpose: 'TypeInputStorePaymentPurpose'): """ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage. """ self.receipt = receipt self.purpose = purpose def to_dict(self): return { '_': 'AssignAppStoreTransactionRequest', 'receipt': self.receipt, 'purpose': self.purpose.to_dict() if isinstance(self.purpose, TLObject) else self.purpose } def _bytes(self): return b''.join(( b'}t\xed\x80', self.serialize_bytes(self.receipt), self.purpose._bytes(), )) @classmethod def from_reader(cls, reader): _receipt = reader.tgread_bytes() _purpose = reader.tgread_object() return cls(receipt=_receipt, purpose=_purpose) class AssignPlayMarketTransactionRequest(TLRequest): CONSTRUCTOR_ID = 0xdffd50d3 SUBCLASS_OF_ID = 0x8af52aac def __init__(self, receipt: 'TypeDataJSON', purpose: 'TypeInputStorePaymentPurpose'): """ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage. """ self.receipt = receipt self.purpose = purpose def to_dict(self): return { '_': 'AssignPlayMarketTransactionRequest', 'receipt': self.receipt.to_dict() if isinstance(self.receipt, TLObject) else self.receipt, 'purpose': self.purpose.to_dict() if isinstance(self.purpose, TLObject) else self.purpose } def _bytes(self): return b''.join(( b'\xd3P\xfd\xdf', self.receipt._bytes(), self.purpose._bytes(), )) @classmethod def from_reader(cls, reader): _receipt = reader.tgread_object() _purpose = reader.tgread_object() return cls(receipt=_receipt, purpose=_purpose) class CanPurchasePremiumRequest(TLRequest): CONSTRUCTOR_ID = 0x9fc19eb6 SUBCLASS_OF_ID = 0xf5b399ac def __init__(self, purpose: 'TypeInputStorePaymentPurpose'): """ :returns Bool: This type has no constructors. """ self.purpose = purpose def to_dict(self): return { '_': 'CanPurchasePremiumRequest', 'purpose': self.purpose.to_dict() if isinstance(self.purpose, TLObject) else self.purpose } def _bytes(self): return b''.join(( b'\xb6\x9e\xc1\x9f', self.purpose._bytes(), )) @classmethod def from_reader(cls, reader): _purpose = reader.tgread_object() return cls(purpose=_purpose) class CheckGiftCodeRequest(TLRequest): CONSTRUCTOR_ID = 0x8e51b4c1 SUBCLASS_OF_ID = 0x5b2997e8 def __init__(self, slug: str): """ :returns payments.CheckedGiftCode: Instance of CheckedGiftCode. """ self.slug = slug def to_dict(self): return { '_': 'CheckGiftCodeRequest', 'slug': self.slug } def _bytes(self): return b''.join(( b'\xc1\xb4Q\x8e', self.serialize_bytes(self.slug), )) @classmethod def from_reader(cls, reader): _slug = reader.tgread_string() return cls(slug=_slug) class ClearSavedInfoRequest(TLRequest): CONSTRUCTOR_ID = 0xd83d70c1 SUBCLASS_OF_ID = 0xf5b399ac def __init__(self, credentials: Optional[bool]=None, info: Optional[bool]=None): """ :returns Bool: This type has no constructors. """ self.credentials = credentials self.info = info def to_dict(self): return { '_': 'ClearSavedInfoRequest', 'credentials': self.credentials, 'info': self.info } def _bytes(self): return b''.join(( b'\xc1p=\xd8', struct.pack(': This type has no constructors. """ self.boost_peer = boost_peer async def resolve(self, client, utils): if self.boost_peer: self.boost_peer = utils.get_input_peer(await client.get_input_entity(self.boost_peer)) def to_dict(self): return { '_': 'GetPremiumGiftCodeOptionsRequest', 'boost_peer': self.boost_peer.to_dict() if isinstance(self.boost_peer, TLObject) else self.boost_peer } def _bytes(self): return b''.join(( b"T\xbaW'", struct.pack('