// <auto-generated/>
// ReSharper disable All

namespace MyTelegram.Schema;

///<summary>
/// Extended user infoWhen updating the <a href="https://corefork.telegram.org/api/peers">local peer database »</a>, all fields from the newly received constructor take priority over the old constructor cached locally (including by removing fields that aren't set in the new constructor).
/// See <a href="https://corefork.telegram.org/constructor/userFull" />
///</summary>
[TlObject(0x99e78045)]
public sealed class TUserFull : IUserFull
{
    public uint ConstructorId => 0x99e78045;
    ///<summary>
    /// Flags, see <a href="https://corefork.telegram.org/mtproto/TL-combinators#conditional-fields">TL conditional fields</a>
    ///</summary>
    public int Flags { get; set; }

    ///<summary>
    /// Whether you have blocked this user
    /// See <a href="https://corefork.telegram.org/type/true" />
    ///</summary>
    public bool Blocked { get; set; }

    ///<summary>
    /// Whether this user can make VoIP calls
    /// See <a href="https://corefork.telegram.org/type/true" />
    ///</summary>
    public bool PhoneCallsAvailable { get; set; }

    ///<summary>
    /// Whether this user's privacy settings allow you to call them
    /// See <a href="https://corefork.telegram.org/type/true" />
    ///</summary>
    public bool PhoneCallsPrivate { get; set; }

    ///<summary>
    /// Whether you can pin messages in the chat with this user, you can do this only for a chat with yourself
    /// See <a href="https://corefork.telegram.org/type/true" />
    ///</summary>
    public bool CanPinMessage { get; set; }

    ///<summary>
    /// Whether <a href="https://corefork.telegram.org/api/scheduled-messages">scheduled messages</a> are available
    /// See <a href="https://corefork.telegram.org/type/true" />
    ///</summary>
    public bool HasScheduled { get; set; }

    ///<summary>
    /// Whether the user can receive video calls
    /// See <a href="https://corefork.telegram.org/type/true" />
    ///</summary>
    public bool VideoCallsAvailable { get; set; }

    ///<summary>
    /// Whether this user doesn't allow sending voice messages in a private chat with them
    /// See <a href="https://corefork.telegram.org/type/true" />
    ///</summary>
    public bool VoiceMessagesForbidden { get; set; }

    ///<summary>
    /// Whether the <a href="https://corefork.telegram.org/api/translation">real-time chat translation popup</a> should be hidden.
    /// See <a href="https://corefork.telegram.org/type/true" />
    ///</summary>
    public bool TranslationsDisabled { get; set; }

    ///<summary>
    /// Whether this user has some <a href="https://corefork.telegram.org/api/stories#pinned-or-archived-stories">pinned stories</a>.
    /// See <a href="https://corefork.telegram.org/type/true" />
    ///</summary>
    public bool StoriesPinnedAvailable { get; set; }

    ///<summary>
    /// Whether we've <a href="https://corefork.telegram.org/api/block">blocked this user, preventing them from seeing our stories »</a>.
    /// See <a href="https://corefork.telegram.org/type/true" />
    ///</summary>
    public bool BlockedMyStoriesFrom { get; set; }

    ///<summary>
    /// Whether the other user has chosen a custom wallpaper for us using <a href="https://corefork.telegram.org/method/messages.setChatWallPaper">messages.setChatWallPaper</a> and the <code>for_both</code> flag, see <a href="https://corefork.telegram.org/api/wallpapers#installing-wallpapers-in-a-specific-chat-or-channel">here »</a> for more info.
    /// See <a href="https://corefork.telegram.org/type/true" />
    ///</summary>
    public bool WallpaperOverridden { get; set; }

    ///<summary>
    /// If set, we cannot write to this user: subscribe to <a href="https://corefork.telegram.org/api/premium">Telegram Premium</a> to get permission to write to this user. <br>To set this flag for ourselves invoke <a href="https://corefork.telegram.org/method/account.setGlobalPrivacySettings">account.setGlobalPrivacySettings</a>, setting the <code>settings.new_noncontact_peers_require_premium</code> flag, see <a href="https://corefork.telegram.org/api/privacy#require-premium-for-new-non-contact-users">here »</a> for more info.
    /// See <a href="https://corefork.telegram.org/type/true" />
    ///</summary>
    public bool ContactRequirePremium { get; set; }

    ///<summary>
    /// If set, we cannot fetch the exact read date of messages we send to this user using <a href="https://corefork.telegram.org/method/messages.getOutboxReadDate">messages.getOutboxReadDate</a>.  <br>The exact read date of messages might still be unavailable for other reasons, see <a href="https://corefork.telegram.org/method/messages.getOutboxReadDate">here »</a> for more info.  <br>To set this flag for ourselves invoke <a href="https://corefork.telegram.org/method/account.setGlobalPrivacySettings">account.setGlobalPrivacySettings</a>, setting the <code>settings.hide_read_marks</code> flag.
    /// See <a href="https://corefork.telegram.org/type/true" />
    ///</summary>
    public bool ReadDatesPrivate { get; set; }

    ///<summary>
    /// Flags, see <a href="https://corefork.telegram.org/mtproto/TL-combinators#conditional-fields">TL conditional fields</a>
    ///</summary>
    public int Flags2 { get; set; }

    ///<summary>
    /// Whether ads were re-enabled for the current account (only accessible to the currently logged-in user), see <a href="https://corefork.telegram.org/api/business#re-enable-ads">here »</a> for more info.
    /// See <a href="https://corefork.telegram.org/type/true" />
    ///</summary>
    public bool SponsoredEnabled { get; set; }

    ///<summary>
    /// If set, this user can view <a href="https://corefork.telegram.org/api/revenue#revenue-statistics">ad revenue statistics »</a> for this bot.
    /// See <a href="https://corefork.telegram.org/type/true" />
    ///</summary>
    public bool CanViewRevenue { get; set; }

    ///<summary>
    /// &nbsp;
    /// See <a href="https://corefork.telegram.org/type/true" />
    ///</summary>
    public bool BotCanManageEmojiStatus { get; set; }
    public bool DisplayGiftsButton { get; set; }

    ///<summary>
    /// User ID
    ///</summary>
    public long Id { get; set; }

    ///<summary>
    /// Bio of the user
    ///</summary>
    public string? About { get; set; }

    ///<summary>
    /// Peer settings
    /// See <a href="https://corefork.telegram.org/type/PeerSettings" />
    ///</summary>
    public MyTelegram.Schema.IPeerSettings Settings { get; set; }

    ///<summary>
    /// Personal profile photo, to be shown instead of <code>profile_photo</code>.
    /// See <a href="https://corefork.telegram.org/type/Photo" />
    ///</summary>
    public MyTelegram.Schema.IPhoto? PersonalPhoto { get; set; }

    ///<summary>
    /// Profile photo
    /// See <a href="https://corefork.telegram.org/type/Photo" />
    ///</summary>
    public MyTelegram.Schema.IPhoto? ProfilePhoto { get; set; }

    ///<summary>
    /// Fallback profile photo, displayed if no photo is present in <code>profile_photo</code> or <code>personal_photo</code>, due to privacy settings.
    /// See <a href="https://corefork.telegram.org/type/Photo" />
    ///</summary>
    public MyTelegram.Schema.IPhoto? FallbackPhoto { get; set; }

    ///<summary>
    /// Notification settings
    /// See <a href="https://corefork.telegram.org/type/PeerNotifySettings" />
    ///</summary>
    public MyTelegram.Schema.IPeerNotifySettings NotifySettings { get; set; }

    ///<summary>
    /// For bots, info about the bot (bot commands, etc)
    /// See <a href="https://corefork.telegram.org/type/BotInfo" />
    ///</summary>
    public MyTelegram.Schema.IBotInfo? BotInfo { get; set; }

    ///<summary>
    /// Message ID of the last <a href="https://corefork.telegram.org/api/pin">pinned message</a>
    ///</summary>
    public int? PinnedMsgId { get; set; }

    ///<summary>
    /// Chats in common with this user
    ///</summary>
    public int CommonChatsCount { get; set; }

    ///<summary>
    /// <a href="https://corefork.telegram.org/api/folders#peer-folders">Peer folder ID, for more info click here</a>
    ///</summary>
    public int? FolderId { get; set; }

    ///<summary>
    /// Time To Live of all messages in this chat; once a message is this many seconds old, it must be deleted.
    ///</summary>
    public int? TtlPeriod { get; set; }

    ///<summary>
    /// Emoji associated with chat theme
    ///</summary>
    public string? ThemeEmoticon { get; set; }

    ///<summary>
    /// Anonymized text to be shown instead of the user's name on forwarded messages
    ///</summary>
    public string? PrivateForwardName { get; set; }

    ///<summary>
    /// A <a href="https://corefork.telegram.org/api/rights#suggested-bot-rights">suggested set of administrator rights</a> for the bot, to be shown when adding the bot as admin to a group, see <a href="https://corefork.telegram.org/api/rights#suggested-bot-rights">here for more info on how to handle them »</a>.
    /// See <a href="https://corefork.telegram.org/type/ChatAdminRights" />
    ///</summary>
    public MyTelegram.Schema.IChatAdminRights? BotGroupAdminRights { get; set; }

    ///<summary>
    /// A <a href="https://corefork.telegram.org/api/rights#suggested-bot-rights">suggested set of administrator rights</a> for the bot, to be shown when adding the bot as admin to a channel, see <a href="https://corefork.telegram.org/api/rights#suggested-bot-rights">here for more info on how to handle them »</a>.
    /// See <a href="https://corefork.telegram.org/type/ChatAdminRights" />
    ///</summary>
    public MyTelegram.Schema.IChatAdminRights? BotBroadcastAdminRights { get; set; }

    ///<summary>
    /// <a href="https://corefork.telegram.org/api/wallpapers">Wallpaper</a> to use in the private chat with the user.
    /// See <a href="https://corefork.telegram.org/type/WallPaper" />
    ///</summary>
    public MyTelegram.Schema.IWallPaper? Wallpaper { get; set; }

    ///<summary>
    /// Active <a href="https://corefork.telegram.org/api/stories">stories »</a>
    /// See <a href="https://corefork.telegram.org/type/PeerStories" />
    ///</summary>
    public MyTelegram.Schema.IPeerStories? Stories { get; set; }

    ///<summary>
    /// <a href="https://corefork.telegram.org/api/business#opening-hours">Telegram Business working hours »</a>.
    /// See <a href="https://corefork.telegram.org/type/BusinessWorkHours" />
    ///</summary>
    public MyTelegram.Schema.IBusinessWorkHours? BusinessWorkHours { get; set; }

    ///<summary>
    /// <a href="https://corefork.telegram.org/api/business#location">Telegram Business location »</a>.
    /// See <a href="https://corefork.telegram.org/type/BusinessLocation" />
    ///</summary>
    public MyTelegram.Schema.IBusinessLocation? BusinessLocation { get; set; }

    ///<summary>
    /// <a href="https://corefork.telegram.org/api/business#greeting-messages">Telegram Business greeting message »</a>.
    /// See <a href="https://corefork.telegram.org/type/BusinessGreetingMessage" />
    ///</summary>
    public MyTelegram.Schema.IBusinessGreetingMessage? BusinessGreetingMessage { get; set; }

    ///<summary>
    /// <a href="https://corefork.telegram.org/api/business#away-messages">Telegram Business away message »</a>.
    /// See <a href="https://corefork.telegram.org/type/BusinessAwayMessage" />
    ///</summary>
    public MyTelegram.Schema.IBusinessAwayMessage? BusinessAwayMessage { get; set; }

    ///<summary>
    /// Specifies a custom <a href="https://corefork.telegram.org/api/business#business-introduction">Telegram Business profile introduction »</a>.
    /// See <a href="https://corefork.telegram.org/type/BusinessIntro" />
    ///</summary>
    public MyTelegram.Schema.IBusinessIntro? BusinessIntro { get; set; }

    ///<summary>
    /// Contains info about the user's <a href="https://corefork.telegram.org/api/profile#birthday">birthday »</a>.
    /// See <a href="https://corefork.telegram.org/type/Birthday" />
    ///</summary>
    public MyTelegram.Schema.IBirthday? Birthday { get; set; }

    ///<summary>
    /// ID of the associated personal <a href="https://corefork.telegram.org/api/channel">channel »</a>, that should be shown in the <a href="https://corefork.telegram.org/api/profile#personal-channel">profile page</a>.
    ///</summary>
    public long? PersonalChannelId { get; set; }

    ///<summary>
    /// ID of the latest message of the associated personal <a href="https://corefork.telegram.org/api/channel">channel »</a>, that should be previewed in the <a href="https://corefork.telegram.org/api/profile#personal-channel">profile page</a>.
    ///</summary>
    public int? PersonalChannelMessage { get; set; }

    ///<summary>
    /// Number of <a href="https://corefork.telegram.org/api/gifts">gifts</a> the user has chosen to display on their profile
    ///</summary>
    public int? StargiftsCount { get; set; }

    ///<summary>
    /// &nbsp;
    /// See <a href="https://corefork.telegram.org/type/StarRefProgram" />
    ///</summary>
    public MyTelegram.Schema.IStarRefProgram? StarrefProgram { get; set; }
    public MyTelegram.Schema.IBotVerification? BotVerification { get; set; }
    public long? SendPaidMessagesStars { get; set; }
    public MyTelegram.Schema.IDisallowedGiftsSettings? DisallowedGifts { get; set; }

    ///<summary>
    /// First song saved to the user's profile (Layer 213)
    /// See <a href="https://corefork.telegram.org/type/Document" />
    ///</summary>
    public MyTelegram.Schema.IDocument? SavedMusic { get; set; }

    public void ComputeFlag()
    {
        if (Blocked) { Flags = Flags.SetBit(0); }
        if (PhoneCallsAvailable) { Flags = Flags.SetBit(4); }
        if (PhoneCallsPrivate) { Flags = Flags.SetBit(5); }
        if (CanPinMessage) { Flags = Flags.SetBit(7); }
        if (HasScheduled) { Flags = Flags.SetBit(12); }
        if (VideoCallsAvailable) { Flags = Flags.SetBit(13); }
        if (VoiceMessagesForbidden) { Flags = Flags.SetBit(20); }
        if (TranslationsDisabled) { Flags = Flags.SetBit(23); }
        if (StoriesPinnedAvailable) { Flags = Flags.SetBit(26); }
        if (BlockedMyStoriesFrom) { Flags = Flags.SetBit(27); }
        if (WallpaperOverridden) { Flags = Flags.SetBit(28); }
        if (ContactRequirePremium) { Flags = Flags.SetBit(29); }
        if (ReadDatesPrivate) { Flags = Flags.SetBit(30); }
        if (SponsoredEnabled) { Flags2 = Flags2.SetBit(7); }
        if (CanViewRevenue) { Flags2 = Flags2.SetBit(9); }
        if (BotCanManageEmojiStatus) { Flags2 = Flags2.SetBit(10); }
        if (DisplayGiftsButton) { Flags2 = Flags2.SetBit(16); }
        if (About != null) { Flags = Flags.SetBit(1); }
        if (PersonalPhoto != null) { Flags = Flags.SetBit(21); }
        if (ProfilePhoto != null) { Flags = Flags.SetBit(2); }
        if (FallbackPhoto != null) { Flags = Flags.SetBit(22); }
        if (BotInfo != null) { Flags = Flags.SetBit(3); }
        if (/*PinnedMsgId != 0 && */PinnedMsgId.HasValue) { Flags = Flags.SetBit(6); }
        if (/*FolderId != 0 && */FolderId.HasValue) { Flags = Flags.SetBit(11); }
        if (/*TtlPeriod != 0 && */TtlPeriod.HasValue) { Flags = Flags.SetBit(14); }
        if (ThemeEmoticon != null) { Flags = Flags.SetBit(15); }
        if (PrivateForwardName != null) { Flags = Flags.SetBit(16); }
        if (BotGroupAdminRights != null) { Flags = Flags.SetBit(17); }
        if (BotBroadcastAdminRights != null) { Flags = Flags.SetBit(18); }
        if (Wallpaper != null) { Flags = Flags.SetBit(24); }
        if (Stories != null) { Flags = Flags.SetBit(25); }
        if (BusinessWorkHours != null) { Flags2 = Flags2.SetBit(0); }
        if (BusinessLocation != null) { Flags2 = Flags2.SetBit(1); }
        if (BusinessGreetingMessage != null) { Flags2 = Flags2.SetBit(2); }
        if (BusinessAwayMessage != null) { Flags2 = Flags2.SetBit(3); }
        if (BusinessIntro != null) { Flags2 = Flags2.SetBit(4); }
        if (Birthday != null) { Flags2 = Flags2.SetBit(5); }
        if (/*PersonalChannelId != 0 &&*/ PersonalChannelId.HasValue) { Flags2 = Flags2.SetBit(6); }
        if (/*PersonalChannelMessage != 0 && */PersonalChannelMessage.HasValue) { Flags2 = Flags2.SetBit(6); }
        if (/*StargiftsCount != 0 && */StargiftsCount.HasValue) { Flags2 = Flags2.SetBit(8); }
        if (StarrefProgram != null) { Flags2 = Flags2.SetBit(11); }
        if (BotVerification != null) { Flags2 = Flags2.SetBit(12); }
        if (/*SendPaidMessagesStars != 0 &&*/ SendPaidMessagesStars.HasValue) { Flags2 = Flags2.SetBit(14); }
        if (DisallowedGifts != null) { Flags2 = Flags2.SetBit(15); }
        if (SavedMusic != null) { Flags2 = Flags2.SetBit(21); }
    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Flags);
        writer.Write(Flags2);
        writer.Write(Id);
        if (Flags.IsBitSet(1)) { writer.Write(About); }
        writer.Write(Settings);
        if (Flags.IsBitSet(21)) { writer.Write(PersonalPhoto); }
        if (Flags.IsBitSet(2)) { writer.Write(ProfilePhoto); }
        if (Flags.IsBitSet(22)) { writer.Write(FallbackPhoto); }
        writer.Write(NotifySettings);
        if (Flags.IsBitSet(3)) { writer.Write(BotInfo); }
        if (Flags.IsBitSet(6)) { writer.Write(PinnedMsgId.Value); }
        writer.Write(CommonChatsCount);
        if (Flags.IsBitSet(11)) { writer.Write(FolderId.Value); }
        if (Flags.IsBitSet(14)) { writer.Write(TtlPeriod.Value); }
        if (Flags.IsBitSet(15)) { writer.Write(ThemeEmoticon); }
        if (Flags.IsBitSet(16)) { writer.Write(PrivateForwardName); }
        if (Flags.IsBitSet(17)) { writer.Write(BotGroupAdminRights); }
        if (Flags.IsBitSet(18)) { writer.Write(BotBroadcastAdminRights); }
        if (Flags.IsBitSet(24)) { writer.Write(Wallpaper); }
        if (Flags.IsBitSet(25)) { writer.Write(Stories); }
        if (Flags2.IsBitSet(0)) { writer.Write(BusinessWorkHours); }
        if (Flags2.IsBitSet(1)) { writer.Write(BusinessLocation); }
        if (Flags2.IsBitSet(2)) { writer.Write(BusinessGreetingMessage); }
        if (Flags2.IsBitSet(3)) { writer.Write(BusinessAwayMessage); }
        if (Flags2.IsBitSet(4)) { writer.Write(BusinessIntro); }
        if (Flags2.IsBitSet(5)) { writer.Write(Birthday); }
        if (Flags2.IsBitSet(6)) { writer.Write(PersonalChannelId.Value); }
        if (Flags2.IsBitSet(6)) { writer.Write(PersonalChannelMessage.Value); }
        if (Flags2.IsBitSet(8)) { writer.Write(StargiftsCount.Value); }
        if (Flags2.IsBitSet(11)) { writer.Write(StarrefProgram); }
        if (Flags2.IsBitSet(12)) { writer.Write(BotVerification); }
        if (Flags2.IsBitSet(14)) { writer.Write(SendPaidMessagesStars.Value); }
        if (Flags2.IsBitSet(15)) { writer.Write(DisallowedGifts); }
        if (Flags2.IsBitSet(21)) { writer.Write(SavedMusic); }
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Flags = buffer.ReadInt32();
        if (Flags.IsBitSet(0)) { Blocked = true; }
        if (Flags.IsBitSet(4)) { PhoneCallsAvailable = true; }
        if (Flags.IsBitSet(5)) { PhoneCallsPrivate = true; }
        if (Flags.IsBitSet(7)) { CanPinMessage = true; }
        if (Flags.IsBitSet(12)) { HasScheduled = true; }
        if (Flags.IsBitSet(13)) { VideoCallsAvailable = true; }
        if (Flags.IsBitSet(20)) { VoiceMessagesForbidden = true; }
        if (Flags.IsBitSet(23)) { TranslationsDisabled = true; }
        if (Flags.IsBitSet(26)) { StoriesPinnedAvailable = true; }
        if (Flags.IsBitSet(27)) { BlockedMyStoriesFrom = true; }
        if (Flags.IsBitSet(28)) { WallpaperOverridden = true; }
        if (Flags.IsBitSet(29)) { ContactRequirePremium = true; }
        if (Flags.IsBitSet(30)) { ReadDatesPrivate = true; }
        Flags2 = buffer.ReadInt32();
        if (Flags2.IsBitSet(7)) { SponsoredEnabled = true; }
        if (Flags2.IsBitSet(9)) { CanViewRevenue = true; }
        if (Flags2.IsBitSet(10)) { BotCanManageEmojiStatus = true; }
        if (Flags2.IsBitSet(16)) { DisplayGiftsButton = true; }
        Id = buffer.ReadInt64();
        if (Flags.IsBitSet(1)) { About = buffer.ReadString(); }
        Settings = buffer.Read<MyTelegram.Schema.IPeerSettings>();
        if (Flags.IsBitSet(21)) { PersonalPhoto = buffer.Read<MyTelegram.Schema.IPhoto>(); }
        if (Flags.IsBitSet(2)) { ProfilePhoto = buffer.Read<MyTelegram.Schema.IPhoto>(); }
        if (Flags.IsBitSet(22)) { FallbackPhoto = buffer.Read<MyTelegram.Schema.IPhoto>(); }
        NotifySettings = buffer.Read<MyTelegram.Schema.IPeerNotifySettings>();
        if (Flags.IsBitSet(3)) { BotInfo = buffer.Read<MyTelegram.Schema.IBotInfo>(); }
        if (Flags.IsBitSet(6)) { PinnedMsgId = buffer.ReadInt32(); }
        CommonChatsCount = buffer.ReadInt32();
        if (Flags.IsBitSet(11)) { FolderId = buffer.ReadInt32(); }
        if (Flags.IsBitSet(14)) { TtlPeriod = buffer.ReadInt32(); }
        if (Flags.IsBitSet(15)) { ThemeEmoticon = buffer.ReadString(); }
        if (Flags.IsBitSet(16)) { PrivateForwardName = buffer.ReadString(); }
        if (Flags.IsBitSet(17)) { BotGroupAdminRights = buffer.Read<MyTelegram.Schema.IChatAdminRights>(); }
        if (Flags.IsBitSet(18)) { BotBroadcastAdminRights = buffer.Read<MyTelegram.Schema.IChatAdminRights>(); }
        if (Flags.IsBitSet(24)) { Wallpaper = buffer.Read<MyTelegram.Schema.IWallPaper>(); }
        if (Flags.IsBitSet(25)) { Stories = buffer.Read<MyTelegram.Schema.IPeerStories>(); }
        if (Flags2.IsBitSet(0)) { BusinessWorkHours = buffer.Read<MyTelegram.Schema.IBusinessWorkHours>(); }
        if (Flags2.IsBitSet(1)) { BusinessLocation = buffer.Read<MyTelegram.Schema.IBusinessLocation>(); }
        if (Flags2.IsBitSet(2)) { BusinessGreetingMessage = buffer.Read<MyTelegram.Schema.IBusinessGreetingMessage>(); }
        if (Flags2.IsBitSet(3)) { BusinessAwayMessage = buffer.Read<MyTelegram.Schema.IBusinessAwayMessage>(); }
        if (Flags2.IsBitSet(4)) { BusinessIntro = buffer.Read<MyTelegram.Schema.IBusinessIntro>(); }
        if (Flags2.IsBitSet(5)) { Birthday = buffer.Read<MyTelegram.Schema.IBirthday>(); }
        if (Flags2.IsBitSet(6)) { PersonalChannelId = buffer.ReadInt64(); }
        if (Flags2.IsBitSet(6)) { PersonalChannelMessage = buffer.ReadInt32(); }
        if (Flags2.IsBitSet(8)) { StargiftsCount = buffer.ReadInt32(); }
        if (Flags2.IsBitSet(11)) { StarrefProgram = buffer.Read<MyTelegram.Schema.IStarRefProgram>(); }
        if (Flags2.IsBitSet(12)) { BotVerification = buffer.Read<MyTelegram.Schema.IBotVerification>(); }
        if (Flags2.IsBitSet(14)) { SendPaidMessagesStars = buffer.ReadInt64(); }
        if (Flags2.IsBitSet(15)) { DisallowedGifts = buffer.Read<MyTelegram.Schema.IDisallowedGiftsSettings>(); }
        if (Flags2.IsBitSet(21)) { SavedMusic = buffer.Read<MyTelegram.Schema.IDocument>(); }
    }
}