"""File auto-generated by tglib TL generator. Do not edit manually."""
from ..tlobject import TLObject
from ..tlobject import TLRequest
from typing import Optional, List, Union
import os
import struct
from datetime import datetime


class AcceptAuthorizationRequest(TLRequest):
    """TL type: account.acceptAuthorization"""
    CONSTRUCTOR_ID = 0xf3ed4c73
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, bot_id: int, scope: str, public_key: str, value_hashes: List['TypeSecureValueHash'], credentials: 'TypeSecureCredentialsEncrypted'):
        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': self.value_hashes,
            'credentials': self.credentials,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<q', self.bot_id))
        buf.write(TLObject.serialize_bytes(self.scope))
        buf.write(TLObject.serialize_bytes(self.public_key))
        buf.write(struct.pack('<i', 0x1cb5c415))  # vector id
        buf.write(struct.pack('<i', len(self.value_hashes)))
        for item in self.value_hashes:
            buf.write(bytes(self.item))
        buf.write(bytes(self.credentials))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_bot_id = reader.read_long()
        _args['bot_id'] = _val_bot_id
        _val_scope = reader.tgread_string()
        _args['scope'] = _val_scope
        _val_public_key = reader.tgread_string()
        _args['public_key'] = _val_public_key
        reader.read_int(signed=False)  # skip vector id
        _count_value_hashes = reader.read_int()
        _list_value_hashes = []
        for _ in range(_count_value_hashes):
            _item_value_hashes = reader.tgread_object()
            _list_value_hashes.append(_item_value_hashes)
        _args['value_hashes'] = _list_value_hashes
        _val_credentials = reader.tgread_object()
        _args['credentials'] = _val_credentials
        return cls(**_args)


class CancelPasswordEmailRequest(TLRequest):
    """TL type: account.cancelPasswordEmail"""
    CONSTRUCTOR_ID = 0xc1cbd5b6
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'CancelPasswordEmailRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class ChangeAuthorizationSettingsRequest(TLRequest):
    """TL type: account.changeAuthorizationSettings"""
    CONSTRUCTOR_ID = 0x40f48462
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, hash: int, confirmed: Optional[bool] = None, encrypted_requests_disabled: Optional[bool] = None, call_requests_disabled: Optional[bool] = None):
        self.hash = hash
        self.confirmed = confirmed
        self.encrypted_requests_disabled = encrypted_requests_disabled
        self.call_requests_disabled = call_requests_disabled

    def to_dict(self):
        return {
            '_': 'ChangeAuthorizationSettingsRequest',
            'hash': self.hash,
            'confirmed': self.confirmed,
            'encrypted_requests_disabled': self.encrypted_requests_disabled,
            'call_requests_disabled': self.call_requests_disabled,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.confirmed:
            flags |= (1 << 3)
        if self.encrypted_requests_disabled is not None:
            flags |= (1 << 0)
        if self.call_requests_disabled is not None:
            flags |= (1 << 1)
        buf.write(struct.pack('<I', flags))
        buf.write(struct.pack('<q', self.hash))
        if self.encrypted_requests_disabled is not None:
            buf.write(struct.pack('<I', 0x997275b5 if self.encrypted_requests_disabled else 0xbc799737))
        if self.call_requests_disabled is not None:
            buf.write(struct.pack('<I', 0x997275b5 if self.call_requests_disabled else 0xbc799737))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        _args['confirmed'] = bool(flags & (1 << 3))
        _val_hash = reader.read_long()
        _args['hash'] = _val_hash
        if flags & (1 << 0):
            _val_encrypted_requests_disabled = reader.tgread_bool()
            _args['encrypted_requests_disabled'] = _val_encrypted_requests_disabled
        else:
            _args['encrypted_requests_disabled'] = None
        if flags & (1 << 1):
            _val_call_requests_disabled = reader.tgread_bool()
            _args['call_requests_disabled'] = _val_call_requests_disabled
        else:
            _args['call_requests_disabled'] = None
        return cls(**_args)


class ChangePhoneRequest(TLRequest):
    """TL type: account.changePhone"""
    CONSTRUCTOR_ID = 0x70c32edb
    SUBCLASS_OF_ID = 0x2da17977

    def __init__(self, phone_number: str, phone_code_hash: str, phone_code: str):
        self.phone_number = phone_number
        self.phone_code_hash = phone_code_hash
        self.phone_code = phone_code

    def to_dict(self):
        return {
            '_': 'ChangePhoneRequest',
            'phone_number': self.phone_number,
            'phone_code_hash': self.phone_code_hash,
            'phone_code': self.phone_code,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(TLObject.serialize_bytes(self.phone_number))
        buf.write(TLObject.serialize_bytes(self.phone_code_hash))
        buf.write(TLObject.serialize_bytes(self.phone_code))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_phone_number = reader.tgread_string()
        _args['phone_number'] = _val_phone_number
        _val_phone_code_hash = reader.tgread_string()
        _args['phone_code_hash'] = _val_phone_code_hash
        _val_phone_code = reader.tgread_string()
        _args['phone_code'] = _val_phone_code
        return cls(**_args)


class CheckUsernameRequest(TLRequest):
    """TL type: account.checkUsername"""
    CONSTRUCTOR_ID = 0x2714d86c
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, username: str):
        self.username = username

    def to_dict(self):
        return {
            '_': 'CheckUsernameRequest',
            'username': self.username,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(TLObject.serialize_bytes(self.username))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_username = reader.tgread_string()
        _args['username'] = _val_username
        return cls(**_args)


class ClearRecentEmojiStatusesRequest(TLRequest):
    """TL type: account.clearRecentEmojiStatuses"""
    CONSTRUCTOR_ID = 0x18201aae
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'ClearRecentEmojiStatusesRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class ConfirmPasswordEmailRequest(TLRequest):
    """TL type: account.confirmPasswordEmail"""
    CONSTRUCTOR_ID = 0x8fdf1920
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, code: str):
        self.code = code

    def to_dict(self):
        return {
            '_': 'ConfirmPasswordEmailRequest',
            'code': self.code,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(TLObject.serialize_bytes(self.code))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_code = reader.tgread_string()
        _args['code'] = _val_code
        return cls(**_args)


class ConfirmPhoneRequest(TLRequest):
    """TL type: account.confirmPhone"""
    CONSTRUCTOR_ID = 0x5f2178c3
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, phone_code_hash: str, phone_code: str):
        self.phone_code_hash = phone_code_hash
        self.phone_code = phone_code

    def to_dict(self):
        return {
            '_': 'ConfirmPhoneRequest',
            'phone_code_hash': self.phone_code_hash,
            'phone_code': self.phone_code,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(TLObject.serialize_bytes(self.phone_code_hash))
        buf.write(TLObject.serialize_bytes(self.phone_code))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_phone_code_hash = reader.tgread_string()
        _args['phone_code_hash'] = _val_phone_code_hash
        _val_phone_code = reader.tgread_string()
        _args['phone_code'] = _val_phone_code
        return cls(**_args)


class CreateBusinessChatLinkRequest(TLRequest):
    """TL type: account.createBusinessChatLink"""
    CONSTRUCTOR_ID = 0x8851e68e
    SUBCLASS_OF_ID = 0x3c0d4a8b

    def __init__(self, link: 'TypeInputBusinessChatLink'):
        self.link = link

    def to_dict(self):
        return {
            '_': 'CreateBusinessChatLinkRequest',
            'link': self.link,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.link))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_link = reader.tgread_object()
        _args['link'] = _val_link
        return cls(**_args)


class CreateThemeRequest(TLRequest):
    """TL type: account.createTheme"""
    CONSTRUCTOR_ID = 0x652e4400
    SUBCLASS_OF_ID = 0x56b4c80c

    def __init__(self, slug: str, title: str, document: Optional['TypeInputDocument'] = None, settings: Optional[List['TypeInputThemeSettings']] = None):
        self.slug = slug
        self.title = title
        self.document = document
        self.settings = settings

    def to_dict(self):
        return {
            '_': 'CreateThemeRequest',
            'slug': self.slug,
            'title': self.title,
            'document': self.document,
            'settings': self.settings,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.document is not None:
            flags |= (1 << 2)
        if self.settings is not None:
            flags |= (1 << 3)
        buf.write(struct.pack('<I', flags))
        buf.write(TLObject.serialize_bytes(self.slug))
        buf.write(TLObject.serialize_bytes(self.title))
        if self.document is not None:
            buf.write(bytes(self.document))
        if self.settings is not None:
            buf.write(struct.pack('<i', 0x1cb5c415))  # vector id
            buf.write(struct.pack('<i', len(self.settings)))
            for item in self.settings:
                buf.write(bytes(self.item))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        _val_slug = reader.tgread_string()
        _args['slug'] = _val_slug
        _val_title = reader.tgread_string()
        _args['title'] = _val_title
        if flags & (1 << 2):
            _val_document = reader.tgread_object()
            _args['document'] = _val_document
        else:
            _args['document'] = None
        if flags & (1 << 3):
            reader.read_int(signed=False)  # skip vector id
            _count_settings = reader.read_int()
            _list_settings = []
            for _ in range(_count_settings):
                _item_settings = reader.tgread_object()
                _list_settings.append(_item_settings)
            _args['settings'] = _list_settings
        else:
            _args['settings'] = None
        return cls(**_args)


class DeclinePasswordResetRequest(TLRequest):
    """TL type: account.declinePasswordReset"""
    CONSTRUCTOR_ID = 0x4c9409f6
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'DeclinePasswordResetRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class DeleteAccountRequest(TLRequest):
    """TL type: account.deleteAccount"""
    CONSTRUCTOR_ID = 0xa2c0cf74
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, reason: str, password: Optional['TypeInputCheckPasswordSRP'] = None):
        self.reason = reason
        self.password = password

    def to_dict(self):
        return {
            '_': 'DeleteAccountRequest',
            'reason': self.reason,
            'password': self.password,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.password is not None:
            flags |= (1 << 0)
        buf.write(struct.pack('<I', flags))
        buf.write(TLObject.serialize_bytes(self.reason))
        if self.password is not None:
            buf.write(bytes(self.password))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        _val_reason = reader.tgread_string()
        _args['reason'] = _val_reason
        if flags & (1 << 0):
            _val_password = reader.tgread_object()
            _args['password'] = _val_password
        else:
            _args['password'] = None
        return cls(**_args)


class DeleteAutoSaveExceptionsRequest(TLRequest):
    """TL type: account.deleteAutoSaveExceptions"""
    CONSTRUCTOR_ID = 0x53bc0020
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'DeleteAutoSaveExceptionsRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class DeleteBusinessChatLinkRequest(TLRequest):
    """TL type: account.deleteBusinessChatLink"""
    CONSTRUCTOR_ID = 0x60073674
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, slug: str):
        self.slug = slug

    def to_dict(self):
        return {
            '_': 'DeleteBusinessChatLinkRequest',
            'slug': self.slug,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(TLObject.serialize_bytes(self.slug))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_slug = reader.tgread_string()
        _args['slug'] = _val_slug
        return cls(**_args)


class DeletePasskeyRequest(TLRequest):
    """TL type: account.deletePasskey"""
    CONSTRUCTOR_ID = 0xf5b5563f
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, id: str):
        self.id = id

    def to_dict(self):
        return {
            '_': 'DeletePasskeyRequest',
            'id': self.id,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(TLObject.serialize_bytes(self.id))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_id = reader.tgread_string()
        _args['id'] = _val_id
        return cls(**_args)


class DeleteSecureValueRequest(TLRequest):
    """TL type: account.deleteSecureValue"""
    CONSTRUCTOR_ID = 0xb880bc4b
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, types: List['TypeSecureValueType']):
        self.types = types

    def to_dict(self):
        return {
            '_': 'DeleteSecureValueRequest',
            'types': self.types,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<i', 0x1cb5c415))  # vector id
        buf.write(struct.pack('<i', len(self.types)))
        for item in self.types:
            buf.write(bytes(self.item))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        reader.read_int(signed=False)  # skip vector id
        _count_types = reader.read_int()
        _list_types = []
        for _ in range(_count_types):
            _item_types = reader.tgread_object()
            _list_types.append(_item_types)
        _args['types'] = _list_types
        return cls(**_args)


class DisablePeerConnectedBotRequest(TLRequest):
    """TL type: account.disablePeerConnectedBot"""
    CONSTRUCTOR_ID = 0x5e437ed9
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, peer: 'TypeInputPeer'):
        self.peer = peer

    def to_dict(self):
        return {
            '_': 'DisablePeerConnectedBotRequest',
            'peer': self.peer,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.peer))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_peer = reader.tgread_object()
        _args['peer'] = _val_peer
        return cls(**_args)


class EditBusinessChatLinkRequest(TLRequest):
    """TL type: account.editBusinessChatLink"""
    CONSTRUCTOR_ID = 0x8c3410af
    SUBCLASS_OF_ID = 0x3c0d4a8b

    def __init__(self, slug: str, link: 'TypeInputBusinessChatLink'):
        self.slug = slug
        self.link = link

    def to_dict(self):
        return {
            '_': 'EditBusinessChatLinkRequest',
            'slug': self.slug,
            'link': self.link,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(TLObject.serialize_bytes(self.slug))
        buf.write(bytes(self.link))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_slug = reader.tgread_string()
        _args['slug'] = _val_slug
        _val_link = reader.tgread_object()
        _args['link'] = _val_link
        return cls(**_args)


class FinishTakeoutSessionRequest(TLRequest):
    """TL type: account.finishTakeoutSession"""
    CONSTRUCTOR_ID = 0x1d2652ee
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, success: Optional[bool] = None):
        self.success = success

    def to_dict(self):
        return {
            '_': 'FinishTakeoutSessionRequest',
            'success': self.success,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.success:
            flags |= (1 << 0)
        buf.write(struct.pack('<I', flags))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        _args['success'] = bool(flags & (1 << 0))
        return cls(**_args)


class GetAccountTtlRequest(TLRequest):
    """TL type: account.getAccountTTL"""
    CONSTRUCTOR_ID = 0x08fc711d
    SUBCLASS_OF_ID = 0xbaa39d88

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'GetAccountTtlRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class GetAllSecureValuesRequest(TLRequest):
    """TL type: account.getAllSecureValues"""
    CONSTRUCTOR_ID = 0xb288bc7d
    SUBCLASS_OF_ID = 0xe82e4121

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'GetAllSecureValuesRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class GetAuthorizationFormRequest(TLRequest):
    """TL type: account.getAuthorizationForm"""
    CONSTRUCTOR_ID = 0xa929597a
    SUBCLASS_OF_ID = 0x78049a94

    def __init__(self, bot_id: int, scope: str, public_key: str):
        self.bot_id = bot_id
        self.scope = scope
        self.public_key = public_key

    def to_dict(self):
        return {
            '_': 'GetAuthorizationFormRequest',
            'bot_id': self.bot_id,
            'scope': self.scope,
            'public_key': self.public_key,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<q', self.bot_id))
        buf.write(TLObject.serialize_bytes(self.scope))
        buf.write(TLObject.serialize_bytes(self.public_key))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_bot_id = reader.read_long()
        _args['bot_id'] = _val_bot_id
        _val_scope = reader.tgread_string()
        _args['scope'] = _val_scope
        _val_public_key = reader.tgread_string()
        _args['public_key'] = _val_public_key
        return cls(**_args)


class GetAuthorizationsRequest(TLRequest):
    """TL type: account.getAuthorizations"""
    CONSTRUCTOR_ID = 0xe320c158
    SUBCLASS_OF_ID = 0x0bf5e0ff

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'GetAuthorizationsRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class GetAutoDownloadSettingsRequest(TLRequest):
    """TL type: account.getAutoDownloadSettings"""
    CONSTRUCTOR_ID = 0x56da0b3f
    SUBCLASS_OF_ID = 0x2fb85921

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'GetAutoDownloadSettingsRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class GetAutoSaveSettingsRequest(TLRequest):
    """TL type: account.getAutoSaveSettings"""
    CONSTRUCTOR_ID = 0xadcbbcda
    SUBCLASS_OF_ID = 0x48cf2f02

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'GetAutoSaveSettingsRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class GetBotBusinessConnectionRequest(TLRequest):
    """TL type: account.getBotBusinessConnection"""
    CONSTRUCTOR_ID = 0x76a86270
    SUBCLASS_OF_ID = 0x8af52aac

    def __init__(self, connection_id: str):
        self.connection_id = connection_id

    def to_dict(self):
        return {
            '_': 'GetBotBusinessConnectionRequest',
            'connection_id': self.connection_id,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(TLObject.serialize_bytes(self.connection_id))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_connection_id = reader.tgread_string()
        _args['connection_id'] = _val_connection_id
        return cls(**_args)


class GetBusinessChatLinksRequest(TLRequest):
    """TL type: account.getBusinessChatLinks"""
    CONSTRUCTOR_ID = 0x6f70dde1
    SUBCLASS_OF_ID = 0xc6ba4a31

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'GetBusinessChatLinksRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class GetChannelDefaultEmojiStatusesRequest(TLRequest):
    """TL type: account.getChannelDefaultEmojiStatuses"""
    CONSTRUCTOR_ID = 0x7727a7d5
    SUBCLASS_OF_ID = 0xd3e005ca

    def __init__(self, hash: int):
        self.hash = hash

    def to_dict(self):
        return {
            '_': 'GetChannelDefaultEmojiStatusesRequest',
            'hash': self.hash,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<q', self.hash))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_hash = reader.read_long()
        _args['hash'] = _val_hash
        return cls(**_args)


class GetChannelRestrictedStatusEmojisRequest(TLRequest):
    """TL type: account.getChannelRestrictedStatusEmojis"""
    CONSTRUCTOR_ID = 0x35a9e0d5
    SUBCLASS_OF_ID = 0xbcef6aba

    def __init__(self, hash: int):
        self.hash = hash

    def to_dict(self):
        return {
            '_': 'GetChannelRestrictedStatusEmojisRequest',
            'hash': self.hash,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<q', self.hash))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_hash = reader.read_long()
        _args['hash'] = _val_hash
        return cls(**_args)


class GetChatThemesRequest(TLRequest):
    """TL type: account.getChatThemes"""
    CONSTRUCTOR_ID = 0xd638de89
    SUBCLASS_OF_ID = 0x7fc52204

    def __init__(self, hash: int):
        self.hash = hash

    def to_dict(self):
        return {
            '_': 'GetChatThemesRequest',
            'hash': self.hash,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<q', self.hash))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_hash = reader.read_long()
        _args['hash'] = _val_hash
        return cls(**_args)


class GetCollectibleEmojiStatusesRequest(TLRequest):
    """TL type: account.getCollectibleEmojiStatuses"""
    CONSTRUCTOR_ID = 0x2e7b4543
    SUBCLASS_OF_ID = 0xd3e005ca

    def __init__(self, hash: int):
        self.hash = hash

    def to_dict(self):
        return {
            '_': 'GetCollectibleEmojiStatusesRequest',
            'hash': self.hash,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<q', self.hash))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_hash = reader.read_long()
        _args['hash'] = _val_hash
        return cls(**_args)


class GetConnectedBotsRequest(TLRequest):
    """TL type: account.getConnectedBots"""
    CONSTRUCTOR_ID = 0x4ea4c80f
    SUBCLASS_OF_ID = 0xe4caf7d3

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'GetConnectedBotsRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class GetContactSignUpNotificationRequest(TLRequest):
    """TL type: account.getContactSignUpNotification"""
    CONSTRUCTOR_ID = 0x9f07c728
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'GetContactSignUpNotificationRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class GetContentSettingsRequest(TLRequest):
    """TL type: account.getContentSettings"""
    CONSTRUCTOR_ID = 0x8b9b4dae
    SUBCLASS_OF_ID = 0xae3ff891

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'GetContentSettingsRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class GetDefaultBackgroundEmojisRequest(TLRequest):
    """TL type: account.getDefaultBackgroundEmojis"""
    CONSTRUCTOR_ID = 0xa60ab9ce
    SUBCLASS_OF_ID = 0xbcef6aba

    def __init__(self, hash: int):
        self.hash = hash

    def to_dict(self):
        return {
            '_': 'GetDefaultBackgroundEmojisRequest',
            'hash': self.hash,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<q', self.hash))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_hash = reader.read_long()
        _args['hash'] = _val_hash
        return cls(**_args)


class GetDefaultEmojiStatusesRequest(TLRequest):
    """TL type: account.getDefaultEmojiStatuses"""
    CONSTRUCTOR_ID = 0xd6753386
    SUBCLASS_OF_ID = 0xd3e005ca

    def __init__(self, hash: int):
        self.hash = hash

    def to_dict(self):
        return {
            '_': 'GetDefaultEmojiStatusesRequest',
            'hash': self.hash,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<q', self.hash))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_hash = reader.read_long()
        _args['hash'] = _val_hash
        return cls(**_args)


class GetDefaultGroupPhotoEmojisRequest(TLRequest):
    """TL type: account.getDefaultGroupPhotoEmojis"""
    CONSTRUCTOR_ID = 0x915860ae
    SUBCLASS_OF_ID = 0xbcef6aba

    def __init__(self, hash: int):
        self.hash = hash

    def to_dict(self):
        return {
            '_': 'GetDefaultGroupPhotoEmojisRequest',
            'hash': self.hash,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<q', self.hash))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_hash = reader.read_long()
        _args['hash'] = _val_hash
        return cls(**_args)


class GetDefaultProfilePhotoEmojisRequest(TLRequest):
    """TL type: account.getDefaultProfilePhotoEmojis"""
    CONSTRUCTOR_ID = 0xe2750328
    SUBCLASS_OF_ID = 0xbcef6aba

    def __init__(self, hash: int):
        self.hash = hash

    def to_dict(self):
        return {
            '_': 'GetDefaultProfilePhotoEmojisRequest',
            'hash': self.hash,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<q', self.hash))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_hash = reader.read_long()
        _args['hash'] = _val_hash
        return cls(**_args)


class GetGlobalPrivacySettingsRequest(TLRequest):
    """TL type: account.getGlobalPrivacySettings"""
    CONSTRUCTOR_ID = 0xeb2b4cf6
    SUBCLASS_OF_ID = 0xc90e5770

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'GetGlobalPrivacySettingsRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class GetMultiWallPapersRequest(TLRequest):
    """TL type: account.getMultiWallPapers"""
    CONSTRUCTOR_ID = 0x65ad71dc
    SUBCLASS_OF_ID = 0x8ec35283

    def __init__(self, wallpapers: List['TypeInputWallPaper']):
        self.wallpapers = wallpapers

    def to_dict(self):
        return {
            '_': 'GetMultiWallPapersRequest',
            'wallpapers': self.wallpapers,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<i', 0x1cb5c415))  # vector id
        buf.write(struct.pack('<i', len(self.wallpapers)))
        for item in self.wallpapers:
            buf.write(bytes(self.item))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        reader.read_int(signed=False)  # skip vector id
        _count_wallpapers = reader.read_int()
        _list_wallpapers = []
        for _ in range(_count_wallpapers):
            _item_wallpapers = reader.tgread_object()
            _list_wallpapers.append(_item_wallpapers)
        _args['wallpapers'] = _list_wallpapers
        return cls(**_args)


class GetNotifyExceptionsRequest(TLRequest):
    """TL type: account.getNotifyExceptions"""
    CONSTRUCTOR_ID = 0x53577479
    SUBCLASS_OF_ID = 0x8af52aac

    def __init__(self, compare_sound: Optional[bool] = None, compare_stories: Optional[bool] = None, peer: Optional['TypeInputNotifyPeer'] = None):
        self.compare_sound = compare_sound
        self.compare_stories = compare_stories
        self.peer = peer

    def to_dict(self):
        return {
            '_': 'GetNotifyExceptionsRequest',
            'compare_sound': self.compare_sound,
            'compare_stories': self.compare_stories,
            'peer': self.peer,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.compare_sound:
            flags |= (1 << 1)
        if self.compare_stories:
            flags |= (1 << 2)
        if self.peer is not None:
            flags |= (1 << 0)
        buf.write(struct.pack('<I', flags))
        if self.peer is not None:
            buf.write(bytes(self.peer))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        _args['compare_sound'] = bool(flags & (1 << 1))
        _args['compare_stories'] = bool(flags & (1 << 2))
        if flags & (1 << 0):
            _val_peer = reader.tgread_object()
            _args['peer'] = _val_peer
        else:
            _args['peer'] = None
        return cls(**_args)


class GetNotifySettingsRequest(TLRequest):
    """TL type: account.getNotifySettings"""
    CONSTRUCTOR_ID = 0x12b3ad31
    SUBCLASS_OF_ID = 0xcf20c074

    def __init__(self, peer: 'TypeInputNotifyPeer'):
        self.peer = peer

    def to_dict(self):
        return {
            '_': 'GetNotifySettingsRequest',
            'peer': self.peer,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.peer))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_peer = reader.tgread_object()
        _args['peer'] = _val_peer
        return cls(**_args)


class GetPaidMessagesRevenueRequest(TLRequest):
    """TL type: account.getPaidMessagesRevenue"""
    CONSTRUCTOR_ID = 0x19ba4a67
    SUBCLASS_OF_ID = 0x152f0c57

    def __init__(self, user_id: 'TypeInputUser', parent_peer: Optional['TypeInputPeer'] = None):
        self.user_id = user_id
        self.parent_peer = parent_peer

    def to_dict(self):
        return {
            '_': 'GetPaidMessagesRevenueRequest',
            'user_id': self.user_id,
            'parent_peer': self.parent_peer,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.parent_peer is not None:
            flags |= (1 << 0)
        buf.write(struct.pack('<I', flags))
        buf.write(bytes(self.user_id))
        if self.parent_peer is not None:
            buf.write(bytes(self.parent_peer))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        if flags & (1 << 0):
            _val_parent_peer = reader.tgread_object()
            _args['parent_peer'] = _val_parent_peer
        else:
            _args['parent_peer'] = None
        _val_user_id = reader.tgread_object()
        _args['user_id'] = _val_user_id
        return cls(**_args)


class GetPasskeysRequest(TLRequest):
    """TL type: account.getPasskeys"""
    CONSTRUCTOR_ID = 0xea1f0c52
    SUBCLASS_OF_ID = 0x24dd205e

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'GetPasskeysRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class GetPasswordRequest(TLRequest):
    """TL type: account.getPassword"""
    CONSTRUCTOR_ID = 0x548a30f5
    SUBCLASS_OF_ID = 0x53a211a3

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'GetPasswordRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class GetPasswordSettingsRequest(TLRequest):
    """TL type: account.getPasswordSettings"""
    CONSTRUCTOR_ID = 0x9cd4eaf9
    SUBCLASS_OF_ID = 0xd23fb078

    def __init__(self, password: 'TypeInputCheckPasswordSRP'):
        self.password = password

    def to_dict(self):
        return {
            '_': 'GetPasswordSettingsRequest',
            'password': self.password,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.password))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_password = reader.tgread_object()
        _args['password'] = _val_password
        return cls(**_args)


class GetPrivacyRequest(TLRequest):
    """TL type: account.getPrivacy"""
    CONSTRUCTOR_ID = 0xdadbc950
    SUBCLASS_OF_ID = 0xb55aba82

    def __init__(self, key: 'TypeInputPrivacyKey'):
        self.key = key

    def to_dict(self):
        return {
            '_': 'GetPrivacyRequest',
            'key': self.key,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.key))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_key = reader.tgread_object()
        _args['key'] = _val_key
        return cls(**_args)


class GetReactionsNotifySettingsRequest(TLRequest):
    """TL type: account.getReactionsNotifySettings"""
    CONSTRUCTOR_ID = 0x06dd654c
    SUBCLASS_OF_ID = 0x8dff0851

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'GetReactionsNotifySettingsRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class GetRecentEmojiStatusesRequest(TLRequest):
    """TL type: account.getRecentEmojiStatuses"""
    CONSTRUCTOR_ID = 0x0f578105
    SUBCLASS_OF_ID = 0xd3e005ca

    def __init__(self, hash: int):
        self.hash = hash

    def to_dict(self):
        return {
            '_': 'GetRecentEmojiStatusesRequest',
            'hash': self.hash,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<q', self.hash))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_hash = reader.read_long()
        _args['hash'] = _val_hash
        return cls(**_args)


class GetSavedMusicIdsRequest(TLRequest):
    """TL type: account.getSavedMusicIds"""
    CONSTRUCTOR_ID = 0xe09d5faf
    SUBCLASS_OF_ID = 0x4b4af692

    def __init__(self, hash: int):
        self.hash = hash

    def to_dict(self):
        return {
            '_': 'GetSavedMusicIdsRequest',
            'hash': self.hash,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<q', self.hash))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_hash = reader.read_long()
        _args['hash'] = _val_hash
        return cls(**_args)


class GetSavedRingtonesRequest(TLRequest):
    """TL type: account.getSavedRingtones"""
    CONSTRUCTOR_ID = 0xe1902288
    SUBCLASS_OF_ID = 0x27bcc95e

    def __init__(self, hash: int):
        self.hash = hash

    def to_dict(self):
        return {
            '_': 'GetSavedRingtonesRequest',
            'hash': self.hash,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<q', self.hash))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_hash = reader.read_long()
        _args['hash'] = _val_hash
        return cls(**_args)


class GetSecureValueRequest(TLRequest):
    """TL type: account.getSecureValue"""
    CONSTRUCTOR_ID = 0x73665bc2
    SUBCLASS_OF_ID = 0xe82e4121

    def __init__(self, types: List['TypeSecureValueType']):
        self.types = types

    def to_dict(self):
        return {
            '_': 'GetSecureValueRequest',
            'types': self.types,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<i', 0x1cb5c415))  # vector id
        buf.write(struct.pack('<i', len(self.types)))
        for item in self.types:
            buf.write(bytes(self.item))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        reader.read_int(signed=False)  # skip vector id
        _count_types = reader.read_int()
        _list_types = []
        for _ in range(_count_types):
            _item_types = reader.tgread_object()
            _list_types.append(_item_types)
        _args['types'] = _list_types
        return cls(**_args)


class GetThemeRequest(TLRequest):
    """TL type: account.getTheme"""
    CONSTRUCTOR_ID = 0x3a5869ec
    SUBCLASS_OF_ID = 0x56b4c80c

    def __init__(self, format: str, theme: 'TypeInputTheme'):
        self.format = format
        self.theme = theme

    def to_dict(self):
        return {
            '_': 'GetThemeRequest',
            'format': self.format,
            'theme': self.theme,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(TLObject.serialize_bytes(self.format))
        buf.write(bytes(self.theme))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_format = reader.tgread_string()
        _args['format'] = _val_format
        _val_theme = reader.tgread_object()
        _args['theme'] = _val_theme
        return cls(**_args)


class GetThemesRequest(TLRequest):
    """TL type: account.getThemes"""
    CONSTRUCTOR_ID = 0x7206e458
    SUBCLASS_OF_ID = 0x7fc52204

    def __init__(self, format: str, hash: int):
        self.format = format
        self.hash = hash

    def to_dict(self):
        return {
            '_': 'GetThemesRequest',
            'format': self.format,
            'hash': self.hash,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(TLObject.serialize_bytes(self.format))
        buf.write(struct.pack('<q', self.hash))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_format = reader.tgread_string()
        _args['format'] = _val_format
        _val_hash = reader.read_long()
        _args['hash'] = _val_hash
        return cls(**_args)


class GetTmpPasswordRequest(TLRequest):
    """TL type: account.getTmpPassword"""
    CONSTRUCTOR_ID = 0x449e0b51
    SUBCLASS_OF_ID = 0xb064992d

    def __init__(self, password: 'TypeInputCheckPasswordSRP', period: int):
        self.password = password
        self.period = period

    def to_dict(self):
        return {
            '_': 'GetTmpPasswordRequest',
            'password': self.password,
            'period': self.period,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.password))
        buf.write(struct.pack('<i', self.period))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_password = reader.tgread_object()
        _args['password'] = _val_password
        _val_period = reader.read_int()
        _args['period'] = _val_period
        return cls(**_args)


class GetUniqueGiftChatThemesRequest(TLRequest):
    """TL type: account.getUniqueGiftChatThemes"""
    CONSTRUCTOR_ID = 0xe42ce9c9
    SUBCLASS_OF_ID = 0x15c14aa8

    def __init__(self, offset: str, limit: int, hash: int):
        self.offset = offset
        self.limit = limit
        self.hash = hash

    def to_dict(self):
        return {
            '_': 'GetUniqueGiftChatThemesRequest',
            'offset': self.offset,
            'limit': self.limit,
            'hash': self.hash,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(TLObject.serialize_bytes(self.offset))
        buf.write(struct.pack('<i', self.limit))
        buf.write(struct.pack('<q', self.hash))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_offset = reader.tgread_string()
        _args['offset'] = _val_offset
        _val_limit = reader.read_int()
        _args['limit'] = _val_limit
        _val_hash = reader.read_long()
        _args['hash'] = _val_hash
        return cls(**_args)


class GetWallPaperRequest(TLRequest):
    """TL type: account.getWallPaper"""
    CONSTRUCTOR_ID = 0xfc8ddbea
    SUBCLASS_OF_ID = 0x96a2c98b

    def __init__(self, wallpaper: 'TypeInputWallPaper'):
        self.wallpaper = wallpaper

    def to_dict(self):
        return {
            '_': 'GetWallPaperRequest',
            'wallpaper': self.wallpaper,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.wallpaper))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_wallpaper = reader.tgread_object()
        _args['wallpaper'] = _val_wallpaper
        return cls(**_args)


class GetWallPapersRequest(TLRequest):
    """TL type: account.getWallPapers"""
    CONSTRUCTOR_ID = 0x07967d36
    SUBCLASS_OF_ID = 0xa2c548fd

    def __init__(self, hash: int):
        self.hash = hash

    def to_dict(self):
        return {
            '_': 'GetWallPapersRequest',
            'hash': self.hash,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<q', self.hash))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_hash = reader.read_long()
        _args['hash'] = _val_hash
        return cls(**_args)


class GetWebAuthorizationsRequest(TLRequest):
    """TL type: account.getWebAuthorizations"""
    CONSTRUCTOR_ID = 0x182e6d6f
    SUBCLASS_OF_ID = 0x9a365b32

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'GetWebAuthorizationsRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class InitPasskeyRegistrationRequest(TLRequest):
    """TL type: account.initPasskeyRegistration"""
    CONSTRUCTOR_ID = 0x429547e8
    SUBCLASS_OF_ID = 0x341d83e4

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'InitPasskeyRegistrationRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class InitTakeoutSessionRequest(TLRequest):
    """TL type: account.initTakeoutSession"""
    CONSTRUCTOR_ID = 0x8ef3eab0
    SUBCLASS_OF_ID = 0x843ebe85

    def __init__(self, contacts: Optional[bool] = None, message_users: Optional[bool] = None, message_chats: Optional[bool] = None, message_megagroups: Optional[bool] = None, message_channels: Optional[bool] = None, files: Optional[bool] = None, file_max_size: Optional[int] = None):
        self.contacts = contacts
        self.message_users = message_users
        self.message_chats = message_chats
        self.message_megagroups = message_megagroups
        self.message_channels = message_channels
        self.files = files
        self.file_max_size = file_max_size

    def to_dict(self):
        return {
            '_': 'InitTakeoutSessionRequest',
            'contacts': self.contacts,
            'message_users': self.message_users,
            'message_chats': self.message_chats,
            'message_megagroups': self.message_megagroups,
            'message_channels': self.message_channels,
            'files': self.files,
            'file_max_size': self.file_max_size,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.contacts:
            flags |= (1 << 0)
        if self.message_users:
            flags |= (1 << 1)
        if self.message_chats:
            flags |= (1 << 2)
        if self.message_megagroups:
            flags |= (1 << 3)
        if self.message_channels:
            flags |= (1 << 4)
        if self.file_max_size is not None:
            flags |= (1 << 5)
        buf.write(struct.pack('<I', flags))
        if self.file_max_size is not None:
            buf.write(struct.pack('<q', self.file_max_size))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        _args['contacts'] = bool(flags & (1 << 0))
        _args['message_users'] = bool(flags & (1 << 1))
        _args['message_chats'] = bool(flags & (1 << 2))
        _args['message_megagroups'] = bool(flags & (1 << 3))
        _args['message_channels'] = bool(flags & (1 << 4))
        _args['files'] = bool(flags & (1 << 5))
        if flags & (1 << 5):
            _val_file_max_size = reader.read_long()
            _args['file_max_size'] = _val_file_max_size
        else:
            _args['file_max_size'] = None
        return cls(**_args)


class InstallThemeRequest(TLRequest):
    """TL type: account.installTheme"""
    CONSTRUCTOR_ID = 0xc727bb3b
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, dark: Optional[bool] = None, theme: Optional['TypeInputTheme'] = None, format: Optional[str] = None, base_theme: Optional['TypeBaseTheme'] = None):
        self.dark = dark
        self.theme = theme
        self.format = format
        self.base_theme = base_theme

    def to_dict(self):
        return {
            '_': 'InstallThemeRequest',
            'dark': self.dark,
            'theme': self.theme,
            'format': self.format,
            'base_theme': self.base_theme,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.dark:
            flags |= (1 << 0)
        if self.theme is not None:
            flags |= (1 << 1)
        if self.format is not None:
            flags |= (1 << 2)
        if self.base_theme is not None:
            flags |= (1 << 3)
        buf.write(struct.pack('<I', flags))
        if self.theme is not None:
            buf.write(bytes(self.theme))
        if self.format is not None:
            buf.write(TLObject.serialize_bytes(self.format))
        if self.base_theme is not None:
            buf.write(bytes(self.base_theme))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        _args['dark'] = bool(flags & (1 << 0))
        if flags & (1 << 1):
            _val_theme = reader.tgread_object()
            _args['theme'] = _val_theme
        else:
            _args['theme'] = None
        if flags & (1 << 2):
            _val_format = reader.tgread_string()
            _args['format'] = _val_format
        else:
            _args['format'] = None
        if flags & (1 << 3):
            _val_base_theme = reader.tgread_object()
            _args['base_theme'] = _val_base_theme
        else:
            _args['base_theme'] = None
        return cls(**_args)


class InstallWallPaperRequest(TLRequest):
    """TL type: account.installWallPaper"""
    CONSTRUCTOR_ID = 0xfeed5769
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, wallpaper: 'TypeInputWallPaper', settings: 'TypeWallPaperSettings'):
        self.wallpaper = wallpaper
        self.settings = settings

    def to_dict(self):
        return {
            '_': 'InstallWallPaperRequest',
            'wallpaper': self.wallpaper,
            'settings': self.settings,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.wallpaper))
        buf.write(bytes(self.settings))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_wallpaper = reader.tgread_object()
        _args['wallpaper'] = _val_wallpaper
        _val_settings = reader.tgread_object()
        _args['settings'] = _val_settings
        return cls(**_args)


class InvalidateSignInCodesRequest(TLRequest):
    """TL type: account.invalidateSignInCodes"""
    CONSTRUCTOR_ID = 0xca8ae8ba
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, codes: List[str]):
        self.codes = codes

    def to_dict(self):
        return {
            '_': 'InvalidateSignInCodesRequest',
            'codes': self.codes,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<i', 0x1cb5c415))  # vector id
        buf.write(struct.pack('<i', len(self.codes)))
        for item in self.codes:
            buf.write(TLObject.serialize_bytes(self.item))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        reader.read_int(signed=False)  # skip vector id
        _count_codes = reader.read_int()
        _list_codes = []
        for _ in range(_count_codes):
            _item_codes = reader.tgread_string()
            _list_codes.append(_item_codes)
        _args['codes'] = _list_codes
        return cls(**_args)


class RegisterDeviceRequest(TLRequest):
    """TL type: account.registerDevice"""
    CONSTRUCTOR_ID = 0xec86017a
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, token_type: int, token: str, app_sandbox: bool, secret: bytes, other_uids: List[int], no_muted: Optional[bool] = None):
        self.token_type = token_type
        self.token = token
        self.app_sandbox = app_sandbox
        self.secret = secret
        self.other_uids = other_uids
        self.no_muted = no_muted

    def to_dict(self):
        return {
            '_': 'RegisterDeviceRequest',
            'token_type': self.token_type,
            'token': self.token,
            'app_sandbox': self.app_sandbox,
            'secret': self.secret,
            'other_uids': self.other_uids,
            'no_muted': self.no_muted,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.no_muted:
            flags |= (1 << 0)
        buf.write(struct.pack('<I', flags))
        buf.write(struct.pack('<i', self.token_type))
        buf.write(TLObject.serialize_bytes(self.token))
        buf.write(struct.pack('<I', 0x997275b5 if self.app_sandbox else 0xbc799737))
        buf.write(TLObject.serialize_bytes(self.secret))
        buf.write(struct.pack('<i', 0x1cb5c415))  # vector id
        buf.write(struct.pack('<i', len(self.other_uids)))
        for item in self.other_uids:
            buf.write(struct.pack('<q', self.item))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        _args['no_muted'] = bool(flags & (1 << 0))
        _val_token_type = reader.read_int()
        _args['token_type'] = _val_token_type
        _val_token = reader.tgread_string()
        _args['token'] = _val_token
        _val_app_sandbox = reader.tgread_bool()
        _args['app_sandbox'] = _val_app_sandbox
        _val_secret = reader.tgread_bytes()
        _args['secret'] = _val_secret
        reader.read_int(signed=False)  # skip vector id
        _count_other_uids = reader.read_int()
        _list_other_uids = []
        for _ in range(_count_other_uids):
            _item_other_uids = reader.read_long()
            _list_other_uids.append(_item_other_uids)
        _args['other_uids'] = _list_other_uids
        return cls(**_args)


class RegisterPasskeyRequest(TLRequest):
    """TL type: account.registerPasskey"""
    CONSTRUCTOR_ID = 0x55b41fd6
    SUBCLASS_OF_ID = 0xcf380de0

    def __init__(self, credential: 'TypeInputPasskeyCredential'):
        self.credential = credential

    def to_dict(self):
        return {
            '_': 'RegisterPasskeyRequest',
            'credential': self.credential,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.credential))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_credential = reader.tgread_object()
        _args['credential'] = _val_credential
        return cls(**_args)


class ReorderUsernamesRequest(TLRequest):
    """TL type: account.reorderUsernames"""
    CONSTRUCTOR_ID = 0xef500eab
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, order: List[str]):
        self.order = order

    def to_dict(self):
        return {
            '_': 'ReorderUsernamesRequest',
            'order': self.order,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<i', 0x1cb5c415))  # vector id
        buf.write(struct.pack('<i', len(self.order)))
        for item in self.order:
            buf.write(TLObject.serialize_bytes(self.item))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        reader.read_int(signed=False)  # skip vector id
        _count_order = reader.read_int()
        _list_order = []
        for _ in range(_count_order):
            _item_order = reader.tgread_string()
            _list_order.append(_item_order)
        _args['order'] = _list_order
        return cls(**_args)


class ReportPeerRequest(TLRequest):
    """TL type: account.reportPeer"""
    CONSTRUCTOR_ID = 0xc5ba3d86
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, peer: 'TypeInputPeer', reason: 'TypeReportReason', message: str):
        self.peer = peer
        self.reason = reason
        self.message = message

    def to_dict(self):
        return {
            '_': 'ReportPeerRequest',
            'peer': self.peer,
            'reason': self.reason,
            'message': self.message,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.peer))
        buf.write(bytes(self.reason))
        buf.write(TLObject.serialize_bytes(self.message))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_peer = reader.tgread_object()
        _args['peer'] = _val_peer
        _val_reason = reader.tgread_object()
        _args['reason'] = _val_reason
        _val_message = reader.tgread_string()
        _args['message'] = _val_message
        return cls(**_args)


class ReportProfilePhotoRequest(TLRequest):
    """TL type: account.reportProfilePhoto"""
    CONSTRUCTOR_ID = 0xfa8cc6f5
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, peer: 'TypeInputPeer', photo_id: 'TypeInputPhoto', reason: 'TypeReportReason', message: str):
        self.peer = peer
        self.photo_id = photo_id
        self.reason = reason
        self.message = message

    def to_dict(self):
        return {
            '_': 'ReportProfilePhotoRequest',
            'peer': self.peer,
            'photo_id': self.photo_id,
            'reason': self.reason,
            'message': self.message,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.peer))
        buf.write(bytes(self.photo_id))
        buf.write(bytes(self.reason))
        buf.write(TLObject.serialize_bytes(self.message))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_peer = reader.tgread_object()
        _args['peer'] = _val_peer
        _val_photo_id = reader.tgread_object()
        _args['photo_id'] = _val_photo_id
        _val_reason = reader.tgread_object()
        _args['reason'] = _val_reason
        _val_message = reader.tgread_string()
        _args['message'] = _val_message
        return cls(**_args)


class ResendPasswordEmailRequest(TLRequest):
    """TL type: account.resendPasswordEmail"""
    CONSTRUCTOR_ID = 0x7a7f2a15
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'ResendPasswordEmailRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class ResetAuthorizationRequest(TLRequest):
    """TL type: account.resetAuthorization"""
    CONSTRUCTOR_ID = 0xdf77f3bc
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, hash: int):
        self.hash = hash

    def to_dict(self):
        return {
            '_': 'ResetAuthorizationRequest',
            'hash': self.hash,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<q', self.hash))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_hash = reader.read_long()
        _args['hash'] = _val_hash
        return cls(**_args)


class ResetNotifySettingsRequest(TLRequest):
    """TL type: account.resetNotifySettings"""
    CONSTRUCTOR_ID = 0xdb7e1747
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'ResetNotifySettingsRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class ResetPasswordRequest(TLRequest):
    """TL type: account.resetPassword"""
    CONSTRUCTOR_ID = 0x9308ce1b
    SUBCLASS_OF_ID = 0x49507416

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'ResetPasswordRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class ResetWallPapersRequest(TLRequest):
    """TL type: account.resetWallPapers"""
    CONSTRUCTOR_ID = 0xbb3b9804
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'ResetWallPapersRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class ResetWebAuthorizationRequest(TLRequest):
    """TL type: account.resetWebAuthorization"""
    CONSTRUCTOR_ID = 0x2d01b9ef
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, hash: int):
        self.hash = hash

    def to_dict(self):
        return {
            '_': 'ResetWebAuthorizationRequest',
            'hash': self.hash,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<q', self.hash))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_hash = reader.read_long()
        _args['hash'] = _val_hash
        return cls(**_args)


class ResetWebAuthorizationsRequest(TLRequest):
    """TL type: account.resetWebAuthorizations"""
    CONSTRUCTOR_ID = 0x682d2594
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self):
        pass

    def to_dict(self):
        return {
            '_': 'ResetWebAuthorizationsRequest',
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        return cls()


class ResolveBusinessChatLinkRequest(TLRequest):
    """TL type: account.resolveBusinessChatLink"""
    CONSTRUCTOR_ID = 0x5492e5ee
    SUBCLASS_OF_ID = 0x3a772c28

    def __init__(self, slug: str):
        self.slug = slug

    def to_dict(self):
        return {
            '_': 'ResolveBusinessChatLinkRequest',
            'slug': self.slug,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(TLObject.serialize_bytes(self.slug))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_slug = reader.tgread_string()
        _args['slug'] = _val_slug
        return cls(**_args)


class SaveAutoDownloadSettingsRequest(TLRequest):
    """TL type: account.saveAutoDownloadSettings"""
    CONSTRUCTOR_ID = 0x76f36233
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, settings: 'TypeAutoDownloadSettings', low: Optional[bool] = None, high: Optional[bool] = None):
        self.settings = settings
        self.low = low
        self.high = high

    def to_dict(self):
        return {
            '_': 'SaveAutoDownloadSettingsRequest',
            'settings': self.settings,
            'low': self.low,
            'high': self.high,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.low:
            flags |= (1 << 0)
        if self.high:
            flags |= (1 << 1)
        buf.write(struct.pack('<I', flags))
        buf.write(bytes(self.settings))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        _args['low'] = bool(flags & (1 << 0))
        _args['high'] = bool(flags & (1 << 1))
        _val_settings = reader.tgread_object()
        _args['settings'] = _val_settings
        return cls(**_args)


class SaveAutoSaveSettingsRequest(TLRequest):
    """TL type: account.saveAutoSaveSettings"""
    CONSTRUCTOR_ID = 0xd69b8361
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, settings: 'TypeAutoSaveSettings', users: Optional[bool] = None, chats: Optional[bool] = None, broadcasts: Optional[bool] = None, peer: Optional['TypeInputPeer'] = None):
        self.settings = settings
        self.users = users
        self.chats = chats
        self.broadcasts = broadcasts
        self.peer = peer

    def to_dict(self):
        return {
            '_': 'SaveAutoSaveSettingsRequest',
            'settings': self.settings,
            'users': self.users,
            'chats': self.chats,
            'broadcasts': self.broadcasts,
            'peer': self.peer,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.users:
            flags |= (1 << 0)
        if self.chats:
            flags |= (1 << 1)
        if self.broadcasts:
            flags |= (1 << 2)
        if self.peer is not None:
            flags |= (1 << 3)
        buf.write(struct.pack('<I', flags))
        buf.write(bytes(self.settings))
        if self.peer is not None:
            buf.write(bytes(self.peer))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        _args['users'] = bool(flags & (1 << 0))
        _args['chats'] = bool(flags & (1 << 1))
        _args['broadcasts'] = bool(flags & (1 << 2))
        if flags & (1 << 3):
            _val_peer = reader.tgread_object()
            _args['peer'] = _val_peer
        else:
            _args['peer'] = None
        _val_settings = reader.tgread_object()
        _args['settings'] = _val_settings
        return cls(**_args)


class SaveMusicRequest(TLRequest):
    """TL type: account.saveMusic"""
    CONSTRUCTOR_ID = 0xb26732a9
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, id: 'TypeInputDocument', unsave: Optional[bool] = None, after_id: Optional['TypeInputDocument'] = None):
        self.id = id
        self.unsave = unsave
        self.after_id = after_id

    def to_dict(self):
        return {
            '_': 'SaveMusicRequest',
            'id': self.id,
            'unsave': self.unsave,
            'after_id': self.after_id,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.unsave:
            flags |= (1 << 0)
        if self.after_id is not None:
            flags |= (1 << 1)
        buf.write(struct.pack('<I', flags))
        buf.write(bytes(self.id))
        if self.after_id is not None:
            buf.write(bytes(self.after_id))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        _args['unsave'] = bool(flags & (1 << 0))
        _val_id = reader.tgread_object()
        _args['id'] = _val_id
        if flags & (1 << 1):
            _val_after_id = reader.tgread_object()
            _args['after_id'] = _val_after_id
        else:
            _args['after_id'] = None
        return cls(**_args)


class SaveRingtoneRequest(TLRequest):
    """TL type: account.saveRingtone"""
    CONSTRUCTOR_ID = 0x3dea5b03
    SUBCLASS_OF_ID = 0xb1e28424

    def __init__(self, id: 'TypeInputDocument', unsave: bool):
        self.id = id
        self.unsave = unsave

    def to_dict(self):
        return {
            '_': 'SaveRingtoneRequest',
            'id': self.id,
            'unsave': self.unsave,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.id))
        buf.write(struct.pack('<I', 0x997275b5 if self.unsave else 0xbc799737))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_id = reader.tgread_object()
        _args['id'] = _val_id
        _val_unsave = reader.tgread_bool()
        _args['unsave'] = _val_unsave
        return cls(**_args)


class SaveSecureValueRequest(TLRequest):
    """TL type: account.saveSecureValue"""
    CONSTRUCTOR_ID = 0x899fe31d
    SUBCLASS_OF_ID = 0x051138ae

    def __init__(self, value: 'TypeInputSecureValue', secure_secret_id: int):
        self.value = value
        self.secure_secret_id = secure_secret_id

    def to_dict(self):
        return {
            '_': 'SaveSecureValueRequest',
            'value': self.value,
            'secure_secret_id': self.secure_secret_id,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.value))
        buf.write(struct.pack('<q', self.secure_secret_id))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_value = reader.tgread_object()
        _args['value'] = _val_value
        _val_secure_secret_id = reader.read_long()
        _args['secure_secret_id'] = _val_secure_secret_id
        return cls(**_args)


class SaveThemeRequest(TLRequest):
    """TL type: account.saveTheme"""
    CONSTRUCTOR_ID = 0xf257106c
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, theme: 'TypeInputTheme', unsave: bool):
        self.theme = theme
        self.unsave = unsave

    def to_dict(self):
        return {
            '_': 'SaveThemeRequest',
            'theme': self.theme,
            'unsave': self.unsave,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.theme))
        buf.write(struct.pack('<I', 0x997275b5 if self.unsave else 0xbc799737))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_theme = reader.tgread_object()
        _args['theme'] = _val_theme
        _val_unsave = reader.tgread_bool()
        _args['unsave'] = _val_unsave
        return cls(**_args)


class SaveWallPaperRequest(TLRequest):
    """TL type: account.saveWallPaper"""
    CONSTRUCTOR_ID = 0x6c5a5b37
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, wallpaper: 'TypeInputWallPaper', unsave: bool, settings: 'TypeWallPaperSettings'):
        self.wallpaper = wallpaper
        self.unsave = unsave
        self.settings = settings

    def to_dict(self):
        return {
            '_': 'SaveWallPaperRequest',
            'wallpaper': self.wallpaper,
            'unsave': self.unsave,
            'settings': self.settings,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.wallpaper))
        buf.write(struct.pack('<I', 0x997275b5 if self.unsave else 0xbc799737))
        buf.write(bytes(self.settings))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_wallpaper = reader.tgread_object()
        _args['wallpaper'] = _val_wallpaper
        _val_unsave = reader.tgread_bool()
        _args['unsave'] = _val_unsave
        _val_settings = reader.tgread_object()
        _args['settings'] = _val_settings
        return cls(**_args)


class SendChangePhoneCodeRequest(TLRequest):
    """TL type: account.sendChangePhoneCode"""
    CONSTRUCTOR_ID = 0x82574ae5
    SUBCLASS_OF_ID = 0x6ce87081

    def __init__(self, phone_number: str, settings: 'TypeCodeSettings'):
        self.phone_number = phone_number
        self.settings = settings

    def to_dict(self):
        return {
            '_': 'SendChangePhoneCodeRequest',
            'phone_number': self.phone_number,
            'settings': self.settings,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(TLObject.serialize_bytes(self.phone_number))
        buf.write(bytes(self.settings))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_phone_number = reader.tgread_string()
        _args['phone_number'] = _val_phone_number
        _val_settings = reader.tgread_object()
        _args['settings'] = _val_settings
        return cls(**_args)


class SendConfirmPhoneCodeRequest(TLRequest):
    """TL type: account.sendConfirmPhoneCode"""
    CONSTRUCTOR_ID = 0x1b3faa88
    SUBCLASS_OF_ID = 0x6ce87081

    def __init__(self, hash: str, settings: 'TypeCodeSettings'):
        self.hash = hash
        self.settings = settings

    def to_dict(self):
        return {
            '_': 'SendConfirmPhoneCodeRequest',
            'hash': self.hash,
            'settings': self.settings,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(TLObject.serialize_bytes(self.hash))
        buf.write(bytes(self.settings))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_hash = reader.tgread_string()
        _args['hash'] = _val_hash
        _val_settings = reader.tgread_object()
        _args['settings'] = _val_settings
        return cls(**_args)


class SendVerifyEmailCodeRequest(TLRequest):
    """TL type: account.sendVerifyEmailCode"""
    CONSTRUCTOR_ID = 0x98e037bb
    SUBCLASS_OF_ID = 0x69f3c06e

    def __init__(self, purpose: 'TypeEmailVerifyPurpose', email: str):
        self.purpose = purpose
        self.email = email

    def to_dict(self):
        return {
            '_': 'SendVerifyEmailCodeRequest',
            'purpose': self.purpose,
            'email': self.email,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.purpose))
        buf.write(TLObject.serialize_bytes(self.email))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_purpose = reader.tgread_object()
        _args['purpose'] = _val_purpose
        _val_email = reader.tgread_string()
        _args['email'] = _val_email
        return cls(**_args)


class SendVerifyPhoneCodeRequest(TLRequest):
    """TL type: account.sendVerifyPhoneCode"""
    CONSTRUCTOR_ID = 0xa5a356f9
    SUBCLASS_OF_ID = 0x6ce87081

    def __init__(self, phone_number: str, settings: 'TypeCodeSettings'):
        self.phone_number = phone_number
        self.settings = settings

    def to_dict(self):
        return {
            '_': 'SendVerifyPhoneCodeRequest',
            'phone_number': self.phone_number,
            'settings': self.settings,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(TLObject.serialize_bytes(self.phone_number))
        buf.write(bytes(self.settings))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_phone_number = reader.tgread_string()
        _args['phone_number'] = _val_phone_number
        _val_settings = reader.tgread_object()
        _args['settings'] = _val_settings
        return cls(**_args)


class SetAccountTtlRequest(TLRequest):
    """TL type: account.setAccountTTL"""
    CONSTRUCTOR_ID = 0x2442485e
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, ttl: 'TypeAccountDaysTTL'):
        self.ttl = ttl

    def to_dict(self):
        return {
            '_': 'SetAccountTtlRequest',
            'ttl': self.ttl,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.ttl))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_ttl = reader.tgread_object()
        _args['ttl'] = _val_ttl
        return cls(**_args)


class SetAuthorizationTtlRequest(TLRequest):
    """TL type: account.setAuthorizationTTL"""
    CONSTRUCTOR_ID = 0xbf899aa0
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, authorization_ttl_days: int):
        self.authorization_ttl_days = authorization_ttl_days

    def to_dict(self):
        return {
            '_': 'SetAuthorizationTtlRequest',
            'authorization_ttl_days': self.authorization_ttl_days,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<i', self.authorization_ttl_days))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_authorization_ttl_days = reader.read_int()
        _args['authorization_ttl_days'] = _val_authorization_ttl_days
        return cls(**_args)


class SetContactSignUpNotificationRequest(TLRequest):
    """TL type: account.setContactSignUpNotification"""
    CONSTRUCTOR_ID = 0xcff43f61
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, silent: bool):
        self.silent = silent

    def to_dict(self):
        return {
            '_': 'SetContactSignUpNotificationRequest',
            'silent': self.silent,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<I', 0x997275b5 if self.silent else 0xbc799737))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_silent = reader.tgread_bool()
        _args['silent'] = _val_silent
        return cls(**_args)


class SetContentSettingsRequest(TLRequest):
    """TL type: account.setContentSettings"""
    CONSTRUCTOR_ID = 0xb574b16b
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, sensitive_enabled: Optional[bool] = None):
        self.sensitive_enabled = sensitive_enabled

    def to_dict(self):
        return {
            '_': 'SetContentSettingsRequest',
            'sensitive_enabled': self.sensitive_enabled,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.sensitive_enabled:
            flags |= (1 << 0)
        buf.write(struct.pack('<I', flags))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        _args['sensitive_enabled'] = bool(flags & (1 << 0))
        return cls(**_args)


class SetGlobalPrivacySettingsRequest(TLRequest):
    """TL type: account.setGlobalPrivacySettings"""
    CONSTRUCTOR_ID = 0x1edaaac2
    SUBCLASS_OF_ID = 0xc90e5770

    def __init__(self, settings: 'TypeGlobalPrivacySettings'):
        self.settings = settings

    def to_dict(self):
        return {
            '_': 'SetGlobalPrivacySettingsRequest',
            'settings': self.settings,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.settings))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_settings = reader.tgread_object()
        _args['settings'] = _val_settings
        return cls(**_args)


class SetMainProfileTabRequest(TLRequest):
    """TL type: account.setMainProfileTab"""
    CONSTRUCTOR_ID = 0x5dee78b0
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, tab: 'TypeProfileTab'):
        self.tab = tab

    def to_dict(self):
        return {
            '_': 'SetMainProfileTabRequest',
            'tab': self.tab,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.tab))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_tab = reader.tgread_object()
        _args['tab'] = _val_tab
        return cls(**_args)


class SetPrivacyRequest(TLRequest):
    """TL type: account.setPrivacy"""
    CONSTRUCTOR_ID = 0xc9f81ce8
    SUBCLASS_OF_ID = 0xb55aba82

    def __init__(self, key: 'TypeInputPrivacyKey', rules: List['TypeInputPrivacyRule']):
        self.key = key
        self.rules = rules

    def to_dict(self):
        return {
            '_': 'SetPrivacyRequest',
            'key': self.key,
            'rules': self.rules,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.key))
        buf.write(struct.pack('<i', 0x1cb5c415))  # vector id
        buf.write(struct.pack('<i', len(self.rules)))
        for item in self.rules:
            buf.write(bytes(self.item))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_key = reader.tgread_object()
        _args['key'] = _val_key
        reader.read_int(signed=False)  # skip vector id
        _count_rules = reader.read_int()
        _list_rules = []
        for _ in range(_count_rules):
            _item_rules = reader.tgread_object()
            _list_rules.append(_item_rules)
        _args['rules'] = _list_rules
        return cls(**_args)


class SetReactionsNotifySettingsRequest(TLRequest):
    """TL type: account.setReactionsNotifySettings"""
    CONSTRUCTOR_ID = 0x316ce548
    SUBCLASS_OF_ID = 0x8dff0851

    def __init__(self, settings: 'TypeReactionsNotifySettings'):
        self.settings = settings

    def to_dict(self):
        return {
            '_': 'SetReactionsNotifySettingsRequest',
            'settings': self.settings,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.settings))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_settings = reader.tgread_object()
        _args['settings'] = _val_settings
        return cls(**_args)


class ToggleConnectedBotPausedRequest(TLRequest):
    """TL type: account.toggleConnectedBotPaused"""
    CONSTRUCTOR_ID = 0x646e1097
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, peer: 'TypeInputPeer', paused: bool):
        self.peer = peer
        self.paused = paused

    def to_dict(self):
        return {
            '_': 'ToggleConnectedBotPausedRequest',
            'peer': self.peer,
            'paused': self.paused,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.peer))
        buf.write(struct.pack('<I', 0x997275b5 if self.paused else 0xbc799737))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_peer = reader.tgread_object()
        _args['peer'] = _val_peer
        _val_paused = reader.tgread_bool()
        _args['paused'] = _val_paused
        return cls(**_args)


class ToggleNoPaidMessagesExceptionRequest(TLRequest):
    """TL type: account.toggleNoPaidMessagesException"""
    CONSTRUCTOR_ID = 0xfe2eda76
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, user_id: 'TypeInputUser', refund_charged: Optional[bool] = None, require_payment: Optional[bool] = None, parent_peer: Optional['TypeInputPeer'] = None):
        self.user_id = user_id
        self.refund_charged = refund_charged
        self.require_payment = require_payment
        self.parent_peer = parent_peer

    def to_dict(self):
        return {
            '_': 'ToggleNoPaidMessagesExceptionRequest',
            'user_id': self.user_id,
            'refund_charged': self.refund_charged,
            'require_payment': self.require_payment,
            'parent_peer': self.parent_peer,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.refund_charged:
            flags |= (1 << 0)
        if self.require_payment:
            flags |= (1 << 2)
        if self.parent_peer is not None:
            flags |= (1 << 1)
        buf.write(struct.pack('<I', flags))
        buf.write(bytes(self.user_id))
        if self.parent_peer is not None:
            buf.write(bytes(self.parent_peer))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        _args['refund_charged'] = bool(flags & (1 << 0))
        _args['require_payment'] = bool(flags & (1 << 2))
        if flags & (1 << 1):
            _val_parent_peer = reader.tgread_object()
            _args['parent_peer'] = _val_parent_peer
        else:
            _args['parent_peer'] = None
        _val_user_id = reader.tgread_object()
        _args['user_id'] = _val_user_id
        return cls(**_args)


class ToggleSponsoredMessagesRequest(TLRequest):
    """TL type: account.toggleSponsoredMessages"""
    CONSTRUCTOR_ID = 0xb9d9a38d
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, enabled: bool):
        self.enabled = enabled

    def to_dict(self):
        return {
            '_': 'ToggleSponsoredMessagesRequest',
            'enabled': self.enabled,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<I', 0x997275b5 if self.enabled else 0xbc799737))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_enabled = reader.tgread_bool()
        _args['enabled'] = _val_enabled
        return cls(**_args)


class ToggleUsernameRequest(TLRequest):
    """TL type: account.toggleUsername"""
    CONSTRUCTOR_ID = 0x58d6b376
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, username: str, active: bool):
        self.username = username
        self.active = active

    def to_dict(self):
        return {
            '_': 'ToggleUsernameRequest',
            'username': self.username,
            'active': self.active,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(TLObject.serialize_bytes(self.username))
        buf.write(struct.pack('<I', 0x997275b5 if self.active else 0xbc799737))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_username = reader.tgread_string()
        _args['username'] = _val_username
        _val_active = reader.tgread_bool()
        _args['active'] = _val_active
        return cls(**_args)


class UnregisterDeviceRequest(TLRequest):
    """TL type: account.unregisterDevice"""
    CONSTRUCTOR_ID = 0x6a0d3206
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, token_type: int, token: str, other_uids: List[int]):
        self.token_type = token_type
        self.token = token
        self.other_uids = other_uids

    def to_dict(self):
        return {
            '_': 'UnregisterDeviceRequest',
            'token_type': self.token_type,
            'token': self.token,
            'other_uids': self.other_uids,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<i', self.token_type))
        buf.write(TLObject.serialize_bytes(self.token))
        buf.write(struct.pack('<i', 0x1cb5c415))  # vector id
        buf.write(struct.pack('<i', len(self.other_uids)))
        for item in self.other_uids:
            buf.write(struct.pack('<q', self.item))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_token_type = reader.read_int()
        _args['token_type'] = _val_token_type
        _val_token = reader.tgread_string()
        _args['token'] = _val_token
        reader.read_int(signed=False)  # skip vector id
        _count_other_uids = reader.read_int()
        _list_other_uids = []
        for _ in range(_count_other_uids):
            _item_other_uids = reader.read_long()
            _list_other_uids.append(_item_other_uids)
        _args['other_uids'] = _list_other_uids
        return cls(**_args)


class UpdateBirthdayRequest(TLRequest):
    """TL type: account.updateBirthday"""
    CONSTRUCTOR_ID = 0xcc6e0c11
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, birthday: Optional['TypeBirthday'] = None):
        self.birthday = birthday

    def to_dict(self):
        return {
            '_': 'UpdateBirthdayRequest',
            'birthday': self.birthday,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.birthday is not None:
            flags |= (1 << 0)
        buf.write(struct.pack('<I', flags))
        if self.birthday is not None:
            buf.write(bytes(self.birthday))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        if flags & (1 << 0):
            _val_birthday = reader.tgread_object()
            _args['birthday'] = _val_birthday
        else:
            _args['birthday'] = None
        return cls(**_args)


class UpdateBusinessAwayMessageRequest(TLRequest):
    """TL type: account.updateBusinessAwayMessage"""
    CONSTRUCTOR_ID = 0xa26a7fa5
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, message: Optional['TypeInputBusinessAwayMessage'] = None):
        self.message = message

    def to_dict(self):
        return {
            '_': 'UpdateBusinessAwayMessageRequest',
            'message': self.message,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.message is not None:
            flags |= (1 << 0)
        buf.write(struct.pack('<I', flags))
        if self.message is not None:
            buf.write(bytes(self.message))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        if flags & (1 << 0):
            _val_message = reader.tgread_object()
            _args['message'] = _val_message
        else:
            _args['message'] = None
        return cls(**_args)


class UpdateBusinessGreetingMessageRequest(TLRequest):
    """TL type: account.updateBusinessGreetingMessage"""
    CONSTRUCTOR_ID = 0x66cdafc4
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, message: Optional['TypeInputBusinessGreetingMessage'] = None):
        self.message = message

    def to_dict(self):
        return {
            '_': 'UpdateBusinessGreetingMessageRequest',
            'message': self.message,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.message is not None:
            flags |= (1 << 0)
        buf.write(struct.pack('<I', flags))
        if self.message is not None:
            buf.write(bytes(self.message))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        if flags & (1 << 0):
            _val_message = reader.tgread_object()
            _args['message'] = _val_message
        else:
            _args['message'] = None
        return cls(**_args)


class UpdateBusinessIntroRequest(TLRequest):
    """TL type: account.updateBusinessIntro"""
    CONSTRUCTOR_ID = 0xa614d034
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, intro: Optional['TypeInputBusinessIntro'] = None):
        self.intro = intro

    def to_dict(self):
        return {
            '_': 'UpdateBusinessIntroRequest',
            'intro': self.intro,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.intro is not None:
            flags |= (1 << 0)
        buf.write(struct.pack('<I', flags))
        if self.intro is not None:
            buf.write(bytes(self.intro))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        if flags & (1 << 0):
            _val_intro = reader.tgread_object()
            _args['intro'] = _val_intro
        else:
            _args['intro'] = None
        return cls(**_args)


class UpdateBusinessLocationRequest(TLRequest):
    """TL type: account.updateBusinessLocation"""
    CONSTRUCTOR_ID = 0x9e6b131a
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, geo_point: Optional['TypeInputGeoPoint'] = None, address: Optional[str] = None):
        self.geo_point = geo_point
        self.address = address

    def to_dict(self):
        return {
            '_': 'UpdateBusinessLocationRequest',
            'geo_point': self.geo_point,
            'address': self.address,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.geo_point is not None:
            flags |= (1 << 1)
        if self.address is not None:
            flags |= (1 << 0)
        buf.write(struct.pack('<I', flags))
        if self.geo_point is not None:
            buf.write(bytes(self.geo_point))
        if self.address is not None:
            buf.write(TLObject.serialize_bytes(self.address))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        if flags & (1 << 1):
            _val_geo_point = reader.tgread_object()
            _args['geo_point'] = _val_geo_point
        else:
            _args['geo_point'] = None
        if flags & (1 << 0):
            _val_address = reader.tgread_string()
            _args['address'] = _val_address
        else:
            _args['address'] = None
        return cls(**_args)


class UpdateBusinessWorkHoursRequest(TLRequest):
    """TL type: account.updateBusinessWorkHours"""
    CONSTRUCTOR_ID = 0x4b00e066
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, business_work_hours: Optional['TypeBusinessWorkHours'] = None):
        self.business_work_hours = business_work_hours

    def to_dict(self):
        return {
            '_': 'UpdateBusinessWorkHoursRequest',
            'business_work_hours': self.business_work_hours,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.business_work_hours is not None:
            flags |= (1 << 0)
        buf.write(struct.pack('<I', flags))
        if self.business_work_hours is not None:
            buf.write(bytes(self.business_work_hours))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        if flags & (1 << 0):
            _val_business_work_hours = reader.tgread_object()
            _args['business_work_hours'] = _val_business_work_hours
        else:
            _args['business_work_hours'] = None
        return cls(**_args)


class UpdateColorRequest(TLRequest):
    """TL type: account.updateColor"""
    CONSTRUCTOR_ID = 0x684d214e
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, for_profile: Optional[bool] = None, color: Optional['TypePeerColor'] = None):
        self.for_profile = for_profile
        self.color = color

    def to_dict(self):
        return {
            '_': 'UpdateColorRequest',
            'for_profile': self.for_profile,
            'color': self.color,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.for_profile:
            flags |= (1 << 1)
        if self.color is not None:
            flags |= (1 << 2)
        buf.write(struct.pack('<I', flags))
        if self.color is not None:
            buf.write(bytes(self.color))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        _args['for_profile'] = bool(flags & (1 << 1))
        if flags & (1 << 2):
            _val_color = reader.tgread_object()
            _args['color'] = _val_color
        else:
            _args['color'] = None
        return cls(**_args)


class UpdateConnectedBotRequest(TLRequest):
    """TL type: account.updateConnectedBot"""
    CONSTRUCTOR_ID = 0x66a08c7e
    SUBCLASS_OF_ID = 0x8af52aac

    def __init__(self, bot: 'TypeInputUser', recipients: 'TypeInputBusinessBotRecipients', deleted: Optional[bool] = None, rights: Optional['TypeBusinessBotRights'] = None):
        self.bot = bot
        self.recipients = recipients
        self.deleted = deleted
        self.rights = rights

    def to_dict(self):
        return {
            '_': 'UpdateConnectedBotRequest',
            'bot': self.bot,
            'recipients': self.recipients,
            'deleted': self.deleted,
            'rights': self.rights,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.deleted:
            flags |= (1 << 1)
        if self.rights is not None:
            flags |= (1 << 0)
        buf.write(struct.pack('<I', flags))
        buf.write(bytes(self.bot))
        buf.write(bytes(self.recipients))
        if self.rights is not None:
            buf.write(bytes(self.rights))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        _args['deleted'] = bool(flags & (1 << 1))
        if flags & (1 << 0):
            _val_rights = reader.tgread_object()
            _args['rights'] = _val_rights
        else:
            _args['rights'] = None
        _val_bot = reader.tgread_object()
        _args['bot'] = _val_bot
        _val_recipients = reader.tgread_object()
        _args['recipients'] = _val_recipients
        return cls(**_args)


class UpdateDeviceLockedRequest(TLRequest):
    """TL type: account.updateDeviceLocked"""
    CONSTRUCTOR_ID = 0x38df3532
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, period: int):
        self.period = period

    def to_dict(self):
        return {
            '_': 'UpdateDeviceLockedRequest',
            'period': self.period,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<i', self.period))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_period = reader.read_int()
        _args['period'] = _val_period
        return cls(**_args)


class UpdateEmojiStatusRequest(TLRequest):
    """TL type: account.updateEmojiStatus"""
    CONSTRUCTOR_ID = 0xfbd3de6b
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, emoji_status: 'TypeEmojiStatus'):
        self.emoji_status = emoji_status

    def to_dict(self):
        return {
            '_': 'UpdateEmojiStatusRequest',
            'emoji_status': self.emoji_status,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.emoji_status))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_emoji_status = reader.tgread_object()
        _args['emoji_status'] = _val_emoji_status
        return cls(**_args)


class UpdateNotifySettingsRequest(TLRequest):
    """TL type: account.updateNotifySettings"""
    CONSTRUCTOR_ID = 0x84be5b93
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, peer: 'TypeInputNotifyPeer', settings: 'TypeInputPeerNotifySettings'):
        self.peer = peer
        self.settings = settings

    def to_dict(self):
        return {
            '_': 'UpdateNotifySettingsRequest',
            'peer': self.peer,
            'settings': self.settings,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.peer))
        buf.write(bytes(self.settings))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_peer = reader.tgread_object()
        _args['peer'] = _val_peer
        _val_settings = reader.tgread_object()
        _args['settings'] = _val_settings
        return cls(**_args)


class UpdatePasswordSettingsRequest(TLRequest):
    """TL type: account.updatePasswordSettings"""
    CONSTRUCTOR_ID = 0xa59b102f
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, password: 'TypeInputCheckPasswordSRP', new_settings: 'TypePasswordInputSettings'):
        self.password = password
        self.new_settings = new_settings

    def to_dict(self):
        return {
            '_': 'UpdatePasswordSettingsRequest',
            'password': self.password,
            'new_settings': self.new_settings,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.password))
        buf.write(bytes(self.new_settings))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_password = reader.tgread_object()
        _args['password'] = _val_password
        _val_new_settings = reader.tgread_object()
        _args['new_settings'] = _val_new_settings
        return cls(**_args)


class UpdatePersonalChannelRequest(TLRequest):
    """TL type: account.updatePersonalChannel"""
    CONSTRUCTOR_ID = 0xd94305e0
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, channel: 'TypeInputChannel'):
        self.channel = channel

    def to_dict(self):
        return {
            '_': 'UpdatePersonalChannelRequest',
            'channel': self.channel,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.channel))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_channel = reader.tgread_object()
        _args['channel'] = _val_channel
        return cls(**_args)


class UpdateProfileRequest(TLRequest):
    """TL type: account.updateProfile"""
    CONSTRUCTOR_ID = 0x78515775
    SUBCLASS_OF_ID = 0x2da17977

    def __init__(self, first_name: Optional[str] = None, last_name: Optional[str] = None, about: Optional[str] = None):
        self.first_name = first_name
        self.last_name = last_name
        self.about = about

    def to_dict(self):
        return {
            '_': 'UpdateProfileRequest',
            'first_name': self.first_name,
            'last_name': self.last_name,
            'about': self.about,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.first_name is not None:
            flags |= (1 << 0)
        if self.last_name is not None:
            flags |= (1 << 1)
        if self.about is not None:
            flags |= (1 << 2)
        buf.write(struct.pack('<I', flags))
        if self.first_name is not None:
            buf.write(TLObject.serialize_bytes(self.first_name))
        if self.last_name is not None:
            buf.write(TLObject.serialize_bytes(self.last_name))
        if self.about is not None:
            buf.write(TLObject.serialize_bytes(self.about))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        if flags & (1 << 0):
            _val_first_name = reader.tgread_string()
            _args['first_name'] = _val_first_name
        else:
            _args['first_name'] = None
        if flags & (1 << 1):
            _val_last_name = reader.tgread_string()
            _args['last_name'] = _val_last_name
        else:
            _args['last_name'] = None
        if flags & (1 << 2):
            _val_about = reader.tgread_string()
            _args['about'] = _val_about
        else:
            _args['about'] = None
        return cls(**_args)


class UpdateStatusRequest(TLRequest):
    """TL type: account.updateStatus"""
    CONSTRUCTOR_ID = 0x6628562c
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, offline: bool):
        self.offline = offline

    def to_dict(self):
        return {
            '_': 'UpdateStatusRequest',
            'offline': self.offline,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(struct.pack('<I', 0x997275b5 if self.offline else 0xbc799737))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_offline = reader.tgread_bool()
        _args['offline'] = _val_offline
        return cls(**_args)


class UpdateThemeRequest(TLRequest):
    """TL type: account.updateTheme"""
    CONSTRUCTOR_ID = 0x2bf40ccc
    SUBCLASS_OF_ID = 0x56b4c80c

    def __init__(self, format: str, theme: 'TypeInputTheme', slug: Optional[str] = None, title: Optional[str] = None, document: Optional['TypeInputDocument'] = None, settings: Optional[List['TypeInputThemeSettings']] = None):
        self.format = format
        self.theme = theme
        self.slug = slug
        self.title = title
        self.document = document
        self.settings = settings

    def to_dict(self):
        return {
            '_': 'UpdateThemeRequest',
            'format': self.format,
            'theme': self.theme,
            'slug': self.slug,
            'title': self.title,
            'document': self.document,
            'settings': self.settings,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.slug is not None:
            flags |= (1 << 0)
        if self.title is not None:
            flags |= (1 << 1)
        if self.document is not None:
            flags |= (1 << 2)
        if self.settings is not None:
            flags |= (1 << 3)
        buf.write(struct.pack('<I', flags))
        buf.write(TLObject.serialize_bytes(self.format))
        buf.write(bytes(self.theme))
        if self.slug is not None:
            buf.write(TLObject.serialize_bytes(self.slug))
        if self.title is not None:
            buf.write(TLObject.serialize_bytes(self.title))
        if self.document is not None:
            buf.write(bytes(self.document))
        if self.settings is not None:
            buf.write(struct.pack('<i', 0x1cb5c415))  # vector id
            buf.write(struct.pack('<i', len(self.settings)))
            for item in self.settings:
                buf.write(bytes(self.item))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        _val_format = reader.tgread_string()
        _args['format'] = _val_format
        _val_theme = reader.tgread_object()
        _args['theme'] = _val_theme
        if flags & (1 << 0):
            _val_slug = reader.tgread_string()
            _args['slug'] = _val_slug
        else:
            _args['slug'] = None
        if flags & (1 << 1):
            _val_title = reader.tgread_string()
            _args['title'] = _val_title
        else:
            _args['title'] = None
        if flags & (1 << 2):
            _val_document = reader.tgread_object()
            _args['document'] = _val_document
        else:
            _args['document'] = None
        if flags & (1 << 3):
            reader.read_int(signed=False)  # skip vector id
            _count_settings = reader.read_int()
            _list_settings = []
            for _ in range(_count_settings):
                _item_settings = reader.tgread_object()
                _list_settings.append(_item_settings)
            _args['settings'] = _list_settings
        else:
            _args['settings'] = None
        return cls(**_args)


class UpdateUsernameRequest(TLRequest):
    """TL type: account.updateUsername"""
    CONSTRUCTOR_ID = 0x3e0bdd7c
    SUBCLASS_OF_ID = 0x2da17977

    def __init__(self, username: str):
        self.username = username

    def to_dict(self):
        return {
            '_': 'UpdateUsernameRequest',
            'username': self.username,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(TLObject.serialize_bytes(self.username))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_username = reader.tgread_string()
        _args['username'] = _val_username
        return cls(**_args)


class UploadRingtoneRequest(TLRequest):
    """TL type: account.uploadRingtone"""
    CONSTRUCTOR_ID = 0x831a83a2
    SUBCLASS_OF_ID = 0x211fe820

    def __init__(self, file: 'TypeInputFile', file_name: str, mime_type: str):
        self.file = file
        self.file_name = file_name
        self.mime_type = mime_type

    def to_dict(self):
        return {
            '_': 'UploadRingtoneRequest',
            'file': self.file,
            'file_name': self.file_name,
            'mime_type': self.mime_type,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.file))
        buf.write(TLObject.serialize_bytes(self.file_name))
        buf.write(TLObject.serialize_bytes(self.mime_type))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_file = reader.tgread_object()
        _args['file'] = _val_file
        _val_file_name = reader.tgread_string()
        _args['file_name'] = _val_file_name
        _val_mime_type = reader.tgread_string()
        _args['mime_type'] = _val_mime_type
        return cls(**_args)


class UploadThemeRequest(TLRequest):
    """TL type: account.uploadTheme"""
    CONSTRUCTOR_ID = 0x1c3db333
    SUBCLASS_OF_ID = 0x211fe820

    def __init__(self, file: 'TypeInputFile', file_name: str, mime_type: str, thumb: Optional['TypeInputFile'] = None):
        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,
            'file_name': self.file_name,
            'mime_type': self.mime_type,
            'thumb': self.thumb,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.thumb is not None:
            flags |= (1 << 0)
        buf.write(struct.pack('<I', flags))
        buf.write(bytes(self.file))
        buf.write(TLObject.serialize_bytes(self.file_name))
        buf.write(TLObject.serialize_bytes(self.mime_type))
        if self.thumb is not None:
            buf.write(bytes(self.thumb))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        _val_file = reader.tgread_object()
        _args['file'] = _val_file
        if flags & (1 << 0):
            _val_thumb = reader.tgread_object()
            _args['thumb'] = _val_thumb
        else:
            _args['thumb'] = None
        _val_file_name = reader.tgread_string()
        _args['file_name'] = _val_file_name
        _val_mime_type = reader.tgread_string()
        _args['mime_type'] = _val_mime_type
        return cls(**_args)


class UploadWallPaperRequest(TLRequest):
    """TL type: account.uploadWallPaper"""
    CONSTRUCTOR_ID = 0xe39a8f03
    SUBCLASS_OF_ID = 0x96a2c98b

    def __init__(self, file: 'TypeInputFile', mime_type: str, settings: 'TypeWallPaperSettings', for_chat: Optional[bool] = None):
        self.file = file
        self.mime_type = mime_type
        self.settings = settings
        self.for_chat = for_chat

    def to_dict(self):
        return {
            '_': 'UploadWallPaperRequest',
            'file': self.file,
            'mime_type': self.mime_type,
            'settings': self.settings,
            'for_chat': self.for_chat,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        flags = 0
        if self.for_chat:
            flags |= (1 << 0)
        buf.write(struct.pack('<I', flags))
        buf.write(bytes(self.file))
        buf.write(TLObject.serialize_bytes(self.mime_type))
        buf.write(bytes(self.settings))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        flags = reader.read_int(signed=False)
        _args['for_chat'] = bool(flags & (1 << 0))
        _val_file = reader.tgread_object()
        _args['file'] = _val_file
        _val_mime_type = reader.tgread_string()
        _args['mime_type'] = _val_mime_type
        _val_settings = reader.tgread_object()
        _args['settings'] = _val_settings
        return cls(**_args)


class VerifyEmailRequest(TLRequest):
    """TL type: account.verifyEmail"""
    CONSTRUCTOR_ID = 0x032da4cf
    SUBCLASS_OF_ID = 0x64833188

    def __init__(self, purpose: 'TypeEmailVerifyPurpose', verification: 'TypeEmailVerification'):
        self.purpose = purpose
        self.verification = verification

    def to_dict(self):
        return {
            '_': 'VerifyEmailRequest',
            'purpose': self.purpose,
            'verification': self.verification,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.purpose))
        buf.write(bytes(self.verification))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_purpose = reader.tgread_object()
        _args['purpose'] = _val_purpose
        _val_verification = reader.tgread_object()
        _args['verification'] = _val_verification
        return cls(**_args)


class VerifyPhoneRequest(TLRequest):
    """TL type: account.verifyPhone"""
    CONSTRUCTOR_ID = 0x4dd3a7f6
    SUBCLASS_OF_ID = 0xf5b399ac

    def __init__(self, phone_number: str, phone_code_hash: str, phone_code: str):
        self.phone_number = phone_number
        self.phone_code_hash = phone_code_hash
        self.phone_code = phone_code

    def to_dict(self):
        return {
            '_': 'VerifyPhoneRequest',
            'phone_number': self.phone_number,
            'phone_code_hash': self.phone_code_hash,
            'phone_code': self.phone_code,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(TLObject.serialize_bytes(self.phone_number))
        buf.write(TLObject.serialize_bytes(self.phone_code_hash))
        buf.write(TLObject.serialize_bytes(self.phone_code))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_phone_number = reader.tgread_string()
        _args['phone_number'] = _val_phone_number
        _val_phone_code_hash = reader.tgread_string()
        _args['phone_code_hash'] = _val_phone_code_hash
        _val_phone_code = reader.tgread_string()
        _args['phone_code'] = _val_phone_code
        return cls(**_args)

